OSDN Git Service

33070a099ec23c8d6d4c028c5d837573a08ef625
[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
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
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{-dr} is very different from @w{@samp{-d
101 -r}}.
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 * Running Protoize::    Automatically adding or removing function prototypes.
152 @end menu
153
154 @c man begin OPTIONS
155
156 @node Option Summary
157 @section Option Summary
158
159 Here is a summary of all the options, grouped by type.  Explanations are
160 in the following sections.
161
162 @table @emph
163 @item Overall Options
164 @xref{Overall Options,,Options Controlling the Kind of Output}.
165 @gccoptlist{-c  -S  -E  -o @var{file}  -combine  -pipe  -pass-exit-codes  @gol
166 -x @var{language}  -v  -###  --help@r{[}=@var{class}@r{]}  --target-help  @gol
167 --version -wrapper@@@var{file}}
168
169 @item C Language Options
170 @xref{C Dialect Options,,Options Controlling C Dialect}.
171 @gccoptlist{-ansi  -std=@var{standard}  -fgnu89-inline @gol
172 -aux-info @var{filename} @gol
173 -fno-asm  -fno-builtin  -fno-builtin-@var{function} @gol
174 -fhosted  -ffreestanding -fopenmp -fms-extensions @gol
175 -trigraphs  -no-integrated-cpp  -traditional  -traditional-cpp @gol
176 -fallow-single-precision  -fcond-mismatch -flax-vector-conversions @gol
177 -fsigned-bitfields  -fsigned-char @gol
178 -funsigned-bitfields  -funsigned-char}
179
180 @item C++ Language Options
181 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}.
182 @gccoptlist{-fabi-version=@var{n}  -fno-access-control  -fcheck-new @gol
183 -fconserve-space  -ffriend-injection @gol
184 -fno-elide-constructors @gol
185 -fno-enforce-eh-specs @gol
186 -ffor-scope  -fno-for-scope  -fno-gnu-keywords @gol
187 -fno-implicit-templates @gol
188 -fno-implicit-inline-templates @gol
189 -fno-implement-inlines  -fms-extensions @gol
190 -fno-nonansi-builtins  -fno-operator-names @gol
191 -fno-optional-diags  -fpermissive @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 -Wc++-compat -Wc++0x-compat -Wcast-align  -Wcast-qual  @gol
232 -Wchar-subscripts -Wclobbered  -Wcomment @gol
233 -Wconversion  -Wcoverage-mismatch  -Wno-deprecated  @gol
234 -Wno-deprecated-declarations -Wdisabled-optimization  @gol
235 -Wdisallowed-function-list=@var{sym},@var{sym},@dots{} @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} -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  -Wpadded @gol
252 -Wparentheses  -Wpointer-arith  -Wno-pointer-to-int-cast @gol
253 -Wredundant-decls @gol
254 -Wreturn-type  -Wsequence-point  -Wshadow @gol
255 -Wsign-compare  -Wsign-conversion  -Wstack-protector @gol
256 -Wstrict-aliasing -Wstrict-aliasing=n @gol
257 -Wstrict-overflow -Wstrict-overflow=@var{n} @gol
258 -Wswitch  -Wswitch-default  -Wswitch-enum @gol
259 -Wsystem-headers  -Wtrigraphs  -Wtype-limits  -Wundef  -Wuninitialized @gol
260 -Wunknown-pragmas  -Wno-pragmas -Wunreachable-code @gol
261 -Wunused  -Wunused-function  -Wunused-label  -Wunused-parameter @gol
262 -Wunused-value  -Wunused-variable @gol
263 -Wvariadic-macros -Wvla @gol
264 -Wvolatile-register-var  -Wwrite-strings}
265
266 @item C and Objective-C-only Warning Options
267 @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
268 -Wmissing-parameter-type  -Wmissing-prototypes  -Wnested-externs @gol
269 -Wold-style-declaration  -Wold-style-definition @gol
270 -Wstrict-prototypes  -Wtraditional  -Wtraditional-conversion @gol
271 -Wdeclaration-after-statement -Wpointer-sign}
272
273 @item Debugging Options
274 @xref{Debugging Options,,Options for Debugging Your Program or GCC}.
275 @gccoptlist{-d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
276 -fdbg-cnt-list -fdbg-cnt=@var{counter-value-list} @gol
277 -fdump-noaddr -fdump-unnumbered @gol
278 -fdump-translation-unit@r{[}-@var{n}@r{]} @gol
279 -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
280 -fdump-ipa-all -fdump-ipa-cgraph -fdump-ipa-inline @gol
281 -fdump-statistics @gol
282 -fdump-tree-all @gol
283 -fdump-tree-original@r{[}-@var{n}@r{]}  @gol
284 -fdump-tree-optimized@r{[}-@var{n}@r{]} @gol
285 -fdump-tree-cfg -fdump-tree-vcg -fdump-tree-alias @gol
286 -fdump-tree-ch @gol
287 -fdump-tree-ssa@r{[}-@var{n}@r{]} -fdump-tree-pre@r{[}-@var{n}@r{]} @gol
288 -fdump-tree-ccp@r{[}-@var{n}@r{]} -fdump-tree-dce@r{[}-@var{n}@r{]} @gol
289 -fdump-tree-gimple@r{[}-raw@r{]} -fdump-tree-mudflap@r{[}-@var{n}@r{]} @gol
290 -fdump-tree-dom@r{[}-@var{n}@r{]} @gol
291 -fdump-tree-dse@r{[}-@var{n}@r{]} @gol
292 -fdump-tree-phiopt@r{[}-@var{n}@r{]} @gol
293 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
294 -fdump-tree-copyrename@r{[}-@var{n}@r{]} @gol
295 -fdump-tree-nrv -fdump-tree-vect @gol
296 -fdump-tree-sink @gol
297 -fdump-tree-sra@r{[}-@var{n}@r{]} @gol
298 -fdump-tree-fre@r{[}-@var{n}@r{]} @gol
299 -fdump-tree-vrp@r{[}-@var{n}@r{]} @gol
300 -ftree-vectorizer-verbose=@var{n} @gol
301 -fdump-tree-storeccp@r{[}-@var{n}@r{]} @gol
302 -feliminate-dwarf2-dups -feliminate-unused-debug-types @gol
303 -feliminate-unused-debug-symbols -femit-class-debug-always @gol
304 -fmem-report -fpre-ipa-mem-report -fpost-ipa-mem-report -fprofile-arcs @gol
305 -frandom-seed=@var{string} -fsched-verbose=@var{n} @gol
306 -fsel-sched-verbose -fsel-sched-dump-cfg -fsel-sched-pipelining-verbose @gol
307 -ftest-coverage  -ftime-report -fvar-tracking @gol
308 -g  -g@var{level}  -gcoff -gdwarf-2 @gol
309 -ggdb  -gstabs  -gstabs+  -gvms  -gxcoff  -gxcoff+ @gol
310 -fno-merge-debug-strings -fdebug-prefix-map=@var{old}=@var{new} @gol
311 -femit-struct-debug-baseonly -femit-struct-debug-reduced @gol
312 -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol
313 -p  -pg  -print-file-name=@var{library}  -print-libgcc-file-name @gol
314 -print-multi-directory  -print-multi-lib @gol
315 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
316 -print-sysroot -print-sysroot-headers-suffix @gol
317 -save-temps  -time}
318
319 @item Optimization Options
320 @xref{Optimize Options,,Options that Control Optimization}.
321 @gccoptlist{
322 -falign-functions[=@var{n}] -falign-jumps[=@var{n}] @gol
323 -falign-labels[=@var{n}] -falign-loops[=@var{n}] -fassociative-math @gol
324 -fauto-inc-dec -fbranch-probabilities -fbranch-target-load-optimize @gol
325 -fbranch-target-load-optimize2 -fbtr-bb-exclusive -fcaller-saves @gol
326 -fcheck-data-deps -fcprop-registers -fcrossjumping -fcse-follow-jumps @gol
327 -fcse-skip-blocks -fcx-fortran-rules -fcx-limited-range @gol
328 -fdata-sections -fdce -fdce @gol
329 -fdelayed-branch -fdelete-null-pointer-checks -fdse -fdse @gol
330 -fearly-inlining -fexpensive-optimizations -ffast-math @gol
331 -ffinite-math-only -ffloat-store -fforward-propagate @gol
332 -ffunction-sections -fgcse -fgcse-after-reload -fgcse-las -fgcse-lm @gol
333 -fgcse-sm -fif-conversion -fif-conversion2 -findirect-inlining @gol
334 -finline-functions -finline-functions-called-once -finline-limit=@var{n} @gol
335 -finline-small-functions -fipa-cp -fipa-cp-clone -fipa-marix-reorg -fipa-pta @gol 
336 -fipa-pure-const -fipa-reference -fipa-struct-reorg @gol
337 -fipa-type-escape -fira -fira-algorithm=@var{algorithm} @gol
338 -fira-coalesce -fno-ira-share-save-slots @gol
339 -fno-ira-share-spill-slots -fira-verbose=@var{n} @gol
340 -fivopts -fkeep-inline-functions -fkeep-static-consts @gol
341 -fmerge-all-constants -fmerge-constants -fmodulo-sched @gol
342 -fmodulo-sched-allow-regmoves -fmove-loop-invariants -fmudflap @gol
343 -fmudflapir -fmudflapth -fno-branch-count-reg -fno-default-inline @gol
344 -fno-defer-pop -fno-function-cse -fno-guess-branch-probability @gol
345 -fno-inline -fno-math-errno -fno-peephole -fno-peephole2 @gol
346 -fno-sched-interblock -fno-sched-spec -fno-signed-zeros @gol
347 -fno-toplevel-reorder -fno-trapping-math -fno-zero-initialized-in-bss @gol
348 -fomit-frame-pointer -foptimize-register-move -foptimize-sibling-calls @gol
349 -fpeel-loops -fpredictive-commoning -fprefetch-loop-arrays @gol
350 -fprofile-correction -fprofile-dir=@var{path} -fprofile-generate @gol
351 -fprofile-generate=@var{path} @gol
352 -fprofile-use -fprofile-use=@var{path} -fprofile-values @gol
353 -freciprocal-math -fregmove -frename-registers -freorder-blocks @gol
354 -freorder-blocks-and-partition -freorder-functions @gol
355 -frerun-cse-after-loop -freschedule-modulo-scheduled-loops @gol
356 -frounding-math -frtl-abstract-sequences -fsched2-use-superblocks @gol
357 -fsched2-use-traces -fsched-spec-load -fsched-spec-load-dangerous @gol
358 -fsched-stalled-insns-dep[=@var{n}] -fsched-stalled-insns[=@var{n}] @gol
359 -fschedule-insns -fschedule-insns2 -fsection-anchors -fsee @gol
360 -fselective-scheduling -fselective-scheduling2 @gol
361 -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops @gol
362 -fsignaling-nans -fsingle-precision-constant -fsplit-ivs-in-unroller @gol
363 -fsplit-wide-types -fstack-protector -fstack-protector-all @gol
364 -fstrict-aliasing -fstrict-overflow -fthread-jumps -ftracer @gol
365 -ftree-builtin-call-dce -ftree-ccp -ftree-ch -ftree-copy-prop @gol
366 -ftree-copyrename -ftree-dce @gol
367 -ftree-dominator-opts -ftree-dse -ftree-fre -ftree-loop-im @gol
368 -ftree-loop-distribution @gol
369 -ftree-loop-ivcanon -ftree-loop-linear -ftree-loop-optimize @gol
370 -ftree-parallelize-loops=@var{n} -ftree-pre -ftree-reassoc @gol
371 -ftree-sink -ftree-sra -ftree-switch-conversion @gol
372 -ftree-ter -ftree-vect-loop-version -ftree-vectorize -ftree-vrp @gol
373 -funit-at-a-time -funroll-all-loops -funroll-loops @gol
374 -funsafe-loop-optimizations -funsafe-math-optimizations -funswitch-loops @gol
375 -fvariable-expansion-in-unroller -fvect-cost-model -fvpt -fweb @gol
376 -fwhole-program @gol
377 --param @var{name}=@var{value}
378 -O  -O0  -O1  -O2  -O3  -Os}
379
380 @item Preprocessor Options
381 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
382 @gccoptlist{-A@var{question}=@var{answer} @gol
383 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
384 -C  -dD  -dI  -dM  -dN @gol
385 -D@var{macro}@r{[}=@var{defn}@r{]}  -E  -H @gol
386 -idirafter @var{dir} @gol
387 -include @var{file}  -imacros @var{file} @gol
388 -iprefix @var{file}  -iwithprefix @var{dir} @gol
389 -iwithprefixbefore @var{dir}  -isystem @var{dir} @gol
390 -imultilib @var{dir} -isysroot @var{dir} @gol
391 -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  @gol
392 -P  -fworking-directory  -remap @gol
393 -trigraphs  -undef  -U@var{macro}  -Wp,@var{option} @gol
394 -Xpreprocessor @var{option}}
395
396 @item Assembler Option
397 @xref{Assembler Options,,Passing Options to the Assembler}.
398 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
399
400 @item Linker Options
401 @xref{Link Options,,Options for Linking}.
402 @gccoptlist{@var{object-file-name}  -l@var{library} @gol
403 -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic @gol
404 -s  -static  -static-libgcc  -shared  -shared-libgcc  -symbolic @gol
405 -Wl,@var{option}  -Xlinker @var{option} @gol
406 -u @var{symbol}}
407
408 @item Directory Options
409 @xref{Directory Options,,Options for Directory Search}.
410 @gccoptlist{-B@var{prefix}  -I@var{dir}  -iquote@var{dir}  -L@var{dir}
411 -specs=@var{file}  -I- --sysroot=@var{dir}}
412
413 @item Target Options
414 @c I wrote this xref this way to avoid overfull hbox. -- rms
415 @xref{Target Options}.
416 @gccoptlist{-V @var{version}  -b @var{machine}}
417
418 @item Machine Dependent Options
419 @xref{Submodel Options,,Hardware Models and Configurations}.
420 @c This list is ordered alphanumerically by subsection name.
421 @c Try and put the significant identifier (CPU or system) first,
422 @c so users have a clue at guessing where the ones they want will be.
423
424 @emph{ARC Options}
425 @gccoptlist{-EB  -EL @gol
426 -mmangle-cpu  -mcpu=@var{cpu}  -mtext=@var{text-section} @gol
427 -mdata=@var{data-section}  -mrodata=@var{readonly-data-section}}
428
429 @emph{ARM Options}
430 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
431 -mabi=@var{name} @gol
432 -mapcs-stack-check  -mno-apcs-stack-check @gol
433 -mapcs-float  -mno-apcs-float @gol
434 -mapcs-reentrant  -mno-apcs-reentrant @gol
435 -msched-prolog  -mno-sched-prolog @gol
436 -mlittle-endian  -mbig-endian  -mwords-little-endian @gol
437 -mfloat-abi=@var{name}  -msoft-float  -mhard-float  -mfpe @gol
438 -mthumb-interwork  -mno-thumb-interwork @gol
439 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
440 -mstructure-size-boundary=@var{n} @gol
441 -mabort-on-noreturn @gol
442 -mlong-calls  -mno-long-calls @gol
443 -msingle-pic-base  -mno-single-pic-base @gol
444 -mpic-register=@var{reg} @gol
445 -mnop-fun-dllimport @gol
446 -mcirrus-fix-invalid-insns -mno-cirrus-fix-invalid-insns @gol
447 -mpoke-function-name @gol
448 -mthumb  -marm @gol
449 -mtpcs-frame  -mtpcs-leaf-frame @gol
450 -mcaller-super-interworking  -mcallee-super-interworking @gol
451 -mtp=@var{name}}
452
453 @emph{AVR Options}
454 @gccoptlist{-mmcu=@var{mcu}  -msize  -minit-stack=@var{n}  -mno-interrupts @gol
455 -mcall-prologues  -mno-tablejump  -mtiny-stack  -mint8}
456
457 @emph{Blackfin Options}
458 @gccoptlist{-mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]} @gol
459 -msim -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
460 -mspecld-anomaly  -mno-specld-anomaly  -mcsync-anomaly  -mno-csync-anomaly @gol
461 -mlow-64k -mno-low64k  -mstack-check-l1  -mid-shared-library @gol
462 -mno-id-shared-library  -mshared-library-id=@var{n} @gol
463 -mleaf-id-shared-library  -mno-leaf-id-shared-library @gol
464 -msep-data  -mno-sep-data  -mlong-calls  -mno-long-calls @gol
465 -mfast-fp -minline-plt -mmulticore  -mcorea  -mcoreb  -msdram}
466
467 @emph{CRIS Options}
468 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
469 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
470 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
471 -mstack-align  -mdata-align  -mconst-align @gol
472 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
473 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
474 -mmul-bug-workaround  -mno-mul-bug-workaround}
475
476 @emph{CRX Options}
477 @gccoptlist{-mmac -mpush-args}
478
479 @emph{Darwin Options}
480 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
481 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
482 -client_name  -compatibility_version  -current_version @gol
483 -dead_strip @gol
484 -dependency-file  -dylib_file  -dylinker_install_name @gol
485 -dynamic  -dynamiclib  -exported_symbols_list @gol
486 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
487 -force_flat_namespace  -headerpad_max_install_names @gol
488 -iframework @gol
489 -image_base  -init  -install_name  -keep_private_externs @gol
490 -multi_module  -multiply_defined  -multiply_defined_unused @gol
491 -noall_load   -no_dead_strip_inits_and_terms @gol
492 -nofixprebinding -nomultidefs  -noprebind  -noseglinkedit @gol
493 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
494 -private_bundle  -read_only_relocs  -sectalign @gol
495 -sectobjectsymbols  -whyload  -seg1addr @gol
496 -sectcreate  -sectobjectsymbols  -sectorder @gol
497 -segaddr -segs_read_only_addr -segs_read_write_addr @gol
498 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
499 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
500 -single_module  -static  -sub_library  -sub_umbrella @gol
501 -twolevel_namespace  -umbrella  -undefined @gol
502 -unexported_symbols_list  -weak_reference_mismatches @gol
503 -whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} @gol
504 -mkernel -mone-byte-bool}
505
506 @emph{DEC Alpha Options}
507 @gccoptlist{-mno-fp-regs  -msoft-float  -malpha-as  -mgas @gol
508 -mieee  -mieee-with-inexact  -mieee-conformant @gol
509 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
510 -mtrap-precision=@var{mode}  -mbuild-constants @gol
511 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
512 -mbwx  -mmax  -mfix  -mcix @gol
513 -mfloat-vax  -mfloat-ieee @gol
514 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
515 -msmall-text  -mlarge-text @gol
516 -mmemory-latency=@var{time}}
517
518 @emph{DEC Alpha/VMS Options}
519 @gccoptlist{-mvms-return-codes}
520
521 @emph{FRV Options}
522 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
523 -mhard-float  -msoft-float @gol
524 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
525 -mdouble  -mno-double @gol
526 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
527 -mfdpic  -minline-plt -mgprel-ro  -multilib-library-pic @gol
528 -mlinked-fp  -mlong-calls  -malign-labels @gol
529 -mlibrary-pic  -macc-4  -macc-8 @gol
530 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
531 -moptimize-membar -mno-optimize-membar @gol
532 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
533 -mvliw-branch  -mno-vliw-branch @gol
534 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
535 -mno-nested-cond-exec  -mtomcat-stats @gol
536 -mTLS -mtls @gol
537 -mcpu=@var{cpu}}
538
539 @emph{GNU/Linux Options}
540 @gccoptlist{-muclibc}
541
542 @emph{H8/300 Options}
543 @gccoptlist{-mrelax  -mh  -ms  -mn  -mint32  -malign-300}
544
545 @emph{HPPA Options}
546 @gccoptlist{-march=@var{architecture-type} @gol
547 -mbig-switch  -mdisable-fpregs  -mdisable-indexing @gol
548 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
549 -mfixed-range=@var{register-range} @gol
550 -mjump-in-delay -mlinker-opt -mlong-calls @gol
551 -mlong-load-store  -mno-big-switch  -mno-disable-fpregs @gol
552 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
553 -mno-jump-in-delay  -mno-long-load-store @gol
554 -mno-portable-runtime  -mno-soft-float @gol
555 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
556 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
557 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
558 -munix=@var{unix-std}  -nolibdld  -static  -threads}
559
560 @emph{i386 and x86-64 Options}
561 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
562 -mfpmath=@var{unit} @gol
563 -masm=@var{dialect}  -mno-fancy-math-387 @gol
564 -mno-fp-ret-in-387  -msoft-float @gol
565 -mno-wide-multiply  -mrtd  -malign-double @gol
566 -mpreferred-stack-boundary=@var{num}
567 -mincoming-stack-boundary=@var{num}
568 -mcld -mcx16 -msahf -mrecip @gol
569 -mmmx  -msse  -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -msse4 -mavx @gol
570 -maes -mpclmul @gol
571 -msse4a -m3dnow -mpopcnt -mabm -msse5 @gol
572 -mthreads  -mno-align-stringops  -minline-all-stringops @gol
573 -minline-stringops-dynamically -mstringop-strategy=@var{alg} @gol
574 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
575 -m96bit-long-double  -mregparm=@var{num}  -msseregparm @gol
576 -mveclibabi=@var{type} -mpc32 -mpc64 -mpc80 -mstackrealign @gol
577 -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs @gol
578 -mcmodel=@var{code-model} @gol
579 -m32  -m64 -mlarge-data-threshold=@var{num} @gol
580 -mfused-madd -mno-fused-madd}
581
582 @emph{IA-64 Options}
583 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
584 -mvolatile-asm-stop  -mregister-names  -mno-sdata @gol
585 -mconstant-gp  -mauto-pic  -minline-float-divide-min-latency @gol
586 -minline-float-divide-max-throughput @gol
587 -minline-int-divide-min-latency @gol
588 -minline-int-divide-max-throughput  @gol
589 -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
590 -mno-dwarf2-asm -mearly-stop-bits @gol
591 -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
592 -mtune=@var{cpu-type} -mt -pthread -milp32 -mlp64 @gol
593 -mno-sched-br-data-spec -msched-ar-data-spec -mno-sched-control-spec @gol
594 -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec @gol
595 -msched-ldc -mno-sched-control-ldc -mno-sched-spec-verbose @gol
596 -mno-sched-prefer-non-data-spec-insns @gol
597 -mno-sched-prefer-non-control-spec-insns @gol
598 -mno-sched-count-spec-in-critical-path}
599
600 @emph{M32R/D Options}
601 @gccoptlist{-m32r2 -m32rx -m32r @gol
602 -mdebug @gol
603 -malign-loops -mno-align-loops @gol
604 -missue-rate=@var{number} @gol
605 -mbranch-cost=@var{number} @gol
606 -mmodel=@var{code-size-model-type} @gol
607 -msdata=@var{sdata-type} @gol
608 -mno-flush-func -mflush-func=@var{name} @gol
609 -mno-flush-trap -mflush-trap=@var{number} @gol
610 -G @var{num}}
611
612 @emph{M32C Options}
613 @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
614
615 @emph{M680x0 Options}
616 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu}  -mtune=@var{tune}
617 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
618 -m68060  -mcpu32  -m5200  -m5206e  -m528x  -m5307  -m5407 @gol
619 -mcfv4e  -mbitfield  -mno-bitfield  -mc68000  -mc68020 @gol
620 -mnobitfield  -mrtd  -mno-rtd  -mdiv  -mno-div  -mshort @gol
621 -mno-short  -mhard-float  -m68881  -msoft-float  -mpcrel @gol
622 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
623 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library @gol
624 -mxgot -mno-xgot}
625
626 @emph{M68hc1x Options}
627 @gccoptlist{-m6811  -m6812  -m68hc11  -m68hc12   -m68hcs12 @gol
628 -mauto-incdec  -minmax  -mlong-calls  -mshort @gol
629 -msoft-reg-count=@var{count}}
630
631 @emph{MCore Options}
632 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
633 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
634 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
635 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
636 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
637
638 @emph{MIPS Options}
639 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
640 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2 @gol
641 -mips64  -mips64r2 @gol
642 -mips16  -mno-mips16  -mflip-mips16 @gol
643 -minterlink-mips16  -mno-interlink-mips16 @gol
644 -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
645 -mshared  -mno-shared  -mplt  -mno-plt  -mxgot  -mno-xgot @gol
646 -mgp32  -mgp64  -mfp32  -mfp64  -mhard-float  -msoft-float @gol
647 -msingle-float  -mdouble-float  -mdsp  -mno-dsp  -mdspr2  -mno-dspr2 @gol
648 -msmartmips  -mno-smartmips @gol
649 -mpaired-single  -mno-paired-single  -mdmx  -mno-mdmx @gol
650 -mips3d  -mno-mips3d  -mmt  -mno-mt  -mllsc  -mno-llsc @gol
651 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
652 -G@var{num}  -mlocal-sdata  -mno-local-sdata @gol
653 -mextern-sdata  -mno-extern-sdata  -mgpopt  -mno-gopt @gol
654 -membedded-data  -mno-embedded-data @gol
655 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
656 -mcode-readable=@var{setting} @gol
657 -msplit-addresses  -mno-split-addresses @gol
658 -mexplicit-relocs  -mno-explicit-relocs @gol
659 -mcheck-zero-division  -mno-check-zero-division @gol
660 -mdivide-traps  -mdivide-breaks @gol
661 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
662 -mmad  -mno-mad  -mfused-madd  -mno-fused-madd  -nocpp @gol
663 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
664 -mfix-vr4120  -mno-fix-vr4120  -mfix-vr4130  -mno-fix-vr4130 @gol
665 -mfix-sb1  -mno-fix-sb1 @gol
666 -mflush-func=@var{func}  -mno-flush-func @gol
667 -mbranch-cost=@var{num}  -mbranch-likely  -mno-branch-likely @gol
668 -mfp-exceptions -mno-fp-exceptions @gol
669 -mvr4130-align -mno-vr4130-align}
670
671 @emph{MMIX Options}
672 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
673 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
674 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
675 -mno-base-addresses  -msingle-exit  -mno-single-exit}
676
677 @emph{MN10300 Options}
678 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
679 -mam33  -mno-am33 @gol
680 -mam33-2  -mno-am33-2 @gol
681 -mreturn-pointer-on-d0 @gol
682 -mno-crt0  -mrelax}
683
684 @emph{PDP-11 Options}
685 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
686 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
687 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
688 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
689 -mbranch-expensive  -mbranch-cheap @gol
690 -msplit  -mno-split  -munix-asm  -mdec-asm}
691
692 @emph{PowerPC Options}
693 See RS/6000 and PowerPC Options.
694
695 @emph{RS/6000 and PowerPC Options}
696 @gccoptlist{-mcpu=@var{cpu-type} @gol
697 -mtune=@var{cpu-type} @gol
698 -mpower  -mno-power  -mpower2  -mno-power2 @gol
699 -mpowerpc  -mpowerpc64  -mno-powerpc @gol
700 -maltivec  -mno-altivec @gol
701 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
702 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
703 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb  -mfprnd  -mno-fprnd @gol
704 -mcmpb -mno-cmpb -mmfpgpr -mno-mfpgpr -mhard-dfp -mno-hard-dfp @gol
705 -mnew-mnemonics  -mold-mnemonics @gol
706 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
707 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
708 -malign-power  -malign-natural @gol
709 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
710 -mstring  -mno-string  -mupdate  -mno-update @gol
711 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
712 -mstrict-align  -mno-strict-align  -mrelocatable @gol
713 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
714 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
715 -mdynamic-no-pic  -maltivec  -mswdiv @gol
716 -mprioritize-restricted-insns=@var{priority} @gol
717 -msched-costly-dep=@var{dependence_type} @gol
718 -minsert-sched-nops=@var{scheme} @gol
719 -mcall-sysv  -mcall-netbsd @gol
720 -maix-struct-return  -msvr4-struct-return @gol
721 -mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
722 -misel -mno-isel @gol
723 -misel=yes  -misel=no @gol
724 -mspe -mno-spe @gol
725 -mspe=yes  -mspe=no @gol
726 -mpaired @gol
727 -mvrsave -mno-vrsave @gol
728 -mmulhw -mno-mulhw @gol
729 -mdlmzb -mno-dlmzb @gol
730 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
731 -mprototype  -mno-prototype @gol
732 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
733 -msdata=@var{opt}  -mvxworks  -G @var{num}  -pthread}
734
735 @emph{S/390 and zSeries Options}
736 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
737 -mhard-float  -msoft-float -mlong-double-64 -mlong-double-128 @gol
738 -mbackchain  -mno-backchain -mpacked-stack  -mno-packed-stack @gol
739 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
740 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
741 -mtpf-trace -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
742 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size -mstack-guard}
743
744 @emph{Score Options}
745 @gccoptlist{-meb -mel @gol
746 -mnhwloop @gol
747 -muls @gol
748 -mmac @gol
749 -mscore5 -mscore5u -mscore7 -mscore7d}
750
751 @emph{SH Options}
752 @gccoptlist{-m1  -m2  -m2e  -m3  -m3e @gol
753 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
754 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol
755 -m5-64media  -m5-64media-nofpu @gol
756 -m5-32media  -m5-32media-nofpu @gol
757 -m5-compact  -m5-compact-nofpu @gol
758 -mb  -ml  -mdalign  -mrelax @gol
759 -mbigtable  -mfmovd  -mhitachi -mrenesas -mno-renesas -mnomacsave @gol
760 -mieee  -mbitops  -misize  -minline-ic_invalidate -mpadstruct  -mspace @gol
761 -mprefergot  -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
762 -mdivsi3_libfunc=@var{name} -mfixed-range=@var{register-range} @gol
763 -madjust-unroll -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol
764 -minvalid-symbols}
765
766 @emph{SPARC Options}
767 @gccoptlist{-mcpu=@var{cpu-type} @gol
768 -mtune=@var{cpu-type} @gol
769 -mcmodel=@var{code-model} @gol
770 -m32  -m64  -mapp-regs  -mno-app-regs @gol
771 -mfaster-structs  -mno-faster-structs @gol
772 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
773 -mhard-quad-float  -msoft-quad-float @gol
774 -mimpure-text  -mno-impure-text  -mlittle-endian @gol
775 -mstack-bias  -mno-stack-bias @gol
776 -munaligned-doubles  -mno-unaligned-doubles @gol
777 -mv8plus  -mno-v8plus  -mvis  -mno-vis
778 -threads -pthreads -pthread}
779
780 @emph{SPU Options}
781 @gccoptlist{-mwarn-reloc -merror-reloc @gol
782 -msafe-dma -munsafe-dma @gol
783 -mbranch-hints @gol
784 -msmall-mem -mlarge-mem -mstdmain @gol
785 -mfixed-range=@var{register-range}}
786
787 @emph{System V Options}
788 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
789
790 @emph{V850 Options}
791 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
792 -mprolog-function  -mno-prolog-function  -mspace @gol
793 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
794 -mapp-regs  -mno-app-regs @gol
795 -mdisable-callt  -mno-disable-callt @gol
796 -mv850e1 @gol
797 -mv850e @gol
798 -mv850  -mbig-switch}
799
800 @emph{VAX Options}
801 @gccoptlist{-mg  -mgnu  -munix}
802
803 @emph{VxWorks Options}
804 @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
805 -Xbind-lazy  -Xbind-now}
806
807 @emph{x86-64 Options}
808 See i386 and x86-64 Options.
809
810 @emph{Xstormy16 Options}
811 @gccoptlist{-msim}
812
813 @emph{Xtensa Options}
814 @gccoptlist{-mconst16 -mno-const16 @gol
815 -mfused-madd  -mno-fused-madd @gol
816 -mserialize-volatile  -mno-serialize-volatile @gol
817 -mtext-section-literals  -mno-text-section-literals @gol
818 -mtarget-align  -mno-target-align @gol
819 -mlongcalls  -mno-longcalls}
820
821 @emph{zSeries Options}
822 See S/390 and zSeries Options.
823
824 @item Code Generation Options
825 @xref{Code Gen Options,,Options for Code Generation Conventions}.
826 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
827 -ffixed-@var{reg}  -fexceptions @gol
828 -fnon-call-exceptions  -funwind-tables @gol
829 -fasynchronous-unwind-tables @gol
830 -finhibit-size-directive  -finstrument-functions @gol
831 -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol
832 -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{} @gol
833 -fno-common  -fno-ident @gol
834 -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE @gol
835 -fno-jump-tables @gol
836 -frecord-gcc-switches @gol
837 -freg-struct-return  -fshort-enums @gol
838 -fshort-double  -fshort-wchar @gol
839 -fverbose-asm  -fpack-struct[=@var{n}]  -fstack-check @gol
840 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
841 -fno-stack-limit  -fargument-alias  -fargument-noalias @gol
842 -fargument-noalias-global  -fargument-noalias-anything @gol
843 -fleading-underscore  -ftls-model=@var{model} @gol
844 -ftrapv  -fwrapv  -fbounds-check @gol
845 -fvisibility}
846 @end table
847
848 @menu
849 * Overall Options::     Controlling the kind of output:
850                         an executable, object files, assembler files,
851                         or preprocessed source.
852 * C Dialect Options::   Controlling the variant of C language compiled.
853 * C++ Dialect Options:: Variations on C++.
854 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
855                         and Objective-C++.
856 * Language Independent Options:: Controlling how diagnostics should be
857                         formatted.
858 * Warning Options::     How picky should the compiler be?
859 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
860 * Optimize Options::    How much optimization?
861 * Preprocessor Options:: Controlling header files and macro definitions.
862                          Also, getting dependency information for Make.
863 * Assembler Options::   Passing options to the assembler.
864 * Link Options::        Specifying libraries and so on.
865 * Directory Options::   Where to find header files and libraries.
866                         Where to find the compiler executable files.
867 * Spec Files::          How to pass switches to sub-processes.
868 * Target Options::      Running a cross-compiler, or an old version of GCC.
869 @end menu
870
871 @node Overall Options
872 @section Options Controlling the Kind of Output
873
874 Compilation can involve up to four stages: preprocessing, compilation
875 proper, assembly and linking, always in that order.  GCC is capable of
876 preprocessing and compiling several files either into several
877 assembler input files, or into one assembler input file; then each
878 assembler input file produces an object file, and linking combines all
879 the object files (those newly compiled, and those specified as input)
880 into an executable file.
881
882 @cindex file name suffix
883 For any given input file, the file name suffix determines what kind of
884 compilation is done:
885
886 @table @gcctabopt
887 @item @var{file}.c
888 C source code which must be preprocessed.
889
890 @item @var{file}.i
891 C source code which should not be preprocessed.
892
893 @item @var{file}.ii
894 C++ source code which should not be preprocessed.
895
896 @item @var{file}.m
897 Objective-C source code.  Note that you must link with the @file{libobjc}
898 library to make an Objective-C program work.
899
900 @item @var{file}.mi
901 Objective-C source code which should not be preprocessed.
902
903 @item @var{file}.mm
904 @itemx @var{file}.M
905 Objective-C++ source code.  Note that you must link with the @file{libobjc}
906 library to make an Objective-C++ program work.  Note that @samp{.M} refers
907 to a literal capital M@.
908
909 @item @var{file}.mii
910 Objective-C++ source code which should not be preprocessed.
911
912 @item @var{file}.h
913 C, C++, Objective-C or Objective-C++ header file to be turned into a
914 precompiled header.
915
916 @item @var{file}.cc
917 @itemx @var{file}.cp
918 @itemx @var{file}.cxx
919 @itemx @var{file}.cpp
920 @itemx @var{file}.CPP
921 @itemx @var{file}.c++
922 @itemx @var{file}.C
923 C++ source code which must be preprocessed.  Note that in @samp{.cxx},
924 the last two letters must both be literally @samp{x}.  Likewise,
925 @samp{.C} refers to a literal capital C@.
926
927 @item @var{file}.mm
928 @itemx @var{file}.M
929 Objective-C++ source code which must be preprocessed.
930
931 @item @var{file}.mii
932 Objective-C++ source code which should not be preprocessed.
933
934 @item @var{file}.hh
935 @itemx @var{file}.H
936 @itemx @var{file}.hp
937 @itemx @var{file}.hxx
938 @itemx @var{file}.hpp
939 @itemx @var{file}.HPP
940 @itemx @var{file}.h++
941 @itemx @var{file}.tcc
942 C++ header file to be turned into a precompiled header.
943
944 @item @var{file}.f
945 @itemx @var{file}.for
946 @itemx @var{file}.ftn
947 Fixed form Fortran source code which should not be preprocessed.
948
949 @item @var{file}.F
950 @itemx @var{file}.FOR
951 @itemx @var{file}.fpp
952 @itemx @var{file}.FPP
953 @itemx @var{file}.FTN
954 Fixed form Fortran source code which must be preprocessed (with the traditional
955 preprocessor).
956
957 @item @var{file}.f90
958 @itemx @var{file}.f95
959 @itemx @var{file}.f03
960 @itemx @var{file}.f08
961 Free form Fortran source code which should not be preprocessed.
962
963 @item @var{file}.F90
964 @itemx @var{file}.F95
965 @itemx @var{file}.F03
966 @itemx @var{file}.F08
967 Free form Fortran source code which must be preprocessed (with the
968 traditional preprocessor).
969
970 @c FIXME: Descriptions of Java file types.
971 @c @var{file}.java
972 @c @var{file}.class
973 @c @var{file}.zip
974 @c @var{file}.jar
975
976 @item @var{file}.ads
977 Ada source code file which contains a library unit declaration (a
978 declaration of a package, subprogram, or generic, or a generic
979 instantiation), or a library unit renaming declaration (a package,
980 generic, or subprogram renaming declaration).  Such files are also
981 called @dfn{specs}.
982
983 @item @var{file}.adb
984 Ada source code file containing a library unit body (a subprogram or
985 package body).  Such files are also called @dfn{bodies}.
986
987 @c GCC also knows about some suffixes for languages not yet included:
988 @c Pascal:
989 @c @var{file}.p
990 @c @var{file}.pas
991 @c Ratfor:
992 @c @var{file}.r
993
994 @item @var{file}.s
995 Assembler code.
996
997 @item @var{file}.S
998 @itemx @var{file}.sx
999 Assembler code which must be preprocessed.
1000
1001 @item @var{other}
1002 An object file to be fed straight into linking.
1003 Any file name with no recognized suffix is treated this way.
1004 @end table
1005
1006 @opindex x
1007 You can specify the input language explicitly with the @option{-x} option:
1008
1009 @table @gcctabopt
1010 @item -x @var{language}
1011 Specify explicitly the @var{language} for the following input files
1012 (rather than letting the compiler choose a default based on the file
1013 name suffix).  This option applies to all following input files until
1014 the next @option{-x} option.  Possible values for @var{language} are:
1015 @smallexample
1016 c  c-header  c-cpp-output
1017 c++  c++-header  c++-cpp-output
1018 objective-c  objective-c-header  objective-c-cpp-output
1019 objective-c++ objective-c++-header objective-c++-cpp-output
1020 assembler  assembler-with-cpp
1021 ada
1022 f77  f77-cpp-input f95  f95-cpp-input
1023 java
1024 @end smallexample
1025
1026 @item -x none
1027 Turn off any specification of a language, so that subsequent files are
1028 handled according to their file name suffixes (as they are if @option{-x}
1029 has not been used at all).
1030
1031 @item -pass-exit-codes
1032 @opindex pass-exit-codes
1033 Normally the @command{gcc} program will exit with the code of 1 if any
1034 phase of the compiler returns a non-success return code.  If you specify
1035 @option{-pass-exit-codes}, the @command{gcc} program will instead return with
1036 numerically highest error produced by any phase that returned an error
1037 indication.  The C, C++, and Fortran frontends return 4, if an internal
1038 compiler error is encountered.
1039 @end table
1040
1041 If you only want some of the stages of compilation, you can use
1042 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
1043 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
1044 @command{gcc} is to stop.  Note that some combinations (for example,
1045 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
1046
1047 @table @gcctabopt
1048 @item -c
1049 @opindex c
1050 Compile or assemble the source files, but do not link.  The linking
1051 stage simply is not done.  The ultimate output is in the form of an
1052 object file for each source file.
1053
1054 By default, the object file name for a source file is made by replacing
1055 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1056
1057 Unrecognized input files, not requiring compilation or assembly, are
1058 ignored.
1059
1060 @item -S
1061 @opindex S
1062 Stop after the stage of compilation proper; do not assemble.  The output
1063 is in the form of an assembler code file for each non-assembler input
1064 file specified.
1065
1066 By default, the assembler file name for a source file is made by
1067 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1068
1069 Input files that don't require compilation are ignored.
1070
1071 @item -E
1072 @opindex E
1073 Stop after the preprocessing stage; do not run the compiler proper.  The
1074 output is in the form of preprocessed source code, which is sent to the
1075 standard output.
1076
1077 Input files which don't require preprocessing are ignored.
1078
1079 @cindex output file option
1080 @item -o @var{file}
1081 @opindex o
1082 Place output in file @var{file}.  This applies regardless to whatever
1083 sort of output is being produced, whether it be an executable file,
1084 an object file, an assembler file or preprocessed C code.
1085
1086 If @option{-o} is not specified, the default is to put an executable
1087 file in @file{a.out}, the object file for
1088 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1089 assembler file in @file{@var{source}.s}, a precompiled header file in
1090 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1091 standard output.
1092
1093 @item -v
1094 @opindex v
1095 Print (on standard error output) the commands executed to run the stages
1096 of compilation.  Also print the version number of the compiler driver
1097 program and of the preprocessor and the compiler proper.
1098
1099 @item -###
1100 @opindex ###
1101 Like @option{-v} except the commands are not executed and all command
1102 arguments are quoted.  This is useful for shell scripts to capture the
1103 driver-generated command lines.
1104
1105 @item -pipe
1106 @opindex pipe
1107 Use pipes rather than temporary files for communication between the
1108 various stages of compilation.  This fails to work on some systems where
1109 the assembler is unable to read from a pipe; but the GNU assembler has
1110 no trouble.
1111
1112 @item -combine
1113 @opindex combine
1114 If you are compiling multiple source files, this option tells the driver
1115 to pass all the source files to the compiler at once (for those
1116 languages for which the compiler can handle this).  This will allow
1117 intermodule analysis (IMA) to be performed by the compiler.  Currently the only
1118 language for which this is supported is C@.  If you pass source files for
1119 multiple languages to the driver, using this option, the driver will invoke
1120 the compiler(s) that support IMA once each, passing each compiler all the
1121 source files appropriate for it.  For those languages that do not support
1122 IMA this option will be ignored, and the compiler will be invoked once for
1123 each source file in that language.  If you use this option in conjunction
1124 with @option{-save-temps}, the compiler will generate multiple
1125 pre-processed files
1126 (one for each source file), but only one (combined) @file{.o} or
1127 @file{.s} file.
1128
1129 @item --help
1130 @opindex help
1131 Print (on the standard output) a description of the command line options
1132 understood by @command{gcc}.  If the @option{-v} option is also specified
1133 then @option{--help} will also be passed on to the various processes
1134 invoked by @command{gcc}, so that they can display the command line options
1135 they accept.  If the @option{-Wextra} option has also been specified
1136 (prior to the @option{--help} option), then command line options which
1137 have no documentation associated with them will also be displayed.
1138
1139 @item --target-help
1140 @opindex target-help
1141 Print (on the standard output) a description of target-specific command
1142 line options for each tool.  For some targets extra target-specific
1143 information may also be printed.
1144
1145 @item --help=@var{class}@r{[},@var{qualifier}@r{]}
1146 Print (on the standard output) a description of the command line
1147 options understood by the compiler that fit into a specific class.
1148 The class can be one of @samp{optimizers}, @samp{warnings}, @samp{target},
1149 @samp{params}, or @var{language}:
1150
1151 @table @asis
1152 @item @samp{optimizers}
1153 This will display all of the optimization options supported by the
1154 compiler.
1155
1156 @item @samp{warnings}
1157 This will display all of the options controlling warning messages
1158 produced by the compiler.
1159
1160 @item @samp{target}
1161 This will display target-specific options.  Unlike the
1162 @option{--target-help} option however, target-specific options of the
1163 linker and assembler will not be displayed.  This is because those
1164 tools do not currently support the extended @option{--help=} syntax.
1165
1166 @item @samp{params}
1167 This will display the values recognized by the @option{--param}
1168 option.
1169
1170 @item @var{language}
1171 This will display the options supported for @var{language}, where 
1172 @var{language} is the name of one of the languages supported in this 
1173 version of GCC.
1174
1175 @item @samp{common}
1176 This will display the options that are common to all languages.
1177 @end table
1178
1179 It is possible to further refine the output of the @option{--help=}
1180 option by adding a comma separated list of qualifiers after the
1181 class.  These can be any from the following list:
1182
1183 @table @asis
1184 @item @samp{undocumented}
1185 Display only those options which are undocumented.
1186
1187 @item @samp{joined}
1188 Display options which take an argument that appears after an equal
1189 sign in the same continuous piece of text, such as:
1190 @samp{--help=target}.
1191
1192 @item @samp{separate}
1193 Display options which take an argument that appears as a separate word
1194 following the original option, such as: @samp{-o output-file}.
1195 @end table
1196
1197 Thus for example to display all the undocumented target-specific
1198 switches supported by the compiler the following can be used:
1199
1200 @smallexample
1201 --help=target,undocumented
1202 @end smallexample
1203
1204 The sense of a qualifier can be inverted by prefixing it with the
1205 @var{^} character, so for example to display all binary warning
1206 options (i.e., ones that are either on or off and that do not take an
1207 argument), which have a description the following can be used:
1208
1209 @smallexample
1210 --help=warnings,^joined,^undocumented
1211 @end smallexample
1212
1213 A class can also be used as a qualifier, although this usually
1214 restricts the output by so much that there is nothing to display.  One
1215 case where it does work however is when one of the classes is
1216 @var{target}.  So for example to display all the target-specific
1217 optimization options the following can be used:
1218
1219 @smallexample
1220 --help=target,optimizers
1221 @end smallexample
1222
1223 The @option{--help=} option can be repeated on the command line.  Each
1224 successive use will display its requested class of options, skipping
1225 those that have already been displayed.
1226
1227 If the @option{-Q} option appears on the command line before the
1228 @option{--help=} option, then the descriptive text displayed by
1229 @option{--help=} is changed.  Instead of describing the displayed
1230 options, an indication is given as to whether the option is enabled,
1231 disabled or set to a specific value (assuming that the compiler
1232 knows this at the point where the @option{--help=} option is used).
1233
1234 Here is a truncated example from the ARM port of @command{gcc}:
1235
1236 @smallexample
1237   % gcc -Q -mabi=2 --help=target -c
1238   The following options are target specific:
1239   -mabi=                                2
1240   -mabort-on-noreturn                   [disabled]
1241   -mapcs                                [disabled]
1242 @end smallexample
1243
1244 The output is sensitive to the effects of previous command line
1245 options, so for example it is possible to find out which optimizations
1246 are enabled at @option{-O2} by using:
1247
1248 @smallexample
1249 -O2 --help=optimizers
1250 @end smallexample
1251
1252 Alternatively you can discover which binary optimizations are enabled
1253 by @option{-O3} by using:
1254
1255 @smallexample
1256 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1257 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1258 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1259 @end smallexample
1260
1261 @item --version
1262 @opindex version
1263 Display the version number and copyrights of the invoked GCC@.
1264
1265 @item -wrapper
1266 @opindex wrapper
1267 Invoke all subcommands under a wrapper program. It takes a single
1268 comma separated list as an argument, which will be used to invoke
1269 the wrapper:
1270
1271 @smallexample
1272 gcc -c t.c -wrapper gdb,--args
1273 @end smallexample
1274
1275 This will invoke all subprograms of gcc under "gdb --args",
1276 thus cc1 invocation will be "gdb --args cc1 ...".
1277
1278 @include @value{srcdir}/../libiberty/at-file.texi
1279 @end table
1280
1281 @node Invoking G++
1282 @section Compiling C++ Programs
1283
1284 @cindex suffixes for C++ source
1285 @cindex C++ source file suffixes
1286 C++ source files conventionally use one of the suffixes @samp{.C},
1287 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1288 @samp{.cxx}; C++ header files often use @samp{.hh}, @samp{.hpp},
1289 @samp{.H}, or (for shared template code) @samp{.tcc}; and
1290 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1291 files with these names and compiles them as C++ programs even if you
1292 call the compiler the same way as for compiling C programs (usually
1293 with the name @command{gcc}).
1294
1295 @findex g++
1296 @findex c++
1297 However, the use of @command{gcc} does not add the C++ library.
1298 @command{g++} is a program that calls GCC and treats @samp{.c},
1299 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1300 files unless @option{-x} is used, and automatically specifies linking
1301 against the C++ library.  This program is also useful when
1302 precompiling a C header file with a @samp{.h} extension for use in C++
1303 compilations.  On many systems, @command{g++} is also installed with
1304 the name @command{c++}.
1305
1306 @cindex invoking @command{g++}
1307 When you compile C++ programs, you may specify many of the same
1308 command-line options that you use for compiling programs in any
1309 language; or command-line options meaningful for C and related
1310 languages; or options that are meaningful only for C++ programs.
1311 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1312 explanations of options for languages related to C@.
1313 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1314 explanations of options that are meaningful only for C++ programs.
1315
1316 @node C Dialect Options
1317 @section Options Controlling C Dialect
1318 @cindex dialect options
1319 @cindex language dialect options
1320 @cindex options, dialect
1321
1322 The following options control the dialect of C (or languages derived
1323 from C, such as C++, Objective-C and Objective-C++) that the compiler
1324 accepts:
1325
1326 @table @gcctabopt
1327 @cindex ANSI support
1328 @cindex ISO support
1329 @item -ansi
1330 @opindex ansi
1331 In C mode, this is equivalent to @samp{-std=c89}. In C++ mode, it is
1332 equivalent to @samp{-std=c++98}.
1333
1334 This turns off certain features of GCC that are incompatible with ISO
1335 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1336 such as the @code{asm} and @code{typeof} keywords, and
1337 predefined macros such as @code{unix} and @code{vax} that identify the
1338 type of system you are using.  It also enables the undesirable and
1339 rarely used ISO trigraph feature.  For the C compiler,
1340 it disables recognition of C++ style @samp{//} comments as well as
1341 the @code{inline} keyword.
1342
1343 The alternate keywords @code{__asm__}, @code{__extension__},
1344 @code{__inline__} and @code{__typeof__} continue to work despite
1345 @option{-ansi}.  You would not want to use them in an ISO C program, of
1346 course, but it is useful to put them in header files that might be included
1347 in compilations done with @option{-ansi}.  Alternate predefined macros
1348 such as @code{__unix__} and @code{__vax__} are also available, with or
1349 without @option{-ansi}.
1350
1351 The @option{-ansi} option does not cause non-ISO programs to be
1352 rejected gratuitously.  For that, @option{-pedantic} is required in
1353 addition to @option{-ansi}.  @xref{Warning Options}.
1354
1355 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1356 option is used.  Some header files may notice this macro and refrain
1357 from declaring certain functions or defining certain macros that the
1358 ISO standard doesn't call for; this is to avoid interfering with any
1359 programs that might use these names for other things.
1360
1361 Functions that would normally be built in but do not have semantics
1362 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1363 functions when @option{-ansi} is used.  @xref{Other Builtins,,Other
1364 built-in functions provided by GCC}, for details of the functions
1365 affected.
1366
1367 @item -std=
1368 @opindex std
1369 Determine the language standard. @xref{Standards,,Language Standards
1370 Supported by GCC}, for details of these standard versions.  This option
1371 is currently only supported when compiling C or C++. 
1372
1373 The compiler can accept several base standards, such as @samp{c89} or
1374 @samp{c++98}, and GNU dialects of those standards, such as
1375 @samp{gnu89} or @samp{gnu++98}.  By specifing a base standard, the
1376 compiler will accept all programs following that standard and those
1377 using GNU extensions that do not contradict it.  For example,
1378 @samp{-std=c89} turns off certain features of GCC that are
1379 incompatible with ISO C90, such as the @code{asm} and @code{typeof}
1380 keywords, but not other GNU extensions that do not have a meaning in
1381 ISO C90, such as omitting the middle term of a @code{?:}
1382 expression. On the other hand, by specifing a GNU dialect of a
1383 standard, all features the compiler support are enabled, even when
1384 those features change the meaning of the base standard and some
1385 strict-conforming programs may be rejected.  The particular standard
1386 is used by @option{-pedantic} to identify which features are GNU
1387 extensions given that version of the standard. For example
1388 @samp{-std=gnu89 -pedantic} would warn about C++ style @samp{//}
1389 comments, while @samp{-std=gnu99 -pedantic} would not.
1390
1391 A value for this option must be provided; possible values are
1392
1393 @table @samp
1394 @item c89
1395 @itemx iso9899:1990
1396 Support all ISO C90 programs (certain GNU extensions that conflict
1397 with ISO C90 are disabled). Same as @option{-ansi} for C code.
1398
1399 @item iso9899:199409
1400 ISO C90 as modified in amendment 1.
1401
1402 @item c99
1403 @itemx c9x
1404 @itemx iso9899:1999
1405 @itemx iso9899:199x
1406 ISO C99.  Note that this standard is not yet fully supported; see
1407 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1408 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1409
1410 @item gnu89
1411 GNU dialect of ISO C90 (including some C99 features). This
1412 is the default for C code.
1413
1414 @item gnu99
1415 @itemx gnu9x
1416 GNU dialect of ISO C99.  When ISO C99 is fully implemented in GCC,
1417 this will become the default.  The name @samp{gnu9x} is deprecated.
1418
1419 @item c++98
1420 The 1998 ISO C++ standard plus amendments. Same as @option{-ansi} for
1421 C++ code.
1422
1423 @item gnu++98
1424 GNU dialect of @option{-std=c++98}.  This is the default for
1425 C++ code.
1426
1427 @item c++0x
1428 The working draft of the upcoming ISO C++0x standard. This option
1429 enables experimental features that are likely to be included in
1430 C++0x. The working draft is constantly changing, and any feature that is
1431 enabled by this flag may be removed from future versions of GCC if it is
1432 not part of the C++0x standard.
1433
1434 @item gnu++0x
1435 GNU dialect of @option{-std=c++0x}. This option enables
1436 experimental features that may be removed in future versions of GCC.
1437 @end table
1438
1439 @item -fgnu89-inline
1440 @opindex fgnu89-inline
1441 The option @option{-fgnu89-inline} tells GCC to use the traditional
1442 GNU semantics for @code{inline} functions when in C99 mode.
1443 @xref{Inline,,An Inline Function is As Fast As a Macro}.  This option
1444 is accepted and ignored by GCC versions 4.1.3 up to but not including
1445 4.3.  In GCC versions 4.3 and later it changes the behavior of GCC in
1446 C99 mode.  Using this option is roughly equivalent to adding the
1447 @code{gnu_inline} function attribute to all inline functions
1448 (@pxref{Function Attributes}).
1449
1450 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
1451 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
1452 specifies the default behavior).  This option was first supported in
1453 GCC 4.3.  This option is not supported in C89 or gnu89 mode.
1454
1455 The preprocessor macros @code{__GNUC_GNU_INLINE__} and
1456 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
1457 in effect for @code{inline} functions.  @xref{Common Predefined
1458 Macros,,,cpp,The C Preprocessor}.
1459
1460 @item -aux-info @var{filename}
1461 @opindex aux-info
1462 Output to the given filename prototyped declarations for all functions
1463 declared and/or defined in a translation unit, including those in header
1464 files.  This option is silently ignored in any language other than C@.
1465
1466 Besides declarations, the file indicates, in comments, the origin of
1467 each declaration (source file and line), whether the declaration was
1468 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1469 @samp{O} for old, respectively, in the first character after the line
1470 number and the colon), and whether it came from a declaration or a
1471 definition (@samp{C} or @samp{F}, respectively, in the following
1472 character).  In the case of function definitions, a K&R-style list of
1473 arguments followed by their declarations is also provided, inside
1474 comments, after the declaration.
1475
1476 @item -fno-asm
1477 @opindex fno-asm
1478 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1479 keyword, so that code can use these words as identifiers.  You can use
1480 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1481 instead.  @option{-ansi} implies @option{-fno-asm}.
1482
1483 In C++, this switch only affects the @code{typeof} keyword, since
1484 @code{asm} and @code{inline} are standard keywords.  You may want to
1485 use the @option{-fno-gnu-keywords} flag instead, which has the same
1486 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1487 switch only affects the @code{asm} and @code{typeof} keywords, since
1488 @code{inline} is a standard keyword in ISO C99.
1489
1490 @item -fno-builtin
1491 @itemx -fno-builtin-@var{function}
1492 @opindex fno-builtin
1493 @cindex built-in functions
1494 Don't recognize built-in functions that do not begin with
1495 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1496 functions provided by GCC}, for details of the functions affected,
1497 including those which are not built-in functions when @option{-ansi} or
1498 @option{-std} options for strict ISO C conformance are used because they
1499 do not have an ISO standard meaning.
1500
1501 GCC normally generates special code to handle certain built-in functions
1502 more efficiently; for instance, calls to @code{alloca} may become single
1503 instructions that adjust the stack directly, and calls to @code{memcpy}
1504 may become inline copy loops.  The resulting code is often both smaller
1505 and faster, but since the function calls no longer appear as such, you
1506 cannot set a breakpoint on those calls, nor can you change the behavior
1507 of the functions by linking with a different library.  In addition,
1508 when a function is recognized as a built-in function, GCC may use
1509 information about that function to warn about problems with calls to
1510 that function, or to generate more efficient code, even if the
1511 resulting code still contains calls to that function.  For example,
1512 warnings are given with @option{-Wformat} for bad calls to
1513 @code{printf}, when @code{printf} is built in, and @code{strlen} is
1514 known not to modify global memory.
1515
1516 With the @option{-fno-builtin-@var{function}} option
1517 only the built-in function @var{function} is
1518 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1519 function is named this is not built-in in this version of GCC, this
1520 option is ignored.  There is no corresponding
1521 @option{-fbuiltin-@var{function}} option; if you wish to enable
1522 built-in functions selectively when using @option{-fno-builtin} or
1523 @option{-ffreestanding}, you may define macros such as:
1524
1525 @smallexample
1526 #define abs(n)          __builtin_abs ((n))
1527 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1528 @end smallexample
1529
1530 @item -fhosted
1531 @opindex fhosted
1532 @cindex hosted environment
1533
1534 Assert that compilation takes place in a hosted environment.  This implies
1535 @option{-fbuiltin}.  A hosted environment is one in which the
1536 entire standard library is available, and in which @code{main} has a return
1537 type of @code{int}.  Examples are nearly everything except a kernel.
1538 This is equivalent to @option{-fno-freestanding}.
1539
1540 @item -ffreestanding
1541 @opindex ffreestanding
1542 @cindex hosted environment
1543
1544 Assert that compilation takes place in a freestanding environment.  This
1545 implies @option{-fno-builtin}.  A freestanding environment
1546 is one in which the standard library may not exist, and program startup may
1547 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1548 This is equivalent to @option{-fno-hosted}.
1549
1550 @xref{Standards,,Language Standards Supported by GCC}, for details of
1551 freestanding and hosted environments.
1552
1553 @item -fopenmp
1554 @opindex fopenmp
1555 @cindex openmp parallel
1556 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
1557 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
1558 compiler generates parallel code according to the OpenMP Application
1559 Program Interface v2.5 @w{@uref{http://www.openmp.org/}}.  This option
1560 implies @option{-pthread}, and thus is only supported on targets that
1561 have support for @option{-pthread}.
1562
1563 @item -fms-extensions
1564 @opindex fms-extensions
1565 Accept some non-standard constructs used in Microsoft header files.
1566
1567 Some cases of unnamed fields in structures and unions are only
1568 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
1569 fields within structs/unions}, for details.
1570
1571 @item -trigraphs
1572 @opindex trigraphs
1573 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
1574 options for strict ISO C conformance) implies @option{-trigraphs}.
1575
1576 @item -no-integrated-cpp
1577 @opindex no-integrated-cpp
1578 Performs a compilation in two passes: preprocessing and compiling.  This
1579 option allows a user supplied "cc1", "cc1plus", or "cc1obj" via the
1580 @option{-B} option.  The user supplied compilation step can then add in
1581 an additional preprocessing step after normal preprocessing but before
1582 compiling.  The default is to use the integrated cpp (internal cpp)
1583
1584 The semantics of this option will change if "cc1", "cc1plus", and
1585 "cc1obj" are merged.
1586
1587 @cindex traditional C language
1588 @cindex C language, traditional
1589 @item -traditional
1590 @itemx -traditional-cpp
1591 @opindex traditional-cpp
1592 @opindex traditional
1593 Formerly, these options caused GCC to attempt to emulate a pre-standard
1594 C compiler.  They are now only supported with the @option{-E} switch.
1595 The preprocessor continues to support a pre-standard mode.  See the GNU
1596 CPP manual for details.
1597
1598 @item -fcond-mismatch
1599 @opindex fcond-mismatch
1600 Allow conditional expressions with mismatched types in the second and
1601 third arguments.  The value of such an expression is void.  This option
1602 is not supported for C++.
1603
1604 @item -flax-vector-conversions
1605 @opindex flax-vector-conversions
1606 Allow implicit conversions between vectors with differing numbers of
1607 elements and/or incompatible element types.  This option should not be
1608 used for new code.
1609
1610 @item -funsigned-char
1611 @opindex funsigned-char
1612 Let the type @code{char} be unsigned, like @code{unsigned char}.
1613
1614 Each kind of machine has a default for what @code{char} should
1615 be.  It is either like @code{unsigned char} by default or like
1616 @code{signed char} by default.
1617
1618 Ideally, a portable program should always use @code{signed char} or
1619 @code{unsigned char} when it depends on the signedness of an object.
1620 But many programs have been written to use plain @code{char} and
1621 expect it to be signed, or expect it to be unsigned, depending on the
1622 machines they were written for.  This option, and its inverse, let you
1623 make such a program work with the opposite default.
1624
1625 The type @code{char} is always a distinct type from each of
1626 @code{signed char} or @code{unsigned char}, even though its behavior
1627 is always just like one of those two.
1628
1629 @item -fsigned-char
1630 @opindex fsigned-char
1631 Let the type @code{char} be signed, like @code{signed char}.
1632
1633 Note that this is equivalent to @option{-fno-unsigned-char}, which is
1634 the negative form of @option{-funsigned-char}.  Likewise, the option
1635 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
1636
1637 @item -fsigned-bitfields
1638 @itemx -funsigned-bitfields
1639 @itemx -fno-signed-bitfields
1640 @itemx -fno-unsigned-bitfields
1641 @opindex fsigned-bitfields
1642 @opindex funsigned-bitfields
1643 @opindex fno-signed-bitfields
1644 @opindex fno-unsigned-bitfields
1645 These options control whether a bit-field is signed or unsigned, when the
1646 declaration does not use either @code{signed} or @code{unsigned}.  By
1647 default, such a bit-field is signed, because this is consistent: the
1648 basic integer types such as @code{int} are signed types.
1649 @end table
1650
1651 @node C++ Dialect Options
1652 @section Options Controlling C++ Dialect
1653
1654 @cindex compiler options, C++
1655 @cindex C++ options, command line
1656 @cindex options, C++
1657 This section describes the command-line options that are only meaningful
1658 for C++ programs; but you can also use most of the GNU compiler options
1659 regardless of what language your program is in.  For example, you
1660 might compile a file @code{firstClass.C} like this:
1661
1662 @smallexample
1663 g++ -g -frepo -O -c firstClass.C
1664 @end smallexample
1665
1666 @noindent
1667 In this example, only @option{-frepo} is an option meant
1668 only for C++ programs; you can use the other options with any
1669 language supported by GCC@.
1670
1671 Here is a list of options that are @emph{only} for compiling C++ programs:
1672
1673 @table @gcctabopt
1674
1675 @item -fabi-version=@var{n}
1676 @opindex fabi-version
1677 Use version @var{n} of the C++ ABI@.  Version 2 is the version of the
1678 C++ ABI that first appeared in G++ 3.4.  Version 1 is the version of
1679 the C++ ABI that first appeared in G++ 3.2.  Version 0 will always be
1680 the version that conforms most closely to the C++ ABI specification.
1681 Therefore, the ABI obtained using version 0 will change as ABI bugs
1682 are fixed.
1683
1684 The default is version 2.
1685
1686 @item -fno-access-control
1687 @opindex fno-access-control
1688 Turn off all access checking.  This switch is mainly useful for working
1689 around bugs in the access control code.
1690
1691 @item -fcheck-new
1692 @opindex fcheck-new
1693 Check that the pointer returned by @code{operator new} is non-null
1694 before attempting to modify the storage allocated.  This check is
1695 normally unnecessary because the C++ standard specifies that
1696 @code{operator new} will only return @code{0} if it is declared
1697 @samp{throw()}, in which case the compiler will always check the
1698 return value even without this option.  In all other cases, when
1699 @code{operator new} has a non-empty exception specification, memory
1700 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
1701 @samp{new (nothrow)}.
1702
1703 @item -fconserve-space
1704 @opindex fconserve-space
1705 Put uninitialized or runtime-initialized global variables into the
1706 common segment, as C does.  This saves space in the executable at the
1707 cost of not diagnosing duplicate definitions.  If you compile with this
1708 flag and your program mysteriously crashes after @code{main()} has
1709 completed, you may have an object that is being destroyed twice because
1710 two definitions were merged.
1711
1712 This option is no longer useful on most targets, now that support has
1713 been added for putting variables into BSS without making them common.
1714
1715 @item -ffriend-injection
1716 @opindex ffriend-injection
1717 Inject friend functions into the enclosing namespace, so that they are
1718 visible outside the scope of the class in which they are declared.
1719 Friend functions were documented to work this way in the old Annotated
1720 C++ Reference Manual, and versions of G++ before 4.1 always worked
1721 that way.  However, in ISO C++ a friend function which is not declared
1722 in an enclosing scope can only be found using argument dependent
1723 lookup.  This option causes friends to be injected as they were in
1724 earlier releases.
1725
1726 This option is for compatibility, and may be removed in a future
1727 release of G++.
1728
1729 @item -fno-elide-constructors
1730 @opindex fno-elide-constructors
1731 The C++ standard allows an implementation to omit creating a temporary
1732 which is only used to initialize another object of the same type.
1733 Specifying this option disables that optimization, and forces G++ to
1734 call the copy constructor in all cases.
1735
1736 @item -fno-enforce-eh-specs
1737 @opindex fno-enforce-eh-specs
1738 Don't generate code to check for violation of exception specifications
1739 at runtime.  This option violates the C++ standard, but may be useful
1740 for reducing code size in production builds, much like defining
1741 @samp{NDEBUG}.  This does not give user code permission to throw
1742 exceptions in violation of the exception specifications; the compiler
1743 will still optimize based on the specifications, so throwing an
1744 unexpected exception will result in undefined behavior.
1745
1746 @item -ffor-scope
1747 @itemx -fno-for-scope
1748 @opindex ffor-scope
1749 @opindex fno-for-scope
1750 If @option{-ffor-scope} is specified, the scope of variables declared in
1751 a @i{for-init-statement} is limited to the @samp{for} loop itself,
1752 as specified by the C++ standard.
1753 If @option{-fno-for-scope} is specified, the scope of variables declared in
1754 a @i{for-init-statement} extends to the end of the enclosing scope,
1755 as was the case in old versions of G++, and other (traditional)
1756 implementations of C++.
1757
1758 The default if neither flag is given to follow the standard,
1759 but to allow and give a warning for old-style code that would
1760 otherwise be invalid, or have different behavior.
1761
1762 @item -fno-gnu-keywords
1763 @opindex fno-gnu-keywords
1764 Do not recognize @code{typeof} as a keyword, so that code can use this
1765 word as an identifier.  You can use the keyword @code{__typeof__} instead.
1766 @option{-ansi} implies @option{-fno-gnu-keywords}.
1767
1768 @item -fno-implicit-templates
1769 @opindex fno-implicit-templates
1770 Never emit code for non-inline templates which are instantiated
1771 implicitly (i.e.@: by use); only emit code for explicit instantiations.
1772 @xref{Template Instantiation}, for more information.
1773
1774 @item -fno-implicit-inline-templates
1775 @opindex fno-implicit-inline-templates
1776 Don't emit code for implicit instantiations of inline templates, either.
1777 The default is to handle inlines differently so that compiles with and
1778 without optimization will need the same set of explicit instantiations.
1779
1780 @item -fno-implement-inlines
1781 @opindex fno-implement-inlines
1782 To save space, do not emit out-of-line copies of inline functions
1783 controlled by @samp{#pragma implementation}.  This will cause linker
1784 errors if these functions are not inlined everywhere they are called.
1785
1786 @item -fms-extensions
1787 @opindex fms-extensions
1788 Disable pedantic warnings about constructs used in MFC, such as implicit
1789 int and getting a pointer to member function via non-standard syntax.
1790
1791 @item -fno-nonansi-builtins
1792 @opindex fno-nonansi-builtins
1793 Disable built-in declarations of functions that are not mandated by
1794 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
1795 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
1796
1797 @item -fno-operator-names
1798 @opindex fno-operator-names
1799 Do not treat the operator name keywords @code{and}, @code{bitand},
1800 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
1801 synonyms as keywords.
1802
1803 @item -fno-optional-diags
1804 @opindex fno-optional-diags
1805 Disable diagnostics that the standard says a compiler does not need to
1806 issue.  Currently, the only such diagnostic issued by G++ is the one for
1807 a name having multiple meanings within a class.
1808
1809 @item -fpermissive
1810 @opindex fpermissive
1811 Downgrade some diagnostics about nonconformant code from errors to
1812 warnings.  Thus, using @option{-fpermissive} will allow some
1813 nonconforming code to compile.
1814
1815 @item -frepo
1816 @opindex frepo
1817 Enable automatic template instantiation at link time.  This option also
1818 implies @option{-fno-implicit-templates}.  @xref{Template
1819 Instantiation}, for more information.
1820
1821 @item -fno-rtti
1822 @opindex fno-rtti
1823 Disable generation of information about every class with virtual
1824 functions for use by the C++ runtime type identification features
1825 (@samp{dynamic_cast} and @samp{typeid}).  If you don't use those parts
1826 of the language, you can save some space by using this flag.  Note that
1827 exception handling uses the same information, but it will generate it as
1828 needed. The @samp{dynamic_cast} operator can still be used for casts that
1829 do not require runtime type information, i.e.@: casts to @code{void *} or to
1830 unambiguous base classes.
1831
1832 @item -fstats
1833 @opindex fstats
1834 Emit statistics about front-end processing at the end of the compilation.
1835 This information is generally only useful to the G++ development team.
1836
1837 @item -ftemplate-depth-@var{n}
1838 @opindex ftemplate-depth
1839 Set the maximum instantiation depth for template classes to @var{n}.
1840 A limit on the template instantiation depth is needed to detect
1841 endless recursions during template class instantiation.  ANSI/ISO C++
1842 conforming programs must not rely on a maximum depth greater than 17.
1843
1844 @item -fno-threadsafe-statics
1845 @opindex fno-threadsafe-statics
1846 Do not emit the extra code to use the routines specified in the C++
1847 ABI for thread-safe initialization of local statics.  You can use this
1848 option to reduce code size slightly in code that doesn't need to be
1849 thread-safe.
1850
1851 @item -fuse-cxa-atexit
1852 @opindex fuse-cxa-atexit
1853 Register destructors for objects with static storage duration with the
1854 @code{__cxa_atexit} function rather than the @code{atexit} function.
1855 This option is required for fully standards-compliant handling of static
1856 destructors, but will only work if your C library supports
1857 @code{__cxa_atexit}.
1858
1859 @item -fno-use-cxa-get-exception-ptr
1860 @opindex fno-use-cxa-get-exception-ptr
1861 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
1862 will cause @code{std::uncaught_exception} to be incorrect, but is necessary
1863 if the runtime routine is not available.
1864
1865 @item -fvisibility-inlines-hidden
1866 @opindex fvisibility-inlines-hidden
1867 This switch declares that the user does not attempt to compare
1868 pointers to inline methods where the addresses of the two functions
1869 were taken in different shared objects.
1870
1871 The effect of this is that GCC may, effectively, mark inline methods with
1872 @code{__attribute__ ((visibility ("hidden")))} so that they do not
1873 appear in the export table of a DSO and do not require a PLT indirection
1874 when used within the DSO@.  Enabling this option can have a dramatic effect
1875 on load and link times of a DSO as it massively reduces the size of the
1876 dynamic export table when the library makes heavy use of templates.
1877
1878 The behavior of this switch is not quite the same as marking the
1879 methods as hidden directly, because it does not affect static variables
1880 local to the function or cause the compiler to deduce that
1881 the function is defined in only one shared object.
1882
1883 You may mark a method as having a visibility explicitly to negate the
1884 effect of the switch for that method.  For example, if you do want to
1885 compare pointers to a particular inline method, you might mark it as
1886 having default visibility.  Marking the enclosing class with explicit
1887 visibility will have no effect.
1888
1889 Explicitly instantiated inline methods are unaffected by this option
1890 as their linkage might otherwise cross a shared library boundary.
1891 @xref{Template Instantiation}.
1892
1893 @item -fvisibility-ms-compat
1894 @opindex fvisibility-ms-compat
1895 This flag attempts to use visibility settings to make GCC's C++
1896 linkage model compatible with that of Microsoft Visual Studio.
1897
1898 The flag makes these changes to GCC's linkage model:
1899
1900 @enumerate
1901 @item
1902 It sets the default visibility to @code{hidden}, like
1903 @option{-fvisibility=hidden}.
1904
1905 @item
1906 Types, but not their members, are not hidden by default.
1907
1908 @item
1909 The One Definition Rule is relaxed for types without explicit
1910 visibility specifications which are defined in more than one different
1911 shared object: those declarations are permitted if they would have
1912 been permitted when this option was not used.
1913 @end enumerate
1914
1915 In new code it is better to use @option{-fvisibility=hidden} and
1916 export those classes which are intended to be externally visible.
1917 Unfortunately it is possible for code to rely, perhaps accidentally,
1918 on the Visual Studio behavior.
1919
1920 Among the consequences of these changes are that static data members
1921 of the same type with the same name but defined in different shared
1922 objects will be different, so changing one will not change the other;
1923 and that pointers to function members defined in different shared
1924 objects may not compare equal.  When this flag is given, it is a
1925 violation of the ODR to define types with the same name differently.
1926
1927 @item -fno-weak
1928 @opindex fno-weak
1929 Do not use weak symbol support, even if it is provided by the linker.
1930 By default, G++ will use weak symbols if they are available.  This
1931 option exists only for testing, and should not be used by end-users;
1932 it will result in inferior code and has no benefits.  This option may
1933 be removed in a future release of G++.
1934
1935 @item -nostdinc++
1936 @opindex nostdinc++
1937 Do not search for header files in the standard directories specific to
1938 C++, but do still search the other standard directories.  (This option
1939 is used when building the C++ library.)
1940 @end table
1941
1942 In addition, these optimization, warning, and code generation options
1943 have meanings only for C++ programs:
1944
1945 @table @gcctabopt
1946 @item -fno-default-inline
1947 @opindex fno-default-inline
1948 Do not assume @samp{inline} for functions defined inside a class scope.
1949 @xref{Optimize Options,,Options That Control Optimization}.  Note that these
1950 functions will have linkage like inline functions; they just won't be
1951 inlined by default.
1952
1953 @item -Wabi @r{(C++ and Objective-C++ only)}
1954 @opindex Wabi
1955 @opindex Wno-abi
1956 Warn when G++ generates code that is probably not compatible with the
1957 vendor-neutral C++ ABI@.  Although an effort has been made to warn about
1958 all such cases, there are probably some cases that are not warned about,
1959 even though G++ is generating incompatible code.  There may also be
1960 cases where warnings are emitted even though the code that is generated
1961 will be compatible.
1962
1963 You should rewrite your code to avoid these warnings if you are
1964 concerned about the fact that code generated by G++ may not be binary
1965 compatible with code generated by other compilers.
1966
1967 The known incompatibilities at this point include:
1968
1969 @itemize @bullet
1970
1971 @item
1972 Incorrect handling of tail-padding for bit-fields.  G++ may attempt to
1973 pack data into the same byte as a base class.  For example:
1974
1975 @smallexample
1976 struct A @{ virtual void f(); int f1 : 1; @};
1977 struct B : public A @{ int f2 : 1; @};
1978 @end smallexample
1979
1980 @noindent
1981 In this case, G++ will place @code{B::f2} into the same byte
1982 as@code{A::f1}; other compilers will not.  You can avoid this problem
1983 by explicitly padding @code{A} so that its size is a multiple of the
1984 byte size on your platform; that will cause G++ and other compilers to
1985 layout @code{B} identically.
1986
1987 @item
1988 Incorrect handling of tail-padding for virtual bases.  G++ does not use
1989 tail padding when laying out virtual bases.  For example:
1990
1991 @smallexample
1992 struct A @{ virtual void f(); char c1; @};
1993 struct B @{ B(); char c2; @};
1994 struct C : public A, public virtual B @{@};
1995 @end smallexample
1996
1997 @noindent
1998 In this case, G++ will not place @code{B} into the tail-padding for
1999 @code{A}; other compilers will.  You can avoid this problem by
2000 explicitly padding @code{A} so that its size is a multiple of its
2001 alignment (ignoring virtual base classes); that will cause G++ and other
2002 compilers to layout @code{C} identically.
2003
2004 @item
2005 Incorrect handling of bit-fields with declared widths greater than that
2006 of their underlying types, when the bit-fields appear in a union.  For
2007 example:
2008
2009 @smallexample
2010 union U @{ int i : 4096; @};
2011 @end smallexample
2012
2013 @noindent
2014 Assuming that an @code{int} does not have 4096 bits, G++ will make the
2015 union too small by the number of bits in an @code{int}.
2016
2017 @item
2018 Empty classes can be placed at incorrect offsets.  For example:
2019
2020 @smallexample
2021 struct A @{@};
2022
2023 struct B @{
2024   A a;
2025   virtual void f ();
2026 @};
2027
2028 struct C : public B, public A @{@};
2029 @end smallexample
2030
2031 @noindent
2032 G++ will place the @code{A} base class of @code{C} at a nonzero offset;
2033 it should be placed at offset zero.  G++ mistakenly believes that the
2034 @code{A} data member of @code{B} is already at offset zero.
2035
2036 @item
2037 Names of template functions whose types involve @code{typename} or
2038 template template parameters can be mangled incorrectly.
2039
2040 @smallexample
2041 template <typename Q>
2042 void f(typename Q::X) @{@}
2043
2044 template <template <typename> class Q>
2045 void f(typename Q<int>::X) @{@}
2046 @end smallexample
2047
2048 @noindent
2049 Instantiations of these templates may be mangled incorrectly.
2050
2051 @end itemize
2052
2053 @item -Wctor-dtor-privacy @r{(C++ and Objective-C++ only)}
2054 @opindex Wctor-dtor-privacy
2055 @opindex Wno-ctor-dtor-privacy
2056 Warn when a class seems unusable because all the constructors or
2057 destructors in that class are private, and it has neither friends nor
2058 public static member functions.
2059
2060 @item -Wnon-virtual-dtor @r{(C++ and Objective-C++ only)}
2061 @opindex Wnon-virtual-dtor
2062 @opindex Wno-non-virtual-dtor
2063 Warn when a class has virtual functions and accessible non-virtual
2064 destructor, in which case it would be possible but unsafe to delete
2065 an instance of a derived class through a pointer to the base class.
2066 This warning is also enabled if -Weffc++ is specified.
2067
2068 @item -Wreorder @r{(C++ and Objective-C++ only)}
2069 @opindex Wreorder
2070 @opindex Wno-reorder
2071 @cindex reordering, warning
2072 @cindex warning for reordering of member initializers
2073 Warn when the order of member initializers given in the code does not
2074 match the order in which they must be executed.  For instance:
2075
2076 @smallexample
2077 struct A @{
2078   int i;
2079   int j;
2080   A(): j (0), i (1) @{ @}
2081 @};
2082 @end smallexample
2083
2084 The compiler will rearrange the member initializers for @samp{i}
2085 and @samp{j} to match the declaration order of the members, emitting
2086 a warning to that effect.  This warning is enabled by @option{-Wall}.
2087 @end table
2088
2089 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
2090
2091 @table @gcctabopt
2092 @item -Weffc++ @r{(C++ and Objective-C++ only)}
2093 @opindex Weffc++
2094 @opindex Wno-effc++
2095 Warn about violations of the following style guidelines from Scott Meyers'
2096 @cite{Effective C++} book:
2097
2098 @itemize @bullet
2099 @item
2100 Item 11:  Define a copy constructor and an assignment operator for classes
2101 with dynamically allocated memory.
2102
2103 @item
2104 Item 12:  Prefer initialization to assignment in constructors.
2105
2106 @item
2107 Item 14:  Make destructors virtual in base classes.
2108
2109 @item
2110 Item 15:  Have @code{operator=} return a reference to @code{*this}.
2111
2112 @item
2113 Item 23:  Don't try to return a reference when you must return an object.
2114
2115 @end itemize
2116
2117 Also warn about violations of the following style guidelines from
2118 Scott Meyers' @cite{More Effective C++} book:
2119
2120 @itemize @bullet
2121 @item
2122 Item 6:  Distinguish between prefix and postfix forms of increment and
2123 decrement operators.
2124
2125 @item
2126 Item 7:  Never overload @code{&&}, @code{||}, or @code{,}.
2127
2128 @end itemize
2129
2130 When selecting this option, be aware that the standard library
2131 headers do not obey all of these guidelines; use @samp{grep -v}
2132 to filter out those warnings.
2133
2134 @item -Wstrict-null-sentinel @r{(C++ and Objective-C++ only)}
2135 @opindex Wstrict-null-sentinel
2136 @opindex Wno-strict-null-sentinel
2137 Warn also about the use of an uncasted @code{NULL} as sentinel.  When
2138 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
2139 to @code{__null}.  Although it is a null pointer constant not a null pointer,
2140 it is guaranteed to of the same size as a pointer.  But this use is
2141 not portable across different compilers.
2142
2143 @item -Wno-non-template-friend @r{(C++ and Objective-C++ only)}
2144 @opindex Wno-non-template-friend
2145 @opindex Wnon-template-friend
2146 Disable warnings when non-templatized friend functions are declared
2147 within a template.  Since the advent of explicit template specification
2148 support in G++, if the name of the friend is an unqualified-id (i.e.,
2149 @samp{friend foo(int)}), the C++ language specification demands that the
2150 friend declare or define an ordinary, nontemplate function.  (Section
2151 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
2152 could be interpreted as a particular specialization of a templatized
2153 function.  Because this non-conforming behavior is no longer the default
2154 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
2155 check existing code for potential trouble spots and is on by default.
2156 This new compiler behavior can be turned off with
2157 @option{-Wno-non-template-friend} which keeps the conformant compiler code
2158 but disables the helpful warning.
2159
2160 @item -Wold-style-cast @r{(C++ and Objective-C++ only)}
2161 @opindex Wold-style-cast
2162 @opindex Wno-old-style-cast
2163 Warn if an old-style (C-style) cast to a non-void type is used within
2164 a C++ program.  The new-style casts (@samp{dynamic_cast},
2165 @samp{static_cast}, @samp{reinterpret_cast}, and @samp{const_cast}) are
2166 less vulnerable to unintended effects and much easier to search for.
2167
2168 @item -Woverloaded-virtual @r{(C++ and Objective-C++ only)}
2169 @opindex Woverloaded-virtual
2170 @opindex Wno-overloaded-virtual
2171 @cindex overloaded virtual fn, warning
2172 @cindex warning for overloaded virtual fn
2173 Warn when a function declaration hides virtual functions from a
2174 base class.  For example, in:
2175
2176 @smallexample
2177 struct A @{
2178   virtual void f();
2179 @};
2180
2181 struct B: public A @{
2182   void f(int);
2183 @};
2184 @end smallexample
2185
2186 the @code{A} class version of @code{f} is hidden in @code{B}, and code
2187 like:
2188
2189 @smallexample
2190 B* b;
2191 b->f();
2192 @end smallexample
2193
2194 will fail to compile.
2195
2196 @item -Wno-pmf-conversions @r{(C++ and Objective-C++ only)}
2197 @opindex Wno-pmf-conversions
2198 @opindex Wpmf-conversions
2199 Disable the diagnostic for converting a bound pointer to member function
2200 to a plain pointer.
2201
2202 @item -Wsign-promo @r{(C++ and Objective-C++ only)}
2203 @opindex Wsign-promo
2204 @opindex Wno-sign-promo
2205 Warn when overload resolution chooses a promotion from unsigned or
2206 enumerated type to a signed type, over a conversion to an unsigned type of
2207 the same size.  Previous versions of G++ would try to preserve
2208 unsignedness, but the standard mandates the current behavior.
2209
2210 @smallexample
2211 struct A @{
2212   operator int ();
2213   A& operator = (int);
2214 @};
2215
2216 main ()
2217 @{
2218   A a,b;
2219   a = b;
2220 @}
2221 @end smallexample
2222
2223 In this example, G++ will synthesize a default @samp{A& operator =
2224 (const A&);}, while cfront will use the user-defined @samp{operator =}.
2225 @end table
2226
2227 @node Objective-C and Objective-C++ Dialect Options
2228 @section Options Controlling Objective-C and Objective-C++ Dialects
2229
2230 @cindex compiler options, Objective-C and Objective-C++
2231 @cindex Objective-C and Objective-C++ options, command line
2232 @cindex options, Objective-C and Objective-C++
2233 (NOTE: This manual does not describe the Objective-C and Objective-C++
2234 languages themselves.  See @xref{Standards,,Language Standards
2235 Supported by GCC}, for references.)
2236
2237 This section describes the command-line options that are only meaningful
2238 for Objective-C and Objective-C++ programs, but you can also use most of
2239 the language-independent GNU compiler options.
2240 For example, you might compile a file @code{some_class.m} like this:
2241
2242 @smallexample
2243 gcc -g -fgnu-runtime -O -c some_class.m
2244 @end smallexample
2245
2246 @noindent
2247 In this example, @option{-fgnu-runtime} is an option meant only for
2248 Objective-C and Objective-C++ programs; you can use the other options with
2249 any language supported by GCC@.
2250
2251 Note that since Objective-C is an extension of the C language, Objective-C
2252 compilations may also use options specific to the C front-end (e.g.,
2253 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
2254 C++-specific options (e.g., @option{-Wabi}).
2255
2256 Here is a list of options that are @emph{only} for compiling Objective-C
2257 and Objective-C++ programs:
2258
2259 @table @gcctabopt
2260 @item -fconstant-string-class=@var{class-name}
2261 @opindex fconstant-string-class
2262 Use @var{class-name} as the name of the class to instantiate for each
2263 literal string specified with the syntax @code{@@"@dots{}"}.  The default
2264 class name is @code{NXConstantString} if the GNU runtime is being used, and
2265 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
2266 @option{-fconstant-cfstrings} option, if also present, will override the
2267 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
2268 to be laid out as constant CoreFoundation strings.
2269
2270 @item -fgnu-runtime
2271 @opindex fgnu-runtime
2272 Generate object code compatible with the standard GNU Objective-C
2273 runtime.  This is the default for most types of systems.
2274
2275 @item -fnext-runtime
2276 @opindex fnext-runtime
2277 Generate output compatible with the NeXT runtime.  This is the default
2278 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
2279 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
2280 used.
2281
2282 @item -fno-nil-receivers
2283 @opindex fno-nil-receivers
2284 Assume that all Objective-C message dispatches (e.g.,
2285 @code{[receiver message:arg]}) in this translation unit ensure that the receiver
2286 is not @code{nil}.  This allows for more efficient entry points in the runtime
2287 to be used.  Currently, this option is only available in conjunction with
2288 the NeXT runtime on Mac OS X 10.3 and later.
2289
2290 @item -fobjc-call-cxx-cdtors
2291 @opindex fobjc-call-cxx-cdtors
2292 For each Objective-C class, check if any of its instance variables is a
2293 C++ object with a non-trivial default constructor.  If so, synthesize a
2294 special @code{- (id) .cxx_construct} instance method that will run
2295 non-trivial default constructors on any such instance variables, in order,
2296 and then return @code{self}.  Similarly, check if any instance variable
2297 is a C++ object with a non-trivial destructor, and if so, synthesize a
2298 special @code{- (void) .cxx_destruct} method that will run
2299 all such default destructors, in reverse order.
2300
2301 The @code{- (id) .cxx_construct} and/or @code{- (void) .cxx_destruct} methods
2302 thusly generated will only operate on instance variables declared in the
2303 current Objective-C class, and not those inherited from superclasses.  It
2304 is the responsibility of the Objective-C runtime to invoke all such methods
2305 in an object's inheritance hierarchy.  The @code{- (id) .cxx_construct} methods
2306 will be invoked by the runtime immediately after a new object
2307 instance is allocated; the @code{- (void) .cxx_destruct} methods will
2308 be invoked immediately before the runtime deallocates an object instance.
2309
2310 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
2311 support for invoking the @code{- (id) .cxx_construct} and
2312 @code{- (void) .cxx_destruct} methods.
2313
2314 @item -fobjc-direct-dispatch
2315 @opindex fobjc-direct-dispatch
2316 Allow fast jumps to the message dispatcher.  On Darwin this is
2317 accomplished via the comm page.
2318
2319 @item -fobjc-exceptions
2320 @opindex fobjc-exceptions
2321 Enable syntactic support for structured exception handling in Objective-C,
2322 similar to what is offered by C++ and Java.  This option is
2323 unavailable in conjunction with the NeXT runtime on Mac OS X 10.2 and
2324 earlier.
2325
2326 @smallexample
2327   @@try @{
2328     @dots{}
2329        @@throw expr;
2330     @dots{}
2331   @}
2332   @@catch (AnObjCClass *exc) @{
2333     @dots{}
2334       @@throw expr;
2335     @dots{}
2336       @@throw;
2337     @dots{}
2338   @}
2339   @@catch (AnotherClass *exc) @{
2340     @dots{}
2341   @}
2342   @@catch (id allOthers) @{
2343     @dots{}
2344   @}
2345   @@finally @{
2346     @dots{}
2347       @@throw expr;
2348     @dots{}
2349   @}
2350 @end smallexample
2351
2352 The @code{@@throw} statement may appear anywhere in an Objective-C or
2353 Objective-C++ program; when used inside of a @code{@@catch} block, the
2354 @code{@@throw} may appear without an argument (as shown above), in which case
2355 the object caught by the @code{@@catch} will be rethrown.
2356
2357 Note that only (pointers to) Objective-C objects may be thrown and
2358 caught using this scheme.  When an object is thrown, it will be caught
2359 by the nearest @code{@@catch} clause capable of handling objects of that type,
2360 analogously to how @code{catch} blocks work in C++ and Java.  A
2361 @code{@@catch(id @dots{})} clause (as shown above) may also be provided to catch
2362 any and all Objective-C exceptions not caught by previous @code{@@catch}
2363 clauses (if any).
2364
2365 The @code{@@finally} clause, if present, will be executed upon exit from the
2366 immediately preceding @code{@@try @dots{} @@catch} section.  This will happen
2367 regardless of whether any exceptions are thrown, caught or rethrown
2368 inside the @code{@@try @dots{} @@catch} section, analogously to the behavior
2369 of the @code{finally} clause in Java.
2370
2371 There are several caveats to using the new exception mechanism:
2372
2373 @itemize @bullet
2374 @item
2375 Although currently designed to be binary compatible with @code{NS_HANDLER}-style
2376 idioms provided by the @code{NSException} class, the new
2377 exceptions can only be used on Mac OS X 10.3 (Panther) and later
2378 systems, due to additional functionality needed in the (NeXT) Objective-C
2379 runtime.
2380
2381 @item
2382 As mentioned above, the new exceptions do not support handling
2383 types other than Objective-C objects.   Furthermore, when used from
2384 Objective-C++, the Objective-C exception model does not interoperate with C++
2385 exceptions at this time.  This means you cannot @code{@@throw} an exception
2386 from Objective-C and @code{catch} it in C++, or vice versa
2387 (i.e., @code{throw @dots{} @@catch}).
2388 @end itemize
2389
2390 The @option{-fobjc-exceptions} switch also enables the use of synchronization
2391 blocks for thread-safe execution:
2392
2393 @smallexample
2394   @@synchronized (ObjCClass *guard) @{
2395     @dots{}
2396   @}
2397 @end smallexample
2398
2399 Upon entering the @code{@@synchronized} block, a thread of execution shall
2400 first check whether a lock has been placed on the corresponding @code{guard}
2401 object by another thread.  If it has, the current thread shall wait until
2402 the other thread relinquishes its lock.  Once @code{guard} becomes available,
2403 the current thread will place its own lock on it, execute the code contained in
2404 the @code{@@synchronized} block, and finally relinquish the lock (thereby
2405 making @code{guard} available to other threads).
2406
2407 Unlike Java, Objective-C does not allow for entire methods to be marked
2408 @code{@@synchronized}.  Note that throwing exceptions out of
2409 @code{@@synchronized} blocks is allowed, and will cause the guarding object
2410 to be unlocked properly.
2411
2412 @item -fobjc-gc
2413 @opindex fobjc-gc
2414 Enable garbage collection (GC) in Objective-C and Objective-C++ programs.
2415
2416 @item -freplace-objc-classes
2417 @opindex freplace-objc-classes
2418 Emit a special marker instructing @command{ld(1)} not to statically link in
2419 the resulting object file, and allow @command{dyld(1)} to load it in at
2420 run time instead.  This is used in conjunction with the Fix-and-Continue
2421 debugging mode, where the object file in question may be recompiled and
2422 dynamically reloaded in the course of program execution, without the need
2423 to restart the program itself.  Currently, Fix-and-Continue functionality
2424 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
2425 and later.
2426
2427 @item -fzero-link
2428 @opindex fzero-link
2429 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
2430 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
2431 compile time) with static class references that get initialized at load time,
2432 which improves run-time performance.  Specifying the @option{-fzero-link} flag
2433 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
2434 to be retained.  This is useful in Zero-Link debugging mode, since it allows
2435 for individual class implementations to be modified during program execution.
2436
2437 @item -gen-decls
2438 @opindex gen-decls
2439 Dump interface declarations for all classes seen in the source file to a
2440 file named @file{@var{sourcename}.decl}.
2441
2442 @item -Wassign-intercept @r{(Objective-C and Objective-C++ only)}
2443 @opindex Wassign-intercept
2444 @opindex Wno-assign-intercept
2445 Warn whenever an Objective-C assignment is being intercepted by the
2446 garbage collector.
2447
2448 @item -Wno-protocol @r{(Objective-C and Objective-C++ only)}
2449 @opindex Wno-protocol
2450 @opindex Wprotocol
2451 If a class is declared to implement a protocol, a warning is issued for
2452 every method in the protocol that is not implemented by the class.  The
2453 default behavior is to issue a warning for every method not explicitly
2454 implemented in the class, even if a method implementation is inherited
2455 from the superclass.  If you use the @option{-Wno-protocol} option, then
2456 methods inherited from the superclass are considered to be implemented,
2457 and no warning is issued for them.
2458
2459 @item -Wselector @r{(Objective-C and Objective-C++ only)}
2460 @opindex Wselector
2461 @opindex Wno-selector
2462 Warn if multiple methods of different types for the same selector are
2463 found during compilation.  The check is performed on the list of methods
2464 in the final stage of compilation.  Additionally, a check is performed
2465 for each selector appearing in a @code{@@selector(@dots{})}
2466 expression, and a corresponding method for that selector has been found
2467 during compilation.  Because these checks scan the method table only at
2468 the end of compilation, these warnings are not produced if the final
2469 stage of compilation is not reached, for example because an error is
2470 found during compilation, or because the @option{-fsyntax-only} option is
2471 being used.
2472
2473 @item -Wstrict-selector-match @r{(Objective-C and Objective-C++ only)}
2474 @opindex Wstrict-selector-match
2475 @opindex Wno-strict-selector-match
2476 Warn if multiple methods with differing argument and/or return types are
2477 found for a given selector when attempting to send a message using this
2478 selector to a receiver of type @code{id} or @code{Class}.  When this flag
2479 is off (which is the default behavior), the compiler will omit such warnings
2480 if any differences found are confined to types which share the same size
2481 and alignment.
2482
2483 @item -Wundeclared-selector @r{(Objective-C and Objective-C++ only)}
2484 @opindex Wundeclared-selector
2485 @opindex Wno-undeclared-selector
2486 Warn if a @code{@@selector(@dots{})} expression referring to an
2487 undeclared selector is found.  A selector is considered undeclared if no
2488 method with that name has been declared before the
2489 @code{@@selector(@dots{})} expression, either explicitly in an
2490 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
2491 an @code{@@implementation} section.  This option always performs its
2492 checks as soon as a @code{@@selector(@dots{})} expression is found,
2493 while @option{-Wselector} only performs its checks in the final stage of
2494 compilation.  This also enforces the coding style convention
2495 that methods and selectors must be declared before being used.
2496
2497 @item -print-objc-runtime-info
2498 @opindex print-objc-runtime-info
2499 Generate C header describing the largest structure that is passed by
2500 value, if any.
2501
2502 @end table
2503
2504 @node Language Independent Options
2505 @section Options to Control Diagnostic Messages Formatting
2506 @cindex options to control diagnostics formatting
2507 @cindex diagnostic messages
2508 @cindex message formatting
2509
2510 Traditionally, diagnostic messages have been formatted irrespective of
2511 the output device's aspect (e.g.@: its width, @dots{}).  The options described
2512 below can be used to control the diagnostic messages formatting
2513 algorithm, e.g.@: how many characters per line, how often source location
2514 information should be reported.  Right now, only the C++ front end can
2515 honor these options.  However it is expected, in the near future, that
2516 the remaining front ends would be able to digest them correctly.
2517
2518 @table @gcctabopt
2519 @item -fmessage-length=@var{n}
2520 @opindex fmessage-length
2521 Try to format error messages so that they fit on lines of about @var{n}
2522 characters.  The default is 72 characters for @command{g++} and 0 for the rest of
2523 the front ends supported by GCC@.  If @var{n} is zero, then no
2524 line-wrapping will be done; each error message will appear on a single
2525 line.
2526
2527 @opindex fdiagnostics-show-location
2528 @item -fdiagnostics-show-location=once
2529 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
2530 reporter to emit @emph{once} source location information; that is, in
2531 case the message is too long to fit on a single physical line and has to
2532 be wrapped, the source location won't be emitted (as prefix) again,
2533 over and over, in subsequent continuation lines.  This is the default
2534 behavior.
2535
2536 @item -fdiagnostics-show-location=every-line
2537 Only meaningful in line-wrapping mode.  Instructs the diagnostic
2538 messages reporter to emit the same source location information (as
2539 prefix) for physical lines that result from the process of breaking
2540 a message which is too long to fit on a single line.
2541
2542 @item -fdiagnostics-show-option
2543 @opindex fdiagnostics-show-option
2544 This option instructs the diagnostic machinery to add text to each
2545 diagnostic emitted, which indicates which command line option directly
2546 controls that diagnostic, when such an option is known to the
2547 diagnostic machinery.
2548
2549 @item -Wcoverage-mismatch
2550 @opindex Wcoverage-mismatch
2551 Warn if feedback profiles do not match when using the
2552 @option{-fprofile-use} option.
2553 If a source file was changed between @option{-fprofile-gen} and
2554 @option{-fprofile-use}, the files with the profile feedback can fail
2555 to match the source file and GCC can not use the profile feedback
2556 information.  By default, GCC emits an error message in this case.
2557 The option @option{-Wcoverage-mismatch} emits a warning instead of an
2558 error.  GCC does not use appropriate feedback profiles, so using this
2559 option can result in poorly optimized code.  This option is useful
2560 only in the case of very minor changes such as bug fixes to an
2561 existing code-base.
2562
2563 @end table
2564
2565 @node Warning Options
2566 @section Options to Request or Suppress Warnings
2567 @cindex options to control warnings
2568 @cindex warning messages
2569 @cindex messages, warning
2570 @cindex suppressing warnings
2571
2572 Warnings are diagnostic messages that report constructions which
2573 are not inherently erroneous but which are risky or suggest there
2574 may have been an error.
2575
2576 The following language-independent options do not enable specific
2577 warnings but control the kinds of diagnostics produced by GCC.
2578
2579 @table @gcctabopt
2580 @cindex syntax checking
2581 @item -fsyntax-only
2582 @opindex fsyntax-only
2583 Check the code for syntax errors, but don't do anything beyond that.
2584
2585 @item -w
2586 @opindex w
2587 Inhibit all warning messages.
2588
2589 @item -Werror
2590 @opindex Werror
2591 @opindex Wno-error
2592 Make all warnings into errors.
2593
2594 @item -Werror=
2595 @opindex Werror=
2596 @opindex Wno-error=
2597 Make the specified warning into an error.  The specifier for a warning
2598 is appended, for example @option{-Werror=switch} turns the warnings
2599 controlled by @option{-Wswitch} into errors.  This switch takes a
2600 negative form, to be used to negate @option{-Werror} for specific
2601 warnings, for example @option{-Wno-error=switch} makes
2602 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
2603 is in effect.  You can use the @option{-fdiagnostics-show-option}
2604 option to have each controllable warning amended with the option which
2605 controls it, to determine what to use with this option.
2606
2607 Note that specifying @option{-Werror=}@var{foo} automatically implies
2608 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
2609 imply anything.
2610
2611 @item -Wfatal-errors
2612 @opindex Wfatal-errors
2613 @opindex Wno-fatal-errors
2614 This option causes the compiler to abort compilation on the first error
2615 occurred rather than trying to keep going and printing further error
2616 messages.
2617
2618 @end table
2619
2620 You can request many specific warnings with options beginning
2621 @samp{-W}, for example @option{-Wimplicit} to request warnings on
2622 implicit declarations.  Each of these specific warning options also
2623 has a negative form beginning @samp{-Wno-} to turn off warnings; for
2624 example, @option{-Wno-implicit}.  This manual lists only one of the
2625 two forms, whichever is not the default.  For further,
2626 language-specific options also refer to @ref{C++ Dialect Options} and
2627 @ref{Objective-C and Objective-C++ Dialect Options}.
2628
2629 @table @gcctabopt
2630 @item -pedantic
2631 @opindex pedantic
2632 Issue all the warnings demanded by strict ISO C and ISO C++;
2633 reject all programs that use forbidden extensions, and some other
2634 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
2635 version of the ISO C standard specified by any @option{-std} option used.
2636
2637 Valid ISO C and ISO C++ programs should compile properly with or without
2638 this option (though a rare few will require @option{-ansi} or a
2639 @option{-std} option specifying the required version of ISO C)@.  However,
2640 without this option, certain GNU extensions and traditional C and C++
2641 features are supported as well.  With this option, they are rejected.
2642
2643 @option{-pedantic} does not cause warning messages for use of the
2644 alternate keywords whose names begin and end with @samp{__}.  Pedantic
2645 warnings are also disabled in the expression that follows
2646 @code{__extension__}.  However, only system header files should use
2647 these escape routes; application programs should avoid them.
2648 @xref{Alternate Keywords}.
2649
2650 Some users try to use @option{-pedantic} to check programs for strict ISO
2651 C conformance.  They soon find that it does not do quite what they want:
2652 it finds some non-ISO practices, but not all---only those for which
2653 ISO C @emph{requires} a diagnostic, and some others for which
2654 diagnostics have been added.
2655
2656 A feature to report any failure to conform to ISO C might be useful in
2657 some instances, but would require considerable additional work and would
2658 be quite different from @option{-pedantic}.  We don't have plans to
2659 support such a feature in the near future.
2660
2661 Where the standard specified with @option{-std} represents a GNU
2662 extended dialect of C, such as @samp{gnu89} or @samp{gnu99}, there is a
2663 corresponding @dfn{base standard}, the version of ISO C on which the GNU
2664 extended dialect is based.  Warnings from @option{-pedantic} are given
2665 where they are required by the base standard.  (It would not make sense
2666 for such warnings to be given only for features not in the specified GNU
2667 C dialect, since by definition the GNU dialects of C include all
2668 features the compiler supports with the given option, and there would be
2669 nothing to warn about.)
2670
2671 @item -pedantic-errors
2672 @opindex pedantic-errors
2673 Like @option{-pedantic}, except that errors are produced rather than
2674 warnings.
2675
2676 @item -Wall
2677 @opindex Wall
2678 @opindex Wno-all
2679 This enables all the warnings about constructions that some users
2680 consider questionable, and that are easy to avoid (or modify to
2681 prevent the warning), even in conjunction with macros.  This also
2682 enables some language-specific warnings described in @ref{C++ Dialect
2683 Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
2684
2685 @option{-Wall} turns on the following warning flags:
2686
2687 @gccoptlist{-Waddress   @gol
2688 -Warray-bounds @r{(only with} @option{-O2}@r{)}  @gol
2689 -Wc++0x-compat  @gol
2690 -Wchar-subscripts  @gol
2691 -Wimplicit-int  @gol
2692 -Wimplicit-function-declaration  @gol
2693 -Wcomment  @gol
2694 -Wformat   @gol
2695 -Wmain @r{(only for C/ObjC and unless} @option{-ffreestanding}@r{)}  @gol
2696 -Wmissing-braces  @gol
2697 -Wnonnull  @gol
2698 -Wparentheses  @gol
2699 -Wpointer-sign  @gol
2700 -Wreorder   @gol
2701 -Wreturn-type  @gol
2702 -Wsequence-point  @gol
2703 -Wsign-compare @r{(only in C++)}  @gol
2704 -Wstrict-aliasing  @gol
2705 -Wstrict-overflow=1  @gol
2706 -Wswitch  @gol
2707 -Wtrigraphs  @gol
2708 -Wuninitialized  @gol
2709 -Wunknown-pragmas  @gol
2710 -Wunused-function  @gol
2711 -Wunused-label     @gol
2712 -Wunused-value     @gol
2713 -Wunused-variable  @gol
2714 -Wvolatile-register-var @gol
2715 }
2716
2717 Note that some warning flags are not implied by @option{-Wall}.  Some of
2718 them warn about constructions that users generally do not consider
2719 questionable, but which occasionally you might wish to check for;
2720 others warn about constructions that are necessary or hard to avoid in
2721 some cases, and there is no simple way to modify the code to suppress
2722 the warning. Some of them are enabled by @option{-Wextra} but many of
2723 them must be enabled individually.
2724
2725 @item -Wextra
2726 @opindex W
2727 @opindex Wextra
2728 @opindex Wno-extra
2729 This enables some extra warning flags that are not enabled by
2730 @option{-Wall}. (This option used to be called @option{-W}.  The older
2731 name is still supported, but the newer name is more descriptive.)
2732
2733 @gccoptlist{-Wclobbered  @gol
2734 -Wempty-body  @gol
2735 -Wignored-qualifiers @gol
2736 -Wmissing-field-initializers  @gol
2737 -Wmissing-parameter-type @r{(C only)}  @gol
2738 -Wold-style-declaration @r{(C only)}  @gol
2739 -Woverride-init  @gol
2740 -Wsign-compare  @gol
2741 -Wtype-limits  @gol
2742 -Wuninitialized  @gol
2743 -Wunused-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)}  @gol
2744 }
2745
2746 The option @option{-Wextra} also prints warning messages for the
2747 following cases:
2748
2749 @itemize @bullet
2750
2751 @item
2752 A pointer is compared against integer zero with @samp{<}, @samp{<=},
2753 @samp{>}, or @samp{>=}.
2754
2755 @item 
2756 (C++ only) An enumerator and a non-enumerator both appear in a
2757 conditional expression.
2758
2759 @item 
2760 (C++ only) Ambiguous virtual bases.
2761
2762 @item 
2763 (C++ only) Subscripting an array which has been declared @samp{register}.
2764
2765 @item 
2766 (C++ only) Taking the address of a variable which has been declared
2767 @samp{register}.
2768
2769 @item 
2770 (C++ only) A base class is not initialized in a derived class' copy
2771 constructor.
2772
2773 @end itemize
2774
2775 @item -Wchar-subscripts
2776 @opindex Wchar-subscripts
2777 @opindex Wno-char-subscripts
2778 Warn if an array subscript has type @code{char}.  This is a common cause
2779 of error, as programmers often forget that this type is signed on some
2780 machines.
2781 This warning is enabled by @option{-Wall}.
2782
2783 @item -Wcomment
2784 @opindex Wcomment
2785 @opindex Wno-comment
2786 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
2787 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
2788 This warning is enabled by @option{-Wall}.
2789
2790 @item -Wformat
2791 @opindex Wformat
2792 @opindex Wno-format
2793 @opindex ffreestanding
2794 @opindex fno-builtin
2795 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
2796 the arguments supplied have types appropriate to the format string
2797 specified, and that the conversions specified in the format string make
2798 sense.  This includes standard functions, and others specified by format
2799 attributes (@pxref{Function Attributes}), in the @code{printf},
2800 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
2801 not in the C standard) families (or other target-specific families).
2802 Which functions are checked without format attributes having been
2803 specified depends on the standard version selected, and such checks of
2804 functions without the attribute specified are disabled by
2805 @option{-ffreestanding} or @option{-fno-builtin}.
2806
2807 The formats are checked against the format features supported by GNU
2808 libc version 2.2.  These include all ISO C90 and C99 features, as well
2809 as features from the Single Unix Specification and some BSD and GNU
2810 extensions.  Other library implementations may not support all these
2811 features; GCC does not support warning about features that go beyond a
2812 particular library's limitations.  However, if @option{-pedantic} is used
2813 with @option{-Wformat}, warnings will be given about format features not
2814 in the selected standard version (but not for @code{strfmon} formats,
2815 since those are not in any version of the C standard).  @xref{C Dialect
2816 Options,,Options Controlling C Dialect}.
2817
2818 Since @option{-Wformat} also checks for null format arguments for
2819 several functions, @option{-Wformat} also implies @option{-Wnonnull}.
2820
2821 @option{-Wformat} is included in @option{-Wall}.  For more control over some
2822 aspects of format checking, the options @option{-Wformat-y2k},
2823 @option{-Wno-format-extra-args}, @option{-Wno-format-zero-length},
2824 @option{-Wformat-nonliteral}, @option{-Wformat-security}, and
2825 @option{-Wformat=2} are available, but are not included in @option{-Wall}.
2826
2827 @item -Wformat-y2k
2828 @opindex Wformat-y2k
2829 @opindex Wno-format-y2k
2830 If @option{-Wformat} is specified, also warn about @code{strftime}
2831 formats which may yield only a two-digit year.
2832
2833 @item -Wno-format-contains-nul
2834 @opindex Wno-format-contains-nul
2835 @opindex Wformat-contains-nul
2836 If @option{-Wformat} is specified, do not warn about format strings that
2837 contain NUL bytes.
2838
2839 @item -Wno-format-extra-args
2840 @opindex Wno-format-extra-args
2841 @opindex Wformat-extra-args
2842 If @option{-Wformat} is specified, do not warn about excess arguments to a
2843 @code{printf} or @code{scanf} format function.  The C standard specifies
2844 that such arguments are ignored.
2845
2846 Where the unused arguments lie between used arguments that are
2847 specified with @samp{$} operand number specifications, normally
2848 warnings are still given, since the implementation could not know what
2849 type to pass to @code{va_arg} to skip the unused arguments.  However,
2850 in the case of @code{scanf} formats, this option will suppress the
2851 warning if the unused arguments are all pointers, since the Single
2852 Unix Specification says that such unused arguments are allowed.
2853
2854 @item -Wno-format-zero-length @r{(C and Objective-C only)}
2855 @opindex Wno-format-zero-length
2856 @opindex Wformat-zero-length
2857 If @option{-Wformat} is specified, do not warn about zero-length formats.
2858 The C standard specifies that zero-length formats are allowed.
2859
2860 @item -Wformat-nonliteral
2861 @opindex Wformat-nonliteral
2862 @opindex Wno-format-nonliteral
2863 If @option{-Wformat} is specified, also warn if the format string is not a
2864 string literal and so cannot be checked, unless the format function
2865 takes its format arguments as a @code{va_list}.
2866
2867 @item -Wformat-security
2868 @opindex Wformat-security
2869 @opindex Wno-format-security
2870 If @option{-Wformat} is specified, also warn about uses of format
2871 functions that represent possible security problems.  At present, this
2872 warns about calls to @code{printf} and @code{scanf} functions where the
2873 format string is not a string literal and there are no format arguments,
2874 as in @code{printf (foo);}.  This may be a security hole if the format
2875 string came from untrusted input and contains @samp{%n}.  (This is
2876 currently a subset of what @option{-Wformat-nonliteral} warns about, but
2877 in future warnings may be added to @option{-Wformat-security} that are not
2878 included in @option{-Wformat-nonliteral}.)
2879
2880 @item -Wformat=2
2881 @opindex Wformat=2
2882 @opindex Wno-format=2
2883 Enable @option{-Wformat} plus format checks not included in
2884 @option{-Wformat}.  Currently equivalent to @samp{-Wformat
2885 -Wformat-nonliteral -Wformat-security -Wformat-y2k}.
2886
2887 @item -Wnonnull @r{(C and Objective-C only)}
2888 @opindex Wnonnull
2889 @opindex Wno-nonnull
2890 Warn about passing a null pointer for arguments marked as
2891 requiring a non-null value by the @code{nonnull} function attribute.
2892
2893 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
2894 can be disabled with the @option{-Wno-nonnull} option.
2895
2896 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
2897 @opindex Winit-self
2898 @opindex Wno-init-self
2899 Warn about uninitialized variables which are initialized with themselves.
2900 Note this option can only be used with the @option{-Wuninitialized} option.
2901
2902 For example, GCC will warn about @code{i} being uninitialized in the
2903 following snippet only when @option{-Winit-self} has been specified:
2904 @smallexample
2905 @group
2906 int f()
2907 @{
2908   int i = i;
2909   return i;
2910 @}
2911 @end group
2912 @end smallexample
2913
2914 @item -Wimplicit-int @r{(C and Objective-C only)}
2915 @opindex Wimplicit-int
2916 @opindex Wno-implicit-int
2917 Warn when a declaration does not specify a type.
2918 This warning is enabled by @option{-Wall}.
2919
2920 @item -Wimplicit-function-declaration @r{(C and Objective-C only)}
2921 @opindex Wimplicit-function-declaration
2922 @opindex Wno-implicit-function-declaration
2923 Give a warning whenever a function is used before being declared. In
2924 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
2925 enabled by default and it is made into an error by
2926 @option{-pedantic-errors}. This warning is also enabled by
2927 @option{-Wall}.
2928
2929 @item -Wimplicit
2930 @opindex Wimplicit
2931 @opindex Wno-implicit
2932 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
2933 This warning is enabled by @option{-Wall}.
2934
2935 @item -Wignored-qualifiers @r{(C and C++ only)}
2936 @opindex Wignored-qualifiers
2937 @opindex Wno-ignored-qualifiers
2938 Warn if the return type of a function has a type qualifier
2939 such as @code{const}.  For ISO C such a type qualifier has no effect,
2940 since the value returned by a function is not an lvalue.
2941 For C++, the warning is only emitted for scalar types or @code{void}.
2942 ISO C prohibits qualified @code{void} return types on function
2943 definitions, so such return types always receive a warning
2944 even without this option.
2945
2946 This warning is also enabled by @option{-Wextra}.
2947
2948 @item -Wmain
2949 @opindex Wmain
2950 @opindex Wno-main
2951 Warn if the type of @samp{main} is suspicious.  @samp{main} should be
2952 a function with external linkage, returning int, taking either zero
2953 arguments, two, or three arguments of appropriate types.  This warning
2954 is enabled by default in C++ and is enabled by either @option{-Wall}
2955 or @option{-pedantic}.
2956
2957 @item -Wmissing-braces
2958 @opindex Wmissing-braces
2959 @opindex Wno-missing-braces
2960 Warn if an aggregate or union initializer is not fully bracketed.  In
2961 the following example, the initializer for @samp{a} is not fully
2962 bracketed, but that for @samp{b} is fully bracketed.
2963
2964 @smallexample
2965 int a[2][2] = @{ 0, 1, 2, 3 @};
2966 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
2967 @end smallexample
2968
2969 This warning is enabled by @option{-Wall}.
2970
2971 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
2972 @opindex Wmissing-include-dirs
2973 @opindex Wno-missing-include-dirs
2974 Warn if a user-supplied include directory does not exist.
2975
2976 @item -Wparentheses
2977 @opindex Wparentheses
2978 @opindex Wno-parentheses
2979 Warn if parentheses are omitted in certain contexts, such
2980 as when there is an assignment in a context where a truth value
2981 is expected, or when operators are nested whose precedence people
2982 often get confused about.
2983
2984 Also warn if a comparison like @samp{x<=y<=z} appears; this is
2985 equivalent to @samp{(x<=y ? 1 : 0) <= z}, which is a different
2986 interpretation from that of ordinary mathematical notation.
2987
2988 Also warn about constructions where there may be confusion to which
2989 @code{if} statement an @code{else} branch belongs.  Here is an example of
2990 such a case:
2991
2992 @smallexample
2993 @group
2994 @{
2995   if (a)
2996     if (b)
2997       foo ();
2998   else
2999     bar ();
3000 @}
3001 @end group
3002 @end smallexample
3003
3004 In C/C++, every @code{else} branch belongs to the innermost possible
3005 @code{if} statement, which in this example is @code{if (b)}.  This is
3006 often not what the programmer expected, as illustrated in the above
3007 example by indentation the programmer chose.  When there is the
3008 potential for this confusion, GCC will issue a warning when this flag
3009 is specified.  To eliminate the warning, add explicit braces around
3010 the innermost @code{if} statement so there is no way the @code{else}
3011 could belong to the enclosing @code{if}.  The resulting code would
3012 look like this:
3013
3014 @smallexample
3015 @group
3016 @{
3017   if (a)
3018     @{
3019       if (b)
3020         foo ();
3021       else
3022         bar ();
3023     @}
3024 @}
3025 @end group
3026 @end smallexample
3027
3028 This warning is enabled by @option{-Wall}.
3029
3030 @item -Wsequence-point
3031 @opindex Wsequence-point
3032 @opindex Wno-sequence-point
3033 Warn about code that may have undefined semantics because of violations
3034 of sequence point rules in the C and C++ standards.
3035
3036 The C and C++ standards defines the order in which expressions in a C/C++
3037 program are evaluated in terms of @dfn{sequence points}, which represent
3038 a partial ordering between the execution of parts of the program: those
3039 executed before the sequence point, and those executed after it.  These
3040 occur after the evaluation of a full expression (one which is not part
3041 of a larger expression), after the evaluation of the first operand of a
3042 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
3043 function is called (but after the evaluation of its arguments and the
3044 expression denoting the called function), and in certain other places.
3045 Other than as expressed by the sequence point rules, the order of
3046 evaluation of subexpressions of an expression is not specified.  All
3047 these rules describe only a partial order rather than a total order,
3048 since, for example, if two functions are called within one expression
3049 with no sequence point between them, the order in which the functions
3050 are called is not specified.  However, the standards committee have
3051 ruled that function calls do not overlap.
3052
3053 It is not specified when between sequence points modifications to the
3054 values of objects take effect.  Programs whose behavior depends on this
3055 have undefined behavior; the C and C++ standards specify that ``Between
3056 the previous and next sequence point an object shall have its stored
3057 value modified at most once by the evaluation of an expression.
3058 Furthermore, the prior value shall be read only to determine the value
3059 to be stored.''.  If a program breaks these rules, the results on any
3060 particular implementation are entirely unpredictable.
3061
3062 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
3063 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
3064 diagnosed by this option, and it may give an occasional false positive
3065 result, but in general it has been found fairly effective at detecting
3066 this sort of problem in programs.
3067
3068 The standard is worded confusingly, therefore there is some debate
3069 over the precise meaning of the sequence point rules in subtle cases.
3070 Links to discussions of the problem, including proposed formal
3071 definitions, may be found on the GCC readings page, at
3072 @w{@uref{http://gcc.gnu.org/readings.html}}.
3073
3074 This warning is enabled by @option{-Wall} for C and C++.
3075
3076 @item -Wreturn-type
3077 @opindex Wreturn-type
3078 @opindex Wno-return-type
3079 Warn whenever a function is defined with a return-type that defaults
3080 to @code{int}.  Also warn about any @code{return} statement with no
3081 return-value in a function whose return-type is not @code{void}
3082 (falling off the end of the function body is considered returning
3083 without a value), and about a @code{return} statement with a
3084 expression in a function whose return-type is @code{void}.
3085
3086 For C++, a function without return type always produces a diagnostic
3087 message, even when @option{-Wno-return-type} is specified.  The only
3088 exceptions are @samp{main} and functions defined in system headers.
3089
3090 This warning is enabled by @option{-Wall}.
3091
3092 @item -Wswitch
3093 @opindex Wswitch
3094 @opindex Wno-switch
3095 Warn whenever a @code{switch} statement has an index of enumerated type
3096 and lacks a @code{case} for one or more of the named codes of that
3097 enumeration.  (The presence of a @code{default} label prevents this
3098 warning.)  @code{case} labels outside the enumeration range also
3099 provoke warnings when this option is used.
3100 This warning is enabled by @option{-Wall}.
3101
3102 @item -Wswitch-default
3103 @opindex Wswitch-default
3104 @opindex Wno-switch-default
3105 Warn whenever a @code{switch} statement does not have a @code{default}
3106 case.
3107
3108 @item -Wswitch-enum
3109 @opindex Wswitch-enum
3110 @opindex Wno-switch-enum
3111 Warn whenever a @code{switch} statement has an index of enumerated type
3112 and lacks a @code{case} for one or more of the named codes of that
3113 enumeration.  @code{case} labels outside the enumeration range also
3114 provoke warnings when this option is used.
3115
3116 @item -Wtrigraphs
3117 @opindex Wtrigraphs
3118 @opindex Wno-trigraphs
3119 Warn if any trigraphs are encountered that might change the meaning of
3120 the program (trigraphs within comments are not warned about).
3121 This warning is enabled by @option{-Wall}.
3122
3123 @item -Wunused-function
3124 @opindex Wunused-function
3125 @opindex Wno-unused-function
3126 Warn whenever a static function is declared but not defined or a
3127 non-inline static function is unused.
3128 This warning is enabled by @option{-Wall}.
3129
3130 @item -Wunused-label
3131 @opindex Wunused-label
3132 @opindex Wno-unused-label
3133 Warn whenever a label is declared but not used.
3134 This warning is enabled by @option{-Wall}.
3135
3136 To suppress this warning use the @samp{unused} attribute
3137 (@pxref{Variable Attributes}).
3138
3139 @item -Wunused-parameter
3140 @opindex Wunused-parameter
3141 @opindex Wno-unused-parameter
3142 Warn whenever a function parameter is unused aside from its declaration.
3143
3144 To suppress this warning use the @samp{unused} attribute
3145 (@pxref{Variable Attributes}).
3146
3147 @item -Wunused-variable
3148 @opindex Wunused-variable
3149 @opindex Wno-unused-variable
3150 Warn whenever a local variable or non-constant static variable is unused
3151 aside from its declaration.
3152 This warning is enabled by @option{-Wall}.
3153
3154 To suppress this warning use the @samp{unused} attribute
3155 (@pxref{Variable Attributes}).
3156
3157 @item -Wunused-value
3158 @opindex Wunused-value
3159 @opindex Wno-unused-value
3160 Warn whenever a statement computes a result that is explicitly not
3161 used. To suppress this warning cast the unused expression to
3162 @samp{void}. This includes an expression-statement or the left-hand
3163 side of a comma expression that contains no side effects. For example,
3164 an expression such as @samp{x[i,j]} will cause a warning, while
3165 @samp{x[(void)i,j]} will not.
3166
3167 This warning is enabled by @option{-Wall}.
3168
3169 @item -Wunused
3170 @opindex Wunused
3171 @opindex Wno-unused
3172 All the above @option{-Wunused} options combined.
3173
3174 In order to get a warning about an unused function parameter, you must
3175 either specify @samp{-Wextra -Wunused} (note that @samp{-Wall} implies
3176 @samp{-Wunused}), or separately specify @option{-Wunused-parameter}.
3177
3178 @item -Wuninitialized
3179 @opindex Wuninitialized
3180 @opindex Wno-uninitialized
3181 Warn if an automatic variable is used without first being initialized
3182 or if a variable may be clobbered by a @code{setjmp} call. In C++,
3183 warn if a non-static reference or non-static @samp{const} member
3184 appears in a class without constructors.
3185
3186 If you want to warn about code which uses the uninitialized value of the
3187 variable in its own initializer, use the @option{-Winit-self} option.
3188
3189 These warnings occur for individual uninitialized or clobbered
3190 elements of structure, union or array variables as well as for
3191 variables which are uninitialized or clobbered as a whole.  They do
3192 not occur for variables or elements declared @code{volatile}.  Because
3193 these warnings depend on optimization, the exact variables or elements
3194 for which there are warnings will depend on the precise optimization
3195 options and version of GCC used.
3196
3197 Note that there may be no warning about a variable that is used only
3198 to compute a value that itself is never used, because such
3199 computations may be deleted by data flow analysis before the warnings
3200 are printed.
3201
3202 These warnings are made optional because GCC is not smart
3203 enough to see all the reasons why the code might be correct
3204 despite appearing to have an error.  Here is one example of how
3205 this can happen:
3206
3207 @smallexample
3208 @group
3209 @{
3210   int x;
3211   switch (y)
3212     @{
3213     case 1: x = 1;
3214       break;
3215     case 2: x = 4;
3216       break;
3217     case 3: x = 5;
3218     @}
3219   foo (x);
3220 @}
3221 @end group
3222 @end smallexample
3223
3224 @noindent
3225 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
3226 always initialized, but GCC doesn't know this.  Here is
3227 another common case:
3228
3229 @smallexample
3230 @{
3231   int save_y;
3232   if (change_y) save_y = y, y = new_y;
3233   @dots{}
3234   if (change_y) y = save_y;
3235 @}
3236 @end smallexample
3237
3238 @noindent
3239 This has no bug because @code{save_y} is used only if it is set.
3240
3241 @cindex @code{longjmp} warnings
3242 This option also warns when a non-volatile automatic variable might be
3243 changed by a call to @code{longjmp}.  These warnings as well are possible
3244 only in optimizing compilation.
3245
3246 The compiler sees only the calls to @code{setjmp}.  It cannot know
3247 where @code{longjmp} will be called; in fact, a signal handler could
3248 call it at any point in the code.  As a result, you may get a warning
3249 even when there is in fact no problem because @code{longjmp} cannot
3250 in fact be called at the place which would cause a problem.
3251
3252 Some spurious warnings can be avoided if you declare all the functions
3253 you use that never return as @code{noreturn}.  @xref{Function
3254 Attributes}.
3255
3256 This warning is enabled by @option{-Wall} or @option{-Wextra}.
3257
3258 @item -Wunknown-pragmas
3259 @opindex Wunknown-pragmas
3260 @opindex Wno-unknown-pragmas
3261 @cindex warning for unknown pragmas
3262 @cindex unknown pragmas, warning
3263 @cindex pragmas, warning of unknown
3264 Warn when a #pragma directive is encountered which is not understood by
3265 GCC@.  If this command line option is used, warnings will even be issued
3266 for unknown pragmas in system header files.  This is not the case if
3267 the warnings were only enabled by the @option{-Wall} command line option.
3268
3269 @item -Wno-pragmas
3270 @opindex Wno-pragmas
3271 @opindex Wpragmas
3272 Do not warn about misuses of pragmas, such as incorrect parameters,
3273 invalid syntax, or conflicts between pragmas.  See also
3274 @samp{-Wunknown-pragmas}.
3275
3276 @item -Wstrict-aliasing
3277 @opindex Wstrict-aliasing
3278 @opindex Wno-strict-aliasing
3279 This option is only active when @option{-fstrict-aliasing} is active.
3280 It warns about code which might break the strict aliasing rules that the
3281 compiler is using for optimization.  The warning does not catch all
3282 cases, but does attempt to catch the more common pitfalls.  It is
3283 included in @option{-Wall}.
3284 It is equivalent to @option{-Wstrict-aliasing=3}
3285
3286 @item -Wstrict-aliasing=n
3287 @opindex Wstrict-aliasing=n
3288 @opindex Wno-strict-aliasing=n
3289 This option is only active when @option{-fstrict-aliasing} is active.
3290 It warns about code which might break the strict aliasing rules that the
3291 compiler is using for optimization.
3292 Higher levels correspond to higher accuracy (fewer false positives).
3293 Higher levels also correspond to more effort, similar to the way -O works.
3294 @option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=n},
3295 with n=3.
3296
3297 Level 1: Most aggressive, quick, least accurate.
3298 Possibly useful when higher levels
3299 do not warn but -fstrict-aliasing still breaks the code, as it has very few 
3300 false negatives.  However, it has many false positives.
3301 Warns for all pointer conversions between possibly incompatible types, 
3302 even if never dereferenced.  Runs in the frontend only.
3303
3304 Level 2: Aggressive, quick, not too precise.
3305 May still have many false positives (not as many as level 1 though),
3306 and few false negatives (but possibly more than level 1).
3307 Unlike level 1, it only warns when an address is taken.  Warns about
3308 incomplete types.  Runs in the frontend only.
3309
3310 Level 3 (default for @option{-Wstrict-aliasing}): 
3311 Should have very few false positives and few false 
3312 negatives.  Slightly slower than levels 1 or 2 when optimization is enabled.
3313 Takes care of the common punn+dereference pattern in the frontend:
3314 @code{*(int*)&some_float}.
3315 If optimization is enabled, it also runs in the backend, where it deals 
3316 with multiple statement cases using flow-sensitive points-to information.
3317 Only warns when the converted pointer is dereferenced.
3318 Does not warn about incomplete types.
3319
3320 @item -Wstrict-overflow
3321 @itemx -Wstrict-overflow=@var{n}
3322 @opindex Wstrict-overflow
3323 @opindex Wno-strict-overflow
3324 This option is only active when @option{-fstrict-overflow} is active.
3325 It warns about cases where the compiler optimizes based on the
3326 assumption that signed overflow does not occur.  Note that it does not
3327 warn about all cases where the code might overflow: it only warns
3328 about cases where the compiler implements some optimization.  Thus
3329 this warning depends on the optimization level.
3330
3331 An optimization which assumes that signed overflow does not occur is
3332 perfectly safe if the values of the variables involved are such that
3333 overflow never does, in fact, occur.  Therefore this warning can
3334 easily give a false positive: a warning about code which is not
3335 actually a problem.  To help focus on important issues, several
3336 warning levels are defined.  No warnings are issued for the use of
3337 undefined signed overflow when estimating how many iterations a loop
3338 will require, in particular when determining whether a loop will be
3339 executed at all.
3340
3341 @table @gcctabopt
3342 @item -Wstrict-overflow=1
3343 Warn about cases which are both questionable and easy to avoid.  For
3344 example: @code{x + 1 > x}; with @option{-fstrict-overflow}, the
3345 compiler will simplify this to @code{1}.  This level of
3346 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
3347 are not, and must be explicitly requested.
3348
3349 @item -Wstrict-overflow=2
3350 Also warn about other cases where a comparison is simplified to a
3351 constant.  For example: @code{abs (x) >= 0}.  This can only be
3352 simplified when @option{-fstrict-overflow} is in effect, because
3353 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
3354 zero.  @option{-Wstrict-overflow} (with no level) is the same as
3355 @option{-Wstrict-overflow=2}.
3356
3357 @item -Wstrict-overflow=3
3358 Also warn about other cases where a comparison is simplified.  For
3359 example: @code{x + 1 > 1} will be simplified to @code{x > 0}.
3360
3361 @item -Wstrict-overflow=4
3362 Also warn about other simplifications not covered by the above cases.
3363 For example: @code{(x * 10) / 5} will be simplified to @code{x * 2}.
3364
3365 @item -Wstrict-overflow=5
3366 Also warn about cases where the compiler reduces the magnitude of a
3367 constant involved in a comparison.  For example: @code{x + 2 > y} will
3368 be simplified to @code{x + 1 >= y}.  This is reported only at the
3369 highest warning level because this simplification applies to many
3370 comparisons, so this warning level will give a very large number of
3371 false positives.
3372 @end table
3373
3374 @item -Warray-bounds
3375 @opindex Wno-array-bounds
3376 @opindex Warray-bounds
3377 This option is only active when @option{-ftree-vrp} is active
3378 (default for -O2 and above). It warns about subscripts to arrays
3379 that are always out of bounds. This warning is enabled by @option{-Wall}.
3380
3381 @item -Wno-div-by-zero
3382 @opindex Wno-div-by-zero
3383 @opindex Wdiv-by-zero
3384 Do not warn about compile-time integer division by zero.  Floating point
3385 division by zero is not warned about, as it can be a legitimate way of
3386 obtaining infinities and NaNs.
3387
3388 @item -Wsystem-headers
3389 @opindex Wsystem-headers
3390 @opindex Wno-system-headers
3391 @cindex warnings from system headers
3392 @cindex system headers, warnings from
3393 Print warning messages for constructs found in system header files.
3394 Warnings from system headers are normally suppressed, on the assumption
3395 that they usually do not indicate real problems and would only make the
3396 compiler output harder to read.  Using this command line option tells
3397 GCC to emit warnings from system headers as if they occurred in user
3398 code.  However, note that using @option{-Wall} in conjunction with this
3399 option will @emph{not} warn about unknown pragmas in system
3400 headers---for that, @option{-Wunknown-pragmas} must also be used.
3401
3402 @item -Wfloat-equal
3403 @opindex Wfloat-equal
3404 @opindex Wno-float-equal
3405 Warn if floating point values are used in equality comparisons.
3406
3407 The idea behind this is that sometimes it is convenient (for the
3408 programmer) to consider floating-point values as approximations to
3409 infinitely precise real numbers.  If you are doing this, then you need
3410 to compute (by analyzing the code, or in some other way) the maximum or
3411 likely maximum error that the computation introduces, and allow for it
3412 when performing comparisons (and when producing output, but that's a
3413 different problem).  In particular, instead of testing for equality, you
3414 would check to see whether the two values have ranges that overlap; and
3415 this is done with the relational operators, so equality comparisons are
3416 probably mistaken.
3417
3418 @item -Wtraditional @r{(C and Objective-C only)}
3419 @opindex Wtraditional
3420 @opindex Wno-traditional
3421 Warn about certain constructs that behave differently in traditional and
3422 ISO C@.  Also warn about ISO C constructs that have no traditional C
3423 equivalent, and/or problematic constructs which should be avoided.
3424
3425 @itemize @bullet
3426 @item
3427 Macro parameters that appear within string literals in the macro body.
3428 In traditional C macro replacement takes place within string literals,
3429 but does not in ISO C@.
3430
3431 @item
3432 In traditional C, some preprocessor directives did not exist.
3433 Traditional preprocessors would only consider a line to be a directive
3434 if the @samp{#} appeared in column 1 on the line.  Therefore
3435 @option{-Wtraditional} warns about directives that traditional C
3436 understands but would ignore because the @samp{#} does not appear as the
3437 first character on the line.  It also suggests you hide directives like
3438 @samp{#pragma} not understood by traditional C by indenting them.  Some
3439 traditional implementations would not recognize @samp{#elif}, so it
3440 suggests avoiding it altogether.
3441
3442 @item
3443 A function-like macro that appears without arguments.
3444
3445 @item
3446 The unary plus operator.
3447
3448 @item
3449 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating point
3450 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
3451 constants.)  Note, these suffixes appear in macros defined in the system
3452 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
3453 Use of these macros in user code might normally lead to spurious
3454 warnings, however GCC's integrated preprocessor has enough context to
3455 avoid warning in these cases.
3456
3457 @item
3458 A function declared external in one block and then used after the end of
3459 the block.
3460
3461 @item
3462 A @code{switch} statement has an operand of type @code{long}.
3463
3464 @item
3465 A non-@code{static} function declaration follows a @code{static} one.
3466 This construct is not accepted by some traditional C compilers.
3467
3468 @item
3469 The ISO type of an integer constant has a different width or
3470 signedness from its traditional type.  This warning is only issued if
3471 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
3472 typically represent bit patterns, are not warned about.
3473
3474 @item
3475 Usage of ISO string concatenation is detected.
3476
3477 @item
3478 Initialization of automatic aggregates.
3479
3480 @item
3481 Identifier conflicts with labels.  Traditional C lacks a separate
3482 namespace for labels.
3483
3484 @item
3485 Initialization of unions.  If the initializer is zero, the warning is
3486 omitted.  This is done under the assumption that the zero initializer in
3487 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
3488 initializer warnings and relies on default initialization to zero in the
3489 traditional C case.
3490
3491 @item
3492 Conversions by prototypes between fixed/floating point values and vice
3493 versa.  The absence of these prototypes when compiling with traditional
3494 C would cause serious problems.  This is a subset of the possible
3495 conversion warnings, for the full set use @option{-Wtraditional-conversion}.
3496
3497 @item
3498 Use of ISO C style function definitions.  This warning intentionally is
3499 @emph{not} issued for prototype declarations or variadic functions
3500 because these ISO C features will appear in your code when using
3501 libiberty's traditional C compatibility macros, @code{PARAMS} and
3502 @code{VPARAMS}.  This warning is also bypassed for nested functions
3503 because that feature is already a GCC extension and thus not relevant to
3504 traditional C compatibility.
3505 @end itemize
3506
3507 @item -Wtraditional-conversion @r{(C and Objective-C only)}
3508 @opindex Wtraditional-conversion
3509 @opindex Wno-traditional-conversion
3510 Warn if a prototype causes a type conversion that is different from what
3511 would happen to the same argument in the absence of a prototype.  This
3512 includes conversions of fixed point to floating and vice versa, and
3513 conversions changing the width or signedness of a fixed point argument
3514 except when the same as the default promotion.
3515
3516 @item -Wdeclaration-after-statement @r{(C and Objective-C only)}
3517 @opindex Wdeclaration-after-statement
3518 @opindex Wno-declaration-after-statement
3519 Warn when a declaration is found after a statement in a block.  This
3520 construct, known from C++, was introduced with ISO C99 and is by default
3521 allowed in GCC@.  It is not supported by ISO C90 and was not supported by
3522 GCC versions before GCC 3.0.  @xref{Mixed Declarations}.
3523
3524 @item -Wundef
3525 @opindex Wundef
3526 @opindex Wno-undef
3527 Warn if an undefined identifier is evaluated in an @samp{#if} directive.
3528
3529 @item -Wno-endif-labels
3530 @opindex Wno-endif-labels
3531 @opindex Wendif-labels
3532 Do not warn whenever an @samp{#else} or an @samp{#endif} are followed by text.
3533
3534 @item -Wshadow
3535 @opindex Wshadow
3536 @opindex Wno-shadow
3537 Warn whenever a local variable shadows another local variable, parameter or
3538 global variable or whenever a built-in function is shadowed.
3539
3540 @item -Wlarger-than=@var{len}
3541 @opindex Wlarger-than=@var{len}
3542 @opindex Wlarger-than-@var{len}
3543 Warn whenever an object of larger than @var{len} bytes is defined.
3544
3545 @item -Wframe-larger-than=@var{len}
3546 @opindex Wframe-larger-than
3547 Warn if the size of a function frame is larger than @var{len} bytes.
3548 The computation done to determine the stack frame size is approximate
3549 and not conservative.
3550 The actual requirements may be somewhat greater than @var{len}
3551 even if you do not get a warning.  In addition, any space allocated
3552 via @code{alloca}, variable-length arrays, or related constructs
3553 is not included by the compiler when determining
3554 whether or not to issue a warning.
3555
3556 @item -Wunsafe-loop-optimizations
3557 @opindex Wunsafe-loop-optimizations
3558 @opindex Wno-unsafe-loop-optimizations
3559 Warn if the loop cannot be optimized because the compiler could not
3560 assume anything on the bounds of the loop indices.  With
3561 @option{-funsafe-loop-optimizations} warn if the compiler made
3562 such assumptions.
3563
3564 @item -Wpointer-arith
3565 @opindex Wpointer-arith
3566 @opindex Wno-pointer-arith
3567 Warn about anything that depends on the ``size of'' a function type or
3568 of @code{void}.  GNU C assigns these types a size of 1, for
3569 convenience in calculations with @code{void *} pointers and pointers
3570 to functions.  In C++, warn also when an arithmetic operation involves
3571 @code{NULL}.  This warning is also enabled by @option{-pedantic}.
3572
3573 @item -Wtype-limits
3574 @opindex Wtype-limits
3575 @opindex Wno-type-limits
3576 Warn if a comparison is always true or always false due to the limited
3577 range of the data type, but do not warn for constant expressions.  For
3578 example, warn if an unsigned variable is compared against zero with
3579 @samp{<} or @samp{>=}.  This warning is also enabled by
3580 @option{-Wextra}.
3581
3582 @item -Wbad-function-cast @r{(C and Objective-C only)}
3583 @opindex Wbad-function-cast
3584 @opindex Wno-bad-function-cast
3585 Warn whenever a function call is cast to a non-matching type.
3586 For example, warn if @code{int malloc()} is cast to @code{anything *}.
3587
3588 @item -Wc++-compat @r{(C and Objective-C only)}
3589 Warn about ISO C constructs that are outside of the common subset of
3590 ISO C and ISO C++, e.g.@: request for implicit conversion from
3591 @code{void *} to a pointer to non-@code{void} type.
3592
3593 @item -Wc++0x-compat @r{(C++ and Objective-C++ only)}
3594 Warn about C++ constructs whose meaning differs between ISO C++ 1998 and
3595 ISO C++ 200x, e.g., identifiers in ISO C++ 1998 that will become keywords
3596 in ISO C++ 200x.  This warning is enabled by @option{-Wall}.
3597
3598 @item -Wcast-qual
3599 @opindex Wcast-qual
3600 @opindex Wno-cast-qual
3601 Warn whenever a pointer is cast so as to remove a type qualifier from
3602 the target type.  For example, warn if a @code{const char *} is cast
3603 to an ordinary @code{char *}.
3604
3605 @item -Wcast-align
3606 @opindex Wcast-align
3607 @opindex Wno-cast-align
3608 Warn whenever a pointer is cast such that the required alignment of the
3609 target is increased.  For example, warn if a @code{char *} is cast to
3610 an @code{int *} on machines where integers can only be accessed at
3611 two- or four-byte boundaries.
3612
3613 @item -Wwrite-strings
3614 @opindex Wwrite-strings
3615 @opindex Wno-write-strings
3616 When compiling C, give string constants the type @code{const
3617 char[@var{length}]} so that copying the address of one into a
3618 non-@code{const} @code{char *} pointer will get a warning.  These
3619 warnings will help you find at compile time code that can try to write
3620 into a string constant, but only if you have been very careful about
3621 using @code{const} in declarations and prototypes.  Otherwise, it will
3622 just be a nuisance. This is why we did not make @option{-Wall} request
3623 these warnings.
3624
3625 When compiling C++, warn about the deprecated conversion from string
3626 literals to @code{char *}.  This warning is enabled by default for C++
3627 programs.
3628
3629 @item -Wclobbered
3630 @opindex Wclobbered
3631 @opindex Wno-clobbered
3632 Warn for variables that might be changed by @samp{longjmp} or
3633 @samp{vfork}.  This warning is also enabled by @option{-Wextra}.
3634
3635 @item -Wconversion
3636 @opindex Wconversion
3637 @opindex Wno-conversion
3638 Warn for implicit conversions that may alter a value. This includes
3639 conversions between real and integer, like @code{abs (x)} when
3640 @code{x} is @code{double}; conversions between signed and unsigned,
3641 like @code{unsigned ui = -1}; and conversions to smaller types, like
3642 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
3643 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
3644 changed by the conversion like in @code{abs (2.0)}.  Warnings about
3645 conversions between signed and unsigned integers can be disabled by
3646 using @option{-Wno-sign-conversion}.
3647
3648 For C++, also warn for conversions between @code{NULL} and non-pointer
3649 types; confusing overload resolution for user-defined conversions; and
3650 conversions that will never use a type conversion operator:
3651 conversions to @code{void}, the same type, a base class or a reference
3652 to them. Warnings about conversions between signed and unsigned
3653 integers are disabled by default in C++ unless
3654 @option{-Wsign-conversion} is explicitly enabled.
3655
3656 @item -Wempty-body
3657 @opindex Wempty-body
3658 @opindex Wno-empty-body
3659 Warn if an empty body occurs in an @samp{if}, @samp{else} or @samp{do
3660 while} statement.  Additionally, in C++, warn when an empty body occurs
3661 in a @samp{while} or @samp{for} statement with no whitespacing before
3662 the semicolon.  This warning is also enabled by @option{-Wextra}.
3663
3664 @item -Wenum-compare @r{(C++ and Objective-C++ only)}
3665 @opindex Wenum-compare
3666 @opindex Wno-enum-compare
3667 Warn about a comparison between values of different enum types. This
3668 warning is enabled by default.
3669
3670 @item -Wsign-compare
3671 @opindex Wsign-compare
3672 @opindex Wno-sign-compare
3673 @cindex warning for comparison of signed and unsigned values
3674 @cindex comparison of signed and unsigned values, warning
3675 @cindex signed and unsigned values, comparison warning
3676 Warn when a comparison between signed and unsigned values could produce
3677 an incorrect result when the signed value is converted to unsigned.
3678 This warning is also enabled by @option{-Wextra}; to get the other warnings
3679 of @option{-Wextra} without this warning, use @samp{-Wextra -Wno-sign-compare}.
3680
3681 @item -Wsign-conversion
3682 @opindex Wsign-conversion
3683 @opindex Wno-sign-conversion
3684 Warn for implicit conversions that may change the sign of an integer
3685 value, like assigning a signed integer expression to an unsigned
3686 integer variable. An explicit cast silences the warning. In C, this
3687 option is enabled also by @option{-Wconversion}.
3688
3689 @item -Waddress
3690 @opindex Waddress
3691 @opindex Wno-address
3692 Warn about suspicious uses of memory addresses. These include using
3693 the address of a function in a conditional expression, such as
3694 @code{void func(void); if (func)}, and comparisons against the memory
3695 address of a string literal, such as @code{if (x == "abc")}.  Such
3696 uses typically indicate a programmer error: the address of a function
3697 always evaluates to true, so their use in a conditional usually
3698 indicate that the programmer forgot the parentheses in a function
3699 call; and comparisons against string literals result in unspecified
3700 behavior and are not portable in C, so they usually indicate that the
3701 programmer intended to use @code{strcmp}.  This warning is enabled by
3702 @option{-Wall}.
3703
3704 @item -Wlogical-op
3705 @opindex Wlogical-op
3706 @opindex Wno-logical-op
3707 Warn about suspicious uses of logical operators in expressions.
3708 This includes using logical operators in contexts where a
3709 bit-wise operator is likely to be expected.
3710
3711 @item -Waggregate-return
3712 @opindex Waggregate-return
3713 @opindex Wno-aggregate-return
3714 Warn if any functions that return structures or unions are defined or
3715 called.  (In languages where you can return an array, this also elicits
3716 a warning.)
3717
3718 @item -Wno-attributes
3719 @opindex Wno-attributes
3720 @opindex Wattributes
3721 Do not warn if an unexpected @code{__attribute__} is used, such as
3722 unrecognized attributes, function attributes applied to variables,
3723 etc.  This will not stop errors for incorrect use of supported
3724 attributes.
3725
3726 @item -Wstrict-prototypes @r{(C and Objective-C only)}
3727 @opindex Wstrict-prototypes
3728 @opindex Wno-strict-prototypes
3729 Warn if a function is declared or defined without specifying the
3730 argument types.  (An old-style function definition is permitted without
3731 a warning if preceded by a declaration which specifies the argument
3732 types.)
3733
3734 @item -Wold-style-declaration @r{(C and Objective-C only)}
3735 @opindex Wold-style-declaration
3736 @opindex Wno-old-style-declaration
3737 Warn for obsolescent usages, according to the C Standard, in a
3738 declaration. For example, warn if storage-class specifiers like
3739 @code{static} are not the first things in a declaration.  This warning
3740 is also enabled by @option{-Wextra}.
3741
3742 @item -Wold-style-definition @r{(C and Objective-C only)}
3743 @opindex Wold-style-definition
3744 @opindex Wno-old-style-definition
3745 Warn if an old-style function definition is used.  A warning is given
3746 even if there is a previous prototype.
3747
3748 @item -Wmissing-parameter-type @r{(C and Objective-C only)}
3749 @opindex Wmissing-parameter-type
3750 @opindex Wno-missing-parameter-type
3751 A function parameter is declared without a type specifier in K&R-style
3752 functions:
3753
3754 @smallexample
3755 void foo(bar) @{ @}
3756 @end smallexample
3757
3758 This warning is also enabled by @option{-Wextra}.
3759
3760 @item -Wmissing-prototypes @r{(C and Objective-C only)}
3761 @opindex Wmissing-prototypes
3762 @opindex Wno-missing-prototypes
3763 Warn if a global function is defined without a previous prototype
3764 declaration.  This warning is issued even if the definition itself
3765 provides a prototype.  The aim is to detect global functions that fail
3766 to be declared in header files.
3767
3768 @item -Wmissing-declarations
3769 @opindex Wmissing-declarations
3770 @opindex Wno-missing-declarations
3771 Warn if a global function is defined without a previous declaration.
3772 Do so even if the definition itself provides a prototype.
3773 Use this option to detect global functions that are not declared in
3774 header files.  In C++, no warnings are issued for function templates,
3775 or for inline functions, or for functions in anonymous namespaces.
3776
3777 @item -Wmissing-field-initializers
3778 @opindex Wmissing-field-initializers
3779 @opindex Wno-missing-field-initializers
3780 @opindex W
3781 @opindex Wextra
3782 @opindex Wno-extra
3783 Warn if a structure's initializer has some fields missing.  For
3784 example, the following code would cause such a warning, because
3785 @code{x.h} is implicitly zero:
3786
3787 @smallexample
3788 struct s @{ int f, g, h; @};
3789 struct s x = @{ 3, 4 @};
3790 @end smallexample
3791
3792 This option does not warn about designated initializers, so the following
3793 modification would not trigger a warning:
3794
3795 @smallexample
3796 struct s @{ int f, g, h; @};
3797 struct s x = @{ .f = 3, .g = 4 @};
3798 @end smallexample
3799
3800 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
3801 warnings without this one, use @samp{-Wextra -Wno-missing-field-initializers}.
3802
3803 @item -Wmissing-noreturn
3804 @opindex Wmissing-noreturn
3805 @opindex Wno-missing-noreturn
3806 Warn about functions which might be candidates for attribute @code{noreturn}.
3807 Note these are only possible candidates, not absolute ones.  Care should
3808 be taken to manually verify functions actually do not ever return before
3809 adding the @code{noreturn} attribute, otherwise subtle code generation
3810 bugs could be introduced.  You will not get a warning for @code{main} in
3811 hosted C environments.
3812
3813 @item -Wmissing-format-attribute
3814 @opindex Wmissing-format-attribute
3815 @opindex Wno-missing-format-attribute
3816 @opindex Wformat
3817 @opindex Wno-format
3818 Warn about function pointers which might be candidates for @code{format}
3819 attributes.  Note these are only possible candidates, not absolute ones.
3820 GCC will guess that function pointers with @code{format} attributes that
3821 are used in assignment, initialization, parameter passing or return
3822 statements should have a corresponding @code{format} attribute in the
3823 resulting type.  I.e.@: the left-hand side of the assignment or
3824 initialization, the type of the parameter variable, or the return type
3825 of the containing function respectively should also have a @code{format}
3826 attribute to avoid the warning.
3827
3828 GCC will also warn about function definitions which might be
3829 candidates for @code{format} attributes.  Again, these are only
3830 possible candidates.  GCC will guess that @code{format} attributes
3831 might be appropriate for any function that calls a function like
3832 @code{vprintf} or @code{vscanf}, but this might not always be the
3833 case, and some functions for which @code{format} attributes are
3834 appropriate may not be detected.
3835
3836 @item -Wno-multichar
3837 @opindex Wno-multichar
3838 @opindex Wmultichar
3839 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
3840 Usually they indicate a typo in the user's code, as they have
3841 implementation-defined values, and should not be used in portable code.
3842
3843 @item -Wnormalized=<none|id|nfc|nfkc>
3844 @opindex Wnormalized=
3845 @cindex NFC
3846 @cindex NFKC
3847 @cindex character set, input normalization
3848 In ISO C and ISO C++, two identifiers are different if they are
3849 different sequences of characters.  However, sometimes when characters
3850 outside the basic ASCII character set are used, you can have two
3851 different character sequences that look the same.  To avoid confusion,
3852 the ISO 10646 standard sets out some @dfn{normalization rules} which
3853 when applied ensure that two sequences that look the same are turned into
3854 the same sequence.  GCC can warn you if you are using identifiers which
3855 have not been normalized; this option controls that warning.
3856
3857 There are four levels of warning that GCC supports.  The default is
3858 @option{-Wnormalized=nfc}, which warns about any identifier which is
3859 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
3860 recommended form for most uses.
3861
3862 Unfortunately, there are some characters which ISO C and ISO C++ allow
3863 in identifiers that when turned into NFC aren't allowable as
3864 identifiers.  That is, there's no way to use these symbols in portable
3865 ISO C or C++ and have all your identifiers in NFC@.
3866 @option{-Wnormalized=id} suppresses the warning for these characters.
3867 It is hoped that future versions of the standards involved will correct
3868 this, which is why this option is not the default.
3869
3870 You can switch the warning off for all characters by writing
3871 @option{-Wnormalized=none}.  You would only want to do this if you
3872 were using some other normalization scheme (like ``D''), because
3873 otherwise you can easily create bugs that are literally impossible to see.
3874
3875 Some characters in ISO 10646 have distinct meanings but look identical
3876 in some fonts or display methodologies, especially once formatting has
3877 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
3878 LETTER N'', will display just like a regular @code{n} which has been
3879 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
3880 normalization scheme to convert all these into a standard form as
3881 well, and GCC will warn if your code is not in NFKC if you use
3882 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
3883 about every identifier that contains the letter O because it might be
3884 confused with the digit 0, and so is not the default, but may be
3885 useful as a local coding convention if the programming environment is
3886 unable to be fixed to display these characters distinctly.
3887
3888 @item -Wno-deprecated
3889 @opindex Wno-deprecated
3890 @opindex Wdeprecated
3891 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
3892
3893 @item -Wno-deprecated-declarations
3894 @opindex Wno-deprecated-declarations
3895 @opindex Wdeprecated-declarations
3896 Do not warn about uses of functions (@pxref{Function Attributes}),
3897 variables (@pxref{Variable Attributes}), and types (@pxref{Type
3898 Attributes}) marked as deprecated by using the @code{deprecated}
3899 attribute.
3900
3901 @item -Wno-overflow
3902 @opindex Wno-overflow
3903 @opindex Woverflow
3904 Do not warn about compile-time overflow in constant expressions.
3905
3906 @item -Woverride-init @r{(C and Objective-C only)}
3907 @opindex Woverride-init
3908 @opindex Wno-override-init
3909 @opindex W
3910 @opindex Wextra
3911 @opindex Wno-extra
3912 Warn if an initialized field without side effects is overridden when
3913 using designated initializers (@pxref{Designated Inits, , Designated
3914 Initializers}).
3915
3916 This warning is included in @option{-Wextra}.  To get other
3917 @option{-Wextra} warnings without this one, use @samp{-Wextra
3918 -Wno-override-init}.
3919
3920 @item -Wpacked
3921 @opindex Wpacked
3922 @opindex Wno-packed
3923 Warn if a structure is given the packed attribute, but the packed
3924 attribute has no effect on the layout or size of the structure.
3925 Such structures may be mis-aligned for little benefit.  For
3926 instance, in this code, the variable @code{f.x} in @code{struct bar}
3927 will be misaligned even though @code{struct bar} does not itself
3928 have the packed attribute:
3929
3930 @smallexample
3931 @group
3932 struct foo @{
3933   int x;
3934   char a, b, c, d;
3935 @} __attribute__((packed));
3936 struct bar @{
3937   char z;
3938   struct foo f;
3939 @};
3940 @end group
3941 @end smallexample
3942
3943 @item -Wpadded
3944 @opindex Wpadded
3945 @opindex Wno-padded
3946 Warn if padding is included in a structure, either to align an element
3947 of the structure or to align the whole structure.  Sometimes when this
3948 happens it is possible to rearrange the fields of the structure to
3949 reduce the padding and so make the structure smaller.
3950
3951 @item -Wredundant-decls
3952 @opindex Wredundant-decls
3953 @opindex Wno-redundant-decls
3954 Warn if anything is declared more than once in the same scope, even in
3955 cases where multiple declaration is valid and changes nothing.
3956
3957 @item -Wnested-externs @r{(C and Objective-C only)}
3958 @opindex Wnested-externs
3959 @opindex Wno-nested-externs
3960 Warn if an @code{extern} declaration is encountered within a function.
3961
3962 @item -Wunreachable-code
3963 @opindex Wunreachable-code
3964 @opindex Wno-unreachable-code
3965 Warn if the compiler detects that code will never be executed.
3966
3967 This option is intended to warn when the compiler detects that at
3968 least a whole line of source code will never be executed, because
3969 some condition is never satisfied or because it is after a
3970 procedure that never returns.
3971
3972 It is possible for this option to produce a warning even though there
3973 are circumstances under which part of the affected line can be executed,
3974 so care should be taken when removing apparently-unreachable code.
3975
3976 For instance, when a function is inlined, a warning may mean that the
3977 line is unreachable in only one inlined copy of the function.
3978
3979 This option is not made part of @option{-Wall} because in a debugging
3980 version of a program there is often substantial code which checks
3981 correct functioning of the program and is, hopefully, unreachable
3982 because the program does work.  Another common use of unreachable
3983 code is to provide behavior which is selectable at compile-time.
3984
3985 @item -Winline
3986 @opindex Winline
3987 @opindex Wno-inline
3988 Warn if a function can not be inlined and it was declared as inline.
3989 Even with this option, the compiler will not warn about failures to
3990 inline functions declared in system headers.
3991
3992 The compiler uses a variety of heuristics to determine whether or not
3993 to inline a function.  For example, the compiler takes into account
3994 the size of the function being inlined and the amount of inlining
3995 that has already been done in the current function.  Therefore,
3996 seemingly insignificant changes in the source program can cause the
3997 warnings produced by @option{-Winline} to appear or disappear.
3998
3999 @item -Wno-invalid-offsetof @r{(C++ and Objective-C++ only)}
4000 @opindex Wno-invalid-offsetof
4001 @opindex Winvalid-offsetof
4002 Suppress warnings from applying the @samp{offsetof} macro to a non-POD
4003 type.  According to the 1998 ISO C++ standard, applying @samp{offsetof}
4004 to a non-POD type is undefined.  In existing C++ implementations,
4005 however, @samp{offsetof} typically gives meaningful results even when
4006 applied to certain kinds of non-POD types. (Such as a simple
4007 @samp{struct} that fails to be a POD type only by virtue of having a
4008 constructor.)  This flag is for users who are aware that they are
4009 writing nonportable code and who have deliberately chosen to ignore the
4010 warning about it.
4011
4012 The restrictions on @samp{offsetof} may be relaxed in a future version
4013 of the C++ standard.
4014
4015 @item -Wno-int-to-pointer-cast @r{(C and Objective-C only)}
4016 @opindex Wno-int-to-pointer-cast
4017 @opindex Wint-to-pointer-cast
4018 Suppress warnings from casts to pointer type of an integer of a
4019 different size.
4020
4021 @item -Wno-pointer-to-int-cast @r{(C and Objective-C only)}
4022 @opindex Wno-pointer-to-int-cast
4023 @opindex Wpointer-to-int-cast
4024 Suppress warnings from casts from a pointer to an integer type of a
4025 different size.
4026
4027 @item -Winvalid-pch
4028 @opindex Winvalid-pch
4029 @opindex Wno-invalid-pch
4030 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
4031 the search path but can't be used.
4032
4033 @item -Wlong-long
4034 @opindex Wlong-long
4035 @opindex Wno-long-long
4036 Warn if @samp{long long} type is used.  This is default.  To inhibit
4037 the warning messages, use @option{-Wno-long-long}.  Flags
4038 @option{-Wlong-long} and @option{-Wno-long-long} are taken into account
4039 only when @option{-pedantic} flag is used.
4040
4041 @item -Wvariadic-macros
4042 @opindex Wvariadic-macros
4043 @opindex Wno-variadic-macros
4044 Warn if variadic macros are used in pedantic ISO C90 mode, or the GNU
4045 alternate syntax when in pedantic ISO C99 mode.  This is default.
4046 To inhibit the warning messages, use @option{-Wno-variadic-macros}.
4047
4048 @item -Wvla
4049 @opindex Wvla
4050 @opindex Wno-vla
4051 Warn if variable length array is used in the code.
4052 @option{-Wno-vla} will prevent the @option{-pedantic} warning of
4053 the variable length array.
4054
4055 @item -Wvolatile-register-var
4056 @opindex Wvolatile-register-var
4057 @opindex Wno-volatile-register-var
4058 Warn if a register variable is declared volatile.  The volatile
4059 modifier does not inhibit all optimizations that may eliminate reads
4060 and/or writes to register variables.  This warning is enabled by
4061 @option{-Wall}.
4062
4063 @item -Wdisabled-optimization
4064 @opindex Wdisabled-optimization
4065 @opindex Wno-disabled-optimization
4066 Warn if a requested optimization pass is disabled.  This warning does
4067 not generally indicate that there is anything wrong with your code; it
4068 merely indicates that GCC's optimizers were unable to handle the code
4069 effectively.  Often, the problem is that your code is too big or too
4070 complex; GCC will refuse to optimize programs when the optimization
4071 itself is likely to take inordinate amounts of time.
4072
4073 @item -Wpointer-sign @r{(C and Objective-C only)}
4074 @opindex Wpointer-sign
4075 @opindex Wno-pointer-sign
4076 Warn for pointer argument passing or assignment with different signedness.
4077 This option is only supported for C and Objective-C@.  It is implied by
4078 @option{-Wall} and by @option{-pedantic}, which can be disabled with
4079 @option{-Wno-pointer-sign}.
4080
4081 @item -Wstack-protector
4082 @opindex Wstack-protector
4083 @opindex Wno-stack-protector
4084 This option is only active when @option{-fstack-protector} is active.  It
4085 warns about functions that will not be protected against stack smashing.
4086
4087 @item -Wno-mudflap
4088 @opindex Wno-mudflap
4089 Suppress warnings about constructs that cannot be instrumented by
4090 @option{-fmudflap}.
4091
4092 @item -Woverlength-strings
4093 @opindex Woverlength-strings
4094 @opindex Wno-overlength-strings
4095 Warn about string constants which are longer than the ``minimum
4096 maximum'' length specified in the C standard.  Modern compilers
4097 generally allow string constants which are much longer than the
4098 standard's minimum limit, but very portable programs should avoid
4099 using longer strings.
4100
4101 The limit applies @emph{after} string constant concatenation, and does
4102 not count the trailing NUL@.  In C89, the limit was 509 characters; in
4103 C99, it was raised to 4095.  C++98 does not specify a normative
4104 minimum maximum, so we do not diagnose overlength strings in C++@.
4105
4106 This option is implied by @option{-pedantic}, and can be disabled with
4107 @option{-Wno-overlength-strings}.
4108
4109 @item -Wdisallowed-function-list=@var{sym},@var{sym},@dots{}
4110 @opindex Wdisallowed-function-list
4111
4112 If any of @var{sym} is called, GCC will issue a warning. This can be useful
4113 in enforcing coding conventions that ban calls to certain functions, for
4114 example, @code{alloca}, @code{malloc}, etc.
4115 @end table
4116
4117 @node Debugging Options
4118 @section Options for Debugging Your Program or GCC
4119 @cindex options, debugging
4120 @cindex debugging information options
4121
4122 GCC has various special options that are used for debugging
4123 either your program or GCC:
4124
4125 @table @gcctabopt
4126 @item -g
4127 @opindex g
4128 Produce debugging information in the operating system's native format
4129 (stabs, COFF, XCOFF, or DWARF 2)@.  GDB can work with this debugging
4130 information.
4131
4132 On most systems that use stabs format, @option{-g} enables use of extra
4133 debugging information that only GDB can use; this extra information
4134 makes debugging work better in GDB but will probably make other debuggers
4135 crash or
4136 refuse to read the program.  If you want to control for certain whether
4137 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
4138 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
4139
4140 GCC allows you to use @option{-g} with
4141 @option{-O}.  The shortcuts taken by optimized code may occasionally
4142 produce surprising results: some variables you declared may not exist
4143 at all; flow of control may briefly move where you did not expect it;
4144 some statements may not be executed because they compute constant
4145 results or their values were already at hand; some statements may
4146 execute in different places because they were moved out of loops.
4147
4148 Nevertheless it proves possible to debug optimized output.  This makes
4149 it reasonable to use the optimizer for programs that might have bugs.
4150
4151 The following options are useful when GCC is generated with the
4152 capability for more than one debugging format.
4153
4154 @item -ggdb
4155 @opindex ggdb
4156 Produce debugging information for use by GDB@.  This means to use the
4157 most expressive format available (DWARF 2, stabs, or the native format
4158 if neither of those are supported), including GDB extensions if at all
4159 possible.
4160
4161 @item -gstabs
4162 @opindex gstabs
4163 Produce debugging information in stabs format (if that is supported),
4164 without GDB extensions.  This is the format used by DBX on most BSD
4165 systems.  On MIPS, Alpha and System V Release 4 systems this option
4166 produces stabs debugging output which is not understood by DBX or SDB@.
4167 On System V Release 4 systems this option requires the GNU assembler.
4168
4169 @item -feliminate-unused-debug-symbols
4170 @opindex feliminate-unused-debug-symbols
4171 Produce debugging information in stabs format (if that is supported),
4172 for only symbols that are actually used.
4173
4174 @item -femit-class-debug-always
4175 Instead of emitting debugging information for a C++ class in only one
4176 object file, emit it in all object files using the class.  This option
4177 should be used only with debuggers that are unable to handle the way GCC
4178 normally emits debugging information for classes because using this
4179 option will increase the size of debugging information by as much as a
4180 factor of two.
4181
4182 @item -gstabs+
4183 @opindex gstabs+
4184 Produce debugging information in stabs format (if that is supported),
4185 using GNU extensions understood only by the GNU debugger (GDB)@.  The
4186 use of these extensions is likely to make other debuggers crash or
4187 refuse to read the program.
4188
4189 @item -gcoff
4190 @opindex gcoff
4191 Produce debugging information in COFF format (if that is supported).
4192 This is the format used by SDB on most System V systems prior to
4193 System V Release 4.
4194
4195 @item -gxcoff
4196 @opindex gxcoff
4197 Produce debugging information in XCOFF format (if that is supported).
4198 This is the format used by the DBX debugger on IBM RS/6000 systems.
4199
4200 @item -gxcoff+
4201 @opindex gxcoff+
4202 Produce debugging information in XCOFF format (if that is supported),
4203 using GNU extensions understood only by the GNU debugger (GDB)@.  The
4204 use of these extensions is likely to make other debuggers crash or
4205 refuse to read the program, and may cause assemblers other than the GNU
4206 assembler (GAS) to fail with an error.
4207
4208 @item -gdwarf-2
4209 @opindex gdwarf-2
4210 Produce debugging information in DWARF version 2 format (if that is
4211 supported).  This is the format used by DBX on IRIX 6.  With this
4212 option, GCC uses features of DWARF version 3 when they are useful;
4213 version 3 is upward compatible with version 2, but may still cause
4214 problems for older debuggers.
4215
4216 @item -gvms
4217 @opindex gvms
4218 Produce debugging information in VMS debug format (if that is
4219 supported).  This is the format used by DEBUG on VMS systems.
4220
4221 @item -g@var{level}
4222 @itemx -ggdb@var{level}
4223 @itemx -gstabs@var{level}
4224 @itemx -gcoff@var{level}
4225 @itemx -gxcoff@var{level}
4226 @itemx -gvms@var{level}
4227 Request debugging information and also use @var{level} to specify how
4228 much information.  The default level is 2.
4229
4230 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
4231 @option{-g}.
4232
4233 Level 1 produces minimal information, enough for making backtraces in
4234 parts of the program that you don't plan to debug.  This includes
4235 descriptions of functions and external variables, but no information
4236 about local variables and no line numbers.
4237
4238 Level 3 includes extra information, such as all the macro definitions
4239 present in the program.  Some debuggers support macro expansion when
4240 you use @option{-g3}.
4241
4242 @option{-gdwarf-2} does not accept a concatenated debug level, because
4243 GCC used to support an option @option{-gdwarf} that meant to generate
4244 debug information in version 1 of the DWARF format (which is very
4245 different from version 2), and it would have been too confusing.  That
4246 debug format is long obsolete, but the option cannot be changed now.
4247 Instead use an additional @option{-g@var{level}} option to change the
4248 debug level for DWARF2.
4249
4250 @item -feliminate-dwarf2-dups
4251 @opindex feliminate-dwarf2-dups
4252 Compress DWARF2 debugging information by eliminating duplicated
4253 information about each symbol.  This option only makes sense when
4254 generating DWARF2 debugging information with @option{-gdwarf-2}.
4255
4256 @item -femit-struct-debug-baseonly
4257 Emit debug information for struct-like types
4258 only when the base name of the compilation source file
4259 matches the base name of file in which the struct was defined.
4260
4261 This option substantially reduces the size of debugging information,
4262 but at significant potential loss in type information to the debugger.
4263 See @option{-femit-struct-debug-reduced} for a less aggressive option.
4264 See @option{-femit-struct-debug-detailed} for more detailed control.
4265
4266 This option works only with DWARF 2.
4267
4268 @item -femit-struct-debug-reduced
4269 Emit debug information for struct-like types
4270 only when the base name of the compilation source file
4271 matches the base name of file in which the type was defined,
4272 unless the struct is a template or defined in a system header.
4273
4274 This option significantly reduces the size of debugging information,
4275 with some potential loss in type information to the debugger.
4276 See @option{-femit-struct-debug-baseonly} for a more aggressive option.
4277 See @option{-femit-struct-debug-detailed} for more detailed control.
4278
4279 This option works only with DWARF 2.
4280
4281 @item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
4282 Specify the struct-like types
4283 for which the compiler will generate debug information.
4284 The intent is to reduce duplicate struct debug information
4285 between different object files within the same program.
4286
4287 This option is a detailed version of
4288 @option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
4289 which will serve for most needs.
4290
4291 A specification has the syntax
4292 [@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
4293
4294 The optional first word limits the specification to
4295 structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
4296 A struct type is used directly when it is the type of a variable, member.
4297 Indirect uses arise through pointers to structs.
4298 That is, when use of an incomplete struct would be legal, the use is indirect.
4299 An example is
4300 @samp{struct one direct; struct two * indirect;}.
4301
4302 The optional second word limits the specification to
4303 ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
4304 Generic structs are a bit complicated to explain.
4305 For C++, these are non-explicit specializations of template classes,
4306 or non-template classes within the above.
4307 Other programming languages have generics,
4308 but @samp{-femit-struct-debug-detailed} does not yet implement them.
4309
4310 The third word specifies the source files for those
4311 structs for which the compiler will emit debug information.
4312 The values @samp{none} and @samp{any} have the normal meaning.
4313 The value @samp{base} means that
4314 the base of name of the file in which the type declaration appears
4315 must match the base of the name of the main compilation file.
4316 In practice, this means that
4317 types declared in @file{foo.c} and @file{foo.h} will have debug information,
4318 but types declared in other header will not.
4319 The value @samp{sys} means those types satisfying @samp{base}
4320 or declared in system or compiler headers.
4321
4322 You may need to experiment to determine the best settings for your application.
4323
4324 The default is @samp{-femit-struct-debug-detailed=all}.
4325
4326 This option works only with DWARF 2.
4327
4328 @item -fno-merge-debug-strings
4329 @opindex fmerge-debug-strings
4330 @opindex fno-merge-debug-strings
4331 Direct the linker to merge together strings which are identical in
4332 different object files.  This is not supported by all assemblers or
4333 linker.  This decreases the size of the debug information in the
4334 output file at the cost of increasing link processing time.  This is
4335 on by default.
4336
4337 @item -fdebug-prefix-map=@var{old}=@var{new}
4338 @opindex fdebug-prefix-map
4339 When compiling files in directory @file{@var{old}}, record debugging
4340 information describing them as in @file{@var{new}} instead.
4341
4342 @cindex @command{prof}
4343 @item -p
4344 @opindex p
4345 Generate extra code to write profile information suitable for the
4346 analysis program @command{prof}.  You must use this option when compiling
4347 the source files you want data about, and you must also use it when
4348 linking.
4349
4350 @cindex @command{gprof}
4351 @item -pg
4352 @opindex pg
4353 Generate extra code to write profile information suitable for the
4354 analysis program @command{gprof}.  You must use this option when compiling
4355 the source files you want data about, and you must also use it when
4356 linking.
4357
4358 @item -Q
4359 @opindex Q
4360 Makes the compiler print out each function name as it is compiled, and
4361 print some statistics about each pass when it finishes.
4362
4363 @item -ftime-report
4364 @opindex ftime-report
4365 Makes the compiler print some statistics about the time consumed by each
4366 pass when it finishes.
4367
4368 @item -fmem-report
4369 @opindex fmem-report
4370 Makes the compiler print some statistics about permanent memory
4371 allocation when it finishes.
4372
4373 @item -fpre-ipa-mem-report
4374 @opindex fpre-ipa-mem-report
4375 @item -fpost-ipa-mem-report
4376 @opindex fpost-ipa-mem-report
4377 Makes the compiler print some statistics about permanent memory
4378 allocation before or after interprocedural optimization.
4379
4380 @item -fprofile-arcs
4381 @opindex fprofile-arcs
4382 Add code so that program flow @dfn{arcs} are instrumented.  During
4383 execution the program records how many times each branch and call is
4384 executed and how many times it is taken or returns.  When the compiled
4385 program exits it saves this data to a file called
4386 @file{@var{auxname}.gcda} for each source file.  The data may be used for
4387 profile-directed optimizations (@option{-fbranch-probabilities}), or for
4388 test coverage analysis (@option{-ftest-coverage}).  Each object file's
4389 @var{auxname} is generated from the name of the output file, if
4390 explicitly specified and it is not the final executable, otherwise it is
4391 the basename of the source file.  In both cases any suffix is removed
4392 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
4393 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
4394 @xref{Cross-profiling}.
4395
4396 @cindex @command{gcov}
4397 @item --coverage
4398 @opindex coverage
4399
4400 This option is used to compile and link code instrumented for coverage
4401 analysis.  The option is a synonym for @option{-fprofile-arcs}
4402 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
4403 linking).  See the documentation for those options for more details.
4404
4405 @itemize
4406
4407 @item
4408 Compile the source files with @option{-fprofile-arcs} plus optimization
4409 and code generation options.  For test coverage analysis, use the
4410 additional @option{-ftest-coverage} option.  You do not need to profile
4411 every source file in a program.
4412
4413 @item
4414 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
4415 (the latter implies the former).
4416
4417 @item
4418 Run the program on a representative workload to generate the arc profile
4419 information.  This may be repeated any number of times.  You can run
4420 concurrent instances of your program, and provided that the file system
4421 supports locking, the data files will be correctly updated.  Also
4422 @code{fork} calls are detected and correctly handled (double counting
4423 will not happen).
4424
4425 @item
4426 For profile-directed optimizations, compile the source files again with
4427 the same optimization and code generation options plus
4428 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
4429 Control Optimization}).
4430
4431 @item
4432 For test coverage analysis, use @command{gcov} to produce human readable
4433 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
4434 @command{gcov} documentation for further information.
4435
4436 @end itemize
4437
4438 With @option{-fprofile-arcs}, for each function of your program GCC
4439 creates a program flow graph, then finds a spanning tree for the graph.
4440 Only arcs that are not on the spanning tree have to be instrumented: the
4441 compiler adds code to count the number of times that these arcs are
4442 executed.  When an arc is the only exit or only entrance to a block, the
4443 instrumentation code can be added to the block; otherwise, a new basic
4444 block must be created to hold the instrumentation code.
4445
4446 @need 2000
4447 @item -ftest-coverage
4448 @opindex ftest-coverage
4449 Produce a notes file that the @command{gcov} code-coverage utility
4450 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
4451 show program coverage.  Each source file's note file is called
4452 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
4453 above for a description of @var{auxname} and instructions on how to
4454 generate test coverage data.  Coverage data will match the source files
4455 more closely, if you do not optimize.
4456
4457 @item -fdbg-cnt-list
4458 @opindex fdbg-cnt-list
4459 Print the name and the counter upperbound for all debug counters.
4460
4461 @item -fdbg-cnt=@var{counter-value-list}
4462 @opindex fdbg-cnt
4463 Set the internal debug counter upperbound. @var{counter-value-list} 
4464 is a comma-separated list of @var{name}:@var{value} pairs
4465 which sets the upperbound of each debug counter @var{name} to @var{value}.
4466 All debug counters have the initial upperbound of @var{UINT_MAX},
4467 thus dbg_cnt() returns true always unless the upperbound is set by this option.
4468 e.g. With -fdbg-cnt=dce:10,tail_call:0
4469 dbg_cnt(dce) will return true only for first 10 invocations
4470 and dbg_cnt(tail_call) will return false always.
4471
4472 @item -d@var{letters}
4473 @itemx -fdump-rtl-@var{pass}
4474 @opindex d
4475 Says to make debugging dumps during compilation at times specified by
4476 @var{letters}.    This is used for debugging the RTL-based passes of the
4477 compiler.  The file names for most of the dumps are made by appending a
4478 pass number and a word to the @var{dumpname}.  @var{dumpname} is generated
4479 from the name of the output file, if explicitly specified and it is not
4480 an executable, otherwise it is the basename of the source file. These
4481 switches may have different effects when @option{-E} is used for
4482 preprocessing.
4483
4484 Most debug dumps can be enabled either passing a letter to the @option{-d}
4485 option, or with a long @option{-fdump-rtl} switch; here are the possible
4486 letters for use in @var{letters} and @var{pass}, and their meanings:
4487
4488 @table @gcctabopt
4489 @item -dA
4490 @opindex dA
4491 Annotate the assembler output with miscellaneous debugging information.
4492
4493 @item -fdump-rtl-bbro
4494 @opindex fdump-rtl-bbro
4495 Dump after block reordering, to @file{@var{file}.148r.bbro}.
4496
4497 @item -fdump-rtl-combine
4498 @opindex fdump-rtl-combine
4499 Dump after the RTL instruction combination pass, to the file
4500 @file{@var{file}.129r.combine}.
4501
4502 @item -fdump-rtl-ce1
4503 @itemx -fdump-rtl-ce2
4504 @opindex fdump-rtl-ce1
4505 @opindex fdump-rtl-ce2
4506 @option{-fdump-rtl-ce1} enable dumping after the
4507 first if conversion, to the file @file{@var{file}.117r.ce1}. 
4508 @option{-fdump-rtl-ce2} enable dumping after the second if
4509 conversion, to the file @file{@var{file}.130r.ce2}.
4510
4511 @item -fdump-rtl-btl
4512 @itemx -fdump-rtl-dbr
4513 @opindex fdump-rtl-btl
4514 @opindex fdump-rtl-dbr
4515 @option{-fdump-rtl-btl} enable dumping after branch
4516 target load optimization, to @file{@var{file}.31.btl}.  
4517 @option{-fdump-rtl-dbr} enable dumping after delayed branch
4518 scheduling, to @file{@var{file}.36.dbr}.
4519
4520 @item -dD
4521 @opindex dD
4522 Dump all macro definitions, at the end of preprocessing, in addition to
4523 normal output.
4524
4525 @item -fdump-rtl-ce3
4526 @opindex fdump-rtl-ce3
4527 Dump after the third if conversion, to @file{@var{file}.146r.ce3}.
4528
4529 @item -fdump-rtl-cfg
4530 @itemx -fdump-rtl-life
4531 @opindex fdump-rtl-cfg
4532 @opindex fdump-rtl-life
4533 @option{-fdump-rtl-cfg} enable dumping after control
4534 and data flow analysis, to @file{@var{file}.116r.cfg}.  
4535 @option{-fdump-rtl-cfg} enable dumping dump after life analysis,
4536 to @file{@var{file}.128r.life1} and @file{@var{file}.135r.life2}.
4537
4538 @item -fdump-rtl-greg
4539 @opindex fdump-rtl-greg
4540 Dump after global register allocation, to @file{@var{file}.139r.greg}.
4541
4542 @item -fdump-rtl-gcse
4543 @itemx -fdump-rtl-bypass
4544 @opindex fdump-rtl-gcse
4545 @opindex fdump-rtl-bypass
4546 @option{-fdump-rtl-gcse} enable dumping after GCSE, to
4547 @file{@var{file}.114r.gcse}.  @option{-fdump-rtl-bypass}
4548 enable dumping after jump bypassing and control flow optimizations, to
4549 @file{@var{file}.115r.bypass}.
4550
4551 @item -fdump-rtl-eh
4552 @opindex fdump-rtl-eh
4553 Dump after finalization of EH handling code, to @file{@var{file}.02.eh}.
4554
4555 @item -fdump-rtl-sibling
4556 @opindex fdump-rtl-sibling
4557 Dump after sibling call optimizations, to @file{@var{file}.106r.sibling}.
4558
4559 @item -fdump-rtl-jump
4560 @opindex fdump-rtl-jump
4561 Dump after the first jump optimization, to @file{@var{file}.112r.jump}.
4562
4563 @item -fdump-rtl-stack
4564 @opindex fdump-rtl-stack
4565 Dump after conversion from GCC's "flat register file" registers to the
4566 x87's stack-like registers, to @file{@var{file}.152r.stack}.
4567
4568 @item -fdump-rtl-lreg
4569 @opindex fdump-rtl-lreg
4570 Dump after local register allocation, to @file{@var{file}.138r.lreg}.
4571
4572 @item -fdump-rtl-loop2
4573 @opindex fdump-rtl-loop2
4574 @option{-dL} and @option{-fdump-rtl-loop2} enable dumping after the
4575 loop optimization pass, to @file{@var{file}.119r.loop2},
4576 @file{@var{file}.120r.loop2_init},
4577 @file{@var{file}.121r.loop2_invariant}, and
4578 @file{@var{file}.125r.loop2_done}.
4579
4580 @item -fdump-rtl-sms
4581 @opindex fdump-rtl-sms
4582 Dump after modulo scheduling, to @file{@var{file}.136r.sms}.
4583
4584 @item -fdump-rtl-mach
4585 @opindex fdump-rtl-mach
4586 Dump after performing the machine dependent reorganization pass, to
4587 @file{@var{file}.155r.mach} if that pass exists.
4588
4589 @item -fdump-rtl-rnreg
4590 @opindex fdump-rtl-rnreg
4591 Dump after register renumbering, to @file{@var{file}.147r.rnreg}.
4592
4593 @item -fdump-rtl-regmove
4594 @opindex fdump-rtl-regmove
4595 Dump after the register move pass, to @file{@var{file}.132r.regmove}.
4596
4597 @item -fdump-rtl-postreload
4598 @opindex fdump-rtl-postreload
4599 Dump after post-reload optimizations, to @file{@var{file}.24.postreload}.
4600
4601 @item -fdump-rtl-expand
4602 @opindex fdump-rtl-expand
4603 Dump after RTL generation, to @file{@var{file}.104r.expand}.
4604
4605 @item -fdump-rtl-sched2
4606 @opindex fdump-rtl-sched2
4607 Dump after the second scheduling pass, to @file{@var{file}.149r.sched2}.
4608
4609 @item -fdump-rtl-cse
4610 @opindex fdump-rtl-cse
4611 Dump after CSE (including the jump optimization that sometimes follows
4612 CSE), to @file{@var{file}.113r.cse}.
4613
4614 @item -fdump-rtl-sched1
4615 @opindex fdump-rtl-sched1
4616 Dump after the first scheduling pass, to @file{@var{file}.136r.sched1}.
4617
4618 @item -fdump-rtl-cse2
4619 @opindex fdump-rtl-cse2
4620 Dump after the second CSE pass (including the jump optimization that
4621 sometimes follows CSE), to @file{@var{file}.127r.cse2}.
4622
4623 @item -fdump-rtl-tracer
4624 @opindex fdump-rtl-tracer
4625 Dump after running tracer, to @file{@var{file}.118r.tracer}.
4626
4627 @item -fdump-rtl-vpt
4628 @itemx -fdump-rtl-vartrack
4629 @opindex fdump-rtl-vpt
4630 @opindex fdump-rtl-vartrack
4631 @option{-fdump-rtl-vpt} enable dumping after the value
4632 profile transformations, to @file{@var{file}.10.vpt}.
4633 @option{-fdump-rtl-vartrack} enable dumping after variable tracking,
4634 to @file{@var{file}.154r.vartrack}.
4635
4636 @item -fdump-rtl-flow2
4637 @opindex fdump-rtl-flow2
4638 Dump after the second flow pass, to @file{@var{file}.142r.flow2}.
4639
4640 @item -fdump-rtl-peephole2
4641 @opindex fdump-rtl-peephole2
4642 Dump after the peephole pass, to @file{@var{file}.145r.peephole2}.
4643
4644 @item -fdump-rtl-web
4645 @opindex fdump-rtl-web
4646 Dump after live range splitting, to @file{@var{file}.126r.web}.
4647
4648 @item -fdump-rtl-all
4649 @opindex fdump-rtl-all
4650 Produce all the dumps listed above.
4651
4652 @item -dH
4653 @opindex dH
4654 Produce a core dump whenever an error occurs.
4655
4656 @item -dm
4657 @opindex dm
4658 Print statistics on memory usage, at the end of the run, to
4659 standard error.
4660
4661 @item -dp
4662 @opindex dp
4663 Annotate the assembler output with a comment indicating which
4664 pattern and alternative was used.  The length of each instruction is
4665 also printed.
4666
4667 @item -dP
4668 @opindex dP
4669 Dump the RTL in the assembler output as a comment before each instruction.
4670 Also turns on @option{-dp} annotation.
4671
4672 @item -dv
4673 @opindex dv
4674 For each of the other indicated dump files (either with @option{-d} or
4675 @option{-fdump-rtl-@var{pass}}), dump a representation of the control flow
4676 graph suitable for viewing with VCG to @file{@var{file}.@var{pass}.vcg}.
4677
4678 @item -dx
4679 @opindex dx
4680 Just generate RTL for a function instead of compiling it.  Usually used
4681 with @samp{r} (@option{-fdump-rtl-expand}).
4682
4683 @item -dy
4684 @opindex dy
4685 Dump debugging information during parsing, to standard error.
4686 @end table
4687
4688 @item -fdump-noaddr
4689 @opindex fdump-noaddr
4690 When doing debugging dumps (see @option{-d} option above), suppress
4691 address output.  This makes it more feasible to use diff on debugging
4692 dumps for compiler invocations with different compiler binaries and/or
4693 different text / bss / data / heap / stack / dso start locations.
4694
4695 @item -fdump-unnumbered
4696 @opindex fdump-unnumbered
4697 When doing debugging dumps (see @option{-d} option above), suppress instruction
4698 numbers and address output.  This makes it more feasible to
4699 use diff on debugging dumps for compiler invocations with different
4700 options, in particular with and without @option{-g}.
4701
4702 @item -fdump-translation-unit @r{(C++ only)}
4703 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
4704 @opindex fdump-translation-unit
4705 Dump a representation of the tree structure for the entire translation
4706 unit to a file.  The file name is made by appending @file{.tu} to the
4707 source file name.  If the @samp{-@var{options}} form is used, @var{options}
4708 controls the details of the dump as described for the
4709 @option{-fdump-tree} options.
4710
4711 @item -fdump-class-hierarchy @r{(C++ only)}
4712 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
4713 @opindex fdump-class-hierarchy
4714 Dump a representation of each class's hierarchy and virtual function
4715 table layout to a file.  The file name is made by appending @file{.class}
4716 to the source file name.  If the @samp{-@var{options}} form is used,
4717 @var{options} controls the details of the dump as described for the
4718 @option{-fdump-tree} options.
4719
4720 @item -fdump-ipa-@var{switch}
4721 @opindex fdump-ipa
4722 Control the dumping at various stages of inter-procedural analysis
4723 language tree to a file.  The file name is generated by appending a switch
4724 specific suffix to the source file name.  The following dumps are possible:
4725
4726 @table @samp
4727 @item all
4728 Enables all inter-procedural analysis dumps.
4729
4730 @item cgraph
4731 Dumps information about call-graph optimization, unused function removal,
4732 and inlining decisions.
4733
4734 @item inline
4735 Dump after function inlining.
4736
4737 @end table
4738
4739 @item -fdump-statistics-@var{option}
4740 @opindex -fdump-statistics
4741 Enable and control dumping of pass statistics in a separate file.  The
4742 file name is generated by appending a suffix ending in @samp{.statistics}
4743 to the source file name.  If the @samp{-@var{option}} form is used,
4744 @samp{-stats} will cause counters to be summed over the whole compilation unit
4745 while @samp{-details} will dump every event as the passes generate them.
4746 The default with no option is to sum counters for each function compiled.
4747
4748 @item -fdump-tree-@var{switch}
4749 @itemx -fdump-tree-@var{switch}-@var{options}
4750 @opindex fdump-tree
4751 Control the dumping at various stages of processing the intermediate
4752 language tree to a file.  The file name is generated by appending a switch
4753 specific suffix to the source file name.  If the @samp{-@var{options}}
4754 form is used, @var{options} is a list of @samp{-} separated options that
4755 control the details of the dump.  Not all options are applicable to all
4756 dumps, those which are not meaningful will be ignored.  The following
4757 options are available
4758
4759 @table @samp
4760 @item address
4761 Print the address of each node.  Usually this is not meaningful as it
4762 changes according to the environment and source file.  Its primary use
4763 is for tying up a dump file with a debug environment.
4764 @item slim
4765 Inhibit dumping of members of a scope or body of a function merely
4766 because that scope has been reached.  Only dump such items when they
4767 are directly reachable by some other path.  When dumping pretty-printed
4768 trees, this option inhibits dumping the bodies of control structures.
4769 @item raw
4770 Print a raw representation of the tree.  By default, trees are
4771 pretty-printed into a C-like representation.
4772 @item details
4773 Enable more detailed dumps (not honored by every dump option).
4774 @item stats
4775 Enable dumping various statistics about the pass (not honored by every dump
4776 option).
4777 @item blocks
4778 Enable showing basic block boundaries (disabled in raw dumps).
4779 @item vops
4780 Enable showing virtual operands for every statement.
4781 @item lineno
4782 Enable showing line numbers for statements.
4783 @item uid
4784 Enable showing the unique ID (@code{DECL_UID}) for each variable.
4785 @item verbose
4786 Enable showing the tree dump for each statement.
4787 @item all
4788 Turn on all options, except @option{raw}, @option{slim}, @option{verbose}
4789 and @option{lineno}.
4790 @end table
4791
4792 The following tree dumps are possible:
4793 @table @samp
4794
4795 @item original
4796 Dump before any tree based optimization, to @file{@var{file}.original}.
4797
4798 @item optimized
4799 Dump after all tree based optimization, to @file{@var{file}.optimized}.
4800
4801 @item gimple
4802 @opindex fdump-tree-gimple
4803 Dump each function before and after the gimplification pass to a file.  The
4804 file name is made by appending @file{.gimple} to the source file name.
4805
4806 @item cfg
4807 @opindex fdump-tree-cfg
4808 Dump the control flow graph of each function to a file.  The file name is
4809 made by appending @file{.cfg} to the source file name.
4810
4811 @item vcg
4812 @opindex fdump-tree-vcg
4813 Dump the control flow graph of each function to a file in VCG format.  The
4814 file name is made by appending @file{.vcg} to the source file name.  Note
4815 that if the file contains more than one function, the generated file cannot
4816 be used directly by VCG@.  You will need to cut and paste each function's
4817 graph into its own separate file first.
4818
4819 @item ch
4820 @opindex fdump-tree-ch
4821 Dump each function after copying loop headers.  The file name is made by
4822 appending @file{.ch} to the source file name.
4823
4824 @item ssa
4825 @opindex fdump-tree-ssa
4826 Dump SSA related information to a file.  The file name is made by appending
4827 @file{.ssa} to the source file name.
4828
4829 @item alias
4830 @opindex fdump-tree-alias
4831 Dump aliasing information for each function.  The file name is made by
4832 appending @file{.alias} to the source file name.
4833
4834 @item ccp
4835 @opindex fdump-tree-ccp
4836 Dump each function after CCP@.  The file name is made by appending
4837 @file{.ccp} to the source file name.
4838
4839 @item storeccp
4840 @opindex fdump-tree-storeccp
4841 Dump each function after STORE-CCP@.  The file name is made by appending
4842 @file{.storeccp} to the source file name.
4843
4844 @item pre
4845 @opindex fdump-tree-pre
4846 Dump trees after partial redundancy elimination.  The file name is made
4847 by appending @file{.pre} to the source file name.
4848
4849 @item fre
4850 @opindex fdump-tree-fre
4851 Dump trees after full redundancy elimination.  The file name is made
4852 by appending @file{.fre} to the source file name.
4853
4854 @item copyprop
4855 @opindex fdump-tree-copyprop
4856 Dump trees after copy propagation.  The file name is made
4857 by appending @file{.copyprop} to the source file name.
4858
4859 @item store_copyprop
4860 @opindex fdump-tree-store_copyprop
4861 Dump trees after store copy-propagation.  The file name is made
4862 by appending @file{.store_copyprop} to the source file name.
4863
4864 @item dce
4865 @opindex fdump-tree-dce
4866 Dump each function after dead code elimination.  The file name is made by
4867 appending @file{.dce} to the source file name.
4868
4869 @item mudflap
4870 @opindex fdump-tree-mudflap
4871 Dump each function after adding mudflap instrumentation.  The file name is
4872 made by appending @file{.mudflap} to the source file name.
4873
4874 @item sra
4875 @opindex fdump-tree-sra
4876 Dump each function after performing scalar replacement of aggregates.  The
4877 file name is made by appending @file{.sra} to the source file name.
4878
4879 @item sink
4880 @opindex fdump-tree-sink
4881 Dump each function after performing code sinking.  The file name is made
4882 by appending @file{.sink} to the source file name.
4883
4884 @item dom
4885 @opindex fdump-tree-dom
4886 Dump each function after applying dominator tree optimizations.  The file
4887 name is made by appending @file{.dom} to the source file name.
4888
4889 @item dse
4890 @opindex fdump-tree-dse
4891 Dump each function after applying dead store elimination.  The file
4892 name is made by appending @file{.dse} to the source file name.
4893
4894 @item phiopt
4895 @opindex fdump-tree-phiopt
4896 Dump each function after optimizing PHI nodes into straightline code.  The file
4897 name is made by appending @file{.phiopt} to the source file name.
4898
4899 @item forwprop
4900 @opindex fdump-tree-forwprop
4901 Dump each function after forward propagating single use variables.  The file
4902 name is made by appending @file{.forwprop} to the source file name.
4903
4904 @item copyrename
4905 @opindex fdump-tree-copyrename
4906 Dump each function after applying the copy rename optimization.  The file
4907 name is made by appending @file{.copyrename} to the source file name.
4908
4909 @item nrv
4910 @opindex fdump-tree-nrv
4911 Dump each function after applying the named return value optimization on
4912 generic trees.  The file name is made by appending @file{.nrv} to the source
4913 file name.
4914
4915 @item vect
4916 @opindex fdump-tree-vect
4917 Dump each function after applying vectorization of loops.  The file name is
4918 made by appending @file{.vect} to the source file name.
4919
4920 @item vrp
4921 @opindex fdump-tree-vrp
4922 Dump each function after Value Range Propagation (VRP).  The file name
4923 is made by appending @file{.vrp} to the source file name.
4924
4925 @item all
4926 @opindex fdump-tree-all
4927 Enable all the available tree dumps with the flags provided in this option.
4928 @end table
4929
4930 @item -ftree-vectorizer-verbose=@var{n}
4931 @opindex ftree-vectorizer-verbose
4932 This option controls the amount of debugging output the vectorizer prints.
4933 This information is written to standard error, unless
4934 @option{-fdump-tree-all} or @option{-fdump-tree-vect} is specified,
4935 in which case it is output to the usual dump listing file, @file{.vect}.
4936 For @var{n}=0 no diagnostic information is reported.
4937 If @var{n}=1 the vectorizer reports each loop that got vectorized,
4938 and the total number of loops that got vectorized.
4939 If @var{n}=2 the vectorizer also reports non-vectorized loops that passed
4940 the first analysis phase (vect_analyze_loop_form) - i.e.@: countable,
4941 inner-most, single-bb, single-entry/exit loops.  This is the same verbosity
4942 level that @option{-fdump-tree-vect-stats} uses.
4943 Higher verbosity levels mean either more information dumped for each
4944 reported loop, or same amount of information reported for more loops:
4945 If @var{n}=3, alignment related information is added to the reports.
4946 If @var{n}=4, data-references related information (e.g.@: memory dependences,
4947 memory access-patterns) is added to the reports.
4948 If @var{n}=5, the vectorizer reports also non-vectorized inner-most loops
4949 that did not pass the first analysis phase (i.e., may not be countable, or
4950 may have complicated control-flow).
4951 If @var{n}=6, the vectorizer reports also non-vectorized nested loops.
4952 For @var{n}=7, all the information the vectorizer generates during its
4953 analysis and transformation is reported.  This is the same verbosity level
4954 that @option{-fdump-tree-vect-details} uses.
4955
4956 @item -frandom-seed=@var{string}
4957 @opindex frandom-string
4958 This option provides a seed that GCC uses when it would otherwise use
4959 random numbers.  It is used to generate certain symbol names
4960 that have to be different in every compiled file.  It is also used to
4961 place unique stamps in coverage data files and the object files that
4962 produce them.  You can use the @option{-frandom-seed} option to produce
4963 reproducibly identical object files.
4964
4965 The @var{string} should be different for every file you compile.
4966
4967 @item -fsched-verbose=@var{n}
4968 @opindex fsched-verbose
4969 On targets that use instruction scheduling, this option controls the
4970 amount of debugging output the scheduler prints.  This information is
4971 written to standard error, unless @option{-dS} or @option{-dR} is
4972 specified, in which case it is output to the usual dump
4973 listing file, @file{.sched} or @file{.sched2} respectively.  However
4974 for @var{n} greater than nine, the output is always printed to standard
4975 error.
4976
4977 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
4978 same information as @option{-dRS}.  For @var{n} greater than one, it
4979 also output basic block probabilities, detailed ready list information
4980 and unit/insn info.  For @var{n} greater than two, it includes RTL
4981 at abort point, control-flow and regions info.  And for @var{n} over
4982 four, @option{-fsched-verbose} also includes dependence info.
4983
4984 @item -save-temps
4985 @opindex save-temps
4986 Store the usual ``temporary'' intermediate files permanently; place them
4987 in the current directory and name them based on the source file.  Thus,
4988 compiling @file{foo.c} with @samp{-c -save-temps} would produce files
4989 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
4990 preprocessed @file{foo.i} output file even though the compiler now
4991 normally uses an integrated preprocessor.
4992
4993 When used in combination with the @option{-x} command line option,
4994 @option{-save-temps} is sensible enough to avoid over writing an
4995 input source file with the same extension as an intermediate file.
4996 The corresponding intermediate file may be obtained by renaming the
4997 source file before using @option{-save-temps}.
4998
4999 @item -time
5000 @opindex time
5001 Report the CPU time taken by each subprocess in the compilation
5002 sequence.  For C source files, this is the compiler proper and assembler
5003 (plus the linker if linking is done).  The output looks like this:
5004
5005 @smallexample
5006 # cc1 0.12 0.01
5007 # as 0.00 0.01
5008 @end smallexample
5009
5010 The first number on each line is the ``user time'', that is time spent
5011 executing the program itself.  The second number is ``system time'',
5012 time spent executing operating system routines on behalf of the program.
5013 Both numbers are in seconds.
5014
5015 @item -fvar-tracking
5016 @opindex fvar-tracking
5017 Run variable tracking pass.  It computes where variables are stored at each
5018 position in code.  Better debugging information is then generated
5019 (if the debugging information format supports this information).
5020
5021 It is enabled by default when compiling with optimization (@option{-Os},
5022 @option{-O}, @option{-O2}, @dots{}), debugging information (@option{-g}) and
5023 the debug info format supports it.
5024
5025 @item -print-file-name=@var{library}
5026 @opindex print-file-name
5027 Print the full absolute name of the library file @var{library} that
5028 would be used when linking---and don't do anything else.  With this
5029 option, GCC does not compile or link anything; it just prints the
5030 file name.
5031
5032 @item -print-multi-directory
5033 @opindex print-multi-directory
5034 Print the directory name corresponding to the multilib selected by any
5035 other switches present in the command line.  This directory is supposed
5036 to exist in @env{GCC_EXEC_PREFIX}.
5037
5038 @item -print-multi-lib
5039 @opindex print-multi-lib
5040 Print the mapping from multilib directory names to compiler switches
5041 that enable them.  The directory name is separated from the switches by
5042 @samp{;}, and each switch starts with an @samp{@@} instead of the
5043 @samp{-}, without spaces between multiple switches.  This is supposed to
5044 ease shell-processing.
5045
5046 @item -print-prog-name=@var{program}
5047 @opindex print-prog-name
5048 Like @option{-print-file-name}, but searches for a program such as @samp{cpp}.
5049
5050 @item -print-libgcc-file-name
5051 @opindex print-libgcc-file-name
5052 Same as @option{-print-file-name=libgcc.a}.
5053
5054 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
5055 but you do want to link with @file{libgcc.a}.  You can do
5056
5057 @smallexample
5058 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
5059 @end smallexample
5060
5061 @item -print-search-dirs
5062 @opindex print-search-dirs
5063 Print the name of the configured installation directory and a list of
5064 program and library directories @command{gcc} will search---and don't do anything else.
5065
5066 This is useful when @command{gcc} prints the error message
5067 @samp{installation problem, cannot exec cpp0: No such file or directory}.
5068 To resolve this you either need to put @file{cpp0} and the other compiler
5069 components where @command{gcc} expects to find them, or you can set the environment
5070 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
5071 Don't forget the trailing @samp{/}.
5072 @xref{Environment Variables}.
5073
5074 @item -print-sysroot
5075 @opindex print-sysroot
5076 Print the target sysroot directory that will be used during
5077 compilation.  This is the target sysroot specified either at configure
5078 time or or using the @option{--sysroot} option, possibly with an extra
5079 suffix that depends on compilation options.  If no target sysroot is
5080 specified, the option prints nothing.
5081
5082 @item -print-sysroot-headers-suffix
5083 @opindex print-sysroot-headers-suffix
5084 Print the suffix added to the target sysroot when searching for
5085 headers, or give an error if the compiler is not configured with such
5086 a suffix---and don't do anything else.
5087
5088 @item -dumpmachine
5089 @opindex dumpmachine
5090 Print the compiler's target machine (for example,
5091 @samp{i686-pc-linux-gnu})---and don't do anything else.
5092
5093 @item -dumpversion
5094 @opindex dumpversion
5095 Print the compiler version (for example, @samp{3.0})---and don't do
5096 anything else.
5097
5098 @item -dumpspecs
5099 @opindex dumpspecs
5100 Print the compiler's built-in specs---and don't do anything else.  (This
5101 is used when GCC itself is being built.)  @xref{Spec Files}.
5102
5103 @item -feliminate-unused-debug-types
5104 @opindex feliminate-unused-debug-types
5105 Normally, when producing DWARF2 output, GCC will emit debugging
5106 information for all types declared in a compilation
5107 unit, regardless of whether or not they are actually used
5108 in that compilation unit.  Sometimes this is useful, such as
5109 if, in the debugger, you want to cast a value to a type that is
5110 not actually used in your program (but is declared).  More often,
5111 however, this results in a significant amount of wasted space.
5112 With this option, GCC will avoid producing debug symbol output
5113 for types that are nowhere used in the source file being compiled.
5114 @end table
5115
5116 @node Optimize Options
5117 @section Options That Control Optimization
5118 @cindex optimize options
5119 @cindex options, optimization
5120
5121 These options control various sorts of optimizations.
5122
5123 Without any optimization option, the compiler's goal is to reduce the
5124 cost of compilation and to make debugging produce the expected
5125 results.  Statements are independent: if you stop the program with a
5126 breakpoint between statements, you can then assign a new value to any
5127 variable or change the program counter to any other statement in the
5128 function and get exactly the results you would expect from the source
5129 code.
5130
5131 Turning on optimization flags makes the compiler attempt to improve
5132 the performance and/or code size at the expense of compilation time
5133 and possibly the ability to debug the program.
5134
5135 The compiler performs optimization based on the knowledge it has of the
5136 program.  Compiling multiple files at once to a single output file mode allows
5137 the compiler to use information gained from all of the files when compiling
5138 each of them.
5139
5140 Not all optimizations are controlled directly by a flag.  Only
5141 optimizations that have a flag are listed.
5142
5143 @table @gcctabopt
5144 @item -O
5145 @itemx -O1
5146 @opindex O
5147 @opindex O1
5148 Optimize.  Optimizing compilation takes somewhat more time, and a lot
5149 more memory for a large function.
5150
5151 With @option{-O}, the compiler tries to reduce code size and execution
5152 time, without performing any optimizations that take a great deal of
5153 compilation time.
5154
5155 @option{-O} turns on the following optimization flags:
5156 @gccoptlist{
5157 -fauto-inc-dec @gol
5158 -fcprop-registers @gol
5159 -fdce @gol
5160 -fdefer-pop @gol
5161 -fdelayed-branch @gol
5162 -fdse @gol
5163 -fguess-branch-probability @gol
5164 -fif-conversion2 @gol
5165 -fif-conversion @gol
5166 -finline-small-functions @gol
5167 -fipa-pure-const @gol
5168 -fipa-reference @gol
5169 -fmerge-constants
5170 -fsplit-wide-types @gol
5171 -ftree-builtin-call-dce @gol
5172 -ftree-ccp @gol
5173 -ftree-ch @gol
5174 -ftree-copyrename @gol
5175 -ftree-dce @gol
5176 -ftree-dominator-opts @gol
5177 -ftree-dse @gol
5178 -ftree-fre @gol
5179 -ftree-sra @gol
5180 -ftree-ter @gol
5181 -funit-at-a-time}
5182
5183 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
5184 where doing so does not interfere with debugging.
5185
5186 @item -O2
5187 @opindex O2
5188 Optimize even more.  GCC performs nearly all supported optimizations
5189 that do not involve a space-speed tradeoff.  The compiler does not
5190 perform loop unrolling or function inlining when you specify @option{-O2}.
5191 As compared to @option{-O}, this option increases both compilation time
5192 and the performance of the generated code.
5193
5194 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
5195 also turns on the following optimization flags:
5196 @gccoptlist{-fthread-jumps @gol
5197 -falign-functions  -falign-jumps @gol
5198 -falign-loops  -falign-labels @gol
5199 -fcaller-saves @gol
5200 -fcrossjumping @gol
5201 -fcse-follow-jumps  -fcse-skip-blocks @gol
5202 -fdelete-null-pointer-checks @gol
5203 -fexpensive-optimizations @gol
5204 -fgcse  -fgcse-lm  @gol
5205 -findirect-inlining @gol
5206 -foptimize-sibling-calls @gol
5207 -fpeephole2 @gol
5208 -fregmove @gol
5209 -freorder-blocks  -freorder-functions @gol
5210 -frerun-cse-after-loop  @gol
5211 -fsched-interblock  -fsched-spec @gol
5212 -fschedule-insns  -fschedule-insns2 @gol
5213 -fstrict-aliasing -fstrict-overflow @gol
5214 -ftree-switch-conversion @gol
5215 -ftree-pre @gol
5216 -ftree-vrp}
5217
5218 Please note the warning under @option{-fgcse} about
5219 invoking @option{-O2} on programs that use computed gotos.
5220
5221 @item -O3
5222 @opindex O3
5223 Optimize yet more.  @option{-O3} turns on all optimizations specified
5224 by @option{-O2} and also turns on the @option{-finline-functions},
5225 @option{-funswitch-loops}, @option{-fpredictive-commoning},
5226 @option{-fgcse-after-reload} and @option{-ftree-vectorize} options.
5227
5228 @item -O0
5229 @opindex O0
5230 Reduce compilation time and make debugging produce the expected
5231 results.  This is the default.
5232
5233 @item -Os
5234 @opindex Os
5235 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
5236 do not typically increase code size.  It also performs further
5237 optimizations designed to reduce code size.
5238
5239 @option{-Os} disables the following optimization flags:
5240 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
5241 -falign-labels  -freorder-blocks  -freorder-blocks-and-partition @gol
5242 -fprefetch-loop-arrays  -ftree-vect-loop-version}
5243
5244 If you use multiple @option{-O} options, with or without level numbers,
5245 the last such option is the one that is effective.
5246 @end table
5247
5248 Options of the form @option{-f@var{flag}} specify machine-independent
5249 flags.  Most flags have both positive and negative forms; the negative
5250 form of @option{-ffoo} would be @option{-fno-foo}.  In the table
5251 below, only one of the forms is listed---the one you typically will
5252 use.  You can figure out the other form by either removing @samp{no-}
5253 or adding it.
5254
5255 The following options control specific optimizations.  They are either
5256 activated by @option{-O} options or are related to ones that are.  You
5257 can use the following flags in the rare cases when ``fine-tuning'' of
5258 optimizations to be performed is desired.
5259
5260 @table @gcctabopt
5261 @item -fno-default-inline
5262 @opindex fno-default-inline
5263 Do not make member functions inline by default merely because they are
5264 defined inside the class scope (C++ only).  Otherwise, when you specify
5265 @w{@option{-O}}, member functions defined inside class scope are compiled
5266 inline by default; i.e., you don't need to add @samp{inline} in front of
5267 the member function name.
5268
5269 @item -fno-defer-pop
5270 @opindex fno-defer-pop
5271 Always pop the arguments to each function call as soon as that function
5272 returns.  For machines which must pop arguments after a function call,
5273 the compiler normally lets arguments accumulate on the stack for several
5274 function calls and pops them all at once.
5275
5276 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5277
5278 @item -fforward-propagate
5279 @opindex fforward-propagate
5280 Perform a forward propagation pass on RTL@.  The pass tries to combine two
5281 instructions and checks if the result can be simplified.  If loop unrolling
5282 is active, two passes are performed and the second is scheduled after
5283 loop unrolling.
5284
5285 This option is enabled by default at optimization levels @option{-O2},
5286 @option{-O3}, @option{-Os}.
5287
5288 @item -fomit-frame-pointer
5289 @opindex fomit-frame-pointer
5290 Don't keep the frame pointer in a register for functions that
5291 don't need one.  This avoids the instructions to save, set up and
5292 restore frame pointers; it also makes an extra register available
5293 in many functions.  @strong{It also makes debugging impossible on
5294 some machines.}
5295
5296 On some machines, such as the VAX, this flag has no effect, because
5297 the standard calling sequence automatically handles the frame pointer
5298 and nothing is saved by pretending it doesn't exist.  The
5299 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
5300 whether a target machine supports this flag.  @xref{Registers,,Register
5301 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
5302
5303 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5304
5305 @item -foptimize-sibling-calls
5306 @opindex foptimize-sibling-calls
5307 Optimize sibling and tail recursive calls.
5308
5309 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5310
5311 @item -fno-inline
5312 @opindex fno-inline
5313 Don't pay attention to the @code{inline} keyword.  Normally this option
5314 is used to keep the compiler from expanding any functions inline.
5315 Note that if you are not optimizing, no functions can be expanded inline.
5316
5317 @item -finline-small-functions
5318 @opindex finline-small-functions
5319 Integrate functions into their callers when their body is smaller than expected
5320 function call code (so overall size of program gets smaller).  The compiler
5321 heuristically decides which functions are simple enough to be worth integrating
5322 in this way.
5323
5324 Enabled at level @option{-O2}.
5325
5326 @item -findirect-inlining
5327 @opindex findirect-inlining
5328 Inline also indirect calls that are discovered to be known at compile
5329 time thanks to previous inlining.  This option has any effect only
5330 when inlining itself is turned on by the @option{-finline-functions}
5331 or @option{-finline-small-functions} options.
5332
5333 Enabled at level @option{-O2}.
5334
5335 @item -finline-functions
5336 @opindex finline-functions
5337 Integrate all simple functions into their callers.  The compiler
5338 heuristically decides which functions are simple enough to be worth
5339 integrating in this way.
5340
5341 If all calls to a given function are integrated, and the function is
5342 declared @code{static}, then the function is normally not output as
5343 assembler code in its own right.
5344
5345 Enabled at level @option{-O3}.
5346
5347 @item -finline-functions-called-once
5348 @opindex finline-functions-called-once
5349 Consider all @code{static} functions called once for inlining into their
5350 caller even if they are not marked @code{inline}.  If a call to a given
5351 function is integrated, then the function is not output as assembler code
5352 in its own right.
5353
5354 Enabled at levels @option{-O1}, @option{-O2}, @option{-O3} and @option{-Os}.
5355
5356 @item -fearly-inlining
5357 @opindex fearly-inlining
5358 Inline functions marked by @code{always_inline} and functions whose body seems
5359 smaller than the function call overhead early before doing
5360 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
5361 makes profiling significantly cheaper and usually inlining faster on programs
5362 having large chains of nested wrapper functions.
5363
5364 Enabled by default.
5365
5366 @item -finline-limit=@var{n}
5367 @opindex finline-limit
5368 By default, GCC limits the size of functions that can be inlined.  This flag
5369 allows coarse control of this limit.  @var{n} is the size of functions that
5370 can be inlined in number of pseudo instructions.
5371
5372 Inlining is actually controlled by a number of parameters, which may be
5373 specified individually by using @option{--param @var{name}=@var{value}}.
5374 The @option{-finline-limit=@var{n}} option sets some of these parameters
5375 as follows:
5376
5377 @table @gcctabopt
5378 @item max-inline-insns-single
5379 is set to @var{n}/2.
5380 @item max-inline-insns-auto
5381 is set to @var{n}/2.
5382 @end table
5383
5384 See below for a documentation of the individual
5385 parameters controlling inlining and for the defaults of these parameters.
5386
5387 @emph{Note:} there may be no value to @option{-finline-limit} that results
5388 in default behavior.
5389
5390 @emph{Note:} pseudo instruction represents, in this particular context, an
5391 abstract measurement of function's size.  In no way does it represent a count
5392 of assembly instructions and as such its exact meaning might change from one
5393 release to an another.
5394
5395 @item -fkeep-inline-functions
5396 @opindex fkeep-inline-functions
5397 In C, emit @code{static} functions that are declared @code{inline}
5398 into the object file, even if the function has been inlined into all
5399 of its callers.  This switch does not affect functions using the
5400 @code{extern inline} extension in GNU C89@.  In C++, emit any and all
5401 inline functions into the object file.
5402
5403 @item -fkeep-static-consts
5404 @opindex fkeep-static-consts
5405 Emit variables declared @code{static const} when optimization isn't turned
5406 on, even if the variables aren't referenced.
5407
5408 GCC enables this option by default.  If you want to force the compiler to
5409 check if the variable was referenced, regardless of whether or not
5410 optimization is turned on, use the @option{-fno-keep-static-consts} option.
5411
5412 @item -fmerge-constants
5413 @opindex fmerge-constants
5414 Attempt to merge identical constants (string constants and floating point
5415 constants) across compilation units.
5416
5417 This option is the default for optimized compilation if the assembler and
5418 linker support it.  Use @option{-fno-merge-constants} to inhibit this
5419 behavior.
5420
5421 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5422
5423 @item -fmerge-all-constants
5424 @opindex fmerge-all-constants
5425 Attempt to merge identical constants and identical variables.
5426
5427 This option implies @option{-fmerge-constants}.  In addition to
5428 @option{-fmerge-constants} this considers e.g.@: even constant initialized
5429 arrays or initialized constant variables with integral or floating point
5430 types.  Languages like C or C++ require each non-automatic variable to
5431 have distinct location, so using this option will result in non-conforming
5432 behavior.
5433
5434 @item -fmodulo-sched
5435 @opindex fmodulo-sched
5436 Perform swing modulo scheduling immediately before the first scheduling
5437 pass.  This pass looks at innermost loops and reorders their
5438 instructions by overlapping different iterations.
5439
5440 @item -fmodulo-sched-allow-regmoves
5441 @opindex fmodulo-sched-allow-regmoves
5442 Perform more aggressive SMS based modulo scheduling with register moves
5443 allowed.  By setting this flag certain anti-dependences edges will be
5444 deleted which will trigger the generation of reg-moves based on the
5445 life-range analysis.  This option is effective only with
5446 @option{-fmodulo-sched} enabled.
5447
5448 @item -fno-branch-count-reg
5449 @opindex fno-branch-count-reg
5450 Do not use ``decrement and branch'' instructions on a count register,
5451 but instead generate a sequence of instructions that decrement a
5452 register, compare it against zero, then branch based upon the result.
5453 This option is only meaningful on architectures that support such
5454 instructions, which include x86, PowerPC, IA-64 and S/390.
5455
5456 The default is @option{-fbranch-count-reg}.
5457
5458 @item -fno-function-cse
5459 @opindex fno-function-cse
5460 Do not put function addresses in registers; make each instruction that
5461 calls a constant function contain the function's address explicitly.
5462
5463 This option results in less efficient code, but some strange hacks
5464 that alter the assembler output may be confused by the optimizations
5465 performed when this option is not used.
5466
5467 The default is @option{-ffunction-cse}
5468
5469 @item -fno-zero-initialized-in-bss
5470 @opindex fno-zero-initialized-in-bss
5471 If the target supports a BSS section, GCC by default puts variables that
5472 are initialized to zero into BSS@.  This can save space in the resulting
5473 code.
5474
5475 This option turns off this behavior because some programs explicitly
5476 rely on variables going to the data section.  E.g., so that the
5477 resulting executable can find the beginning of that section and/or make
5478 assumptions based on that.
5479
5480 The default is @option{-fzero-initialized-in-bss}.
5481
5482 @item -fmudflap -fmudflapth -fmudflapir
5483 @opindex fmudflap
5484 @opindex fmudflapth
5485 @opindex fmudflapir
5486 @cindex bounds checking
5487 @cindex mudflap
5488 For front-ends that support it (C and C++), instrument all risky
5489 pointer/array dereferencing operations, some standard library
5490 string/heap functions, and some other associated constructs with
5491 range/validity tests.  Modules so instrumented should be immune to
5492 buffer overflows, invalid heap use, and some other classes of C/C++
5493 programming errors.  The instrumentation relies on a separate runtime
5494 library (@file{libmudflap}), which will be linked into a program if
5495 @option{-fmudflap} is given at link time.  Run-time behavior of the
5496 instrumented program is controlled by the @env{MUDFLAP_OPTIONS}
5497 environment variable.  See @code{env MUDFLAP_OPTIONS=-help a.out}
5498 for its options.
5499
5500 Use @option{-fmudflapth} instead of @option{-fmudflap} to compile and to
5501 link if your program is multi-threaded.  Use @option{-fmudflapir}, in
5502 addition to @option{-fmudflap} or @option{-fmudflapth}, if
5503 instrumentation should ignore pointer reads.  This produces less
5504 instrumentation (and therefore faster execution) and still provides
5505 some protection against outright memory corrupting writes, but allows
5506 erroneously read data to propagate within a program.
5507
5508 @item -fthread-jumps
5509 @opindex fthread-jumps
5510 Perform optimizations where we check to see if a jump branches to a
5511 location where another comparison subsumed by the first is found.  If
5512 so, the first branch is redirected to either the destination of the
5513 second branch or a point immediately following it, depending on whether
5514 the condition is known to be true or false.
5515
5516 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5517
5518 @item -fsplit-wide-types
5519 @opindex fsplit-wide-types
5520 When using a type that occupies multiple registers, such as @code{long
5521 long} on a 32-bit system, split the registers apart and allocate them
5522 independently.  This normally generates better code for those types,
5523 but may make debugging more difficult.
5524
5525 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
5526 @option{-Os}.
5527
5528 @item -fcse-follow-jumps
5529 @opindex fcse-follow-jumps
5530 In common subexpression elimination (CSE), scan through jump instructions
5531 when the target of the jump is not reached by any other path.  For
5532 example, when CSE encounters an @code{if} statement with an
5533 @code{else} clause, CSE will follow the jump when the condition
5534 tested is false.
5535
5536 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5537
5538 @item -fcse-skip-blocks
5539 @opindex fcse-skip-blocks
5540 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
5541 follow jumps which conditionally skip over blocks.  When CSE
5542 encounters a simple @code{if} statement with no else clause,
5543 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
5544 body of the @code{if}.
5545
5546 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5547
5548 @item -frerun-cse-after-loop
5549 @opindex frerun-cse-after-loop
5550 Re-run common subexpression elimination after loop optimizations has been
5551 performed.
5552
5553 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5554
5555 @item -fgcse
5556 @opindex fgcse
5557 Perform a global common subexpression elimination pass.
5558 This pass also performs global constant and copy propagation.
5559
5560 @emph{Note:} When compiling a program using computed gotos, a GCC
5561 extension, you may get better runtime performance if you disable
5562 the global common subexpression elimination pass by adding
5563 @option{-fno-gcse} to the command line.
5564
5565 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5566
5567 @item -fgcse-lm
5568 @opindex fgcse-lm
5569 When @option{-fgcse-lm} is enabled, global common subexpression elimination will
5570 attempt to move loads which are only killed by stores into themselves.  This
5571 allows a loop containing a load/store sequence to be changed to a load outside
5572 the loop, and a copy/store within the loop.
5573
5574 Enabled by default when gcse is enabled.
5575
5576 @item -fgcse-sm
5577 @opindex fgcse-sm
5578 When @option{-fgcse-sm} is enabled, a store motion pass is run after
5579 global common subexpression elimination.  This pass will attempt to move
5580 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
5581 loops containing a load/store sequence can be changed to a load before
5582 the loop and a store after the loop.
5583
5584 Not enabled at any optimization level.
5585
5586 @item -fgcse-las
5587 @opindex fgcse-las
5588 When @option{-fgcse-las} is enabled, the global common subexpression
5589 elimination pass eliminates redundant loads that come after stores to the
5590 same memory location (both partial and full redundancies).
5591
5592 Not enabled at any optimization level.
5593
5594 @item -fgcse-after-reload
5595 @opindex fgcse-after-reload
5596 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
5597 pass is performed after reload.  The purpose of this pass is to cleanup
5598 redundant spilling.
5599
5600 @item -funsafe-loop-optimizations
5601 @opindex funsafe-loop-optimizations
5602 If given, the loop optimizer will assume that loop indices do not
5603 overflow, and that the loops with nontrivial exit condition are not
5604 infinite.  This enables a wider range of loop optimizations even if
5605 the loop optimizer itself cannot prove that these assumptions are valid.
5606 Using @option{-Wunsafe-loop-optimizations}, the compiler will warn you
5607 if it finds this kind of loop.
5608
5609 @item -fcrossjumping
5610 @opindex fcrossjumping
5611 Perform cross-jumping transformation.  This transformation unifies equivalent code and save code size.  The
5612 resulting code may or may not perform better than without cross-jumping.
5613
5614 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5615
5616 @item -fauto-inc-dec
5617 @opindex fauto-inc-dec
5618 Combine increments or decrements of addresses with memory accesses.
5619 This pass is always skipped on architectures that do not have
5620 instructions to support this.  Enabled by default at @option{-O} and
5621 higher on architectures that support this.
5622
5623 @item -fdce
5624 @opindex fdce
5625 Perform dead code elimination (DCE) on RTL@.
5626 Enabled by default at @option{-O} and higher.
5627
5628 @item -fdse
5629 @opindex fdse
5630 Perform dead store elimination (DSE) on RTL@.
5631 Enabled by default at @option{-O} and higher.
5632
5633 @item -fif-conversion
5634 @opindex fif-conversion
5635 Attempt to transform conditional jumps into branch-less equivalents.  This
5636 include use of conditional moves, min, max, set flags and abs instructions, and
5637 some tricks doable by standard arithmetics.  The use of conditional execution
5638 on chips where it is available is controlled by @code{if-conversion2}.
5639
5640 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5641
5642 @item -fif-conversion2
5643 @opindex fif-conversion2
5644 Use conditional execution (where available) to transform conditional jumps into
5645 branch-less equivalents.
5646
5647 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5648
5649 @item -fdelete-null-pointer-checks
5650 @opindex fdelete-null-pointer-checks
5651 Use global dataflow analysis to identify and eliminate useless checks
5652 for null pointers.  The compiler assumes that dereferencing a null
5653 pointer would have halted the program.  If a pointer is checked after
5654 it has already been dereferenced, it cannot be null.
5655
5656 In some environments, this assumption is not true, and programs can
5657 safely dereference null pointers.  Use
5658 @option{-fno-delete-null-pointer-checks} to disable this optimization
5659 for programs which depend on that behavior.
5660
5661 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5662
5663 @item -fexpensive-optimizations
5664 @opindex fexpensive-optimizations
5665 Perform a number of minor optimizations that are relatively expensive.
5666
5667 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5668
5669 @item -foptimize-register-move
5670 @itemx -fregmove
5671 @opindex foptimize-register-move
5672 @opindex fregmove
5673 Attempt to reassign register numbers in move instructions and as
5674 operands of other simple instructions in order to maximize the amount of
5675 register tying.  This is especially helpful on machines with two-operand
5676 instructions.
5677
5678 Note @option{-fregmove} and @option{-foptimize-register-move} are the same
5679 optimization.
5680
5681 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5682
5683 @item -fira
5684 @opindex fira
5685 Use the integrated register allocator (@acronym{IRA}) for register
5686 allocation.  It is a default if @acronym{IRA} has been ported for the
5687 target.
5688
5689 @item -fira-algorithm=@var{algorithm}
5690 Use specified algorithm for the integrated register allocator.  The
5691 @var{algorithm} argument should be one of @code{regional}, @code{CB},
5692 or @code{mixed}.  The second algorithm specifies Chaitin-Briggs
5693 coloring, the first one specifies regional coloring based on
5694 Chaitin-Briggs coloring, and the third one which is the default
5695 specifies a mix of Chaitin-Briggs and regional algorithms where loops
5696 with small register pressure are ignored.  The first algorithm can
5697 give best result for machines with small size and irregular register
5698 set, the second one is faster and generates decent code and the
5699 smallest size code, and the mixed algorithm usually give the best
5700 results in most cases and for most architectures.
5701
5702 @item -fira-coalesce
5703 @opindex fira-coalesce
5704 Do optimistic register coalescing.  This option might be profitable for
5705 architectures with big regular register files.
5706
5707 @item -fno-ira-share-save-slots
5708 @opindex fno-ira-share-save-slots
5709 Switch off sharing stack slots used for saving call used hard
5710 registers living through a call.  Each hard register will get a
5711 separate stack slot and as a result function stack frame will be
5712 bigger.
5713
5714 @item -fno-ira-share-spill-slots
5715 @opindex fno-ira-share-spill-slots
5716 Switch off sharing stack slots allocated for pseudo-registers.  Each
5717 pseudo-register which did not get a hard register will get a separate
5718 stack slot and as a result function stack frame will be bigger.
5719
5720 @item -fira-verbose=@var{n}
5721 @opindex fira-verbose
5722 Set up how verbose dump file for the integrated register allocator
5723 will be.  Default value is 5.  If the value is greater or equal to 10,
5724 the dump file will be stderr as if the value were @var{n} minus 10.
5725
5726 @item -fdelayed-branch
5727 @opindex fdelayed-branch
5728 If supported for the target machine, attempt to reorder instructions
5729 to exploit instruction slots available after delayed branch
5730 instructions.
5731
5732 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5733
5734 @item -fschedule-insns
5735 @opindex fschedule-insns
5736 If supported for the target machine, attempt to reorder instructions to
5737 eliminate execution stalls due to required data being unavailable.  This
5738 helps machines that have slow floating point or memory load instructions
5739 by allowing other instructions to be issued until the result of the load
5740 or floating point instruction is required.
5741
5742 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5743
5744 @item -fschedule-insns2
5745 @opindex fschedule-insns2
5746 Similar to @option{-fschedule-insns}, but requests an additional pass of
5747 instruction scheduling after register allocation has been done.  This is
5748 especially useful on machines with a relatively small number of
5749 registers and where memory load instructions take more than one cycle.
5750
5751 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5752
5753 @item -fno-sched-interblock
5754 @opindex fno-sched-interblock
5755 Don't schedule instructions across basic blocks.  This is normally
5756 enabled by default when scheduling before register allocation, i.e.@:
5757 with @option{-fschedule-insns} or at @option{-O2} or higher.
5758
5759 @item -fno-sched-spec
5760 @opindex fno-sched-spec
5761 Don't allow speculative motion of non-load instructions.  This is normally
5762 enabled by default when scheduling before register allocation, i.e.@:
5763 with @option{-fschedule-insns} or at @option{-O2} or higher.
5764
5765 @item -fsched-spec-load
5766 @opindex fsched-spec-load
5767 Allow speculative motion of some load instructions.  This only makes
5768 sense when scheduling before register allocation, i.e.@: with
5769 @option{-fschedule-insns} or at @option{-O2} or higher.
5770
5771 @item -fsched-spec-load-dangerous
5772 @opindex fsched-spec-load-dangerous
5773 Allow speculative motion of more load instructions.  This only makes
5774 sense when scheduling before register allocation, i.e.@: with
5775 @option{-fschedule-insns} or at @option{-O2} or higher.
5776
5777 @item -fsched-stalled-insns
5778 @itemx -fsched-stalled-insns=@var{n}
5779 @opindex fsched-stalled-insns
5780 Define how many insns (if any) can be moved prematurely from the queue
5781 of stalled insns into the ready list, during the second scheduling pass.
5782 @option{-fno-sched-stalled-insns} means that no insns will be moved
5783 prematurely, @option{-fsched-stalled-insns=0} means there is no limit
5784 on how many queued insns can be moved prematurely.
5785 @option{-fsched-stalled-insns} without a value is equivalent to
5786 @option{-fsched-stalled-insns=1}.
5787
5788 @item -fsched-stalled-insns-dep
5789 @itemx -fsched-stalled-insns-dep=@var{n}
5790 @opindex fsched-stalled-insns-dep
5791 Define how many insn groups (cycles) will be examined for a dependency
5792 on a stalled insn that is candidate for premature removal from the queue
5793 of stalled insns.  This has an effect only during the second scheduling pass,
5794 and only if @option{-fsched-stalled-insns} is used.
5795 @option{-fno-sched-stalled-insns-dep} is equivalent to
5796 @option{-fsched-stalled-insns-dep=0}.
5797 @option{-fsched-stalled-insns-dep} without a value is equivalent to
5798 @option{-fsched-stalled-insns-dep=1}.
5799
5800 @item -fsched2-use-superblocks
5801 @opindex fsched2-use-superblocks
5802 When scheduling after register allocation, do use superblock scheduling
5803 algorithm.  Superblock scheduling allows motion across basic block boundaries
5804 resulting on faster schedules.  This option is experimental, as not all machine
5805 descriptions used by GCC model the CPU closely enough to avoid unreliable
5806 results from the algorithm.
5807
5808 This only makes sense when scheduling after register allocation, i.e.@: with
5809 @option{-fschedule-insns2} or at @option{-O2} or higher.
5810
5811 @item -fsched2-use-traces
5812 @opindex fsched2-use-traces
5813 Use @option{-fsched2-use-superblocks} algorithm when scheduling after register
5814 allocation and additionally perform code duplication in order to increase the
5815 size of superblocks using tracer pass.  See @option{-ftracer} for details on
5816 trace formation.
5817
5818 This mode should produce faster but significantly longer programs.  Also
5819 without @option{-fbranch-probabilities} the traces constructed may not
5820 match the reality and hurt the performance.  This only makes
5821 sense when scheduling after register allocation, i.e.@: with
5822 @option{-fschedule-insns2} or at @option{-O2} or higher.
5823
5824 @item -fsee
5825 @opindex fsee
5826 Eliminate redundant sign extension instructions and move the non-redundant
5827 ones to optimal placement using lazy code motion (LCM).
5828
5829 @item -freschedule-modulo-scheduled-loops
5830 @opindex freschedule-modulo-scheduled-loops
5831 The modulo scheduling comes before the traditional scheduling, if a loop
5832 was modulo scheduled we may want to prevent the later scheduling passes
5833 from changing its schedule, we use this option to control that.
5834
5835 @item -fselective-scheduling
5836 @opindex fselective-scheduling
5837 Schedule instructions using selective scheduling algorithm.  Selective
5838 scheduling runs instead of the first scheduler pass.
5839
5840 @item -fselective-scheduling2
5841 @opindex fselective-scheduling2
5842 Schedule instructions using selective scheduling algorithm.  Selective
5843 scheduling runs instead of the second scheduler pass.
5844
5845 @item -fsel-sched-pipelining
5846 @opindex fsel-sched-pipelining
5847 Enable software pipelining of innermost loops during selective scheduling.  
5848 This option has no effect until one of @option{-fselective-scheduling} or 
5849 @option{-fselective-scheduling2} is turned on.
5850
5851 @item -fsel-sched-pipelining-outer-loops
5852 @opindex fsel-sched-pipelining-outer-loops
5853 When pipelining loops during selective scheduling, also pipeline outer loops.
5854 This option has no effect until @option{-fsel-sched-pipelining} is turned on.
5855
5856 @item -fcaller-saves
5857 @opindex fcaller-saves
5858 Enable values to be allocated in registers that will be clobbered by
5859 function calls, by emitting extra instructions to save and restore the
5860 registers around such calls.  Such allocation is done only when it
5861 seems to result in better code than would otherwise be produced.
5862
5863 This option is always enabled by default on certain machines, usually
5864 those which have no call-preserved registers to use instead.
5865
5866 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5867
5868 @item -ftree-reassoc
5869 @opindex ftree-reassoc
5870 Perform reassociation on trees.  This flag is enabled by default
5871 at @option{-O} and higher.
5872
5873 @item -ftree-pre
5874 @opindex ftree-pre
5875 Perform partial redundancy elimination (PRE) on trees.  This flag is
5876 enabled by default at @option{-O2} and @option{-O3}.
5877
5878 @item -ftree-fre
5879 @opindex ftree-fre
5880 Perform full redundancy elimination (FRE) on trees.  The difference
5881 between FRE and PRE is that FRE only considers expressions
5882 that are computed on all paths leading to the redundant computation.
5883 This analysis is faster than PRE, though it exposes fewer redundancies.
5884 This flag is enabled by default at @option{-O} and higher.
5885
5886 @item -ftree-copy-prop
5887 @opindex ftree-copy-prop
5888 Perform copy propagation on trees.  This pass eliminates unnecessary
5889 copy operations.  This flag is enabled by default at @option{-O} and
5890 higher.
5891
5892 @item -fipa-pure-const
5893 @opindex fipa-pure-const
5894 Discover which functions are pure or constant.
5895 Enabled by default at @option{-O} and higher.
5896
5897 @item -fipa-reference
5898 @opindex fipa-reference
5899 Discover which static variables do not escape cannot escape the
5900 compilation unit.
5901 Enabled by default at @option{-O} and higher.
5902
5903 @item -fipa-struct-reorg
5904 @opindex fipa-struct-reorg
5905 Perform structure reorganization optimization, that change C-like structures 
5906 layout in order to better utilize spatial locality.  This transformation is 
5907 affective for programs containing arrays of structures.  Available in two 
5908 compilation modes: profile-based (enabled with @option{-fprofile-generate})
5909 or static (which uses built-in heuristics).  Require @option{-fipa-type-escape}
5910 to provide the safety of this transformation.  It works only in whole program
5911 mode, so it requires @option{-fwhole-program} and @option{-combine} to be
5912 enabled.  Structures considered @samp{cold} by this transformation are not
5913 affected (see @option{--param struct-reorg-cold-struct-ratio=@var{value}}).
5914
5915 With this flag, the program debug info reflects a new structure layout.
5916
5917 @item -fipa-pta
5918 @opindex fipa-pta
5919 Perform interprocedural pointer analysis.  This option is experimental
5920 and does not affect generated code.
5921
5922 @item -fipa-cp
5923 @opindex fipa-cp
5924 Perform interprocedural constant propagation.
5925 This optimization analyzes the program to determine when values passed
5926 to functions are constants and then optimizes accordingly.  
5927 This optimization can substantially increase performance
5928 if the application has constants passed to functions.
5929 This flag is enabled by default at @option{-O2}, @option{-Os} and @option{-O3}.
5930
5931 @item -fipa-cp-clone
5932 @opindex fipa-cp-clone
5933 Perform function cloning to make interprocedural constant propagation stronger.
5934 When enabled, interprocedural constant propagation will perform function cloning
5935 when externally visible function can be called with constant arguments.
5936 Because this optimization can create multiple copies of functions,
5937 it may significantly increase code size
5938 (see @option{--param ipcp-unit-growth=@var{value}}).
5939 This flag is enabled by default at @option{-O3}.
5940
5941 @item -fipa-matrix-reorg
5942 @opindex fipa-matrix-reorg
5943 Perform matrix flattening and transposing.
5944 Matrix flattening tries to replace a m-dimensional matrix 
5945 with its equivalent n-dimensional matrix, where n < m.
5946 This reduces the level of indirection needed for accessing the elements
5947 of the matrix. The second optimization is matrix transposing that
5948 attemps to change the order of the matrix's dimensions in order to 
5949 improve cache locality.
5950 Both optimizations need fwhole-program flag. 
5951 Transposing is enabled only if profiling information is avaliable.
5952
5953
5954 @item -ftree-sink
5955 @opindex ftree-sink
5956 Perform forward store motion  on trees.  This flag is
5957 enabled by default at @option{-O} and higher.
5958
5959 @item -ftree-ccp
5960 @opindex ftree-ccp
5961 Perform sparse conditional constant propagation (CCP) on trees.  This
5962 pass only operates on local scalar variables and is enabled by default
5963 at @option{-O} and higher.
5964
5965 @item -ftree-switch-conversion
5966 Perform conversion of simple initializations in a switch to
5967 initializations from a scalar array.  This flag is enabled by default
5968 at @option{-O2} and higher.
5969
5970 @item -ftree-dce
5971 @opindex ftree-dce
5972 Perform dead code elimination (DCE) on trees.  This flag is enabled by
5973 default at @option{-O} and higher.
5974
5975 @item -ftree-builtin-call-dce
5976 @opindex ftree-builtin-call-dce
5977 Perform conditional dead code elimination (DCE) for calls to builtin functions 
5978 that may set @code{errno} but are otherwise side-effect free.  This flag is 
5979 enabled by default at @option{-O2} and higher if @option{-Os} is not also 
5980 specified.
5981
5982 @item -ftree-dominator-opts
5983 @opindex ftree-dominator-opts
5984 Perform a variety of simple scalar cleanups (constant/copy
5985 propagation, redundancy elimination, range propagation and expression
5986 simplification) based on a dominator tree traversal.  This also
5987 performs jump threading (to reduce jumps to jumps). This flag is
5988 enabled by default at @option{-O} and higher.
5989
5990 @item -ftree-dse
5991 @opindex ftree-dse
5992 Perform dead store elimination (DSE) on trees.  A dead store is a store into
5993 a memory location which will later be overwritten by another store without
5994 any intervening loads.  In this case the earlier store can be deleted.  This
5995 flag is enabled by default at @option{-O} and higher.
5996
5997 @item -ftree-ch
5998 @opindex ftree-ch
5999 Perform loop header copying on trees.  This is beneficial since it increases
6000 effectiveness of code motion optimizations.  It also saves one jump.  This flag
6001 is enabled by default at @option{-O} and higher.  It is not enabled
6002 for @option{-Os}, since it usually increases code size.
6003
6004 @item -ftree-loop-optimize
6005 @opindex ftree-loop-optimize
6006 Perform loop optimizations on trees.  This flag is enabled by default
6007 at @option{-O} and higher.
6008
6009 @item -ftree-loop-linear
6010 @opindex ftree-loop-linear
6011 Perform linear loop transformations on tree.  This flag can improve cache
6012 performance and allow further loop optimizations to take place.
6013
6014 @item -fcheck-data-deps
6015 @opindex fcheck-data-deps
6016 Compare the results of several data dependence analyzers.  This option
6017 is used for debugging the data dependence analyzers.
6018
6019 @item -ftree-loop-distribution
6020 Perform loop distribution.  This flag can improve cache performance on
6021 big loop bodies and allow further loop optimizations, like
6022 parallelization or vectorization, to take place.  For example, the loop
6023 @smallexample
6024 DO I = 1, N
6025   A(I) = B(I) + C
6026   D(I) = E(I) * F
6027 ENDDO
6028 @end smallexample
6029 is transformed to
6030 @smallexample
6031 DO I = 1, N
6032    A(I) = B(I) + C
6033 ENDDO
6034 DO I = 1, N
6035    D(I) = E(I) * F
6036 ENDDO
6037 @end smallexample
6038
6039 @item -ftree-loop-im
6040 @opindex ftree-loop-im
6041 Perform loop invariant motion on trees.  This pass moves only invariants that
6042 would be hard to handle at RTL level (function calls, operations that expand to
6043 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
6044 operands of conditions that are invariant out of the loop, so that we can use
6045 just trivial invariantness analysis in loop unswitching.  The pass also includes
6046 store motion.
6047
6048 @item -ftree-loop-ivcanon
6049 @opindex ftree-loop-ivcanon
6050 Create a canonical counter for number of iterations in the loop for that
6051 determining number of iterations requires complicated analysis.  Later
6052 optimizations then may determine the number easily.  Useful especially
6053 in connection with unrolling.
6054
6055 @item -fivopts
6056 @opindex fivopts
6057 Perform induction variable optimizations (strength reduction, induction
6058 variable merging and induction variable elimination) on trees.
6059
6060 @item -ftree-parallelize-loops=n
6061 @opindex ftree-parallelize-loops
6062 Parallelize loops, i.e., split their iteration space to run in n threads.
6063 This is only possible for loops whose iterations are independent
6064 and can be arbitrarily reordered.  The optimization is only
6065 profitable on multiprocessor machines, for loops that are CPU-intensive,
6066 rather than constrained e.g.@: by memory bandwidth.  This option
6067 implies @option{-pthread}, and thus is only supported on targets
6068 that have support for @option{-pthread}.
6069
6070 @item -ftree-sra
6071 @opindex ftree-sra
6072 Perform scalar replacement of aggregates.  This pass replaces structure
6073 references with scalars to prevent committing structures to memory too
6074 early.  This flag is enabled by default at @option{-O} and higher.
6075
6076 @item -ftree-copyrename
6077 @opindex ftree-copyrename
6078 Perform copy renaming on trees.  This pass attempts to rename compiler
6079 temporaries to other variables at copy locations, usually resulting in
6080 variable names which more closely resemble the original variables.  This flag
6081 is enabled by default at @option{-O} and higher.
6082
6083 @item -ftree-ter
6084 @opindex ftree-ter
6085 Perform temporary expression replacement during the SSA->normal phase.  Single
6086 use/single def temporaries are replaced at their use location with their
6087 defining expression.  This results in non-GIMPLE code, but gives the expanders
6088 much more complex trees to work on resulting in better RTL generation.  This is
6089 enabled by default at @option{-O} and higher.
6090
6091 @item -ftree-vectorize
6092 @opindex ftree-vectorize
6093 Perform loop vectorization on trees. This flag is enabled by default at
6094 @option{-O3}.
6095
6096 @item -ftree-vect-loop-version
6097 @opindex ftree-vect-loop-version
6098 Perform loop versioning when doing loop vectorization on trees.  When a loop
6099 appears to be vectorizable except that data alignment or data dependence cannot
6100 be determined at compile time then vectorized and non-vectorized versions of
6101 the loop are generated along with runtime checks for alignment or dependence
6102 to control which version is executed.  This option is enabled by default
6103 except at level @option{-Os} where it is disabled.
6104
6105 @item -fvect-cost-model
6106 @opindex fvect-cost-model
6107 Enable cost model for vectorization.
6108
6109 @item -ftree-vrp
6110 @opindex ftree-vrp
6111 Perform Value Range Propagation on trees.  This is similar to the
6112 constant propagation pass, but instead of values, ranges of values are
6113 propagated.  This allows the optimizers to remove unnecessary range
6114 checks like array bound checks and null pointer checks.  This is
6115 enabled by default at @option{-O2} and higher.  Null pointer check
6116 elimination is only done if @option{-fdelete-null-pointer-checks} is
6117 enabled.
6118
6119 @item -ftracer
6120 @opindex ftracer
6121 Perform tail duplication to enlarge superblock size.  This transformation
6122 simplifies the control flow of the function allowing other optimizations to do
6123 better job.
6124
6125 @item -funroll-loops
6126 @opindex funroll-loops
6127 Unroll loops whose number of iterations can be determined at compile
6128 time or upon entry to the loop.  @option{-funroll-loops} implies
6129 @option{-frerun-cse-after-loop}.  This option makes code larger,
6130 and may or may not make it run faster.
6131
6132 @item -funroll-all-loops
6133 @opindex funroll-all-loops
6134 Unroll all loops, even if their number of iterations is uncertain when
6135 the loop is entered.  This usually makes programs run more slowly.
6136 @option{-funroll-all-loops} implies the same options as
6137 @option{-funroll-loops},
6138
6139 @item -fsplit-ivs-in-unroller
6140 @opindex fsplit-ivs-in-unroller
6141 Enables expressing of values of induction variables in later iterations
6142 of the unrolled loop using the value in the first iteration.  This breaks
6143 long dependency chains, thus improving efficiency of the scheduling passes.
6144
6145 Combination of @option{-fweb} and CSE is often sufficient to obtain the
6146 same effect.  However in cases the loop body is more complicated than
6147 a single basic block, this is not reliable.  It also does not work at all
6148 on some of the architectures due to restrictions in the CSE pass.
6149
6150 This optimization is enabled by default.
6151
6152 @item -fvariable-expansion-in-unroller
6153 @opindex fvariable-expansion-in-unroller
6154 With this option, the compiler will create multiple copies of some
6155 local variables when unrolling a loop which can result in superior code.
6156
6157 @item -fpredictive-commoning
6158 @opindex fpredictive-commoning
6159 Perform predictive commoning optimization, i.e., reusing computations
6160 (especially memory loads and stores) performed in previous
6161 iterations of loops.
6162
6163 This option is enabled at level @option{-O3}.
6164
6165 @item -fprefetch-loop-arrays
6166 @opindex fprefetch-loop-arrays
6167 If supported by the target machine, generate instructions to prefetch
6168 memory to improve the performance of loops that access large arrays.
6169
6170 This option may generate better or worse code; results are highly
6171 dependent on the structure of loops within the source code.
6172
6173 Disabled at level @option{-Os}.
6174
6175 @item -fno-peephole
6176 @itemx -fno-peephole2
6177 @opindex fno-peephole
6178 @opindex fno-peephole2
6179 Disable any machine-specific peephole optimizations.  The difference
6180 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
6181 are implemented in the compiler; some targets use one, some use the
6182 other, a few use both.
6183
6184 @option{-fpeephole} is enabled by default.
6185 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6186
6187 @item -fno-guess-branch-probability
6188 @opindex fno-guess-branch-probability
6189 Do not guess branch probabilities using heuristics.
6190
6191 GCC will use heuristics to guess branch probabilities if they are
6192 not provided by profiling feedback (@option{-fprofile-arcs}).  These
6193 heuristics are based on the control flow graph.  If some branch probabilities
6194 are specified by @samp{__builtin_expect}, then the heuristics will be
6195 used to guess branch probabilities for the rest of the control flow graph,
6196 taking the @samp{__builtin_expect} info into account.  The interactions
6197 between the heuristics and @samp{__builtin_expect} can be complex, and in
6198 some cases, it may be useful to disable the heuristics so that the effects
6199 of @samp{__builtin_expect} are easier to understand.
6200
6201 The default is @option{-fguess-branch-probability} at levels
6202 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6203
6204 @item -freorder-blocks
6205 @opindex freorder-blocks
6206 Reorder basic blocks in the compiled function in order to reduce number of
6207 taken branches and improve code locality.
6208
6209 Enabled at levels @option{-O2}, @option{-O3}.
6210
6211 @item -freorder-blocks-and-partition
6212 @opindex freorder-blocks-and-partition
6213 In addition to reordering basic blocks in the compiled function, in order
6214 to reduce number of taken branches, partitions hot and cold basic blocks
6215 into separate sections of the assembly and .o files, to improve
6216 paging and cache locality performance.
6217
6218 This optimization is automatically turned off in the presence of
6219 exception handling, for linkonce sections, for functions with a user-defined
6220 section attribute and on any architecture that does not support named
6221 sections.
6222
6223 @item -freorder-functions
6224 @opindex freorder-functions
6225 Reorder functions in the object file in order to
6226 improve code locality.  This is implemented by using special
6227 subsections @code{.text.hot} for most frequently executed functions and
6228 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
6229 the linker so object file format must support named sections and linker must
6230 place them in a reasonable way.
6231
6232 Also profile feedback must be available in to make this option effective.  See
6233 @option{-fprofile-arcs} for details.
6234
6235 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6236
6237 @item -fstrict-aliasing
6238 @opindex fstrict-aliasing
6239 Allows the compiler to assume the strictest aliasing rules applicable to
6240 the language being compiled.  For C (and C++), this activates
6241 optimizations based on the type of expressions.  In particular, an
6242 object of one type is assumed never to reside at the same address as an
6243 object of a different type, unless the types are almost the same.  For
6244 example, an @code{unsigned int} can alias an @code{int}, but not a
6245 @code{void*} or a @code{double}.  A character type may alias any other
6246 type.
6247
6248 @anchor{Type-punning}Pay special attention to code like this:
6249 @smallexample
6250 union a_union @{
6251   int i;
6252   double d;
6253 @};
6254
6255 int f() @{
6256   a_union t;
6257   t.d = 3.0;
6258   return t.i;
6259 @}
6260 @end smallexample
6261 The practice of reading from a different union member than the one most
6262 recently written to (called ``type-punning'') is common.  Even with
6263 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
6264 is accessed through the union type.  So, the code above will work as
6265 expected.  @xref{Structures unions enumerations and bit-fields
6266 implementation}.  However, this code might not:
6267 @smallexample
6268 int f() @{
6269   a_union t;
6270   int* ip;
6271   t.d = 3.0;
6272   ip = &t.i;
6273   return *ip;
6274 @}
6275 @end smallexample
6276
6277 Similarly, access by taking the address, casting the resulting pointer
6278 and dereferencing the result has undefined behavior, even if the cast
6279 uses a union type, e.g.:
6280 @smallexample
6281 int f() @{
6282   double d = 3.0;
6283   return ((union a_union *) &d)->i;
6284 @}
6285 @end smallexample
6286
6287 The @option{-fstrict-aliasing} option is enabled at levels
6288 @option{-O2}, @option{-O3}, @option{-Os}.
6289
6290 @item -fstrict-overflow
6291 @opindex fstrict-overflow
6292 Allow the compiler to assume strict signed overflow rules, depending
6293 on the language being compiled.  For C (and C++) this means that
6294 overflow when doing arithmetic with signed numbers is undefined, which
6295 means that the compiler may assume that it will not happen.  This
6296 permits various optimizations.  For example, the compiler will assume
6297 that an expression like @code{i + 10 > i} will always be true for
6298 signed @code{i}.  This assumption is only valid if signed overflow is
6299 undefined, as the expression is false if @code{i + 10} overflows when
6300 using twos complement arithmetic.  When this option is in effect any
6301 attempt to determine whether an operation on signed numbers will
6302 overflow must be written carefully to not actually involve overflow.
6303
6304 This option also allows the compiler to assume strict pointer
6305 semantics: given a pointer to an object, if adding an offset to that
6306 pointer does not produce a pointer to the same object, the addition is
6307 undefined.  This permits the compiler to conclude that @code{p + u >
6308 p} is always true for a pointer @code{p} and unsigned integer
6309 @code{u}.  This assumption is only valid because pointer wraparound is
6310 undefined, as the expression is false if @code{p + u} overflows using
6311 twos complement arithmetic.
6312
6313 See also the @option{-fwrapv} option.  Using @option{-fwrapv} means
6314 that integer signed overflow is fully defined: it wraps.  When
6315 @option{-fwrapv} is used, there is no difference between
6316 @option{-fstrict-overflow} and @option{-fno-strict-overflow} for
6317 integers.  With @option{-fwrapv} certain types of overflow are
6318 permitted.  For example, if the compiler gets an overflow when doing
6319 arithmetic on constants, the overflowed value can still be used with
6320 @option{-fwrapv}, but not otherwise.
6321
6322 The @option{-fstrict-overflow} option is enabled at levels
6323 @option{-O2}, @option{-O3}, @option{-Os}.
6324
6325 @item -falign-functions
6326 @itemx -falign-functions=@var{n}
6327 @opindex falign-functions
6328 Align the start of functions to the next power-of-two greater than
6329 @var{n}, skipping up to @var{n} bytes.  For instance,
6330 @option{-falign-functions=32} aligns functions to the next 32-byte
6331 boundary, but @option{-falign-functions=24} would align to the next
6332 32-byte boundary only if this can be done by skipping 23 bytes or less.
6333
6334 @option{-fno-align-functions} and @option{-falign-functions=1} are
6335 equivalent and mean that functions will not be aligned.
6336
6337 Some assemblers only support this flag when @var{n} is a power of two;
6338 in that case, it is rounded up.
6339
6340 If @var{n} is not specified or is zero, use a machine-dependent default.
6341
6342 Enabled at levels @option{-O2}, @option{-O3}.
6343
6344 @item -falign-labels
6345 @itemx -falign-labels=@var{n}
6346 @opindex falign-labels
6347 Align all branch targets to a power-of-two boundary, skipping up to
6348 @var{n} bytes like @option{-falign-functions}.  This option can easily
6349 make code slower, because it must insert dummy operations for when the
6350 branch target is reached in the usual flow of the code.
6351
6352 @option{-fno-align-labels} and @option{-falign-labels=1} are
6353 equivalent and mean that labels will not be aligned.
6354
6355 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
6356 are greater than this value, then their values are used instead.
6357
6358 If @var{n} is not specified or is zero, use a machine-dependent default
6359 which is very likely to be @samp{1}, meaning no alignment.
6360
6361 Enabled at levels @option{-O2}, @option{-O3}.
6362
6363 @item -falign-loops
6364 @itemx -falign-loops=@var{n}
6365 @opindex falign-loops
6366 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
6367 like @option{-falign-functions}.  The hope is that the loop will be
6368 executed many times, which will make up for any execution of the dummy
6369 operations.
6370
6371 @option{-fno-align-loops} and @option{-falign-loops=1} are
6372 equivalent and mean that loops will not be aligned.
6373
6374 If @var{n} is not specified or is zero, use a machine-dependent default.
6375
6376 Enabled at levels @option{-O2}, @option{-O3}.
6377
6378 @item -falign-jumps
6379 @itemx -falign-jumps=@var{n}
6380 @opindex falign-jumps
6381 Align branch targets to a power-of-two boundary, for branch targets
6382 where the targets can only be reached by jumping, skipping up to @var{n}
6383 bytes like @option{-falign-functions}.  In this case, no dummy operations
6384 need be executed.
6385
6386 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
6387 equivalent and mean that loops will not be aligned.
6388
6389 If @var{n} is not specified or is zero, use a machine-dependent default.
6390
6391 Enabled at levels @option{-O2}, @option{-O3}.
6392
6393 @item -funit-at-a-time
6394 @opindex funit-at-a-time
6395 This option is left for compatibility reasons. @option{-funit-at-a-time}
6396 has no effect, while @option{-fno-unit-at-a-time} implies
6397 @option{-fno-toplevel-reorder} and @option{-fno-section-anchors}.
6398
6399 Enabled by default.
6400
6401 @item -fno-toplevel-reorder
6402 @opindex fno-toplevel-reorder
6403 Do not reorder top-level functions, variables, and @code{asm}
6404 statements.  Output them in the same order that they appear in the
6405 input file.  When this option is used, unreferenced static variables
6406 will not be removed.  This option is intended to support existing code
6407 which relies on a particular ordering.  For new code, it is better to
6408 use attributes.
6409
6410 Enabled at level @option{-O0}.  When disabled explicitly, it also imply
6411 @option{-fno-section-anchors} that is otherwise enabled at @option{-O0} on some
6412 targets.
6413
6414 @item -fweb
6415 @opindex fweb
6416 Constructs webs as commonly used for register allocation purposes and assign
6417 each web individual pseudo register.  This allows the register allocation pass
6418 to operate on pseudos directly, but also strengthens several other optimization
6419 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
6420 however, make debugging impossible, since variables will no longer stay in a
6421 ``home register''.
6422
6423 Enabled by default with @option{-funroll-loops}.
6424
6425 @item -fwhole-program
6426 @opindex fwhole-program
6427 Assume that the current compilation unit represents whole program being
6428 compiled.  All public functions and variables with the exception of @code{main}
6429 and those merged by attribute @code{externally_visible} become static functions
6430 and in a affect gets more aggressively optimized by interprocedural optimizers.
6431 While this option is equivalent to proper use of @code{static} keyword for
6432 programs consisting of single file, in combination with option
6433 @option{--combine} this flag can be used to compile most of smaller scale C
6434 programs since the functions and variables become local for the whole combined
6435 compilation unit, not for the single source file itself.
6436
6437 This option is not supported for Fortran programs.
6438
6439 @item -fcprop-registers
6440 @opindex fcprop-registers
6441 After register allocation and post-register allocation instruction splitting,
6442 we perform a copy-propagation pass to try to reduce scheduling dependencies
6443 and occasionally eliminate the copy.
6444
6445 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6446
6447 @item -fprofile-correction
6448 @opindex fprofile-correction
6449 Profiles collected using an instrumented binary for multi-threaded programs may
6450 be inconsistent due to missed counter updates. When this option is specified,
6451 GCC will use heuristics to correct or smooth out such inconsistencies. By
6452 default, GCC will emit an error message when an inconsistent profile is detected.
6453
6454 @item -fprofile-dir=@var{path}
6455 @opindex fprofile-dir
6456
6457 Set the directory to search the profile data files in to @var{path}.
6458 This option affects only the profile data generated by
6459 @option{-fprofile-generate}, @option{-ftest-coverage}, @option{-fprofile-arcs}
6460 and used by @option{-fprofile-use} and @option{-fbranch-probabilities} 
6461 and its related options.
6462 By default, GCC will use the current directory as @var{path}
6463 thus the profile data file will appear in the same directory as the object file.
6464
6465 @item -fprofile-generate
6466 @itemx -fprofile-generate=@var{path}
6467 @opindex fprofile-generate
6468
6469 Enable options usually used for instrumenting application to produce
6470 profile useful for later recompilation with profile feedback based
6471 optimization.  You must use @option{-fprofile-generate} both when
6472 compiling and when linking your program.
6473
6474 The following options are enabled: @code{-fprofile-arcs}, @code{-fprofile-values}, @code{-fvpt}.
6475
6476 If @var{path} is specified, GCC will look at the @var{path} to find
6477 the profile feeedback data files. See @option{-fprofile-dir}.
6478
6479 @item -fprofile-use
6480 @itemx -fprofile-use=@var{path}
6481 @opindex fprofile-use
6482 Enable profile feedback directed optimizations, and optimizations
6483 generally profitable only with profile feedback available.
6484
6485 The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt},
6486 @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}
6487
6488 By default, GCC emits an error message if the feedback profiles do not
6489 match the source code.  This error can be turned into a warning by using
6490 @option{-Wcoverage-mismatch}.  Note this may result in poorly optimized
6491 code.
6492
6493 If @var{path} is specified, GCC will look at the @var{path} to find
6494 the profile feedback data files. See @option{-fprofile-dir}.
6495 @end table
6496
6497 The following options control compiler behavior regarding floating
6498 point arithmetic.  These options trade off between speed and
6499 correctness.  All must be specifically enabled.
6500
6501 @table @gcctabopt
6502 @item -ffloat-store
6503 @opindex ffloat-store
6504 Do not store floating point variables in registers, and inhibit other
6505 options that might change whether a floating point value is taken from a
6506 register or memory.
6507
6508 @cindex floating point precision
6509 This option prevents undesirable excess precision on machines such as
6510 the 68000 where the floating registers (of the 68881) keep more
6511 precision than a @code{double} is supposed to have.  Similarly for the
6512 x86 architecture.  For most programs, the excess precision does only
6513 good, but a few programs rely on the precise definition of IEEE floating
6514 point.  Use @option{-ffloat-store} for such programs, after modifying
6515 them to store all pertinent intermediate computations into variables.
6516
6517 @item -ffast-math
6518 @opindex ffast-math
6519 Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations},
6520 @option{-ffinite-math-only}, @option{-fno-rounding-math},
6521 @option{-fno-signaling-nans} and @option{-fcx-limited-range}.
6522
6523 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
6524
6525 This option is not turned on by any @option{-O} option since
6526 it can result in incorrect output for programs which depend on
6527 an exact implementation of IEEE or ISO rules/specifications for
6528 math functions. It may, however, yield faster code for programs
6529 that do not require the guarantees of these specifications.
6530
6531 @item -fno-math-errno
6532 @opindex fno-math-errno
6533 Do not set ERRNO after calling math functions that are executed
6534 with a single instruction, e.g., sqrt.  A program that relies on
6535 IEEE exceptions for math error handling may want to use this flag
6536 for speed while maintaining IEEE arithmetic compatibility.
6537
6538 This option is not turned on by any @option{-O} option since
6539 it can result in incorrect output for programs which depend on
6540 an exact implementation of IEEE or ISO rules/specifications for
6541 math functions. It may, however, yield faster code for programs
6542 that do not require the guarantees of these specifications.
6543
6544 The default is @option{-fmath-errno}.
6545
6546 On Darwin systems, the math library never sets @code{errno}.  There is
6547 therefore no reason for the compiler to consider the possibility that
6548 it might, and @option{-fno-math-errno} is the default.
6549
6550 @item -funsafe-math-optimizations
6551 @opindex funsafe-math-optimizations
6552
6553 Allow optimizations for floating-point arithmetic that (a) assume
6554 that arguments and results are valid and (b) may violate IEEE or
6555 ANSI standards.  When used at link-time, it may include libraries
6556 or startup files that change the default FPU control word or other
6557 similar optimizations.
6558
6559 This option is not turned on by any @option{-O} option since
6560 it can result in incorrect output for programs which depend on
6561 an exact implementation of IEEE or ISO rules/specifications for
6562 math functions. It may, however, yield faster code for programs
6563 that do not require the guarantees of these specifications.
6564 Enables @option{-fno-signed-zeros}, @option{-fno-trapping-math},
6565 @option{-fassociative-math} and @option{-freciprocal-math}.
6566
6567 The default is @option{-fno-unsafe-math-optimizations}.
6568
6569 @item -fassociative-math
6570 @opindex fassociative-math
6571
6572 Allow re-association of operands in series of floating-point operations.
6573 This violates the ISO C and C++ language standard by possibly changing
6574 computation result.  NOTE: re-ordering may change the sign of zero as
6575 well as ignore NaNs and inhibit or create underflow or overflow (and
6576 thus cannot be used on a code which relies on rounding behavior like
6577 @code{(x + 2**52) - 2**52)}.  May also reorder floating-point comparisons
6578 and thus may not be used when ordered comparisons are required.
6579 This option requires that both @option{-fno-signed-zeros} and
6580 @option{-fno-trapping-math} be in effect.  Moreover, it doesn't make
6581 much sense with @option{-frounding-math}.
6582
6583 The default is @option{-fno-associative-math}.
6584
6585 @item -freciprocal-math
6586 @opindex freciprocal-math
6587
6588 Allow the reciprocal of a value to be used instead of dividing by
6589 the value if this enables optimizations.  For example @code{x / y}
6590 can be replaced with @code{x * (1/y)} which is useful if @code{(1/y)}
6591 is subject to common subexpression elimination.  Note that this loses
6592 precision and increases the number of flops operating on the value.
6593
6594 The default is @option{-fno-reciprocal-math}.
6595
6596 @item -ffinite-math-only
6597 @opindex ffinite-math-only
6598 Allow optimizations for floating-point arithmetic that assume
6599 that arguments and results are not NaNs or +-Infs.
6600
6601 This option is not turned on by any @option{-O} option since
6602 it can result in incorrect output for programs which depend on
6603 an exact implementation of IEEE or ISO rules/specifications for
6604 math functions. It may, however, yield faster code for programs
6605 that do not require the guarantees of these specifications.
6606
6607 The default is @option{-fno-finite-math-only}.
6608
6609 @item -fno-signed-zeros
6610 @opindex fno-signed-zeros
6611 Allow optimizations for floating point arithmetic that ignore the
6612 signedness of zero.  IEEE arithmetic specifies the behavior of
6613 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
6614 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
6615 This option implies that the sign of a zero result isn't significant.
6616
6617 The default is @option{-fsigned-zeros}.
6618
6619 @item -fno-trapping-math
6620 @opindex fno-trapping-math
6621 Compile code assuming that floating-point operations cannot generate
6622 user-visible traps.  These traps include division by zero, overflow,
6623 underflow, inexact result and invalid operation.  This option requires
6624 that @option{-fno-signaling-nans} be in effect.  Setting this option may
6625 allow faster code if one relies on ``non-stop'' IEEE arithmetic, for example.
6626
6627 This option should never be turned on by any @option{-O} option since
6628 it can result in incorrect output for programs which depend on
6629 an exact implementation of IEEE or ISO rules/specifications for
6630 math functions.
6631
6632 The default is @option{-ftrapping-math}.
6633
6634 @item -frounding-math
6635 @opindex frounding-math
6636 Disable transformations and optimizations that assume default floating
6637 point rounding behavior.  This is round-to-zero for all floating point
6638 to integer conversions, and round-to-nearest for all other arithmetic
6639 truncations.  This option should be specified for programs that change
6640 the FP rounding mode dynamically, or that may be executed with a
6641 non-default rounding mode.  This option disables constant folding of
6642 floating point expressions at compile-time (which may be affected by
6643 rounding mode) and arithmetic transformations that are unsafe in the
6644 presence of sign-dependent rounding modes.
6645
6646 The default is @option{-fno-rounding-math}.
6647
6648 This option is experimental and does not currently guarantee to
6649 disable all GCC optimizations that are affected by rounding mode.
6650 Future versions of GCC may provide finer control of this setting
6651 using C99's @code{FENV_ACCESS} pragma.  This command line option
6652 will be used to specify the default state for @code{FENV_ACCESS}.
6653
6654 @item -frtl-abstract-sequences
6655 @opindex frtl-abstract-sequences
6656 It is a size optimization method. This option is to find identical
6657 sequences of code, which can be turned into pseudo-procedures  and
6658 then  replace  all  occurrences with  calls to  the  newly created
6659 subroutine. It is kind of an opposite of @option{-finline-functions}.
6660 This optimization runs at RTL level.
6661
6662 @item -fsignaling-nans
6663 @opindex fsignaling-nans
6664 Compile code assuming that IEEE signaling NaNs may generate user-visible
6665 traps during floating-point operations.  Setting this option disables
6666 optimizations that may change the number of exceptions visible with
6667 signaling NaNs.  This option implies @option{-ftrapping-math}.
6668
6669 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
6670 be defined.
6671
6672 The default is @option{-fno-signaling-nans}.
6673
6674 This option is experimental and does not currently guarantee to
6675 disable all GCC optimizations that affect signaling NaN behavior.
6676
6677 @item -fsingle-precision-constant
6678 @opindex fsingle-precision-constant
6679 Treat floating point constant as single precision constant instead of
6680 implicitly converting it to double precision constant.
6681
6682 @item -fcx-limited-range
6683 @opindex fcx-limited-range
6684 When enabled, this option states that a range reduction step is not
6685 needed when performing complex division.  Also, there is no checking
6686 whether the result of a complex multiplication or division is @code{NaN
6687 + I*NaN}, with an attempt to rescue the situation in that case.  The
6688 default is @option{-fno-cx-limited-range}, but is enabled by
6689 @option{-ffast-math}.
6690
6691 This option controls the default setting of the ISO C99
6692 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
6693 all languages.
6694
6695 @item -fcx-fortran-rules
6696 @opindex fcx-fortran-rules
6697 Complex multiplication and division follow Fortran rules.  Range
6698 reduction is done as part of complex division, but there is no checking
6699 whether the result of a complex multiplication or division is @code{NaN
6700 + I*NaN}, with an attempt to rescue the situation in that case.
6701
6702 The default is @option{-fno-cx-fortran-rules}.
6703
6704 @end table
6705
6706 The following options control optimizations that may improve
6707 performance, but are not enabled by any @option{-O} options.  This
6708 section includes experimental options that may produce broken code.
6709
6710 @table @gcctabopt
6711 @item -fbranch-probabilities
6712 @opindex fbranch-probabilities
6713 After running a program compiled with @option{-fprofile-arcs}
6714 (@pxref{Debugging Options,, Options for Debugging Your Program or
6715 @command{gcc}}), you can compile it a second time using
6716 @option{-fbranch-probabilities}, to improve optimizations based on
6717 the number of times each branch was taken.  When the program
6718 compiled with @option{-fprofile-arcs} exits it saves arc execution
6719 counts to a file called @file{@var{sourcename}.gcda} for each source
6720 file.  The information in this data file is very dependent on the
6721 structure of the generated code, so you must use the same source code
6722 and the same optimization options for both compilations.
6723
6724 With @option{-fbranch-probabilities}, GCC puts a
6725 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
6726 These can be used to improve optimization.  Currently, they are only
6727 used in one place: in @file{reorg.c}, instead of guessing which path a
6728 branch is mostly to take, the @samp{REG_BR_PROB} values are used to
6729 exactly determine which path is taken more often.
6730
6731 @item -fprofile-values
6732 @opindex fprofile-values
6733 If combined with @option{-fprofile-arcs}, it adds code so that some
6734 data about values of expressions in the program is gathered.
6735
6736 With @option{-fbranch-probabilities}, it reads back the data gathered
6737 from profiling values of expressions and adds @samp{REG_VALUE_PROFILE}
6738 notes to instructions for their later usage in optimizations.
6739
6740 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
6741
6742 @item -fvpt
6743 @opindex fvpt
6744 If combined with @option{-fprofile-arcs}, it instructs the compiler to add
6745 a code to gather information about values of expressions.
6746
6747 With @option{-fbranch-probabilities}, it reads back the data gathered
6748 and actually performs the optimizations based on them.
6749 Currently the optimizations include specialization of division operation
6750 using the knowledge about the value of the denominator.
6751
6752 @item -frename-registers
6753 @opindex frename-registers
6754 Attempt to avoid false dependencies in scheduled code by making use
6755 of registers left over after register allocation.  This optimization
6756 will most benefit processors with lots of registers.  Depending on the
6757 debug information format adopted by the target, however, it can
6758 make debugging impossible, since variables will no longer stay in
6759 a ``home register''.
6760
6761 Enabled by default with @option{-funroll-loops}.
6762
6763 @item -ftracer
6764 @opindex ftracer
6765 Perform tail duplication to enlarge superblock size.  This transformation
6766 simplifies the control flow of the function allowing other optimizations to do
6767 better job.
6768
6769 Enabled with @option{-fprofile-use}.
6770
6771 @item -funroll-loops
6772 @opindex funroll-loops
6773 Unroll loops whose number of iterations can be determined at compile time or
6774 upon entry to the loop.  @option{-funroll-loops} implies
6775 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
6776 It also turns on complete loop peeling (i.e.@: complete removal of loops with
6777 small constant number of iterations).  This option makes code larger, and may
6778 or may not make it run faster.
6779
6780 Enabled with @option{-fprofile-use}.
6781
6782 @item -funroll-all-loops
6783 @opindex funroll-all-loops
6784 Unroll all loops, even if their number of iterations is uncertain when
6785 the loop is entered.  This usually makes programs run more slowly.
6786 @option{-funroll-all-loops} implies the same options as
6787 @option{-funroll-loops}.
6788
6789 @item -fpeel-loops
6790 @opindex fpeel-loops
6791 Peels the loops for that there is enough information that they do not
6792 roll much (from profile feedback).  It also turns on complete loop peeling
6793 (i.e.@: complete removal of loops with small constant number of iterations).
6794
6795 Enabled with @option{-fprofile-use}.
6796
6797 @item -fmove-loop-invariants
6798 @opindex fmove-loop-invariants
6799 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
6800 at level @option{-O1}
6801
6802 @item -funswitch-loops
6803 @opindex funswitch-loops
6804 Move branches with loop invariant conditions out of the loop, with duplicates
6805 of the loop on both branches (modified according to result of the condition).
6806
6807 @item -ffunction-sections
6808 @itemx -fdata-sections
6809 @opindex ffunction-sections
6810 @opindex fdata-sections
6811 Place each function or data item into its own section in the output
6812 file if the target supports arbitrary sections.  The name of the
6813 function or the name of the data item determines the section's name
6814 in the output file.
6815
6816 Use these options on systems where the linker can perform optimizations
6817 to improve locality of reference in the instruction space.  Most systems
6818 using the ELF object format and SPARC processors running Solaris 2 have
6819 linkers with such optimizations.  AIX may have these optimizations in
6820 the future.
6821
6822 Only use these options when there are significant benefits from doing
6823 so.  When you specify these options, the assembler and linker will
6824 create larger object and executable files and will also be slower.
6825 You will not be able to use @code{gprof} on all systems if you
6826 specify this option and you may have problems with debugging if
6827 you specify both this option and @option{-g}.
6828
6829 @item -fbranch-target-load-optimize
6830 @opindex fbranch-target-load-optimize
6831 Perform branch target register load optimization before prologue / epilogue
6832 threading.
6833 The use of target registers can typically be exposed only during reload,
6834 thus hoisting loads out of loops and doing inter-block scheduling needs
6835 a separate optimization pass.
6836
6837 @item -fbranch-target-load-optimize2
6838 @opindex fbranch-target-load-optimize2
6839 Perform branch target register load optimization after prologue / epilogue
6840 threading.
6841
6842 @item -fbtr-bb-exclusive
6843 @opindex fbtr-bb-exclusive
6844 When performing branch target register load optimization, don't reuse
6845 branch target registers in within any basic block.
6846
6847 @item -fstack-protector
6848 @opindex fstack-protector
6849 Emit extra code to check for buffer overflows, such as stack smashing
6850 attacks.  This is done by adding a guard variable to functions with
6851 vulnerable objects.  This includes functions that call alloca, and
6852 functions with buffers larger than 8 bytes.  The guards are initialized
6853 when a function is entered and then checked when the function exits.
6854 If a guard check fails, an error message is printed and the program exits.
6855
6856 @item -fstack-protector-all
6857 @opindex fstack-protector-all
6858 Like @option{-fstack-protector} except that all functions are protected.
6859
6860 @item -fsection-anchors
6861 @opindex fsection-anchors
6862 Try to reduce the number of symbolic address calculations by using
6863 shared ``anchor'' symbols to address nearby objects.  This transformation
6864 can help to reduce the number of GOT entries and GOT accesses on some
6865 targets.
6866
6867 For example, the implementation of the following function @code{foo}:
6868
6869 @smallexample
6870 static int a, b, c;
6871 int foo (void) @{ return a + b + c; @}
6872 @end smallexample
6873
6874 would usually calculate the addresses of all three variables, but if you
6875 compile it with @option{-fsection-anchors}, it will access the variables
6876 from a common anchor point instead.  The effect is similar to the
6877 following pseudocode (which isn't valid C):
6878
6879 @smallexample
6880 int foo (void)
6881 @{
6882   register int *xr = &x;
6883   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
6884 @}
6885 @end smallexample
6886
6887 Not all targets support this option.
6888
6889 @item --param @var{name}=@var{value}
6890 @opindex param
6891 In some places, GCC uses various constants to control the amount of
6892 optimization that is done.  For example, GCC will not inline functions
6893 that contain more that a certain number of instructions.  You can
6894 control some of these constants on the command-line using the
6895 @option{--param} option.
6896
6897 The names of specific parameters, and the meaning of the values, are
6898 tied to the internals of the compiler, and are subject to change
6899 without notice in future releases.
6900
6901 In each case, the @var{value} is an integer.  The allowable choices for
6902 @var{name} are given in the following table:
6903
6904 @table @gcctabopt
6905 @item sra-max-structure-size
6906 The maximum structure size, in bytes, at which the scalar replacement
6907 of aggregates (SRA) optimization will perform block copies.  The
6908 default value, 0, implies that GCC will select the most appropriate
6909 size itself.
6910
6911 @item sra-field-structure-ratio
6912 The threshold ratio (as a percentage) between instantiated fields and
6913 the complete structure size.  We say that if the ratio of the number
6914 of bytes in instantiated fields to the number of bytes in the complete
6915 structure exceeds this parameter, then block copies are not used.  The
6916 default is 75.
6917
6918 @item struct-reorg-cold-struct-ratio
6919 The threshold ratio (as a percentage) between a structure frequency
6920 and the frequency of the hottest structure in the program.  This parameter
6921 is used by struct-reorg optimization enabled by @option{-fipa-struct-reorg}.
6922 We say that if the ratio of a structure frequency, calculated by profiling, 
6923 to the hottest structure frequency in the program is less than this 
6924 parameter, then structure reorganization is not applied to this structure.
6925 The default is 10.
6926
6927 @item predictable-branch-cost-outcome
6928 When branch is predicted to be taken with probability lower than this threshold
6929 (in percent), then it is considered well predictable. The default is 10.
6930
6931 @item max-crossjump-edges
6932 The maximum number of incoming edges to consider for crossjumping.
6933 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
6934 the number of edges incoming to each block.  Increasing values mean
6935 more aggressive optimization, making the compile time increase with
6936 probably small improvement in executable size.
6937
6938 @item min-crossjump-insns
6939 The minimum number of instructions which must be matched at the end
6940 of two blocks before crossjumping will be performed on them.  This
6941 value is ignored in the case where all instructions in the block being
6942 crossjumped from are matched.  The default value is 5.
6943
6944 @item max-grow-copy-bb-insns
6945 The maximum code size expansion factor when copying basic blocks
6946 instead of jumping.  The expansion is relative to a jump instruction.
6947 The default value is 8.
6948
6949 @item max-goto-duplication-insns
6950 The maximum number of instructions to duplicate to a block that jumps
6951 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
6952 passes, GCC factors computed gotos early in the compilation process,
6953 and unfactors them as late as possible.  Only computed jumps at the
6954 end of a basic blocks with no more than max-goto-duplication-insns are
6955 unfactored.  The default value is 8.
6956
6957 @item max-delay-slot-insn-search
6958 The maximum number of instructions to consider when looking for an
6959 instruction to fill a delay slot.  If more than this arbitrary number of
6960 instructions is searched, the time savings from filling the delay slot
6961 will be minimal so stop searching.  Increasing values mean more
6962 aggressive optimization, making the compile time increase with probably
6963 small improvement in executable run time.
6964
6965 @item max-delay-slot-live-search
6966 When trying to fill delay slots, the maximum number of instructions to
6967 consider when searching for a block with valid live register
6968 information.  Increasing this arbitrarily chosen value means more
6969 aggressive optimization, increasing the compile time.  This parameter
6970 should be removed when the delay slot code is rewritten to maintain the
6971 control-flow graph.
6972
6973 @item max-gcse-memory
6974 The approximate maximum amount of memory that will be allocated in
6975 order to perform the global common subexpression elimination
6976 optimization.  If more memory than specified is required, the
6977 optimization will not be done.
6978
6979 @item max-gcse-passes
6980 The maximum number of passes of GCSE to run.  The default is 1.
6981
6982 @item max-pending-list-length
6983 The maximum number of pending dependencies scheduling will allow
6984 before flushing the current state and starting over.  Large functions
6985 with few branches or calls can create excessively large lists which
6986 needlessly consume memory and resources.
6987
6988 @item max-inline-insns-single
6989 Several parameters control the tree inliner used in gcc.
6990 This number sets the maximum number of instructions (counted in GCC's
6991 internal representation) in a single function that the tree inliner
6992 will consider for inlining.  This only affects functions declared
6993 inline and methods implemented in a class declaration (C++).
6994 The default value is 450.
6995
6996 @item max-inline-insns-auto
6997 When you use @option{-finline-functions} (included in @option{-O3}),
6998 a lot of functions that would otherwise not be considered for inlining
6999 by the compiler will be investigated.  To those functions, a different
7000 (more restrictive) limit compared to functions declared inline can
7001 be applied.
7002 The default value is 90.
7003
7004 @item large-function-insns
7005 The limit specifying really large functions.  For functions larger than this
7006 limit after inlining inlining is constrained by
7007 @option{--param large-function-growth}.  This parameter is useful primarily
7008 to avoid extreme compilation time caused by non-linear algorithms used by the
7009 backend.
7010 The default value is 2700.
7011
7012 @item large-function-growth
7013 Specifies maximal growth of large function caused by inlining in percents.
7014 The default value is 100 which limits large function growth to 2.0 times
7015 the original size.
7016
7017 @item large-unit-insns
7018 The limit specifying large translation unit.  Growth caused by inlining of
7019 units larger than this limit is limited by @option{--param inline-unit-growth}.
7020 For small units this might be too tight (consider unit consisting of function A
7021 that is inline and B that just calls A three time.  If B is small relative to
7022 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
7023 large units consisting of small inlineable functions however the overall unit
7024 growth limit is needed to avoid exponential explosion of code size.  Thus for
7025 smaller units, the size is increased to @option{--param large-unit-insns}
7026 before applying @option{--param inline-unit-growth}.  The default is 10000
7027
7028 @item inline-unit-growth
7029 Specifies maximal overall growth of the compilation unit caused by inlining.
7030 The default value is 30 which limits unit growth to 1.3 times the original
7031 size.
7032
7033 @item ipcp-unit-growth
7034 Specifies maximal overall growth of the compilation unit caused by
7035 interprocedural constant propagation.  The default value is 10 which limits
7036 unit growth to 1.1 times the original size.
7037
7038 @item large-stack-frame
7039 The limit specifying large stack frames.  While inlining the algorithm is trying
7040 to not grow past this limit too much.  Default value is 256 bytes.
7041
7042 @item large-stack-frame-growth
7043 Specifies maximal growth of large stack frames caused by inlining in percents.
7044 The default value is 1000 which limits large stack frame growth to 11 times
7045 the original size.
7046
7047 @item max-inline-insns-recursive
7048 @itemx max-inline-insns-recursive-auto
7049 Specifies maximum number of instructions out-of-line copy of self recursive inline
7050 function can grow into by performing recursive inlining.
7051
7052 For functions declared inline @option{--param max-inline-insns-recursive} is
7053 taken into account.  For function not declared inline, recursive inlining
7054 happens only when @option{-finline-functions} (included in @option{-O3}) is
7055 enabled and @option{--param max-inline-insns-recursive-auto} is used.  The
7056 default value is 450.
7057
7058 @item max-inline-recursive-depth
7059 @itemx max-inline-recursive-depth-auto
7060 Specifies maximum recursion depth used by the recursive inlining.
7061
7062 For functions declared inline @option{--param max-inline-recursive-depth} is
7063 taken into account.  For function not declared inline, recursive inlining
7064 happens only when @option{-finline-functions} (included in @option{-O3}) is
7065 enabled and @option{--param max-inline-recursive-depth-auto} is used.  The
7066 default value is 8.
7067
7068 @item min-inline-recursive-probability
7069 Recursive inlining is profitable only for function having deep recursion
7070 in average and can hurt for function having little recursion depth by
7071 increasing the prologue size or complexity of function body to other
7072 optimizers.
7073
7074 When profile feedback is available (see @option{-fprofile-generate}) the actual
7075 recursion depth can be guessed from probability that function will recurse via
7076 given call expression.  This parameter limits inlining only to call expression
7077 whose probability exceeds given threshold (in percents).  The default value is
7078 10.
7079
7080 @item inline-call-cost
7081 Specify cost of call instruction relative to simple arithmetics operations
7082 (having cost of 1).  Increasing this cost disqualifies inlining of non-leaf
7083 functions and at the same time increases size of leaf function that is believed to
7084 reduce function size by being inlined.  In effect it increases amount of
7085 inlining for code having large abstraction penalty (many functions that just
7086 pass the arguments to other functions) and decrease inlining for code with low
7087 abstraction penalty.  The default value is 12.
7088
7089 @item min-vect-loop-bound
7090 The minimum number of iterations under which a loop will not get vectorized
7091 when @option{-ftree-vectorize} is used.  The number of iterations after
7092 vectorization needs to be greater than the value specified by this option
7093 to allow vectorization.  The default value is 0.
7094
7095 @item max-unrolled-insns
7096 The maximum number of instructions that a loop should have if that loop
7097 is unrolled, and if the loop is unrolled, it determines how many times
7098 the loop code is unrolled.
7099
7100 @item max-average-unrolled-insns
7101 The maximum number of instructions biased by probabilities of their execution
7102 that a loop should have if that loop is unrolled, and if the loop is unrolled,
7103 it determines how many times the loop code is unrolled.
7104
7105 @item max-unroll-times
7106 The maximum number of unrollings of a single loop.
7107
7108 @item max-peeled-insns
7109 The maximum number of instructions that a loop should have if that loop
7110 is peeled, and if the loop is peeled, it determines how many times
7111 the loop code is peeled.
7112
7113 @item max-peel-times
7114 The maximum number of peelings of a single loop.
7115
7116 @item max-completely-peeled-insns
7117 The maximum number of insns of a completely peeled loop.
7118
7119 @item max-completely-peel-times
7120 The maximum number of iterations of a loop to be suitable for complete peeling.
7121
7122 @item max-unswitch-insns
7123 The maximum number of insns of an unswitched loop.
7124
7125 @item max-unswitch-level
7126 The maximum number of branches unswitched in a single loop.
7127
7128 @item lim-expensive
7129 The minimum cost of an expensive expression in the loop invariant motion.
7130
7131 @item iv-consider-all-candidates-bound
7132 Bound on number of candidates for induction variables below that
7133 all candidates are considered for each use in induction variable
7134 optimizations.  Only the most relevant candidates are considered
7135 if there are more candidates, to avoid quadratic time complexity.
7136
7137 @item iv-max-considered-uses
7138 The induction variable optimizations give up on loops that contain more
7139 induction variable uses.
7140
7141 @item iv-always-prune-cand-set-bound
7142 If number of candidates in the set is smaller than this value,
7143 we always try to remove unnecessary ivs from the set during its
7144 optimization when a new iv is added to the set.
7145
7146 @item scev-max-expr-size
7147 Bound on size of expressions used in the scalar evolutions analyzer.
7148 Large expressions slow the analyzer.
7149
7150 @item omega-max-vars
7151 The maximum number of variables in an Omega constraint system.
7152 The default value is 128.
7153
7154 @item omega-max-geqs
7155 The maximum number of inequalities in an Omega constraint system.
7156 The default value is 256.
7157
7158 @item omega-max-eqs
7159 The maximum number of equalities in an Omega constraint system.
7160 The default value is 128.
7161
7162 @item omega-max-wild-cards
7163 The maximum number of wildcard variables that the Omega solver will
7164 be able to insert.  The default value is 18.
7165
7166 @item omega-hash-table-size
7167 The size of the hash table in the Omega solver.  The default value is
7168 550.
7169
7170 @item omega-max-keys
7171 The maximal number of keys used by the Omega solver.  The default
7172 value is 500.
7173
7174 @item omega-eliminate-redundant-constraints
7175 When set to 1, use expensive methods to eliminate all redundant
7176 constraints.  The default value is 0.
7177
7178 @item vect-max-version-for-alignment-checks
7179 The maximum number of runtime checks that can be performed when
7180 doing loop versioning for alignment in the vectorizer.  See option
7181 ftree-vect-loop-version for more information.
7182
7183 @item vect-max-version-for-alias-checks
7184 The maximum number of runtime checks that can be performed when
7185 doing loop versioning for alias in the vectorizer.  See option
7186 ftree-vect-loop-version for more information.
7187
7188 @item max-iterations-to-track
7189
7190 The maximum number of iterations of a loop the brute force algorithm
7191 for analysis of # of iterations of the loop tries to evaluate.
7192
7193 @item hot-bb-count-fraction
7194 Select fraction of the maximal count of repetitions of basic block in program
7195 given basic block needs to have to be considered hot.
7196
7197 @item hot-bb-frequency-fraction
7198 Select fraction of the maximal frequency of executions of basic block in
7199 function given basic block needs to have to be considered hot
7200
7201 @item max-predicted-iterations
7202 The maximum number of loop iterations we predict statically.  This is useful
7203 in cases where function contain single loop with known bound and other loop
7204 with unknown.  We predict the known number of iterations correctly, while
7205 the unknown number of iterations average to roughly 10.  This means that the
7206 loop without bounds would appear artificially cold relative to the other one.
7207
7208 @item align-threshold
7209
7210 Select fraction of the maximal frequency of executions of basic block in
7211 function given basic block will get aligned.
7212
7213 @item align-loop-iterations
7214
7215 A loop expected to iterate at lest the selected number of iterations will get
7216 aligned.
7217
7218 @item tracer-dynamic-coverage
7219 @itemx tracer-dynamic-coverage-feedback
7220
7221 This value is used to limit superblock formation once the given percentage of
7222 executed instructions is covered.  This limits unnecessary code size
7223 expansion.
7224
7225 The @option{tracer-dynamic-coverage-feedback} is used only when profile
7226 feedback is available.  The real profiles (as opposed to statically estimated
7227 ones) are much less balanced allowing the threshold to be larger value.
7228
7229 @item tracer-max-code-growth
7230 Stop tail duplication once code growth has reached given percentage.  This is
7231 rather hokey argument, as most of the duplicates will be eliminated later in
7232 cross jumping, so it may be set to much higher values than is the desired code
7233 growth.
7234
7235 @item tracer-min-branch-ratio
7236
7237 Stop reverse growth when the reverse probability of best edge is less than this
7238 threshold (in percent).
7239
7240 @item tracer-min-branch-ratio
7241 @itemx tracer-min-branch-ratio-feedback
7242
7243 Stop forward growth if the best edge do have probability lower than this
7244 threshold.
7245
7246 Similarly to @option{tracer-dynamic-coverage} two values are present, one for
7247 compilation for profile feedback and one for compilation without.  The value
7248 for compilation with profile feedback needs to be more conservative (higher) in
7249 order to make tracer effective.
7250
7251 @item max-cse-path-length
7252
7253 Maximum number of basic blocks on path that cse considers.  The default is 10.
7254
7255 @item max-cse-insns
7256 The maximum instructions CSE process before flushing. The default is 1000.
7257
7258 @item max-aliased-vops
7259
7260 Maximum number of virtual operands per function allowed to represent
7261 aliases before triggering the alias partitioning heuristic.  Alias
7262 partitioning reduces compile times and memory consumption needed for
7263 aliasing at the expense of precision loss in alias information.  The
7264 default value for this parameter is 100 for -O1, 500 for -O2 and 1000
7265 for -O3.
7266
7267 Notice that if a function contains more memory statements than the
7268 value of this parameter, it is not really possible to achieve this
7269 reduction.  In this case, the compiler will use the number of memory
7270 statements as the value for @option{max-aliased-vops}.
7271
7272 @item avg-aliased-vops
7273
7274 Average number of virtual operands per statement allowed to represent
7275 aliases before triggering the alias partitioning heuristic.  This
7276 works in conjunction with @option{max-aliased-vops}.  If a function
7277 contains more than @option{max-aliased-vops} virtual operators, then
7278 memory symbols will be grouped into memory partitions until either the
7279 total number of virtual operators is below @option{max-aliased-vops}
7280 or the average number of virtual operators per memory statement is
7281 below @option{avg-aliased-vops}.  The default value for this parameter
7282 is 1 for -O1 and -O2, and 3 for -O3.
7283
7284 @item ggc-min-expand
7285
7286 GCC uses a garbage collector to manage its own memory allocation.  This
7287 parameter specifies the minimum percentage by which the garbage
7288 collector's heap should be allowed to expand between collections.
7289 Tuning this may improve compilation speed; it has no effect on code
7290 generation.
7291
7292 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
7293 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of "RAM" is
7294 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
7295 GCC is not able to calculate RAM on a particular platform, the lower
7296 bound of 30% is used.  Setting this parameter and
7297 @option{ggc-min-heapsize} to zero causes a full collection to occur at
7298 every opportunity.  This is extremely slow, but can be useful for
7299 debugging.
7300
7301 @item ggc-min-heapsize
7302
7303 Minimum size of the garbage collector's heap before it begins bothering
7304 to collect garbage.  The first collection occurs after the heap expands
7305 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
7306 tuning this may improve compilation speed, and has no effect on code
7307 generation.
7308
7309 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit which
7310 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
7311 with a lower bound of 4096 (four megabytes) and an upper bound of
7312 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
7313 particular platform, the lower bound is used.  Setting this parameter
7314 very large effectively disables garbage collection.  Setting this
7315 parameter and @option{ggc-min-expand} to zero causes a full collection
7316 to occur at every opportunity.
7317
7318 @item max-reload-search-insns
7319 The maximum number of instruction reload should look backward for equivalent
7320 register.  Increasing values mean more aggressive optimization, making the
7321 compile time increase with probably slightly better performance.  The default
7322 value is 100.
7323
7324 @item max-cselib-memory-locations
7325 The maximum number of memory locations cselib should take into account.
7326 Increasing values mean more aggressive optimization, making the compile time
7327 increase with probably slightly better performance.  The default value is 500.
7328
7329 @item reorder-blocks-duplicate
7330 @itemx reorder-blocks-duplicate-feedback
7331
7332 Used by basic block reordering pass to decide whether to use unconditional
7333 branch or duplicate the code on its destination.  Code is duplicated when its
7334 estimated size is smaller than this value multiplied by the estimated size of
7335 unconditional jump in the hot spots of the program.
7336
7337 The @option{reorder-block-duplicate-feedback} is used only when profile
7338 feedback is available and may be set to higher values than
7339 @option{reorder-block-duplicate} since information about the hot spots is more
7340 accurate.
7341
7342 @item max-sched-ready-insns
7343 The maximum number of instructions ready to be issued the scheduler should
7344 consider at any given time during the first scheduling pass.  Increasing
7345 values mean more thorough searches, making the compilation time increase
7346 with probably little benefit.  The default value is 100.
7347
7348 @item max-sched-region-blocks
7349 The maximum number of blocks in a region to be considered for
7350 interblock scheduling.  The default value is 10.
7351
7352 @item max-pipeline-region-blocks
7353 The maximum number of blocks in a region to be considered for
7354 pipelining in the selective scheduler.  The default value is 15.
7355
7356 @item max-sched-region-insns
7357 The maximum number of insns in a region to be considered for
7358 interblock scheduling.  The default value is 100.
7359
7360 @item max-pipeline-region-insns
7361 The maximum number of insns in a region to be considered for
7362 pipelining in the selective scheduler.  The default value is 200.
7363
7364 @item min-spec-prob
7365 The minimum probability (in percents) of reaching a source block
7366 for interblock speculative scheduling.  The default value is 40.
7367
7368 @item max-sched-extend-regions-iters
7369 The maximum number of iterations through CFG to extend regions.
7370 0 - disable region extension,
7371 N - do at most N iterations.
7372 The default value is 0.
7373
7374 @item max-sched-insn-conflict-delay
7375 The maximum conflict delay for an insn to be considered for speculative motion.
7376 The default value is 3.
7377
7378 @item sched-spec-prob-cutoff
7379 The minimal probability of speculation success (in percents), so that
7380 speculative insn will be scheduled.
7381 The default value is 40.
7382
7383 @item sched-mem-true-dep-cost
7384 Minimal distance (in CPU cycles) between store and load targeting same
7385 memory locations.  The default value is 1.
7386
7387 @item selsched-max-lookahead
7388 The maximum size of the lookahead window of selective scheduling.  It is a
7389 depth of search for available instructions.
7390 The default value is 50.
7391
7392 @item selsched-max-sched-times
7393 The maximum number of times that an instruction will be scheduled during 
7394 selective scheduling.  This is the limit on the number of iterations 
7395 through which the instruction may be pipelined.  The default value is 2.
7396
7397 @item selsched-max-insns-to-rename
7398 The maximum number of best instructions in the ready list that are considered
7399 for renaming in the selective scheduler.  The default value is 2.
7400
7401 @item max-last-value-rtl
7402 The maximum size measured as number of RTLs that can be recorded in an expression
7403 in combiner for a pseudo register as last known value of that register.  The default
7404 is 10000.
7405
7406 @item integer-share-limit
7407 Small integer constants can use a shared data structure, reducing the
7408 compiler's memory usage and increasing its speed.  This sets the maximum
7409 value of a shared integer constant.  The default value is 256.
7410
7411 @item min-virtual-mappings
7412 Specifies the minimum number of virtual mappings in the incremental
7413 SSA updater that should be registered to trigger the virtual mappings
7414 heuristic defined by virtual-mappings-ratio.  The default value is
7415 100.
7416
7417 @item virtual-mappings-ratio
7418 If the number of virtual mappings is virtual-mappings-ratio bigger
7419 than the number of virtual symbols to be updated, then the incremental
7420 SSA updater switches to a full update for those symbols.  The default
7421 ratio is 3.
7422
7423 @item ssp-buffer-size
7424 The minimum size of buffers (i.e.@: arrays) that will receive stack smashing
7425 protection when @option{-fstack-protection} is used.
7426
7427 @item max-jump-thread-duplication-stmts
7428 Maximum number of statements allowed in a block that needs to be
7429 duplicated when threading jumps.
7430
7431 @item max-fields-for-field-sensitive
7432 Maximum number of fields in a structure we will treat in
7433 a field sensitive manner during pointer analysis.  The default is zero
7434 for -O0, and -O1 and 100 for -Os, -O2, and -O3.
7435
7436 @item prefetch-latency
7437 Estimate on average number of instructions that are executed before
7438 prefetch finishes.  The distance we prefetch ahead is proportional
7439 to this constant.  Increasing this number may also lead to less
7440 streams being prefetched (see @option{simultaneous-prefetches}).
7441
7442 @item simultaneous-prefetches
7443 Maximum number of prefetches that can run at the same time.
7444
7445 @item l1-cache-line-size
7446 The size of cache line in L1 cache, in bytes.
7447
7448 @item l1-cache-size
7449 The size of L1 cache, in kilobytes.
7450
7451 @item l2-cache-size
7452 The size of L2 cache, in kilobytes.
7453
7454 @item use-canonical-types
7455 Whether the compiler should use the ``canonical'' type system.  By
7456 default, this should always be 1, which uses a more efficient internal
7457 mechanism for comparing types in C++ and Objective-C++.  However, if
7458 bugs in the canonical type system are causing compilation failures,
7459 set this value to 0 to disable canonical types.
7460
7461 @item switch-conversion-max-branch-ratio
7462 Switch initialization conversion will refuse to create arrays that are
7463 bigger than @option{switch-conversion-max-branch-ratio} times the number of
7464 branches in the switch.
7465
7466 @item max-partial-antic-length
7467 Maximum length of the partial antic set computed during the tree
7468 partial redundancy elimination optimization (@option{-ftree-pre}) when
7469 optimizing at @option{-O3} and above.  For some sorts of source code
7470 the enhanced partial redundancy elimination optimization can run away,
7471 consuming all of the memory available on the host machine.  This
7472 parameter sets a limit on the length of the sets that are computed,
7473 which prevents the runaway behaviour.  Setting a value of 0 for
7474 this paramter will allow an unlimited set length.
7475
7476 @item sccvn-max-scc-size
7477 Maximum size of a strongly connected component (SCC) during SCCVN
7478 processing.  If this limit is hit, SCCVN processing for the whole
7479 function will not be done and optimizations depending on it will
7480 be disabled.  The default maximum SCC size is 10000.
7481
7482 @item ira-max-loops-num
7483 IRA uses a regional register allocation by default.  If a function
7484 contains loops more than number given by the parameter, non-regional
7485 register allocator will be used even when option
7486 @option{-fira-algorithm} is given.  The default value of the parameter
7487 is 20.
7488
7489 @end table
7490 @end table
7491
7492 @node Preprocessor Options
7493 @section Options Controlling the Preprocessor
7494 @cindex preprocessor options
7495 @cindex options, preprocessor
7496
7497 These options control the C preprocessor, which is run on each C source
7498 file before actual compilation.
7499
7500 If you use the @option{-E} option, nothing is done except preprocessing.
7501 Some of these options make sense only together with @option{-E} because
7502 they cause the preprocessor output to be unsuitable for actual
7503 compilation.
7504
7505 @table @gcctabopt
7506 @opindex Wp
7507 You can use @option{-Wp,@var{option}} to bypass the compiler driver
7508 and pass @var{option} directly through to the preprocessor.  If
7509 @var{option} contains commas, it is split into multiple options at the
7510 commas.  However, many options are modified, translated or interpreted
7511 by the compiler driver before being passed to the preprocessor, and
7512 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
7513 interface is undocumented and subject to change, so whenever possible
7514 you should avoid using @option{-Wp} and let the driver handle the
7515 options instead.
7516
7517 @item -Xpreprocessor @var{option}
7518 @opindex preprocessor
7519 Pass @var{option} as an option to the preprocessor.  You can use this to
7520 supply system-specific preprocessor options which GCC does not know how to
7521 recognize.
7522
7523 If you want to pass an option that takes an argument, you must use
7524 @option{-Xpreprocessor} twice, once for the option and once for the argument.
7525 @end table
7526
7527 @include cppopts.texi
7528
7529 @node Assembler Options
7530 @section Passing Options to the Assembler
7531
7532 @c prevent bad page break with this line
7533 You can pass options to the assembler.
7534
7535 @table @gcctabopt
7536 @item -Wa,@var{option}
7537 @opindex Wa
7538 Pass @var{option} as an option to the assembler.  If @var{option}
7539 contains commas, it is split into multiple options at the commas.
7540
7541 @item -Xassembler @var{option}
7542 @opindex Xassembler
7543 Pass @var{option} as an option to the assembler.  You can use this to
7544 supply system-specific assembler options which GCC does not know how to
7545 recognize.
7546
7547 If you want to pass an option that takes an argument, you must use
7548 @option{-Xassembler} twice, once for the option and once for the argument.
7549
7550 @end table
7551
7552 @node Link Options
7553 @section Options for Linking
7554 @cindex link options
7555 @cindex options, linking
7556
7557 These options come into play when the compiler links object files into
7558 an executable output file.  They are meaningless if the compiler is
7559 not doing a link step.
7560
7561 @table @gcctabopt
7562 @cindex file names
7563 @item @var{object-file-name}
7564 A file name that does not end in a special recognized suffix is
7565 considered to name an object file or library.  (Object files are
7566 distinguished from libraries by the linker according to the file
7567 contents.)  If linking is done, these object files are used as input
7568 to the linker.
7569
7570 @item -c
7571 @itemx -S
7572 @itemx -E
7573 @opindex c
7574 @opindex S
7575 @opindex E
7576 If any of these options is used, then the linker is not run, and
7577 object file names should not be used as arguments.  @xref{Overall
7578 Options}.
7579
7580 @cindex Libraries
7581 @item -l@var{library}
7582 @itemx -l @var{library}
7583 @opindex l
7584 Search the library named @var{library} when linking.  (The second
7585 alternative with the library as a separate argument is only for
7586 POSIX compliance and is not recommended.)
7587
7588 It makes a difference where in the command you write this option; the
7589 linker searches and processes libraries and object files in the order they
7590 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
7591 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
7592 to functions in @samp{z}, those functions may not be loaded.
7593
7594 The linker searches a standard list of directories for the library,
7595 which is actually a file named @file{lib@var{library}.a}.  The linker
7596 then uses this file as if it had been specified precisely by name.
7597
7598 The directories searched include several standard system directories
7599 plus any that you specify with @option{-L}.
7600
7601 Normally the files found this way are library files---archive files
7602 whose members are object files.  The linker handles an archive file by
7603 scanning through it for members which define symbols that have so far
7604 been referenced but not defined.  But if the file that is found is an
7605 ordinary object file, it is linked in the usual fashion.  The only
7606 difference between using an @option{-l} option and specifying a file name
7607 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
7608 and searches several directories.
7609
7610 @item -lobjc
7611 @opindex lobjc
7612 You need this special case of the @option{-l} option in order to
7613 link an Objective-C or Objective-C++ program.
7614
7615 @item -nostartfiles
7616 @opindex nostartfiles
7617 Do not use the standard system startup files when linking.
7618 The standard system libraries are used normally, unless @option{-nostdlib}
7619 or @option{-nodefaultlibs} is used.
7620
7621 @item -nodefaultlibs
7622 @opindex nodefaultlibs
7623 Do not use the standard system libraries when linking.
7624 Only the libraries you specify will be passed to the linker.
7625 The standard startup files are used normally, unless @option{-nostartfiles}
7626 is used.  The compiler may generate calls to @code{memcmp},
7627 @code{memset}, @code{memcpy} and @code{memmove}.
7628 These entries are usually resolved by entries in
7629 libc.  These entry points should be supplied through some other
7630 mechanism when this option is specified.
7631
7632 @item -nostdlib
7633 @opindex nostdlib
7634 Do not use the standard system startup files or libraries when linking.
7635 No startup files and only the libraries you specify will be passed to
7636 the linker.  The compiler may generate calls to @code{memcmp}, @code{memset},
7637 @code{memcpy} and @code{memmove}.
7638 These entries are usually resolved by entries in
7639 libc.  These entry points should be supplied through some other
7640 mechanism when this option is specified.
7641
7642 @cindex @option{-lgcc}, use with @option{-nostdlib}
7643 @cindex @option{-nostdlib} and unresolved references
7644 @cindex unresolved references and @option{-nostdlib}
7645 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
7646 @cindex @option{-nodefaultlibs} and unresolved references
7647 @cindex unresolved references and @option{-nodefaultlibs}
7648 One of the standard libraries bypassed by @option{-nostdlib} and
7649 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
7650 that GCC uses to overcome shortcomings of particular machines, or special
7651 needs for some languages.
7652 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
7653 Collection (GCC) Internals},
7654 for more discussion of @file{libgcc.a}.)
7655 In most cases, you need @file{libgcc.a} even when you want to avoid
7656 other standard libraries.  In other words, when you specify @option{-nostdlib}
7657 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
7658 This ensures that you have no unresolved references to internal GCC
7659 library subroutines.  (For example, @samp{__main}, used to ensure C++
7660 constructors will be called; @pxref{Collect2,,@code{collect2}, gccint,
7661 GNU Compiler Collection (GCC) Internals}.)
7662
7663 @item -pie
7664 @opindex pie
7665 Produce a position independent executable on targets which support it.
7666 For predictable results, you must also specify the same set of options
7667 that were used to generate code (@option{-fpie}, @option{-fPIE},
7668 or model suboptions) when you specify this option.
7669
7670 @item -rdynamic
7671 @opindex rdynamic
7672 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
7673 that support it. This instructs the linker to add all symbols, not
7674 only used ones, to the dynamic symbol table. This option is needed
7675 for some uses of @code{dlopen} or to allow obtaining backtraces
7676 from within a program.
7677
7678 @item -s
7679 @opindex s
7680 Remove all symbol table and relocation information from the executable.
7681
7682 @item -static
7683 @opindex static
7684 On systems that support dynamic linking, this prevents linking with the shared
7685 libraries.  On other systems, this option has no effect.
7686
7687 @item -shared
7688 @opindex shared
7689 Produce a shared object which can then be linked with other objects to
7690 form an executable.  Not all systems support this option.  For predictable
7691 results, you must also specify the same set of options that were used to
7692 generate code (@option{-fpic}, @option{-fPIC}, or model suboptions)
7693 when you specify this option.@footnote{On some systems, @samp{gcc -shared}
7694 needs to build supplementary stub code for constructors to work.  On
7695 multi-libbed systems, @samp{gcc -shared} must select the correct support
7696 libraries to link against.  Failing to supply the correct flags may lead
7697 to subtle defects.  Supplying them in cases where they are not necessary
7698 is innocuous.}
7699
7700 @item -shared-libgcc
7701 @itemx -static-libgcc
7702 @opindex shared-libgcc
7703 @opindex static-libgcc
7704 On systems that provide @file{libgcc} as a shared library, these options
7705 force the use of either the shared or static version respectively.
7706 If no shared version of @file{libgcc} was built when the compiler was
7707 configured, these options have no effect.
7708
7709 There are several situations in which an application should use the
7710 shared @file{libgcc} instead of the static version.  The most common
7711 of these is when the application wishes to throw and catch exceptions
7712 across different shared libraries.  In that case, each of the libraries
7713 as well as the application itself should use the shared @file{libgcc}.
7714
7715 Therefore, the G++ and GCJ drivers automatically add
7716 @option{-shared-libgcc} whenever you build a shared library or a main
7717 executable, because C++ and Java programs typically use exceptions, so
7718 this is the right thing to do.
7719
7720 If, instead, you use the GCC driver to create shared libraries, you may
7721 find that they will not always be linked with the shared @file{libgcc}.
7722 If GCC finds, at its configuration time, that you have a non-GNU linker
7723 or a GNU linker that does not support option @option{--eh-frame-hdr},
7724 it will link the shared version of @file{libgcc} into shared libraries
7725 by default.  Otherwise, it will take advantage of the linker and optimize
7726 away the linking with the shared version of @file{libgcc}, linking with
7727 the static version of libgcc by default.  This allows exceptions to
7728 propagate through such shared libraries, without incurring relocation
7729 costs at library load time.
7730
7731 However, if a library or main executable is supposed to throw or catch
7732 exceptions, you must link it using the G++ or GCJ driver, as appropriate
7733 for the languages used in the program, or using the option
7734 @option{-shared-libgcc}, such that it is linked with the shared
7735 @file{libgcc}.
7736
7737 @item -symbolic
7738 @opindex symbolic
7739 Bind references to global symbols when building a shared object.  Warn
7740 about any unresolved references (unless overridden by the link editor
7741 option @samp{-Xlinker -z -Xlinker defs}).  Only a few systems support
7742 this option.
7743
7744 @item -Xlinker @var{option}
7745 @opindex Xlinker
7746 Pass @var{option} as an option to the linker.  You can use this to
7747 supply system-specific linker options which GCC does not know how to
7748 recognize.
7749
7750 If you want to pass an option that takes an argument, you must use
7751 @option{-Xlinker} twice, once for the option and once for the argument.
7752 For example, to pass @option{-assert definitions}, you must write
7753 @samp{-Xlinker -assert -Xlinker definitions}.  It does not work to write
7754 @option{-Xlinker "-assert definitions"}, because this passes the entire
7755 string as a single argument, which is not what the linker expects.
7756
7757 @item -Wl,@var{option}
7758 @opindex Wl
7759 Pass @var{option} as an option to the linker.  If @var{option} contains
7760 commas, it is split into multiple options at the commas.
7761
7762 @item -u @var{symbol}
7763 @opindex u
7764 Pretend the symbol @var{symbol} is undefined, to force linking of
7765 library modules to define it.  You can use @option{-u} multiple times with
7766 different symbols to force loading of additional library modules.
7767 @end table
7768
7769 @node Directory Options
7770 @section Options for Directory Search
7771 @cindex directory options
7772 @cindex options, directory search
7773 @cindex search path
7774
7775 These options specify directories to search for header files, for
7776 libraries and for parts of the compiler:
7777
7778 @table @gcctabopt
7779 @item -I@var{dir}
7780 @opindex I
7781 Add the directory @var{dir} to the head of the list of directories to be
7782 searched for header files.  This can be used to override a system header
7783 file, substituting your own version, since these directories are
7784 searched before the system header file directories.  However, you should
7785 not use this option to add directories that contain vendor-supplied
7786 system header files (use @option{-isystem} for that).  If you use more than
7787 one @option{-I} option, the directories are scanned in left-to-right
7788 order; the standard system directories come after.
7789
7790 If a standard system include directory, or a directory specified with
7791 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
7792 option will be ignored.  The directory will still be searched but as a
7793 system directory at its normal position in the system include chain.
7794 This is to ensure that GCC's procedure to fix buggy system headers and
7795 the ordering for the include_next directive are not inadvertently changed.
7796 If you really need to change the search order for system directories,
7797 use the @option{-nostdinc} and/or @option{-isystem} options.
7798
7799 @item -iquote@var{dir}
7800 @opindex iquote
7801 Add the directory @var{dir} to the head of the list of directories to
7802 be searched for header files only for the case of @samp{#include
7803 "@var{file}"}; they are not searched for @samp{#include <@var{file}>},
7804 otherwise just like @option{-I}.
7805
7806 @item -L@var{dir}
7807 @opindex L
7808 Add directory @var{dir} to the list of directories to be searched
7809 for @option{-l}.
7810
7811 @item -B@var{prefix}
7812 @opindex B
7813 This option specifies where to find the executables, libraries,
7814 include files, and data files of the compiler itself.
7815
7816 The compiler driver program runs one or more of the subprograms
7817 @file{cpp}, @file{cc1}, @file{as} and @file{ld}.  It tries
7818 @var{prefix} as a prefix for each program it tries to run, both with and
7819 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
7820
7821 For each subprogram to be run, the compiler driver first tries the
7822 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
7823 was not specified, the driver tries two standard prefixes, which are
7824 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
7825 those results in a file name that is found, the unmodified program
7826 name is searched for using the directories specified in your
7827 @env{PATH} environment variable.
7828
7829 The compiler will check to see if the path provided by the @option{-B}
7830 refers to a directory, and if necessary it will add a directory
7831 separator character at the end of the path.
7832
7833 @option{-B} prefixes that effectively specify directory names also apply
7834 to libraries in the linker, because the compiler translates these
7835 options into @option{-L} options for the linker.  They also apply to
7836 includes files in the preprocessor, because the compiler translates these
7837 options into @option{-isystem} options for the preprocessor.  In this case,
7838 the compiler appends @samp{include} to the prefix.
7839
7840 The run-time support file @file{libgcc.a} can also be searched for using
7841 the @option{-B} prefix, if needed.  If it is not found there, the two
7842 standard prefixes above are tried, and that is all.  The file is left
7843 out of the link if it is not found by those means.
7844
7845 Another way to specify a prefix much like the @option{-B} prefix is to use
7846 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
7847 Variables}.
7848
7849 As a special kludge, if the path provided by @option{-B} is
7850 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
7851 9, then it will be replaced by @file{[dir/]include}.  This is to help
7852 with boot-strapping the compiler.
7853
7854 @item -specs=@var{file}
7855 @opindex specs
7856 Process @var{file} after the compiler reads in the standard @file{specs}
7857 file, in order to override the defaults that the @file{gcc} driver
7858 program uses when determining what switches to pass to @file{cc1},
7859 @file{cc1plus}, @file{as}, @file{ld}, etc.  More than one
7860 @option{-specs=@var{file}} can be specified on the command line, and they
7861 are processed in order, from left to right.
7862
7863 @item --sysroot=@var{dir}
7864 @opindex sysroot
7865 Use @var{dir} as the logical root directory for headers and libraries.
7866 For example, if the compiler would normally search for headers in
7867 @file{/usr/include} and libraries in @file{/usr/lib}, it will instead
7868 search @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
7869
7870 If you use both this option and the @option{-isysroot} option, then
7871 the @option{--sysroot} option will apply to libraries, but the
7872 @option{-isysroot} option will apply to header files.
7873
7874 The GNU linker (beginning with version 2.16) has the necessary support
7875 for this option.  If your linker does not support this option, the
7876 header file aspect of @option{--sysroot} will still work, but the
7877 library aspect will not.
7878
7879 @item -I-
7880 @opindex I-
7881 This option has been deprecated.  Please use @option{-iquote} instead for
7882 @option{-I} directories before the @option{-I-} and remove the @option{-I-}.
7883 Any directories you specify with @option{-I} options before the @option{-I-}
7884 option are searched only for the case of @samp{#include "@var{file}"};
7885 they are not searched for @samp{#include <@var{file}>}.
7886
7887 If additional directories are specified with @option{-I} options after
7888 the @option{-I-}, these directories are searched for all @samp{#include}
7889 directives.  (Ordinarily @emph{all} @option{-I} directories are used
7890 this way.)
7891
7892 In addition, the @option{-I-} option inhibits the use of the current
7893 directory (where the current input file came from) as the first search
7894 directory for @samp{#include "@var{file}"}.  There is no way to
7895 override this effect of @option{-I-}.  With @option{-I.} you can specify
7896 searching the directory which was current when the compiler was
7897 invoked.  That is not exactly the same as what the preprocessor does
7898 by default, but it is often satisfactory.
7899
7900 @option{-I-} does not inhibit the use of the standard system directories
7901 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
7902 independent.
7903 @end table
7904
7905 @c man end
7906
7907 @node Spec Files
7908 @section Specifying subprocesses and the switches to pass to them
7909 @cindex Spec Files
7910
7911 @command{gcc} is a driver program.  It performs its job by invoking a
7912 sequence of other programs to do the work of compiling, assembling and
7913 linking.  GCC interprets its command-line parameters and uses these to
7914 deduce which programs it should invoke, and which command-line options
7915 it ought to place on their command lines.  This behavior is controlled
7916 by @dfn{spec strings}.  In most cases there is one spec string for each
7917 program that GCC can invoke, but a few programs have multiple spec
7918 strings to control their behavior.  The spec strings built into GCC can
7919 be overridden by using the @option{-specs=} command-line switch to specify
7920 a spec file.
7921
7922 @dfn{Spec files} are plaintext files that are used to construct spec
7923 strings.  They consist of a sequence of directives separated by blank
7924 lines.  The type of directive is determined by the first non-whitespace
7925 character on the line and it can be one of the following:
7926
7927 @table @code
7928 @item %@var{command}
7929 Issues a @var{command} to the spec file processor.  The commands that can
7930 appear here are:
7931
7932 @table @code
7933 @item %include <@var{file}>
7934 @cindex %include
7935 Search for @var{file} and insert its text at the current point in the
7936 specs file.
7937
7938 @item %include_noerr <@var{file}>
7939 @cindex %include_noerr
7940 Just like @samp{%include}, but do not generate an error message if the include
7941 file cannot be found.
7942
7943 @item %rename @var{old_name} @var{new_name}
7944 @cindex %rename
7945 Rename the spec string @var{old_name} to @var{new_name}.
7946
7947 @end table
7948
7949 @item *[@var{spec_name}]:
7950 This tells the compiler to create, override or delete the named spec
7951 string.  All lines after this directive up to the next directive or
7952 blank line are considered to be the text for the spec string.  If this
7953 results in an empty string then the spec will be deleted.  (Or, if the
7954 spec did not exist, then nothing will happened.)  Otherwise, if the spec
7955 does not currently exist a new spec will be created.  If the spec does
7956 exist then its contents will be overridden by the text of this
7957 directive, unless the first character of that text is the @samp{+}
7958 character, in which case the text will be appended to the spec.
7959
7960 @item [@var{suffix}]:
7961 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
7962 and up to the next directive or blank line are considered to make up the
7963 spec string for the indicated suffix.  When the compiler encounters an
7964 input file with the named suffix, it will processes the spec string in
7965 order to work out how to compile that file.  For example:
7966
7967 @smallexample
7968 .ZZ:
7969 z-compile -input %i
7970 @end smallexample
7971
7972 This says that any input file whose name ends in @samp{.ZZ} should be
7973 passed to the program @samp{z-compile}, which should be invoked with the
7974 command-line switch @option{-input} and with the result of performing the
7975 @samp{%i} substitution.  (See below.)
7976
7977 As an alternative to providing a spec string, the text that follows a
7978 suffix directive can be one of the following:
7979
7980 @table @code
7981 @item @@@var{language}
7982 This says that the suffix is an alias for a known @var{language}.  This is
7983 similar to using the @option{-x} command-line switch to GCC to specify a
7984 language explicitly.  For example:
7985
7986 @smallexample
7987 .ZZ:
7988 @@c++
7989 @end smallexample
7990
7991 Says that .ZZ files are, in fact, C++ source files.
7992
7993 @item #@var{name}
7994 This causes an error messages saying:
7995
7996 @smallexample
7997 @var{name} compiler not installed on this system.
7998 @end smallexample
7999 @end table
8000
8001 GCC already has an extensive list of suffixes built into it.
8002 This directive will add an entry to the end of the list of suffixes, but
8003 since the list is searched from the end backwards, it is effectively
8004 possible to override earlier entries using this technique.
8005
8006 @end table
8007
8008 GCC has the following spec strings built into it.  Spec files can
8009 override these strings or create their own.  Note that individual
8010 targets can also add their own spec strings to this list.
8011
8012 @smallexample
8013 asm          Options to pass to the assembler
8014 asm_final    Options to pass to the assembler post-processor
8015 cpp          Options to pass to the C preprocessor
8016 cc1          Options to pass to the C compiler
8017 cc1plus      Options to pass to the C++ compiler
8018 endfile      Object files to include at the end of the link
8019 link         Options to pass to the linker
8020 lib          Libraries to include on the command line to the linker
8021 libgcc       Decides which GCC support library to pass to the linker
8022 linker       Sets the name of the linker
8023 predefines   Defines to be passed to the C preprocessor
8024 signed_char  Defines to pass to CPP to say whether @code{char} is signed
8025              by default
8026 startfile    Object files to include at the start of the link
8027 @end smallexample
8028
8029 Here is a small example of a spec file:
8030
8031 @smallexample
8032 %rename lib                 old_lib
8033
8034 *lib:
8035 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
8036 @end smallexample
8037
8038 This example renames the spec called @samp{lib} to @samp{old_lib} and
8039 then overrides the previous definition of @samp{lib} with a new one.
8040 The new definition adds in some extra command-line options before
8041 including the text of the old definition.
8042
8043 @dfn{Spec strings} are a list of command-line options to be passed to their
8044 corresponding program.  In addition, the spec strings can contain
8045 @samp{%}-prefixed sequences to substitute variable text or to
8046 conditionally insert text into the command line.  Using these constructs
8047 it is possible to generate quite complex command lines.
8048
8049 Here is a table of all defined @samp{%}-sequences for spec
8050 strings.  Note that spaces are not generated automatically around the
8051 results of expanding these sequences.  Therefore you can concatenate them
8052 together or combine them with constant text in a single argument.
8053
8054 @table @code
8055 @item %%
8056 Substitute one @samp{%} into the program name or argument.
8057
8058 @item %i
8059 Substitute the name of the input file being processed.
8060
8061 @item %b
8062 Substitute the basename of the input file being processed.
8063 This is the substring up to (and not including) the last period
8064 and not including the directory.
8065
8066 @item %B
8067 This is the same as @samp{%b}, but include the file suffix (text after
8068 the last period).
8069
8070 @item %d
8071 Marks the argument containing or following the @samp{%d} as a
8072 temporary file name, so that that file will be deleted if GCC exits
8073 successfully.  Unlike @samp{%g}, this contributes no text to the
8074 argument.
8075
8076 @item %g@var{suffix}
8077 Substitute a file name that has suffix @var{suffix} and is chosen
8078 once per compilation, and mark the argument in the same way as
8079 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
8080 name is now chosen in a way that is hard to predict even when previously
8081 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
8082 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
8083 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
8084 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
8085 was simply substituted with a file name chosen once per compilation,
8086 without regard to any appended suffix (which was therefore treated
8087 just like ordinary text), making such attacks more likely to succeed.
8088
8089 @item %u@var{suffix}
8090 Like @samp{%g}, but generates a new temporary file name even if
8091 @samp{%u@var{suffix}} was already seen.
8092
8093 @item %U@var{suffix}
8094 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
8095 new one if there is no such last file name.  In the absence of any
8096 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
8097 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
8098 would involve the generation of two distinct file names, one
8099 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
8100 simply substituted with a file name chosen for the previous @samp{%u},
8101 without regard to any appended suffix.
8102
8103 @item %j@var{suffix}
8104 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
8105 writable, and if save-temps is off; otherwise, substitute the name
8106 of a temporary file, just like @samp{%u}.  This temporary file is not
8107 meant for communication between processes, but rather as a junk
8108 disposal mechanism.
8109
8110 @item %|@var{suffix}
8111 @itemx %m@var{suffix}
8112 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
8113 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
8114 all.  These are the two most common ways to instruct a program that it
8115 should read from standard input or write to standard output.  If you
8116 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
8117 construct: see for example @file{f/lang-specs.h}.
8118
8119 @item %.@var{SUFFIX}
8120 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
8121 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
8122 terminated by the next space or %.
8123
8124 @item %w
8125 Marks the argument containing or following the @samp{%w} as the
8126 designated output file of this compilation.  This puts the argument
8127 into the sequence of arguments that @samp{%o} will substitute later.
8128
8129 @item %o
8130 Substitutes the names of all the output files, with spaces
8131 automatically placed around them.  You should write spaces
8132 around the @samp{%o} as well or the results are undefined.
8133 @samp{%o} is for use in the specs for running the linker.
8134 Input files whose names have no recognized suffix are not compiled
8135 at all, but they are included among the output files, so they will
8136 be linked.
8137
8138 @item %O
8139 Substitutes the suffix for object files.  Note that this is
8140 handled specially when it immediately follows @samp{%g, %u, or %U},
8141 because of the need for those to form complete file names.  The
8142 handling is such that @samp{%O} is treated exactly as if it had already
8143 been substituted, except that @samp{%g, %u, and %U} do not currently
8144 support additional @var{suffix} characters following @samp{%O} as they would
8145 following, for example, @samp{.o}.
8146
8147 @item %p
8148 Substitutes the standard macro predefinitions for the
8149 current target machine.  Use this when running @code{cpp}.
8150
8151 @item %P
8152 Like @samp{%p}, but puts @samp{__} before and after the name of each
8153 predefined macro, except for macros that start with @samp{__} or with
8154 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
8155 C@.
8156
8157 @item %I
8158 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
8159 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
8160 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
8161 and @option{-imultilib} as necessary.
8162
8163 @item %s
8164 Current argument is the name of a library or startup file of some sort.
8165 Search for that file in a standard list of directories and substitute
8166 the full name found.
8167
8168 @item %e@var{str}
8169 Print @var{str} as an error message.  @var{str} is terminated by a newline.
8170 Use this when inconsistent options are detected.
8171
8172 @item %(@var{name})
8173 Substitute the contents of spec string @var{name} at this point.
8174
8175 @item %[@var{name}]
8176 Like @samp{%(@dots{})} but put @samp{__} around @option{-D} arguments.
8177
8178 @item %x@{@var{option}@}
8179 Accumulate an option for @samp{%X}.
8180
8181 @item %X
8182 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
8183 spec string.
8184
8185 @item %Y
8186 Output the accumulated assembler options specified by @option{-Wa}.
8187
8188 @item %Z
8189 Output the accumulated preprocessor options specified by @option{-Wp}.
8190
8191 @item %a
8192 Process the @code{asm} spec.  This is used to compute the
8193 switches to be passed to the assembler.
8194
8195 @item %A
8196 Process the @code{asm_final} spec.  This is a spec string for
8197 passing switches to an assembler post-processor, if such a program is
8198 needed.
8199
8200 @item %l
8201 Process the @code{link} spec.  This is the spec for computing the
8202 command line passed to the linker.  Typically it will make use of the
8203 @samp{%L %G %S %D and %E} sequences.
8204
8205 @item %D
8206 Dump out a @option{-L} option for each directory that GCC believes might
8207 contain startup files.  If the target supports multilibs then the
8208 current multilib directory will be prepended to each of these paths.
8209
8210 @item %L
8211 Process the @code{lib} spec.  This is a spec string for deciding which
8212 libraries should be included on the command line to the linker.
8213
8214 @item %G
8215 Process the @code{libgcc} spec.  This is a spec string for deciding
8216 which GCC support library should be included on the command line to the linker.
8217
8218 @item %S
8219 Process the @code{startfile} spec.  This is a spec for deciding which
8220 object files should be the first ones passed to the linker.  Typically
8221 this might be a file named @file{crt0.o}.
8222
8223 @item %E
8224 Process the @code{endfile} spec.  This is a spec string that specifies
8225 the last object files that will be passed to the linker.
8226
8227 @item %C
8228 Process the @code{cpp} spec.  This is used to construct the arguments
8229 to be passed to the C preprocessor.
8230
8231 @item %1
8232 Process the @code{cc1} spec.  This is used to construct the options to be
8233 passed to the actual C compiler (@samp{cc1}).
8234
8235 @item %2
8236 Process the @code{cc1plus} spec.  This is used to construct the options to be
8237 passed to the actual C++ compiler (@samp{cc1plus}).
8238
8239 @item %*
8240 Substitute the variable part of a matched option.  See below.
8241 Note that each comma in the substituted string is replaced by
8242 a single space.
8243
8244 @item %<@code{S}
8245 Remove all occurrences of @code{-S} from the command line.  Note---this
8246 command is position dependent.  @samp{%} commands in the spec string
8247 before this one will see @code{-S}, @samp{%} commands in the spec string
8248 after this one will not.
8249
8250 @item %:@var{function}(@var{args})
8251 Call the named function @var{function}, passing it @var{args}.
8252 @var{args} is first processed as a nested spec string, then split
8253 into an argument vector in the usual fashion.  The function returns
8254 a string which is processed as if it had appeared literally as part
8255 of the current spec.
8256
8257 The following built-in spec functions are provided:
8258
8259 @table @code
8260 @item @code{getenv}
8261 The @code{getenv} spec function takes two arguments: an environment
8262 variable name and a string.  If the environment variable is not
8263 defined, a fatal error is issued.  Otherwise, the return value is the
8264 value of the environment variable concatenated with the string.  For
8265 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
8266
8267 @smallexample
8268 %:getenv(TOPDIR /include)
8269 @end smallexample
8270
8271 expands to @file{/path/to/top/include}.
8272
8273 @item @code{if-exists}
8274 The @code{if-exists} spec function takes one argument, an absolute
8275 pathname to a file.  If the file exists, @code{if-exists} returns the
8276 pathname.  Here is a small example of its usage:
8277
8278 @smallexample
8279 *startfile:
8280 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
8281 @end smallexample
8282
8283 @item @code{if-exists-else}
8284 The @code{if-exists-else} spec function is similar to the @code{if-exists}
8285 spec function, except that it takes two arguments.  The first argument is
8286 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
8287 returns the pathname.  If it does not exist, it returns the second argument.
8288 This way, @code{if-exists-else} can be used to select one file or another,
8289 based on the existence of the first.  Here is a small example of its usage:
8290
8291 @smallexample
8292 *startfile:
8293 crt0%O%s %:if-exists(crti%O%s) \
8294 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
8295 @end smallexample
8296
8297 @item @code{replace-outfile}
8298 The @code{replace-outfile} spec function takes two arguments.  It looks for the
8299 first argument in the outfiles array and replaces it with the second argument.  Here
8300 is a small example of its usage:
8301
8302 @smallexample
8303 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
8304 @end smallexample
8305
8306 @item @code{print-asm-header}
8307 The @code{print-asm-header} function takes no arguments and simply
8308 prints a banner like:
8309
8310 @smallexample
8311 Assembler options
8312 =================
8313
8314 Use "-Wa,OPTION" to pass "OPTION" to the assembler.
8315 @end smallexample
8316
8317 It is used to separate compiler options from assembler options
8318 in the @option{--target-help} output.
8319 @end table
8320
8321 @item %@{@code{S}@}
8322 Substitutes the @code{-S} switch, if that switch was given to GCC@.
8323 If that switch was not specified, this substitutes nothing.  Note that
8324 the leading dash is omitted when specifying this option, and it is
8325 automatically inserted if the substitution is performed.  Thus the spec
8326 string @samp{%@{foo@}} would match the command-line option @option{-foo}
8327 and would output the command line option @option{-foo}.
8328
8329 @item %W@{@code{S}@}
8330 Like %@{@code{S}@} but mark last argument supplied within as a file to be
8331 deleted on failure.
8332
8333 @item %@{@code{S}*@}
8334 Substitutes all the switches specified to GCC whose names start
8335 with @code{-S}, but which also take an argument.  This is used for
8336 switches like @option{-o}, @option{-D}, @option{-I}, etc.
8337 GCC considers @option{-o foo} as being
8338 one switch whose names starts with @samp{o}.  %@{o*@} would substitute this
8339 text, including the space.  Thus two arguments would be generated.
8340
8341 @item %@{@code{S}*&@code{T}*@}
8342 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
8343 (the order of @code{S} and @code{T} in the spec is not significant).
8344 There can be any number of ampersand-separated variables; for each the
8345 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
8346
8347 @item %@{@code{S}:@code{X}@}
8348 Substitutes @code{X}, if the @samp{-S} switch was given to GCC@.
8349
8350 @item %@{!@code{S}:@code{X}@}
8351 Substitutes @code{X}, if the @samp{-S} switch was @emph{not} given to GCC@.
8352
8353 @item %@{@code{S}*:@code{X}@}
8354 Substitutes @code{X} if one or more switches whose names start with
8355 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
8356 once, no matter how many such switches appeared.  However, if @code{%*}
8357 appears somewhere in @code{X}, then @code{X} will be substituted once
8358 for each matching switch, with the @code{%*} replaced by the part of
8359 that switch that matched the @code{*}.
8360
8361 @item %@{.@code{S}:@code{X}@}
8362 Substitutes @code{X}, if processing a file with suffix @code{S}.
8363
8364 @item %@{!.@code{S}:@code{X}@}
8365 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
8366
8367 @item %@{,@code{S}:@code{X}@}
8368 Substitutes @code{X}, if processing a file for language @code{S}.
8369
8370 @item %@{!,@code{S}:@code{X}@}
8371 Substitutes @code{X}, if not processing a file for language @code{S}.
8372
8373 @item %@{@code{S}|@code{P}:@code{X}@}
8374 Substitutes @code{X} if either @code{-S} or @code{-P} was given to
8375 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
8376 @code{*} sequences as well, although they have a stronger binding than
8377 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
8378 alternatives must be starred, and only the first matching alternative
8379 is substituted.
8380
8381 For example, a spec string like this:
8382
8383 @smallexample
8384 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
8385 @end smallexample
8386
8387 will output the following command-line options from the following input
8388 command-line options:
8389
8390 @smallexample
8391 fred.c        -foo -baz
8392 jim.d         -bar -boggle
8393 -d fred.c     -foo -baz -boggle
8394 -d jim.d      -bar -baz -boggle
8395 @end smallexample
8396
8397 @item %@{S:X; T:Y; :D@}
8398
8399 If @code{S} was given to GCC, substitutes @code{X}; else if @code{T} was
8400 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
8401 be as many clauses as you need.  This may be combined with @code{.},
8402 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
8403
8404
8405 @end table
8406
8407 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
8408 construct may contain other nested @samp{%} constructs or spaces, or
8409 even newlines.  They are processed as usual, as described above.
8410 Trailing white space in @code{X} is ignored.  White space may also
8411 appear anywhere on the left side of the colon in these constructs,
8412 except between @code{.} or @code{*} and the corresponding word.
8413
8414 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
8415 handled specifically in these constructs.  If another value of
8416 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
8417 @option{-W} switch is found later in the command line, the earlier
8418 switch value is ignored, except with @{@code{S}*@} where @code{S} is
8419 just one letter, which passes all matching options.
8420
8421 The character @samp{|} at the beginning of the predicate text is used to
8422 indicate that a command should be piped to the following command, but
8423 only if @option{-pipe} is specified.
8424
8425 It is built into GCC which switches take arguments and which do not.
8426 (You might think it would be useful to generalize this to allow each
8427 compiler's spec to say which switches take arguments.  But this cannot
8428 be done in a consistent fashion.  GCC cannot even decide which input
8429 files have been specified without knowing which switches take arguments,
8430 and it must know which input files to compile in order to tell which
8431 compilers to run).
8432
8433 GCC also knows implicitly that arguments starting in @option{-l} are to be
8434 treated as compiler output files, and passed to the linker in their
8435 proper position among the other output files.
8436
8437 @c man begin OPTIONS
8438
8439 @node Target Options
8440 @section Specifying Target Machine and Compiler Version
8441 @cindex target options
8442 @cindex cross compiling
8443 @cindex specifying machine version
8444 @cindex specifying compiler version and target machine
8445 @cindex compiler version, specifying
8446 @cindex target machine, specifying
8447
8448 The usual way to run GCC is to run the executable called @file{gcc}, or
8449 @file{<machine>-gcc} when cross-compiling, or
8450 @file{<machine>-gcc-<version>} to run a version other than the one that
8451 was installed last.  Sometimes this is inconvenient, so GCC provides
8452 options that will switch to another cross-compiler or version.
8453
8454 @table @gcctabopt
8455 @item -b @var{machine}
8456 @opindex b
8457 The argument @var{machine} specifies the target machine for compilation.
8458
8459 The value to use for @var{machine} is the same as was specified as the
8460 machine type when configuring GCC as a cross-compiler.  For
8461 example, if a cross-compiler was configured with @samp{configure
8462 arm-elf}, meaning to compile for an arm processor with elf binaries,
8463 then you would specify @option{-b arm-elf} to run that cross compiler.
8464 Because there are other options beginning with @option{-b}, the
8465 configuration must contain a hyphen.
8466
8467 @item -V @var{version}
8468 @opindex V
8469 The argument @var{version} specifies which version of GCC to run.
8470 This is useful when multiple versions are installed.  For example,
8471 @var{version} might be @samp{4.0}, meaning to run GCC version 4.0.
8472 @end table
8473
8474 The @option{-V} and @option{-b} options work by running the
8475 @file{<machine>-gcc-<version>} executable, so there's no real reason to
8476 use them if you can just run that directly.
8477
8478 @node Submodel Options
8479 @section Hardware Models and Configurations
8480 @cindex submodel options
8481 @cindex specifying hardware config
8482 @cindex hardware models and configurations, specifying
8483 @cindex machine dependent options
8484
8485 Earlier we discussed the standard option @option{-b} which chooses among
8486 different installed compilers for completely different target
8487 machines, such as VAX vs.@: 68000 vs.@: 80386.
8488
8489 In addition, each of these target machine types can have its own
8490 special options, starting with @samp{-m}, to choose among various
8491 hardware models or configurations---for example, 68010 vs 68020,
8492 floating coprocessor or none.  A single installed version of the
8493 compiler can compile for any model or configuration, according to the
8494 options specified.
8495
8496 Some configurations of the compiler also support additional special
8497 options, usually for compatibility with other compilers on the same
8498 platform.
8499
8500 @c This list is ordered alphanumerically by subsection name.
8501 @c It should be the same order and spelling as these options are listed
8502 @c in Machine Dependent Options
8503
8504 @menu
8505 * ARC Options::
8506 * ARM Options::
8507 * AVR Options::
8508 * Blackfin Options::
8509 * CRIS Options::
8510 * CRX Options::
8511 * Darwin Options::
8512 * DEC Alpha Options::
8513 * DEC Alpha/VMS Options::
8514 * FRV Options::
8515 * GNU/Linux Options::
8516 * H8/300 Options::
8517 * HPPA Options::
8518 * i386 and x86-64 Options::
8519 * IA-64 Options::
8520 * M32C Options::
8521 * M32R/D Options::
8522 * M680x0 Options::
8523 * M68hc1x Options::
8524 * MCore Options::
8525 * MIPS Options::
8526 * MMIX Options::
8527 * MN10300 Options::
8528 * PDP-11 Options::
8529 * PowerPC Options::
8530 * RS/6000 and PowerPC Options::
8531 * S/390 and zSeries Options::
8532 * Score Options::
8533 * SH Options::
8534 * SPARC Options::
8535 * SPU Options::
8536 * System V Options::
8537 * V850 Options::
8538 * VAX Options::
8539 * VxWorks Options::
8540 * x86-64 Options::
8541 * Xstormy16 Options::
8542 * Xtensa Options::
8543 * zSeries Options::
8544 @end menu
8545
8546 @node ARC Options
8547 @subsection ARC Options
8548 @cindex ARC Options
8549
8550 These options are defined for ARC implementations:
8551
8552 @table @gcctabopt
8553 @item -EL
8554 @opindex EL
8555 Compile code for little endian mode.  This is the default.
8556
8557 @item -EB
8558 @opindex EB
8559 Compile code for big endian mode.
8560
8561 @item -mmangle-cpu
8562 @opindex mmangle-cpu
8563 Prepend the name of the cpu to all public symbol names.
8564 In multiple-processor systems, there are many ARC variants with different
8565 instruction and register set characteristics.  This flag prevents code
8566 compiled for one cpu to be linked with code compiled for another.
8567 No facility exists for handling variants that are ``almost identical''.
8568 This is an all or nothing option.
8569
8570 @item -mcpu=@var{cpu}
8571 @opindex mcpu
8572 Compile code for ARC variant @var{cpu}.
8573 Which variants are supported depend on the configuration.
8574 All variants support @option{-mcpu=base}, this is the default.
8575
8576 @item -mtext=@var{text-section}
8577 @itemx -mdata=@var{data-section}
8578 @itemx -mrodata=@var{readonly-data-section}
8579 @opindex mtext
8580 @opindex mdata
8581 @opindex mrodata
8582 Put functions, data, and readonly data in @var{text-section},
8583 @var{data-section}, and @var{readonly-data-section} respectively
8584 by default.  This can be overridden with the @code{section} attribute.
8585 @xref{Variable Attributes}.
8586
8587 @end table
8588
8589 @node ARM Options
8590 @subsection ARM Options
8591 @cindex ARM options
8592
8593 These @samp{-m} options are defined for Advanced RISC Machines (ARM)
8594 architectures:
8595
8596 @table @gcctabopt
8597 @item -mabi=@var{name}
8598 @opindex mabi
8599 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
8600 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
8601
8602 @item -mapcs-frame
8603 @opindex mapcs-frame
8604 Generate a stack frame that is compliant with the ARM Procedure Call
8605 Standard for all functions, even if this is not strictly necessary for
8606 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
8607 with this option will cause the stack frames not to be generated for
8608 leaf functions.  The default is @option{-mno-apcs-frame}.
8609
8610 @item -mapcs
8611 @opindex mapcs
8612 This is a synonym for @option{-mapcs-frame}.
8613
8614 @ignore
8615 @c not currently implemented
8616 @item -mapcs-stack-check
8617 @opindex mapcs-stack-check
8618 Generate code to check the amount of stack space available upon entry to
8619 every function (that actually uses some stack space).  If there is
8620 insufficient space available then either the function
8621 @samp{__rt_stkovf_split_small} or @samp{__rt_stkovf_split_big} will be
8622 called, depending upon the amount of stack space required.  The run time
8623 system is required to provide these functions.  The default is
8624 @option{-mno-apcs-stack-check}, since this produces smaller code.
8625
8626 @c not currently implemented
8627 @item -mapcs-float
8628 @opindex mapcs-float
8629 Pass floating point arguments using the float point registers.  This is
8630 one of the variants of the APCS@.  This option is recommended if the
8631 target hardware has a floating point unit or if a lot of floating point
8632 arithmetic is going to be performed by the code.  The default is
8633 @option{-mno-apcs-float}, since integer only code is slightly increased in
8634 size if @option{-mapcs-float} is used.
8635
8636 @c not currently implemented
8637 @item -mapcs-reentrant
8638 @opindex mapcs-reentrant
8639 Generate reentrant, position independent code.  The default is
8640 @option{-mno-apcs-reentrant}.
8641 @end ignore
8642
8643 @item -mthumb-interwork
8644 @opindex mthumb-interwork
8645 Generate code which supports calling between the ARM and Thumb
8646 instruction sets.  Without this option the two instruction sets cannot
8647 be reliably used inside one program.  The default is
8648 @option{-mno-thumb-interwork}, since slightly larger code is generated
8649 when @option{-mthumb-interwork} is specified.
8650
8651 @item -mno-sched-prolog
8652 @opindex mno-sched-prolog
8653 Prevent the reordering of instructions in the function prolog, or the
8654 merging of those instruction with the instructions in the function's
8655 body.  This means that all functions will start with a recognizable set
8656 of instructions (or in fact one of a choice from a small set of
8657 different function prologues), and this information can be used to
8658 locate the start if functions inside an executable piece of code.  The
8659 default is @option{-msched-prolog}.
8660
8661 @item -mhard-float
8662 @opindex mhard-float
8663 Generate output containing floating point instructions.  This is the
8664 default.
8665
8666 @item -msoft-float
8667 @opindex msoft-float
8668 Generate output containing library calls for floating point.
8669 @strong{Warning:} the requisite libraries are not available for all ARM
8670 targets.  Normally the facilities of the machine's usual C compiler are
8671 used, but this cannot be done directly in cross-compilation.  You must make
8672 your own arrangements to provide suitable library functions for
8673 cross-compilation.
8674
8675 @option{-msoft-float} changes the calling convention in the output file;
8676 therefore, it is only useful if you compile @emph{all} of a program with
8677 this option.  In particular, you need to compile @file{libgcc.a}, the
8678 library that comes with GCC, with @option{-msoft-float} in order for
8679 this to work.
8680
8681 @item -mfloat-abi=@var{name}
8682 @opindex mfloat-abi
8683 Specifies which ABI to use for floating point values.  Permissible values
8684 are: @samp{soft}, @samp{softfp} and @samp{hard}.
8685
8686 @samp{soft} and @samp{hard} are equivalent to @option{-msoft-float}
8687 and @option{-mhard-float} respectively.  @samp{softfp} allows the generation
8688 of floating point instructions, but still uses the soft-float calling
8689 conventions.
8690
8691 @item -mlittle-endian
8692 @opindex mlittle-endian
8693 Generate code for a processor running in little-endian mode.  This is
8694 the default for all standard configurations.
8695
8696 @item -mbig-endian
8697 @opindex mbig-endian
8698 Generate code for a processor running in big-endian mode; the default is
8699 to compile code for a little-endian processor.
8700
8701 @item -mwords-little-endian
8702 @opindex mwords-little-endian
8703 This option only applies when generating code for big-endian processors.
8704 Generate code for a little-endian word order but a big-endian byte
8705 order.  That is, a byte order of the form @samp{32107654}.  Note: this
8706 option should only be used if you require compatibility with code for
8707 big-endian ARM processors generated by versions of the compiler prior to
8708 2.8.
8709
8710 @item -mcpu=@var{name}
8711 @opindex mcpu
8712 This specifies the name of the target ARM processor.  GCC uses this name
8713 to determine what kind of instructions it can emit when generating
8714 assembly code.  Permissible names are: @samp{arm2}, @samp{arm250},
8715 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
8716 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
8717 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
8718 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
8719 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
8720 @samp{arm8}, @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
8721 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
8722 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
8723 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
8724 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
8725 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
8726 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
8727 @samp{arm1156t2-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
8728 @samp{cortex-a8}, @samp{cortex-r4}, @samp{cortex-r4f}, @samp{cortex-m3},
8729 @samp{cortex-m1},
8730 @samp{xscale}, @samp{iwmmxt}, @samp{ep9312}.
8731
8732 @item -mtune=@var{name}
8733 @opindex mtune
8734 This option is very similar to the @option{-mcpu=} option, except that
8735 instead of specifying the actual target processor type, and hence
8736 restricting which instructions can be used, it specifies that GCC should
8737 tune the performance of the code as if the target were of the type
8738 specified in this option, but still choosing the instructions that it
8739 will generate based on the cpu specified by a @option{-mcpu=} option.
8740 For some ARM implementations better performance can be obtained by using
8741 this option.
8742
8743 @item -march=@var{name}
8744 @opindex march
8745 This specifies the name of the target ARM architecture.  GCC uses this
8746 name to determine what kind of instructions it can emit when generating
8747 assembly code.  This option can be used in conjunction with or instead
8748 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
8749 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
8750 @samp{armv5}, @samp{armv5t}, @samp{armv5te}, @samp{armv6}, @samp{armv6j},
8751 @samp{armv6t2}, @samp{armv6z}, @samp{armv6zk}, @samp{armv6-m},
8752 @samp{armv7}, @samp{armv7-a}, @samp{armv7-r}, @samp{armv7-m},
8753 @samp{iwmmxt}, @samp{ep9312}.
8754
8755 @item -mfpu=@var{name}
8756 @itemx -mfpe=@var{number}
8757 @itemx -mfp=@var{number}
8758 @opindex mfpu
8759 @opindex mfpe
8760 @opindex mfp
8761 This specifies what floating point hardware (or hardware emulation) is
8762 available on the target.  Permissible names are: @samp{fpa}, @samp{fpe2},
8763 @samp{fpe3}, @samp{maverick}, @samp{vfp}, @samp{vfpv3}, @samp{vfpv3-d16} and
8764 @samp{neon}.  @option{-mfp} and @option{-mfpe}
8765 are synonyms for @option{-mfpu}=@samp{fpe}@var{number}, for compatibility
8766 with older versions of GCC@.
8767
8768 If @option{-msoft-float} is specified this specifies the format of
8769 floating point values.
8770
8771 @item -mstructure-size-boundary=@var{n}
8772 @opindex mstructure-size-boundary
8773 The size of all structures and unions will be rounded up to a multiple
8774 of the number of bits set by this option.  Permissible values are 8, 32
8775 and 64.  The default value varies for different toolchains.  For the COFF
8776 targeted toolchain the default value is 8.  A value of 64 is only allowed
8777 if the underlying ABI supports it.
8778
8779 Specifying the larger number can produce faster, more efficient code, but
8780 can also increase the size of the program.  Different values are potentially
8781 incompatible.  Code compiled with one value cannot necessarily expect to
8782 work with code or libraries compiled with another value, if they exchange
8783 information using structures or unions.
8784
8785 @item -mabort-on-noreturn
8786 @opindex mabort-on-noreturn
8787 Generate a call to the function @code{abort} at the end of a
8788 @code{noreturn} function.  It will be executed if the function tries to
8789 return.
8790
8791 @item -mlong-calls
8792 @itemx -mno-long-calls
8793 @opindex mlong-calls
8794 @opindex mno-long-calls
8795 Tells the compiler to perform function calls by first loading the
8796 address of the function into a register and then performing a subroutine
8797 call on this register.  This switch is needed if the target function
8798 will lie outside of the 64 megabyte addressing range of the offset based
8799 version of subroutine call instruction.
8800
8801 Even if this switch is enabled, not all function calls will be turned
8802 into long calls.  The heuristic is that static functions, functions
8803 which have the @samp{short-call} attribute, functions that are inside
8804 the scope of a @samp{#pragma no_long_calls} directive and functions whose
8805 definitions have already been compiled within the current compilation
8806 unit, will not be turned into long calls.  The exception to this rule is
8807 that weak function definitions, functions with the @samp{long-call}
8808 attribute or the @samp{section} attribute, and functions that are within
8809 the scope of a @samp{#pragma long_calls} directive, will always be
8810 turned into long calls.
8811
8812 This feature is not enabled by default.  Specifying
8813 @option{-mno-long-calls} will restore the default behavior, as will
8814 placing the function calls within the scope of a @samp{#pragma
8815 long_calls_off} directive.  Note these switches have no effect on how
8816 the compiler generates code to handle function calls via function
8817 pointers.
8818
8819 @item -mnop-fun-dllimport
8820 @opindex mnop-fun-dllimport
8821 Disable support for the @code{dllimport} attribute.
8822
8823 @item -msingle-pic-base
8824 @opindex msingle-pic-base
8825 Treat the register used for PIC addressing as read-only, rather than
8826 loading it in the prologue for each function.  The run-time system is
8827 responsible for initializing this register with an appropriate value
8828 before execution begins.
8829
8830 @item -mpic-register=@var{reg}
8831 @opindex mpic-register
8832 Specify the register to be used for PIC addressing.  The default is R10
8833 unless stack-checking is enabled, when R9 is used.
8834
8835 @item -mcirrus-fix-invalid-insns
8836 @opindex mcirrus-fix-invalid-insns
8837 @opindex mno-cirrus-fix-invalid-insns
8838 Insert NOPs into the instruction stream to in order to work around
8839 problems with invalid Maverick instruction combinations.  This option
8840 is only valid if the @option{-mcpu=ep9312} option has been used to
8841 enable generation of instructions for the Cirrus Maverick floating
8842 point co-processor.  This option is not enabled by default, since the
8843 problem is only present in older Maverick implementations.  The default
8844 can be re-enabled by use of the @option{-mno-cirrus-fix-invalid-insns}
8845 switch.
8846
8847 @item -mpoke-function-name
8848 @opindex mpoke-function-name
8849 Write the name of each function into the text section, directly
8850 preceding the function prologue.  The generated code is similar to this:
8851
8852 @smallexample
8853      t0
8854          .ascii "arm_poke_function_name", 0
8855          .align
8856      t1
8857          .word 0xff000000 + (t1 - t0)
8858      arm_poke_function_name
8859          mov     ip, sp
8860          stmfd   sp!, @{fp, ip, lr, pc@}
8861          sub     fp, ip, #4
8862 @end smallexample
8863
8864 When performing a stack backtrace, code can inspect the value of
8865 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
8866 location @code{pc - 12} and the top 8 bits are set, then we know that
8867 there is a function name embedded immediately preceding this location
8868 and has length @code{((pc[-3]) & 0xff000000)}.
8869
8870 @item -mthumb
8871 @opindex mthumb
8872 Generate code for the Thumb instruction set.  The default is to
8873 use the 32-bit ARM instruction set.
8874 This option automatically enables either 16-bit Thumb-1 or
8875 mixed 16/32-bit Thumb-2 instructions based on the @option{-mcpu=@var{name}}
8876 and @option{-march=@var{name}} options.
8877
8878 @item -mtpcs-frame
8879 @opindex mtpcs-frame
8880 Generate a stack frame that is compliant with the Thumb Procedure Call
8881 Standard for all non-leaf functions.  (A leaf function is one that does
8882 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
8883
8884 @item -mtpcs-leaf-frame
8885 @opindex mtpcs-leaf-frame
8886 Generate a stack frame that is compliant with the Thumb Procedure Call
8887 Standard for all leaf functions.  (A leaf function is one that does
8888 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
8889
8890 @item -mcallee-super-interworking
8891 @opindex mcallee-super-interworking
8892 Gives all externally visible functions in the file being compiled an ARM
8893 instruction set header which switches to Thumb mode before executing the
8894 rest of the function.  This allows these functions to be called from
8895 non-interworking code.
8896
8897 @item -mcaller-super-interworking
8898 @opindex mcaller-super-interworking
8899 Allows calls via function pointers (including virtual functions) to
8900 execute correctly regardless of whether the target code has been
8901 compiled for interworking or not.  There is a small overhead in the cost
8902 of executing a function pointer if this option is enabled.
8903
8904 @item -mtp=@var{name}
8905 @opindex mtp
8906 Specify the access model for the thread local storage pointer.  The valid
8907 models are @option{soft}, which generates calls to @code{__aeabi_read_tp},
8908 @option{cp15}, which fetches the thread pointer from @code{cp15} directly
8909 (supported in the arm6k architecture), and @option{auto}, which uses the
8910 best available method for the selected processor.  The default setting is
8911 @option{auto}.
8912
8913 @end table
8914
8915 @node AVR Options
8916 @subsection AVR Options
8917 @cindex AVR Options
8918
8919 These options are defined for AVR implementations:
8920
8921 @table @gcctabopt
8922 @item -mmcu=@var{mcu}
8923 @opindex mmcu
8924 Specify ATMEL AVR instruction set or MCU type.
8925
8926 Instruction set avr1 is for the minimal AVR core, not supported by the C
8927 compiler, only for assembler programs (MCU types: at90s1200, attiny10,
8928 attiny11, attiny12, attiny15, attiny28).
8929
8930 Instruction set avr2 (default) is for the classic AVR core with up to
8931 8K program memory space (MCU types: at90s2313, at90s2323, attiny22,
8932 at90s2333, at90s2343, at90s4414, at90s4433, at90s4434, at90s8515,
8933 at90c8534, at90s8535).
8934
8935 Instruction set avr3 is for the classic AVR core with up to 128K program
8936 memory space (MCU types: atmega103, atmega603, at43usb320, at76c711).
8937
8938 Instruction set avr4 is for the enhanced AVR core with up to 8K program
8939 memory space (MCU types: atmega8, atmega83, atmega85).
8940
8941 Instruction set avr5 is for the enhanced AVR core with up to 128K program
8942 memory space (MCU types: atmega16, atmega161, atmega163, atmega32, atmega323,
8943 atmega64, atmega128, at43usb355, at94k).
8944
8945 @item -msize
8946 @opindex msize
8947 Output instruction sizes to the asm file.
8948
8949 @item -minit-stack=@var{N}
8950 @opindex minit-stack
8951 Specify the initial stack address, which may be a symbol or numeric value,
8952 @samp{__stack} is the default.
8953
8954 @item -mno-interrupts
8955 @opindex mno-interrupts
8956 Generated code is not compatible with hardware interrupts.
8957 Code size will be smaller.
8958
8959 @item -mcall-prologues
8960 @opindex mcall-prologues
8961 Functions prologues/epilogues expanded as call to appropriate
8962 subroutines.  Code size will be smaller.
8963
8964 @item -mno-tablejump
8965 @opindex mno-tablejump
8966 Do not generate tablejump insns which sometimes increase code size.
8967
8968 @item -mtiny-stack
8969 @opindex mtiny-stack
8970 Change only the low 8 bits of the stack pointer.
8971
8972 @item -mint8
8973 @opindex mint8
8974 Assume int to be 8 bit integer.  This affects the sizes of all types: A
8975 char will be 1 byte, an int will be 1 byte, an long will be 2 bytes
8976 and long long will be 4 bytes.  Please note that this option does not
8977 comply to the C standards, but it will provide you with smaller code
8978 size.
8979 @end table
8980
8981 @node Blackfin Options
8982 @subsection Blackfin Options
8983 @cindex Blackfin Options
8984
8985 @table @gcctabopt
8986 @item -mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]}
8987 @opindex mcpu=
8988 Specifies the name of the target Blackfin processor.  Currently, @var{cpu}
8989 can be one of @samp{bf522}, @samp{bf523}, @samp{bf524},
8990 @samp{bf525}, @samp{bf526}, @samp{bf527},
8991 @samp{bf531}, @samp{bf532}, @samp{bf533}, @samp{bf534},
8992 @samp{bf536}, @samp{bf537}, @samp{bf538}, @samp{bf539},
8993 @samp{bf542}, @samp{bf544}, @samp{bf547}, @samp{bf548}, @samp{bf549},
8994 @samp{bf561}.
8995 The optional @var{sirevision} specifies the silicon revision of the target
8996 Blackfin processor.  Any workarounds available for the targeted silicon revision
8997 will be enabled.  If @var{sirevision} is @samp{none}, no workarounds are enabled.
8998 If @var{sirevision} is @samp{any}, all workarounds for the targeted processor
8999 will be enabled.  The @code{__SILICON_REVISION__} macro is defined to two
9000 hexadecimal digits representing the major and minor numbers in the silicon
9001 revision.  If @var{sirevision} is @samp{none}, the @code{__SILICON_REVISION__}
9002 is not defined.  If @var{sirevision} is @samp{any}, the
9003 @code{__SILICON_REVISION__} is defined to be @code{0xffff}.
9004 If this optional @var{sirevision} is not used, GCC assumes the latest known
9005 silicon revision of the targeted Blackfin processor.
9006
9007 Support for @samp{bf561} is incomplete.  For @samp{bf561},
9008 Only the processor macro is defined.
9009 Without this option, @samp{bf532} is used as the processor by default.
9010 The corresponding predefined processor macros for @var{cpu} is to
9011 be defined.  And for @samp{bfin-elf} toolchain, this causes the hardware BSP
9012 provided by libgloss to be linked in if @option{-msim} is not given.
9013
9014 @item -msim
9015 @opindex msim
9016 Specifies that the program will be run on the simulator.  This causes
9017 the simulator BSP provided by libgloss to be linked in.  This option
9018 has effect only for @samp{bfin-elf} toolchain.
9019 Certain other options, such as @option{-mid-shared-library} and
9020 @option{-mfdpic}, imply @option{-msim}.
9021
9022 @item -momit-leaf-frame-pointer
9023 @opindex momit-leaf-frame-pointer
9024 Don't keep the frame pointer in a register for leaf functions.  This
9025 avoids the instructions to save, set up and restore frame pointers and
9026 makes an extra register available in leaf functions.  The option
9027 @option{-fomit-frame-pointer} removes the frame pointer for all functions
9028 which might make debugging harder.
9029
9030 @item -mspecld-anomaly
9031 @opindex mspecld-anomaly
9032 When enabled, the compiler will ensure that the generated code does not
9033 contain speculative loads after jump instructions. If this option is used,
9034 @code{__WORKAROUND_SPECULATIVE_LOADS} is defined.
9035
9036 @item -mno-specld-anomaly
9037 @opindex mno-specld-anomaly
9038 Don't generate extra code to prevent speculative loads from occurring.
9039
9040 @item -mcsync-anomaly
9041 @opindex mcsync-anomaly
9042 When enabled, the compiler will ensure that the generated code does not
9043 contain CSYNC or SSYNC instructions too soon after conditional branches.
9044 If this option is used, @code{__WORKAROUND_SPECULATIVE_SYNCS} is defined.
9045
9046 @item -mno-csync-anomaly
9047 @opindex mno-csync-anomaly
9048 Don't generate extra code to prevent CSYNC or SSYNC instructions from
9049 occurring too soon after a conditional branch.
9050
9051 @item -mlow-64k
9052 @opindex mlow-64k
9053 When enabled, the compiler is free to take advantage of the knowledge that
9054 the entire program fits into the low 64k of memory.
9055
9056 @item -mno-low-64k
9057 @opindex mno-low-64k
9058 Assume that the program is arbitrarily large.  This is the default.
9059
9060 @item -mstack-check-l1
9061 @opindex mstack-check-l1
9062 Do stack checking using information placed into L1 scratchpad memory by the
9063 uClinux kernel.
9064
9065 @item -mid-shared-library
9066 @opindex mid-shared-library
9067 Generate code that supports shared libraries via the library ID method.
9068 This allows for execute in place and shared libraries in an environment
9069 without virtual memory management.  This option implies @option{-fPIC}.
9070 With a @samp{bfin-elf} target, this option implies @option{-msim}.
9071
9072 @item -mno-id-shared-library
9073 @opindex mno-id-shared-library
9074 Generate code that doesn't assume ID based shared libraries are being used.
9075 This is the default.
9076
9077 @item -mleaf-id-shared-library
9078 @opindex mleaf-id-shared-library
9079 Generate code that supports shared libraries via the library ID method,
9080 but assumes that this library or executable won't link against any other
9081 ID shared libraries.  That allows the compiler to use faster code for jumps
9082 and calls.
9083
9084 @item -mno-leaf-id-shared-library
9085 @opindex mno-leaf-id-shared-library
9086 Do not assume that the code being compiled won't link against any ID shared
9087 libraries.  Slower code will be generated for jump and call insns.
9088
9089 @item -mshared-library-id=n
9090 @opindex mshared-library-id
9091 Specified the identification number of the ID based shared library being
9092 compiled.  Specifying a value of 0 will generate more compact code, specifying
9093 other values will force the allocation of that number to the current
9094 library but is no more space or time efficient than omitting this option.
9095
9096 @item -msep-data
9097 @opindex msep-data
9098 Generate code that allows the data segment to be located in a different
9099 area of memory from the text segment.  This allows for execute in place in
9100 an environment without virtual memory management by eliminating relocations
9101 against the text section.
9102
9103 @item -mno-sep-data
9104 @opindex mno-sep-data
9105 Generate code that assumes that the data segment follows the text segment.
9106 This is the default.
9107
9108 @item -mlong-calls
9109 @itemx -mno-long-calls
9110 @opindex mlong-calls
9111 @opindex mno-long-calls
9112 Tells the compiler to perform function calls by first loading the
9113 address of the function into a register and then performing a subroutine
9114 call on this register.  This switch is needed if the target function
9115 will lie outside of the 24 bit addressing range of the offset based
9116 version of subroutine call instruction.
9117
9118 This feature is not enabled by default.  Specifying
9119 @option{-mno-long-calls} will restore the default behavior.  Note these
9120 switches have no effect on how the compiler generates code to handle
9121 function calls via function pointers.
9122
9123 @item -mfast-fp
9124 @opindex mfast-fp
9125 Link with the fast floating-point library. This library relaxes some of
9126 the IEEE floating-point standard's rules for checking inputs against
9127 Not-a-Number (NAN), in the interest of performance.
9128
9129 @item -minline-plt
9130 @opindex minline-plt
9131 Enable inlining of PLT entries in function calls to functions that are
9132 not known to bind locally.  It has no effect without @option{-mfdpic}.
9133
9134 @item -mmulticore
9135 @opindex mmulticore
9136 Build standalone application for multicore Blackfin processor. Proper
9137 start files and link scripts will be used to support multicore.
9138 This option defines @code{__BFIN_MULTICORE}. It can only be used with
9139 @option{-mcpu=bf561@r{[}-@var{sirevision}@r{]}}. It can be used with
9140 @option{-mcorea} or @option{-mcoreb}. If it's used without
9141 @option{-mcorea} or @option{-mcoreb}, single application/dual core
9142 programming model is used. In this model, the main function of Core B
9143 should be named as coreb_main. If it's used with @option{-mcorea} or
9144 @option{-mcoreb}, one application per core programming model is used.
9145 If this option is not used, single core application programming
9146 model is used.
9147
9148 @item -mcorea
9149 @opindex mcorea
9150 Build standalone application for Core A of BF561 when using
9151 one application per core programming model. Proper start files
9152 and link scripts will be used to support Core A. This option
9153 defines @code{__BFIN_COREA}. It must be used with @option{-mmulticore}.
9154
9155 @item -mcoreb
9156 @opindex mcoreb
9157 Build standalone application for Core B of BF561 when using
9158 one application per core programming model. Proper start files
9159 and link scripts will be used to support Core B. This option
9160 defines @code{__BFIN_COREB}. When this option is used, coreb_main
9161 should be used instead of main. It must be used with
9162 @option{-mmulticore}. 
9163
9164 @item -msdram
9165 @opindex msdram
9166 Build standalone application for SDRAM. Proper start files and
9167 link scripts will be used to put the application into SDRAM.
9168 Loader should initialize SDRAM before loading the application
9169 into SDRAM. This option defines @code{__BFIN_SDRAM}.
9170 @end table
9171
9172 @node CRIS Options
9173 @subsection CRIS Options
9174 @cindex CRIS Options
9175
9176 These options are defined specifically for the CRIS ports.
9177
9178 @table @gcctabopt
9179 @item -march=@var{architecture-type}
9180 @itemx -mcpu=@var{architecture-type}
9181 @opindex march
9182 @opindex mcpu
9183 Generate code for the specified architecture.  The choices for
9184 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
9185 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
9186 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
9187 @samp{v10}.
9188
9189 @item -mtune=@var{architecture-type}
9190 @opindex mtune
9191 Tune to @var{architecture-type} everything applicable about the generated
9192 code, except for the ABI and the set of available instructions.  The
9193 choices for @var{architecture-type} are the same as for
9194 @option{-march=@var{architecture-type}}.
9195
9196 @item -mmax-stack-frame=@var{n}
9197 @opindex mmax-stack-frame
9198 Warn when the stack frame of a function exceeds @var{n} bytes.
9199
9200 @item -metrax4
9201 @itemx -metrax100
9202 @opindex metrax4
9203 @opindex metrax100
9204 The options @option{-metrax4} and @option{-metrax100} are synonyms for
9205 @option{-march=v3} and @option{-march=v8} respectively.
9206
9207 @item -mmul-bug-workaround
9208 @itemx -mno-mul-bug-workaround
9209 @opindex mmul-bug-workaround
9210 @opindex mno-mul-bug-workaround
9211 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
9212 models where it applies.  This option is active by default.
9213
9214 @item -mpdebug
9215 @opindex mpdebug
9216 Enable CRIS-specific verbose debug-related information in the assembly
9217 code.  This option also has the effect to turn off the @samp{#NO_APP}
9218 formatted-code indicator to the assembler at the beginning of the
9219 assembly file.
9220
9221 @item -mcc-init
9222 @opindex mcc-init
9223 Do not use condition-code results from previous instruction; always emit
9224 compare and test instructions before use of condition codes.
9225
9226 @item -mno-side-effects
9227 @opindex mno-side-effects
9228 Do not emit instructions with side-effects in addressing modes other than
9229 post-increment.
9230
9231 @item -mstack-align
9232 @itemx -mno-stack-align
9233 @itemx -mdata-align
9234 @itemx -mno-data-align
9235 @itemx -mconst-align
9236 @itemx -mno-const-align
9237 @opindex mstack-align
9238 @opindex mno-stack-align
9239 @opindex mdata-align
9240 @opindex mno-data-align
9241 @opindex mconst-align
9242 @opindex mno-const-align
9243 These options (no-options) arranges (eliminate arrangements) for the
9244 stack-frame, individual data and constants to be aligned for the maximum
9245 single data access size for the chosen CPU model.  The default is to
9246 arrange for 32-bit alignment.  ABI details such as structure layout are
9247 not affected by these options.
9248
9249 @item -m32-bit
9250 @itemx -m16-bit
9251 @itemx -m8-bit
9252 @opindex m32-bit
9253 @opindex m16-bit
9254 @opindex m8-bit
9255 Similar to the stack- data- and const-align options above, these options
9256 arrange for stack-frame, writable data and constants to all be 32-bit,
9257 16-bit or 8-bit aligned.  The default is 32-bit alignment.
9258
9259 @item -mno-prologue-epilogue
9260 @itemx -mprologue-epilogue
9261 @opindex mno-prologue-epilogue
9262 @opindex mprologue-epilogue
9263 With @option{-mno-prologue-epilogue}, the normal function prologue and
9264 epilogue that sets up the stack-frame are omitted and no return
9265 instructions or return sequences are generated in the code.  Use this
9266 option only together with visual inspection of the compiled code: no
9267 warnings or errors are generated when call-saved registers must be saved,
9268 or storage for local variable needs to be allocated.
9269
9270 @item -mno-gotplt
9271 @itemx -mgotplt
9272 @opindex mno-gotplt
9273 @opindex mgotplt
9274 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
9275 instruction sequences that load addresses for functions from the PLT part
9276 of the GOT rather than (traditional on other architectures) calls to the
9277 PLT@.  The default is @option{-mgotplt}.
9278
9279 @item -melf
9280 @opindex melf
9281 Legacy no-op option only recognized with the cris-axis-elf and
9282 cris-axis-linux-gnu targets.
9283
9284 @item -mlinux
9285 @opindex mlinux
9286 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
9287
9288 @item -sim
9289 @opindex sim
9290 This option, recognized for the cris-axis-elf arranges
9291 to link with input-output functions from a simulator library.  Code,
9292 initialized data and zero-initialized data are allocated consecutively.
9293
9294 @item -sim2
9295 @opindex sim2
9296 Like @option{-sim}, but pass linker options to locate initialized data at
9297 0x40000000 and zero-initialized data at 0x80000000.
9298 @end table
9299
9300 @node CRX Options
9301 @subsection CRX Options
9302 @cindex CRX Options
9303
9304 These options are defined specifically for the CRX ports.
9305
9306 @table @gcctabopt
9307
9308 @item -mmac
9309 @opindex mmac
9310 Enable the use of multiply-accumulate instructions. Disabled by default.
9311
9312 @item -mpush-args
9313 @opindex mpush-args
9314 Push instructions will be used to pass outgoing arguments when functions
9315 are called. Enabled by default.
9316 @end table
9317
9318 @node Darwin Options
9319 @subsection Darwin Options
9320 @cindex Darwin options
9321
9322 These options are defined for all architectures running the Darwin operating
9323 system.
9324
9325 FSF GCC on Darwin does not create ``fat'' object files; it will create
9326 an object file for the single architecture that it was built to
9327 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
9328 @option{-arch} options are used; it does so by running the compiler or
9329 linker multiple times and joining the results together with
9330 @file{lipo}.
9331
9332 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
9333 @samp{i686}) is determined by the flags that specify the ISA
9334 that GCC is targetting, like @option{-mcpu} or @option{-march}.  The
9335 @option{-force_cpusubtype_ALL} option can be used to override this.
9336
9337 The Darwin tools vary in their behavior when presented with an ISA
9338 mismatch.  The assembler, @file{as}, will only permit instructions to
9339 be used that are valid for the subtype of the file it is generating,
9340 so you cannot put 64-bit instructions in an @samp{ppc750} object file.
9341 The linker for shared libraries, @file{/usr/bin/libtool}, will fail
9342 and print an error if asked to create a shared library with a less
9343 restrictive subtype than its input files (for instance, trying to put
9344 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
9345 for executables, @file{ld}, will quietly give the executable the most
9346 restrictive subtype of any of its input files.
9347
9348 @table @gcctabopt
9349 @item -F@var{dir}
9350 @opindex F
9351 Add the framework directory @var{dir} to the head of the list of
9352 directories to be searched for header files.  These directories are
9353 interleaved with those specified by @option{-I} options and are
9354 scanned in a left-to-right order.
9355
9356 A framework directory is a directory with frameworks in it.  A
9357 framework is a directory with a @samp{"Headers"} and/or
9358 @samp{"PrivateHeaders"} directory contained directly in it that ends
9359 in @samp{".framework"}.  The name of a framework is the name of this
9360 directory excluding the @samp{".framework"}.  Headers associated with
9361 the framework are found in one of those two directories, with
9362 @samp{"Headers"} being searched first.  A subframework is a framework
9363 directory that is in a framework's @samp{"Frameworks"} directory.
9364 Includes of subframework headers can only appear in a header of a
9365 framework that contains the subframework, or in a sibling subframework
9366 header.  Two subframeworks are siblings if they occur in the same
9367 framework.  A subframework should not have the same name as a
9368 framework, a warning will be issued if this is violated.  Currently a
9369 subframework cannot have subframeworks, in the future, the mechanism
9370 may be extended to support this.  The standard frameworks can be found
9371 in @samp{"/System/Library/Frameworks"} and
9372 @samp{"/Library/Frameworks"}.  An example include looks like
9373 @code{#include <Framework/header.h>}, where @samp{Framework} denotes
9374 the name of the framework and header.h is found in the
9375 @samp{"PrivateHeaders"} or @samp{"Headers"} directory.
9376
9377 @item -iframework@var{dir}
9378 @opindex iframework
9379 Like @option{-F} except the directory is a treated as a system
9380 directory.  The main difference between this @option{-iframework} and
9381 @option{-F} is that with @option{-iframework} the compiler does not
9382 warn about constructs contained within header files found via
9383 @var{dir}.  This option is valid only for the C family of languages.
9384
9385 @item -gused
9386 @opindex gused
9387 Emit debugging information for symbols that are used.  For STABS
9388 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
9389 This is by default ON@.
9390
9391 @item -gfull
9392 @opindex gfull
9393 Emit debugging information for all symbols and types.
9394
9395 @item -mmacosx-version-min=@var{version}
9396 The earliest version of MacOS X that this executable will run on
9397 is @var{version}.  Typical values of @var{version} include @code{10.1},
9398 @code{10.2}, and @code{10.3.9}.
9399
9400 If the compiler was built to use the system's headers by default,
9401 then the default for this option is the system version on which the
9402 compiler is running, otherwise the default is to make choices which
9403 are compatible with as many systems and code bases as possible.
9404
9405 @item -mkernel
9406 @opindex mkernel
9407 Enable kernel development mode.  The @option{-mkernel} option sets
9408 @option{-static}, @option{-fno-common}, @option{-fno-cxa-atexit},
9409 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
9410 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
9411 applicable.  This mode also sets @option{-mno-altivec},
9412 @option{-msoft-float}, @option{-fno-builtin} and
9413 @option{-mlong-branch} for PowerPC targets.
9414
9415 @item -mone-byte-bool
9416 @opindex mone-byte-bool
9417 Override the defaults for @samp{bool} so that @samp{sizeof(bool)==1}.
9418 By default @samp{sizeof(bool)} is @samp{4} when compiling for
9419 Darwin/PowerPC and @samp{1} when compiling for Darwin/x86, so this
9420 option has no effect on x86.
9421
9422 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
9423 to generate code that is not binary compatible with code generated
9424 without that switch.  Using this switch may require recompiling all
9425 other modules in a program, including system libraries.  Use this
9426 switch to conform to a non-default data model.
9427
9428 @item -mfix-and-continue
9429 @itemx -ffix-and-continue
9430 @itemx -findirect-data
9431 @opindex mfix-and-continue
9432 @opindex ffix-and-continue
9433 @opindex findirect-data
9434 Generate code suitable for fast turn around development.  Needed to
9435 enable gdb to dynamically load @code{.o} files into already running
9436 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
9437 are provided for backwards compatibility.
9438
9439 @item -all_load
9440 @opindex all_load
9441 Loads all members of static archive libraries.
9442 See man ld(1) for more information.
9443
9444 @item -arch_errors_fatal
9445 @opindex arch_errors_fatal
9446 Cause the errors having to do with files that have the wrong architecture
9447 to be fatal.
9448
9449 @item -bind_at_load
9450 @opindex bind_at_load
9451 Causes the output file to be marked such that the dynamic linker will
9452 bind all undefined references when the file is loaded or launched.
9453
9454 @item -bundle
9455 @opindex bundle
9456 Produce a Mach-o bundle format file.
9457 See man ld(1) for more information.
9458
9459 @item -bundle_loader @var{executable}
9460 @opindex bundle_loader
9461 This option specifies the @var{executable} that will be loading the build
9462 output file being linked.  See man ld(1) for more information.
9463
9464 @item -dynamiclib
9465 @opindex dynamiclib
9466 When passed this option, GCC will produce a dynamic library instead of
9467 an executable when linking, using the Darwin @file{libtool} command.
9468
9469 @item -force_cpusubtype_ALL
9470 @opindex force_cpusubtype_ALL
9471 This causes GCC's output file to have the @var{ALL} subtype, instead of
9472 one controlled by the @option{-mcpu} or @option{-march} option.
9473
9474 @item -allowable_client  @var{client_name}
9475 @itemx -client_name
9476 @itemx -compatibility_version
9477 @itemx -current_version
9478 @itemx -dead_strip
9479 @itemx -dependency-file
9480 @itemx -dylib_file
9481 @itemx -dylinker_install_name
9482 @itemx -dynamic
9483 @itemx -exported_symbols_list
9484 @itemx -filelist
9485 @itemx -flat_namespace
9486 @itemx -force_flat_namespace
9487 @itemx -headerpad_max_install_names
9488 @itemx -image_base
9489 @itemx -init
9490 @itemx -install_name
9491 @itemx -keep_private_externs
9492 @itemx -multi_module
9493 @itemx -multiply_defined
9494 @itemx -multiply_defined_unused
9495 @itemx -noall_load
9496 @itemx -no_dead_strip_inits_and_terms
9497 @itemx -nofixprebinding
9498 @itemx -nomultidefs
9499 @itemx -noprebind
9500 @itemx -noseglinkedit
9501 @itemx -pagezero_size
9502 @itemx -prebind
9503 @itemx -prebind_all_twolevel_modules
9504 @itemx -private_bundle
9505 @itemx -read_only_relocs
9506 @itemx -sectalign
9507 @itemx -sectobjectsymbols
9508 @itemx -whyload
9509 @itemx -seg1addr
9510 @itemx -sectcreate
9511 @itemx -sectobjectsymbols
9512 @itemx -sectorder
9513 @itemx -segaddr
9514 @itemx -segs_read_only_addr
9515 @itemx -segs_read_write_addr
9516 @itemx -seg_addr_table
9517 @itemx -seg_addr_table_filename
9518 @itemx -seglinkedit
9519 @itemx -segprot
9520 @itemx -segs_read_only_addr
9521 @itemx -segs_read_write_addr
9522 @itemx -single_module
9523 @itemx -static
9524 @itemx -sub_library
9525 @itemx -sub_umbrella
9526 @itemx -twolevel_namespace
9527 @itemx -umbrella
9528 @itemx -undefined
9529 @itemx -unexported_symbols_list
9530 @itemx -weak_reference_mismatches
9531 @itemx -whatsloaded
9532 @opindex allowable_client
9533 @opindex client_name
9534 @opindex compatibility_version
9535 @opindex current_version
9536 @opindex dead_strip
9537 @opindex dependency-file
9538 @opindex dylib_file
9539 @opindex dylinker_install_name
9540 @opindex dynamic
9541 @opindex exported_symbols_list
9542 @opindex filelist
9543 @opindex flat_namespace
9544 @opindex force_flat_namespace
9545 @opindex headerpad_max_install_names
9546 @opindex image_base
9547 @opindex init
9548 @opindex install_name
9549 @opindex keep_private_externs
9550 @opindex multi_module
9551 @opindex multiply_defined
9552 @opindex multiply_defined_unused
9553 @opindex noall_load
9554 @opindex no_dead_strip_inits_and_terms
9555 @opindex nofixprebinding
9556 @opindex nomultidefs
9557 @opindex noprebind
9558 @opindex noseglinkedit
9559 @opindex pagezero_size
9560 @opindex prebind
9561 @opindex prebind_all_twolevel_modules
9562 @opindex private_bundle
9563 @opindex read_only_relocs
9564 @opindex sectalign
9565 @opindex sectobjectsymbols
9566 @opindex whyload
9567 @opindex seg1addr
9568 @opindex sectcreate
9569 @opindex sectobjectsymbols
9570 @opindex sectorder
9571 @opindex segaddr
9572 @opindex segs_read_only_addr
9573 @opindex segs_read_write_addr
9574 @opindex seg_addr_table
9575 @opindex seg_addr_table_filename
9576 @opindex seglinkedit
9577 @opindex segprot
9578 @opindex segs_read_only_addr
9579 @opindex segs_read_write_addr
9580 @opindex single_module
9581 @opindex static
9582 @opindex sub_library
9583 @opindex sub_umbrella
9584 @opindex twolevel_namespace
9585 @opindex umbrella
9586 @opindex undefined
9587 @opindex unexported_symbols_list
9588 @opindex weak_reference_mismatches
9589 @opindex whatsloaded
9590 These options are passed to the Darwin linker.  The Darwin linker man page
9591 describes them in detail.
9592 @end table
9593
9594 @node DEC Alpha Options
9595 @subsection DEC Alpha Options
9596
9597 These @samp{-m} options are defined for the DEC Alpha implementations:
9598
9599 @table @gcctabopt
9600 @item -mno-soft-float
9601 @itemx -msoft-float
9602 @opindex mno-soft-float
9603 @opindex msoft-float
9604 Use (do not use) the hardware floating-point instructions for
9605 floating-point operations.  When @option{-msoft-float} is specified,
9606 functions in @file{libgcc.a} will be used to perform floating-point
9607 operations.  Unless they are replaced by routines that emulate the
9608 floating-point operations, or compiled in such a way as to call such
9609 emulations routines, these routines will issue floating-point
9610 operations.   If you are compiling for an Alpha without floating-point
9611 operations, you must ensure that the library is built so as not to call
9612 them.
9613
9614 Note that Alpha implementations without floating-point operations are
9615 required to have floating-point registers.
9616
9617 @item -mfp-reg
9618 @itemx -mno-fp-regs
9619 @opindex mfp-reg
9620 @opindex mno-fp-regs
9621 Generate code that uses (does not use) the floating-point register set.
9622 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
9623 register set is not used, floating point operands are passed in integer
9624 registers as if they were integers and floating-point results are passed
9625 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
9626 so any function with a floating-point argument or return value called by code
9627 compiled with @option{-mno-fp-regs} must also be compiled with that
9628 option.
9629
9630 A typical use of this option is building a kernel that does not use,
9631 and hence need not save and restore, any floating-point registers.
9632
9633 @item -mieee
9634 @opindex mieee
9635 The Alpha architecture implements floating-point hardware optimized for
9636 maximum performance.  It is mostly compliant with the IEEE floating
9637 point standard.  However, for full compliance, software assistance is
9638 required.  This option generates code fully IEEE compliant code
9639 @emph{except} that the @var{inexact-flag} is not maintained (see below).
9640 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
9641 defined during compilation.  The resulting code is less efficient but is
9642 able to correctly support denormalized numbers and exceptional IEEE
9643 values such as not-a-number and plus/minus infinity.  Other Alpha
9644 compilers call this option @option{-ieee_with_no_inexact}.
9645
9646 @item -mieee-with-inexact
9647 @opindex mieee-with-inexact
9648 This is like @option{-mieee} except the generated code also maintains
9649 the IEEE @var{inexact-flag}.  Turning on this option causes the
9650 generated code to implement fully-compliant IEEE math.  In addition to
9651 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
9652 macro.  On some Alpha implementations the resulting code may execute
9653 significantly slower than the code generated by default.  Since there is
9654 very little code that depends on the @var{inexact-flag}, you should
9655 normally not specify this option.  Other Alpha compilers call this
9656 option @option{-ieee_with_inexact}.
9657
9658 @item -mfp-trap-mode=@var{trap-mode}
9659 @opindex mfp-trap-mode
9660 This option controls what floating-point related traps are enabled.
9661 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
9662 The trap mode can be set to one of four values:
9663
9664 @table @samp
9665 @item n
9666 This is the default (normal) setting.  The only traps that are enabled
9667 are the ones that cannot be disabled in software (e.g., division by zero
9668 trap).
9669
9670 @item u
9671 In addition to the traps enabled by @samp{n}, underflow traps are enabled
9672 as well.
9673
9674 @item su
9675 Like @samp{u}, but the instructions are marked to be safe for software
9676 completion (see Alpha architecture manual for details).
9677
9678 @item sui
9679 Like @samp{su}, but inexact traps are enabled as well.
9680 @end table
9681
9682 @item -mfp-rounding-mode=@var{rounding-mode}
9683 @opindex mfp-rounding-mode
9684 Selects the IEEE rounding mode.  Other Alpha compilers call this option
9685 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
9686 of:
9687
9688 @table @samp
9689 @item n
9690 Normal IEEE rounding mode.  Floating point numbers are rounded towards
9691 the nearest machine number or towards the even machine number in case
9692 of a tie.
9693
9694 @item m
9695 Round towards minus infinity.
9696
9697 @item c
9698 Chopped rounding mode.  Floating point numbers are rounded towards zero.
9699
9700 @item d
9701 Dynamic rounding mode.  A field in the floating point control register
9702 (@var{fpcr}, see Alpha architecture reference manual) controls the
9703 rounding mode in effect.  The C library initializes this register for
9704 rounding towards plus infinity.  Thus, unless your program modifies the
9705 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
9706 @end table
9707
9708 @item -mtrap-precision=@var{trap-precision}
9709 @opindex mtrap-precision
9710 In the Alpha architecture, floating point traps are imprecise.  This
9711 means without software assistance it is impossible to recover from a
9712 floating trap and program execution normally needs to be terminated.
9713 GCC can generate code that can assist operating system trap handlers
9714 in determining the exact location that caused a floating point trap.
9715 Depending on the requirements of an application, different levels of
9716 precisions can be selected:
9717
9718 @table @samp
9719 @item p
9720 Program precision.  This option is the default and means a trap handler
9721 can only identify which program caused a floating point exception.
9722
9723 @item f
9724 Function precision.  The trap handler can determine the function that
9725 caused a floating point exception.
9726
9727 @item i
9728 Instruction precision.  The trap handler can determine the exact
9729 instruction that caused a floating point exception.
9730 @end table
9731
9732 Other Alpha compilers provide the equivalent options called
9733 @option{-scope_safe} and @option{-resumption_safe}.
9734
9735 @item -mieee-conformant
9736 @opindex mieee-conformant
9737 This option marks the generated code as IEEE conformant.  You must not
9738 use this option unless you also specify @option{-mtrap-precision=i} and either
9739 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
9740 is to emit the line @samp{.eflag 48} in the function prologue of the
9741 generated assembly file.  Under DEC Unix, this has the effect that
9742 IEEE-conformant math library routines will be linked in.
9743
9744 @item -mbuild-constants
9745 @opindex mbuild-constants
9746 Normally GCC examines a 32- or 64-bit integer constant to
9747 see if it can construct it from smaller constants in two or three
9748 instructions.  If it cannot, it will output the constant as a literal and
9749 generate code to load it from the data segment at runtime.
9750
9751 Use this option to require GCC to construct @emph{all} integer constants
9752 using code, even if it takes more instructions (the maximum is six).
9753
9754 You would typically use this option to build a shared library dynamic
9755 loader.  Itself a shared library, it must relocate itself in memory
9756 before it can find the variables and constants in its own data segment.
9757
9758 @item -malpha-as
9759 @itemx -mgas
9760 @opindex malpha-as
9761 @opindex mgas
9762 Select whether to generate code to be assembled by the vendor-supplied
9763 assembler (@option{-malpha-as}) or by the GNU assembler @option{-mgas}.
9764
9765 @item -mbwx
9766 @itemx -mno-bwx
9767 @itemx -mcix
9768 @itemx -mno-cix
9769 @itemx -mfix
9770 @itemx -mno-fix
9771 @itemx -mmax
9772 @itemx -mno-max
9773 @opindex mbwx
9774 @opindex mno-bwx
9775 @opindex mcix
9776 @opindex mno-cix
9777 @opindex mfix
9778 @opindex mno-fix
9779 @opindex mmax
9780 @opindex mno-max
9781 Indicate whether GCC should generate code to use the optional BWX,
9782 CIX, FIX and MAX instruction sets.  The default is to use the instruction
9783 sets supported by the CPU type specified via @option{-mcpu=} option or that
9784 of the CPU on which GCC was built if none was specified.
9785
9786 @item -mfloat-vax
9787 @itemx -mfloat-ieee
9788 @opindex mfloat-vax
9789 @opindex mfloat-ieee
9790 Generate code that uses (does not use) VAX F and G floating point
9791 arithmetic instead of IEEE single and double precision.
9792
9793 @item -mexplicit-relocs
9794 @itemx -mno-explicit-relocs
9795 @opindex mexplicit-relocs
9796 @opindex mno-explicit-relocs
9797 Older Alpha assemblers provided no way to generate symbol relocations
9798 except via assembler macros.  Use of these macros does not allow
9799 optimal instruction scheduling.  GNU binutils as of version 2.12
9800 supports a new syntax that allows the compiler to explicitly mark
9801 which relocations should apply to which instructions.  This option
9802 is mostly useful for debugging, as GCC detects the capabilities of
9803 the assembler when it is built and sets the default accordingly.
9804
9805 @item -msmall-data
9806 @itemx -mlarge-data
9807 @opindex msmall-data
9808 @opindex mlarge-data
9809 When @option{-mexplicit-relocs} is in effect, static data is
9810 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
9811 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
9812 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
9813 16-bit relocations off of the @code{$gp} register.  This limits the
9814 size of the small data area to 64KB, but allows the variables to be
9815 directly accessed via a single instruction.
9816
9817 The default is @option{-mlarge-data}.  With this option the data area
9818 is limited to just below 2GB@.  Programs that require more than 2GB of
9819 data must use @code{malloc} or @code{mmap} to allocate the data in the
9820 heap instead of in the program's data segment.
9821
9822 When generating code for shared libraries, @option{-fpic} implies
9823 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
9824
9825 @item -msmall-text
9826 @itemx -mlarge-text
9827 @opindex msmall-text
9828 @opindex mlarge-text
9829 When @option{-msmall-text} is used, the compiler assumes that the
9830 code of the entire program (or shared library) fits in 4MB, and is
9831 thus reachable with a branch instruction.  When @option{-msmall-data}
9832 is used, the compiler can assume that all local symbols share the
9833 same @code{$gp} value, and thus reduce the number of instructions
9834 required for a function call from 4 to 1.
9835
9836 The default is @option{-mlarge-text}.
9837
9838 @item -mcpu=@var{cpu_type}
9839 @opindex mcpu
9840 Set the instruction set and instruction scheduling parameters for
9841 machine type @var{cpu_type}.  You can specify either the @samp{EV}
9842 style name or the corresponding chip number.  GCC supports scheduling
9843 parameters for the EV4, EV5 and EV6 family of processors and will
9844 choose the default values for the instruction set from the processor
9845 you specify.  If you do not specify a processor type, GCC will default
9846 to the processor on which the compiler was built.
9847
9848 Supported values for @var{cpu_type} are
9849
9850 @table @samp
9851 @item ev4
9852 @itemx ev45
9853 @itemx 21064
9854 Schedules as an EV4 and has no instruction set extensions.
9855
9856 @item ev5
9857 @itemx 21164
9858 Schedules as an EV5 and has no instruction set extensions.
9859
9860 @item ev56
9861 @itemx 21164a
9862 Schedules as an EV5 and supports the BWX extension.
9863
9864 @item pca56
9865 @itemx 21164pc
9866 @itemx 21164PC
9867 Schedules as an EV5 and supports the BWX and MAX extensions.
9868
9869 @item ev6
9870 @itemx 21264
9871 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
9872
9873 @item ev67
9874 @itemx 21264a
9875 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
9876 @end table
9877
9878 @item -mtune=@var{cpu_type}
9879 @opindex mtune
9880 Set only the instruction scheduling parameters for machine type
9881 @var{cpu_type}.  The instruction set is not changed.
9882
9883 @item -mmemory-latency=@var{time}
9884 @opindex mmemory-latency
9885 Sets the latency the scheduler should assume for typical memory
9886 references as seen by the application.  This number is highly
9887 dependent on the memory access patterns used by the application
9888 and the size of the external cache on the machine.
9889
9890 Valid options for @var{time} are
9891
9892 @table @samp
9893 @item @var{number}
9894 A decimal number representing clock cycles.
9895
9896 @item L1
9897 @itemx L2
9898 @itemx L3
9899 @itemx main
9900 The compiler contains estimates of the number of clock cycles for
9901 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
9902 (also called Dcache, Scache, and Bcache), as well as to main memory.
9903 Note that L3 is only valid for EV5.
9904
9905 @end table
9906 @end table
9907
9908 @node DEC Alpha/VMS Options
9909 @subsection DEC Alpha/VMS Options
9910
9911 These @samp{-m} options are defined for the DEC Alpha/VMS implementations:
9912
9913 @table @gcctabopt
9914 @item -mvms-return-codes
9915 @opindex mvms-return-codes
9916 Return VMS condition codes from main.  The default is to return POSIX
9917 style condition (e.g.@: error) codes.
9918 @end table
9919
9920 @node FRV Options
9921 @subsection FRV Options
9922 @cindex FRV Options
9923
9924 @table @gcctabopt
9925 @item -mgpr-32
9926 @opindex mgpr-32
9927
9928 Only use the first 32 general purpose registers.
9929
9930 @item -mgpr-64
9931 @opindex mgpr-64
9932
9933 Use all 64 general purpose registers.
9934
9935 @item -mfpr-32
9936 @opindex mfpr-32
9937
9938 Use only the first 32 floating point registers.
9939
9940 @item -mfpr-64
9941 @opindex mfpr-64
9942
9943 Use all 64 floating point registers
9944
9945 @item -mhard-float
9946 @opindex mhard-float
9947
9948 Use hardware instructions for floating point operations.
9949
9950 @item -msoft-float
9951 @opindex msoft-float
9952
9953 Use library routines for floating point operations.
9954
9955 @item -malloc-cc
9956 @opindex malloc-cc
9957
9958 Dynamically allocate condition code registers.
9959
9960 @item -mfixed-cc
9961 @opindex mfixed-cc
9962
9963 Do not try to dynamically allocate condition code registers, only
9964 use @code{icc0} and @code{fcc0}.
9965
9966 @item -mdword
9967 @opindex mdword
9968
9969 Change ABI to use double word insns.
9970
9971 @item -mno-dword
9972 @opindex mno-dword
9973
9974 Do not use double word instructions.
9975
9976 @item -mdouble
9977 @opindex mdouble
9978
9979 Use floating point double instructions.
9980
9981 @item -mno-double
9982 @opindex mno-double
9983
9984 Do not use floating point double instructions.
9985
9986 @item -mmedia
9987 @opindex mmedia
9988
9989 Use media instructions.
9990
9991 @item -mno-media
9992 @opindex mno-media
9993
9994 Do not use media instructions.
9995
9996 @item -mmuladd
9997 @opindex mmuladd
9998
9999 Use multiply and add/subtract instructions.
10000
10001 @item -mno-muladd
10002 @opindex mno-muladd
10003
10004 Do not use multiply and add/subtract instructions.
10005
10006 @item -mfdpic
10007 @opindex mfdpic
10008
10009 Select the FDPIC ABI, that uses function descriptors to represent
10010 pointers to functions.  Without any PIC/PIE-related options, it
10011 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
10012 assumes GOT entries and small data are within a 12-bit range from the
10013 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
10014 are computed with 32 bits.
10015 With a @samp{bfin-elf} target, this option implies @option{-msim}.
10016
10017 @item -minline-plt
10018 @opindex minline-plt
10019
10020 Enable inlining of PLT entries in function calls to functions that are
10021 not known to bind locally.  It has no effect without @option{-mfdpic}.
10022 It's enabled by default if optimizing for speed and compiling for
10023 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
10024 optimization option such as @option{-O3} or above is present in the
10025 command line.
10026
10027 @item -mTLS
10028 @opindex TLS
10029
10030 Assume a large TLS segment when generating thread-local code.
10031
10032 @item -mtls
10033 @opindex tls
10034
10035 Do not assume a large TLS segment when generating thread-local code.
10036
10037 @item -mgprel-ro
10038 @opindex mgprel-ro
10039
10040 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
10041 that is known to be in read-only sections.  It's enabled by default,
10042 except for @option{-fpic} or @option{-fpie}: even though it may help
10043 make the global offset table smaller, it trades 1 instruction for 4.
10044 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
10045 one of which may be shared by multiple symbols, and it avoids the need
10046 for a GOT entry for the referenced symbol, so it's more likely to be a
10047 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
10048
10049 @item -multilib-library-pic
10050 @opindex multilib-library-pic
10051
10052 Link with the (library, not FD) pic libraries.  It's implied by
10053 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
10054 @option{-fpic} without @option{-mfdpic}.  You should never have to use
10055 it explicitly.
10056
10057 @item -mlinked-fp
10058 @opindex mlinked-fp
10059
10060 Follow the EABI requirement of always creating a frame pointer whenever
10061 a stack frame is allocated.  This option is enabled by default and can
10062 be disabled with @option{-mno-linked-fp}.
10063
10064 @item -mlong-calls
10065 @opindex mlong-calls
10066
10067 Use indirect addressing to call functions outside the current
10068 compilation unit.  This allows the functions to be placed anywhere
10069 within the 32-bit address space.
10070
10071 @item -malign-labels
10072 @opindex malign-labels
10073
10074 Try to align labels to an 8-byte boundary by inserting nops into the
10075 previous packet.  This option only has an effect when VLIW packing
10076 is enabled.  It doesn't create new packets; it merely adds nops to
10077 existing ones.
10078
10079 @item -mlibrary-pic
10080 @opindex mlibrary-pic
10081
10082 Generate position-independent EABI code.
10083
10084 @item -macc-4
10085 @opindex macc-4
10086
10087 Use only the first four media accumulator registers.
10088
10089 @item -macc-8
10090 @opindex macc-8
10091
10092 Use all eight media accumulator registers.
10093
10094 @item -mpack
10095 @opindex mpack
10096
10097 Pack VLIW instructions.
10098
10099 @item -mno-pack
10100 @opindex mno-pack
10101
10102 Do not pack VLIW instructions.
10103
10104 @item -mno-eflags
10105 @opindex mno-eflags
10106
10107 Do not mark ABI switches in e_flags.
10108
10109 @item -mcond-move
10110 @opindex mcond-move
10111
10112 Enable the use of conditional-move instructions (default).
10113
10114 This switch is mainly for debugging the compiler and will likely be removed
10115 in a future version.
10116
10117 @item -mno-cond-move
10118 @opindex mno-cond-move
10119
10120 Disable the use of conditional-move instructions.
10121
10122 This switch is mainly for debugging the compiler and will likely be removed
10123 in a future version.
10124
10125 @item -mscc
10126 @opindex mscc
10127
10128 Enable the use of conditional set instructions (default).
10129
10130 This switch is mainly for debugging the compiler and will likely be removed
10131 in a future version.
10132
10133 @item -mno-scc
10134 @opindex mno-scc
10135
10136 Disable the use of conditional set instructions.
10137
10138 This switch is mainly for debugging the compiler and will likely be removed
10139 in a future version.
10140
10141 @item -mcond-exec
10142 @opindex mcond-exec
10143
10144 Enable the use of conditional execution (default).
10145
10146 This switch is mainly for debugging the compiler and will likely be removed
10147 in a future version.
10148
10149 @item -mno-cond-exec
10150 @opindex mno-cond-exec
10151
10152 Disable the use of conditional execution.
10153
10154 This switch is mainly for debugging the compiler and will likely be removed
10155 in a future version.
10156
10157 @item -mvliw-branch
10158 @opindex mvliw-branch
10159
10160 Run a pass to pack branches into VLIW instructions (default).
10161
10162 This switch is mainly for debugging the compiler and will likely be removed
10163 in a future version.
10164
10165 @item -mno-vliw-branch
10166 @opindex mno-vliw-branch
10167
10168 Do not run a pass to pack branches into VLIW instructions.
10169
10170 This switch is mainly for debugging the compiler and will likely be removed
10171 in a future version.
10172
10173 @item -mmulti-cond-exec
10174 @opindex mmulti-cond-exec
10175
10176 Enable optimization of @code{&&} and @code{||} in conditional execution
10177 (default).
10178
10179 This switch is mainly for debugging the compiler and will likely be removed
10180 in a future version.
10181
10182 @item -mno-multi-cond-exec
10183 @opindex mno-multi-cond-exec
10184
10185 Disable optimization of @code{&&} and @code{||} in conditional execution.
10186
10187 This switch is mainly for debugging the compiler and will likely be removed
10188 in a future version.
10189
10190 @item -mnested-cond-exec
10191 @opindex mnested-cond-exec
10192
10193 Enable nested conditional execution optimizations (default).
10194
10195 This switch is mainly for debugging the compiler and will likely be removed
10196 in a future version.
10197
10198 @item -mno-nested-cond-exec
10199 @opindex mno-nested-cond-exec
10200
10201 Disable nested conditional execution optimizations.
10202
10203 This switch is mainly for debugging the compiler and will likely be removed
10204 in a future version.
10205
10206 @item -moptimize-membar
10207 @opindex moptimize-membar
10208
10209 This switch removes redundant @code{membar} instructions from the
10210 compiler generated code.  It is enabled by default.
10211
10212 @item -mno-optimize-membar
10213 @opindex mno-optimize-membar
10214
10215 This switch disables the automatic removal of redundant @code{membar}
10216 instructions from the generated code.
10217
10218 @item -mtomcat-stats
10219 @opindex mtomcat-stats
10220
10221 Cause gas to print out tomcat statistics.
10222
10223 @item -mcpu=@var{cpu}
10224 @opindex mcpu
10225
10226 Select the processor type for which to generate code.  Possible values are
10227 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
10228 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
10229
10230 @end table
10231
10232 @node GNU/Linux Options
10233 @subsection GNU/Linux Options
10234
10235 These @samp{-m} options are defined for GNU/Linux targets:
10236
10237 @table @gcctabopt
10238 @item -mglibc
10239 @opindex mglibc
10240 Use the GNU C library instead of uClibc.  This is the default except
10241 on @samp{*-*-linux-*uclibc*} targets.
10242
10243 @item -muclibc
10244 @opindex muclibc
10245 Use uClibc instead of the GNU C library.  This is the default on
10246 @samp{*-*-linux-*uclibc*} targets.
10247 @end table
10248
10249 @node H8/300 Options
10250 @subsection H8/300 Options
10251
10252 These @samp{-m} options are defined for the H8/300 implementations:
10253
10254 @table @gcctabopt
10255 @item -mrelax
10256 @opindex mrelax
10257 Shorten some address references at link time, when possible; uses the
10258 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
10259 ld, Using ld}, for a fuller description.
10260
10261 @item -mh
10262 @opindex mh
10263 Generate code for the H8/300H@.
10264
10265 @item -ms
10266 @opindex ms
10267 Generate code for the H8S@.
10268
10269 @item -mn
10270 @opindex mn
10271 Generate code for the H8S and H8/300H in the normal mode.  This switch
10272 must be used either with @option{-mh} or @option{-ms}.
10273
10274 @item -ms2600
10275 @opindex ms2600
10276 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
10277
10278 @item -mint32
10279 @opindex mint32
10280 Make @code{int} data 32 bits by default.
10281
10282 @item -malign-300
10283 @opindex malign-300
10284 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
10285 The default for the H8/300H and H8S is to align longs and floats on 4
10286 byte boundaries.
10287 @option{-malign-300} causes them to be aligned on 2 byte boundaries.
10288 This option has no effect on the H8/300.
10289 @end table
10290
10291 @node HPPA Options
10292 @subsection HPPA Options
10293 @cindex HPPA Options
10294
10295 These @samp{-m} options are defined for the HPPA family of computers:
10296
10297 @table @gcctabopt
10298 @item -march=@var{architecture-type}
10299 @opindex march
10300 Generate code for the specified architecture.  The choices for
10301 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
10302 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
10303 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
10304 architecture option for your machine.  Code compiled for lower numbered
10305 architectures will run on higher numbered architectures, but not the
10306 other way around.
10307
10308 @item -mpa-risc-1-0
10309 @itemx -mpa-risc-1-1
10310 @itemx -mpa-risc-2-0
10311 @opindex mpa-risc-1-0
10312 @opindex mpa-risc-1-1
10313 @opindex mpa-risc-2-0
10314 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
10315
10316 @item -mbig-switch
10317 @opindex mbig-switch
10318 Generate code suitable for big switch tables.  Use this option only if
10319 the assembler/linker complain about out of range branches within a switch
10320 table.
10321
10322 @item -mjump-in-delay
10323 @opindex mjump-in-delay
10324 Fill delay slots of function calls with unconditional jump instructions
10325 by modifying the return pointer for the function call to be the target
10326 of the conditional jump.
10327
10328 @item -mdisable-fpregs
10329 @opindex mdisable-fpregs
10330 Prevent floating point registers from being used in any manner.  This is
10331 necessary for compiling kernels which perform lazy context switching of
10332 floating point registers.  If you use this option and attempt to perform
10333 floating point operations, the compiler will abort.
10334
10335 @item -mdisable-indexing
10336 @opindex mdisable-indexing
10337 Prevent the compiler from using indexing address modes.  This avoids some
10338 rather obscure problems when compiling MIG generated code under MACH@.
10339
10340 @item -mno-space-regs
10341 @opindex mno-space-regs
10342 Generate code that assumes the target has no space registers.  This allows
10343 GCC to generate faster indirect calls and use unscaled index address modes.
10344
10345 Such code is suitable for level 0 PA systems and kernels.
10346
10347 @item -mfast-indirect-calls
10348 @opindex mfast-indirect-calls
10349 Generate code that assumes calls never cross space boundaries.  This
10350 allows GCC to emit code which performs faster indirect calls.
10351
10352 This option will not work in the presence of shared libraries or nested
10353 functions.
10354
10355 @item -mfixed-range=@var{register-range}
10356 @opindex mfixed-range
10357 Generate code treating the given register range as fixed registers.
10358 A fixed register is one that the register allocator can not use.  This is
10359 useful when compiling kernel code.  A register range is specified as
10360 two registers separated by a dash.  Multiple register ranges can be
10361 specified separated by a comma.
10362
10363 @item -mlong-load-store
10364 @opindex mlong-load-store
10365 Generate 3-instruction load and store sequences as sometimes required by
10366 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
10367 the HP compilers.
10368
10369 @item -mportable-runtime
10370 @opindex mportable-runtime
10371 Use the portable calling conventions proposed by HP for ELF systems.
10372
10373 @item -mgas
10374 @opindex mgas
10375 Enable the use of assembler directives only GAS understands.
10376
10377 @item -mschedule=@var{cpu-type}
10378 @opindex mschedule
10379 Schedule code according to the constraints for the machine type
10380 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
10381 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
10382 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
10383 proper scheduling option for your machine.  The default scheduling is
10384 @samp{8000}.
10385
10386 @item -mlinker-opt
10387 @opindex mlinker-opt
10388 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
10389 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
10390 linkers in which they give bogus error messages when linking some programs.
10391
10392 @item -msoft-float
10393 @opindex msoft-float
10394 Generate output containing library calls for floating point.
10395 @strong{Warning:} the requisite libraries are not available for all HPPA
10396 targets.  Normally the facilities of the machine's usual C compiler are
10397 used, but this cannot be done directly in cross-compilation.  You must make
10398 your own arrangements to provide suitable library functions for
10399 cross-compilation.
10400
10401 @option{-msoft-float} changes the calling convention in the output file;
10402 therefore, it is only useful if you compile @emph{all} of a program with
10403 this option.  In particular, you need to compile @file{libgcc.a}, the
10404 library that comes with GCC, with @option{-msoft-float} in order for
10405 this to work.
10406
10407 @item -msio
10408 @opindex msio
10409 Generate the predefine, @code{_SIO}, for server IO@.  The default is
10410 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
10411 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
10412 options are available under HP-UX and HI-UX@.
10413
10414 @item -mgnu-ld
10415 @opindex gnu-ld
10416 Use GNU ld specific options.  This passes @option{-shared} to ld when
10417 building a shared library.  It is the default when GCC is configured,
10418 explicitly or implicitly, with the GNU linker.  This option does not
10419 have any affect on which ld is called, it only changes what parameters
10420 are passed to that ld.  The ld that is called is determined by the
10421 @option{--with-ld} configure option, GCC's program search path, and
10422 finally by the user's @env{PATH}.  The linker used by GCC can be printed
10423 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
10424 on the 64 bit HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
10425
10426 @item -mhp-ld
10427 @opindex hp-ld
10428 Use HP ld specific options.  This passes @option{-b} to ld when building
10429 a shared library and passes @option{+Accept TypeMismatch} to ld on all
10430 links.  It is the default when GCC is configured, explicitly or
10431 implicitly, with the HP linker.  This option does not have any affect on
10432 which ld is called, it only changes what parameters are passed to that
10433 ld.  The ld that is called is determined by the @option{--with-ld}
10434 configure option, GCC's program search path, and finally by the user's
10435 @env{PATH}.  The linker used by GCC can be printed using @samp{which
10436 `gcc -print-prog-name=ld`}.  This option is only available on the 64 bit
10437 HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
10438
10439 @item -mlong-calls
10440 @opindex mno-long-calls
10441 Generate code that uses long call sequences.  This ensures that a call
10442 is always able to reach linker generated stubs.  The default is to generate
10443 long calls only when the distance from the call site to the beginning
10444 of the function or translation unit, as the case may be, exceeds a
10445 predefined limit set by the branch type being used.  The limits for
10446 normal calls are 7,600,000 and 240,000 bytes, respectively for the
10447 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
10448 240,000 bytes.
10449
10450 Distances are measured from the beginning of functions when using the
10451 @option{-ffunction-sections} option, or when using the @option{-mgas}
10452 and @option{-mno-portable-runtime} options together under HP-UX with
10453 the SOM linker.
10454
10455 It is normally not desirable to use this option as it will degrade
10456 performance.  However, it may be useful in large applications,
10457 particularly when partial linking is used to build the application.
10458
10459 The types of long calls used depends on the capabilities of the
10460 assembler and linker, and the type of code being generated.  The
10461 impact on systems that support long absolute calls, and long pic
10462 symbol-difference or pc-relative calls should be relatively small.
10463 However, an indirect call is used on 32-bit ELF systems in pic code
10464 and it is quite long.
10465
10466 @item -munix=@var{unix-std}
10467 @opindex march
10468 Generate compiler predefines and select a startfile for the specified
10469 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
10470 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
10471 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
10472 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
10473 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
10474 and later.
10475
10476 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
10477 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
10478 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
10479 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
10480 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
10481 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
10482
10483 It is @emph{important} to note that this option changes the interfaces
10484 for various library routines.  It also affects the operational behavior
10485 of the C library.  Thus, @emph{extreme} care is needed in using this
10486 option.
10487
10488 Library code that is intended to operate with more than one UNIX
10489 standard must test, set and restore the variable @var{__xpg4_extended_mask}
10490 as appropriate.  Most GNU software doesn't provide this capability.
10491
10492 @item -nolibdld
10493 @opindex nolibdld
10494 Suppress the generation of link options to search libdld.sl when the
10495 @option{-static} option is specified on HP-UX 10 and later.
10496
10497 @item -static
10498 @opindex static
10499 The HP-UX implementation of setlocale in libc has a dependency on
10500 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
10501 when the @option{-static} option is specified, special link options
10502 are needed to resolve this dependency.
10503
10504 On HP-UX 10 and later, the GCC driver adds the necessary options to
10505 link with libdld.sl when the @option{-static} option is specified.
10506 This causes the resulting binary to be dynamic.  On the 64-bit port,
10507 the linkers generate dynamic binaries by default in any case.  The
10508 @option{-nolibdld} option can be used to prevent the GCC driver from
10509 adding these link options.
10510
10511 @item -threads
10512 @opindex threads
10513 Add support for multithreading with the @dfn{dce thread} library
10514 under HP-UX@.  This option sets flags for both the preprocessor and
10515 linker.
10516 @end table
10517
10518 @node i386 and x86-64 Options
10519 @subsection Intel 386 and AMD x86-64 Options
10520 @cindex i386 Options
10521 @cindex x86-64 Options
10522 @cindex Intel 386 Options
10523 @cindex AMD x86-64 Options
10524
10525 These @samp{-m} options are defined for the i386 and x86-64 family of
10526 computers:
10527
10528 @table @gcctabopt
10529 @item -mtune=@var{cpu-type}
10530 @opindex mtune
10531 Tune to @var{cpu-type} everything applicable about the generated code, except
10532 for the ABI and the set of available instructions.  The choices for
10533 @var{cpu-type} are:
10534 @table @emph
10535 @item generic
10536 Produce code optimized for the most common IA32/AMD64/EM64T processors.
10537 If you know the CPU on which your code will run, then you should use
10538 the corresponding @option{-mtune} option instead of
10539 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
10540 of your application will have, then you should use this option.
10541
10542 As new processors are deployed in the marketplace, the behavior of this
10543 option will change.  Therefore, if you upgrade to a newer version of
10544 GCC, the code generated option will change to reflect the processors
10545 that were most common when that version of GCC was released.
10546
10547 There is no @option{-march=generic} option because @option{-march}
10548 indicates the instruction set the compiler can use, and there is no
10549 generic instruction set applicable to all processors.  In contrast,
10550 @option{-mtune} indicates the processor (or, in this case, collection of
10551 processors) for which the code is optimized.
10552 @item native
10553 This selects the CPU to tune for at compilation time by determining
10554 the processor type of the compiling machine.  Using @option{-mtune=native}
10555 will produce code optimized for the local machine under the constraints
10556 of the selected instruction set.  Using @option{-march=native} will
10557 enable all instruction subsets supported by the local machine (hence
10558 the result might not run on different machines).
10559 @item i386
10560 Original Intel's i386 CPU@.
10561 @item i486
10562 Intel's i486 CPU@.  (No scheduling is implemented for this chip.)
10563 @item i586, pentium
10564 Intel Pentium CPU with no MMX support.
10565 @item pentium-mmx
10566 Intel PentiumMMX CPU based on Pentium core with MMX instruction set support.
10567 @item pentiumpro
10568 Intel PentiumPro CPU@.
10569 @item i686
10570 Same as @code{generic}, but when used as @code{march} option, PentiumPro
10571 instruction set will be used, so the code will run on all i686 family chips.
10572 @item pentium2
10573 Intel Pentium2 CPU based on PentiumPro core with MMX instruction set support.
10574 @item pentium3, pentium3m
10575 Intel Pentium3 CPU based on PentiumPro core with MMX and SSE instruction set
10576 support.
10577 @item pentium-m
10578 Low power version of Intel Pentium3 CPU with MMX, SSE and SSE2 instruction set
10579 support.  Used by Centrino notebooks.
10580 @item pentium4, pentium4m
10581 Intel Pentium4 CPU with MMX, SSE and SSE2 instruction set support.
10582 @item prescott
10583 Improved version of Intel Pentium4 CPU with MMX, SSE, SSE2 and SSE3 instruction
10584 set support.
10585 @item nocona
10586 Improved version of Intel Pentium4 CPU with 64-bit extensions, MMX, SSE,
10587 SSE2 and SSE3 instruction set support.
10588 @item core2
10589 Intel Core2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
10590 instruction set support.
10591 @item k6
10592 AMD K6 CPU with MMX instruction set support.
10593 @item k6-2, k6-3
10594 Improved versions of AMD K6 CPU with MMX and 3dNOW!@: instruction set support.
10595 @item athlon, athlon-tbird
10596 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW!@: and SSE prefetch instructions
10597 support.
10598 @item athlon-4, athlon-xp, athlon-mp
10599 Improved AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW!@: and full SSE
10600 instruction set support.
10601 @item k8, opteron, athlon64, athlon-fx
10602 AMD K8 core based CPUs with x86-64 instruction set support.  (This supersets
10603 MMX, SSE, SSE2, 3dNOW!, enhanced 3dNOW!@: and 64-bit instruction set extensions.)
10604 @item k8-sse3, opteron-sse3, athlon64-sse3
10605 Improved versions of k8, opteron and athlon64 with SSE3 instruction set support.
10606 @item amdfam10, barcelona
10607 AMD Family 10h core based CPUs with x86-64 instruction set support.  (This
10608 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3dNOW!, enhanced 3dNOW!, ABM and 64-bit
10609 instruction set extensions.)
10610 @item winchip-c6
10611 IDT Winchip C6 CPU, dealt in same way as i486 with additional MMX instruction
10612 set support.
10613 @item winchip2
10614 IDT Winchip2 CPU, dealt in same way as i486 with additional MMX and 3dNOW!@:
10615 instruction set support.
10616 @item c3
10617 Via C3 CPU with MMX and 3dNOW!@: instruction set support.  (No scheduling is
10618 implemented for this chip.)
10619 @item c3-2
10620 Via C3-2 CPU with MMX and SSE instruction set support.  (No scheduling is
10621 implemented for this chip.)
10622 @item geode
10623 Embedded AMD CPU with MMX and 3dNOW! instruction set support.
10624 @end table
10625
10626 While picking a specific @var{cpu-type} will schedule things appropriately
10627 for that particular chip, the compiler will not generate any code that
10628 does not run on the i386 without the @option{-march=@var{cpu-type}} option
10629 being used.
10630
10631 @item -march=@var{cpu-type}
10632 @opindex march
10633 Generate instructions for the machine type @var{cpu-type}.  The choices
10634 for @var{cpu-type} are the same as for @option{-mtune}.  Moreover,
10635 specifying @option{-march=@var{cpu-type}} implies @option{-mtune=@var{cpu-type}}.
10636
10637 @item -mcpu=@var{cpu-type}
10638 @opindex mcpu
10639 A deprecated synonym for @option{-mtune}.
10640
10641 @item -mfpmath=@var{unit}
10642 @opindex march
10643 Generate floating point arithmetics for selected unit @var{unit}.  The choices
10644 for @var{unit} are:
10645
10646 @table @samp
10647 @item 387
10648 Use the standard 387 floating point coprocessor present majority of chips and
10649 emulated otherwise.  Code compiled with this option will run almost everywhere.
10650 The temporary results are computed in 80bit precision instead of precision
10651 specified by the type resulting in slightly different results compared to most
10652 of other chips.  See @option{-ffloat-store} for more detailed description.
10653
10654 This is the default choice for i386 compiler.
10655
10656 @item sse
10657 Use scalar floating point instructions present in the SSE instruction set.
10658 This instruction set is supported by Pentium3 and newer chips, in the AMD line
10659 by Athlon-4, Athlon-xp and Athlon-mp chips.  The earlier version of SSE
10660 instruction set supports only single precision arithmetics, thus the double and
10661 extended precision arithmetics is still done using 387.  Later version, present
10662 only in Pentium4 and the future AMD x86-64 chips supports double precision
10663 arithmetics too.
10664
10665 For the i386 compiler, you need to use @option{-march=@var{cpu-type}}, @option{-msse}
10666 or @option{-msse2} switches to enable SSE extensions and make this option
10667 effective.  For the x86-64 compiler, these extensions are enabled by default.
10668
10669 The resulting code should be considerably faster in the majority of cases and avoid
10670 the numerical instability problems of 387 code, but may break some existing
10671 code that expects temporaries to be 80bit.
10672
10673 This is the default choice for the x86-64 compiler.
10674
10675 @item sse,387
10676 @itemx sse+387
10677 @itemx both
10678 Attempt to utilize both instruction sets at once.  This effectively double the
10679 amount of available registers and on chips with separate execution units for
10680 387 and SSE the execution resources too.  Use this option with care, as it is
10681 still experimental, because the GCC register allocator does not model separate
10682 functional units well resulting in instable performance.
10683 @end table
10684
10685 @item -masm=@var{dialect}
10686 @opindex masm=@var{dialect}
10687 Output asm instructions using selected @var{dialect}.  Supported
10688 choices are @samp{intel} or @samp{att} (the default one).  Darwin does
10689 not support @samp{intel}.
10690
10691 @item -mieee-fp
10692 @itemx -mno-ieee-fp
10693 @opindex mieee-fp
10694 @opindex mno-ieee-fp
10695 Control whether or not the compiler uses IEEE floating point
10696 comparisons.  These handle correctly the case where the result of a
10697 comparison is unordered.
10698
10699 @item -msoft-float
10700 @opindex msoft-float
10701 Generate output containing library calls for floating point.
10702 @strong{Warning:} the requisite libraries are not part of GCC@.
10703 Normally the facilities of the machine's usual C compiler are used, but
10704 this can't be done directly in cross-compilation.  You must make your
10705 own arrangements to provide suitable library functions for
10706 cross-compilation.
10707
10708 On machines where a function returns floating point results in the 80387
10709 register stack, some floating point opcodes may be emitted even if
10710 @option{-msoft-float} is used.
10711
10712 @item -mno-fp-ret-in-387
10713 @opindex mno-fp-ret-in-387
10714 Do not use the FPU registers for return values of functions.
10715
10716 The usual calling convention has functions return values of types
10717 @code{float} and @code{double} in an FPU register, even if there
10718 is no FPU@.  The idea is that the operating system should emulate
10719 an FPU@.
10720
10721 The option @option{-mno-fp-ret-in-387} causes such values to be returned
10722 in ordinary CPU registers instead.
10723
10724 @item -mno-fancy-math-387
10725 @opindex mno-fancy-math-387
10726 Some 387 emulators do not support the @code{sin}, @code{cos} and
10727 @code{sqrt} instructions for the 387.  Specify this option to avoid
10728 generating those instructions.  This option is the default on FreeBSD,
10729 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
10730 indicates that the target cpu will always have an FPU and so the
10731 instruction will not need emulation.  As of revision 2.6.1, these
10732 instructions are not generated unless you also use the
10733 @option{-funsafe-math-optimizations} switch.
10734
10735 @item -malign-double
10736 @itemx -mno-align-double
10737 @opindex malign-double
10738 @opindex mno-align-double
10739 Control whether GCC aligns @code{double}, @code{long double}, and
10740 @code{long long} variables on a two word boundary or a one word
10741 boundary.  Aligning @code{double} variables on a two word boundary will
10742 produce code that runs somewhat faster on a @samp{Pentium} at the
10743 expense of more memory.
10744
10745 On x86-64, @option{-malign-double} is enabled by default.
10746
10747 @strong{Warning:} if you use the @option{-malign-double} switch,
10748 structures containing the above types will be aligned differently than
10749 the published application binary interface specifications for the 386
10750 and will not be binary compatible with structures in code compiled
10751 without that switch.
10752
10753 @item -m96bit-long-double
10754 @itemx -m128bit-long-double
10755 @opindex m96bit-long-double
10756 @opindex m128bit-long-double
10757 These switches control the size of @code{long double} type.  The i386
10758 application binary interface specifies the size to be 96 bits,
10759 so @option{-m96bit-long-double} is the default in 32 bit mode.
10760
10761 Modern architectures (Pentium and newer) would prefer @code{long double}
10762 to be aligned to an 8 or 16 byte boundary.  In arrays or structures
10763 conforming to the ABI, this would not be possible.  So specifying a
10764 @option{-m128bit-long-double} will align @code{long double}
10765 to a 16 byte boundary by padding the @code{long double} with an additional
10766 32 bit zero.
10767
10768 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
10769 its ABI specifies that @code{long double} is to be aligned on 16 byte boundary.
10770
10771 Notice that neither of these options enable any extra precision over the x87
10772 standard of 80 bits for a @code{long double}.
10773
10774 @strong{Warning:} if you override the default value for your target ABI, the
10775 structures and arrays containing @code{long double} variables will change
10776 their size as well as function calling convention for function taking
10777 @code{long double} will be modified.  Hence they will not be binary
10778 compatible with arrays or structures in code compiled without that switch.
10779
10780 @item -mmlarge-data-threshold=@var{number}
10781 @opindex mlarge-data-threshold=@var{number}
10782 When @option{-mcmodel=medium} is specified, the data greater than
10783 @var{threshold} are placed in large data section.  This value must be the
10784 same across all object linked into the binary and defaults to 65535.
10785
10786 @item -mrtd
10787 @opindex mrtd
10788 Use a different function-calling convention, in which functions that
10789 take a fixed number of arguments return with the @code{ret} @var{num}
10790 instruction, which pops their arguments while returning.  This saves one
10791 instruction in the caller since there is no need to pop the arguments
10792 there.
10793
10794 You can specify that an individual function is called with this calling
10795 sequence with the function attribute @samp{stdcall}.  You can also
10796 override the @option{-mrtd} option by using the function attribute
10797 @samp{cdecl}.  @xref{Function Attributes}.
10798
10799 @strong{Warning:} this calling convention is incompatible with the one
10800 normally used on Unix, so you cannot use it if you need to call
10801 libraries compiled with the Unix compiler.
10802
10803 Also, you must provide function prototypes for all functions that
10804 take variable numbers of arguments (including @code{printf});
10805 otherwise incorrect code will be generated for calls to those
10806 functions.
10807
10808 In addition, seriously incorrect code will result if you call a
10809 function with too many arguments.  (Normally, extra arguments are
10810 harmlessly ignored.)
10811
10812 @item -mregparm=@var{num}
10813 @opindex mregparm
10814 Control how many registers are used to pass integer arguments.  By
10815 default, no registers are used to pass arguments, and at most 3
10816 registers can be used.  You can control this behavior for a specific
10817 function by using the function attribute @samp{regparm}.
10818 @xref{Function Attributes}.
10819
10820 @strong{Warning:} if you use this switch, and
10821 @var{num} is nonzero, then you must build all modules with the same
10822 value, including any libraries.  This includes the system libraries and
10823 startup modules.
10824
10825 @item -msseregparm
10826 @opindex msseregparm
10827 Use SSE register passing conventions for float and double arguments
10828 and return values.  You can control this behavior for a specific
10829 function by using the function attribute @samp{sseregparm}.
10830 @xref{Function Attributes}.
10831
10832 @strong{Warning:} if you use this switch then you must build all
10833 modules with the same value, including any libraries.  This includes
10834 the system libraries and startup modules.
10835
10836 @item -mpc32
10837 @itemx -mpc64
10838 @itemx -mpc80
10839 @opindex mpc32
10840 @opindex mpc64
10841 @opindex mpc80
10842
10843 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
10844 is specified, the significands of results of floating-point operations are
10845 rounded to 24 bits (single precision); @option{-mpc64} rounds the the
10846 significands of results of floating-point operations to 53 bits (double
10847 precision) and @option{-mpc80} rounds the significands of results of
10848 floating-point operations to 64 bits (extended double precision), which is
10849 the default.  When this option is used, floating-point operations in higher
10850 precisions are not available to the programmer without setting the FPU
10851 control word explicitly.
10852
10853 Setting the rounding of floating-point operations to less than the default
10854 80 bits can speed some programs by 2% or more.  Note that some mathematical
10855 libraries assume that extended precision (80 bit) floating-point operations
10856 are enabled by default; routines in such libraries could suffer significant
10857 loss of accuracy, typically through so-called "catastrophic cancellation",
10858 when this option is used to set the precision to less than extended precision. 
10859
10860 @item -mstackrealign
10861 @opindex mstackrealign
10862 Realign the stack at entry.  On the Intel x86, the @option{-mstackrealign}
10863 option will generate an alternate prologue and epilogue that realigns the
10864 runtime stack if necessary.  This supports mixing legacy codes that keep
10865 a 4-byte aligned stack with modern codes that keep a 16-byte stack for
10866 SSE compatibility.  See also the attribute @code{force_align_arg_pointer},
10867 applicable to individual functions.
10868
10869 @item -mpreferred-stack-boundary=@var{num}
10870 @opindex mpreferred-stack-boundary
10871 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
10872 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
10873 the default is 4 (16 bytes or 128 bits).
10874
10875 @item -mincoming-stack-boundary=@var{num}
10876 @opindex mincoming-stack-boundary
10877 Assume the incoming stack is aligned to a 2 raised to @var{num} byte
10878 boundary.  If @option{-mincoming-stack-boundary} is not specified,
10879 the one specified by @option{-mpreferred-stack-boundary} will be used.
10880
10881 On Pentium and PentiumPro, @code{double} and @code{long double} values
10882 should be aligned to an 8 byte boundary (see @option{-malign-double}) or
10883 suffer significant run time performance penalties.  On Pentium III, the
10884 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
10885 properly if it is not 16 byte aligned.
10886
10887 To ensure proper alignment of this values on the stack, the stack boundary
10888 must be as aligned as that required by any value stored on the stack.
10889 Further, every function must be generated such that it keeps the stack
10890 aligned.  Thus calling a function compiled with a higher preferred
10891 stack boundary from a function compiled with a lower preferred stack
10892 boundary will most likely misalign the stack.  It is recommended that
10893 libraries that use callbacks always use the default setting.
10894
10895 This extra alignment does consume extra stack space, and generally
10896 increases code size.  Code that is sensitive to stack space usage, such
10897 as embedded systems and operating system kernels, may want to reduce the
10898 preferred alignment to @option{-mpreferred-stack-boundary=2}.
10899
10900 @item -mmmx
10901 @itemx -mno-mmx
10902 @itemx -msse
10903 @itemx -mno-sse
10904 @itemx -msse2
10905 @itemx -mno-sse2
10906 @itemx -msse3
10907 @itemx -mno-sse3
10908 @itemx -mssse3
10909 @itemx -mno-ssse3
10910 @itemx -msse4.1
10911 @itemx -mno-sse4.1
10912 @itemx -msse4.2
10913 @itemx -mno-sse4.2
10914 @itemx -msse4
10915 @itemx -mno-sse4
10916 @itemx -mavx
10917 @itemx -mno-avx
10918 @itemx -maes
10919 @itemx -mno-aes
10920 @itemx -mpclmul
10921 @itemx -mno-pclmul
10922 @itemx -msse4a
10923 @itemx -mno-sse4a
10924 @itemx -msse5
10925 @itemx -mno-sse5
10926 @itemx -m3dnow
10927 @itemx -mno-3dnow
10928 @itemx -mpopcnt
10929 @itemx -mno-popcnt
10930 @itemx -mabm
10931 @itemx -mno-abm
10932 @opindex mmmx
10933 @opindex mno-mmx
10934 @opindex msse
10935 @opindex mno-sse
10936 @opindex m3dnow
10937 @opindex mno-3dnow
10938 These switches enable or disable the use of instructions in the MMX,
10939 SSE, SSE2, SSE3, SSSE3, SSE4.1, AVX, AES, PCLMUL, SSE4A, SSE5, ABM or
10940 3DNow!@: extended instruction sets.
10941 These extensions are also available as built-in functions: see
10942 @ref{X86 Built-in Functions}, for details of the functions enabled and
10943 disabled by these switches.
10944
10945 To have SSE/SSE2 instructions generated automatically from floating-point
10946 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
10947
10948 GCC depresses SSEx instructions when @option{-mavx} is used. Instead, it
10949 generates new AVX instructions or AVX equivalence for all SSEx instructions
10950 when needed.
10951
10952 These options will enable GCC to use these extended instructions in
10953 generated code, even without @option{-mfpmath=sse}.  Applications which
10954 perform runtime CPU detection must compile separate files for each
10955 supported architecture, using the appropriate flags.  In particular,
10956 the file containing the CPU detection code should be compiled without
10957 these options.
10958
10959 @item -mcld
10960 @opindex mcld
10961 This option instructs GCC to emit a @code{cld} instruction in the prologue
10962 of functions that use string instructions.  String instructions depend on
10963 the DF flag to select between autoincrement or autodecrement mode.  While the
10964 ABI specifies the DF flag to be cleared on function entry, some operating
10965 systems violate this specification by not clearing the DF flag in their
10966 exception dispatchers.  The exception handler can be invoked with the DF flag
10967 set which leads to wrong direction mode, when string instructions are used.
10968 This option can be enabled by default on 32-bit x86 targets by configuring
10969 GCC with the @option{--enable-cld} configure option.  Generation of @code{cld}
10970 instructions can be suppressed with the @option{-mno-cld} compiler option
10971 in this case.
10972
10973 @item -mcx16
10974 @opindex mcx16
10975 This option will enable GCC to use CMPXCHG16B instruction in generated code.
10976 CMPXCHG16B allows for atomic operations on 128-bit double quadword (or oword)
10977 data types.  This is useful for high resolution counters that could be updated
10978 by multiple processors (or cores).  This instruction is generated as part of
10979 atomic built-in functions: see @ref{Atomic Builtins} for details.
10980
10981 @item -msahf
10982 @opindex msahf
10983 This option will enable GCC to use SAHF instruction in generated 64-bit code.
10984 Early Intel CPUs with Intel 64 lacked LAHF and SAHF instructions supported
10985 by AMD64 until introduction of Pentium 4 G1 step in December 2005.  LAHF and
10986 SAHF are load and store instructions, respectively, for certain status flags.
10987 In 64-bit mode, SAHF instruction is used to optimize @code{fmod}, @code{drem}
10988 or @code{remainder} built-in functions: see @ref{Other Builtins} for details.
10989
10990 @item -mrecip
10991 @opindex mrecip
10992 This option will enable GCC to use RCPSS and RSQRTSS instructions (and their
10993 vectorized variants RCPPS and RSQRTPS) with an additional Newton-Rhapson step
10994 to increase precision instead of DIVSS and SQRTSS (and their vectorized
10995 variants) for single precision floating point arguments.  These instructions
10996 are generated only when @option{-funsafe-math-optimizations} is enabled
10997 together with @option{-finite-math-only} and @option{-fno-trapping-math}.
10998 Note that while the throughput of the sequence is higher than the throughput
10999 of the non-reciprocal instruction, the precision of the sequence can be
11000 decreased by up to 2 ulp (i.e. the inverse of 1.0 equals 0.99999994).
11001
11002 @item -mveclibabi=@var{type}
11003 @opindex mveclibabi
11004 Specifies the ABI type to use for vectorizing intrinsics using an
11005 external library.  Supported types are @code{svml} for the Intel short
11006 vector math library and @code{acml} for the AMD math core library style
11007 of interfacing.  GCC will currently emit calls to @code{vmldExp2},
11008 @code{vmldLn2}, @code{vmldLog102}, @code{vmldLog102}, @code{vmldPow2},
11009 @code{vmldTanh2}, @code{vmldTan2}, @code{vmldAtan2}, @code{vmldAtanh2},
11010 @code{vmldCbrt2}, @code{vmldSinh2}, @code{vmldSin2}, @code{vmldAsinh2},
11011 @code{vmldAsin2}, @code{vmldCosh2}, @code{vmldCos2}, @code{vmldAcosh2},
11012 @code{vmldAcos2}, @code{vmlsExp4}, @code{vmlsLn4}, @code{vmlsLog104},
11013 @code{vmlsLog104}, @code{vmlsPow4}, @code{vmlsTanh4}, @code{vmlsTan4},
11014 @code{vmlsAtan4}, @code{vmlsAtanh4}, @code{vmlsCbrt4}, @code{vmlsSinh4},
11015 @code{vmlsSin4}, @code{vmlsAsinh4}, @code{vmlsAsin4}, @code{vmlsCosh4},
11016 @code{vmlsCos4}, @code{vmlsAcosh4} and @code{vmlsAcos4} for corresponding
11017 function type when @option{-mveclibabi=svml} is used and @code{__vrd2_sin},
11018 @code{__vrd2_cos}, @code{__vrd2_exp}, @code{__vrd2_log}, @code{__vrd2_log2},
11019 @code{__vrd2_log10}, @code{__vrs4_sinf}, @code{__vrs4_cosf},
11020 @code{__vrs4_expf}, @code{__vrs4_logf}, @code{__vrs4_log2f},
11021 @code{__vrs4_log10f} and @code{__vrs4_powf} for corresponding function type
11022 when @option{-mveclibabi=acml} is used. Both @option{-ftree-vectorize} and
11023 @option{-funsafe-math-optimizations} have to be enabled. A SVML or ACML ABI
11024 compatible library will have to be specified at link time.
11025
11026 @item -mpush-args
11027 @itemx -mno-push-args
11028 @opindex mpush-args
11029 @opindex mno-push-args
11030 Use PUSH operations to store outgoing parameters.  This method is shorter
11031 and usually equally fast as method using SUB/MOV operations and is enabled
11032 by default.  In some cases disabling it may improve performance because of
11033 improved scheduling and reduced dependencies.
11034
11035 @item -maccumulate-outgoing-args
11036 @opindex maccumulate-outgoing-args
11037 If enabled, the maximum amount of space required for outgoing arguments will be
11038 computed in the function prologue.  This is faster on most modern CPUs
11039 because of reduced dependencies, improved scheduling and reduced stack usage
11040 when preferred stack boundary is not equal to 2.  The drawback is a notable
11041 increase in code size.  This switch implies @option{-mno-push-args}.
11042
11043 @item -mthreads
11044 @opindex mthreads
11045 Support thread-safe exception handling on @samp{Mingw32}.  Code that relies
11046 on thread-safe exception handling must compile and link all code with the
11047 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
11048 @option{-D_MT}; when linking, it links in a special thread helper library
11049 @option{-lmingwthrd} which cleans up per thread exception handling data.
11050
11051 @item -mno-align-stringops
11052 @opindex mno-align-stringops
11053 Do not align destination of inlined string operations.  This switch reduces
11054 code size and improves performance in case the destination is already aligned,
11055 but GCC doesn't know about it.
11056
11057 @item -minline-all-stringops
11058 @opindex minline-all-stringops
11059 By default GCC inlines string operations only when destination is known to be
11060 aligned at least to 4 byte boundary.  This enables more inlining, increase code
11061 size, but may improve performance of code that depends on fast memcpy, strlen
11062 and memset for short lengths.
11063
11064 @item -minline-stringops-dynamically
11065 @opindex minline-stringops-dynamically
11066 For string operation of unknown size, inline runtime checks so for small
11067 blocks inline code is used, while for large blocks library call is used.
11068
11069 @item -mstringop-strategy=@var{alg}
11070 @opindex mstringop-strategy=@var{alg}
11071 Overwrite internal decision heuristic about particular algorithm to inline
11072 string operation with.  The allowed values are @code{rep_byte},
11073 @code{rep_4byte}, @code{rep_8byte} for expanding using i386 @code{rep} prefix
11074 of specified size, @code{byte_loop}, @code{loop}, @code{unrolled_loop} for
11075 expanding inline loop, @code{libcall} for always expanding library call.
11076
11077 @item -momit-leaf-frame-pointer
11078 @opindex momit-leaf-frame-pointer
11079 Don't keep the frame pointer in a register for leaf functions.  This
11080 avoids the instructions to save, set up and restore frame pointers and
11081 makes an extra register available in leaf functions.  The option
11082 @option{-fomit-frame-pointer} removes the frame pointer for all functions
11083 which might make debugging harder.
11084
11085 @item -mtls-direct-seg-refs
11086 @itemx -mno-tls-direct-seg-refs
11087 @opindex mtls-direct-seg-refs
11088 Controls whether TLS variables may be accessed with offsets from the
11089 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
11090 or whether the thread base pointer must be added.  Whether or not this
11091 is legal depends on the operating system, and whether it maps the
11092 segment to cover the entire TLS area.
11093
11094 For systems that use GNU libc, the default is on.
11095
11096 @item -mfused-madd
11097 @itemx -mno-fused-madd
11098 @opindex mfused-madd
11099 Enable automatic generation of fused floating point multiply-add instructions
11100 if the ISA supports such instructions.  The -mfused-madd option is on by
11101 default.  The fused multiply-add instructions have a different
11102 rounding behavior compared to executing a multiply followed by an add.
11103 @end table
11104
11105 These @samp{-m} switches are supported in addition to the above
11106 on AMD x86-64 processors in 64-bit environments.
11107
11108 @table @gcctabopt
11109 @item -m32
11110 @itemx -m64
11111 @opindex m32
11112 @opindex m64
11113 Generate code for a 32-bit or 64-bit environment.
11114 The 32-bit environment sets int, long and pointer to 32 bits and
11115 generates code that runs on any i386 system.
11116 The 64-bit environment sets int to 32 bits and long and pointer
11117 to 64 bits and generates code for AMD's x86-64 architecture. For
11118 darwin only the -m64 option turns off the @option{-fno-pic} and
11119 @option{-mdynamic-no-pic} options.
11120
11121 @item -mno-red-zone
11122 @opindex no-red-zone
11123 Do not use a so called red zone for x86-64 code.  The red zone is mandated
11124 by the x86-64 ABI, it is a 128-byte area beyond the location of the
11125 stack pointer that will not be modified by signal or interrupt handlers
11126 and therefore can be used for temporary data without adjusting the stack
11127 pointer.  The flag @option{-mno-red-zone} disables this red zone.
11128
11129 @item -mcmodel=small
11130 @opindex mcmodel=small
11131 Generate code for the small code model: the program and its symbols must
11132 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
11133 Programs can be statically or dynamically linked.  This is the default
11134 code model.
11135
11136 @item -mcmodel=kernel
11137 @opindex mcmodel=kernel
11138 Generate code for the kernel code model.  The kernel runs in the
11139 negative 2 GB of the address space.
11140 This model has to be used for Linux kernel code.
11141
11142 @item -mcmodel=medium
11143 @opindex mcmodel=medium
11144 Generate code for the medium model: The program is linked in the lower 2
11145 GB of the address space but symbols can be located anywhere in the
11146 address space.  Programs can be statically or dynamically linked, but
11147 building of shared libraries are not supported with the medium model.
11148
11149 @item -mcmodel=large
11150 @opindex mcmodel=large
11151 Generate code for the large model: This model makes no assumptions
11152 about addresses and sizes of sections.
11153 @end table
11154
11155 @node IA-64 Options
11156 @subsection IA-64 Options
11157 @cindex IA-64 Options
11158
11159 These are the @samp{-m} options defined for the Intel IA-64 architecture.
11160
11161 @table @gcctabopt
11162 @item -mbig-endian
11163 @opindex mbig-endian
11164 Generate code for a big endian target.  This is the default for HP-UX@.
11165
11166 @item -mlittle-endian
11167 @opindex mlittle-endian
11168 Generate code for a little endian target.  This is the default for AIX5
11169 and GNU/Linux.
11170
11171 @item -mgnu-as
11172 @itemx -mno-gnu-as
11173 @opindex mgnu-as
11174 @opindex mno-gnu-as
11175 Generate (or don't) code for the GNU assembler.  This is the default.
11176 @c Also, this is the default if the configure option @option{--with-gnu-as}
11177 @c is used.
11178
11179 @item -mgnu-ld
11180 @itemx -mno-gnu-ld
11181 @opindex mgnu-ld
11182 @opindex mno-gnu-ld
11183 Generate (or don't) code for the GNU linker.  This is the default.
11184 @c Also, this is the default if the configure option @option{--with-gnu-ld}
11185 @c is used.
11186
11187 @item -mno-pic
11188 @opindex mno-pic
11189 Generate code that does not use a global pointer register.  The result
11190 is not position independent code, and violates the IA-64 ABI@.
11191
11192 @item -mvolatile-asm-stop
11193 @itemx -mno-volatile-asm-stop
11194 @opindex mvolatile-asm-stop
11195 @opindex mno-volatile-asm-stop
11196 Generate (or don't) a stop bit immediately before and after volatile asm
11197 statements.
11198
11199 @item -mregister-names
11200 @itemx -mno-register-names
11201 @opindex mregister-names
11202 @opindex mno-register-names
11203 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
11204 the stacked registers.  This may make assembler output more readable.
11205
11206 @item -mno-sdata
11207 @itemx -msdata
11208 @opindex mno-sdata
11209 @opindex msdata
11210 Disable (or enable) optimizations that use the small data section.  This may
11211 be useful for working around optimizer bugs.
11212
11213 @item -mconstant-gp
11214 @opindex mconstant-gp
11215 Generate code that uses a single constant global pointer value.  This is
11216 useful when compiling kernel code.
11217
11218 @item -mauto-pic
11219 @opindex mauto-pic
11220 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
11221 This is useful when compiling firmware code.
11222
11223 @item -minline-float-divide-min-latency
11224 @opindex minline-float-divide-min-latency
11225 Generate code for inline divides of floating point values
11226 using the minimum latency algorithm.
11227
11228 @item -minline-float-divide-max-throughput
11229 @opindex minline-float-divide-max-throughput
11230 Generate code for inline divides of floating point values
11231 using the maximum throughput algorithm.
11232
11233 @item -minline-int-divide-min-latency
11234 @opindex minline-int-divide-min-latency
11235 Generate code for inline divides of integer values
11236 using the minimum latency algorithm.
11237
11238 @item -minline-int-divide-max-throughput
11239 @opindex minline-int-divide-max-throughput
11240 Generate code for inline divides of integer values
11241 using the maximum throughput algorithm.
11242
11243 @item -minline-sqrt-min-latency
11244 @opindex minline-sqrt-min-latency
11245 Generate code for inline square roots
11246 using the minimum latency algorithm.
11247
11248 @item -minline-sqrt-max-throughput
11249 @opindex minline-sqrt-max-throughput
11250 Generate code for inline square roots
11251 using the maximum throughput algorithm.
11252
11253 @item -mno-dwarf2-asm
11254 @itemx -mdwarf2-asm
11255 @opindex mno-dwarf2-asm
11256 @opindex mdwarf2-asm
11257 Don't (or do) generate assembler code for the DWARF2 line number debugging
11258 info.  This may be useful when not using the GNU assembler.
11259
11260 @item -mearly-stop-bits
11261 @itemx -mno-early-stop-bits
11262 @opindex mearly-stop-bits
11263 @opindex mno-early-stop-bits
11264 Allow stop bits to be placed earlier than immediately preceding the
11265 instruction that triggered the stop bit.  This can improve instruction
11266 scheduling, but does not always do so.
11267
11268 @item -mfixed-range=@var{register-range}
11269 @opindex mfixed-range
11270 Generate code treating the given register range as fixed registers.
11271 A fixed register is one that the register allocator can not use.  This is
11272 useful when compiling kernel code.  A register range is specified as
11273 two registers separated by a dash.  Multiple register ranges can be
11274 specified separated by a comma.
11275
11276 @item -mtls-size=@var{tls-size}
11277 @opindex mtls-size
11278 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
11279 64.
11280
11281 @item -mtune=@var{cpu-type}
11282 @opindex mtune
11283 Tune the instruction scheduling for a particular CPU, Valid values are
11284 itanium, itanium1, merced, itanium2, and mckinley.
11285
11286 @item -mt
11287 @itemx -pthread
11288 @opindex mt
11289 @opindex pthread
11290 Add support for multithreading using the POSIX threads library.  This
11291 option sets flags for both the preprocessor and linker.  It does
11292 not affect the thread safety of object code produced by the compiler or
11293 that of libraries supplied with it.  These are HP-UX specific flags.
11294
11295 @item -milp32
11296 @itemx -mlp64
11297 @opindex milp32
11298 @opindex mlp64
11299 Generate code for a 32-bit or 64-bit environment.
11300 The 32-bit environment sets int, long and pointer to 32 bits.
11301 The 64-bit environment sets int to 32 bits and long and pointer
11302 to 64 bits.  These are HP-UX specific flags.
11303
11304 @item -mno-sched-br-data-spec
11305 @itemx -msched-br-data-spec
11306 @opindex mno-sched-br-data-spec
11307 @opindex msched-br-data-spec
11308 (Dis/En)able data speculative scheduling before reload.
11309 This will result in generation of the ld.a instructions and
11310 the corresponding check instructions (ld.c / chk.a).
11311 The default is 'disable'.
11312
11313 @item -msched-ar-data-spec
11314 @itemx -mno-sched-ar-data-spec
11315 @opindex msched-ar-data-spec
11316 @opindex mno-sched-ar-data-spec
11317 (En/Dis)able data speculative scheduling after reload.
11318 This will result in generation of the ld.a instructions and
11319 the corresponding check instructions (ld.c / chk.a).
11320 The default is 'enable'.
11321
11322 @item -mno-sched-control-spec
11323 @itemx -msched-control-spec
11324 @opindex mno-sched-control-spec
11325 @opindex msched-control-spec
11326 (Dis/En)able control speculative scheduling.  This feature is
11327 available only during region scheduling (i.e.@: before reload).
11328 This will result in generation of the ld.s instructions and
11329 the corresponding check instructions chk.s .
11330 The default is 'disable'.
11331
11332 @item -msched-br-in-data-spec
11333 @itemx -mno-sched-br-in-data-spec
11334 @opindex msched-br-in-data-spec
11335 @opindex mno-sched-br-in-data-spec
11336 (En/Dis)able speculative scheduling of the instructions that
11337 are dependent on the data speculative loads before reload.
11338 This is effective only with @option{-msched-br-data-spec} enabled.
11339 The default is 'enable'.
11340
11341 @item -msched-ar-in-data-spec
11342 @itemx -mno-sched-ar-in-data-spec
11343 @opindex msched-ar-in-data-spec
11344 @opindex mno-sched-ar-in-data-spec
11345 (En/Dis)able speculative scheduling of the instructions that
11346 are dependent on the data speculative loads after reload.
11347 This is effective only with @option{-msched-ar-data-spec} enabled.
11348 The default is 'enable'.
11349
11350 @item -msched-in-control-spec
11351 @itemx -mno-sched-in-control-spec
11352 @opindex msched-in-control-spec
11353 @opindex mno-sched-in-control-spec
11354 (En/Dis)able speculative scheduling of the instructions that
11355 are dependent on the control speculative loads.
11356 This is effective only with @option{-msched-control-spec} enabled.
11357 The default is 'enable'.
11358
11359 @item -msched-ldc
11360 @itemx -mno-sched-ldc
11361 @opindex msched-ldc
11362 @opindex mno-sched-ldc
11363 (En/Dis)able use of simple data speculation checks ld.c .
11364 If disabled, only chk.a instructions will be emitted to check
11365 data speculative loads.
11366 The default is 'enable'.
11367
11368 @item -mno-sched-control-ldc
11369 @itemx -msched-control-ldc
11370 @opindex mno-sched-control-ldc
11371 @opindex msched-control-ldc
11372 (Dis/En)able use of ld.c instructions to check control speculative loads.
11373 If enabled, in case of control speculative load with no speculatively
11374 scheduled dependent instructions this load will be emitted as ld.sa and
11375 ld.c will be used to check it.
11376 The default is 'disable'.
11377
11378 @item -mno-sched-spec-verbose
11379 @itemx -msched-spec-verbose
11380 @opindex mno-sched-spec-verbose
11381 @opindex msched-spec-verbose
11382 (Dis/En)able printing of the information about speculative motions.
11383
11384 @item -mno-sched-prefer-non-data-spec-insns
11385 @itemx -msched-prefer-non-data-spec-insns
11386 @opindex mno-sched-prefer-non-data-spec-insns
11387 @opindex msched-prefer-non-data-spec-insns
11388 If enabled, data speculative instructions will be chosen for schedule
11389 only if there are no other choices at the moment.  This will make
11390 the use of the data speculation much more conservative.
11391 The default is 'disable'.
11392
11393 @item -mno-sched-prefer-non-control-spec-insns
11394 @itemx -msched-prefer-non-control-spec-insns
11395 @opindex mno-sched-prefer-non-control-spec-insns
11396 @opindex msched-prefer-non-control-spec-insns
11397 If enabled, control speculative instructions will be chosen for schedule
11398 only if there are no other choices at the moment.  This will make
11399 the use of the control speculation much more conservative.
11400 The default is 'disable'.
11401
11402 @item -mno-sched-count-spec-in-critical-path
11403 @itemx -msched-count-spec-in-critical-path
11404 @opindex mno-sched-count-spec-in-critical-path
11405 @opindex msched-count-spec-in-critical-path
11406 If enabled, speculative dependencies will be considered during
11407 computation of the instructions priorities.  This will make the use of the
11408 speculation a bit more conservative.
11409 The default is 'disable'.
11410
11411 @end table
11412
11413 @node M32C Options
11414 @subsection M32C Options
11415 @cindex M32C options
11416
11417 @table @gcctabopt
11418 @item -mcpu=@var{name}
11419 @opindex mcpu=
11420 Select the CPU for which code is generated.  @var{name} may be one of
11421 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
11422 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
11423 the M32C/80 series.
11424
11425 @item -msim
11426 @opindex msim
11427 Specifies that the program will be run on the simulator.  This causes
11428 an alternate runtime library to be linked in which supports, for
11429 example, file I/O@.  You must not use this option when generating
11430 programs that will run on real hardware; you must provide your own
11431 runtime library for whatever I/O functions are needed.
11432
11433 @item -memregs=@var{number}
11434 @opindex memregs=
11435 Specifies the number of memory-based pseudo-registers GCC will use
11436 during code generation.  These pseudo-registers will be used like real
11437 registers, so there is a tradeoff between GCC's ability to fit the
11438 code into available registers, and the performance penalty of using
11439 memory instead of registers.  Note that all modules in a program must
11440 be compiled with the same value for this option.  Because of that, you
11441 must not use this option with the default runtime libraries gcc
11442 builds.
11443
11444 @end table
11445
11446 @node M32R/D Options
11447 @subsection M32R/D Options
11448 @cindex M32R/D options
11449
11450 These @option{-m} options are defined for Renesas M32R/D architectures:
11451
11452 @table @gcctabopt
11453 @item -m32r2
11454 @opindex m32r2
11455 Generate code for the M32R/2@.
11456
11457 @item -m32rx
11458 @opindex m32rx
11459 Generate code for the M32R/X@.
11460
11461 @item -m32r
11462 @opindex m32r
11463 Generate code for the M32R@.  This is the default.
11464
11465 @item -mmodel=small
11466 @opindex mmodel=small
11467 Assume all objects live in the lower 16MB of memory (so that their addresses
11468 can be loaded with the @code{ld24} instruction), and assume all subroutines
11469 are reachable with the @code{bl} instruction.
11470 This is the default.
11471
11472 The addressability of a particular object can be set with the
11473 @code{model} attribute.
11474
11475 @item -mmodel=medium
11476 @opindex mmodel=medium
11477 Assume objects may be anywhere in the 32-bit address space (the compiler
11478 will generate @code{seth/add3} instructions to load their addresses), and
11479 assume all subroutines are reachable with the @code{bl} instruction.
11480
11481 @item -mmodel=large
11482 @opindex mmodel=large
11483 Assume objects may be anywhere in the 32-bit address space (the compiler
11484 will generate @code{seth/add3} instructions to load their addresses), and
11485 assume subroutines may not be reachable with the @code{bl} instruction
11486 (the compiler will generate the much slower @code{seth/add3/jl}
11487 instruction sequence).
11488
11489 @item -msdata=none
11490 @opindex msdata=none
11491 Disable use of the small data area.  Variables will be put into
11492 one of @samp{.data}, @samp{bss}, or @samp{.rodata} (unless the
11493 @code{section} attribute has been specified).
11494 This is the default.
11495
11496 The small data area consists of sections @samp{.sdata} and @samp{.sbss}.
11497 Objects may be explicitly put in the small data area with the
11498 @code{section} attribute using one of these sections.
11499
11500 @item -msdata=sdata
11501 @opindex msdata=sdata
11502 Put small global and static data in the small data area, but do not
11503 generate special code to reference them.
11504
11505 @item -msdata=use
11506 @opindex msdata=use
11507 Put small global and static data in the small data area, and generate
11508 special instructions to reference them.
11509
11510 @item -G @var{num}
11511 @opindex G
11512 @cindex smaller data references
11513 Put global and static objects less than or equal to @var{num} bytes
11514 into the small data or bss sections instead of the normal data or bss
11515 sections.  The default value of @var{num} is 8.
11516 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
11517 for this option to have any effect.
11518
11519 All modules should be compiled with the same @option{-G @var{num}} value.
11520 Compiling with different values of @var{num} may or may not work; if it
11521 doesn't the linker will give an error message---incorrect code will not be
11522 generated.
11523
11524 @item -mdebug
11525 @opindex mdebug
11526 Makes the M32R specific code in the compiler display some statistics
11527 that might help in debugging programs.
11528
11529 @item -malign-loops
11530 @opindex malign-loops
11531 Align all loops to a 32-byte boundary.
11532
11533 @item -mno-align-loops
11534 @opindex mno-align-loops
11535 Do not enforce a 32-byte alignment for loops.  This is the default.
11536
11537 @item -missue-rate=@var{number}
11538 @opindex missue-rate=@var{number}
11539 Issue @var{number} instructions per cycle.  @var{number} can only be 1
11540 or 2.
11541
11542 @item -mbranch-cost=@var{number}
11543 @opindex mbranch-cost=@var{number}
11544 @var{number} can only be 1 or 2.  If it is 1 then branches will be
11545 preferred over conditional code, if it is 2, then the opposite will
11546 apply.
11547
11548 @item -mflush-trap=@var{number}
11549 @opindex mflush-trap=@var{number}
11550 Specifies the trap number to use to flush the cache.  The default is
11551 12.  Valid numbers are between 0 and 15 inclusive.
11552
11553 @item -mno-flush-trap
11554 @opindex mno-flush-trap
11555 Specifies that the cache cannot be flushed by using a trap.
11556
11557 @item -mflush-func=@var{name}
11558 @opindex mflush-func=@var{name}
11559 Specifies the name of the operating system function to call to flush
11560 the cache.  The default is @emph{_flush_cache}, but a function call
11561 will only be used if a trap is not available.
11562
11563 @item -mno-flush-func
11564 @opindex mno-flush-func
11565 Indicates that there is no OS function for flushing the cache.
11566
11567 @end table
11568
11569 @node M680x0 Options
11570 @subsection M680x0 Options
11571 @cindex M680x0 options
11572
11573 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
11574 The default settings depend on which architecture was selected when
11575 the compiler was configured; the defaults for the most common choices
11576 are given below.
11577
11578 @table @gcctabopt
11579 @item -march=@var{arch}
11580 @opindex march
11581 Generate code for a specific M680x0 or ColdFire instruction set
11582 architecture.  Permissible values of @var{arch} for M680x0
11583 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
11584 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
11585 architectures are selected according to Freescale's ISA classification
11586 and the permissible values are: @samp{isaa}, @samp{isaaplus},
11587 @samp{isab} and @samp{isac}.
11588
11589 gcc defines a macro @samp{__mcf@var{arch}__} whenever it is generating
11590 code for a ColdFire target.  The @var{arch} in this macro is one of the
11591 @option{-march} arguments given above.
11592
11593 When used together, @option{-march} and @option{-mtune} select code
11594 that runs on a family of similar processors but that is optimized
11595 for a particular microarchitecture.
11596
11597 @item -mcpu=@var{cpu}
11598 @opindex mcpu
11599 Generate code for a specific M680x0 or ColdFire processor.
11600 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
11601 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
11602 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
11603 below, which also classifies the CPUs into families:
11604
11605 @multitable @columnfractions 0.20 0.80
11606 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
11607 @item @samp{51qe} @tab @samp{51qe}
11608 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
11609 @item @samp{5206e} @tab @samp{5206e}
11610 @item @samp{5208} @tab @samp{5207} @samp{5208}
11611 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
11612 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
11613 @item @samp{5216} @tab @samp{5214} @samp{5216}
11614 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
11615 @item @samp{5225} @tab @samp{5224} @samp{5225}
11616 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
11617 @item @samp{5249} @tab @samp{5249}
11618 @item @samp{5250} @tab @samp{5250}
11619 @item @samp{5271} @tab @samp{5270} @samp{5271}
11620 @item @samp{5272} @tab @samp{5272}
11621 @item @samp{5275} @tab @samp{5274} @samp{5275}
11622 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
11623 @item @samp{5307} @tab @samp{5307}
11624 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
11625 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
11626 @item @samp{5407} @tab @samp{5407}
11627 @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}
11628 @end multitable
11629
11630 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
11631 @var{arch} is compatible with @var{cpu}.  Other combinations of
11632 @option{-mcpu} and @option{-march} are rejected.
11633
11634 gcc defines the macro @samp{__mcf_cpu_@var{cpu}} when ColdFire target
11635 @var{cpu} is selected.  It also defines @samp{__mcf_family_@var{family}},
11636 where the value of @var{family} is given by the table above.
11637
11638 @item -mtune=@var{tune}
11639 @opindex mtune
11640 Tune the code for a particular microarchitecture, within the
11641 constraints set by @option{-march} and @option{-mcpu}.
11642 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
11643 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
11644 and @samp{cpu32}.  The ColdFire microarchitectures
11645 are: @samp{cfv1}, @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
11646
11647 You can also use @option{-mtune=68020-40} for code that needs
11648 to run relatively well on 68020, 68030 and 68040 targets.
11649 @option{-mtune=68020-60} is similar but includes 68060 targets
11650 as well.  These two options select the same tuning decisions as
11651 @option{-m68020-40} and @option{-m68020-60} respectively.
11652
11653 gcc defines the macros @samp{__mc@var{arch}} and @samp{__mc@var{arch}__}
11654 when tuning for 680x0 architecture @var{arch}.  It also defines
11655 @samp{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
11656 option is used.  If gcc is tuning for a range of architectures,
11657 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
11658 it defines the macros for every architecture in the range.
11659
11660 gcc also defines the macro @samp{__m@var{uarch}__} when tuning for
11661 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
11662 of the arguments given above.
11663
11664 @item -m68000
11665 @itemx -mc68000
11666 @opindex m68000
11667 @opindex mc68000
11668 Generate output for a 68000.  This is the default
11669 when the compiler is configured for 68000-based systems.
11670 It is equivalent to @option{-march=68000}.
11671
11672 Use this option for microcontrollers with a 68000 or EC000 core,
11673 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
11674
11675 @item -m68010
11676 @opindex m68010
11677 Generate output for a 68010.  This is the default
11678 when the compiler is configured for 68010-based systems.
11679 It is equivalent to @option{-march=68010}.
11680
11681 @item -m68020
11682 @itemx -mc68020
11683 @opindex m68020
11684 @opindex mc68020
11685 Generate output for a 68020.  This is the default
11686 when the compiler is configured for 68020-based systems.
11687 It is equivalent to @option{-march=68020}.
11688
11689 @item -m68030
11690 @opindex m68030
11691 Generate output for a 68030.  This is the default when the compiler is
11692 configured for 68030-based systems.  It is equivalent to
11693 @option{-march=68030}.
11694
11695 @item -m68040
11696 @opindex m68040
11697 Generate output for a 68040.  This is the default when the compiler is
11698 configured for 68040-based systems.  It is equivalent to
11699 @option{-march=68040}.
11700
11701 This option inhibits the use of 68881/68882 instructions that have to be
11702 emulated by software on the 68040.  Use this option if your 68040 does not
11703 have code to emulate those instructions.
11704
11705 @item -m68060
11706 @opindex m68060
11707 Generate output for a 68060.  This is the default when the compiler is
11708 configured for 68060-based systems.  It is equivalent to
11709 @option{-march=68060}.
11710
11711 This option inhibits the use of 68020 and 68881/68882 instructions that
11712 have to be emulated by software on the 68060.  Use this option if your 68060
11713 does not have code to emulate those instructions.
11714
11715 @item -mcpu32
11716 @opindex mcpu32
11717 Generate output for a CPU32.  This is the default
11718 when the compiler is configured for CPU32-based systems.
11719 It is equivalent to @option{-march=cpu32}.
11720
11721 Use this option for microcontrollers with a
11722 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
11723 68336, 68340, 68341, 68349 and 68360.
11724
11725 @item -m5200
11726 @opindex m5200
11727 Generate output for a 520X ColdFire CPU@.  This is the default
11728 when the compiler is configured for 520X-based systems.
11729 It is equivalent to @option{-mcpu=5206}, and is now deprecated
11730 in favor of that option.
11731
11732 Use this option for microcontroller with a 5200 core, including
11733 the MCF5202, MCF5203, MCF5204 and MCF5206.
11734
11735 @item -m5206e
11736 @opindex m5206e
11737 Generate output for a 5206e ColdFire CPU@.  The option is now
11738 deprecated in favor of the equivalent @option{-mcpu=5206e}.
11739
11740 @item -m528x
11741 @opindex m528x
11742 Generate output for a member of the ColdFire 528X family.
11743 The option is now deprecated in favor of the equivalent
11744 @option{-mcpu=528x}.
11745
11746 @item -m5307
11747 @opindex m5307
11748 Generate output for a ColdFire 5307 CPU@.  The option is now deprecated
11749 in favor of the equivalent @option{-mcpu=5307}.
11750
11751 @item -m5407
11752 @opindex m5407
11753 Generate output for a ColdFire 5407 CPU@.  The option is now deprecated
11754 in favor of the equivalent @option{-mcpu=5407}.
11755
11756 @item -mcfv4e
11757 @opindex mcfv4e
11758 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
11759 This includes use of hardware floating point instructions.
11760 The option is equivalent to @option{-mcpu=547x}, and is now
11761 deprecated in favor of that option.
11762
11763 @item -m68020-40
11764 @opindex m68020-40
11765 Generate output for a 68040, without using any of the new instructions.
11766 This results in code which can run relatively efficiently on either a
11767 68020/68881 or a 68030 or a 68040.  The generated code does use the
11768 68881 instructions that are emulated on the 68040.
11769
11770 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
11771
11772 @item -m68020-60
11773 @opindex m68020-60
11774 Generate output for a 68060, without using any of the new instructions.
11775 This results in code which can run relatively efficiently on either a
11776 68020/68881 or a 68030 or a 68040.  The generated code does use the
11777 68881 instructions that are emulated on the 68060.
11778
11779 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
11780
11781 @item -mhard-float
11782 @itemx -m68881
11783 @opindex mhard-float
11784 @opindex m68881
11785 Generate floating-point instructions.  This is the default for 68020
11786 and above, and for ColdFire devices that have an FPU@.  It defines the
11787 macro @samp{__HAVE_68881__} on M680x0 targets and @samp{__mcffpu__}
11788 on ColdFire targets.
11789
11790 @item -msoft-float
11791 @opindex msoft-float
11792 Do not generate floating-point instructions; use library calls instead.
11793 This is the default for 68000, 68010, and 68832 targets.  It is also
11794 the default for ColdFire devices that have no FPU.
11795
11796 @item -mdiv
11797 @itemx -mno-div
11798 @opindex mdiv
11799 @opindex mno-div
11800 Generate (do not generate) ColdFire hardware divide and remainder
11801 instructions.  If @option{-march} is used without @option{-mcpu},
11802 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
11803 architectures.  Otherwise, the default is taken from the target CPU
11804 (either the default CPU, or the one specified by @option{-mcpu}).  For
11805 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
11806 @option{-mcpu=5206e}.
11807
11808 gcc defines the macro @samp{__mcfhwdiv__} when this option is enabled.
11809
11810 @item -mshort
11811 @opindex mshort
11812 Consider type @code{int} to be 16 bits wide, like @code{short int}.
11813 Additionally, parameters passed on the stack are also aligned to a
11814 16-bit boundary even on targets whose API mandates promotion to 32-bit.
11815
11816 @item -mno-short
11817 @opindex mno-short
11818 Do not consider type @code{int} to be 16 bits wide.  This is the default.
11819
11820 @item -mnobitfield
11821 @itemx -mno-bitfield
11822 @opindex mnobitfield
11823 @opindex mno-bitfield
11824 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
11825 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
11826
11827 @item -mbitfield
11828 @opindex mbitfield
11829 Do use the bit-field instructions.  The @option{-m68020} option implies
11830 @option{-mbitfield}.  This is the default if you use a configuration
11831 designed for a 68020.
11832
11833 @item -mrtd
11834 @opindex mrtd
11835 Use a different function-calling convention, in which functions
11836 that take a fixed number of arguments return with the @code{rtd}
11837 instruction, which pops their arguments while returning.  This
11838 saves one instruction in the caller since there is no need to pop
11839 the arguments there.
11840
11841 This calling convention is incompatible with the one normally
11842 used on Unix, so you cannot use it if you need to call libraries
11843 compiled with the Unix compiler.
11844
11845 Also, you must provide function prototypes for all functions that
11846 take variable numbers of arguments (including @code{printf});
11847 otherwise incorrect code will be generated for calls to those
11848 functions.
11849
11850 In addition, seriously incorrect code will result if you call a
11851 function with too many arguments.  (Normally, extra arguments are
11852 harmlessly ignored.)
11853
11854 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
11855 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
11856
11857 @item -mno-rtd
11858 @opindex mno-rtd
11859 Do not use the calling conventions selected by @option{-mrtd}.
11860 This is the default.
11861
11862 @item -malign-int
11863 @itemx -mno-align-int
11864 @opindex malign-int
11865 @opindex mno-align-int
11866 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
11867 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
11868 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
11869 Aligning variables on 32-bit boundaries produces code that runs somewhat
11870 faster on processors with 32-bit busses at the expense of more memory.
11871
11872 @strong{Warning:} if you use the @option{-malign-int} switch, GCC will
11873 align structures containing the above types  differently than
11874 most published application binary interface specifications for the m68k.
11875
11876 @item -mpcrel
11877 @opindex mpcrel
11878 Use the pc-relative addressing mode of the 68000 directly, instead of
11879 using a global offset table.  At present, this option implies @option{-fpic},
11880 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
11881 not presently supported with @option{-mpcrel}, though this could be supported for
11882 68020 and higher processors.
11883
11884 @item -mno-strict-align
11885 @itemx -mstrict-align
11886 @opindex mno-strict-align
11887 @opindex mstrict-align
11888 Do not (do) assume that unaligned memory references will be handled by
11889 the system.
11890
11891 @item -msep-data
11892 Generate code that allows the data segment to be located in a different
11893 area of memory from the text segment.  This allows for execute in place in
11894 an environment without virtual memory management.  This option implies
11895 @option{-fPIC}.
11896
11897 @item -mno-sep-data
11898 Generate code that assumes that the data segment follows the text segment.
11899 This is the default.
11900
11901 @item -mid-shared-library
11902 Generate code that supports shared libraries via the library ID method.
11903 This allows for execute in place and shared libraries in an environment
11904 without virtual memory management.  This option implies @option{-fPIC}.
11905
11906 @item -mno-id-shared-library
11907 Generate code that doesn't assume ID based shared libraries are being used.
11908 This is the default.
11909
11910 @item -mshared-library-id=n
11911 Specified the identification number of the ID based shared library being
11912 compiled.  Specifying a value of 0 will generate more compact code, specifying
11913 other values will force the allocation of that number to the current
11914 library but is no more space or time efficient than omitting this option.
11915
11916 @item -mxgot
11917 @itemx -mno-xgot
11918 @opindex mxgot
11919 @opindex mno-xgot
11920 When generating position-independent code for ColdFire, generate code
11921 that works if the GOT has more than 8192 entries.  This code is
11922 larger and slower than code generated without this option.  On M680x0
11923 processors, this option is not needed; @option{-fPIC} suffices.
11924
11925 GCC normally uses a single instruction to load values from the GOT@.
11926 While this is relatively efficient, it only works if the GOT
11927 is smaller than about 64k.  Anything larger causes the linker
11928 to report an error such as:
11929
11930 @cindex relocation truncated to fit (ColdFire)
11931 @smallexample
11932 relocation truncated to fit: R_68K_GOT16O foobar
11933 @end smallexample
11934
11935 If this happens, you should recompile your code with @option{-mxgot}.
11936 It should then work with very large GOTs.  However, code generated with
11937 @option{-mxgot} is less efficient, since it takes 4 instructions to fetch
11938 the value of a global symbol.
11939
11940 Note that some linkers, including newer versions of the GNU linker,
11941 can create multiple GOTs and sort GOT entries.  If you have such a linker,
11942 you should only need to use @option{-mxgot} when compiling a single
11943 object file that accesses more than 8192 GOT entries.  Very few do.
11944
11945 These options have no effect unless GCC is generating
11946 position-independent code.
11947
11948 @end table
11949
11950 @node M68hc1x Options
11951 @subsection M68hc1x Options
11952 @cindex M68hc1x options
11953
11954 These are the @samp{-m} options defined for the 68hc11 and 68hc12
11955 microcontrollers.  The default values for these options depends on
11956 which style of microcontroller was selected when the compiler was configured;
11957 the defaults for the most common choices are given below.
11958
11959 @table @gcctabopt
11960 @item -m6811
11961 @itemx -m68hc11
11962 @opindex m6811
11963 @opindex m68hc11
11964 Generate output for a 68HC11.  This is the default
11965 when the compiler is configured for 68HC11-based systems.
11966
11967 @item -m6812
11968 @itemx -m68hc12
11969 @opindex m6812
11970 @opindex m68hc12
11971 Generate output for a 68HC12.  This is the default
11972 when the compiler is configured for 68HC12-based systems.
11973
11974 @item -m68S12
11975 @itemx -m68hcs12
11976 @opindex m68S12
11977 @opindex m68hcs12
11978 Generate output for a 68HCS12.
11979
11980 @item -mauto-incdec
11981 @opindex mauto-incdec
11982 Enable the use of 68HC12 pre and post auto-increment and auto-decrement
11983 addressing modes.
11984
11985 @item -minmax
11986 @itemx -nominmax
11987 @opindex minmax
11988 @opindex mnominmax
11989 Enable the use of 68HC12 min and max instructions.
11990
11991 @item -mlong-calls
11992 @itemx -mno-long-calls
11993 @opindex mlong-calls
11994 @opindex mno-long-calls
11995 Treat all calls as being far away (near).  If calls are assumed to be
11996 far away, the compiler will use the @code{call} instruction to
11997 call a function and the @code{rtc} instruction for returning.
11998
11999 @item -mshort
12000 @opindex mshort
12001 Consider type @code{int} to be 16 bits wide, like @code{short int}.
12002
12003 @item -msoft-reg-count=@var{count}
12004 @opindex msoft-reg-count
12005 Specify the number of pseudo-soft registers which are used for the
12006 code generation.  The maximum number is 32.  Using more pseudo-soft
12007 register may or may not result in better code depending on the program.
12008 The default is 4 for 68HC11 and 2 for 68HC12.
12009
12010 @end table
12011
12012 @node MCore Options
12013 @subsection MCore Options
12014 @cindex MCore options
12015
12016 These are the @samp{-m} options defined for the Motorola M*Core
12017 processors.
12018
12019 @table @gcctabopt
12020
12021 @item -mhardlit
12022 @itemx -mno-hardlit
12023 @opindex mhardlit
12024 @opindex mno-hardlit
12025 Inline constants into the code stream if it can be done in two
12026 instructions or less.
12027
12028 @item -mdiv
12029 @itemx -mno-div
12030 @opindex mdiv
12031 @opindex mno-div
12032 Use the divide instruction.  (Enabled by default).
12033
12034 @item -mrelax-immediate
12035 @itemx -mno-relax-immediate
12036 @opindex mrelax-immediate
12037 @opindex mno-relax-immediate
12038 Allow arbitrary sized immediates in bit operations.
12039
12040 @item -mwide-bitfields
12041 @itemx -mno-wide-bitfields
12042 @opindex mwide-bitfields
12043 @opindex mno-wide-bitfields
12044 Always treat bit-fields as int-sized.
12045
12046 @item -m4byte-functions
12047 @itemx -mno-4byte-functions
12048 @opindex m4byte-functions
12049 @opindex mno-4byte-functions
12050 Force all functions to be aligned to a four byte boundary.
12051
12052 @item -mcallgraph-data
12053 @itemx -mno-callgraph-data
12054 @opindex mcallgraph-data
12055 @opindex mno-callgraph-data
12056 Emit callgraph information.
12057
12058 @item -mslow-bytes
12059 @itemx -mno-slow-bytes
12060 @opindex mslow-bytes
12061 @opindex mno-slow-bytes
12062 Prefer word access when reading byte quantities.
12063
12064 @item -mlittle-endian
12065 @itemx -mbig-endian
12066 @opindex mlittle-endian
12067 @opindex mbig-endian
12068 Generate code for a little endian target.
12069
12070 @item -m210
12071 @itemx -m340
12072 @opindex m210
12073 @opindex m340
12074 Generate code for the 210 processor.
12075 @end table
12076
12077 @node MIPS Options
12078 @subsection MIPS Options
12079 @cindex MIPS options
12080
12081 @table @gcctabopt
12082
12083 @item -EB
12084 @opindex EB
12085 Generate big-endian code.
12086
12087 @item -EL
12088 @opindex EL
12089 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
12090 configurations.
12091
12092 @item -march=@var{arch}
12093 @opindex march
12094 Generate code that will run on @var{arch}, which can be the name of a
12095 generic MIPS ISA, or the name of a particular processor.
12096 The ISA names are:
12097 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
12098 @samp{mips32}, @samp{mips32r2}, @samp{mips64} and @samp{mips64r2}.
12099 The processor names are:
12100 @samp{4kc}, @samp{4km}, @samp{4kp}, @samp{4ksc},
12101 @samp{4kec}, @samp{4kem}, @samp{4kep}, @samp{4ksd},
12102 @samp{5kc}, @samp{5kf},
12103 @samp{20kc},
12104 @samp{24kc}, @samp{24kf2_1}, @samp{24kf1_1},
12105 @samp{24kec}, @samp{24kef2_1}, @samp{24kef1_1},
12106 @samp{34kc}, @samp{34kf2_1}, @samp{34kf1_1},
12107 @samp{74kc}, @samp{74kf2_1}, @samp{74kf1_1}, @samp{74kf3_2},
12108 @samp{loongson2e}, @samp{loongson2f},
12109 @samp{m4k},
12110 @samp{octeon},
12111 @samp{orion},
12112 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
12113 @samp{r4600}, @samp{r4650}, @samp{r6000}, @samp{r8000},
12114 @samp{rm7000}, @samp{rm9000},
12115 @samp{sb1},
12116 @samp{sr71000},
12117 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
12118 @samp{vr5000}, @samp{vr5400}, @samp{vr5500}
12119 and @samp{xlr}.
12120 The special value @samp{from-abi} selects the
12121 most compatible architecture for the selected ABI (that is,
12122 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
12123
12124 Native Linux/GNU toolchains also support the value @samp{native},
12125 which selects the best architecture option for the host processor.
12126 @option{-march=native} has no effect if GCC does not recognize
12127 the processor.
12128
12129 In processor names, a final @samp{000} can be abbreviated as @samp{k}
12130 (for example, @samp{-march=r2k}).  Prefixes are optional, and
12131 @samp{vr} may be written @samp{r}.
12132
12133 Names of the form @samp{@var{n}f2_1} refer to processors with
12134 FPUs clocked at half the rate of the core, names of the form
12135 @samp{@var{n}f1_1} refer to processors with FPUs clocked at the same
12136 rate as the core, and names of the form @samp{@var{n}f3_2} refer to
12137 processors with FPUs clocked a ratio of 3:2 with respect to the core.
12138 For compatibility reasons, @samp{@var{n}f} is accepted as a synonym
12139 for @samp{@var{n}f2_1} while @samp{@var{n}x} and @samp{@var{b}fx} are
12140 accepted as synonyms for @samp{@var{n}f1_1}.
12141
12142 GCC defines two macros based on the value of this option.  The first
12143 is @samp{_MIPS_ARCH}, which gives the name of target architecture, as
12144 a string.  The second has the form @samp{_MIPS_ARCH_@var{foo}},
12145 where @var{foo} is the capitalized value of @samp{_MIPS_ARCH}@.
12146 For example, @samp{-march=r2000} will set @samp{_MIPS_ARCH}
12147 to @samp{"r2000"} and define the macro @samp{_MIPS_ARCH_R2000}.
12148
12149 Note that the @samp{_MIPS_ARCH} macro uses the processor names given
12150 above.  In other words, it will have the full prefix and will not
12151 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
12152 the macro names the resolved architecture (either @samp{"mips1"} or
12153 @samp{"mips3"}).  It names the default architecture when no
12154 @option{-march} option is given.
12155
12156 @item -mtune=@var{arch}
12157 @opindex mtune
12158 Optimize for @var{arch}.  Among other things, this option controls
12159 the way instructions are scheduled, and the perceived cost of arithmetic
12160 operations.  The list of @var{arch} values is the same as for
12161 @option{-march}.
12162
12163 When this option is not used, GCC will optimize for the processor
12164 specified by @option{-march}.  By using @option{-march} and
12165 @option{-mtune} together, it is possible to generate code that will
12166 run on a family of processors, but optimize the code for one
12167 particular member of that family.
12168
12169 @samp{-mtune} defines the macros @samp{_MIPS_TUNE} and
12170 @samp{_MIPS_TUNE_@var{foo}}, which work in the same way as the
12171 @samp{-march} ones described above.
12172
12173 @item -mips1
12174 @opindex mips1
12175 Equivalent to @samp{-march=mips1}.
12176
12177 @item -mips2
12178 @opindex mips2
12179 Equivalent to @samp{-march=mips2}.
12180
12181 @item -mips3
12182 @opindex mips3
12183 Equivalent to @samp{-march=mips3}.
12184
12185 @item -mips4
12186 @opindex mips4
12187 Equivalent to @samp{-march=mips4}.
12188
12189 @item -mips32
12190 @opindex mips32
12191 Equivalent to @samp{-march=mips32}.
12192
12193 @item -mips32r2
12194 @opindex mips32r2
12195 Equivalent to @samp{-march=mips32r2}.
12196
12197 @item -mips64
12198 @opindex mips64
12199 Equivalent to @samp{-march=mips64}.
12200
12201 @item -mips64r2
12202 @opindex mips64r2
12203 Equivalent to @samp{-march=mips64r2}.
12204
12205 @item -mips16
12206 @itemx -mno-mips16
12207 @opindex mips16
12208 @opindex mno-mips16
12209 Generate (do not generate) MIPS16 code.  If GCC is targetting a
12210 MIPS32 or MIPS64 architecture, it will make use of the MIPS16e ASE@.
12211
12212 MIPS16 code generation can also be controlled on a per-function basis
12213 by means of @code{mips16} and @code{nomips16} attributes.  
12214 @xref{Function Attributes}, for more information.
12215
12216 @item -mflip-mips16
12217 @opindex mflip-mips16
12218 Generate MIPS16 code on alternating functions.  This option is provided
12219 for regression testing of mixed MIPS16/non-MIPS16 code generation, and is
12220 not intended for ordinary use in compiling user code.
12221
12222 @item -minterlink-mips16
12223 @itemx -mno-interlink-mips16
12224 @opindex minterlink-mips16
12225 @opindex mno-interlink-mips16
12226 Require (do not require) that non-MIPS16 code be link-compatible with
12227 MIPS16 code.
12228
12229 For example, non-MIPS16 code cannot jump directly to MIPS16 code;
12230 it must either use a call or an indirect jump.  @option{-minterlink-mips16}
12231 therefore disables direct jumps unless GCC knows that the target of the
12232 jump is not MIPS16.
12233
12234 @item -mabi=32
12235 @itemx -mabi=o64
12236 @itemx -mabi=n32
12237 @itemx -mabi=64
12238 @itemx -mabi=eabi
12239 @opindex mabi=32
12240 @opindex mabi=o64
12241 @opindex mabi=n32
12242 @opindex mabi=64
12243 @opindex mabi=eabi
12244 Generate code for the given ABI@.
12245
12246 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
12247 generates 64-bit code when you select a 64-bit architecture, but you
12248 can use @option{-mgp32} to get 32-bit code instead.
12249
12250 For information about the O64 ABI, see
12251 @w{@uref{http://gcc.gnu.org/projects/mipso64-abi.html}}.
12252
12253 GCC supports a variant of the o32 ABI in which floating-point registers
12254 are 64 rather than 32 bits wide.  You can select this combination with
12255 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @samp{mthc1}
12256 and @samp{mfhc1} instructions and is therefore only supported for
12257 MIPS32R2 processors.
12258
12259 The register assignments for arguments and return values remain the
12260 same, but each scalar value is passed in a single 64-bit register
12261 rather than a pair of 32-bit registers.  For example, scalar
12262 floating-point values are returned in @samp{$f0} only, not a
12263 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
12264 remains the same, but all 64 bits are saved.
12265
12266 @item -mabicalls
12267 @itemx -mno-abicalls
12268 @opindex mabicalls
12269 @opindex mno-abicalls
12270 Generate (do not generate) code that is suitable for SVR4-style
12271 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
12272 systems.
12273
12274 @item -mshared
12275 @itemx -mno-shared
12276 Generate (do not generate) code that is fully position-independent,
12277 and that can therefore be linked into shared libraries.  This option
12278 only affects @option{-mabicalls}.
12279
12280 All @option{-mabicalls} code has traditionally been position-independent,
12281 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
12282 as an extension, the GNU toolchain allows executables to use absolute
12283 accesses for locally-binding symbols.  It can also use shorter GP
12284 initialization sequences and generate direct calls to locally-defined
12285 functions.  This mode is selected by @option{-mno-shared}.
12286
12287 @option{-mno-shared} depends on binutils 2.16 or higher and generates
12288 objects that can only be linked by the GNU linker.  However, the option
12289 does not affect the ABI of the final executable; it only affects the ABI
12290 of relocatable objects.  Using @option{-mno-shared} will generally make
12291 executables both smaller and quicker.
12292
12293 @option{-mshared} is the default.
12294
12295 @item -mplt
12296 @itemx -mno-plt
12297 @opindex mplt
12298 @opindex mno-plt
12299 Assume (do not assume) that the static and dynamic linkers
12300 support PLTs and copy relocations.  This option only affects
12301 @samp{-mno-shared -mabicalls}.  For the n64 ABI, this option
12302 has no effect without @samp{-msym32}.
12303
12304 You can make @option{-mplt} the default by configuring
12305 GCC with @option{--with-mips-plt}.  The default is
12306 @option{-mno-plt} otherwise.
12307
12308 @item -mxgot
12309 @itemx -mno-xgot
12310 @opindex mxgot
12311 @opindex mno-xgot
12312 Lift (do not lift) the usual restrictions on the size of the global
12313 offset table.
12314
12315 GCC normally uses a single instruction to load values from the GOT@.
12316 While this is relatively efficient, it will only work if the GOT
12317 is smaller than about 64k.  Anything larger will cause the linker
12318 to report an error such as:
12319
12320 @cindex relocation truncated to fit (MIPS)
12321 @smallexample
12322 relocation truncated to fit: R_MIPS_GOT16 foobar
12323 @end smallexample
12324
12325 If this happens, you should recompile your code with @option{-mxgot}.
12326 It should then work with very large GOTs, although it will also be
12327 less efficient, since it will take three instructions to fetch the
12328 value of a global symbol.
12329
12330 Note that some linkers can create multiple GOTs.  If you have such a
12331 linker, you should only need to use @option{-mxgot} when a single object
12332 file accesses more than 64k's worth of GOT entries.  Very few do.
12333
12334 These options have no effect unless GCC is generating position
12335 independent code.
12336
12337 @item -mgp32
12338 @opindex mgp32
12339 Assume that general-purpose registers are 32 bits wide.
12340
12341 @item -mgp64
12342 @opindex mgp64
12343 Assume that general-purpose registers are 64 bits wide.
12344
12345 @item -mfp32
12346 @opindex mfp32
12347 Assume that floating-point registers are 32 bits wide.
12348
12349 @item -mfp64
12350 @opindex mfp64
12351 Assume that floating-point registers are 64 bits wide.
12352
12353 @item -mhard-float
12354 @opindex mhard-float
12355 Use floating-point coprocessor instructions.
12356
12357 @item -msoft-float
12358 @opindex msoft-float
12359 Do not use floating-point coprocessor instructions.  Implement
12360 floating-point calculations using library calls instead.
12361
12362 @item -msingle-float
12363 @opindex msingle-float
12364 Assume that the floating-point coprocessor only supports single-precision
12365 operations.
12366
12367 @item -mdouble-float
12368 @opindex mdouble-float
12369 Assume that the floating-point coprocessor supports double-precision
12370 operations.  This is the default.
12371
12372 @item -mllsc
12373 @itemx -mno-llsc
12374 @opindex mllsc
12375 @opindex mno-llsc
12376 Use (do not use) @samp{ll}, @samp{sc}, and @samp{sync} instructions to
12377 implement atomic memory built-in functions.  When neither option is
12378 specified, GCC will use the instructions if the target architecture
12379 supports them.
12380
12381 @option{-mllsc} is useful if the runtime environment can emulate the
12382 instructions and @option{-mno-llsc} can be useful when compiling for
12383 nonstandard ISAs.  You can make either option the default by
12384 configuring GCC with @option{--with-llsc} and @option{--without-llsc}
12385 respectively.  @option{--with-llsc} is the default for some
12386 configurations; see the installation documentation for details.
12387
12388 @item -mdsp
12389 @itemx -mno-dsp
12390 @opindex mdsp
12391 @opindex mno-dsp
12392 Use (do not use) revision 1 of the MIPS DSP ASE@.
12393 @xref{MIPS DSP Built-in Functions}.  This option defines the
12394 preprocessor macro @samp{__mips_dsp}.  It also defines
12395 @samp{__mips_dsp_rev} to 1.
12396
12397 @item -mdspr2
12398 @itemx -mno-dspr2
12399 @opindex mdspr2
12400 @opindex mno-dspr2
12401 Use (do not use) revision 2 of the MIPS DSP ASE@.
12402 @xref{MIPS DSP Built-in Functions}.  This option defines the
12403 preprocessor macros @samp{__mips_dsp} and @samp{__mips_dspr2}.
12404 It also defines @samp{__mips_dsp_rev} to 2.
12405
12406 @item -msmartmips
12407 @itemx -mno-smartmips
12408 @opindex msmartmips
12409 @opindex mno-smartmips
12410 Use (do not use) the MIPS SmartMIPS ASE.
12411
12412 @item -mpaired-single
12413 @itemx -mno-paired-single
12414 @opindex mpaired-single
12415 @opindex mno-paired-single
12416 Use (do not use) paired-single floating-point instructions.
12417 @xref{MIPS Paired-Single Support}.  This option requires
12418 hardware floating-point support to be enabled.
12419
12420 @item -mdmx
12421 @itemx -mno-mdmx
12422 @opindex mdmx
12423 @opindex mno-mdmx
12424 Use (do not use) MIPS Digital Media Extension instructions.
12425 This option can only be used when generating 64-bit code and requires
12426 hardware floating-point support to be enabled.
12427
12428 @item -mips3d
12429 @itemx -mno-mips3d
12430 @opindex mips3d
12431 @opindex mno-mips3d
12432 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
12433 The option @option{-mips3d} implies @option{-mpaired-single}.
12434
12435 @item -mmt
12436 @itemx -mno-mt
12437 @opindex mmt
12438 @opindex mno-mt
12439 Use (do not use) MT Multithreading instructions.
12440
12441 @item -mlong64
12442 @opindex mlong64
12443 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
12444 an explanation of the default and the way that the pointer size is
12445 determined.
12446
12447 @item -mlong32
12448 @opindex mlong32
12449 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
12450
12451 The default size of @code{int}s, @code{long}s and pointers depends on
12452 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
12453 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
12454 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
12455 or the same size as integer registers, whichever is smaller.
12456
12457 @item -msym32
12458 @itemx -mno-sym32
12459 @opindex msym32
12460 @opindex mno-sym32
12461 Assume (do not assume) that all symbols have 32-bit values, regardless
12462 of the selected ABI@.  This option is useful in combination with
12463 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
12464 to generate shorter and faster references to symbolic addresses.
12465
12466 @item -G @var{num}
12467 @opindex G
12468 Put definitions of externally-visible data in a small data section
12469 if that data is no bigger than @var{num} bytes.  GCC can then access
12470 the data more efficiently; see @option{-mgpopt} for details.
12471
12472 The default @option{-G} option depends on the configuration.
12473
12474 @item -mlocal-sdata
12475 @itemx -mno-local-sdata
12476 @opindex mlocal-sdata
12477 @opindex mno-local-sdata
12478 Extend (do not extend) the @option{-G} behavior to local data too,
12479 such as to static variables in C@.  @option{-mlocal-sdata} is the
12480 default for all configurations.
12481
12482 If the linker complains that an application is using too much small data,
12483 you might want to try rebuilding the less performance-critical parts with
12484 @option{-mno-local-sdata}.  You might also want to build large
12485 libraries with @option{-mno-local-sdata}, so that the libraries leave
12486 more room for the main program.
12487
12488 @item -mextern-sdata
12489 @itemx -mno-extern-sdata
12490 @opindex mextern-sdata
12491 @opindex mno-extern-sdata
12492 Assume (do not assume) that externally-defined data will be in
12493 a small data section if that data is within the @option{-G} limit.
12494 @option{-mextern-sdata} is the default for all configurations.
12495
12496 If you compile a module @var{Mod} with @option{-mextern-sdata} @option{-G
12497 @var{num}} @option{-mgpopt}, and @var{Mod} references a variable @var{Var}
12498 that is no bigger than @var{num} bytes, you must make sure that @var{Var}
12499 is placed in a small data section.  If @var{Var} is defined by another
12500 module, you must either compile that module with a high-enough
12501 @option{-G} setting or attach a @code{section} attribute to @var{Var}'s
12502 definition.  If @var{Var} is common, you must link the application
12503 with a high-enough @option{-G} setting.
12504
12505 The easiest way of satisfying these restrictions is to compile
12506 and link every module with the same @option{-G} option.  However,
12507 you may wish to build a library that supports several different
12508 small data limits.  You can do this by compiling the library with
12509 the highest supported @option{-G} setting and additionally using
12510 @option{-mno-extern-sdata} to stop the library from making assumptions
12511 about externally-defined data.
12512
12513 @item -mgpopt
12514 @itemx -mno-gpopt
12515 @opindex mgpopt
12516 @opindex mno-gpopt
12517 Use (do not use) GP-relative accesses for symbols that are known to be
12518 in a small data section; see @option{-G}, @option{-mlocal-sdata} and
12519 @option{-mextern-sdata}.  @option{-mgpopt} is the default for all
12520 configurations.
12521
12522 @option{-mno-gpopt} is useful for cases where the @code{$gp} register
12523 might not hold the value of @code{_gp}.  For example, if the code is
12524 part of a library that might be used in a boot monitor, programs that
12525 call boot monitor routines will pass an unknown value in @code{$gp}.
12526 (In such situations, the boot monitor itself would usually be compiled
12527 with @option{-G0}.)
12528
12529 @option{-mno-gpopt} implies @option{-mno-local-sdata} and
12530 @option{-mno-extern-sdata}.
12531
12532 @item -membedded-data
12533 @itemx -mno-embedded-data
12534 @opindex membedded-data
12535 @opindex mno-embedded-data
12536 Allocate variables to the read-only data section first if possible, then
12537 next in the small data section if possible, otherwise in data.  This gives
12538 slightly slower code than the default, but reduces the amount of RAM required
12539 when executing, and thus may be preferred for some embedded systems.
12540
12541 @item -muninit-const-in-rodata
12542 @itemx -mno-uninit-const-in-rodata
12543 @opindex muninit-const-in-rodata
12544 @opindex mno-uninit-const-in-rodata
12545 Put uninitialized @code{const} variables in the read-only data section.
12546 This option is only meaningful in conjunction with @option{-membedded-data}.
12547
12548 @item -mcode-readable=@var{setting}
12549 @opindex mcode-readable
12550 Specify whether GCC may generate code that reads from executable sections.
12551 There are three possible settings:
12552
12553 @table @gcctabopt
12554 @item -mcode-readable=yes
12555 Instructions may freely access executable sections.  This is the
12556 default setting.
12557
12558 @item -mcode-readable=pcrel
12559 MIPS16 PC-relative load instructions can access executable sections,
12560 but other instructions must not do so.  This option is useful on 4KSc
12561 and 4KSd processors when the code TLBs have the Read Inhibit bit set.
12562 It is also useful on processors that can be configured to have a dual
12563 instruction/data SRAM interface and that, like the M4K, automatically
12564 redirect PC-relative loads to the instruction RAM.
12565
12566 @item -mcode-readable=no
12567 Instructions must not access executable sections.  This option can be
12568 useful on targets that are configured to have a dual instruction/data
12569 SRAM interface but that (unlike the M4K) do not automatically redirect
12570 PC-relative loads to the instruction RAM.
12571 @end table
12572
12573 @item -msplit-addresses
12574 @itemx -mno-split-addresses
12575 @opindex msplit-addresses
12576 @opindex mno-split-addresses
12577 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
12578 relocation operators.  This option has been superseded by
12579 @option{-mexplicit-relocs} but is retained for backwards compatibility.
12580
12581 @item -mexplicit-relocs
12582 @itemx -mno-explicit-relocs
12583 @opindex mexplicit-relocs
12584 @opindex mno-explicit-relocs
12585 Use (do not use) assembler relocation operators when dealing with symbolic
12586 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
12587 is to use assembler macros instead.
12588
12589 @option{-mexplicit-relocs} is the default if GCC was configured
12590 to use an assembler that supports relocation operators.
12591
12592 @item -mcheck-zero-division
12593 @itemx -mno-check-zero-division
12594 @opindex mcheck-zero-division
12595 @opindex mno-check-zero-division
12596 Trap (do not trap) on integer division by zero.
12597
12598 The default is @option{-mcheck-zero-division}.
12599
12600 @item -mdivide-traps
12601 @itemx -mdivide-breaks
12602 @opindex mdivide-traps
12603 @opindex mdivide-breaks
12604 MIPS systems check for division by zero by generating either a
12605 conditional trap or a break instruction.  Using traps results in
12606 smaller code, but is only supported on MIPS II and later.  Also, some
12607 versions of the Linux kernel have a bug that prevents trap from
12608 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
12609 allow conditional traps on architectures that support them and
12610 @option{-mdivide-breaks} to force the use of breaks.
12611
12612 The default is usually @option{-mdivide-traps}, but this can be
12613 overridden at configure time using @option{--with-divide=breaks}.
12614 Divide-by-zero checks can be completely disabled using
12615 @option{-mno-check-zero-division}.
12616
12617 @item -mmemcpy
12618 @itemx -mno-memcpy
12619 @opindex mmemcpy
12620 @opindex mno-memcpy
12621 Force (do not force) the use of @code{memcpy()} for non-trivial block
12622 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
12623 most constant-sized copies.
12624
12625 @item -mlong-calls
12626 @itemx -mno-long-calls
12627 @opindex mlong-calls
12628 @opindex mno-long-calls
12629 Disable (do not disable) use of the @code{jal} instruction.  Calling
12630 functions using @code{jal} is more efficient but requires the caller
12631 and callee to be in the same 256 megabyte segment.
12632
12633 This option has no effect on abicalls code.  The default is
12634 @option{-mno-long-calls}.
12635
12636 @item -mmad
12637 @itemx -mno-mad
12638 @opindex mmad
12639 @opindex mno-mad
12640 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
12641 instructions, as provided by the R4650 ISA@.
12642
12643 @item -mfused-madd
12644 @itemx -mno-fused-madd
12645 @opindex mfused-madd
12646 @opindex mno-fused-madd
12647 Enable (disable) use of the floating point multiply-accumulate
12648 instructions, when they are available.  The default is
12649 @option{-mfused-madd}.
12650
12651 When multiply-accumulate instructions are used, the intermediate
12652 product is calculated to infinite precision and is not subject to
12653 the FCSR Flush to Zero bit.  This may be undesirable in some
12654 circumstances.
12655
12656 @item -nocpp
12657 @opindex nocpp
12658 Tell the MIPS assembler to not run its preprocessor over user
12659 assembler files (with a @samp{.s} suffix) when assembling them.
12660
12661 @item -mfix-r4000
12662 @itemx -mno-fix-r4000
12663 @opindex mfix-r4000
12664 @opindex mno-fix-r4000
12665 Work around certain R4000 CPU errata:
12666 @itemize @minus
12667 @item
12668 A double-word or a variable shift may give an incorrect result if executed
12669 immediately after starting an integer division.
12670 @item
12671 A double-word or a variable shift may give an incorrect result if executed
12672 while an integer multiplication is in progress.
12673 @item
12674 An integer division may give an incorrect result if started in a delay slot
12675 of a taken branch or a jump.
12676 @end itemize
12677
12678 @item -mfix-r4400
12679 @itemx -mno-fix-r4400
12680 @opindex mfix-r4400
12681 @opindex mno-fix-r4400
12682 Work around certain R4400 CPU errata:
12683 @itemize @minus
12684 @item
12685 A double-word or a variable shift may give an incorrect result if executed
12686 immediately after starting an integer division.
12687 @end itemize
12688
12689 @item -mfix-vr4120
12690 @itemx -mno-fix-vr4120
12691 @opindex mfix-vr4120
12692 Work around certain VR4120 errata:
12693 @itemize @minus
12694 @item
12695 @code{dmultu} does not always produce the correct result.
12696 @item
12697 @code{div} and @code{ddiv} do not always produce the correct result if one
12698 of the operands is negative.
12699 @end itemize
12700 The workarounds for the division errata rely on special functions in
12701 @file{libgcc.a}.  At present, these functions are only provided by
12702 the @code{mips64vr*-elf} configurations.
12703
12704 Other VR4120 errata require a nop to be inserted between certain pairs of
12705 instructions.  These errata are handled by the assembler, not by GCC itself.
12706
12707 @item -mfix-vr4130
12708 @opindex mfix-vr4130
12709 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
12710 workarounds are implemented by the assembler rather than by GCC,
12711 although GCC will avoid using @code{mflo} and @code{mfhi} if the
12712 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
12713 instructions are available instead.
12714
12715 @item -mfix-sb1
12716 @itemx -mno-fix-sb1
12717 @opindex mfix-sb1
12718 Work around certain SB-1 CPU core errata.
12719 (This flag currently works around the SB-1 revision 2
12720 ``F1'' and ``F2'' floating point errata.)
12721
12722 @item -mflush-func=@var{func}
12723 @itemx -mno-flush-func
12724 @opindex mflush-func
12725 Specifies the function to call to flush the I and D caches, or to not
12726 call any such function.  If called, the function must take the same
12727 arguments as the common @code{_flush_func()}, that is, the address of the
12728 memory range for which the cache is being flushed, the size of the
12729 memory range, and the number 3 (to flush both caches).  The default
12730 depends on the target GCC was configured for, but commonly is either
12731 @samp{_flush_func} or @samp{__cpu_flush}.
12732
12733 @item mbranch-cost=@var{num}
12734 @opindex mbranch-cost
12735 Set the cost of branches to roughly @var{num} ``simple'' instructions.
12736 This cost is only a heuristic and is not guaranteed to produce
12737 consistent results across releases.  A zero cost redundantly selects
12738 the default, which is based on the @option{-mtune} setting.
12739
12740 @item -mbranch-likely
12741 @itemx -mno-branch-likely
12742 @opindex mbranch-likely
12743 @opindex mno-branch-likely
12744 Enable or disable use of Branch Likely instructions, regardless of the
12745 default for the selected architecture.  By default, Branch Likely
12746 instructions may be generated if they are supported by the selected
12747 architecture.  An exception is for the MIPS32 and MIPS64 architectures
12748 and processors which implement those architectures; for those, Branch
12749 Likely instructions will not be generated by default because the MIPS32
12750 and MIPS64 architectures specifically deprecate their use.
12751
12752 @item -mfp-exceptions
12753 @itemx -mno-fp-exceptions
12754 @opindex mfp-exceptions
12755 Specifies whether FP exceptions are enabled.  This affects how we schedule
12756 FP instructions for some processors.  The default is that FP exceptions are
12757 enabled.
12758
12759 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
12760 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
12761 FP pipe.
12762
12763 @item -mvr4130-align
12764 @itemx -mno-vr4130-align
12765 @opindex mvr4130-align
12766 The VR4130 pipeline is two-way superscalar, but can only issue two
12767 instructions together if the first one is 8-byte aligned.  When this
12768 option is enabled, GCC will align pairs of instructions that it
12769 thinks should execute in parallel.
12770
12771 This option only has an effect when optimizing for the VR4130.
12772 It normally makes code faster, but at the expense of making it bigger.
12773 It is enabled by default at optimization level @option{-O3}.
12774 @end table
12775
12776 @node MMIX Options
12777 @subsection MMIX Options
12778 @cindex MMIX Options
12779
12780 These options are defined for the MMIX:
12781
12782 @table @gcctabopt
12783 @item -mlibfuncs
12784 @itemx -mno-libfuncs
12785 @opindex mlibfuncs
12786 @opindex mno-libfuncs
12787 Specify that intrinsic library functions are being compiled, passing all
12788 values in registers, no matter the size.
12789
12790 @item -mepsilon
12791 @itemx -mno-epsilon
12792 @opindex mepsilon
12793 @opindex mno-epsilon
12794 Generate floating-point comparison instructions that compare with respect
12795 to the @code{rE} epsilon register.
12796
12797 @item -mabi=mmixware
12798 @itemx -mabi=gnu
12799 @opindex mabi-mmixware
12800 @opindex mabi=gnu
12801 Generate code that passes function parameters and return values that (in
12802 the called function) are seen as registers @code{$0} and up, as opposed to
12803 the GNU ABI which uses global registers @code{$231} and up.
12804
12805 @item -mzero-extend
12806 @itemx -mno-zero-extend
12807 @opindex mzero-extend
12808 @opindex mno-zero-extend
12809 When reading data from memory in sizes shorter than 64 bits, use (do not
12810 use) zero-extending load instructions by default, rather than
12811 sign-extending ones.
12812
12813 @item -mknuthdiv
12814 @itemx -mno-knuthdiv
12815 @opindex mknuthdiv
12816 @opindex mno-knuthdiv
12817 Make the result of a division yielding a remainder have the same sign as
12818 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
12819 remainder follows the sign of the dividend.  Both methods are
12820 arithmetically valid, the latter being almost exclusively used.
12821
12822 @item -mtoplevel-symbols
12823 @itemx -mno-toplevel-symbols
12824 @opindex mtoplevel-symbols
12825 @opindex mno-toplevel-symbols
12826 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
12827 code can be used with the @code{PREFIX} assembly directive.
12828
12829 @item -melf
12830 @opindex melf
12831 Generate an executable in the ELF format, rather than the default
12832 @samp{mmo} format used by the @command{mmix} simulator.
12833
12834 @item -mbranch-predict
12835 @itemx -mno-branch-predict
12836 @opindex mbranch-predict
12837 @opindex mno-branch-predict
12838 Use (do not use) the probable-branch instructions, when static branch
12839 prediction indicates a probable branch.
12840
12841 @item -mbase-addresses
12842 @itemx -mno-base-addresses
12843 @opindex mbase-addresses
12844 @opindex mno-base-addresses
12845 Generate (do not generate) code that uses @emph{base addresses}.  Using a
12846 base address automatically generates a request (handled by the assembler
12847 and the linker) for a constant to be set up in a global register.  The
12848 register is used for one or more base address requests within the range 0
12849 to 255 from the value held in the register.  The generally leads to short
12850 and fast code, but the number of different data items that can be
12851 addressed is limited.  This means that a program that uses lots of static
12852 data may require @option{-mno-base-addresses}.
12853
12854 @item -msingle-exit
12855 @itemx -mno-single-exit
12856 @opindex msingle-exit
12857 @opindex mno-single-exit
12858 Force (do not force) generated code to have a single exit point in each
12859 function.
12860 @end table
12861
12862 @node MN10300 Options
12863 @subsection MN10300 Options
12864 @cindex MN10300 options
12865
12866 These @option{-m} options are defined for Matsushita MN10300 architectures:
12867
12868 @table @gcctabopt
12869 @item -mmult-bug
12870 @opindex mmult-bug
12871 Generate code to avoid bugs in the multiply instructions for the MN10300
12872 processors.  This is the default.
12873
12874 @item -mno-mult-bug
12875 @opindex mno-mult-bug
12876 Do not generate code to avoid bugs in the multiply instructions for the
12877 MN10300 processors.
12878
12879 @item -mam33
12880 @opindex mam33
12881 Generate code which uses features specific to the AM33 processor.
12882
12883 @item -mno-am33
12884 @opindex mno-am33
12885 Do not generate code which uses features specific to the AM33 processor.  This
12886 is the default.
12887
12888 @item -mreturn-pointer-on-d0
12889 @opindex mreturn-pointer-on-d0
12890 When generating a function which returns a pointer, return the pointer
12891 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
12892 only in a0, and attempts to call such functions without a prototype
12893 would result in errors.  Note that this option is on by default; use
12894 @option{-mno-return-pointer-on-d0} to disable it.
12895
12896 @item -mno-crt0
12897 @opindex mno-crt0
12898 Do not link in the C run-time initialization object file.
12899
12900 @item -mrelax
12901 @opindex mrelax
12902 Indicate to the linker that it should perform a relaxation optimization pass
12903 to shorten branches, calls and absolute memory addresses.  This option only
12904 has an effect when used on the command line for the final link step.
12905
12906 This option makes symbolic debugging impossible.
12907 @end table
12908
12909 @node PDP-11 Options
12910 @subsection PDP-11 Options
12911 @cindex PDP-11 Options
12912
12913 These options are defined for the PDP-11:
12914
12915 @table @gcctabopt
12916 @item -mfpu
12917 @opindex mfpu
12918 Use hardware FPP floating point.  This is the default.  (FIS floating
12919 point on the PDP-11/40 is not supported.)
12920
12921 @item -msoft-float
12922 @opindex msoft-float
12923 Do not use hardware floating point.
12924
12925 @item -mac0
12926 @opindex mac0
12927 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
12928
12929 @item -mno-ac0
12930 @opindex mno-ac0
12931 Return floating-point results in memory.  This is the default.
12932
12933 @item -m40
12934 @opindex m40
12935 Generate code for a PDP-11/40.
12936
12937 @item -m45
12938 @opindex m45
12939 Generate code for a PDP-11/45.  This is the default.
12940
12941 @item -m10
12942 @opindex m10
12943 Generate code for a PDP-11/10.
12944
12945 @item -mbcopy-builtin
12946 @opindex bcopy-builtin
12947 Use inline @code{movmemhi} patterns for copying memory.  This is the
12948 default.
12949
12950 @item -mbcopy
12951 @opindex mbcopy
12952 Do not use inline @code{movmemhi} patterns for copying memory.
12953
12954 @item -mint16
12955 @itemx -mno-int32
12956 @opindex mint16
12957 @opindex mno-int32
12958 Use 16-bit @code{int}.  This is the default.
12959
12960 @item -mint32
12961 @itemx -mno-int16
12962 @opindex mint32
12963 @opindex mno-int16
12964 Use 32-bit @code{int}.
12965
12966 @item -mfloat64
12967 @itemx -mno-float32
12968 @opindex mfloat64
12969 @opindex mno-float32
12970 Use 64-bit @code{float}.  This is the default.
12971
12972 @item -mfloat32
12973 @itemx -mno-float64
12974 @opindex mfloat32
12975 @opindex mno-float64
12976 Use 32-bit @code{float}.
12977
12978 @item -mabshi
12979 @opindex mabshi
12980 Use @code{abshi2} pattern.  This is the default.
12981
12982 @item -mno-abshi
12983 @opindex mno-abshi
12984 Do not use @code{abshi2} pattern.
12985
12986 @item -mbranch-expensive
12987 @opindex mbranch-expensive
12988 Pretend that branches are expensive.  This is for experimenting with
12989 code generation only.
12990
12991 @item -mbranch-cheap
12992 @opindex mbranch-cheap
12993 Do not pretend that branches are expensive.  This is the default.
12994
12995 @item -msplit
12996 @opindex msplit
12997 Generate code for a system with split I&D@.
12998
12999 @item -mno-split
13000 @opindex mno-split
13001 Generate code for a system without split I&D@.  This is the default.
13002
13003 @item -munix-asm
13004 @opindex munix-asm
13005 Use Unix assembler syntax.  This is the default when configured for
13006 @samp{pdp11-*-bsd}.
13007
13008 @item -mdec-asm
13009 @opindex mdec-asm
13010 Use DEC assembler syntax.  This is the default when configured for any
13011 PDP-11 target other than @samp{pdp11-*-bsd}.
13012 @end table
13013
13014 @node PowerPC Options
13015 @subsection PowerPC Options
13016 @cindex PowerPC options
13017
13018 These are listed under @xref{RS/6000 and PowerPC Options}.
13019
13020 @node RS/6000 and PowerPC Options
13021 @subsection IBM RS/6000 and PowerPC Options
13022 @cindex RS/6000 and PowerPC Options
13023 @cindex IBM RS/6000 and PowerPC Options
13024
13025 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
13026 @table @gcctabopt
13027 @item -mpower
13028 @itemx -mno-power
13029 @itemx -mpower2
13030 @itemx -mno-power2
13031 @itemx -mpowerpc
13032 @itemx -mno-powerpc
13033 @itemx -mpowerpc-gpopt
13034 @itemx -mno-powerpc-gpopt
13035 @itemx -mpowerpc-gfxopt
13036 @itemx -mno-powerpc-gfxopt
13037 @itemx -mpowerpc64
13038 @itemx -mno-powerpc64
13039 @itemx -mmfcrf
13040 @itemx -mno-mfcrf
13041 @itemx -mpopcntb
13042 @itemx -mno-popcntb
13043 @itemx -mfprnd
13044 @itemx -mno-fprnd
13045 @itemx -mcmpb
13046 @itemx -mno-cmpb
13047 @itemx -mmfpgpr
13048 @itemx -mno-mfpgpr
13049 @itemx -mhard-dfp
13050 @itemx -mno-hard-dfp
13051 @opindex mpower
13052 @opindex mno-power
13053 @opindex mpower2
13054 @opindex mno-power2
13055 @opindex mpowerpc
13056 @opindex mno-powerpc
13057 @opindex mpowerpc-gpopt
13058 @opindex mno-powerpc-gpopt
13059 @opindex mpowerpc-gfxopt
13060 @opindex mno-powerpc-gfxopt
13061 @opindex mpowerpc64
13062 @opindex mno-powerpc64
13063 @opindex mmfcrf
13064 @opindex mno-mfcrf
13065 @opindex mpopcntb
13066 @opindex mno-popcntb
13067 @opindex mfprnd
13068 @opindex mno-fprnd
13069 @opindex mcmpb
13070 @opindex mno-cmpb
13071 @opindex mmfpgpr
13072 @opindex mno-mfpgpr
13073 @opindex mhard-dfp
13074 @opindex mno-hard-dfp
13075 GCC supports two related instruction set architectures for the
13076 RS/6000 and PowerPC@.  The @dfn{POWER} instruction set are those
13077 instructions supported by the @samp{rios} chip set used in the original
13078 RS/6000 systems and the @dfn{PowerPC} instruction set is the
13079 architecture of the Freescale MPC5xx, MPC6xx, MPC8xx microprocessors, and
13080 the IBM 4xx, 6xx, and follow-on microprocessors.
13081
13082 Neither architecture is a subset of the other.  However there is a
13083 large common subset of instructions supported by both.  An MQ
13084 register is included in processors supporting the POWER architecture.
13085
13086 You use these options to specify which instructions are available on the
13087 processor you are using.  The default value of these options is
13088 determined when configuring GCC@.  Specifying the
13089 @option{-mcpu=@var{cpu_type}} overrides the specification of these
13090 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
13091 rather than the options listed above.
13092
13093 The @option{-mpower} option allows GCC to generate instructions that
13094 are found only in the POWER architecture and to use the MQ register.
13095 Specifying @option{-mpower2} implies @option{-power} and also allows GCC
13096 to generate instructions that are present in the POWER2 architecture but
13097 not the original POWER architecture.
13098
13099 The @option{-mpowerpc} option allows GCC to generate instructions that
13100 are found only in the 32-bit subset of the PowerPC architecture.
13101 Specifying @option{-mpowerpc-gpopt} implies @option{-mpowerpc} and also allows
13102 GCC to use the optional PowerPC architecture instructions in the
13103 General Purpose group, including floating-point square root.  Specifying
13104 @option{-mpowerpc-gfxopt} implies @option{-mpowerpc} and also allows GCC to
13105 use the optional PowerPC architecture instructions in the Graphics
13106 group, including floating-point select.
13107
13108 The @option{-mmfcrf} option allows GCC to generate the move from
13109 condition register field instruction implemented on the POWER4
13110 processor and other processors that support the PowerPC V2.01
13111 architecture.
13112 The @option{-mpopcntb} option allows GCC to generate the popcount and
13113 double precision FP reciprocal estimate instruction implemented on the
13114 POWER5 processor and other processors that support the PowerPC V2.02
13115 architecture.
13116 The @option{-mfprnd} option allows GCC to generate the FP round to
13117 integer instructions implemented on the POWER5+ processor and other
13118 processors that support the PowerPC V2.03 architecture.
13119 The @option{-mcmpb} option allows GCC to generate the compare bytes
13120 instruction implemented on the POWER6 processor and other processors
13121 that support the PowerPC V2.05 architecture.
13122 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
13123 general purpose register instructions implemented on the POWER6X
13124 processor and other processors that support the extended PowerPC V2.05
13125 architecture.
13126 The @option{-mhard-dfp} option allows GCC to generate the decimal floating
13127 point instructions implemented on some POWER processors.
13128
13129 The @option{-mpowerpc64} option allows GCC to generate the additional
13130 64-bit instructions that are found in the full PowerPC64 architecture
13131 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
13132 @option{-mno-powerpc64}.
13133
13134 If you specify both @option{-mno-power} and @option{-mno-powerpc}, GCC
13135 will use only the instructions in the common subset of both
13136 architectures plus some special AIX common-mode calls, and will not use
13137 the MQ register.  Specifying both @option{-mpower} and @option{-mpowerpc}
13138 permits GCC to use any instruction from either architecture and to
13139 allow use of the MQ register; specify this for the Motorola MPC601.
13140
13141 @item -mnew-mnemonics
13142 @itemx -mold-mnemonics
13143 @opindex mnew-mnemonics
13144 @opindex mold-mnemonics
13145 Select which mnemonics to use in the generated assembler code.  With
13146 @option{-mnew-mnemonics}, GCC uses the assembler mnemonics defined for
13147 the PowerPC architecture.  With @option{-mold-mnemonics} it uses the
13148 assembler mnemonics defined for the POWER architecture.  Instructions
13149 defined in only one architecture have only one mnemonic; GCC uses that
13150 mnemonic irrespective of which of these options is specified.
13151
13152 GCC defaults to the mnemonics appropriate for the architecture in
13153 use.  Specifying @option{-mcpu=@var{cpu_type}} sometimes overrides the
13154 value of these option.  Unless you are building a cross-compiler, you
13155 should normally not specify either @option{-mnew-mnemonics} or
13156 @option{-mold-mnemonics}, but should instead accept the default.
13157
13158 @item -mcpu=@var{cpu_type}
13159 @opindex mcpu
13160 Set architecture type, register usage, choice of mnemonics, and
13161 instruction scheduling parameters for machine type @var{cpu_type}.
13162 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
13163 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{464}, @samp{464fp},
13164 @samp{505}, @samp{601}, @samp{602}, @samp{603}, @samp{603e}, @samp{604},
13165 @samp{604e}, @samp{620}, @samp{630}, @samp{740}, @samp{7400},
13166 @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
13167 @samp{860}, @samp{970}, @samp{8540}, @samp{e300c2}, @samp{e300c3},
13168 @samp{e500mc}, @samp{ec603e}, @samp{G3}, @samp{G4}, @samp{G5},
13169 @samp{power}, @samp{power2}, @samp{power3}, @samp{power4},
13170 @samp{power5}, @samp{power5+}, @samp{power6}, @samp{power6x}, @samp{power7}
13171 @samp{common}, @samp{powerpc}, @samp{powerpc64}, @samp{rios},
13172 @samp{rios1}, @samp{rios2}, @samp{rsc}, and @samp{rs64}.
13173
13174 @option{-mcpu=common} selects a completely generic processor.  Code
13175 generated under this option will run on any POWER or PowerPC processor.
13176 GCC will use only the instructions in the common subset of both
13177 architectures, and will not use the MQ register.  GCC assumes a generic
13178 processor model for scheduling purposes.
13179
13180 @option{-mcpu=power}, @option{-mcpu=power2}, @option{-mcpu=powerpc}, and
13181 @option{-mcpu=powerpc64} specify generic POWER, POWER2, pure 32-bit
13182 PowerPC (i.e., not MPC601), and 64-bit PowerPC architecture machine
13183 types, with an appropriate, generic processor model assumed for
13184 scheduling purposes.
13185
13186 The other options specify a specific processor.  Code generated under
13187 those options will run best on that processor, and may not run at all on
13188 others.
13189
13190 The @option{-mcpu} options automatically enable or disable the
13191 following options:
13192
13193 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
13194 -mnew-mnemonics  -mpopcntb  -mpower  -mpower2  -mpowerpc64 @gol
13195 -mpowerpc-gpopt  -mpowerpc-gfxopt  -mstring  -mmulhw  -mdlmzb  -mmfpgpr}
13196
13197 The particular options set for any particular CPU will vary between
13198 compiler versions, depending on what setting seems to produce optimal
13199 code for that CPU; it doesn't necessarily reflect the actual hardware's
13200 capabilities.  If you wish to set an individual option to a particular
13201 value, you may specify it after the @option{-mcpu} option, like
13202 @samp{-mcpu=970 -mno-altivec}.
13203
13204 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
13205 not enabled or disabled by the @option{-mcpu} option at present because
13206 AIX does not have full support for these options.  You may still
13207 enable or disable them individually if you're sure it'll work in your
13208 environment.
13209
13210 @item -mtune=@var{cpu_type}
13211 @opindex mtune
13212 Set the instruction scheduling parameters for machine type
13213 @var{cpu_type}, but do not set the architecture type, register usage, or
13214 choice of mnemonics, as @option{-mcpu=@var{cpu_type}} would.  The same
13215 values for @var{cpu_type} are used for @option{-mtune} as for
13216 @option{-mcpu}.  If both are specified, the code generated will use the
13217 architecture, registers, and mnemonics set by @option{-mcpu}, but the
13218 scheduling parameters set by @option{-mtune}.
13219
13220 @item -mswdiv
13221 @itemx -mno-swdiv
13222 @opindex mswdiv
13223 @opindex mno-swdiv
13224 Generate code to compute division as reciprocal estimate and iterative
13225 refinement, creating opportunities for increased throughput.  This
13226 feature requires: optional PowerPC Graphics instruction set for single
13227 precision and FRE instruction for double precision, assuming divides
13228 cannot generate user-visible traps, and the domain values not include
13229 Infinities, denormals or zero denominator.
13230
13231 @item -maltivec
13232 @itemx -mno-altivec
13233 @opindex maltivec
13234 @opindex mno-altivec
13235 Generate code that uses (does not use) AltiVec instructions, and also
13236 enable the use of built-in functions that allow more direct access to
13237 the AltiVec instruction set.  You may also need to set
13238 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
13239 enhancements.
13240
13241 @item -mvrsave
13242 @itemx -mno-vrsave
13243 @opindex mvrsave
13244 @opindex mno-vrsave
13245 Generate VRSAVE instructions when generating AltiVec code.
13246
13247 @item -msecure-plt
13248 @opindex msecure-plt
13249 Generate code that allows ld and ld.so to build executables and shared
13250 libraries with non-exec .plt and .got sections.  This is a PowerPC
13251 32-bit SYSV ABI option.
13252
13253 @item -mbss-plt
13254 @opindex mbss-plt
13255 Generate code that uses a BSS .plt section that ld.so fills in, and
13256 requires .plt and .got sections that are both writable and executable.
13257 This is a PowerPC 32-bit SYSV ABI option.
13258
13259 @item -misel
13260 @itemx -mno-isel
13261 @opindex misel
13262 @opindex mno-isel
13263 This switch enables or disables the generation of ISEL instructions.
13264
13265 @item -misel=@var{yes/no}
13266 This switch has been deprecated.  Use @option{-misel} and
13267 @option{-mno-isel} instead.
13268
13269 @item -mspe
13270 @itemx -mno-spe
13271 @opindex mspe
13272 @opindex mno-spe
13273 This switch enables or disables the generation of SPE simd
13274 instructions.
13275
13276 @item -mpaired
13277 @itemx -mno-paired
13278 @opindex mpaired
13279 @opindex mno-paired
13280 This switch enables or disables the generation of PAIRED simd
13281 instructions.
13282
13283 @item -mspe=@var{yes/no}
13284 This option has been deprecated.  Use @option{-mspe} and
13285 @option{-mno-spe} instead.
13286
13287 @item -mfloat-gprs=@var{yes/single/double/no}
13288 @itemx -mfloat-gprs
13289 @opindex mfloat-gprs
13290 This switch enables or disables the generation of floating point
13291 operations on the general purpose registers for architectures that
13292 support it.
13293
13294 The argument @var{yes} or @var{single} enables the use of
13295 single-precision floating point operations.
13296
13297 The argument @var{double} enables the use of single and
13298 double-precision floating point operations.
13299
13300 The argument @var{no} disables floating point operations on the
13301 general purpose registers.
13302
13303 This option is currently only available on the MPC854x.
13304
13305 @item -m32
13306 @itemx -m64
13307 @opindex m32
13308 @opindex m64
13309 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
13310 targets (including GNU/Linux).  The 32-bit environment sets int, long
13311 and pointer to 32 bits and generates code that runs on any PowerPC
13312 variant.  The 64-bit environment sets int to 32 bits and long and
13313 pointer to 64 bits, and generates code for PowerPC64, as for
13314 @option{-mpowerpc64}.
13315
13316 @item -mfull-toc
13317 @itemx -mno-fp-in-toc
13318 @itemx -mno-sum-in-toc
13319 @itemx -mminimal-toc
13320 @opindex mfull-toc
13321 @opindex mno-fp-in-toc
13322 @opindex mno-sum-in-toc
13323 @opindex mminimal-toc
13324 Modify generation of the TOC (Table Of Contents), which is created for
13325 every executable file.  The @option{-mfull-toc} option is selected by
13326 default.  In that case, GCC will allocate at least one TOC entry for
13327 each unique non-automatic variable reference in your program.  GCC
13328 will also place floating-point constants in the TOC@.  However, only
13329 16,384 entries are available in the TOC@.
13330
13331 If you receive a linker error message that saying you have overflowed
13332 the available TOC space, you can reduce the amount of TOC space used
13333 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
13334 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
13335 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
13336 generate code to calculate the sum of an address and a constant at
13337 run-time instead of putting that sum into the TOC@.  You may specify one
13338 or both of these options.  Each causes GCC to produce very slightly
13339 slower and larger code at the expense of conserving TOC space.
13340
13341 If you still run out of space in the TOC even when you specify both of
13342 these options, specify @option{-mminimal-toc} instead.  This option causes
13343 GCC to make only one TOC entry for every file.  When you specify this
13344 option, GCC will produce code that is slower and larger but which
13345 uses extremely little TOC space.  You may wish to use this option
13346 only on files that contain less frequently executed code.
13347
13348 @item -maix64
13349 @itemx -maix32
13350 @opindex maix64
13351 @opindex maix32
13352 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
13353 @code{long} type, and the infrastructure needed to support them.
13354 Specifying @option{-maix64} implies @option{-mpowerpc64} and
13355 @option{-mpowerpc}, while @option{-maix32} disables the 64-bit ABI and
13356 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
13357
13358 @item -mxl-compat
13359 @itemx -mno-xl-compat
13360 @opindex mxl-compat
13361 @opindex mno-xl-compat
13362 Produce code that conforms more closely to IBM XL compiler semantics
13363 when using AIX-compatible ABI@.  Pass floating-point arguments to
13364 prototyped functions beyond the register save area (RSA) on the stack
13365 in addition to argument FPRs.  Do not assume that most significant
13366 double in 128-bit long double value is properly rounded when comparing
13367 values and converting to double.  Use XL symbol names for long double
13368 support routines.
13369
13370 The AIX calling convention was extended but not initially documented to
13371 handle an obscure K&R C case of calling a function that takes the
13372 address of its arguments with fewer arguments than declared.  IBM XL
13373 compilers access floating point arguments which do not fit in the
13374 RSA from the stack when a subroutine is compiled without
13375 optimization.  Because always storing floating-point arguments on the
13376 stack is inefficient and rarely needed, this option is not enabled by
13377 default and only is necessary when calling subroutines compiled by IBM
13378 XL compilers without optimization.
13379
13380 @item -mpe
13381 @opindex mpe
13382 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
13383 application written to use message passing with special startup code to
13384 enable the application to run.  The system must have PE installed in the
13385 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
13386 must be overridden with the @option{-specs=} option to specify the
13387 appropriate directory location.  The Parallel Environment does not
13388 support threads, so the @option{-mpe} option and the @option{-pthread}
13389 option are incompatible.
13390
13391 @item -malign-natural
13392 @itemx -malign-power
13393 @opindex malign-natural
13394 @opindex malign-power
13395 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
13396 @option{-malign-natural} overrides the ABI-defined alignment of larger
13397 types, such as floating-point doubles, on their natural size-based boundary.
13398 The option @option{-malign-power} instructs GCC to follow the ABI-specified
13399 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
13400
13401 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
13402 is not supported.
13403
13404 @item -msoft-float
13405 @itemx -mhard-float
13406 @opindex msoft-float
13407 @opindex mhard-float
13408 Generate code that does not use (uses) the floating-point register set.
13409 Software floating point emulation is provided if you use the
13410 @option{-msoft-float} option, and pass the option to GCC when linking.
13411
13412 @item -mmultiple
13413 @itemx -mno-multiple
13414 @opindex mmultiple
13415 @opindex mno-multiple
13416 Generate code that uses (does not use) the load multiple word
13417 instructions and the store multiple word instructions.  These
13418 instructions are generated by default on POWER systems, and not
13419 generated on PowerPC systems.  Do not use @option{-mmultiple} on little
13420 endian PowerPC systems, since those instructions do not work when the
13421 processor is in little endian mode.  The exceptions are PPC740 and
13422 PPC750 which permit the instructions usage in little endian mode.
13423
13424 @item -mstring
13425 @itemx -mno-string
13426 @opindex mstring
13427 @opindex mno-string
13428 Generate code that uses (does not use) the load string instructions
13429 and the store string word instructions to save multiple registers and
13430 do small block moves.  These instructions are generated by default on
13431 POWER systems, and not generated on PowerPC systems.  Do not use
13432 @option{-mstring} on little endian PowerPC systems, since those
13433 instructions do not work when the processor is in little endian mode.
13434 The exceptions are PPC740 and PPC750 which permit the instructions
13435 usage in little endian mode.
13436
13437 @item -mupdate
13438 @itemx -mno-update
13439 @opindex mupdate
13440 @opindex mno-update
13441 Generate code that uses (does not use) the load or store instructions
13442 that update the base register to the address of the calculated memory
13443 location.  These instructions are generated by default.  If you use
13444 @option{-mno-update}, there is a small window between the time that the
13445 stack pointer is updated and the address of the previous frame is
13446 stored, which means code that walks the stack frame across interrupts or
13447 signals may get corrupted data.
13448
13449 @item -mfused-madd
13450 @itemx -mno-fused-madd
13451 @opindex mfused-madd
13452 @opindex mno-fused-madd
13453 Generate code that uses (does not use) the floating point multiply and
13454 accumulate instructions.  These instructions are generated by default if
13455 hardware floating is used.
13456
13457 @item -mmulhw
13458 @itemx -mno-mulhw
13459 @opindex mmulhw
13460 @opindex mno-mulhw
13461 Generate code that uses (does not use) the half-word multiply and
13462 multiply-accumulate instructions on the IBM 405, 440 and 464 processors.
13463 These instructions are generated by default when targetting those
13464 processors.
13465
13466 @item -mdlmzb
13467 @itemx -mno-dlmzb
13468 @opindex mdlmzb
13469 @opindex mno-dlmzb
13470 Generate code that uses (does not use) the string-search @samp{dlmzb}
13471 instruction on the IBM 405, 440 and 464 processors.  This instruction is
13472 generated by default when targetting those processors.
13473
13474 @item -mno-bit-align
13475 @itemx -mbit-align
13476 @opindex mno-bit-align
13477 @opindex mbit-align
13478 On System V.4 and embedded PowerPC systems do not (do) force structures
13479 and unions that contain bit-fields to be aligned to the base type of the
13480 bit-field.
13481
13482 For example, by default a structure containing nothing but 8
13483 @code{unsigned} bit-fields of length 1 would be aligned to a 4 byte
13484 boundary and have a size of 4 bytes.  By using @option{-mno-bit-align},
13485 the structure would be aligned to a 1 byte boundary and be one byte in
13486 size.
13487
13488 @item -mno-strict-align
13489 @itemx -mstrict-align
13490 @opindex mno-strict-align
13491 @opindex mstrict-align
13492 On System V.4 and embedded PowerPC systems do not (do) assume that
13493 unaligned memory references will be handled by the system.
13494
13495 @item -mrelocatable
13496 @itemx -mno-relocatable
13497 @opindex mrelocatable
13498 @opindex mno-relocatable
13499 On embedded PowerPC systems generate code that allows (does not allow)
13500 the program to be relocated to a different address at runtime.  If you
13501 use @option{-mrelocatable} on any module, all objects linked together must
13502 be compiled with @option{-mrelocatable} or @option{-mrelocatable-lib}.
13503
13504 @item -mrelocatable-lib
13505 @itemx -mno-relocatable-lib
13506 @opindex mrelocatable-lib
13507 @opindex mno-relocatable-lib
13508 On embedded PowerPC systems generate code that allows (does not allow)
13509 the program to be relocated to a different address at runtime.  Modules
13510 compiled with @option{-mrelocatable-lib} can be linked with either modules
13511 compiled without @option{-mrelocatable} and @option{-mrelocatable-lib} or
13512 with modules compiled with the @option{-mrelocatable} options.
13513
13514 @item -mno-toc
13515 @itemx -mtoc
13516 @opindex mno-toc
13517 @opindex mtoc
13518 On System V.4 and embedded PowerPC systems do not (do) assume that
13519 register 2 contains a pointer to a global area pointing to the addresses
13520 used in the program.
13521
13522 @item -mlittle
13523 @itemx -mlittle-endian
13524 @opindex mlittle
13525 @opindex mlittle-endian
13526 On System V.4 and embedded PowerPC systems compile code for the
13527 processor in little endian mode.  The @option{-mlittle-endian} option is
13528 the same as @option{-mlittle}.
13529
13530 @item -mbig
13531 @itemx -mbig-endian
13532 @opindex mbig
13533 @opindex mbig-endian
13534 On System V.4 and embedded PowerPC systems compile code for the
13535 processor in big endian mode.  The @option{-mbig-endian} option is
13536 the same as @option{-mbig}.
13537
13538 @item -mdynamic-no-pic
13539 @opindex mdynamic-no-pic
13540 On Darwin and Mac OS X systems, compile code so that it is not
13541 relocatable, but that its external references are relocatable.  The
13542 resulting code is suitable for applications, but not shared
13543 libraries.
13544
13545 @item -mprioritize-restricted-insns=@var{priority}
13546 @opindex mprioritize-restricted-insns
13547 This option controls the priority that is assigned to
13548 dispatch-slot restricted instructions during the second scheduling
13549 pass.  The argument @var{priority} takes the value @var{0/1/2} to assign
13550 @var{no/highest/second-highest} priority to dispatch slot restricted
13551 instructions.
13552
13553 @item -msched-costly-dep=@var{dependence_type}
13554 @opindex msched-costly-dep
13555 This option controls which dependences are considered costly
13556 by the target during instruction scheduling.  The argument
13557 @var{dependence_type} takes one of the following values:
13558 @var{no}: no dependence is costly,
13559 @var{all}: all dependences are costly,
13560 @var{true_store_to_load}: a true dependence from store to load is costly,
13561 @var{store_to_load}: any dependence from store to load is costly,
13562 @var{number}: any dependence which latency >= @var{number} is costly.
13563
13564 @item -minsert-sched-nops=@var{scheme}
13565 @opindex minsert-sched-nops
13566 This option controls which nop insertion scheme will be used during
13567 the second scheduling pass.  The argument @var{scheme} takes one of the
13568 following values:
13569 @var{no}: Don't insert nops.
13570 @var{pad}: Pad with nops any dispatch group which has vacant issue slots,
13571 according to the scheduler's grouping.
13572 @var{regroup_exact}: Insert nops to force costly dependent insns into
13573 separate groups.  Insert exactly as many nops as needed to force an insn
13574 to a new group, according to the estimated processor grouping.
13575 @var{number}: Insert nops to force costly dependent insns into
13576 separate groups.  Insert @var{number} nops to force an insn to a new group.
13577
13578 @item -mcall-sysv
13579 @opindex mcall-sysv
13580 On System V.4 and embedded PowerPC systems compile code using calling
13581 conventions that adheres to the March 1995 draft of the System V
13582 Application Binary Interface, PowerPC processor supplement.  This is the
13583 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
13584
13585 @item -mcall-sysv-eabi
13586 @opindex mcall-sysv-eabi
13587 Specify both @option{-mcall-sysv} and @option{-meabi} options.
13588
13589 @item -mcall-sysv-noeabi
13590 @opindex mcall-sysv-noeabi
13591 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
13592
13593 @item -mcall-solaris
13594 @opindex mcall-solaris
13595 On System V.4 and embedded PowerPC systems compile code for the Solaris
13596 operating system.
13597
13598 @item -mcall-linux
13599 @opindex mcall-linux
13600 On System V.4 and embedded PowerPC systems compile code for the
13601 Linux-based GNU system.
13602
13603 @item -mcall-gnu
13604 @opindex mcall-gnu
13605 On System V.4 and embedded PowerPC systems compile code for the
13606 Hurd-based GNU system.
13607
13608 @item -mcall-netbsd
13609 @opindex mcall-netbsd
13610 On System V.4 and embedded PowerPC systems compile code for the
13611 NetBSD operating system.
13612
13613 @item -maix-struct-return
13614 @opindex maix-struct-return
13615 Return all structures in memory (as specified by the AIX ABI)@.
13616
13617 @item -msvr4-struct-return
13618 @opindex msvr4-struct-return
13619 Return structures smaller than 8 bytes in registers (as specified by the
13620 SVR4 ABI)@.
13621
13622 @item -mabi=@var{abi-type}
13623 @opindex mabi
13624 Extend the current ABI with a particular extension, or remove such extension.
13625 Valid values are @var{altivec}, @var{no-altivec}, @var{spe},
13626 @var{no-spe}, @var{ibmlongdouble}, @var{ieeelongdouble}@.
13627
13628 @item -mabi=spe
13629 @opindex mabi=spe
13630 Extend the current ABI with SPE ABI extensions.  This does not change
13631 the default ABI, instead it adds the SPE ABI extensions to the current
13632 ABI@.
13633
13634 @item -mabi=no-spe
13635 @opindex mabi=no-spe
13636 Disable Booke SPE ABI extensions for the current ABI@.
13637
13638 @item -mabi=ibmlongdouble
13639 @opindex mabi=ibmlongdouble
13640 Change the current ABI to use IBM extended precision long double.
13641 This is a PowerPC 32-bit SYSV ABI option.
13642
13643 @item -mabi=ieeelongdouble
13644 @opindex mabi=ieeelongdouble
13645 Change the current ABI to use IEEE extended precision long double.
13646 This is a PowerPC 32-bit Linux ABI option.
13647
13648 @item -mprototype
13649 @itemx -mno-prototype
13650 @opindex mprototype
13651 @opindex mno-prototype
13652 On System V.4 and embedded PowerPC systems assume that all calls to
13653 variable argument functions are properly prototyped.  Otherwise, the
13654 compiler must insert an instruction before every non prototyped call to
13655 set or clear bit 6 of the condition code register (@var{CR}) to
13656 indicate whether floating point values were passed in the floating point
13657 registers in case the function takes a variable arguments.  With
13658 @option{-mprototype}, only calls to prototyped variable argument functions
13659 will set or clear the bit.
13660
13661 @item -msim
13662 @opindex msim
13663 On embedded PowerPC systems, assume that the startup module is called
13664 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
13665 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}
13666 configurations.
13667
13668 @item -mmvme
13669 @opindex mmvme
13670 On embedded PowerPC systems, assume that the startup module is called
13671 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
13672 @file{libc.a}.
13673
13674 @item -mads
13675 @opindex mads
13676 On embedded PowerPC systems, assume that the startup module is called
13677 @file{crt0.o} and the standard C libraries are @file{libads.a} and
13678 @file{libc.a}.
13679
13680 @item -myellowknife
13681 @opindex myellowknife
13682 On embedded PowerPC systems, assume that the startup module is called
13683 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
13684 @file{libc.a}.
13685
13686 @item -mvxworks
13687 @opindex mvxworks
13688 On System V.4 and embedded PowerPC systems, specify that you are
13689 compiling for a VxWorks system.
13690
13691 @item -memb
13692 @opindex memb
13693 On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
13694 header to indicate that @samp{eabi} extended relocations are used.
13695
13696 @item -meabi
13697 @itemx -mno-eabi
13698 @opindex meabi
13699 @opindex mno-eabi
13700 On System V.4 and embedded PowerPC systems do (do not) adhere to the
13701 Embedded Applications Binary Interface (eabi) which is a set of
13702 modifications to the System V.4 specifications.  Selecting @option{-meabi}
13703 means that the stack is aligned to an 8 byte boundary, a function
13704 @code{__eabi} is called to from @code{main} to set up the eabi
13705 environment, and the @option{-msdata} option can use both @code{r2} and
13706 @code{r13} to point to two separate small data areas.  Selecting
13707 @option{-mno-eabi} means that the stack is aligned to a 16 byte boundary,
13708 do not call an initialization function from @code{main}, and the
13709 @option{-msdata} option will only use @code{r13} to point to a single
13710 small data area.  The @option{-meabi} option is on by default if you
13711 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
13712
13713 @item -msdata=eabi
13714 @opindex msdata=eabi
13715 On System V.4 and embedded PowerPC systems, put small initialized
13716 @code{const} global and static data in the @samp{.sdata2} section, which
13717 is pointed to by register @code{r2}.  Put small initialized
13718 non-@code{const} global and static data in the @samp{.sdata} section,
13719 which is pointed to by register @code{r13}.  Put small uninitialized
13720 global and static data in the @samp{.sbss} section, which is adjacent to
13721 the @samp{.sdata} section.  The @option{-msdata=eabi} option is
13722 incompatible with the @option{-mrelocatable} option.  The
13723 @option{-msdata=eabi} option also sets the @option{-memb} option.
13724
13725 @item -msdata=sysv
13726 @opindex msdata=sysv
13727 On System V.4 and embedded PowerPC systems, put small global and static
13728 data in the @samp{.sdata} section, which is pointed to by register
13729 @code{r13}.  Put small uninitialized global and static data in the
13730 @samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
13731 The @option{-msdata=sysv} option is incompatible with the
13732 @option{-mrelocatable} option.
13733
13734 @item -msdata=default
13735 @itemx -msdata
13736 @opindex msdata=default
13737 @opindex msdata
13738 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
13739 compile code the same as @option{-msdata=eabi}, otherwise compile code the
13740 same as @option{-msdata=sysv}.
13741
13742 @item -msdata-data
13743 @opindex msdata-data
13744 On System V.4 and embedded PowerPC systems, put small global
13745 data in the @samp{.sdata} section.  Put small uninitialized global
13746 data in the @samp{.sbss} section.  Do not use register @code{r13}
13747 to address small data however.  This is the default behavior unless
13748 other @option{-msdata} options are used.
13749
13750 @item -msdata=none
13751 @itemx -mno-sdata
13752 @opindex msdata=none
13753 @opindex mno-sdata
13754 On embedded PowerPC systems, put all initialized global and static data
13755 in the @samp{.data} section, and all uninitialized data in the
13756 @samp{.bss} section.
13757
13758 @item -G @var{num}
13759 @opindex G
13760 @cindex smaller data references (PowerPC)
13761 @cindex .sdata/.sdata2 references (PowerPC)
13762 On embedded PowerPC systems, put global and static items less than or
13763 equal to @var{num} bytes into the small data or bss sections instead of
13764 the normal data or bss section.  By default, @var{num} is 8.  The
13765 @option{-G @var{num}} switch is also passed to the linker.
13766 All modules should be compiled with the same @option{-G @var{num}} value.
13767
13768 @item -mregnames
13769 @itemx -mno-regnames
13770 @opindex mregnames
13771 @opindex mno-regnames
13772 On System V.4 and embedded PowerPC systems do (do not) emit register
13773 names in the assembly language output using symbolic forms.
13774
13775 @item -mlongcall
13776 @itemx -mno-longcall
13777 @opindex mlongcall
13778 @opindex mno-longcall
13779 By default assume that all calls are far away so that a longer more
13780 expensive calling sequence is required.  This is required for calls
13781 further than 32 megabytes (33,554,432 bytes) from the current location.
13782 A short call will be generated if the compiler knows
13783 the call cannot be that far away.  This setting can be overridden by
13784 the @code{shortcall} function attribute, or by @code{#pragma
13785 longcall(0)}.
13786
13787 Some linkers are capable of detecting out-of-range calls and generating
13788 glue code on the fly.  On these systems, long calls are unnecessary and
13789 generate slower code.  As of this writing, the AIX linker can do this,
13790 as can the GNU linker for PowerPC/64.  It is planned to add this feature
13791 to the GNU linker for 32-bit PowerPC systems as well.
13792
13793 On Darwin/PPC systems, @code{#pragma longcall} will generate ``jbsr
13794 callee, L42'', plus a ``branch island'' (glue code).  The two target
13795 addresses represent the callee and the ``branch island''.  The
13796 Darwin/PPC linker will prefer the first address and generate a ``bl
13797 callee'' if the PPC ``bl'' instruction will reach the callee directly;
13798 otherwise, the linker will generate ``bl L42'' to call the ``branch
13799 island''.  The ``branch island'' is appended to the body of the
13800 calling function; it computes the full 32-bit address of the callee
13801 and jumps to it.
13802
13803 On Mach-O (Darwin) systems, this option directs the compiler emit to
13804 the glue for every direct call, and the Darwin linker decides whether
13805 to use or discard it.
13806
13807 In the future, we may cause GCC to ignore all longcall specifications
13808 when the linker is known to generate glue.
13809
13810 @item -pthread
13811 @opindex pthread
13812 Adds support for multithreading with the @dfn{pthreads} library.
13813 This option sets flags for both the preprocessor and linker.
13814
13815 @end table
13816
13817 @node S/390 and zSeries Options
13818 @subsection S/390 and zSeries Options
13819 @cindex S/390 and zSeries Options
13820
13821 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
13822
13823 @table @gcctabopt
13824 @item -mhard-float
13825 @itemx -msoft-float
13826 @opindex mhard-float
13827 @opindex msoft-float
13828 Use (do not use) the hardware floating-point instructions and registers
13829 for floating-point operations.  When @option{-msoft-float} is specified,
13830 functions in @file{libgcc.a} will be used to perform floating-point
13831 operations.  When @option{-mhard-float} is specified, the compiler
13832 generates IEEE floating-point instructions.  This is the default.
13833
13834 @item -mlong-double-64
13835 @itemx -mlong-double-128
13836 @opindex mlong-double-64
13837 @opindex mlong-double-128
13838 These switches control the size of @code{long double} type. A size
13839 of 64bit makes the @code{long double} type equivalent to the @code{double}
13840 type. This is the default.
13841
13842 @item -mbackchain
13843 @itemx -mno-backchain
13844 @opindex mbackchain
13845 @opindex mno-backchain
13846 Store (do not store) the address of the caller's frame as backchain pointer
13847 into the callee's stack frame.
13848 A backchain may be needed to allow debugging using tools that do not understand
13849 DWARF-2 call frame information.
13850 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
13851 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
13852 the backchain is placed into the topmost word of the 96/160 byte register
13853 save area.
13854
13855 In general, code compiled with @option{-mbackchain} is call-compatible with
13856 code compiled with @option{-mmo-backchain}; however, use of the backchain
13857 for debugging purposes usually requires that the whole binary is built with
13858 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
13859 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
13860 to build a linux kernel use @option{-msoft-float}.
13861
13862 The default is to not maintain the backchain.
13863
13864 @item -mpacked-stack
13865 @itemx -mno-packed-stack
13866 @opindex mpacked-stack
13867 @opindex mno-packed-stack
13868 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
13869 specified, the compiler uses the all fields of the 96/160 byte register save
13870 area only for their default purpose; unused fields still take up stack space.
13871 When @option{-mpacked-stack} is specified, register save slots are densely
13872 packed at the top of the register save area; unused space is reused for other
13873 purposes, allowing for more efficient use of the available stack space.
13874 However, when @option{-mbackchain} is also in effect, the topmost word of
13875 the save area is always used to store the backchain, and the return address
13876 register is always saved two words below the backchain.
13877
13878 As long as the stack frame backchain is not used, code generated with
13879 @option{-mpacked-stack} is call-compatible with code generated with
13880 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
13881 S/390 or zSeries generated code that uses the stack frame backchain at run
13882 time, not just for debugging purposes.  Such code is not call-compatible
13883 with code compiled with @option{-mpacked-stack}.  Also, note that the
13884 combination of @option{-mbackchain},
13885 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
13886 to build a linux kernel use @option{-msoft-float}.
13887
13888 The default is to not use the packed stack layout.
13889
13890 @item -msmall-exec
13891 @itemx -mno-small-exec
13892 @opindex msmall-exec
13893 @opindex mno-small-exec
13894 Generate (or do not generate) code using the @code{bras} instruction
13895 to do subroutine calls.
13896 This only works reliably if the total executable size does not
13897 exceed 64k.  The default is to use the @code{basr} instruction instead,
13898 which does not have this limitation.
13899
13900 @item -m64
13901 @itemx -m31
13902 @opindex m64
13903 @opindex m31
13904 When @option{-m31} is specified, generate code compliant to the
13905 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
13906 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
13907 particular to generate 64-bit instructions.  For the @samp{s390}
13908 targets, the default is @option{-m31}, while the @samp{s390x}
13909 targets default to @option{-m64}.
13910
13911 @item -mzarch
13912 @itemx -mesa
13913 @opindex mzarch
13914 @opindex mesa
13915 When @option{-mzarch} is specified, generate code using the
13916 instructions available on z/Architecture.
13917 When @option{-mesa} is specified, generate code using the
13918 instructions available on ESA/390.  Note that @option{-mesa} is
13919 not possible with @option{-m64}.
13920 When generating code compliant to the GNU/Linux for S/390 ABI,
13921 the default is @option{-mesa}.  When generating code compliant
13922 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
13923
13924 @item -mmvcle
13925 @itemx -mno-mvcle
13926 @opindex mmvcle
13927 @opindex mno-mvcle
13928 Generate (or do not generate) code using the @code{mvcle} instruction
13929 to perform block moves.  When @option{-mno-mvcle} is specified,
13930 use a @code{mvc} loop instead.  This is the default unless optimizing for
13931 size.
13932
13933 @item -mdebug
13934 @itemx -mno-debug
13935 @opindex mdebug
13936 @opindex mno-debug
13937 Print (or do not print) additional debug information when compiling.
13938 The default is to not print debug information.
13939
13940 @item -march=@var{cpu-type}
13941 @opindex march
13942 Generate code that will run on @var{cpu-type}, which is the name of a system
13943 representing a certain processor type.  Possible values for
13944 @var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, and @samp{z990}.
13945 When generating code using the instructions available on z/Architecture,
13946 the default is @option{-march=z900}.  Otherwise, the default is
13947 @option{-march=g5}.
13948
13949 @item -mtune=@var{cpu-type}
13950 @opindex mtune
13951 Tune to @var{cpu-type} everything applicable about the generated code,
13952 except for the ABI and the set of available instructions.
13953 The list of @var{cpu-type} values is the same as for @option{-march}.
13954 The default is the value used for @option{-march}.
13955
13956 @item -mtpf-trace
13957 @itemx -mno-tpf-trace
13958 @opindex mtpf-trace
13959 @opindex mno-tpf-trace
13960 Generate code that adds (does not add) in TPF OS specific branches to trace
13961 routines in the operating system.  This option is off by default, even
13962 when compiling for the TPF OS@.
13963
13964 @item -mfused-madd
13965 @itemx -mno-fused-madd
13966 @opindex mfused-madd
13967 @opindex mno-fused-madd
13968 Generate code that uses (does not use) the floating point multiply and
13969 accumulate instructions.  These instructions are generated by default if
13970 hardware floating point is used.
13971
13972 @item -mwarn-framesize=@var{framesize}
13973 @opindex mwarn-framesize
13974 Emit a warning if the current function exceeds the given frame size.  Because
13975 this is a compile time check it doesn't need to be a real problem when the program
13976 runs.  It is intended to identify functions which most probably cause
13977 a stack overflow.  It is useful to be used in an environment with limited stack
13978 size e.g.@: the linux kernel.
13979
13980 @item -mwarn-dynamicstack
13981 @opindex mwarn-dynamicstack
13982 Emit a warning if the function calls alloca or uses dynamically
13983 sized arrays.  This is generally a bad idea with a limited stack size.
13984
13985 @item -mstack-guard=@var{stack-guard}
13986 @itemx -mstack-size=@var{stack-size}
13987 @opindex mstack-guard
13988 @opindex mstack-size
13989 If these options are provided the s390 back end emits additional instructions in
13990 the function prologue which trigger a trap if the stack size is @var{stack-guard}
13991 bytes above the @var{stack-size} (remember that the stack on s390 grows downward).
13992 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
13993 the frame size of the compiled function is chosen.
13994 These options are intended to be used to help debugging stack overflow problems.
13995 The additionally emitted code causes only little overhead and hence can also be
13996 used in production like systems without greater performance degradation.  The given
13997 values have to be exact powers of 2 and @var{stack-size} has to be greater than
13998 @var{stack-guard} without exceeding 64k.
13999 In order to be efficient the extra code makes the assumption that the stack starts
14000 at an address aligned to the value given by @var{stack-size}.
14001 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
14002 @end table
14003
14004 @node Score Options
14005 @subsection Score Options
14006 @cindex Score Options
14007
14008 These options are defined for Score implementations:
14009
14010 @table @gcctabopt
14011 @item -meb
14012 @opindex meb
14013 Compile code for big endian mode.  This is the default.
14014
14015 @item -mel
14016 @opindex mel
14017 Compile code for little endian mode. 
14018
14019 @item -mnhwloop
14020 @opindex mnhwloop
14021 Disable generate bcnz instruction.
14022
14023 @item -muls
14024 @opindex muls
14025 Enable generate unaligned load and store instruction.
14026
14027 @item -mmac
14028 @opindex mmac
14029 Enable the use of multiply-accumulate instructions. Disabled by default. 
14030
14031 @item -mscore5
14032 @opindex mscore5
14033 Specify the SCORE5 as the target architecture.
14034
14035 @item -mscore5u
14036 @opindex mscore5u
14037 Specify the SCORE5U of the target architecture.
14038
14039 @item -mscore7
14040 @opindex mscore7
14041 Specify the SCORE7 as the target architecture. This is the default.
14042
14043 @item -mscore7d
14044 @opindex mscore7d
14045 Specify the SCORE7D as the target architecture.
14046 @end table
14047
14048 @node SH Options
14049 @subsection SH Options
14050
14051 These @samp{-m} options are defined for the SH implementations:
14052
14053 @table @gcctabopt
14054 @item -m1
14055 @opindex m1
14056 Generate code for the SH1.
14057
14058 @item -m2
14059 @opindex m2
14060 Generate code for the SH2.
14061
14062 @item -m2e
14063 Generate code for the SH2e.
14064
14065 @item -m3
14066 @opindex m3
14067 Generate code for the SH3.
14068
14069 @item -m3e
14070 @opindex m3e
14071 Generate code for the SH3e.
14072
14073 @item -m4-nofpu
14074 @opindex m4-nofpu
14075 Generate code for the SH4 without a floating-point unit.
14076
14077 @item -m4-single-only
14078 @opindex m4-single-only
14079 Generate code for the SH4 with a floating-point unit that only
14080 supports single-precision arithmetic.
14081
14082 @item -m4-single
14083 @opindex m4-single
14084 Generate code for the SH4 assuming the floating-point unit is in
14085 single-precision mode by default.
14086
14087 @item -m4
14088 @opindex m4
14089 Generate code for the SH4.
14090
14091 @item -m4a-nofpu
14092 @opindex m4a-nofpu
14093 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
14094 floating-point unit is not used.
14095
14096 @item -m4a-single-only
14097 @opindex m4a-single-only
14098 Generate code for the SH4a, in such a way that no double-precision
14099 floating point operations are used.
14100
14101 @item -m4a-single
14102 @opindex m4a-single
14103 Generate code for the SH4a assuming the floating-point unit is in
14104 single-precision mode by default.
14105
14106 @item -m4a
14107 @opindex m4a
14108 Generate code for the SH4a.
14109
14110 @item -m4al
14111 @opindex m4al
14112 Same as @option{-m4a-nofpu}, except that it implicitly passes
14113 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
14114 instructions at the moment.
14115
14116 @item -mb
14117 @opindex mb
14118 Compile code for the processor in big endian mode.
14119
14120 @item -ml
14121 @opindex ml
14122 Compile code for the processor in little endian mode.
14123
14124 @item -mdalign
14125 @opindex mdalign
14126 Align doubles at 64-bit boundaries.  Note that this changes the calling
14127 conventions, and thus some functions from the standard C library will
14128 not work unless you recompile it first with @option{-mdalign}.
14129
14130 @item -mrelax
14131 @opindex mrelax
14132 Shorten some address references at link time, when possible; uses the
14133 linker option @option{-relax}.
14134
14135 @item -mbigtable
14136 @opindex mbigtable
14137 Use 32-bit offsets in @code{switch} tables.  The default is to use
14138 16-bit offsets.
14139
14140 @item -mbitops
14141 @opindex mbitops
14142 Enable the use of bit manipulation instructions on SH2A.
14143
14144 @item -mfmovd
14145 @opindex mfmovd
14146 Enable the use of the instruction @code{fmovd}.
14147
14148 @item -mhitachi
14149 @opindex mhitachi
14150 Comply with the calling conventions defined by Renesas.
14151
14152 @item -mrenesas
14153 @opindex mhitachi
14154 Comply with the calling conventions defined by Renesas.
14155
14156 @item -mno-renesas
14157 @opindex mhitachi
14158 Comply with the calling conventions defined for GCC before the Renesas
14159 conventions were available.  This option is the default for all
14160 targets of the SH toolchain except for @samp{sh-symbianelf}.
14161
14162 @item -mnomacsave
14163 @opindex mnomacsave
14164 Mark the @code{MAC} register as call-clobbered, even if
14165 @option{-mhitachi} is given.
14166
14167 @item -mieee
14168 @opindex mieee
14169 Increase IEEE-compliance of floating-point code.
14170 At the moment, this is equivalent to @option{-fno-finite-math-only}.
14171 When generating 16 bit SH opcodes, getting IEEE-conforming results for
14172 comparisons of NANs / infinities incurs extra overhead in every
14173 floating point comparison, therefore the default is set to
14174 @option{-ffinite-math-only}.
14175
14176 @item -minline-ic_invalidate
14177 @opindex minline-ic_invalidate
14178 Inline code to invalidate instruction cache entries after setting up
14179 nested function trampolines.
14180 This option has no effect if -musermode is in effect and the selected
14181 code generation option (e.g. -m4) does not allow the use of the icbi
14182 instruction.
14183 If the selected code generation option does not allow the use of the icbi
14184 instruction, and -musermode is not in effect, the inlined code will
14185 manipulate the instruction cache address array directly with an associative
14186 write.  This not only requires privileged mode, but it will also
14187 fail if the cache line had been mapped via the TLB and has become unmapped.
14188
14189 @item -misize
14190 @opindex misize
14191 Dump instruction size and location in the assembly code.
14192
14193 @item -mpadstruct
14194 @opindex mpadstruct
14195 This option is deprecated.  It pads structures to multiple of 4 bytes,
14196 which is incompatible with the SH ABI@.
14197
14198 @item -mspace
14199 @opindex mspace
14200 Optimize for space instead of speed.  Implied by @option{-Os}.
14201
14202 @item -mprefergot
14203 @opindex mprefergot
14204 When generating position-independent code, emit function calls using
14205 the Global Offset Table instead of the Procedure Linkage Table.
14206
14207 @item -musermode
14208 @opindex musermode
14209 Don't generate privileged mode only code; implies -mno-inline-ic_invalidate
14210 if the inlined code would not work in user mode.
14211 This is the default when the target is @code{sh-*-linux*}.
14212
14213 @item -multcost=@var{number}
14214 @opindex multcost=@var{number}
14215 Set the cost to assume for a multiply insn.
14216
14217 @item -mdiv=@var{strategy}
14218 @opindex mdiv=@var{strategy}
14219 Set the division strategy to use for SHmedia code.  @var{strategy} must be
14220 one of: call, call2, fp, inv, inv:minlat, inv20u, inv20l, inv:call,
14221 inv:call2, inv:fp .
14222 "fp" performs the operation in floating point.  This has a very high latency,
14223 but needs only a few instructions, so it might be a good choice if
14224 your code has enough easily exploitable ILP to allow the compiler to
14225 schedule the floating point instructions together with other instructions.
14226 Division by zero causes a floating point exception.
14227 "inv" uses integer operations to calculate the inverse of the divisor,
14228 and then multiplies the dividend with the inverse.  This strategy allows
14229 cse and hoisting of the inverse calculation.  Division by zero calculates
14230 an unspecified result, but does not trap.
14231 "inv:minlat" is a variant of "inv" where if no cse / hoisting opportunities
14232 have been found, or if the entire operation has been hoisted to the same
14233 place, the last stages of the inverse calculation are intertwined with the
14234 final multiply to reduce the overall latency, at the expense of using a few
14235 more instructions, and thus offering fewer scheduling opportunities with
14236 other code.
14237 "call" calls a library function that usually implements the inv:minlat
14238 strategy.
14239 This gives high code density for m5-*media-nofpu compilations.
14240 "call2" uses a different entry point of the same library function, where it
14241 assumes that a pointer to a lookup table has already been set up, which
14242 exposes the pointer load to cse / code hoisting optimizations.
14243 "inv:call", "inv:call2" and "inv:fp" all use the "inv" algorithm for initial
14244 code generation, but if the code stays unoptimized, revert to the "call",
14245 "call2", or "fp" strategies, respectively.  Note that the
14246 potentially-trapping side effect of division by zero is carried by a
14247 separate instruction, so it is possible that all the integer instructions
14248 are hoisted out, but the marker for the side effect stays where it is.
14249 A recombination to fp operations or a call is not possible in that case.
14250 "inv20u" and "inv20l" are variants of the "inv:minlat" strategy.  In the case
14251 that the inverse calculation was nor separated from the multiply, they speed
14252 up division where the dividend fits into 20 bits (plus sign where applicable),
14253 by inserting a test to skip a number of operations in this case; this test
14254 slows down the case of larger dividends.  inv20u assumes the case of a such
14255 a small dividend to be unlikely, and inv20l assumes it to be likely.
14256
14257 @item -mdivsi3_libfunc=@var{name}
14258 @opindex mdivsi3_libfunc=@var{name}
14259 Set the name of the library function used for 32 bit signed division to
14260 @var{name}.  This only affect the name used in the call and inv:call
14261 division strategies, and the compiler will still expect the same
14262 sets of input/output/clobbered registers as if this option was not present.
14263
14264 @item -mfixed-range=@var{register-range}
14265 @opindex mfixed-range
14266 Generate code treating the given register range as fixed registers.
14267 A fixed register is one that the register allocator can not use.  This is
14268 useful when compiling kernel code.  A register range is specified as
14269 two registers separated by a dash.  Multiple register ranges can be
14270 specified separated by a comma.
14271
14272 @item -madjust-unroll
14273 @opindex madjust-unroll
14274 Throttle unrolling to avoid thrashing target registers.
14275 This option only has an effect if the gcc code base supports the
14276 TARGET_ADJUST_UNROLL_MAX target hook.
14277
14278 @item -mindexed-addressing
14279 @opindex mindexed-addressing
14280 Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
14281 This is only safe if the hardware and/or OS implement 32 bit wrap-around
14282 semantics for the indexed addressing mode.  The architecture allows the
14283 implementation of processors with 64 bit MMU, which the OS could use to
14284 get 32 bit addressing, but since no current hardware implementation supports
14285 this or any other way to make the indexed addressing mode safe to use in
14286 the 32 bit ABI, the default is -mno-indexed-addressing.
14287
14288 @item -mgettrcost=@var{number}
14289 @opindex mgettrcost=@var{number}
14290 Set the cost assumed for the gettr instruction to @var{number}.
14291 The default is 2 if @option{-mpt-fixed} is in effect, 100 otherwise.
14292
14293 @item -mpt-fixed
14294 @opindex mpt-fixed
14295 Assume pt* instructions won't trap.  This will generally generate better
14296 scheduled code, but is unsafe on current hardware.  The current architecture
14297 definition says that ptabs and ptrel trap when the target anded with 3 is 3.
14298 This has the unintentional effect of making it unsafe to schedule ptabs /
14299 ptrel before a branch, or hoist it out of a loop.  For example,
14300 __do_global_ctors, a part of libgcc that runs constructors at program
14301 startup, calls functions in a list which is delimited by @minus{}1.  With the
14302 -mpt-fixed option, the ptabs will be done before testing against @minus{}1.
14303 That means that all the constructors will be run a bit quicker, but when
14304 the loop comes to the end of the list, the program crashes because ptabs
14305 loads @minus{}1 into a target register.  Since this option is unsafe for any
14306 hardware implementing the current architecture specification, the default
14307 is -mno-pt-fixed.  Unless the user specifies a specific cost with
14308 @option{-mgettrcost}, -mno-pt-fixed also implies @option{-mgettrcost=100};
14309 this deters register allocation using target registers for storing
14310 ordinary integers.
14311
14312 @item -minvalid-symbols
14313 @opindex minvalid-symbols
14314 Assume symbols might be invalid.  Ordinary function symbols generated by
14315 the compiler will always be valid to load with movi/shori/ptabs or
14316 movi/shori/ptrel, but with assembler and/or linker tricks it is possible
14317 to generate symbols that will cause ptabs / ptrel to trap.
14318 This option is only meaningful when @option{-mno-pt-fixed} is in effect.
14319 It will then prevent cross-basic-block cse, hoisting and most scheduling
14320 of symbol loads.  The default is @option{-mno-invalid-symbols}.
14321 @end table
14322
14323 @node SPARC Options
14324 @subsection SPARC Options
14325 @cindex SPARC options
14326
14327 These @samp{-m} options are supported on the SPARC:
14328
14329 @table @gcctabopt
14330 @item -mno-app-regs
14331 @itemx -mapp-regs
14332 @opindex mno-app-regs
14333 @opindex mapp-regs
14334 Specify @option{-mapp-regs} to generate output using the global registers
14335 2 through 4, which the SPARC SVR4 ABI reserves for applications.  This
14336 is the default.
14337
14338 To be fully SVR4 ABI compliant at the cost of some performance loss,
14339 specify @option{-mno-app-regs}.  You should compile libraries and system
14340 software with this option.
14341
14342 @item -mfpu
14343 @itemx -mhard-float
14344 @opindex mfpu
14345 @opindex mhard-float
14346 Generate output containing floating point instructions.  This is the
14347 default.
14348
14349 @item -mno-fpu
14350 @itemx -msoft-float
14351 @opindex mno-fpu
14352 @opindex msoft-float
14353 Generate output containing library calls for floating point.
14354 @strong{Warning:} the requisite libraries are not available for all SPARC
14355 targets.  Normally the facilities of the machine's usual C compiler are
14356 used, but this cannot be done directly in cross-compilation.  You must make
14357 your own arrangements to provide suitable library functions for
14358 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
14359 @samp{sparclite-*-*} do provide software floating point support.
14360
14361 @option{-msoft-float} changes the calling convention in the output file;
14362 therefore, it is only useful if you compile @emph{all} of a program with
14363 this option.  In particular, you need to compile @file{libgcc.a}, the
14364 library that comes with GCC, with @option{-msoft-float} in order for
14365 this to work.
14366
14367 @item -mhard-quad-float
14368 @opindex mhard-quad-float
14369 Generate output containing quad-word (long double) floating point
14370 instructions.
14371
14372 @item -msoft-quad-float
14373 @opindex msoft-quad-float
14374 Generate output containing library calls for quad-word (long double)
14375 floating point instructions.  The functions called are those specified
14376 in the SPARC ABI@.  This is the default.
14377
14378 As of this writing, there are no SPARC implementations that have hardware
14379 support for the quad-word floating point instructions.  They all invoke
14380 a trap handler for one of these instructions, and then the trap handler
14381 emulates the effect of the instruction.  Because of the trap handler overhead,
14382 this is much slower than calling the ABI library routines.  Thus the
14383 @option{-msoft-quad-float} option is the default.
14384
14385 @item -mno-unaligned-doubles
14386 @itemx -munaligned-doubles
14387 @opindex mno-unaligned-doubles
14388 @opindex munaligned-doubles
14389 Assume that doubles have 8 byte alignment.  This is the default.
14390
14391 With @option{-munaligned-doubles}, GCC assumes that doubles have 8 byte
14392 alignment only if they are contained in another type, or if they have an
14393 absolute address.  Otherwise, it assumes they have 4 byte alignment.
14394 Specifying this option avoids some rare compatibility problems with code
14395 generated by other compilers.  It is not the default because it results
14396 in a performance loss, especially for floating point code.
14397
14398 @item -mno-faster-structs
14399 @itemx -mfaster-structs
14400 @opindex mno-faster-structs
14401 @opindex mfaster-structs
14402 With @option{-mfaster-structs}, the compiler assumes that structures
14403 should have 8 byte alignment.  This enables the use of pairs of
14404 @code{ldd} and @code{std} instructions for copies in structure
14405 assignment, in place of twice as many @code{ld} and @code{st} pairs.
14406 However, the use of this changed alignment directly violates the SPARC
14407 ABI@.  Thus, it's intended only for use on targets where the developer
14408 acknowledges that their resulting code will not be directly in line with
14409 the rules of the ABI@.
14410
14411 @item -mimpure-text
14412 @opindex mimpure-text
14413 @option{-mimpure-text}, used in addition to @option{-shared}, tells
14414 the compiler to not pass @option{-z text} to the linker when linking a
14415 shared object.  Using this option, you can link position-dependent
14416 code into a shared object.
14417
14418 @option{-mimpure-text} suppresses the ``relocations remain against
14419 allocatable but non-writable sections'' linker error message.
14420 However, the necessary relocations will trigger copy-on-write, and the
14421 shared object is not actually shared across processes.  Instead of
14422 using @option{-mimpure-text}, you should compile all source code with
14423 @option{-fpic} or @option{-fPIC}.
14424
14425 This option is only available on SunOS and Solaris.
14426
14427 @item -mcpu=@var{cpu_type}
14428 @opindex mcpu
14429 Set the instruction set, register set, and instruction scheduling parameters
14430 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
14431 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{sparclite},
14432 @samp{f930}, @samp{f934}, @samp{hypersparc}, @samp{sparclite86x},
14433 @samp{sparclet}, @samp{tsc701}, @samp{v9}, @samp{ultrasparc},
14434 @samp{ultrasparc3}, @samp{niagara} and @samp{niagara2}.
14435
14436 Default instruction scheduling parameters are used for values that select
14437 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
14438 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
14439
14440 Here is a list of each supported architecture and their supported
14441 implementations.
14442
14443 @smallexample
14444     v7:             cypress
14445     v8:             supersparc, hypersparc
14446     sparclite:      f930, f934, sparclite86x
14447     sparclet:       tsc701
14448     v9:             ultrasparc, ultrasparc3, niagara, niagara2
14449 @end smallexample
14450
14451 By default (unless configured otherwise), GCC generates code for the V7
14452 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
14453 additionally optimizes it for the Cypress CY7C602 chip, as used in the
14454 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
14455 SPARCStation 1, 2, IPX etc.
14456
14457 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
14458 architecture.  The only difference from V7 code is that the compiler emits
14459 the integer multiply and integer divide instructions which exist in SPARC-V8
14460 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
14461 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
14462 2000 series.
14463
14464 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
14465 the SPARC architecture.  This adds the integer multiply, integer divide step
14466 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
14467 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
14468 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
14469 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
14470 MB86934 chip, which is the more recent SPARClite with FPU@.
14471
14472 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
14473 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
14474 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
14475 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
14476 optimizes it for the TEMIC SPARClet chip.
14477
14478 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
14479 architecture.  This adds 64-bit integer and floating-point move instructions,
14480 3 additional floating-point condition code registers and conditional move
14481 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
14482 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
14483 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
14484 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
14485 @option{-mcpu=niagara}, the compiler additionally optimizes it for
14486 Sun UltraSPARC T1 chips.  With @option{-mcpu=niagara2}, the compiler
14487 additionally optimizes it for Sun UltraSPARC T2 chips.
14488
14489 @item -mtune=@var{cpu_type}
14490 @opindex mtune
14491 Set the instruction scheduling parameters for machine type
14492 @var{cpu_type}, but do not set the instruction set or register set that the
14493 option @option{-mcpu=@var{cpu_type}} would.
14494
14495 The same values for @option{-mcpu=@var{cpu_type}} can be used for
14496 @option{-mtune=@var{cpu_type}}, but the only useful values are those
14497 that select a particular cpu implementation.  Those are @samp{cypress},
14498 @samp{supersparc}, @samp{hypersparc}, @samp{f930}, @samp{f934},
14499 @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc},
14500 @samp{ultrasparc3}, @samp{niagara}, and @samp{niagara2}.
14501
14502 @item -mv8plus
14503 @itemx -mno-v8plus
14504 @opindex mv8plus
14505 @opindex mno-v8plus
14506 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
14507 difference from the V8 ABI is that the global and out registers are
14508 considered 64-bit wide.  This is enabled by default on Solaris in 32-bit
14509 mode for all SPARC-V9 processors.
14510
14511 @item -mvis
14512 @itemx -mno-vis
14513 @opindex mvis
14514 @opindex mno-vis
14515 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
14516 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
14517 @end table
14518
14519 These @samp{-m} options are supported in addition to the above
14520 on SPARC-V9 processors in 64-bit environments:
14521
14522 @table @gcctabopt
14523 @item -mlittle-endian
14524 @opindex mlittle-endian
14525 Generate code for a processor running in little-endian mode.  It is only
14526 available for a few configurations and most notably not on Solaris and Linux.
14527
14528 @item -m32
14529 @itemx -m64
14530 @opindex m32
14531 @opindex m64
14532 Generate code for a 32-bit or 64-bit environment.
14533 The 32-bit environment sets int, long and pointer to 32 bits.
14534 The 64-bit environment sets int to 32 bits and long and pointer
14535 to 64 bits.
14536
14537 @item -mcmodel=medlow
14538 @opindex mcmodel=medlow
14539 Generate code for the Medium/Low code model: 64-bit addresses, programs
14540 must be linked in the low 32 bits of memory.  Programs can be statically
14541 or dynamically linked.
14542
14543 @item -mcmodel=medmid
14544 @opindex mcmodel=medmid
14545 Generate code for the Medium/Middle code model: 64-bit addresses, programs
14546 must be linked in the low 44 bits of memory, the text and data segments must
14547 be less than 2GB in size and the data segment must be located within 2GB of
14548 the text segment.
14549
14550 @item -mcmodel=medany
14551 @opindex mcmodel=medany
14552 Generate code for the Medium/Anywhere code model: 64-bit addresses, programs
14553 may be linked anywhere in memory, the text and data segments must be less
14554 than 2GB in size and the data segment must be located within 2GB of the
14555 text segment.
14556
14557 @item -mcmodel=embmedany
14558 @opindex mcmodel=embmedany
14559 Generate code for the Medium/Anywhere code model for embedded systems:
14560 64-bit addresses, the text and data segments must be less than 2GB in
14561 size, both starting anywhere in memory (determined at link time).  The
14562 global register %g4 points to the base of the data segment.  Programs
14563 are statically linked and PIC is not supported.
14564
14565 @item -mstack-bias
14566 @itemx -mno-stack-bias
14567 @opindex mstack-bias
14568 @opindex mno-stack-bias
14569 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
14570 frame pointer if present, are offset by @minus{}2047 which must be added back
14571 when making stack frame references.  This is the default in 64-bit mode.
14572 Otherwise, assume no such offset is present.
14573 @end table
14574
14575 These switches are supported in addition to the above on Solaris:
14576
14577 @table @gcctabopt
14578 @item -threads
14579 @opindex threads
14580 Add support for multithreading using the Solaris threads library.  This
14581 option sets flags for both the preprocessor and linker.  This option does
14582 not affect the thread safety of object code produced by the compiler or
14583 that of libraries supplied with it.
14584
14585 @item -pthreads
14586 @opindex pthreads
14587 Add support for multithreading using the POSIX threads library.  This
14588 option sets flags for both the preprocessor and linker.  This option does
14589 not affect the thread safety of object code produced  by the compiler or
14590 that of libraries supplied with it.
14591
14592 @item -pthread
14593 @opindex pthread
14594 This is a synonym for @option{-pthreads}.
14595 @end table
14596
14597 @node SPU Options
14598 @subsection SPU Options
14599 @cindex SPU options
14600
14601 These @samp{-m} options are supported on the SPU:
14602
14603 @table @gcctabopt
14604 @item -mwarn-reloc
14605 @itemx -merror-reloc
14606 @opindex mwarn-reloc
14607 @opindex merror-reloc
14608
14609 The loader for SPU does not handle dynamic relocations.  By default, GCC
14610 will give an error when it generates code that requires a dynamic
14611 relocation.  @option{-mno-error-reloc} disables the error,
14612 @option{-mwarn-reloc} will generate a warning instead.
14613
14614 @item -msafe-dma
14615 @itemx -munsafe-dma
14616 @opindex msafe-dma
14617 @opindex munsafe-dma
14618
14619 Instructions which initiate or test completion of DMA must not be
14620 reordered with respect to loads and stores of the memory which is being
14621 accessed.  Users typically address this problem using the volatile
14622 keyword, but that can lead to inefficient code in places where the
14623 memory is known to not change.  Rather than mark the memory as volatile
14624 we treat the DMA instructions as potentially effecting all memory.  With
14625 @option{-munsafe-dma} users must use the volatile keyword to protect
14626 memory accesses.
14627
14628 @item -mbranch-hints
14629 @opindex mbranch-hints
14630
14631 By default, GCC will generate a branch hint instruction to avoid
14632 pipeline stalls for always taken or probably taken branches.  A hint
14633 will not be generated closer than 8 instructions away from its branch.
14634 There is little reason to disable them, except for debugging purposes,
14635 or to make an object a little bit smaller.
14636
14637 @item -msmall-mem
14638 @itemx -mlarge-mem
14639 @opindex msmall-mem
14640 @opindex mlarge-mem
14641
14642 By default, GCC generates code assuming that addresses are never larger
14643 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
14644 a full 32 bit address.
14645
14646 @item -mstdmain
14647 @opindex mstdmain
14648
14649 By default, GCC links against startup code that assumes the SPU-style
14650 main function interface (which has an unconventional parameter list).
14651 With @option{-mstdmain}, GCC will link your program against startup
14652 code that assumes a C99-style interface to @code{main}, including a
14653 local copy of @code{argv} strings.
14654
14655 @item -mfixed-range=@var{register-range}
14656 @opindex mfixed-range
14657 Generate code treating the given register range as fixed registers.
14658 A fixed register is one that the register allocator can not use.  This is
14659 useful when compiling kernel code.  A register range is specified as
14660 two registers separated by a dash.  Multiple register ranges can be
14661 specified separated by a comma.
14662
14663 @end table
14664
14665 @node System V Options
14666 @subsection Options for System V
14667
14668 These additional options are available on System V Release 4 for
14669 compatibility with other compilers on those systems:
14670
14671 @table @gcctabopt
14672 @item -G
14673 @opindex G
14674 Create a shared object.
14675 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
14676
14677 @item -Qy
14678 @opindex Qy
14679 Identify the versions of each tool used by the compiler, in a
14680 @code{.ident} assembler directive in the output.
14681
14682 @item -Qn
14683 @opindex Qn
14684 Refrain from adding @code{.ident} directives to the output file (this is
14685 the default).
14686
14687 @item -YP,@var{dirs}
14688 @opindex YP
14689 Search the directories @var{dirs}, and no others, for libraries
14690 specified with @option{-l}.
14691
14692 @item -Ym,@var{dir}
14693 @opindex Ym
14694 Look in the directory @var{dir} to find the M4 preprocessor.
14695 The assembler uses this option.
14696 @c This is supposed to go with a -Yd for predefined M4 macro files, but
14697 @c the generic assembler that comes with Solaris takes just -Ym.
14698 @end table
14699
14700 @node V850 Options
14701 @subsection V850 Options
14702 @cindex V850 Options
14703
14704 These @samp{-m} options are defined for V850 implementations:
14705
14706 @table @gcctabopt
14707 @item -mlong-calls
14708 @itemx -mno-long-calls
14709 @opindex mlong-calls
14710 @opindex mno-long-calls
14711 Treat all calls as being far away (near).  If calls are assumed to be
14712 far away, the compiler will always load the functions address up into a
14713 register, and call indirect through the pointer.
14714
14715 @item -mno-ep
14716 @itemx -mep
14717 @opindex mno-ep
14718 @opindex mep
14719 Do not optimize (do optimize) basic blocks that use the same index
14720 pointer 4 or more times to copy pointer into the @code{ep} register, and
14721 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
14722 option is on by default if you optimize.
14723
14724 @item -mno-prolog-function
14725 @itemx -mprolog-function
14726 @opindex mno-prolog-function
14727 @opindex mprolog-function
14728 Do not use (do use) external functions to save and restore registers
14729 at the prologue and epilogue of a function.  The external functions
14730 are slower, but use less code space if more than one function saves
14731 the same number of registers.  The @option{-mprolog-function} option
14732 is on by default if you optimize.
14733
14734 @item -mspace
14735 @opindex mspace
14736 Try to make the code as small as possible.  At present, this just turns
14737 on the @option{-mep} and @option{-mprolog-function} options.
14738
14739 @item -mtda=@var{n}
14740 @opindex mtda
14741 Put static or global variables whose size is @var{n} bytes or less into
14742 the tiny data area that register @code{ep} points to.  The tiny data
14743 area can hold up to 256 bytes in total (128 bytes for byte references).
14744
14745 @item -msda=@var{n}
14746 @opindex msda
14747 Put static or global variables whose size is @var{n} bytes or less into
14748 the small data area that register @code{gp} points to.  The small data
14749 area can hold up to 64 kilobytes.
14750
14751 @item -mzda=@var{n}
14752 @opindex mzda
14753 Put static or global variables whose size is @var{n} bytes or less into
14754 the first 32 kilobytes of memory.
14755
14756 @item -mv850
14757 @opindex mv850
14758 Specify that the target processor is the V850.
14759
14760 @item -mbig-switch
14761 @opindex mbig-switch
14762 Generate code suitable for big switch tables.  Use this option only if
14763 the assembler/linker complain about out of range branches within a switch
14764 table.
14765
14766 @item -mapp-regs
14767 @opindex mapp-regs
14768 This option will cause r2 and r5 to be used in the code generated by
14769 the compiler.  This setting is the default.
14770
14771 @item -mno-app-regs
14772 @opindex mno-app-regs
14773 This option will cause r2 and r5 to be treated as fixed registers.
14774
14775 @item -mv850e1
14776 @opindex mv850e1
14777 Specify that the target processor is the V850E1.  The preprocessor
14778 constants @samp{__v850e1__} and @samp{__v850e__} will be defined if
14779 this option is used.
14780
14781 @item -mv850e
14782 @opindex mv850e
14783 Specify that the target processor is the V850E@.  The preprocessor
14784 constant @samp{__v850e__} will be defined if this option is used.
14785
14786 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
14787 are defined then a default target processor will be chosen and the
14788 relevant @samp{__v850*__} preprocessor constant will be defined.
14789
14790 The preprocessor constants @samp{__v850} and @samp{__v851__} are always
14791 defined, regardless of which processor variant is the target.
14792
14793 @item -mdisable-callt
14794 @opindex mdisable-callt
14795 This option will suppress generation of the CALLT instruction for the
14796 v850e and v850e1 flavors of the v850 architecture.  The default is
14797 @option{-mno-disable-callt} which allows the CALLT instruction to be used.
14798
14799 @end table
14800
14801 @node VAX Options
14802 @subsection VAX Options
14803 @cindex VAX options
14804
14805 These @samp{-m} options are defined for the VAX:
14806
14807 @table @gcctabopt
14808 @item -munix
14809 @opindex munix
14810 Do not output certain jump instructions (@code{aobleq} and so on)
14811 that the Unix assembler for the VAX cannot handle across long
14812 ranges.
14813
14814 @item -mgnu
14815 @opindex mgnu
14816 Do output those jump instructions, on the assumption that you
14817 will assemble with the GNU assembler.
14818
14819 @item -mg
14820 @opindex mg
14821 Output code for g-format floating point numbers instead of d-format.
14822 @end table
14823
14824 @node VxWorks Options
14825 @subsection VxWorks Options
14826 @cindex VxWorks Options
14827
14828 The options in this section are defined for all VxWorks targets.
14829 Options specific to the target hardware are listed with the other
14830 options for that target.
14831
14832 @table @gcctabopt
14833 @item -mrtp
14834 @opindex mrtp
14835 GCC can generate code for both VxWorks kernels and real time processes
14836 (RTPs).  This option switches from the former to the latter.  It also
14837 defines the preprocessor macro @code{__RTP__}.
14838
14839 @item -non-static
14840 @opindex non-static
14841 Link an RTP executable against shared libraries rather than static
14842 libraries.  The options @option{-static} and @option{-shared} can
14843 also be used for RTPs (@pxref{Link Options}); @option{-static}
14844 is the default.
14845
14846 @item -Bstatic
14847 @itemx -Bdynamic
14848 @opindex Bstatic
14849 @opindex Bdynamic
14850 These options are passed down to the linker.  They are defined for
14851 compatibility with Diab.
14852
14853 @item -Xbind-lazy
14854 @opindex Xbind-lazy
14855 Enable lazy binding of function calls.  This option is equivalent to
14856 @option{-Wl,-z,now} and is defined for compatibility with Diab.
14857
14858 @item -Xbind-now
14859 @opindex Xbind-now
14860 Disable lazy binding of function calls.  This option is the default and
14861 is defined for compatibility with Diab.
14862 @end table
14863
14864 @node x86-64 Options
14865 @subsection x86-64 Options
14866 @cindex x86-64 options
14867
14868 These are listed under @xref{i386 and x86-64 Options}.
14869
14870 @node Xstormy16 Options
14871 @subsection Xstormy16 Options
14872 @cindex Xstormy16 Options
14873
14874 These options are defined for Xstormy16:
14875
14876 @table @gcctabopt
14877 @item -msim
14878 @opindex msim
14879 Choose startup files and linker script suitable for the simulator.
14880 @end table
14881
14882 @node Xtensa Options
14883 @subsection Xtensa Options
14884 @cindex Xtensa Options
14885
14886 These options are supported for Xtensa targets:
14887
14888 @table @gcctabopt
14889 @item -mconst16
14890 @itemx -mno-const16
14891 @opindex mconst16
14892 @opindex mno-const16
14893 Enable or disable use of @code{CONST16} instructions for loading
14894 constant values.  The @code{CONST16} instruction is currently not a
14895 standard option from Tensilica.  When enabled, @code{CONST16}
14896 instructions are always used in place of the standard @code{L32R}
14897 instructions.  The use of @code{CONST16} is enabled by default only if
14898 the @code{L32R} instruction is not available.
14899
14900 @item -mfused-madd
14901 @itemx -mno-fused-madd
14902 @opindex mfused-madd
14903 @opindex mno-fused-madd
14904 Enable or disable use of fused multiply/add and multiply/subtract
14905 instructions in the floating-point option.  This has no effect if the
14906 floating-point option is not also enabled.  Disabling fused multiply/add
14907 and multiply/subtract instructions forces the compiler to use separate
14908 instructions for the multiply and add/subtract operations.  This may be
14909 desirable in some cases where strict IEEE 754-compliant results are
14910 required: the fused multiply add/subtract instructions do not round the
14911 intermediate result, thereby producing results with @emph{more} bits of
14912 precision than specified by the IEEE standard.  Disabling fused multiply
14913 add/subtract instructions also ensures that the program output is not
14914 sensitive to the compiler's ability to combine multiply and add/subtract
14915 operations.
14916
14917 @item -mserialize-volatile
14918 @itemx -mno-serialize-volatile
14919 @opindex mserialize-volatile
14920 @opindex mno-serialize-volatile
14921 When this option is enabled, GCC inserts @code{MEMW} instructions before
14922 @code{volatile} memory references to guarantee sequential consistency.
14923 The default is @option{-mserialize-volatile}.  Use
14924 @option{-mno-serialize-volatile} to omit the @code{MEMW} instructions.
14925
14926 @item -mtext-section-literals
14927 @itemx -mno-text-section-literals
14928 @opindex mtext-section-literals
14929 @opindex mno-text-section-literals
14930 Control the treatment of literal pools.  The default is
14931 @option{-mno-text-section-literals}, which places literals in a separate
14932 section in the output file.  This allows the literal pool to be placed
14933 in a data RAM/ROM, and it also allows the linker to combine literal
14934 pools from separate object files to remove redundant literals and
14935 improve code size.  With @option{-mtext-section-literals}, the literals
14936 are interspersed in the text section in order to keep them as close as
14937 possible to their references.  This may be necessary for large assembly
14938 files.
14939
14940 @item -mtarget-align
14941 @itemx -mno-target-align
14942 @opindex mtarget-align
14943 @opindex mno-target-align
14944 When this option is enabled, GCC instructs the assembler to
14945 automatically align instructions to reduce branch penalties at the
14946 expense of some code density.  The assembler attempts to widen density
14947 instructions to align branch targets and the instructions following call
14948 instructions.  If there are not enough preceding safe density
14949 instructions to align a target, no widening will be performed.  The
14950 default is @option{-mtarget-align}.  These options do not affect the
14951 treatment of auto-aligned instructions like @code{LOOP}, which the
14952 assembler will always align, either by widening density instructions or
14953 by inserting no-op instructions.
14954
14955 @item -mlongcalls
14956 @itemx -mno-longcalls
14957 @opindex mlongcalls
14958 @opindex mno-longcalls
14959 When this option is enabled, GCC instructs the assembler to translate
14960 direct calls to indirect calls unless it can determine that the target
14961 of a direct call is in the range allowed by the call instruction.  This
14962 translation typically occurs for calls to functions in other source
14963 files.  Specifically, the assembler translates a direct @code{CALL}
14964 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
14965 The default is @option{-mno-longcalls}.  This option should be used in
14966 programs where the call target can potentially be out of range.  This
14967 option is implemented in the assembler, not the compiler, so the
14968 assembly code generated by GCC will still show direct call
14969 instructions---look at the disassembled object code to see the actual
14970 instructions.  Note that the assembler will use an indirect call for
14971 every cross-file call, not just those that really will be out of range.
14972 @end table
14973
14974 @node zSeries Options
14975 @subsection zSeries Options
14976 @cindex zSeries options
14977
14978 These are listed under @xref{S/390 and zSeries Options}.
14979
14980 @node Code Gen Options
14981 @section Options for Code Generation Conventions
14982 @cindex code generation conventions
14983 @cindex options, code generation
14984 @cindex run-time options
14985
14986 These machine-independent options control the interface conventions
14987 used in code generation.
14988
14989 Most of them have both positive and negative forms; the negative form
14990 of @option{-ffoo} would be @option{-fno-foo}.  In the table below, only
14991 one of the forms is listed---the one which is not the default.  You
14992 can figure out the other form by either removing @samp{no-} or adding
14993 it.
14994
14995 @table @gcctabopt
14996 @item -fbounds-check
14997 @opindex fbounds-check
14998 For front-ends that support it, generate additional code to check that
14999 indices used to access arrays are within the declared range.  This is
15000 currently only supported by the Java and Fortran front-ends, where
15001 this option defaults to true and false respectively.
15002
15003 @item -ftrapv
15004 @opindex ftrapv
15005 This option generates traps for signed overflow on addition, subtraction,
15006 multiplication operations.
15007
15008 @item -fwrapv
15009 @opindex fwrapv
15010 This option instructs the compiler to assume that signed arithmetic
15011 overflow of addition, subtraction and multiplication wraps around
15012 using twos-complement representation.  This flag enables some optimizations
15013 and disables others.  This option is enabled by default for the Java
15014 front-end, as required by the Java language specification.
15015
15016 @item -fexceptions
15017 @opindex fexceptions
15018 Enable exception handling.  Generates extra code needed to propagate
15019 exceptions.  For some targets, this implies GCC will generate frame
15020 unwind information for all functions, which can produce significant data
15021 size overhead, although it does not affect execution.  If you do not
15022 specify this option, GCC will enable it by default for languages like
15023 C++ which normally require exception handling, and disable it for
15024 languages like C that do not normally require it.  However, you may need
15025 to enable this option when compiling C code that needs to interoperate
15026 properly with exception handlers written in C++.  You may also wish to
15027 disable this option if you are compiling older C++ programs that don't
15028 use exception handling.
15029
15030 @item -fnon-call-exceptions
15031 @opindex fnon-call-exceptions
15032 Generate code that allows trapping instructions to throw exceptions.
15033 Note that this requires platform-specific runtime support that does
15034 not exist everywhere.  Moreover, it only allows @emph{trapping}
15035 instructions to throw exceptions, i.e.@: memory references or floating
15036 point instructions.  It does not allow exceptions to be thrown from
15037 arbitrary signal handlers such as @code{SIGALRM}.
15038
15039 @item -funwind-tables
15040 @opindex funwind-tables
15041 Similar to @option{-fexceptions}, except that it will just generate any needed
15042 static data, but will not affect the generated code in any other way.
15043 You will normally not enable this option; instead, a language processor
15044 that needs this handling would enable it on your behalf.
15045
15046 @item -fasynchronous-unwind-tables
15047 @opindex fasynchronous-unwind-tables
15048 Generate unwind table in dwarf2 format, if supported by target machine.  The
15049 table is exact at each instruction boundary, so it can be used for stack
15050 unwinding from asynchronous events (such as debugger or garbage collector).
15051
15052 @item -fpcc-struct-return
15053 @opindex fpcc-struct-return
15054 Return ``short'' @code{struct} and @code{union} values in memory like
15055 longer ones, rather than in registers.  This convention is less
15056 efficient, but it has the advantage of allowing intercallability between
15057 GCC-compiled files and files compiled with other compilers, particularly
15058 the Portable C Compiler (pcc).
15059
15060 The precise convention for returning structures in memory depends
15061 on the target configuration macros.
15062
15063 Short structures and unions are those whose size and alignment match
15064 that of some integer type.
15065
15066 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
15067 switch is not binary compatible with code compiled with the
15068 @option{-freg-struct-return} switch.
15069 Use it to conform to a non-default application binary interface.
15070
15071 @item -freg-struct-return
15072 @opindex freg-struct-return
15073 Return @code{struct} and @code{union} values in registers when possible.
15074 This is more efficient for small structures than
15075 @option{-fpcc-struct-return}.
15076
15077 If you specify neither @option{-fpcc-struct-return} nor
15078 @option{-freg-struct-return}, GCC defaults to whichever convention is
15079 standard for the target.  If there is no standard convention, GCC
15080 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
15081 the principal compiler.  In those cases, we can choose the standard, and
15082 we chose the more efficient register return alternative.
15083
15084 @strong{Warning:} code compiled with the @option{-freg-struct-return}
15085 switch is not binary compatible with code compiled with the
15086 @option{-fpcc-struct-return} switch.
15087 Use it to conform to a non-default application binary interface.
15088
15089 @item -fshort-enums
15090 @opindex fshort-enums
15091 Allocate to an @code{enum} type only as many bytes as it needs for the
15092 declared range of possible values.  Specifically, the @code{enum} type
15093 will be equivalent to the smallest integer type which has enough room.
15094
15095 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
15096 code that is not binary compatible with code generated without that switch.
15097 Use it to conform to a non-default application binary interface.
15098
15099 @item -fshort-double
15100 @opindex fshort-double
15101 Use the same size for @code{double} as for @code{float}.
15102
15103 @strong{Warning:} the @option{-fshort-double} switch causes GCC to generate
15104 code that is not binary compatible with code generated without that switch.
15105 Use it to conform to a non-default application binary interface.
15106
15107 @item -fshort-wchar
15108 @opindex fshort-wchar
15109 Override the underlying type for @samp{wchar_t} to be @samp{short
15110 unsigned int} instead of the default for the target.  This option is
15111 useful for building programs to run under WINE@.
15112
15113 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
15114 code that is not binary compatible with code generated without that switch.
15115 Use it to conform to a non-default application binary interface.
15116
15117 @item -fno-common
15118 @opindex fno-common
15119 In C, allocate even uninitialized global variables in the data section of the
15120 object file, rather than generating them as common blocks.  This has the
15121 effect that if the same variable is declared (without @code{extern}) in
15122 two different compilations, you will get an error when you link them.
15123 The only reason this might be useful is if you wish to verify that the
15124 program will work on other systems which always work this way.
15125
15126 @item -fno-ident
15127 @opindex fno-ident
15128 Ignore the @samp{#ident} directive.
15129
15130 @item -finhibit-size-directive
15131 @opindex finhibit-size-directive
15132 Don't output a @code{.size} assembler directive, or anything else that
15133 would cause trouble if the function is split in the middle, and the
15134 two halves are placed at locations far apart in memory.  This option is
15135 used when compiling @file{crtstuff.c}; you should not need to use it
15136 for anything else.
15137
15138 @item -fverbose-asm
15139 @opindex fverbose-asm
15140 Put extra commentary information in the generated assembly code to
15141 make it more readable.  This option is generally only of use to those
15142 who actually need to read the generated assembly code (perhaps while
15143 debugging the compiler itself).
15144
15145 @option{-fno-verbose-asm}, the default, causes the
15146 extra information to be omitted and is useful when comparing two assembler
15147 files.
15148
15149 @item -frecord-gcc-switches
15150 @opindex frecord-gcc-switches
15151 This switch causes the command line that was used to invoke the
15152 compiler to be recorded into the object file that is being created.
15153 This switch is only implemented on some targets and the exact format
15154 of the recording is target and binary file format dependent, but it
15155 usually takes the form of a section containing ASCII text.  This
15156 switch is related to the @option{-fverbose-asm} switch, but that
15157 switch only records information in the assembler output file as
15158 comments, so it never reaches the object file.
15159
15160 @item -fpic
15161 @opindex fpic
15162 @cindex global offset table
15163 @cindex PIC
15164 Generate position-independent code (PIC) suitable for use in a shared
15165 library, if supported for the target machine.  Such code accesses all
15166 constant addresses through a global offset table (GOT)@.  The dynamic
15167 loader resolves the GOT entries when the program starts (the dynamic
15168 loader is not part of GCC; it is part of the operating system).  If
15169 the GOT size for the linked executable exceeds a machine-specific
15170 maximum size, you get an error message from the linker indicating that
15171 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
15172 instead.  (These maximums are 8k on the SPARC and 32k
15173 on the m68k and RS/6000.  The 386 has no such limit.)
15174
15175 Position-independent code requires special support, and therefore works
15176 only on certain machines.  For the 386, GCC supports PIC for System V
15177 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
15178 position-independent.
15179
15180 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
15181 are defined to 1.
15182
15183 @item -fPIC
15184 @opindex fPIC
15185 If supported for the target machine, emit position-independent code,
15186 suitable for dynamic linking and avoiding any limit on the size of the
15187 global offset table.  This option makes a difference on the m68k,
15188 PowerPC and SPARC@.
15189
15190 Position-independent code requires special support, and therefore works
15191 only on certain machines.
15192
15193 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
15194 are defined to 2.
15195
15196 @item -fpie
15197 @itemx -fPIE
15198 @opindex fpie
15199 @opindex fPIE
15200 These options are similar to @option{-fpic} and @option{-fPIC}, but
15201 generated position independent code can be only linked into executables.
15202 Usually these options are used when @option{-pie} GCC option will be
15203 used during linking.
15204
15205 @option{-fpie} and @option{-fPIE} both define the macros
15206 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
15207 for @option{-fpie} and 2 for @option{-fPIE}.
15208
15209 @item -fno-jump-tables
15210 @opindex fno-jump-tables
15211 Do not use jump tables for switch statements even where it would be
15212 more efficient than other code generation strategies.  This option is
15213 of use in conjunction with @option{-fpic} or @option{-fPIC} for
15214 building code which forms part of a dynamic linker and cannot
15215 reference the address of a jump table.  On some targets, jump tables
15216 do not require a GOT and this option is not needed.
15217
15218 @item -ffixed-@var{reg}
15219 @opindex ffixed
15220 Treat the register named @var{reg} as a fixed register; generated code
15221 should never refer to it (except perhaps as a stack pointer, frame
15222 pointer or in some other fixed role).
15223
15224 @var{reg} must be the name of a register.  The register names accepted
15225 are machine-specific and are defined in the @code{REGISTER_NAMES}
15226 macro in the machine description macro file.
15227
15228 This flag does not have a negative form, because it specifies a
15229 three-way choice.
15230
15231 @item -fcall-used-@var{reg}
15232 @opindex fcall-used
15233 Treat the register named @var{reg} as an allocable register that is
15234 clobbered by function calls.  It may be allocated for temporaries or
15235 variables that do not live across a call.  Functions compiled this way
15236 will not save and restore the register @var{reg}.
15237
15238 It is an error to used this flag with the frame pointer or stack pointer.
15239 Use of this flag for other registers that have fixed pervasive roles in
15240 the machine's execution model will produce disastrous results.
15241
15242 This flag does not have a negative form, because it specifies a
15243 three-way choice.
15244
15245 @item -fcall-saved-@var{reg}
15246 @opindex fcall-saved
15247 Treat the register named @var{reg} as an allocable register saved by
15248 functions.  It may be allocated even for temporaries or variables that
15249 live across a call.  Functions compiled this way will save and restore
15250 the register @var{reg} if they use it.
15251
15252 It is an error to used this flag with the frame pointer or stack pointer.
15253 Use of this flag for other registers that have fixed pervasive roles in
15254 the machine's execution model will produce disastrous results.
15255
15256 A different sort of disaster will result from the use of this flag for
15257 a register in which function values may be returned.
15258
15259 This flag does not have a negative form, because it specifies a
15260 three-way choice.
15261
15262 @item -fpack-struct[=@var{n}]
15263 @opindex fpack-struct
15264 Without a value specified, pack all structure members together without
15265 holes.  When a value is specified (which must be a small power of two), pack
15266 structure members according to this value, representing the maximum
15267 alignment (that is, objects with default alignment requirements larger than
15268 this will be output potentially unaligned at the next fitting location.
15269
15270 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
15271 code that is not binary compatible with code generated without that switch.
15272 Additionally, it makes the code suboptimal.
15273 Use it to conform to a non-default application binary interface.
15274
15275 @item -finstrument-functions
15276 @opindex finstrument-functions
15277 Generate instrumentation calls for entry and exit to functions.  Just
15278 after function entry and just before function exit, the following
15279 profiling functions will be called with the address of the current
15280 function and its call site.  (On some platforms,
15281 @code{__builtin_return_address} does not work beyond the current
15282 function, so the call site information may not be available to the
15283 profiling functions otherwise.)
15284
15285 @smallexample
15286 void __cyg_profile_func_enter (void *this_fn,
15287                                void *call_site);
15288 void __cyg_profile_func_exit  (void *this_fn,
15289                                void *call_site);
15290 @end smallexample
15291
15292 The first argument is the address of the start of the current function,
15293 which may be looked up exactly in the symbol table.
15294
15295 This instrumentation is also done for functions expanded inline in other
15296 functions.  The profiling calls will indicate where, conceptually, the
15297 inline function is entered and exited.  This means that addressable
15298 versions of such functions must be available.  If all your uses of a
15299 function are expanded inline, this may mean an additional expansion of
15300 code size.  If you use @samp{extern inline} in your C code, an
15301 addressable version of such functions must be provided.  (This is
15302 normally the case anyways, but if you get lucky and the optimizer always
15303 expands the functions inline, you might have gotten away without
15304 providing static copies.)
15305
15306 A function may be given the attribute @code{no_instrument_function}, in
15307 which case this instrumentation will not be done.  This can be used, for
15308 example, for the profiling functions listed above, high-priority
15309 interrupt routines, and any functions from which the profiling functions
15310 cannot safely be called (perhaps signal handlers, if the profiling
15311 routines generate output or allocate memory).
15312
15313 @item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
15314 @opindex finstrument-functions-exclude-file-list
15315
15316 Set the list of functions that are excluded from instrumentation (see
15317 the description of @code{-finstrument-functions}).  If the file that
15318 contains a function definition matches with one of @var{file}, then
15319 that function is not instrumented.  The match is done on substrings:
15320 if the @var{file} parameter is a substring of the file name, it is
15321 considered to be a match.
15322
15323 For example,
15324 @code{-finstrument-functions-exclude-file-list=/bits/stl,include/sys}
15325 will exclude any inline function defined in files whose pathnames
15326 contain @code{/bits/stl} or @code{include/sys}.
15327
15328 If, for some reason, you want to include letter @code{','} in one of
15329 @var{sym}, write @code{'\,'}. For example,
15330 @code{-finstrument-functions-exclude-file-list='\,\,tmp'}
15331 (note the single quote surrounding the option).
15332
15333 @item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{}
15334 @opindex finstrument-functions-exclude-function-list
15335
15336 This is similar to @code{-finstrument-functions-exclude-file-list},
15337 but this option sets the list of function names to be excluded from
15338 instrumentation.  The function name to be matched is its user-visible
15339 name, such as @code{vector<int> blah(const vector<int> &)}, not the
15340 internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}).  The
15341 match is done on substrings: if the @var{sym} parameter is a substring
15342 of the function name, it is considered to be a match.
15343
15344 @item -fstack-check
15345 @opindex fstack-check
15346 Generate code to verify that you do not go beyond the boundary of the
15347 stack.  You should specify this flag if you are running in an
15348 environment with multiple threads, but only rarely need to specify it in
15349 a single-threaded environment since stack overflow is automatically
15350 detected on nearly all systems if there is only one stack.
15351
15352 Note that this switch does not actually cause checking to be done; the
15353 operating system or the language runtime must do that.  The switch causes
15354 generation of code to ensure that they see the stack being extended.
15355
15356 You can additionally specify a string parameter: @code{no} means no
15357 checking, @code{generic} means force the use of old-style checking,
15358 @code{specific} means use the best checking method and is equivalent
15359 to bare @option{-fstack-check}.
15360
15361 Old-style checking is a generic mechanism that requires no specific
15362 target support in the compiler but comes with the following drawbacks:
15363
15364 @enumerate
15365 @item
15366 Modified allocation strategy for large objects: they will always be
15367 allocated dynamically if their size exceeds a fixed threshold.
15368
15369 @item
15370 Fixed limit on the size of the static frame of functions: when it is
15371 topped by a particular function, stack checking is not reliable and
15372 a warning is issued by the compiler.
15373
15374 @item
15375 Inefficiency: because of both the modified allocation strategy and the
15376 generic implementation, the performances of the code are hampered.
15377 @end enumerate
15378
15379 Note that old-style stack checking is also the fallback method for
15380 @code{specific} if no target support has been added in the compiler.
15381
15382 @item -fstack-limit-register=@var{reg}
15383 @itemx -fstack-limit-symbol=@var{sym}
15384 @itemx -fno-stack-limit
15385 @opindex fstack-limit-register
15386 @opindex fstack-limit-symbol
15387 @opindex fno-stack-limit
15388 Generate code to ensure that the stack does not grow beyond a certain value,
15389 either the value of a register or the address of a symbol.  If the stack
15390 would grow beyond the value, a signal is raised.  For most targets,
15391 the signal is raised before the stack overruns the boundary, so
15392 it is possible to catch the signal without taking special precautions.
15393
15394 For instance, if the stack starts at absolute address @samp{0x80000000}
15395 and grows downwards, you can use the flags
15396 @option{-fstack-limit-symbol=__stack_limit} and
15397 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
15398 of 128KB@.  Note that this may only work with the GNU linker.
15399
15400 @cindex aliasing of parameters
15401 @cindex parameters, aliased
15402 @item -fargument-alias
15403 @itemx -fargument-noalias
15404 @itemx -fargument-noalias-global
15405 @itemx -fargument-noalias-anything
15406 @opindex fargument-alias
15407 @opindex fargument-noalias
15408 @opindex fargument-noalias-global
15409 @opindex fargument-noalias-anything
15410 Specify the possible relationships among parameters and between
15411 parameters and global data.
15412
15413 @option{-fargument-alias} specifies that arguments (parameters) may
15414 alias each other and may alias global storage.@*
15415 @option{-fargument-noalias} specifies that arguments do not alias
15416 each other, but may alias global storage.@*
15417 @option{-fargument-noalias-global} specifies that arguments do not
15418 alias each other and do not alias global storage.
15419 @option{-fargument-noalias-anything} specifies that arguments do not
15420 alias any other storage.
15421
15422 Each language will automatically use whatever option is required by
15423 the language standard.  You should not need to use these options yourself.
15424
15425 @item -fleading-underscore
15426 @opindex fleading-underscore
15427 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
15428 change the way C symbols are represented in the object file.  One use
15429 is to help link with legacy assembly code.
15430
15431 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
15432 generate code that is not binary compatible with code generated without that
15433 switch.  Use it to conform to a non-default application binary interface.
15434 Not all targets provide complete support for this switch.
15435
15436 @item -ftls-model=@var{model}
15437 @opindex ftls-model
15438 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
15439 The @var{model} argument should be one of @code{global-dynamic},
15440 @code{local-dynamic}, @code{initial-exec} or @code{local-exec}.
15441
15442 The default without @option{-fpic} is @code{initial-exec}; with
15443 @option{-fpic} the default is @code{global-dynamic}.
15444
15445 @item -fvisibility=@var{default|internal|hidden|protected}
15446 @opindex fvisibility
15447 Set the default ELF image symbol visibility to the specified option---all
15448 symbols will be marked with this unless overridden within the code.
15449 Using this feature can very substantially improve linking and
15450 load times of shared object libraries, produce more optimized
15451 code, provide near-perfect API export and prevent symbol clashes.
15452 It is @strong{strongly} recommended that you use this in any shared objects
15453 you distribute.
15454
15455 Despite the nomenclature, @code{default} always means public ie;
15456 available to be linked against from outside the shared object.
15457 @code{protected} and @code{internal} are pretty useless in real-world
15458 usage so the only other commonly used option will be @code{hidden}.
15459 The default if @option{-fvisibility} isn't specified is
15460 @code{default}, i.e., make every
15461 symbol public---this causes the same behavior as previous versions of
15462 GCC@.
15463
15464 A good explanation of the benefits offered by ensuring ELF
15465 symbols have the correct visibility is given by ``How To Write
15466 Shared Libraries'' by Ulrich Drepper (which can be found at
15467 @w{@uref{http://people.redhat.com/~drepper/}})---however a superior
15468 solution made possible by this option to marking things hidden when
15469 the default is public is to make the default hidden and mark things
15470 public.  This is the norm with DLL's on Windows and with @option{-fvisibility=hidden}
15471 and @code{__attribute__ ((visibility("default")))} instead of
15472 @code{__declspec(dllexport)} you get almost identical semantics with
15473 identical syntax.  This is a great boon to those working with
15474 cross-platform projects.
15475
15476 For those adding visibility support to existing code, you may find
15477 @samp{#pragma GCC visibility} of use.  This works by you enclosing
15478 the declarations you wish to set visibility for with (for example)
15479 @samp{#pragma GCC visibility push(hidden)} and
15480 @samp{#pragma GCC visibility pop}.
15481 Bear in mind that symbol visibility should be viewed @strong{as
15482 part of the API interface contract} and thus all new code should
15483 always specify visibility when it is not the default ie; declarations
15484 only for use within the local DSO should @strong{always} be marked explicitly
15485 as hidden as so to avoid PLT indirection overheads---making this
15486 abundantly clear also aids readability and self-documentation of the code.
15487 Note that due to ISO C++ specification requirements, operator new and
15488 operator delete must always be of default visibility.
15489
15490 Be aware that headers from outside your project, in particular system
15491 headers and headers from any other library you use, may not be
15492 expecting to be compiled with visibility other than the default.  You
15493 may need to explicitly say @samp{#pragma GCC visibility push(default)}
15494 before including any such headers.
15495
15496 @samp{extern} declarations are not affected by @samp{-fvisibility}, so
15497 a lot of code can be recompiled with @samp{-fvisibility=hidden} with
15498 no modifications.  However, this means that calls to @samp{extern}
15499 functions with no explicit visibility will use the PLT, so it is more
15500 effective to use @samp{__attribute ((visibility))} and/or
15501 @samp{#pragma GCC visibility} to tell the compiler which @samp{extern}
15502 declarations should be treated as hidden.
15503
15504 Note that @samp{-fvisibility} does affect C++ vague linkage
15505 entities. This means that, for instance, an exception class that will
15506 be thrown between DSOs must be explicitly marked with default
15507 visibility so that the @samp{type_info} nodes will be unified between
15508 the DSOs.
15509
15510 An overview of these techniques, their benefits and how to use them
15511 is at @w{@uref{http://gcc.gnu.org/wiki/Visibility}}.
15512
15513 @end table
15514
15515 @c man end
15516
15517 @node Environment Variables
15518 @section Environment Variables Affecting GCC
15519 @cindex environment variables
15520
15521 @c man begin ENVIRONMENT
15522 This section describes several environment variables that affect how GCC
15523 operates.  Some of them work by specifying directories or prefixes to use
15524 when searching for various kinds of files.  Some are used to specify other
15525 aspects of the compilation environment.
15526
15527 Note that you can also specify places to search using options such as
15528 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
15529 take precedence over places specified using environment variables, which
15530 in turn take precedence over those specified by the configuration of GCC@.
15531 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
15532 GNU Compiler Collection (GCC) Internals}.
15533
15534 @table @env
15535 @item LANG
15536 @itemx LC_CTYPE
15537 @c @itemx LC_COLLATE
15538 @itemx LC_MESSAGES
15539 @c @itemx LC_MONETARY
15540 @c @itemx LC_NUMERIC
15541 @c @itemx LC_TIME
15542 @itemx LC_ALL
15543 @findex LANG
15544 @findex LC_CTYPE
15545 @c @findex LC_COLLATE
15546 @findex LC_MESSAGES
15547 @c @findex LC_MONETARY
15548 @c @findex LC_NUMERIC
15549 @c @findex LC_TIME
15550 @findex LC_ALL
15551 @cindex locale
15552 These environment variables control the way that GCC uses
15553 localization information that allow GCC to work with different
15554 national conventions.  GCC inspects the locale categories
15555 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
15556 so.  These locale categories can be set to any value supported by your
15557 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
15558 Kingdom encoded in UTF-8.
15559
15560 The @env{LC_CTYPE} environment variable specifies character
15561 classification.  GCC uses it to determine the character boundaries in
15562 a string; this is needed for some multibyte encodings that contain quote
15563 and escape characters that would otherwise be interpreted as a string
15564 end or escape.
15565
15566 The @env{LC_MESSAGES} environment variable specifies the language to
15567 use in diagnostic messages.
15568
15569 If the @env{LC_ALL} environment variable is set, it overrides the value
15570 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
15571 and @env{LC_MESSAGES} default to the value of the @env{LANG}
15572 environment variable.  If none of these variables are set, GCC
15573 defaults to traditional C English behavior.
15574
15575 @item TMPDIR
15576 @findex TMPDIR
15577 If @env{TMPDIR} is set, it specifies the directory to use for temporary
15578 files.  GCC uses temporary files to hold the output of one stage of
15579 compilation which is to be used as input to the next stage: for example,
15580 the output of the preprocessor, which is the input to the compiler
15581 proper.
15582
15583 @item GCC_EXEC_PREFIX
15584 @findex GCC_EXEC_PREFIX
15585 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
15586 names of the subprograms executed by the compiler.  No slash is added
15587 when this prefix is combined with the name of a subprogram, but you can
15588 specify a prefix that ends with a slash if you wish.
15589
15590 If @env{GCC_EXEC_PREFIX} is not set, GCC will attempt to figure out
15591 an appropriate prefix to use based on the pathname it was invoked with.
15592
15593 If GCC cannot find the subprogram using the specified prefix, it
15594 tries looking in the usual places for the subprogram.
15595
15596 The default value of @env{GCC_EXEC_PREFIX} is
15597 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
15598 the installed compiler. In many cases @var{prefix} is the value
15599 of @code{prefix} when you ran the @file{configure} script.
15600
15601 Other prefixes specified with @option{-B} take precedence over this prefix.
15602
15603 This prefix is also used for finding files such as @file{crt0.o} that are
15604 used for linking.
15605
15606 In addition, the prefix is used in an unusual way in finding the
15607 directories to search for header files.  For each of the standard
15608 directories whose name normally begins with @samp{/usr/local/lib/gcc}
15609 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
15610 replacing that beginning with the specified prefix to produce an
15611 alternate directory name.  Thus, with @option{-Bfoo/}, GCC will search
15612 @file{foo/bar} where it would normally search @file{/usr/local/lib/bar}.
15613 These alternate directories are searched first; the standard directories
15614 come next. If a standard directory begins with the configured
15615 @var{prefix} then the value of @var{prefix} is replaced by
15616 @env{GCC_EXEC_PREFIX} when looking for header files.
15617
15618 @item COMPILER_PATH
15619 @findex COMPILER_PATH
15620 The value of @env{COMPILER_PATH} is a colon-separated list of
15621 directories, much like @env{PATH}.  GCC tries the directories thus
15622 specified when searching for subprograms, if it can't find the
15623 subprograms using @env{GCC_EXEC_PREFIX}.
15624
15625 @item LIBRARY_PATH
15626 @findex LIBRARY_PATH
15627 The value of @env{LIBRARY_PATH} is a colon-separated list of
15628 directories, much like @env{PATH}.  When configured as a native compiler,
15629 GCC tries the directories thus specified when searching for special
15630 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
15631 using GCC also uses these directories when searching for ordinary
15632 libraries for the @option{-l} option (but directories specified with
15633 @option{-L} come first).
15634
15635 @item LANG
15636 @findex LANG
15637 @cindex locale definition
15638 This variable is used to pass locale information to the compiler.  One way in
15639 which this information is used is to determine the character set to be used
15640 when character literals, string literals and comments are parsed in C and C++.
15641 When the compiler is configured to allow multibyte characters,
15642 the following values for @env{LANG} are recognized:
15643
15644 @table @samp
15645 @item C-JIS
15646 Recognize JIS characters.
15647 @item C-SJIS
15648 Recognize SJIS characters.
15649 @item C-EUCJP
15650 Recognize EUCJP characters.
15651 @end table
15652
15653 If @env{LANG} is not defined, or if it has some other value, then the
15654 compiler will use mblen and mbtowc as defined by the default locale to
15655 recognize and translate multibyte characters.
15656 @end table
15657
15658 @noindent
15659 Some additional environments variables affect the behavior of the
15660 preprocessor.
15661
15662 @include cppenv.texi
15663
15664 @c man end
15665
15666 @node Precompiled Headers
15667 @section Using Precompiled Headers
15668 @cindex precompiled headers
15669 @cindex speed of compilation
15670
15671 Often large projects have many header files that are included in every
15672 source file.  The time the compiler takes to process these header files
15673 over and over again can account for nearly all of the time required to
15674 build the project.  To make builds faster, GCC allows users to
15675 `precompile' a header file; then, if builds can use the precompiled
15676 header file they will be much faster.
15677
15678 To create a precompiled header file, simply compile it as you would any
15679 other file, if necessary using the @option{-x} option to make the driver
15680 treat it as a C or C++ header file.  You will probably want to use a
15681 tool like @command{make} to keep the precompiled header up-to-date when
15682 the headers it contains change.
15683
15684 A precompiled header file will be searched for when @code{#include} is
15685 seen in the compilation.  As it searches for the included file
15686 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
15687 compiler looks for a precompiled header in each directory just before it
15688 looks for the include file in that directory.  The name searched for is
15689 the name specified in the @code{#include} with @samp{.gch} appended.  If
15690 the precompiled header file can't be used, it is ignored.
15691
15692 For instance, if you have @code{#include "all.h"}, and you have
15693 @file{all.h.gch} in the same directory as @file{all.h}, then the
15694 precompiled header file will be used if possible, and the original
15695 header will be used otherwise.
15696
15697 Alternatively, you might decide to put the precompiled header file in a
15698 directory and use @option{-I} to ensure that directory is searched
15699 before (or instead of) the directory containing the original header.
15700 Then, if you want to check that the precompiled header file is always
15701 used, you can put a file of the same name as the original header in this
15702 directory containing an @code{#error} command.
15703
15704 This also works with @option{-include}.  So yet another way to use
15705 precompiled headers, good for projects not designed with precompiled
15706 header files in mind, is to simply take most of the header files used by
15707 a project, include them from another header file, precompile that header
15708 file, and @option{-include} the precompiled header.  If the header files
15709 have guards against multiple inclusion, they will be skipped because
15710 they've already been included (in the precompiled header).
15711
15712 If you need to precompile the same header file for different
15713 languages, targets, or compiler options, you can instead make a
15714 @emph{directory} named like @file{all.h.gch}, and put each precompiled
15715 header in the directory, perhaps using @option{-o}.  It doesn't matter
15716 what you call the files in the directory, every precompiled header in
15717 the directory will be considered.  The first precompiled header
15718 encountered in the directory that is valid for this compilation will
15719 be used; they're searched in no particular order.
15720
15721 There are many other possibilities, limited only by your imagination,
15722 good sense, and the constraints of your build system.
15723
15724 A precompiled header file can be used only when these conditions apply:
15725
15726 @itemize
15727 @item
15728 Only one precompiled header can be used in a particular compilation.
15729
15730 @item
15731 A precompiled header can't be used once the first C token is seen.  You
15732 can have preprocessor directives before a precompiled header; you can
15733 even include a precompiled header from inside another header, so long as
15734 there are no C tokens before the @code{#include}.
15735
15736 @item
15737 The precompiled header file must be produced for the same language as
15738 the current compilation.  You can't use a C precompiled header for a C++
15739 compilation.
15740
15741 @item
15742 The precompiled header file must have been produced by the same compiler
15743 binary as the current compilation is using.
15744
15745 @item
15746 Any macros defined before the precompiled header is included must
15747 either be defined in the same way as when the precompiled header was
15748 generated, or must not affect the precompiled header, which usually
15749 means that they don't appear in the precompiled header at all.
15750
15751 The @option{-D} option is one way to define a macro before a
15752 precompiled header is included; using a @code{#define} can also do it.
15753 There are also some options that define macros implicitly, like
15754 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
15755 defined this way.
15756
15757 @item If debugging information is output when using the precompiled
15758 header, using @option{-g} or similar, the same kind of debugging information
15759 must have been output when building the precompiled header.  However,
15760 a precompiled header built using @option{-g} can be used in a compilation
15761 when no debugging information is being output.
15762
15763 @item The same @option{-m} options must generally be used when building
15764 and using the precompiled header.  @xref{Submodel Options},
15765 for any cases where this rule is relaxed.
15766
15767 @item Each of the following options must be the same when building and using
15768 the precompiled header:
15769
15770 @gccoptlist{-fexceptions}
15771
15772 @item
15773 Some other command-line options starting with @option{-f},
15774 @option{-p}, or @option{-O} must be defined in the same way as when
15775 the precompiled header was generated.  At present, it's not clear
15776 which options are safe to change and which are not; the safest choice
15777 is to use exactly the same options when generating and using the
15778 precompiled header.  The following are known to be safe:
15779
15780 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
15781 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
15782 -fsched-verbose=<number>  -fschedule-insns  -fvisibility= @gol
15783 -pedantic-errors}
15784
15785 @end itemize
15786
15787 For all of these except the last, the compiler will automatically
15788 ignore the precompiled header if the conditions aren't met.  If you
15789 find an option combination that doesn't work and doesn't cause the
15790 precompiled header to be ignored, please consider filing a bug report,
15791 see @ref{Bugs}.
15792
15793 If you do use differing options when generating and using the
15794 precompiled header, the actual behavior will be a mixture of the
15795 behavior for the options.  For instance, if you use @option{-g} to
15796 generate the precompiled header but not when using it, you may or may
15797 not get debugging information for routines in the precompiled header.
15798
15799 @node Running Protoize
15800 @section Running Protoize
15801
15802 The program @code{protoize} is an optional part of GCC@.  You can use
15803 it to add prototypes to a program, thus converting the program to ISO
15804 C in one respect.  The companion program @code{unprotoize} does the
15805 reverse: it removes argument types from any prototypes that are found.
15806
15807 When you run these programs, you must specify a set of source files as
15808 command line arguments.  The conversion programs start out by compiling
15809 these files to see what functions they define.  The information gathered
15810 about a file @var{foo} is saved in a file named @file{@var{foo}.X}.
15811
15812 After scanning comes actual conversion.  The specified files are all
15813 eligible to be converted; any files they include (whether sources or
15814 just headers) are eligible as well.
15815
15816 But not all the eligible files are converted.  By default,
15817 @code{protoize} and @code{unprotoize} convert only source and header
15818 files in the current directory.  You can specify additional directories
15819 whose files should be converted with the @option{-d @var{directory}}
15820 option.  You can also specify particular files to exclude with the
15821 @option{-x @var{file}} option.  A file is converted if it is eligible, its
15822 directory name matches one of the specified directory names, and its
15823 name within the directory has not been excluded.
15824
15825 Basic conversion with @code{protoize} consists of rewriting most
15826 function definitions and function declarations to specify the types of
15827 the arguments.  The only ones not rewritten are those for varargs
15828 functions.
15829
15830 @code{protoize} optionally inserts prototype declarations at the
15831 beginning of the source file, to make them available for any calls that
15832 precede the function's definition.  Or it can insert prototype
15833 declarations with block scope in the blocks where undeclared functions
15834 are called.
15835
15836 Basic conversion with @code{unprotoize} consists of rewriting most
15837 function declarations to remove any argument types, and rewriting
15838 function definitions to the old-style pre-ISO form.
15839
15840 Both conversion programs print a warning for any function declaration or
15841 definition that they can't convert.  You can suppress these warnings
15842 with @option{-q}.
15843
15844 The output from @code{protoize} or @code{unprotoize} replaces the
15845 original source file.  The original file is renamed to a name ending
15846 with @samp{.save} (for DOS, the saved filename ends in @samp{.sav}
15847 without the original @samp{.c} suffix).  If the @samp{.save} (@samp{.sav}
15848 for DOS) file already exists, then the source file is simply discarded.
15849
15850 @code{protoize} and @code{unprotoize} both depend on GCC itself to
15851 scan the program and collect information about the functions it uses.
15852 So neither of these programs will work until GCC is installed.
15853
15854 Here is a table of the options you can use with @code{protoize} and
15855 @code{unprotoize}.  Each option works with both programs unless
15856 otherwise stated.
15857
15858 @table @code
15859 @item -B @var{directory}
15860 Look for the file @file{SYSCALLS.c.X} in @var{directory}, instead of the
15861 usual directory (normally @file{/usr/local/lib}).  This file contains
15862 prototype information about standard system functions.  This option
15863 applies only to @code{protoize}.
15864
15865 @item -c @var{compilation-options}
15866 Use @var{compilation-options} as the options when running @command{gcc} to
15867 produce the @samp{.X} files.  The special option @option{-aux-info} is
15868 always passed in addition, to tell @command{gcc} to write a @samp{.X} file.
15869
15870 Note that the compilation options must be given as a single argument to
15871 @code{protoize} or @code{unprotoize}.  If you want to specify several
15872 @command{gcc} options, you must quote the entire set of compilation options
15873 to make them a single word in the shell.
15874
15875 There are certain @command{gcc} arguments that you cannot use, because they
15876 would produce the wrong kind of output.  These include @option{-g},
15877 @option{-O}, @option{-c}, @option{-S}, and @option{-o} If you include these in
15878 the @var{compilation-options}, they are ignored.
15879
15880 @item -C
15881 Rename files to end in @samp{.C} (@samp{.cc} for DOS-based file
15882 systems) instead of @samp{.c}.  This is convenient if you are converting
15883 a C program to C++.  This option applies only to @code{protoize}.
15884
15885 @item -g
15886 Add explicit global declarations.  This means inserting explicit
15887 declarations at the beginning of each source file for each function
15888 that is called in the file and was not declared.  These declarations
15889 precede the first function definition that contains a call to an
15890 undeclared function.  This option applies only to @code{protoize}.
15891
15892 @item -i @var{string}
15893 Indent old-style parameter declarations with the string @var{string}.
15894 This option applies only to @code{protoize}.
15895
15896 @code{unprotoize} converts prototyped function definitions to old-style
15897 function definitions, where the arguments are declared between the
15898 argument list and the initial @samp{@{}.  By default, @code{unprotoize}
15899 uses five spaces as the indentation.  If you want to indent with just
15900 one space instead, use @option{-i " "}.
15901
15902 @item -k
15903 Keep the @samp{.X} files.  Normally, they are deleted after conversion
15904 is finished.
15905
15906 @item -l
15907 Add explicit local declarations.  @code{protoize} with @option{-l} inserts
15908 a prototype declaration for each function in each block which calls the
15909 function without any declaration.  This option applies only to
15910 @code{protoize}.
15911
15912 @item -n
15913 Make no real changes.  This mode just prints information about the conversions
15914 that would have been done without @option{-n}.
15915
15916 @item -N
15917 Make no @samp{.save} files.  The original files are simply deleted.
15918 Use this option with caution.
15919
15920 @item -p @var{program}
15921 Use the program @var{program} as the compiler.  Normally, the name
15922 @file{gcc} is used.
15923
15924 @item -q
15925 Work quietly.  Most warnings are suppressed.
15926
15927 @item -v
15928 Print the version number, just like @option{-v} for @command{gcc}.
15929 @end table
15930
15931 If you need special compiler options to compile one of your program's
15932 source files, then you should generate that file's @samp{.X} file
15933 specially, by running @command{gcc} on that source file with the
15934 appropriate options and the option @option{-aux-info}.  Then run
15935 @code{protoize} on the entire set of files.  @code{protoize} will use
15936 the existing @samp{.X} file because it is newer than the source file.
15937 For example:
15938
15939 @smallexample
15940 gcc -Dfoo=bar file1.c -aux-info file1.X
15941 protoize *.c
15942 @end smallexample
15943
15944 @noindent
15945 You need to include the special files along with the rest in the
15946 @code{protoize} command, even though their @samp{.X} files already
15947 exist, because otherwise they won't get converted.
15948
15949 @xref{Protoize Caveats}, for more information on how to use
15950 @code{protoize} successfully.