OSDN Git Service

gcc/
[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 -floop-block -floop-interchange -floop-strip-mine @gol
342 -fmerge-all-constants -fmerge-constants -fmodulo-sched @gol
343 -fmodulo-sched-allow-regmoves -fmove-loop-invariants -fmudflap @gol
344 -fmudflapir -fmudflapth -fno-branch-count-reg -fno-default-inline @gol
345 -fno-defer-pop -fno-function-cse -fno-guess-branch-probability @gol
346 -fno-inline -fno-math-errno -fno-peephole -fno-peephole2 @gol
347 -fno-sched-interblock -fno-sched-spec -fno-signed-zeros @gol
348 -fno-toplevel-reorder -fno-trapping-math -fno-zero-initialized-in-bss @gol
349 -fomit-frame-pointer -foptimize-register-move -foptimize-sibling-calls @gol
350 -fpeel-loops -fpredictive-commoning -fprefetch-loop-arrays @gol
351 -fprofile-correction -fprofile-dir=@var{path} -fprofile-generate @gol
352 -fprofile-generate=@var{path} @gol
353 -fprofile-use -fprofile-use=@var{path} -fprofile-values @gol
354 -freciprocal-math -fregmove -frename-registers -freorder-blocks @gol
355 -freorder-blocks-and-partition -freorder-functions @gol
356 -frerun-cse-after-loop -freschedule-modulo-scheduled-loops @gol
357 -frounding-math -frtl-abstract-sequences -fsched2-use-superblocks @gol
358 -fsched2-use-traces -fsched-spec-load -fsched-spec-load-dangerous @gol
359 -fsched-stalled-insns-dep[=@var{n}] -fsched-stalled-insns[=@var{n}] @gol
360 -fschedule-insns -fschedule-insns2 -fsection-anchors -fsee @gol
361 -fselective-scheduling -fselective-scheduling2 @gol
362 -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops @gol
363 -fsignaling-nans -fsingle-precision-constant -fsplit-ivs-in-unroller @gol
364 -fsplit-wide-types -fstack-protector -fstack-protector-all @gol
365 -fstrict-aliasing -fstrict-overflow -fthread-jumps -ftracer @gol
366 -ftree-builtin-call-dce -ftree-ccp -ftree-ch -ftree-copy-prop @gol
367 -ftree-copyrename -ftree-dce @gol
368 -ftree-dominator-opts -ftree-dse -ftree-fre -ftree-loop-im @gol
369 -ftree-loop-distribution @gol
370 -ftree-loop-ivcanon -ftree-loop-linear -ftree-loop-optimize @gol
371 -ftree-parallelize-loops=@var{n} -ftree-pre -ftree-reassoc @gol
372 -ftree-sink -ftree-sra -ftree-switch-conversion @gol
373 -ftree-ter -ftree-vect-loop-version -ftree-vectorize -ftree-vrp @gol
374 -funit-at-a-time -funroll-all-loops -funroll-loops @gol
375 -funsafe-loop-optimizations -funsafe-math-optimizations -funswitch-loops @gol
376 -fvariable-expansion-in-unroller -fvect-cost-model -fvpt -fweb @gol
377 -fwhole-program @gol
378 --param @var{name}=@var{value}
379 -O  -O0  -O1  -O2  -O3  -Os}
380
381 @item Preprocessor Options
382 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
383 @gccoptlist{-A@var{question}=@var{answer} @gol
384 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
385 -C  -dD  -dI  -dM  -dN @gol
386 -D@var{macro}@r{[}=@var{defn}@r{]}  -E  -H @gol
387 -idirafter @var{dir} @gol
388 -include @var{file}  -imacros @var{file} @gol
389 -iprefix @var{file}  -iwithprefix @var{dir} @gol
390 -iwithprefixbefore @var{dir}  -isystem @var{dir} @gol
391 -imultilib @var{dir} -isysroot @var{dir} @gol
392 -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  @gol
393 -P  -fworking-directory  -remap @gol
394 -trigraphs  -undef  -U@var{macro}  -Wp,@var{option} @gol
395 -Xpreprocessor @var{option}}
396
397 @item Assembler Option
398 @xref{Assembler Options,,Passing Options to the Assembler}.
399 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
400
401 @item Linker Options
402 @xref{Link Options,,Options for Linking}.
403 @gccoptlist{@var{object-file-name}  -l@var{library} @gol
404 -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic @gol
405 -s  -static  -static-libgcc  -shared  -shared-libgcc  -symbolic @gol
406 -Wl,@var{option}  -Xlinker @var{option} @gol
407 -u @var{symbol}}
408
409 @item Directory Options
410 @xref{Directory Options,,Options for Directory Search}.
411 @gccoptlist{-B@var{prefix}  -I@var{dir}  -iquote@var{dir}  -L@var{dir}
412 -specs=@var{file}  -I- --sysroot=@var{dir}}
413
414 @item Target Options
415 @c I wrote this xref this way to avoid overfull hbox. -- rms
416 @xref{Target Options}.
417 @gccoptlist{-V @var{version}  -b @var{machine}}
418
419 @item Machine Dependent Options
420 @xref{Submodel Options,,Hardware Models and Configurations}.
421 @c This list is ordered alphanumerically by subsection name.
422 @c Try and put the significant identifier (CPU or system) first,
423 @c so users have a clue at guessing where the ones they want will be.
424
425 @emph{ARC Options}
426 @gccoptlist{-EB  -EL @gol
427 -mmangle-cpu  -mcpu=@var{cpu}  -mtext=@var{text-section} @gol
428 -mdata=@var{data-section}  -mrodata=@var{readonly-data-section}}
429
430 @emph{ARM Options}
431 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
432 -mabi=@var{name} @gol
433 -mapcs-stack-check  -mno-apcs-stack-check @gol
434 -mapcs-float  -mno-apcs-float @gol
435 -mapcs-reentrant  -mno-apcs-reentrant @gol
436 -msched-prolog  -mno-sched-prolog @gol
437 -mlittle-endian  -mbig-endian  -mwords-little-endian @gol
438 -mfloat-abi=@var{name}  -msoft-float  -mhard-float  -mfpe @gol
439 -mthumb-interwork  -mno-thumb-interwork @gol
440 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
441 -mstructure-size-boundary=@var{n} @gol
442 -mabort-on-noreturn @gol
443 -mlong-calls  -mno-long-calls @gol
444 -msingle-pic-base  -mno-single-pic-base @gol
445 -mpic-register=@var{reg} @gol
446 -mnop-fun-dllimport @gol
447 -mcirrus-fix-invalid-insns -mno-cirrus-fix-invalid-insns @gol
448 -mpoke-function-name @gol
449 -mthumb  -marm @gol
450 -mtpcs-frame  -mtpcs-leaf-frame @gol
451 -mcaller-super-interworking  -mcallee-super-interworking @gol
452 -mtp=@var{name}
453 -mword-relocations}
454
455 @emph{AVR Options}
456 @gccoptlist{-mmcu=@var{mcu}  -msize  -minit-stack=@var{n}  -mno-interrupts @gol
457 -mcall-prologues  -mno-tablejump  -mtiny-stack  -mint8}
458
459 @emph{Blackfin Options}
460 @gccoptlist{-mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]} @gol
461 -msim -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
462 -mspecld-anomaly  -mno-specld-anomaly  -mcsync-anomaly  -mno-csync-anomaly @gol
463 -mlow-64k -mno-low64k  -mstack-check-l1  -mid-shared-library @gol
464 -mno-id-shared-library  -mshared-library-id=@var{n} @gol
465 -mleaf-id-shared-library  -mno-leaf-id-shared-library @gol
466 -msep-data  -mno-sep-data  -mlong-calls  -mno-long-calls @gol
467 -mfast-fp -minline-plt -mmulticore  -mcorea  -mcoreb  -msdram}
468
469 @emph{CRIS Options}
470 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
471 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
472 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
473 -mstack-align  -mdata-align  -mconst-align @gol
474 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
475 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
476 -mmul-bug-workaround  -mno-mul-bug-workaround}
477
478 @emph{CRX Options}
479 @gccoptlist{-mmac -mpush-args}
480
481 @emph{Darwin Options}
482 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
483 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
484 -client_name  -compatibility_version  -current_version @gol
485 -dead_strip @gol
486 -dependency-file  -dylib_file  -dylinker_install_name @gol
487 -dynamic  -dynamiclib  -exported_symbols_list @gol
488 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
489 -force_flat_namespace  -headerpad_max_install_names @gol
490 -iframework @gol
491 -image_base  -init  -install_name  -keep_private_externs @gol
492 -multi_module  -multiply_defined  -multiply_defined_unused @gol
493 -noall_load   -no_dead_strip_inits_and_terms @gol
494 -nofixprebinding -nomultidefs  -noprebind  -noseglinkedit @gol
495 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
496 -private_bundle  -read_only_relocs  -sectalign @gol
497 -sectobjectsymbols  -whyload  -seg1addr @gol
498 -sectcreate  -sectobjectsymbols  -sectorder @gol
499 -segaddr -segs_read_only_addr -segs_read_write_addr @gol
500 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
501 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
502 -single_module  -static  -sub_library  -sub_umbrella @gol
503 -twolevel_namespace  -umbrella  -undefined @gol
504 -unexported_symbols_list  -weak_reference_mismatches @gol
505 -whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} @gol
506 -mkernel -mone-byte-bool}
507
508 @emph{DEC Alpha Options}
509 @gccoptlist{-mno-fp-regs  -msoft-float  -malpha-as  -mgas @gol
510 -mieee  -mieee-with-inexact  -mieee-conformant @gol
511 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
512 -mtrap-precision=@var{mode}  -mbuild-constants @gol
513 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
514 -mbwx  -mmax  -mfix  -mcix @gol
515 -mfloat-vax  -mfloat-ieee @gol
516 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
517 -msmall-text  -mlarge-text @gol
518 -mmemory-latency=@var{time}}
519
520 @emph{DEC Alpha/VMS Options}
521 @gccoptlist{-mvms-return-codes}
522
523 @emph{FRV Options}
524 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
525 -mhard-float  -msoft-float @gol
526 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
527 -mdouble  -mno-double @gol
528 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
529 -mfdpic  -minline-plt -mgprel-ro  -multilib-library-pic @gol
530 -mlinked-fp  -mlong-calls  -malign-labels @gol
531 -mlibrary-pic  -macc-4  -macc-8 @gol
532 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
533 -moptimize-membar -mno-optimize-membar @gol
534 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
535 -mvliw-branch  -mno-vliw-branch @gol
536 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
537 -mno-nested-cond-exec  -mtomcat-stats @gol
538 -mTLS -mtls @gol
539 -mcpu=@var{cpu}}
540
541 @emph{GNU/Linux Options}
542 @gccoptlist{-muclibc}
543
544 @emph{H8/300 Options}
545 @gccoptlist{-mrelax  -mh  -ms  -mn  -mint32  -malign-300}
546
547 @emph{HPPA Options}
548 @gccoptlist{-march=@var{architecture-type} @gol
549 -mbig-switch  -mdisable-fpregs  -mdisable-indexing @gol
550 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
551 -mfixed-range=@var{register-range} @gol
552 -mjump-in-delay -mlinker-opt -mlong-calls @gol
553 -mlong-load-store  -mno-big-switch  -mno-disable-fpregs @gol
554 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
555 -mno-jump-in-delay  -mno-long-load-store @gol
556 -mno-portable-runtime  -mno-soft-float @gol
557 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
558 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
559 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
560 -munix=@var{unix-std}  -nolibdld  -static  -threads}
561
562 @emph{i386 and x86-64 Options}
563 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
564 -mfpmath=@var{unit} @gol
565 -masm=@var{dialect}  -mno-fancy-math-387 @gol
566 -mno-fp-ret-in-387  -msoft-float @gol
567 -mno-wide-multiply  -mrtd  -malign-double @gol
568 -mpreferred-stack-boundary=@var{num}
569 -mincoming-stack-boundary=@var{num}
570 -mcld -mcx16 -msahf -mrecip @gol
571 -mmmx  -msse  -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -msse4 -mavx @gol
572 -maes -mpclmul @gol
573 -msse4a -m3dnow -mpopcnt -mabm -msse5 @gol
574 -mthreads  -mno-align-stringops  -minline-all-stringops @gol
575 -minline-stringops-dynamically -mstringop-strategy=@var{alg} @gol
576 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
577 -m96bit-long-double  -mregparm=@var{num}  -msseregparm @gol
578 -mveclibabi=@var{type} -mpc32 -mpc64 -mpc80 -mstackrealign @gol
579 -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs @gol
580 -mcmodel=@var{code-model} @gol
581 -m32  -m64 -mlarge-data-threshold=@var{num} @gol
582 -mfused-madd -mno-fused-madd}
583
584 @emph{IA-64 Options}
585 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
586 -mvolatile-asm-stop  -mregister-names  -mno-sdata @gol
587 -mconstant-gp  -mauto-pic  -minline-float-divide-min-latency @gol
588 -minline-float-divide-max-throughput @gol
589 -minline-int-divide-min-latency @gol
590 -minline-int-divide-max-throughput  @gol
591 -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
592 -mno-dwarf2-asm -mearly-stop-bits @gol
593 -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
594 -mtune=@var{cpu-type} -mt -pthread -milp32 -mlp64 @gol
595 -mno-sched-br-data-spec -msched-ar-data-spec -mno-sched-control-spec @gol
596 -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec @gol
597 -msched-ldc -mno-sched-control-ldc -mno-sched-spec-verbose @gol
598 -mno-sched-prefer-non-data-spec-insns @gol
599 -mno-sched-prefer-non-control-spec-insns @gol
600 -mno-sched-count-spec-in-critical-path}
601
602 @emph{M32R/D Options}
603 @gccoptlist{-m32r2 -m32rx -m32r @gol
604 -mdebug @gol
605 -malign-loops -mno-align-loops @gol
606 -missue-rate=@var{number} @gol
607 -mbranch-cost=@var{number} @gol
608 -mmodel=@var{code-size-model-type} @gol
609 -msdata=@var{sdata-type} @gol
610 -mno-flush-func -mflush-func=@var{name} @gol
611 -mno-flush-trap -mflush-trap=@var{number} @gol
612 -G @var{num}}
613
614 @emph{M32C Options}
615 @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
616
617 @emph{M680x0 Options}
618 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu}  -mtune=@var{tune}
619 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
620 -m68060  -mcpu32  -m5200  -m5206e  -m528x  -m5307  -m5407 @gol
621 -mcfv4e  -mbitfield  -mno-bitfield  -mc68000  -mc68020 @gol
622 -mnobitfield  -mrtd  -mno-rtd  -mdiv  -mno-div  -mshort @gol
623 -mno-short  -mhard-float  -m68881  -msoft-float  -mpcrel @gol
624 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
625 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library @gol
626 -mxgot -mno-xgot}
627
628 @emph{M68hc1x Options}
629 @gccoptlist{-m6811  -m6812  -m68hc11  -m68hc12   -m68hcs12 @gol
630 -mauto-incdec  -minmax  -mlong-calls  -mshort @gol
631 -msoft-reg-count=@var{count}}
632
633 @emph{MCore Options}
634 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
635 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
636 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
637 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
638 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
639
640 @emph{MIPS Options}
641 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
642 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2 @gol
643 -mips64  -mips64r2 @gol
644 -mips16  -mno-mips16  -mflip-mips16 @gol
645 -minterlink-mips16  -mno-interlink-mips16 @gol
646 -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
647 -mshared  -mno-shared  -mplt  -mno-plt  -mxgot  -mno-xgot @gol
648 -mgp32  -mgp64  -mfp32  -mfp64  -mhard-float  -msoft-float @gol
649 -msingle-float  -mdouble-float  -mdsp  -mno-dsp  -mdspr2  -mno-dspr2 @gol
650 -msmartmips  -mno-smartmips @gol
651 -mpaired-single  -mno-paired-single  -mdmx  -mno-mdmx @gol
652 -mips3d  -mno-mips3d  -mmt  -mno-mt  -mllsc  -mno-llsc @gol
653 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
654 -G@var{num}  -mlocal-sdata  -mno-local-sdata @gol
655 -mextern-sdata  -mno-extern-sdata  -mgpopt  -mno-gopt @gol
656 -membedded-data  -mno-embedded-data @gol
657 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
658 -mcode-readable=@var{setting} @gol
659 -msplit-addresses  -mno-split-addresses @gol
660 -mexplicit-relocs  -mno-explicit-relocs @gol
661 -mcheck-zero-division  -mno-check-zero-division @gol
662 -mdivide-traps  -mdivide-breaks @gol
663 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
664 -mmad  -mno-mad  -mfused-madd  -mno-fused-madd  -nocpp @gol
665 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
666 -mfix-vr4120  -mno-fix-vr4120  -mfix-vr4130  -mno-fix-vr4130 @gol
667 -mfix-sb1  -mno-fix-sb1 @gol
668 -mflush-func=@var{func}  -mno-flush-func @gol
669 -mbranch-cost=@var{num}  -mbranch-likely  -mno-branch-likely @gol
670 -mfp-exceptions -mno-fp-exceptions @gol
671 -mvr4130-align -mno-vr4130-align}
672
673 @emph{MMIX Options}
674 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
675 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
676 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
677 -mno-base-addresses  -msingle-exit  -mno-single-exit}
678
679 @emph{MN10300 Options}
680 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
681 -mam33  -mno-am33 @gol
682 -mam33-2  -mno-am33-2 @gol
683 -mreturn-pointer-on-d0 @gol
684 -mno-crt0  -mrelax}
685
686 @emph{PDP-11 Options}
687 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
688 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
689 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
690 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
691 -mbranch-expensive  -mbranch-cheap @gol
692 -msplit  -mno-split  -munix-asm  -mdec-asm}
693
694 @emph{picoChip Options}
695 @gccoptlist{-mae=@var{ae_type} -mvliw-lookahead=@var{N}
696 -msymbol-as-address -mno-inefficient-warnings}
697
698 @emph{PowerPC Options}
699 See RS/6000 and PowerPC Options.
700
701 @emph{RS/6000 and PowerPC Options}
702 @gccoptlist{-mcpu=@var{cpu-type} @gol
703 -mtune=@var{cpu-type} @gol
704 -mpower  -mno-power  -mpower2  -mno-power2 @gol
705 -mpowerpc  -mpowerpc64  -mno-powerpc @gol
706 -maltivec  -mno-altivec @gol
707 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
708 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
709 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb  -mfprnd  -mno-fprnd @gol
710 -mcmpb -mno-cmpb -mmfpgpr -mno-mfpgpr -mhard-dfp -mno-hard-dfp @gol
711 -mnew-mnemonics  -mold-mnemonics @gol
712 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
713 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
714 -malign-power  -malign-natural @gol
715 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
716 -mstring  -mno-string  -mupdate  -mno-update @gol
717 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
718 -mstrict-align  -mno-strict-align  -mrelocatable @gol
719 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
720 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
721 -mdynamic-no-pic  -maltivec  -mswdiv @gol
722 -mprioritize-restricted-insns=@var{priority} @gol
723 -msched-costly-dep=@var{dependence_type} @gol
724 -minsert-sched-nops=@var{scheme} @gol
725 -mcall-sysv  -mcall-netbsd @gol
726 -maix-struct-return  -msvr4-struct-return @gol
727 -mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
728 -misel -mno-isel @gol
729 -misel=yes  -misel=no @gol
730 -mspe -mno-spe @gol
731 -mspe=yes  -mspe=no @gol
732 -mpaired @gol
733 -mvrsave -mno-vrsave @gol
734 -mmulhw -mno-mulhw @gol
735 -mdlmzb -mno-dlmzb @gol
736 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
737 -mprototype  -mno-prototype @gol
738 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
739 -msdata=@var{opt}  -mvxworks  -G @var{num}  -pthread}
740
741 @emph{S/390 and zSeries Options}
742 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
743 -mhard-float  -msoft-float -mlong-double-64 -mlong-double-128 @gol
744 -mbackchain  -mno-backchain -mpacked-stack  -mno-packed-stack @gol
745 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
746 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
747 -mtpf-trace -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
748 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size -mstack-guard}
749
750 @emph{Score Options}
751 @gccoptlist{-meb -mel @gol
752 -mnhwloop @gol
753 -muls @gol
754 -mmac @gol
755 -mscore5 -mscore5u -mscore7 -mscore7d}
756
757 @emph{SH Options}
758 @gccoptlist{-m1  -m2  -m2e  -m3  -m3e @gol
759 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
760 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol
761 -m5-64media  -m5-64media-nofpu @gol
762 -m5-32media  -m5-32media-nofpu @gol
763 -m5-compact  -m5-compact-nofpu @gol
764 -mb  -ml  -mdalign  -mrelax @gol
765 -mbigtable  -mfmovd  -mhitachi -mrenesas -mno-renesas -mnomacsave @gol
766 -mieee  -mbitops  -misize  -minline-ic_invalidate -mpadstruct  -mspace @gol
767 -mprefergot  -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
768 -mdivsi3_libfunc=@var{name} -mfixed-range=@var{register-range} @gol
769 -madjust-unroll -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol
770 -minvalid-symbols}
771
772 @emph{SPARC Options}
773 @gccoptlist{-mcpu=@var{cpu-type} @gol
774 -mtune=@var{cpu-type} @gol
775 -mcmodel=@var{code-model} @gol
776 -m32  -m64  -mapp-regs  -mno-app-regs @gol
777 -mfaster-structs  -mno-faster-structs @gol
778 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
779 -mhard-quad-float  -msoft-quad-float @gol
780 -mimpure-text  -mno-impure-text  -mlittle-endian @gol
781 -mstack-bias  -mno-stack-bias @gol
782 -munaligned-doubles  -mno-unaligned-doubles @gol
783 -mv8plus  -mno-v8plus  -mvis  -mno-vis
784 -threads -pthreads -pthread}
785
786 @emph{SPU Options}
787 @gccoptlist{-mwarn-reloc -merror-reloc @gol
788 -msafe-dma -munsafe-dma @gol
789 -mbranch-hints @gol
790 -msmall-mem -mlarge-mem -mstdmain @gol
791 -mfixed-range=@var{register-range}}
792
793 @emph{System V Options}
794 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
795
796 @emph{V850 Options}
797 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
798 -mprolog-function  -mno-prolog-function  -mspace @gol
799 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
800 -mapp-regs  -mno-app-regs @gol
801 -mdisable-callt  -mno-disable-callt @gol
802 -mv850e1 @gol
803 -mv850e @gol
804 -mv850  -mbig-switch}
805
806 @emph{VAX Options}
807 @gccoptlist{-mg  -mgnu  -munix}
808
809 @emph{VxWorks Options}
810 @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
811 -Xbind-lazy  -Xbind-now}
812
813 @emph{x86-64 Options}
814 See i386 and x86-64 Options.
815
816 @emph{Xstormy16 Options}
817 @gccoptlist{-msim}
818
819 @emph{Xtensa Options}
820 @gccoptlist{-mconst16 -mno-const16 @gol
821 -mfused-madd  -mno-fused-madd @gol
822 -mserialize-volatile  -mno-serialize-volatile @gol
823 -mtext-section-literals  -mno-text-section-literals @gol
824 -mtarget-align  -mno-target-align @gol
825 -mlongcalls  -mno-longcalls}
826
827 @emph{zSeries Options}
828 See S/390 and zSeries Options.
829
830 @item Code Generation Options
831 @xref{Code Gen Options,,Options for Code Generation Conventions}.
832 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
833 -ffixed-@var{reg}  -fexceptions @gol
834 -fnon-call-exceptions  -funwind-tables @gol
835 -fasynchronous-unwind-tables @gol
836 -finhibit-size-directive  -finstrument-functions @gol
837 -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol
838 -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{} @gol
839 -fno-common  -fno-ident @gol
840 -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE @gol
841 -fno-jump-tables @gol
842 -frecord-gcc-switches @gol
843 -freg-struct-return  -fshort-enums @gol
844 -fshort-double  -fshort-wchar @gol
845 -fverbose-asm  -fpack-struct[=@var{n}]  -fstack-check @gol
846 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
847 -fno-stack-limit  -fargument-alias  -fargument-noalias @gol
848 -fargument-noalias-global  -fargument-noalias-anything @gol
849 -fleading-underscore  -ftls-model=@var{model} @gol
850 -ftrapv  -fwrapv  -fbounds-check @gol
851 -fvisibility}
852 @end table
853
854 @menu
855 * Overall Options::     Controlling the kind of output:
856                         an executable, object files, assembler files,
857                         or preprocessed source.
858 * C Dialect Options::   Controlling the variant of C language compiled.
859 * C++ Dialect Options:: Variations on C++.
860 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
861                         and Objective-C++.
862 * Language Independent Options:: Controlling how diagnostics should be
863                         formatted.
864 * Warning Options::     How picky should the compiler be?
865 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
866 * Optimize Options::    How much optimization?
867 * Preprocessor Options:: Controlling header files and macro definitions.
868                          Also, getting dependency information for Make.
869 * Assembler Options::   Passing options to the assembler.
870 * Link Options::        Specifying libraries and so on.
871 * Directory Options::   Where to find header files and libraries.
872                         Where to find the compiler executable files.
873 * Spec Files::          How to pass switches to sub-processes.
874 * Target Options::      Running a cross-compiler, or an old version of GCC.
875 @end menu
876
877 @node Overall Options
878 @section Options Controlling the Kind of Output
879
880 Compilation can involve up to four stages: preprocessing, compilation
881 proper, assembly and linking, always in that order.  GCC is capable of
882 preprocessing and compiling several files either into several
883 assembler input files, or into one assembler input file; then each
884 assembler input file produces an object file, and linking combines all
885 the object files (those newly compiled, and those specified as input)
886 into an executable file.
887
888 @cindex file name suffix
889 For any given input file, the file name suffix determines what kind of
890 compilation is done:
891
892 @table @gcctabopt
893 @item @var{file}.c
894 C source code which must be preprocessed.
895
896 @item @var{file}.i
897 C source code which should not be preprocessed.
898
899 @item @var{file}.ii
900 C++ source code which should not be preprocessed.
901
902 @item @var{file}.m
903 Objective-C source code.  Note that you must link with the @file{libobjc}
904 library to make an Objective-C program work.
905
906 @item @var{file}.mi
907 Objective-C source code which should not be preprocessed.
908
909 @item @var{file}.mm
910 @itemx @var{file}.M
911 Objective-C++ source code.  Note that you must link with the @file{libobjc}
912 library to make an Objective-C++ program work.  Note that @samp{.M} refers
913 to a literal capital M@.
914
915 @item @var{file}.mii
916 Objective-C++ source code which should not be preprocessed.
917
918 @item @var{file}.h
919 C, C++, Objective-C or Objective-C++ header file to be turned into a
920 precompiled header.
921
922 @item @var{file}.cc
923 @itemx @var{file}.cp
924 @itemx @var{file}.cxx
925 @itemx @var{file}.cpp
926 @itemx @var{file}.CPP
927 @itemx @var{file}.c++
928 @itemx @var{file}.C
929 C++ source code which must be preprocessed.  Note that in @samp{.cxx},
930 the last two letters must both be literally @samp{x}.  Likewise,
931 @samp{.C} refers to a literal capital C@.
932
933 @item @var{file}.mm
934 @itemx @var{file}.M
935 Objective-C++ source code which must be preprocessed.
936
937 @item @var{file}.mii
938 Objective-C++ source code which should not be preprocessed.
939
940 @item @var{file}.hh
941 @itemx @var{file}.H
942 @itemx @var{file}.hp
943 @itemx @var{file}.hxx
944 @itemx @var{file}.hpp
945 @itemx @var{file}.HPP
946 @itemx @var{file}.h++
947 @itemx @var{file}.tcc
948 C++ header file to be turned into a precompiled header.
949
950 @item @var{file}.f
951 @itemx @var{file}.for
952 @itemx @var{file}.ftn
953 Fixed form Fortran source code which should not be preprocessed.
954
955 @item @var{file}.F
956 @itemx @var{file}.FOR
957 @itemx @var{file}.fpp
958 @itemx @var{file}.FPP
959 @itemx @var{file}.FTN
960 Fixed form Fortran source code which must be preprocessed (with the traditional
961 preprocessor).
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 should not be preprocessed.
968
969 @item @var{file}.F90
970 @itemx @var{file}.F95
971 @itemx @var{file}.F03
972 @itemx @var{file}.F08
973 Free form Fortran source code which must be preprocessed (with the
974 traditional preprocessor).
975
976 @c FIXME: Descriptions of Java file types.
977 @c @var{file}.java
978 @c @var{file}.class
979 @c @var{file}.zip
980 @c @var{file}.jar
981
982 @item @var{file}.ads
983 Ada source code file which contains a library unit declaration (a
984 declaration of a package, subprogram, or generic, or a generic
985 instantiation), or a library unit renaming declaration (a package,
986 generic, or subprogram renaming declaration).  Such files are also
987 called @dfn{specs}.
988
989 @item @var{file}.adb
990 Ada source code file containing a library unit body (a subprogram or
991 package body).  Such files are also called @dfn{bodies}.
992
993 @c GCC also knows about some suffixes for languages not yet included:
994 @c Pascal:
995 @c @var{file}.p
996 @c @var{file}.pas
997 @c Ratfor:
998 @c @var{file}.r
999
1000 @item @var{file}.s
1001 Assembler code.
1002
1003 @item @var{file}.S
1004 @itemx @var{file}.sx
1005 Assembler code which must be preprocessed.
1006
1007 @item @var{other}
1008 An object file to be fed straight into linking.
1009 Any file name with no recognized suffix is treated this way.
1010 @end table
1011
1012 @opindex x
1013 You can specify the input language explicitly with the @option{-x} option:
1014
1015 @table @gcctabopt
1016 @item -x @var{language}
1017 Specify explicitly the @var{language} for the following input files
1018 (rather than letting the compiler choose a default based on the file
1019 name suffix).  This option applies to all following input files until
1020 the next @option{-x} option.  Possible values for @var{language} are:
1021 @smallexample
1022 c  c-header  c-cpp-output
1023 c++  c++-header  c++-cpp-output
1024 objective-c  objective-c-header  objective-c-cpp-output
1025 objective-c++ objective-c++-header objective-c++-cpp-output
1026 assembler  assembler-with-cpp
1027 ada
1028 f77  f77-cpp-input f95  f95-cpp-input
1029 java
1030 @end smallexample
1031
1032 @item -x none
1033 Turn off any specification of a language, so that subsequent files are
1034 handled according to their file name suffixes (as they are if @option{-x}
1035 has not been used at all).
1036
1037 @item -pass-exit-codes
1038 @opindex pass-exit-codes
1039 Normally the @command{gcc} program will exit with the code of 1 if any
1040 phase of the compiler returns a non-success return code.  If you specify
1041 @option{-pass-exit-codes}, the @command{gcc} program will instead return with
1042 numerically highest error produced by any phase that returned an error
1043 indication.  The C, C++, and Fortran frontends return 4, if an internal
1044 compiler error is encountered.
1045 @end table
1046
1047 If you only want some of the stages of compilation, you can use
1048 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
1049 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
1050 @command{gcc} is to stop.  Note that some combinations (for example,
1051 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
1052
1053 @table @gcctabopt
1054 @item -c
1055 @opindex c
1056 Compile or assemble the source files, but do not link.  The linking
1057 stage simply is not done.  The ultimate output is in the form of an
1058 object file for each source file.
1059
1060 By default, the object file name for a source file is made by replacing
1061 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1062
1063 Unrecognized input files, not requiring compilation or assembly, are
1064 ignored.
1065
1066 @item -S
1067 @opindex S
1068 Stop after the stage of compilation proper; do not assemble.  The output
1069 is in the form of an assembler code file for each non-assembler input
1070 file specified.
1071
1072 By default, the assembler file name for a source file is made by
1073 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1074
1075 Input files that don't require compilation are ignored.
1076
1077 @item -E
1078 @opindex E
1079 Stop after the preprocessing stage; do not run the compiler proper.  The
1080 output is in the form of preprocessed source code, which is sent to the
1081 standard output.
1082
1083 Input files which don't require preprocessing are ignored.
1084
1085 @cindex output file option
1086 @item -o @var{file}
1087 @opindex o
1088 Place output in file @var{file}.  This applies regardless to whatever
1089 sort of output is being produced, whether it be an executable file,
1090 an object file, an assembler file or preprocessed C code.
1091
1092 If @option{-o} is not specified, the default is to put an executable
1093 file in @file{a.out}, the object file for
1094 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1095 assembler file in @file{@var{source}.s}, a precompiled header file in
1096 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1097 standard output.
1098
1099 @item -v
1100 @opindex v
1101 Print (on standard error output) the commands executed to run the stages
1102 of compilation.  Also print the version number of the compiler driver
1103 program and of the preprocessor and the compiler proper.
1104
1105 @item -###
1106 @opindex ###
1107 Like @option{-v} except the commands are not executed and all command
1108 arguments are quoted.  This is useful for shell scripts to capture the
1109 driver-generated command lines.
1110
1111 @item -pipe
1112 @opindex pipe
1113 Use pipes rather than temporary files for communication between the
1114 various stages of compilation.  This fails to work on some systems where
1115 the assembler is unable to read from a pipe; but the GNU assembler has
1116 no trouble.
1117
1118 @item -combine
1119 @opindex combine
1120 If you are compiling multiple source files, this option tells the driver
1121 to pass all the source files to the compiler at once (for those
1122 languages for which the compiler can handle this).  This will allow
1123 intermodule analysis (IMA) to be performed by the compiler.  Currently the only
1124 language for which this is supported is C@.  If you pass source files for
1125 multiple languages to the driver, using this option, the driver will invoke
1126 the compiler(s) that support IMA once each, passing each compiler all the
1127 source files appropriate for it.  For those languages that do not support
1128 IMA this option will be ignored, and the compiler will be invoked once for
1129 each source file in that language.  If you use this option in conjunction
1130 with @option{-save-temps}, the compiler will generate multiple
1131 pre-processed files
1132 (one for each source file), but only one (combined) @file{.o} or
1133 @file{.s} file.
1134
1135 @item --help
1136 @opindex help
1137 Print (on the standard output) a description of the command line options
1138 understood by @command{gcc}.  If the @option{-v} option is also specified
1139 then @option{--help} will also be passed on to the various processes
1140 invoked by @command{gcc}, so that they can display the command line options
1141 they accept.  If the @option{-Wextra} option has also been specified
1142 (prior to the @option{--help} option), then command line options which
1143 have no documentation associated with them will also be displayed.
1144
1145 @item --target-help
1146 @opindex target-help
1147 Print (on the standard output) a description of target-specific command
1148 line options for each tool.  For some targets extra target-specific
1149 information may also be printed.
1150
1151 @item --help=@var{class}@r{[},@var{qualifier}@r{]}
1152 Print (on the standard output) a description of the command line
1153 options understood by the compiler that fit into a specific class.
1154 The class can be one of @samp{optimizers}, @samp{warnings}, @samp{target},
1155 @samp{params}, or @var{language}:
1156
1157 @table @asis
1158 @item @samp{optimizers}
1159 This will display all of the optimization options supported by the
1160 compiler.
1161
1162 @item @samp{warnings}
1163 This will display all of the options controlling warning messages
1164 produced by the compiler.
1165
1166 @item @samp{target}
1167 This will display target-specific options.  Unlike the
1168 @option{--target-help} option however, target-specific options of the
1169 linker and assembler will not be displayed.  This is because those
1170 tools do not currently support the extended @option{--help=} syntax.
1171
1172 @item @samp{params}
1173 This will display the values recognized by the @option{--param}
1174 option.
1175
1176 @item @var{language}
1177 This will display the options supported for @var{language}, where 
1178 @var{language} is the name of one of the languages supported in this 
1179 version of GCC.
1180
1181 @item @samp{common}
1182 This will display the options that are common to all languages.
1183 @end table
1184
1185 It is possible to further refine the output of the @option{--help=}
1186 option by adding a comma separated list of qualifiers after the
1187 class.  These can be any from the following list:
1188
1189 @table @asis
1190 @item @samp{undocumented}
1191 Display only those options which are undocumented.
1192
1193 @item @samp{joined}
1194 Display options which take an argument that appears after an equal
1195 sign in the same continuous piece of text, such as:
1196 @samp{--help=target}.
1197
1198 @item @samp{separate}
1199 Display options which take an argument that appears as a separate word
1200 following the original option, such as: @samp{-o output-file}.
1201 @end table
1202
1203 Thus for example to display all the undocumented target-specific
1204 switches supported by the compiler the following can be used:
1205
1206 @smallexample
1207 --help=target,undocumented
1208 @end smallexample
1209
1210 The sense of a qualifier can be inverted by prefixing it with the
1211 @var{^} character, so for example to display all binary warning
1212 options (i.e., ones that are either on or off and that do not take an
1213 argument), which have a description the following can be used:
1214
1215 @smallexample
1216 --help=warnings,^joined,^undocumented
1217 @end smallexample
1218
1219 A class can also be used as a qualifier, although this usually
1220 restricts the output by so much that there is nothing to display.  One
1221 case where it does work however is when one of the classes is
1222 @var{target}.  So for example to display all the target-specific
1223 optimization options the following can be used:
1224
1225 @smallexample
1226 --help=target,optimizers
1227 @end smallexample
1228
1229 The @option{--help=} option can be repeated on the command line.  Each
1230 successive use will display its requested class of options, skipping
1231 those that have already been displayed.
1232
1233 If the @option{-Q} option appears on the command line before the
1234 @option{--help=} option, then the descriptive text displayed by
1235 @option{--help=} is changed.  Instead of describing the displayed
1236 options, an indication is given as to whether the option is enabled,
1237 disabled or set to a specific value (assuming that the compiler
1238 knows this at the point where the @option{--help=} option is used).
1239
1240 Here is a truncated example from the ARM port of @command{gcc}:
1241
1242 @smallexample
1243   % gcc -Q -mabi=2 --help=target -c
1244   The following options are target specific:
1245   -mabi=                                2
1246   -mabort-on-noreturn                   [disabled]
1247   -mapcs                                [disabled]
1248 @end smallexample
1249
1250 The output is sensitive to the effects of previous command line
1251 options, so for example it is possible to find out which optimizations
1252 are enabled at @option{-O2} by using:
1253
1254 @smallexample
1255 -O2 --help=optimizers
1256 @end smallexample
1257
1258 Alternatively you can discover which binary optimizations are enabled
1259 by @option{-O3} by using:
1260
1261 @smallexample
1262 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1263 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1264 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1265 @end smallexample
1266
1267 @item --version
1268 @opindex version
1269 Display the version number and copyrights of the invoked GCC@.
1270
1271 @item -wrapper
1272 @opindex wrapper
1273 Invoke all subcommands under a wrapper program. It takes a single
1274 comma separated list as an argument, which will be used to invoke
1275 the wrapper:
1276
1277 @smallexample
1278 gcc -c t.c -wrapper gdb,--args
1279 @end smallexample
1280
1281 This will invoke all subprograms of gcc under "gdb --args",
1282 thus cc1 invocation will be "gdb --args cc1 ...".
1283
1284 @include @value{srcdir}/../libiberty/at-file.texi
1285 @end table
1286
1287 @node Invoking G++
1288 @section Compiling C++ Programs
1289
1290 @cindex suffixes for C++ source
1291 @cindex C++ source file suffixes
1292 C++ source files conventionally use one of the suffixes @samp{.C},
1293 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1294 @samp{.cxx}; C++ header files often use @samp{.hh}, @samp{.hpp},
1295 @samp{.H}, or (for shared template code) @samp{.tcc}; and
1296 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1297 files with these names and compiles them as C++ programs even if you
1298 call the compiler the same way as for compiling C programs (usually
1299 with the name @command{gcc}).
1300
1301 @findex g++
1302 @findex c++
1303 However, the use of @command{gcc} does not add the C++ library.
1304 @command{g++} is a program that calls GCC and treats @samp{.c},
1305 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1306 files unless @option{-x} is used, and automatically specifies linking
1307 against the C++ library.  This program is also useful when
1308 precompiling a C header file with a @samp{.h} extension for use in C++
1309 compilations.  On many systems, @command{g++} is also installed with
1310 the name @command{c++}.
1311
1312 @cindex invoking @command{g++}
1313 When you compile C++ programs, you may specify many of the same
1314 command-line options that you use for compiling programs in any
1315 language; or command-line options meaningful for C and related
1316 languages; or options that are meaningful only for C++ programs.
1317 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1318 explanations of options for languages related to C@.
1319 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1320 explanations of options that are meaningful only for C++ programs.
1321
1322 @node C Dialect Options
1323 @section Options Controlling C Dialect
1324 @cindex dialect options
1325 @cindex language dialect options
1326 @cindex options, dialect
1327
1328 The following options control the dialect of C (or languages derived
1329 from C, such as C++, Objective-C and Objective-C++) that the compiler
1330 accepts:
1331
1332 @table @gcctabopt
1333 @cindex ANSI support
1334 @cindex ISO support
1335 @item -ansi
1336 @opindex ansi
1337 In C mode, this is equivalent to @samp{-std=c89}. In C++ mode, it is
1338 equivalent to @samp{-std=c++98}.
1339
1340 This turns off certain features of GCC that are incompatible with ISO
1341 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1342 such as the @code{asm} and @code{typeof} keywords, and
1343 predefined macros such as @code{unix} and @code{vax} that identify the
1344 type of system you are using.  It also enables the undesirable and
1345 rarely used ISO trigraph feature.  For the C compiler,
1346 it disables recognition of C++ style @samp{//} comments as well as
1347 the @code{inline} keyword.
1348
1349 The alternate keywords @code{__asm__}, @code{__extension__},
1350 @code{__inline__} and @code{__typeof__} continue to work despite
1351 @option{-ansi}.  You would not want to use them in an ISO C program, of
1352 course, but it is useful to put them in header files that might be included
1353 in compilations done with @option{-ansi}.  Alternate predefined macros
1354 such as @code{__unix__} and @code{__vax__} are also available, with or
1355 without @option{-ansi}.
1356
1357 The @option{-ansi} option does not cause non-ISO programs to be
1358 rejected gratuitously.  For that, @option{-pedantic} is required in
1359 addition to @option{-ansi}.  @xref{Warning Options}.
1360
1361 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1362 option is used.  Some header files may notice this macro and refrain
1363 from declaring certain functions or defining certain macros that the
1364 ISO standard doesn't call for; this is to avoid interfering with any
1365 programs that might use these names for other things.
1366
1367 Functions that would normally be built in but do not have semantics
1368 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1369 functions when @option{-ansi} is used.  @xref{Other Builtins,,Other
1370 built-in functions provided by GCC}, for details of the functions
1371 affected.
1372
1373 @item -std=
1374 @opindex std
1375 Determine the language standard. @xref{Standards,,Language Standards
1376 Supported by GCC}, for details of these standard versions.  This option
1377 is currently only supported when compiling C or C++. 
1378
1379 The compiler can accept several base standards, such as @samp{c89} or
1380 @samp{c++98}, and GNU dialects of those standards, such as
1381 @samp{gnu89} or @samp{gnu++98}.  By specifing a base standard, the
1382 compiler will accept all programs following that standard and those
1383 using GNU extensions that do not contradict it.  For example,
1384 @samp{-std=c89} turns off certain features of GCC that are
1385 incompatible with ISO C90, such as the @code{asm} and @code{typeof}
1386 keywords, but not other GNU extensions that do not have a meaning in
1387 ISO C90, such as omitting the middle term of a @code{?:}
1388 expression. On the other hand, by specifing a GNU dialect of a
1389 standard, all features the compiler support are enabled, even when
1390 those features change the meaning of the base standard and some
1391 strict-conforming programs may be rejected.  The particular standard
1392 is used by @option{-pedantic} to identify which features are GNU
1393 extensions given that version of the standard. For example
1394 @samp{-std=gnu89 -pedantic} would warn about C++ style @samp{//}
1395 comments, while @samp{-std=gnu99 -pedantic} would not.
1396
1397 A value for this option must be provided; possible values are
1398
1399 @table @samp
1400 @item c89
1401 @itemx iso9899:1990
1402 Support all ISO C90 programs (certain GNU extensions that conflict
1403 with ISO C90 are disabled). Same as @option{-ansi} for C code.
1404
1405 @item iso9899:199409
1406 ISO C90 as modified in amendment 1.
1407
1408 @item c99
1409 @itemx c9x
1410 @itemx iso9899:1999
1411 @itemx iso9899:199x
1412 ISO C99.  Note that this standard is not yet fully supported; see
1413 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1414 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1415
1416 @item gnu89
1417 GNU dialect of ISO C90 (including some C99 features). This
1418 is the default for C code.
1419
1420 @item gnu99
1421 @itemx gnu9x
1422 GNU dialect of ISO C99.  When ISO C99 is fully implemented in GCC,
1423 this will become the default.  The name @samp{gnu9x} is deprecated.
1424
1425 @item c++98
1426 The 1998 ISO C++ standard plus amendments. Same as @option{-ansi} for
1427 C++ code.
1428
1429 @item gnu++98
1430 GNU dialect of @option{-std=c++98}.  This is the default for
1431 C++ code.
1432
1433 @item c++0x
1434 The working draft of the upcoming ISO C++0x standard. This option
1435 enables experimental features that are likely to be included in
1436 C++0x. The working draft is constantly changing, and any feature that is
1437 enabled by this flag may be removed from future versions of GCC if it is
1438 not part of the C++0x standard.
1439
1440 @item gnu++0x
1441 GNU dialect of @option{-std=c++0x}. This option enables
1442 experimental features that may be removed in future versions of GCC.
1443 @end table
1444
1445 @item -fgnu89-inline
1446 @opindex fgnu89-inline
1447 The option @option{-fgnu89-inline} tells GCC to use the traditional
1448 GNU semantics for @code{inline} functions when in C99 mode.
1449 @xref{Inline,,An Inline Function is As Fast As a Macro}.  This option
1450 is accepted and ignored by GCC versions 4.1.3 up to but not including
1451 4.3.  In GCC versions 4.3 and later it changes the behavior of GCC in
1452 C99 mode.  Using this option is roughly equivalent to adding the
1453 @code{gnu_inline} function attribute to all inline functions
1454 (@pxref{Function Attributes}).
1455
1456 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
1457 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
1458 specifies the default behavior).  This option was first supported in
1459 GCC 4.3.  This option is not supported in C89 or gnu89 mode.
1460
1461 The preprocessor macros @code{__GNUC_GNU_INLINE__} and
1462 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
1463 in effect for @code{inline} functions.  @xref{Common Predefined
1464 Macros,,,cpp,The C Preprocessor}.
1465
1466 @item -aux-info @var{filename}
1467 @opindex aux-info
1468 Output to the given filename prototyped declarations for all functions
1469 declared and/or defined in a translation unit, including those in header
1470 files.  This option is silently ignored in any language other than C@.
1471
1472 Besides declarations, the file indicates, in comments, the origin of
1473 each declaration (source file and line), whether the declaration was
1474 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1475 @samp{O} for old, respectively, in the first character after the line
1476 number and the colon), and whether it came from a declaration or a
1477 definition (@samp{C} or @samp{F}, respectively, in the following
1478 character).  In the case of function definitions, a K&R-style list of
1479 arguments followed by their declarations is also provided, inside
1480 comments, after the declaration.
1481
1482 @item -fno-asm
1483 @opindex fno-asm
1484 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1485 keyword, so that code can use these words as identifiers.  You can use
1486 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1487 instead.  @option{-ansi} implies @option{-fno-asm}.
1488
1489 In C++, this switch only affects the @code{typeof} keyword, since
1490 @code{asm} and @code{inline} are standard keywords.  You may want to
1491 use the @option{-fno-gnu-keywords} flag instead, which has the same
1492 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1493 switch only affects the @code{asm} and @code{typeof} keywords, since
1494 @code{inline} is a standard keyword in ISO C99.
1495
1496 @item -fno-builtin
1497 @itemx -fno-builtin-@var{function}
1498 @opindex fno-builtin
1499 @cindex built-in functions
1500 Don't recognize built-in functions that do not begin with
1501 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1502 functions provided by GCC}, for details of the functions affected,
1503 including those which are not built-in functions when @option{-ansi} or
1504 @option{-std} options for strict ISO C conformance are used because they
1505 do not have an ISO standard meaning.
1506
1507 GCC normally generates special code to handle certain built-in functions
1508 more efficiently; for instance, calls to @code{alloca} may become single
1509 instructions that adjust the stack directly, and calls to @code{memcpy}
1510 may become inline copy loops.  The resulting code is often both smaller
1511 and faster, but since the function calls no longer appear as such, you
1512 cannot set a breakpoint on those calls, nor can you change the behavior
1513 of the functions by linking with a different library.  In addition,
1514 when a function is recognized as a built-in function, GCC may use
1515 information about that function to warn about problems with calls to
1516 that function, or to generate more efficient code, even if the
1517 resulting code still contains calls to that function.  For example,
1518 warnings are given with @option{-Wformat} for bad calls to
1519 @code{printf}, when @code{printf} is built in, and @code{strlen} is
1520 known not to modify global memory.
1521
1522 With the @option{-fno-builtin-@var{function}} option
1523 only the built-in function @var{function} is
1524 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1525 function is named this is not built-in in this version of GCC, this
1526 option is ignored.  There is no corresponding
1527 @option{-fbuiltin-@var{function}} option; if you wish to enable
1528 built-in functions selectively when using @option{-fno-builtin} or
1529 @option{-ffreestanding}, you may define macros such as:
1530
1531 @smallexample
1532 #define abs(n)          __builtin_abs ((n))
1533 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1534 @end smallexample
1535
1536 @item -fhosted
1537 @opindex fhosted
1538 @cindex hosted environment
1539
1540 Assert that compilation takes place in a hosted environment.  This implies
1541 @option{-fbuiltin}.  A hosted environment is one in which the
1542 entire standard library is available, and in which @code{main} has a return
1543 type of @code{int}.  Examples are nearly everything except a kernel.
1544 This is equivalent to @option{-fno-freestanding}.
1545
1546 @item -ffreestanding
1547 @opindex ffreestanding
1548 @cindex hosted environment
1549
1550 Assert that compilation takes place in a freestanding environment.  This
1551 implies @option{-fno-builtin}.  A freestanding environment
1552 is one in which the standard library may not exist, and program startup may
1553 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1554 This is equivalent to @option{-fno-hosted}.
1555
1556 @xref{Standards,,Language Standards Supported by GCC}, for details of
1557 freestanding and hosted environments.
1558
1559 @item -fopenmp
1560 @opindex fopenmp
1561 @cindex openmp parallel
1562 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
1563 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
1564 compiler generates parallel code according to the OpenMP Application
1565 Program Interface v2.5 @w{@uref{http://www.openmp.org/}}.  This option
1566 implies @option{-pthread}, and thus is only supported on targets that
1567 have support for @option{-pthread}.
1568
1569 @item -fms-extensions
1570 @opindex fms-extensions
1571 Accept some non-standard constructs used in Microsoft header files.
1572
1573 Some cases of unnamed fields in structures and unions are only
1574 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
1575 fields within structs/unions}, for details.
1576
1577 @item -trigraphs
1578 @opindex trigraphs
1579 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
1580 options for strict ISO C conformance) implies @option{-trigraphs}.
1581
1582 @item -no-integrated-cpp
1583 @opindex no-integrated-cpp
1584 Performs a compilation in two passes: preprocessing and compiling.  This
1585 option allows a user supplied "cc1", "cc1plus", or "cc1obj" via the
1586 @option{-B} option.  The user supplied compilation step can then add in
1587 an additional preprocessing step after normal preprocessing but before
1588 compiling.  The default is to use the integrated cpp (internal cpp)
1589
1590 The semantics of this option will change if "cc1", "cc1plus", and
1591 "cc1obj" are merged.
1592
1593 @cindex traditional C language
1594 @cindex C language, traditional
1595 @item -traditional
1596 @itemx -traditional-cpp
1597 @opindex traditional-cpp
1598 @opindex traditional
1599 Formerly, these options caused GCC to attempt to emulate a pre-standard
1600 C compiler.  They are now only supported with the @option{-E} switch.
1601 The preprocessor continues to support a pre-standard mode.  See the GNU
1602 CPP manual for details.
1603
1604 @item -fcond-mismatch
1605 @opindex fcond-mismatch
1606 Allow conditional expressions with mismatched types in the second and
1607 third arguments.  The value of such an expression is void.  This option
1608 is not supported for C++.
1609
1610 @item -flax-vector-conversions
1611 @opindex flax-vector-conversions
1612 Allow implicit conversions between vectors with differing numbers of
1613 elements and/or incompatible element types.  This option should not be
1614 used for new code.
1615
1616 @item -funsigned-char
1617 @opindex funsigned-char
1618 Let the type @code{char} be unsigned, like @code{unsigned char}.
1619
1620 Each kind of machine has a default for what @code{char} should
1621 be.  It is either like @code{unsigned char} by default or like
1622 @code{signed char} by default.
1623
1624 Ideally, a portable program should always use @code{signed char} or
1625 @code{unsigned char} when it depends on the signedness of an object.
1626 But many programs have been written to use plain @code{char} and
1627 expect it to be signed, or expect it to be unsigned, depending on the
1628 machines they were written for.  This option, and its inverse, let you
1629 make such a program work with the opposite default.
1630
1631 The type @code{char} is always a distinct type from each of
1632 @code{signed char} or @code{unsigned char}, even though its behavior
1633 is always just like one of those two.
1634
1635 @item -fsigned-char
1636 @opindex fsigned-char
1637 Let the type @code{char} be signed, like @code{signed char}.
1638
1639 Note that this is equivalent to @option{-fno-unsigned-char}, which is
1640 the negative form of @option{-funsigned-char}.  Likewise, the option
1641 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
1642
1643 @item -fsigned-bitfields
1644 @itemx -funsigned-bitfields
1645 @itemx -fno-signed-bitfields
1646 @itemx -fno-unsigned-bitfields
1647 @opindex fsigned-bitfields
1648 @opindex funsigned-bitfields
1649 @opindex fno-signed-bitfields
1650 @opindex fno-unsigned-bitfields
1651 These options control whether a bit-field is signed or unsigned, when the
1652 declaration does not use either @code{signed} or @code{unsigned}.  By
1653 default, such a bit-field is signed, because this is consistent: the
1654 basic integer types such as @code{int} are signed types.
1655 @end table
1656
1657 @node C++ Dialect Options
1658 @section Options Controlling C++ Dialect
1659
1660 @cindex compiler options, C++
1661 @cindex C++ options, command line
1662 @cindex options, C++
1663 This section describes the command-line options that are only meaningful
1664 for C++ programs; but you can also use most of the GNU compiler options
1665 regardless of what language your program is in.  For example, you
1666 might compile a file @code{firstClass.C} like this:
1667
1668 @smallexample
1669 g++ -g -frepo -O -c firstClass.C
1670 @end smallexample
1671
1672 @noindent
1673 In this example, only @option{-frepo} is an option meant
1674 only for C++ programs; you can use the other options with any
1675 language supported by GCC@.
1676
1677 Here is a list of options that are @emph{only} for compiling C++ programs:
1678
1679 @table @gcctabopt
1680
1681 @item -fabi-version=@var{n}
1682 @opindex fabi-version
1683 Use version @var{n} of the C++ ABI@.  Version 2 is the version of the
1684 C++ ABI that first appeared in G++ 3.4.  Version 1 is the version of
1685 the C++ ABI that first appeared in G++ 3.2.  Version 0 will always be
1686 the version that conforms most closely to the C++ ABI specification.
1687 Therefore, the ABI obtained using version 0 will change as ABI bugs
1688 are fixed.
1689
1690 The default is version 2.
1691
1692 @item -fno-access-control
1693 @opindex fno-access-control
1694 Turn off all access checking.  This switch is mainly useful for working
1695 around bugs in the access control code.
1696
1697 @item -fcheck-new
1698 @opindex fcheck-new
1699 Check that the pointer returned by @code{operator new} is non-null
1700 before attempting to modify the storage allocated.  This check is
1701 normally unnecessary because the C++ standard specifies that
1702 @code{operator new} will only return @code{0} if it is declared
1703 @samp{throw()}, in which case the compiler will always check the
1704 return value even without this option.  In all other cases, when
1705 @code{operator new} has a non-empty exception specification, memory
1706 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
1707 @samp{new (nothrow)}.
1708
1709 @item -fconserve-space
1710 @opindex fconserve-space
1711 Put uninitialized or runtime-initialized global variables into the
1712 common segment, as C does.  This saves space in the executable at the
1713 cost of not diagnosing duplicate definitions.  If you compile with this
1714 flag and your program mysteriously crashes after @code{main()} has
1715 completed, you may have an object that is being destroyed twice because
1716 two definitions were merged.
1717
1718 This option is no longer useful on most targets, now that support has
1719 been added for putting variables into BSS without making them common.
1720
1721 @item -ffriend-injection
1722 @opindex ffriend-injection
1723 Inject friend functions into the enclosing namespace, so that they are
1724 visible outside the scope of the class in which they are declared.
1725 Friend functions were documented to work this way in the old Annotated
1726 C++ Reference Manual, and versions of G++ before 4.1 always worked
1727 that way.  However, in ISO C++ a friend function which is not declared
1728 in an enclosing scope can only be found using argument dependent
1729 lookup.  This option causes friends to be injected as they were in
1730 earlier releases.
1731
1732 This option is for compatibility, and may be removed in a future
1733 release of G++.
1734
1735 @item -fno-elide-constructors
1736 @opindex fno-elide-constructors
1737 The C++ standard allows an implementation to omit creating a temporary
1738 which is only used to initialize another object of the same type.
1739 Specifying this option disables that optimization, and forces G++ to
1740 call the copy constructor in all cases.
1741
1742 @item -fno-enforce-eh-specs
1743 @opindex fno-enforce-eh-specs
1744 Don't generate code to check for violation of exception specifications
1745 at runtime.  This option violates the C++ standard, but may be useful
1746 for reducing code size in production builds, much like defining
1747 @samp{NDEBUG}.  This does not give user code permission to throw
1748 exceptions in violation of the exception specifications; the compiler
1749 will still optimize based on the specifications, so throwing an
1750 unexpected exception will result in undefined behavior.
1751
1752 @item -ffor-scope
1753 @itemx -fno-for-scope
1754 @opindex ffor-scope
1755 @opindex fno-for-scope
1756 If @option{-ffor-scope} is specified, the scope of variables declared in
1757 a @i{for-init-statement} is limited to the @samp{for} loop itself,
1758 as specified by the C++ standard.
1759 If @option{-fno-for-scope} is specified, the scope of variables declared in
1760 a @i{for-init-statement} extends to the end of the enclosing scope,
1761 as was the case in old versions of G++, and other (traditional)
1762 implementations of C++.
1763
1764 The default if neither flag is given to follow the standard,
1765 but to allow and give a warning for old-style code that would
1766 otherwise be invalid, or have different behavior.
1767
1768 @item -fno-gnu-keywords
1769 @opindex fno-gnu-keywords
1770 Do not recognize @code{typeof} as a keyword, so that code can use this
1771 word as an identifier.  You can use the keyword @code{__typeof__} instead.
1772 @option{-ansi} implies @option{-fno-gnu-keywords}.
1773
1774 @item -fno-implicit-templates
1775 @opindex fno-implicit-templates
1776 Never emit code for non-inline templates which are instantiated
1777 implicitly (i.e.@: by use); only emit code for explicit instantiations.
1778 @xref{Template Instantiation}, for more information.
1779
1780 @item -fno-implicit-inline-templates
1781 @opindex fno-implicit-inline-templates
1782 Don't emit code for implicit instantiations of inline templates, either.
1783 The default is to handle inlines differently so that compiles with and
1784 without optimization will need the same set of explicit instantiations.
1785
1786 @item -fno-implement-inlines
1787 @opindex fno-implement-inlines
1788 To save space, do not emit out-of-line copies of inline functions
1789 controlled by @samp{#pragma implementation}.  This will cause linker
1790 errors if these functions are not inlined everywhere they are called.
1791
1792 @item -fms-extensions
1793 @opindex fms-extensions
1794 Disable pedantic warnings about constructs used in MFC, such as implicit
1795 int and getting a pointer to member function via non-standard syntax.
1796
1797 @item -fno-nonansi-builtins
1798 @opindex fno-nonansi-builtins
1799 Disable built-in declarations of functions that are not mandated by
1800 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
1801 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
1802
1803 @item -fno-operator-names
1804 @opindex fno-operator-names
1805 Do not treat the operator name keywords @code{and}, @code{bitand},
1806 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
1807 synonyms as keywords.
1808
1809 @item -fno-optional-diags
1810 @opindex fno-optional-diags
1811 Disable diagnostics that the standard says a compiler does not need to
1812 issue.  Currently, the only such diagnostic issued by G++ is the one for
1813 a name having multiple meanings within a class.
1814
1815 @item -fpermissive
1816 @opindex fpermissive
1817 Downgrade some diagnostics about nonconformant code from errors to
1818 warnings.  Thus, using @option{-fpermissive} will allow some
1819 nonconforming code to compile.
1820
1821 @item -frepo
1822 @opindex frepo
1823 Enable automatic template instantiation at link time.  This option also
1824 implies @option{-fno-implicit-templates}.  @xref{Template
1825 Instantiation}, for more information.
1826
1827 @item -fno-rtti
1828 @opindex fno-rtti
1829 Disable generation of information about every class with virtual
1830 functions for use by the C++ runtime type identification features
1831 (@samp{dynamic_cast} and @samp{typeid}).  If you don't use those parts
1832 of the language, you can save some space by using this flag.  Note that
1833 exception handling uses the same information, but it will generate it as
1834 needed. The @samp{dynamic_cast} operator can still be used for casts that
1835 do not require runtime type information, i.e.@: casts to @code{void *} or to
1836 unambiguous base classes.
1837
1838 @item -fstats
1839 @opindex fstats
1840 Emit statistics about front-end processing at the end of the compilation.
1841 This information is generally only useful to the G++ development team.
1842
1843 @item -ftemplate-depth-@var{n}
1844 @opindex ftemplate-depth
1845 Set the maximum instantiation depth for template classes to @var{n}.
1846 A limit on the template instantiation depth is needed to detect
1847 endless recursions during template class instantiation.  ANSI/ISO C++
1848 conforming programs must not rely on a maximum depth greater than 17.
1849
1850 @item -fno-threadsafe-statics
1851 @opindex fno-threadsafe-statics
1852 Do not emit the extra code to use the routines specified in the C++
1853 ABI for thread-safe initialization of local statics.  You can use this
1854 option to reduce code size slightly in code that doesn't need to be
1855 thread-safe.
1856
1857 @item -fuse-cxa-atexit
1858 @opindex fuse-cxa-atexit
1859 Register destructors for objects with static storage duration with the
1860 @code{__cxa_atexit} function rather than the @code{atexit} function.
1861 This option is required for fully standards-compliant handling of static
1862 destructors, but will only work if your C library supports
1863 @code{__cxa_atexit}.
1864
1865 @item -fno-use-cxa-get-exception-ptr
1866 @opindex fno-use-cxa-get-exception-ptr
1867 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
1868 will cause @code{std::uncaught_exception} to be incorrect, but is necessary
1869 if the runtime routine is not available.
1870
1871 @item -fvisibility-inlines-hidden
1872 @opindex fvisibility-inlines-hidden
1873 This switch declares that the user does not attempt to compare
1874 pointers to inline methods where the addresses of the two functions
1875 were taken in different shared objects.
1876
1877 The effect of this is that GCC may, effectively, mark inline methods with
1878 @code{__attribute__ ((visibility ("hidden")))} so that they do not
1879 appear in the export table of a DSO and do not require a PLT indirection
1880 when used within the DSO@.  Enabling this option can have a dramatic effect
1881 on load and link times of a DSO as it massively reduces the size of the
1882 dynamic export table when the library makes heavy use of templates.
1883
1884 The behavior of this switch is not quite the same as marking the
1885 methods as hidden directly, because it does not affect static variables
1886 local to the function or cause the compiler to deduce that
1887 the function is defined in only one shared object.
1888
1889 You may mark a method as having a visibility explicitly to negate the
1890 effect of the switch for that method.  For example, if you do want to
1891 compare pointers to a particular inline method, you might mark it as
1892 having default visibility.  Marking the enclosing class with explicit
1893 visibility will have no effect.
1894
1895 Explicitly instantiated inline methods are unaffected by this option
1896 as their linkage might otherwise cross a shared library boundary.
1897 @xref{Template Instantiation}.
1898
1899 @item -fvisibility-ms-compat
1900 @opindex fvisibility-ms-compat
1901 This flag attempts to use visibility settings to make GCC's C++
1902 linkage model compatible with that of Microsoft Visual Studio.
1903
1904 The flag makes these changes to GCC's linkage model:
1905
1906 @enumerate
1907 @item
1908 It sets the default visibility to @code{hidden}, like
1909 @option{-fvisibility=hidden}.
1910
1911 @item
1912 Types, but not their members, are not hidden by default.
1913
1914 @item
1915 The One Definition Rule is relaxed for types without explicit
1916 visibility specifications which are defined in more than one different
1917 shared object: those declarations are permitted if they would have
1918 been permitted when this option was not used.
1919 @end enumerate
1920
1921 In new code it is better to use @option{-fvisibility=hidden} and
1922 export those classes which are intended to be externally visible.
1923 Unfortunately it is possible for code to rely, perhaps accidentally,
1924 on the Visual Studio behavior.
1925
1926 Among the consequences of these changes are that static data members
1927 of the same type with the same name but defined in different shared
1928 objects will be different, so changing one will not change the other;
1929 and that pointers to function members defined in different shared
1930 objects may not compare equal.  When this flag is given, it is a
1931 violation of the ODR to define types with the same name differently.
1932
1933 @item -fno-weak
1934 @opindex fno-weak
1935 Do not use weak symbol support, even if it is provided by the linker.
1936 By default, G++ will use weak symbols if they are available.  This
1937 option exists only for testing, and should not be used by end-users;
1938 it will result in inferior code and has no benefits.  This option may
1939 be removed in a future release of G++.
1940
1941 @item -nostdinc++
1942 @opindex nostdinc++
1943 Do not search for header files in the standard directories specific to
1944 C++, but do still search the other standard directories.  (This option
1945 is used when building the C++ library.)
1946 @end table
1947
1948 In addition, these optimization, warning, and code generation options
1949 have meanings only for C++ programs:
1950
1951 @table @gcctabopt
1952 @item -fno-default-inline
1953 @opindex fno-default-inline
1954 Do not assume @samp{inline} for functions defined inside a class scope.
1955 @xref{Optimize Options,,Options That Control Optimization}.  Note that these
1956 functions will have linkage like inline functions; they just won't be
1957 inlined by default.
1958
1959 @item -Wabi @r{(C++ and Objective-C++ only)}
1960 @opindex Wabi
1961 @opindex Wno-abi
1962 Warn when G++ generates code that is probably not compatible with the
1963 vendor-neutral C++ ABI@.  Although an effort has been made to warn about
1964 all such cases, there are probably some cases that are not warned about,
1965 even though G++ is generating incompatible code.  There may also be
1966 cases where warnings are emitted even though the code that is generated
1967 will be compatible.
1968
1969 You should rewrite your code to avoid these warnings if you are
1970 concerned about the fact that code generated by G++ may not be binary
1971 compatible with code generated by other compilers.
1972
1973 The known incompatibilities at this point include:
1974
1975 @itemize @bullet
1976
1977 @item
1978 Incorrect handling of tail-padding for bit-fields.  G++ may attempt to
1979 pack data into the same byte as a base class.  For example:
1980
1981 @smallexample
1982 struct A @{ virtual void f(); int f1 : 1; @};
1983 struct B : public A @{ int f2 : 1; @};
1984 @end smallexample
1985
1986 @noindent
1987 In this case, G++ will place @code{B::f2} into the same byte
1988 as@code{A::f1}; other compilers will not.  You can avoid this problem
1989 by explicitly padding @code{A} so that its size is a multiple of the
1990 byte size on your platform; that will cause G++ and other compilers to
1991 layout @code{B} identically.
1992
1993 @item
1994 Incorrect handling of tail-padding for virtual bases.  G++ does not use
1995 tail padding when laying out virtual bases.  For example:
1996
1997 @smallexample
1998 struct A @{ virtual void f(); char c1; @};
1999 struct B @{ B(); char c2; @};
2000 struct C : public A, public virtual B @{@};
2001 @end smallexample
2002
2003 @noindent
2004 In this case, G++ will not place @code{B} into the tail-padding for
2005 @code{A}; other compilers will.  You can avoid this problem by
2006 explicitly padding @code{A} so that its size is a multiple of its
2007 alignment (ignoring virtual base classes); that will cause G++ and other
2008 compilers to layout @code{C} identically.
2009
2010 @item
2011 Incorrect handling of bit-fields with declared widths greater than that
2012 of their underlying types, when the bit-fields appear in a union.  For
2013 example:
2014
2015 @smallexample
2016 union U @{ int i : 4096; @};
2017 @end smallexample
2018
2019 @noindent
2020 Assuming that an @code{int} does not have 4096 bits, G++ will make the
2021 union too small by the number of bits in an @code{int}.
2022
2023 @item
2024 Empty classes can be placed at incorrect offsets.  For example:
2025
2026 @smallexample
2027 struct A @{@};
2028
2029 struct B @{
2030   A a;
2031   virtual void f ();
2032 @};
2033
2034 struct C : public B, public A @{@};
2035 @end smallexample
2036
2037 @noindent
2038 G++ will place the @code{A} base class of @code{C} at a nonzero offset;
2039 it should be placed at offset zero.  G++ mistakenly believes that the
2040 @code{A} data member of @code{B} is already at offset zero.
2041
2042 @item
2043 Names of template functions whose types involve @code{typename} or
2044 template template parameters can be mangled incorrectly.
2045
2046 @smallexample
2047 template <typename Q>
2048 void f(typename Q::X) @{@}
2049
2050 template <template <typename> class Q>
2051 void f(typename Q<int>::X) @{@}
2052 @end smallexample
2053
2054 @noindent
2055 Instantiations of these templates may be mangled incorrectly.
2056
2057 @end itemize
2058
2059 @item -Wctor-dtor-privacy @r{(C++ and Objective-C++ only)}
2060 @opindex Wctor-dtor-privacy
2061 @opindex Wno-ctor-dtor-privacy
2062 Warn when a class seems unusable because all the constructors or
2063 destructors in that class are private, and it has neither friends nor
2064 public static member functions.
2065
2066 @item -Wnon-virtual-dtor @r{(C++ and Objective-C++ only)}
2067 @opindex Wnon-virtual-dtor
2068 @opindex Wno-non-virtual-dtor
2069 Warn when a class has virtual functions and accessible non-virtual
2070 destructor, in which case it would be possible but unsafe to delete
2071 an instance of a derived class through a pointer to the base class.
2072 This warning is also enabled if -Weffc++ is specified.
2073
2074 @item -Wreorder @r{(C++ and Objective-C++ only)}
2075 @opindex Wreorder
2076 @opindex Wno-reorder
2077 @cindex reordering, warning
2078 @cindex warning for reordering of member initializers
2079 Warn when the order of member initializers given in the code does not
2080 match the order in which they must be executed.  For instance:
2081
2082 @smallexample
2083 struct A @{
2084   int i;
2085   int j;
2086   A(): j (0), i (1) @{ @}
2087 @};
2088 @end smallexample
2089
2090 The compiler will rearrange the member initializers for @samp{i}
2091 and @samp{j} to match the declaration order of the members, emitting
2092 a warning to that effect.  This warning is enabled by @option{-Wall}.
2093 @end table
2094
2095 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
2096
2097 @table @gcctabopt
2098 @item -Weffc++ @r{(C++ and Objective-C++ only)}
2099 @opindex Weffc++
2100 @opindex Wno-effc++
2101 Warn about violations of the following style guidelines from Scott Meyers'
2102 @cite{Effective C++} book:
2103
2104 @itemize @bullet
2105 @item
2106 Item 11:  Define a copy constructor and an assignment operator for classes
2107 with dynamically allocated memory.
2108
2109 @item
2110 Item 12:  Prefer initialization to assignment in constructors.
2111
2112 @item
2113 Item 14:  Make destructors virtual in base classes.
2114
2115 @item
2116 Item 15:  Have @code{operator=} return a reference to @code{*this}.
2117
2118 @item
2119 Item 23:  Don't try to return a reference when you must return an object.
2120
2121 @end itemize
2122
2123 Also warn about violations of the following style guidelines from
2124 Scott Meyers' @cite{More Effective C++} book:
2125
2126 @itemize @bullet
2127 @item
2128 Item 6:  Distinguish between prefix and postfix forms of increment and
2129 decrement operators.
2130
2131 @item
2132 Item 7:  Never overload @code{&&}, @code{||}, or @code{,}.
2133
2134 @end itemize
2135
2136 When selecting this option, be aware that the standard library
2137 headers do not obey all of these guidelines; use @samp{grep -v}
2138 to filter out those warnings.
2139
2140 @item -Wstrict-null-sentinel @r{(C++ and Objective-C++ only)}
2141 @opindex Wstrict-null-sentinel
2142 @opindex Wno-strict-null-sentinel
2143 Warn also about the use of an uncasted @code{NULL} as sentinel.  When
2144 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
2145 to @code{__null}.  Although it is a null pointer constant not a null pointer,
2146 it is guaranteed to of the same size as a pointer.  But this use is
2147 not portable across different compilers.
2148
2149 @item -Wno-non-template-friend @r{(C++ and Objective-C++ only)}
2150 @opindex Wno-non-template-friend
2151 @opindex Wnon-template-friend
2152 Disable warnings when non-templatized friend functions are declared
2153 within a template.  Since the advent of explicit template specification
2154 support in G++, if the name of the friend is an unqualified-id (i.e.,
2155 @samp{friend foo(int)}), the C++ language specification demands that the
2156 friend declare or define an ordinary, nontemplate function.  (Section
2157 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
2158 could be interpreted as a particular specialization of a templatized
2159 function.  Because this non-conforming behavior is no longer the default
2160 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
2161 check existing code for potential trouble spots and is on by default.
2162 This new compiler behavior can be turned off with
2163 @option{-Wno-non-template-friend} which keeps the conformant compiler code
2164 but disables the helpful warning.
2165
2166 @item -Wold-style-cast @r{(C++ and Objective-C++ only)}
2167 @opindex Wold-style-cast
2168 @opindex Wno-old-style-cast
2169 Warn if an old-style (C-style) cast to a non-void type is used within
2170 a C++ program.  The new-style casts (@samp{dynamic_cast},
2171 @samp{static_cast}, @samp{reinterpret_cast}, and @samp{const_cast}) are
2172 less vulnerable to unintended effects and much easier to search for.
2173
2174 @item -Woverloaded-virtual @r{(C++ and Objective-C++ only)}
2175 @opindex Woverloaded-virtual
2176 @opindex Wno-overloaded-virtual
2177 @cindex overloaded virtual fn, warning
2178 @cindex warning for overloaded virtual fn
2179 Warn when a function declaration hides virtual functions from a
2180 base class.  For example, in:
2181
2182 @smallexample
2183 struct A @{
2184   virtual void f();
2185 @};
2186
2187 struct B: public A @{
2188   void f(int);
2189 @};
2190 @end smallexample
2191
2192 the @code{A} class version of @code{f} is hidden in @code{B}, and code
2193 like:
2194
2195 @smallexample
2196 B* b;
2197 b->f();
2198 @end smallexample
2199
2200 will fail to compile.
2201
2202 @item -Wno-pmf-conversions @r{(C++ and Objective-C++ only)}
2203 @opindex Wno-pmf-conversions
2204 @opindex Wpmf-conversions
2205 Disable the diagnostic for converting a bound pointer to member function
2206 to a plain pointer.
2207
2208 @item -Wsign-promo @r{(C++ and Objective-C++ only)}
2209 @opindex Wsign-promo
2210 @opindex Wno-sign-promo
2211 Warn when overload resolution chooses a promotion from unsigned or
2212 enumerated type to a signed type, over a conversion to an unsigned type of
2213 the same size.  Previous versions of G++ would try to preserve
2214 unsignedness, but the standard mandates the current behavior.
2215
2216 @smallexample
2217 struct A @{
2218   operator int ();
2219   A& operator = (int);
2220 @};
2221
2222 main ()
2223 @{
2224   A a,b;
2225   a = b;
2226 @}
2227 @end smallexample
2228
2229 In this example, G++ will synthesize a default @samp{A& operator =
2230 (const A&);}, while cfront will use the user-defined @samp{operator =}.
2231 @end table
2232
2233 @node Objective-C and Objective-C++ Dialect Options
2234 @section Options Controlling Objective-C and Objective-C++ Dialects
2235
2236 @cindex compiler options, Objective-C and Objective-C++
2237 @cindex Objective-C and Objective-C++ options, command line
2238 @cindex options, Objective-C and Objective-C++
2239 (NOTE: This manual does not describe the Objective-C and Objective-C++
2240 languages themselves.  See @xref{Standards,,Language Standards
2241 Supported by GCC}, for references.)
2242
2243 This section describes the command-line options that are only meaningful
2244 for Objective-C and Objective-C++ programs, but you can also use most of
2245 the language-independent GNU compiler options.
2246 For example, you might compile a file @code{some_class.m} like this:
2247
2248 @smallexample
2249 gcc -g -fgnu-runtime -O -c some_class.m
2250 @end smallexample
2251
2252 @noindent
2253 In this example, @option{-fgnu-runtime} is an option meant only for
2254 Objective-C and Objective-C++ programs; you can use the other options with
2255 any language supported by GCC@.
2256
2257 Note that since Objective-C is an extension of the C language, Objective-C
2258 compilations may also use options specific to the C front-end (e.g.,
2259 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
2260 C++-specific options (e.g., @option{-Wabi}).
2261
2262 Here is a list of options that are @emph{only} for compiling Objective-C
2263 and Objective-C++ programs:
2264
2265 @table @gcctabopt
2266 @item -fconstant-string-class=@var{class-name}
2267 @opindex fconstant-string-class
2268 Use @var{class-name} as the name of the class to instantiate for each
2269 literal string specified with the syntax @code{@@"@dots{}"}.  The default
2270 class name is @code{NXConstantString} if the GNU runtime is being used, and
2271 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
2272 @option{-fconstant-cfstrings} option, if also present, will override the
2273 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
2274 to be laid out as constant CoreFoundation strings.
2275
2276 @item -fgnu-runtime
2277 @opindex fgnu-runtime
2278 Generate object code compatible with the standard GNU Objective-C
2279 runtime.  This is the default for most types of systems.
2280
2281 @item -fnext-runtime
2282 @opindex fnext-runtime
2283 Generate output compatible with the NeXT runtime.  This is the default
2284 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
2285 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
2286 used.
2287
2288 @item -fno-nil-receivers
2289 @opindex fno-nil-receivers
2290 Assume that all Objective-C message dispatches (e.g.,
2291 @code{[receiver message:arg]}) in this translation unit ensure that the receiver
2292 is not @code{nil}.  This allows for more efficient entry points in the runtime
2293 to be used.  Currently, this option is only available in conjunction with
2294 the NeXT runtime on Mac OS X 10.3 and later.
2295
2296 @item -fobjc-call-cxx-cdtors
2297 @opindex fobjc-call-cxx-cdtors
2298 For each Objective-C class, check if any of its instance variables is a
2299 C++ object with a non-trivial default constructor.  If so, synthesize a
2300 special @code{- (id) .cxx_construct} instance method that will run
2301 non-trivial default constructors on any such instance variables, in order,
2302 and then return @code{self}.  Similarly, check if any instance variable
2303 is a C++ object with a non-trivial destructor, and if so, synthesize a
2304 special @code{- (void) .cxx_destruct} method that will run
2305 all such default destructors, in reverse order.
2306
2307 The @code{- (id) .cxx_construct} and/or @code{- (void) .cxx_destruct} methods
2308 thusly generated will only operate on instance variables declared in the
2309 current Objective-C class, and not those inherited from superclasses.  It
2310 is the responsibility of the Objective-C runtime to invoke all such methods
2311 in an object's inheritance hierarchy.  The @code{- (id) .cxx_construct} methods
2312 will be invoked by the runtime immediately after a new object
2313 instance is allocated; the @code{- (void) .cxx_destruct} methods will
2314 be invoked immediately before the runtime deallocates an object instance.
2315
2316 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
2317 support for invoking the @code{- (id) .cxx_construct} and
2318 @code{- (void) .cxx_destruct} methods.
2319
2320 @item -fobjc-direct-dispatch
2321 @opindex fobjc-direct-dispatch
2322 Allow fast jumps to the message dispatcher.  On Darwin this is
2323 accomplished via the comm page.
2324
2325 @item -fobjc-exceptions
2326 @opindex fobjc-exceptions
2327 Enable syntactic support for structured exception handling in Objective-C,
2328 similar to what is offered by C++ and Java.  This option is
2329 unavailable in conjunction with the NeXT runtime on Mac OS X 10.2 and
2330 earlier.
2331
2332 @smallexample
2333   @@try @{
2334     @dots{}
2335        @@throw expr;
2336     @dots{}
2337   @}
2338   @@catch (AnObjCClass *exc) @{
2339     @dots{}
2340       @@throw expr;
2341     @dots{}
2342       @@throw;
2343     @dots{}
2344   @}
2345   @@catch (AnotherClass *exc) @{
2346     @dots{}
2347   @}
2348   @@catch (id allOthers) @{
2349     @dots{}
2350   @}
2351   @@finally @{
2352     @dots{}
2353       @@throw expr;
2354     @dots{}
2355   @}
2356 @end smallexample
2357
2358 The @code{@@throw} statement may appear anywhere in an Objective-C or
2359 Objective-C++ program; when used inside of a @code{@@catch} block, the
2360 @code{@@throw} may appear without an argument (as shown above), in which case
2361 the object caught by the @code{@@catch} will be rethrown.
2362
2363 Note that only (pointers to) Objective-C objects may be thrown and
2364 caught using this scheme.  When an object is thrown, it will be caught
2365 by the nearest @code{@@catch} clause capable of handling objects of that type,
2366 analogously to how @code{catch} blocks work in C++ and Java.  A
2367 @code{@@catch(id @dots{})} clause (as shown above) may also be provided to catch
2368 any and all Objective-C exceptions not caught by previous @code{@@catch}
2369 clauses (if any).
2370
2371 The @code{@@finally} clause, if present, will be executed upon exit from the
2372 immediately preceding @code{@@try @dots{} @@catch} section.  This will happen
2373 regardless of whether any exceptions are thrown, caught or rethrown
2374 inside the @code{@@try @dots{} @@catch} section, analogously to the behavior
2375 of the @code{finally} clause in Java.
2376
2377 There are several caveats to using the new exception mechanism:
2378
2379 @itemize @bullet
2380 @item
2381 Although currently designed to be binary compatible with @code{NS_HANDLER}-style
2382 idioms provided by the @code{NSException} class, the new
2383 exceptions can only be used on Mac OS X 10.3 (Panther) and later
2384 systems, due to additional functionality needed in the (NeXT) Objective-C
2385 runtime.
2386
2387 @item
2388 As mentioned above, the new exceptions do not support handling
2389 types other than Objective-C objects.   Furthermore, when used from
2390 Objective-C++, the Objective-C exception model does not interoperate with C++
2391 exceptions at this time.  This means you cannot @code{@@throw} an exception
2392 from Objective-C and @code{catch} it in C++, or vice versa
2393 (i.e., @code{throw @dots{} @@catch}).
2394 @end itemize
2395
2396 The @option{-fobjc-exceptions} switch also enables the use of synchronization
2397 blocks for thread-safe execution:
2398
2399 @smallexample
2400   @@synchronized (ObjCClass *guard) @{
2401     @dots{}
2402   @}
2403 @end smallexample
2404
2405 Upon entering the @code{@@synchronized} block, a thread of execution shall
2406 first check whether a lock has been placed on the corresponding @code{guard}
2407 object by another thread.  If it has, the current thread shall wait until
2408 the other thread relinquishes its lock.  Once @code{guard} becomes available,
2409 the current thread will place its own lock on it, execute the code contained in
2410 the @code{@@synchronized} block, and finally relinquish the lock (thereby
2411 making @code{guard} available to other threads).
2412
2413 Unlike Java, Objective-C does not allow for entire methods to be marked
2414 @code{@@synchronized}.  Note that throwing exceptions out of
2415 @code{@@synchronized} blocks is allowed, and will cause the guarding object
2416 to be unlocked properly.
2417
2418 @item -fobjc-gc
2419 @opindex fobjc-gc
2420 Enable garbage collection (GC) in Objective-C and Objective-C++ programs.
2421
2422 @item -freplace-objc-classes
2423 @opindex freplace-objc-classes
2424 Emit a special marker instructing @command{ld(1)} not to statically link in
2425 the resulting object file, and allow @command{dyld(1)} to load it in at
2426 run time instead.  This is used in conjunction with the Fix-and-Continue
2427 debugging mode, where the object file in question may be recompiled and
2428 dynamically reloaded in the course of program execution, without the need
2429 to restart the program itself.  Currently, Fix-and-Continue functionality
2430 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
2431 and later.
2432
2433 @item -fzero-link
2434 @opindex fzero-link
2435 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
2436 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
2437 compile time) with static class references that get initialized at load time,
2438 which improves run-time performance.  Specifying the @option{-fzero-link} flag
2439 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
2440 to be retained.  This is useful in Zero-Link debugging mode, since it allows
2441 for individual class implementations to be modified during program execution.
2442
2443 @item -gen-decls
2444 @opindex gen-decls
2445 Dump interface declarations for all classes seen in the source file to a
2446 file named @file{@var{sourcename}.decl}.
2447
2448 @item -Wassign-intercept @r{(Objective-C and Objective-C++ only)}
2449 @opindex Wassign-intercept
2450 @opindex Wno-assign-intercept
2451 Warn whenever an Objective-C assignment is being intercepted by the
2452 garbage collector.
2453
2454 @item -Wno-protocol @r{(Objective-C and Objective-C++ only)}
2455 @opindex Wno-protocol
2456 @opindex Wprotocol
2457 If a class is declared to implement a protocol, a warning is issued for
2458 every method in the protocol that is not implemented by the class.  The
2459 default behavior is to issue a warning for every method not explicitly
2460 implemented in the class, even if a method implementation is inherited
2461 from the superclass.  If you use the @option{-Wno-protocol} option, then
2462 methods inherited from the superclass are considered to be implemented,
2463 and no warning is issued for them.
2464
2465 @item -Wselector @r{(Objective-C and Objective-C++ only)}
2466 @opindex Wselector
2467 @opindex Wno-selector
2468 Warn if multiple methods of different types for the same selector are
2469 found during compilation.  The check is performed on the list of methods
2470 in the final stage of compilation.  Additionally, a check is performed
2471 for each selector appearing in a @code{@@selector(@dots{})}
2472 expression, and a corresponding method for that selector has been found
2473 during compilation.  Because these checks scan the method table only at
2474 the end of compilation, these warnings are not produced if the final
2475 stage of compilation is not reached, for example because an error is
2476 found during compilation, or because the @option{-fsyntax-only} option is
2477 being used.
2478
2479 @item -Wstrict-selector-match @r{(Objective-C and Objective-C++ only)}
2480 @opindex Wstrict-selector-match
2481 @opindex Wno-strict-selector-match
2482 Warn if multiple methods with differing argument and/or return types are
2483 found for a given selector when attempting to send a message using this
2484 selector to a receiver of type @code{id} or @code{Class}.  When this flag
2485 is off (which is the default behavior), the compiler will omit such warnings
2486 if any differences found are confined to types which share the same size
2487 and alignment.
2488
2489 @item -Wundeclared-selector @r{(Objective-C and Objective-C++ only)}
2490 @opindex Wundeclared-selector
2491 @opindex Wno-undeclared-selector
2492 Warn if a @code{@@selector(@dots{})} expression referring to an
2493 undeclared selector is found.  A selector is considered undeclared if no
2494 method with that name has been declared before the
2495 @code{@@selector(@dots{})} expression, either explicitly in an
2496 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
2497 an @code{@@implementation} section.  This option always performs its
2498 checks as soon as a @code{@@selector(@dots{})} expression is found,
2499 while @option{-Wselector} only performs its checks in the final stage of
2500 compilation.  This also enforces the coding style convention
2501 that methods and selectors must be declared before being used.
2502
2503 @item -print-objc-runtime-info
2504 @opindex print-objc-runtime-info
2505 Generate C header describing the largest structure that is passed by
2506 value, if any.
2507
2508 @end table
2509
2510 @node Language Independent Options
2511 @section Options to Control Diagnostic Messages Formatting
2512 @cindex options to control diagnostics formatting
2513 @cindex diagnostic messages
2514 @cindex message formatting
2515
2516 Traditionally, diagnostic messages have been formatted irrespective of
2517 the output device's aspect (e.g.@: its width, @dots{}).  The options described
2518 below can be used to control the diagnostic messages formatting
2519 algorithm, e.g.@: how many characters per line, how often source location
2520 information should be reported.  Right now, only the C++ front end can
2521 honor these options.  However it is expected, in the near future, that
2522 the remaining front ends would be able to digest them correctly.
2523
2524 @table @gcctabopt
2525 @item -fmessage-length=@var{n}
2526 @opindex fmessage-length
2527 Try to format error messages so that they fit on lines of about @var{n}
2528 characters.  The default is 72 characters for @command{g++} and 0 for the rest of
2529 the front ends supported by GCC@.  If @var{n} is zero, then no
2530 line-wrapping will be done; each error message will appear on a single
2531 line.
2532
2533 @opindex fdiagnostics-show-location
2534 @item -fdiagnostics-show-location=once
2535 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
2536 reporter to emit @emph{once} source location information; that is, in
2537 case the message is too long to fit on a single physical line and has to
2538 be wrapped, the source location won't be emitted (as prefix) again,
2539 over and over, in subsequent continuation lines.  This is the default
2540 behavior.
2541
2542 @item -fdiagnostics-show-location=every-line
2543 Only meaningful in line-wrapping mode.  Instructs the diagnostic
2544 messages reporter to emit the same source location information (as
2545 prefix) for physical lines that result from the process of breaking
2546 a message which is too long to fit on a single line.
2547
2548 @item -fdiagnostics-show-option
2549 @opindex fdiagnostics-show-option
2550 This option instructs the diagnostic machinery to add text to each
2551 diagnostic emitted, which indicates which command line option directly
2552 controls that diagnostic, when such an option is known to the
2553 diagnostic machinery.
2554
2555 @item -Wcoverage-mismatch
2556 @opindex Wcoverage-mismatch
2557 Warn if feedback profiles do not match when using the
2558 @option{-fprofile-use} option.
2559 If a source file was changed between @option{-fprofile-gen} and
2560 @option{-fprofile-use}, the files with the profile feedback can fail
2561 to match the source file and GCC can not use the profile feedback
2562 information.  By default, GCC emits an error message in this case.
2563 The option @option{-Wcoverage-mismatch} emits a warning instead of an
2564 error.  GCC does not use appropriate feedback profiles, so using this
2565 option can result in poorly optimized code.  This option is useful
2566 only in the case of very minor changes such as bug fixes to an
2567 existing code-base.
2568
2569 @end table
2570
2571 @node Warning Options
2572 @section Options to Request or Suppress Warnings
2573 @cindex options to control warnings
2574 @cindex warning messages
2575 @cindex messages, warning
2576 @cindex suppressing warnings
2577
2578 Warnings are diagnostic messages that report constructions which
2579 are not inherently erroneous but which are risky or suggest there
2580 may have been an error.
2581
2582 The following language-independent options do not enable specific
2583 warnings but control the kinds of diagnostics produced by GCC.
2584
2585 @table @gcctabopt
2586 @cindex syntax checking
2587 @item -fsyntax-only
2588 @opindex fsyntax-only
2589 Check the code for syntax errors, but don't do anything beyond that.
2590
2591 @item -w
2592 @opindex w
2593 Inhibit all warning messages.
2594
2595 @item -Werror
2596 @opindex Werror
2597 @opindex Wno-error
2598 Make all warnings into errors.
2599
2600 @item -Werror=
2601 @opindex Werror=
2602 @opindex Wno-error=
2603 Make the specified warning into an error.  The specifier for a warning
2604 is appended, for example @option{-Werror=switch} turns the warnings
2605 controlled by @option{-Wswitch} into errors.  This switch takes a
2606 negative form, to be used to negate @option{-Werror} for specific
2607 warnings, for example @option{-Wno-error=switch} makes
2608 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
2609 is in effect.  You can use the @option{-fdiagnostics-show-option}
2610 option to have each controllable warning amended with the option which
2611 controls it, to determine what to use with this option.
2612
2613 Note that specifying @option{-Werror=}@var{foo} automatically implies
2614 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
2615 imply anything.
2616
2617 @item -Wfatal-errors
2618 @opindex Wfatal-errors
2619 @opindex Wno-fatal-errors
2620 This option causes the compiler to abort compilation on the first error
2621 occurred rather than trying to keep going and printing further error
2622 messages.
2623
2624 @end table
2625
2626 You can request many specific warnings with options beginning
2627 @samp{-W}, for example @option{-Wimplicit} to request warnings on
2628 implicit declarations.  Each of these specific warning options also
2629 has a negative form beginning @samp{-Wno-} to turn off warnings; for
2630 example, @option{-Wno-implicit}.  This manual lists only one of the
2631 two forms, whichever is not the default.  For further,
2632 language-specific options also refer to @ref{C++ Dialect Options} and
2633 @ref{Objective-C and Objective-C++ Dialect Options}.
2634
2635 @table @gcctabopt
2636 @item -pedantic
2637 @opindex pedantic
2638 Issue all the warnings demanded by strict ISO C and ISO C++;
2639 reject all programs that use forbidden extensions, and some other
2640 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
2641 version of the ISO C standard specified by any @option{-std} option used.
2642
2643 Valid ISO C and ISO C++ programs should compile properly with or without
2644 this option (though a rare few will require @option{-ansi} or a
2645 @option{-std} option specifying the required version of ISO C)@.  However,
2646 without this option, certain GNU extensions and traditional C and C++
2647 features are supported as well.  With this option, they are rejected.
2648
2649 @option{-pedantic} does not cause warning messages for use of the
2650 alternate keywords whose names begin and end with @samp{__}.  Pedantic
2651 warnings are also disabled in the expression that follows
2652 @code{__extension__}.  However, only system header files should use
2653 these escape routes; application programs should avoid them.
2654 @xref{Alternate Keywords}.
2655
2656 Some users try to use @option{-pedantic} to check programs for strict ISO
2657 C conformance.  They soon find that it does not do quite what they want:
2658 it finds some non-ISO practices, but not all---only those for which
2659 ISO C @emph{requires} a diagnostic, and some others for which
2660 diagnostics have been added.
2661
2662 A feature to report any failure to conform to ISO C might be useful in
2663 some instances, but would require considerable additional work and would
2664 be quite different from @option{-pedantic}.  We don't have plans to
2665 support such a feature in the near future.
2666
2667 Where the standard specified with @option{-std} represents a GNU
2668 extended dialect of C, such as @samp{gnu89} or @samp{gnu99}, there is a
2669 corresponding @dfn{base standard}, the version of ISO C on which the GNU
2670 extended dialect is based.  Warnings from @option{-pedantic} are given
2671 where they are required by the base standard.  (It would not make sense
2672 for such warnings to be given only for features not in the specified GNU
2673 C dialect, since by definition the GNU dialects of C include all
2674 features the compiler supports with the given option, and there would be
2675 nothing to warn about.)
2676
2677 @item -pedantic-errors
2678 @opindex pedantic-errors
2679 Like @option{-pedantic}, except that errors are produced rather than
2680 warnings.
2681
2682 @item -Wall
2683 @opindex Wall
2684 @opindex Wno-all
2685 This enables all the warnings about constructions that some users
2686 consider questionable, and that are easy to avoid (or modify to
2687 prevent the warning), even in conjunction with macros.  This also
2688 enables some language-specific warnings described in @ref{C++ Dialect
2689 Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
2690
2691 @option{-Wall} turns on the following warning flags:
2692
2693 @gccoptlist{-Waddress   @gol
2694 -Warray-bounds @r{(only with} @option{-O2}@r{)}  @gol
2695 -Wc++0x-compat  @gol
2696 -Wchar-subscripts  @gol
2697 -Wimplicit-int  @gol
2698 -Wimplicit-function-declaration  @gol
2699 -Wcomment  @gol
2700 -Wformat   @gol
2701 -Wmain @r{(only for C/ObjC and unless} @option{-ffreestanding}@r{)}  @gol
2702 -Wmissing-braces  @gol
2703 -Wnonnull  @gol
2704 -Wparentheses  @gol
2705 -Wpointer-sign  @gol
2706 -Wreorder   @gol
2707 -Wreturn-type  @gol
2708 -Wsequence-point  @gol
2709 -Wsign-compare @r{(only in C++)}  @gol
2710 -Wstrict-aliasing  @gol
2711 -Wstrict-overflow=1  @gol
2712 -Wswitch  @gol
2713 -Wtrigraphs  @gol
2714 -Wuninitialized  @gol
2715 -Wunknown-pragmas  @gol
2716 -Wunused-function  @gol
2717 -Wunused-label     @gol
2718 -Wunused-value     @gol
2719 -Wunused-variable  @gol
2720 -Wvolatile-register-var @gol
2721 }
2722
2723 Note that some warning flags are not implied by @option{-Wall}.  Some of
2724 them warn about constructions that users generally do not consider
2725 questionable, but which occasionally you might wish to check for;
2726 others warn about constructions that are necessary or hard to avoid in
2727 some cases, and there is no simple way to modify the code to suppress
2728 the warning. Some of them are enabled by @option{-Wextra} but many of
2729 them must be enabled individually.
2730
2731 @item -Wextra
2732 @opindex W
2733 @opindex Wextra
2734 @opindex Wno-extra
2735 This enables some extra warning flags that are not enabled by
2736 @option{-Wall}. (This option used to be called @option{-W}.  The older
2737 name is still supported, but the newer name is more descriptive.)
2738
2739 @gccoptlist{-Wclobbered  @gol
2740 -Wempty-body  @gol
2741 -Wignored-qualifiers @gol
2742 -Wmissing-field-initializers  @gol
2743 -Wmissing-parameter-type @r{(C only)}  @gol
2744 -Wold-style-declaration @r{(C only)}  @gol
2745 -Woverride-init  @gol
2746 -Wsign-compare  @gol
2747 -Wtype-limits  @gol
2748 -Wuninitialized  @gol
2749 -Wunused-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)}  @gol
2750 }
2751
2752 The option @option{-Wextra} also prints warning messages for the
2753 following cases:
2754
2755 @itemize @bullet
2756
2757 @item
2758 A pointer is compared against integer zero with @samp{<}, @samp{<=},
2759 @samp{>}, or @samp{>=}.
2760
2761 @item 
2762 (C++ only) An enumerator and a non-enumerator both appear in a
2763 conditional expression.
2764
2765 @item 
2766 (C++ only) Ambiguous virtual bases.
2767
2768 @item 
2769 (C++ only) Subscripting an array which has been declared @samp{register}.
2770
2771 @item 
2772 (C++ only) Taking the address of a variable which has been declared
2773 @samp{register}.
2774
2775 @item 
2776 (C++ only) A base class is not initialized in a derived class' copy
2777 constructor.
2778
2779 @end itemize
2780
2781 @item -Wchar-subscripts
2782 @opindex Wchar-subscripts
2783 @opindex Wno-char-subscripts
2784 Warn if an array subscript has type @code{char}.  This is a common cause
2785 of error, as programmers often forget that this type is signed on some
2786 machines.
2787 This warning is enabled by @option{-Wall}.
2788
2789 @item -Wcomment
2790 @opindex Wcomment
2791 @opindex Wno-comment
2792 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
2793 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
2794 This warning is enabled by @option{-Wall}.
2795
2796 @item -Wformat
2797 @opindex Wformat
2798 @opindex Wno-format
2799 @opindex ffreestanding
2800 @opindex fno-builtin
2801 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
2802 the arguments supplied have types appropriate to the format string
2803 specified, and that the conversions specified in the format string make
2804 sense.  This includes standard functions, and others specified by format
2805 attributes (@pxref{Function Attributes}), in the @code{printf},
2806 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
2807 not in the C standard) families (or other target-specific families).
2808 Which functions are checked without format attributes having been
2809 specified depends on the standard version selected, and such checks of
2810 functions without the attribute specified are disabled by
2811 @option{-ffreestanding} or @option{-fno-builtin}.
2812
2813 The formats are checked against the format features supported by GNU
2814 libc version 2.2.  These include all ISO C90 and C99 features, as well
2815 as features from the Single Unix Specification and some BSD and GNU
2816 extensions.  Other library implementations may not support all these
2817 features; GCC does not support warning about features that go beyond a
2818 particular library's limitations.  However, if @option{-pedantic} is used
2819 with @option{-Wformat}, warnings will be given about format features not
2820 in the selected standard version (but not for @code{strfmon} formats,
2821 since those are not in any version of the C standard).  @xref{C Dialect
2822 Options,,Options Controlling C Dialect}.
2823
2824 Since @option{-Wformat} also checks for null format arguments for
2825 several functions, @option{-Wformat} also implies @option{-Wnonnull}.
2826
2827 @option{-Wformat} is included in @option{-Wall}.  For more control over some
2828 aspects of format checking, the options @option{-Wformat-y2k},
2829 @option{-Wno-format-extra-args}, @option{-Wno-format-zero-length},
2830 @option{-Wformat-nonliteral}, @option{-Wformat-security}, and
2831 @option{-Wformat=2} are available, but are not included in @option{-Wall}.
2832
2833 @item -Wformat-y2k
2834 @opindex Wformat-y2k
2835 @opindex Wno-format-y2k
2836 If @option{-Wformat} is specified, also warn about @code{strftime}
2837 formats which may yield only a two-digit year.
2838
2839 @item -Wno-format-contains-nul
2840 @opindex Wno-format-contains-nul
2841 @opindex Wformat-contains-nul
2842 If @option{-Wformat} is specified, do not warn about format strings that
2843 contain NUL bytes.
2844
2845 @item -Wno-format-extra-args
2846 @opindex Wno-format-extra-args
2847 @opindex Wformat-extra-args
2848 If @option{-Wformat} is specified, do not warn about excess arguments to a
2849 @code{printf} or @code{scanf} format function.  The C standard specifies
2850 that such arguments are ignored.
2851
2852 Where the unused arguments lie between used arguments that are
2853 specified with @samp{$} operand number specifications, normally
2854 warnings are still given, since the implementation could not know what
2855 type to pass to @code{va_arg} to skip the unused arguments.  However,
2856 in the case of @code{scanf} formats, this option will suppress the
2857 warning if the unused arguments are all pointers, since the Single
2858 Unix Specification says that such unused arguments are allowed.
2859
2860 @item -Wno-format-zero-length @r{(C and Objective-C only)}
2861 @opindex Wno-format-zero-length
2862 @opindex Wformat-zero-length
2863 If @option{-Wformat} is specified, do not warn about zero-length formats.
2864 The C standard specifies that zero-length formats are allowed.
2865
2866 @item -Wformat-nonliteral
2867 @opindex Wformat-nonliteral
2868 @opindex Wno-format-nonliteral
2869 If @option{-Wformat} is specified, also warn if the format string is not a
2870 string literal and so cannot be checked, unless the format function
2871 takes its format arguments as a @code{va_list}.
2872
2873 @item -Wformat-security
2874 @opindex Wformat-security
2875 @opindex Wno-format-security
2876 If @option{-Wformat} is specified, also warn about uses of format
2877 functions that represent possible security problems.  At present, this
2878 warns about calls to @code{printf} and @code{scanf} functions where the
2879 format string is not a string literal and there are no format arguments,
2880 as in @code{printf (foo);}.  This may be a security hole if the format
2881 string came from untrusted input and contains @samp{%n}.  (This is
2882 currently a subset of what @option{-Wformat-nonliteral} warns about, but
2883 in future warnings may be added to @option{-Wformat-security} that are not
2884 included in @option{-Wformat-nonliteral}.)
2885
2886 @item -Wformat=2
2887 @opindex Wformat=2
2888 @opindex Wno-format=2
2889 Enable @option{-Wformat} plus format checks not included in
2890 @option{-Wformat}.  Currently equivalent to @samp{-Wformat
2891 -Wformat-nonliteral -Wformat-security -Wformat-y2k}.
2892
2893 @item -Wnonnull @r{(C and Objective-C only)}
2894 @opindex Wnonnull
2895 @opindex Wno-nonnull
2896 Warn about passing a null pointer for arguments marked as
2897 requiring a non-null value by the @code{nonnull} function attribute.
2898
2899 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
2900 can be disabled with the @option{-Wno-nonnull} option.
2901
2902 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
2903 @opindex Winit-self
2904 @opindex Wno-init-self
2905 Warn about uninitialized variables which are initialized with themselves.
2906 Note this option can only be used with the @option{-Wuninitialized} option.
2907
2908 For example, GCC will warn about @code{i} being uninitialized in the
2909 following snippet only when @option{-Winit-self} has been specified:
2910 @smallexample
2911 @group
2912 int f()
2913 @{
2914   int i = i;
2915   return i;
2916 @}
2917 @end group
2918 @end smallexample
2919
2920 @item -Wimplicit-int @r{(C and Objective-C only)}
2921 @opindex Wimplicit-int
2922 @opindex Wno-implicit-int
2923 Warn when a declaration does not specify a type.
2924 This warning is enabled by @option{-Wall}.
2925
2926 @item -Wimplicit-function-declaration @r{(C and Objective-C only)}
2927 @opindex Wimplicit-function-declaration
2928 @opindex Wno-implicit-function-declaration
2929 Give a warning whenever a function is used before being declared. In
2930 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
2931 enabled by default and it is made into an error by
2932 @option{-pedantic-errors}. This warning is also enabled by
2933 @option{-Wall}.
2934
2935 @item -Wimplicit
2936 @opindex Wimplicit
2937 @opindex Wno-implicit
2938 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
2939 This warning is enabled by @option{-Wall}.
2940
2941 @item -Wignored-qualifiers @r{(C and C++ only)}
2942 @opindex Wignored-qualifiers
2943 @opindex Wno-ignored-qualifiers
2944 Warn if the return type of a function has a type qualifier
2945 such as @code{const}.  For ISO C such a type qualifier has no effect,
2946 since the value returned by a function is not an lvalue.
2947 For C++, the warning is only emitted for scalar types or @code{void}.
2948 ISO C prohibits qualified @code{void} return types on function
2949 definitions, so such return types always receive a warning
2950 even without this option.
2951
2952 This warning is also enabled by @option{-Wextra}.
2953
2954 @item -Wmain
2955 @opindex Wmain
2956 @opindex Wno-main
2957 Warn if the type of @samp{main} is suspicious.  @samp{main} should be
2958 a function with external linkage, returning int, taking either zero
2959 arguments, two, or three arguments of appropriate types.  This warning
2960 is enabled by default in C++ and is enabled by either @option{-Wall}
2961 or @option{-pedantic}.
2962
2963 @item -Wmissing-braces
2964 @opindex Wmissing-braces
2965 @opindex Wno-missing-braces
2966 Warn if an aggregate or union initializer is not fully bracketed.  In
2967 the following example, the initializer for @samp{a} is not fully
2968 bracketed, but that for @samp{b} is fully bracketed.
2969
2970 @smallexample
2971 int a[2][2] = @{ 0, 1, 2, 3 @};
2972 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
2973 @end smallexample
2974
2975 This warning is enabled by @option{-Wall}.
2976
2977 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
2978 @opindex Wmissing-include-dirs
2979 @opindex Wno-missing-include-dirs
2980 Warn if a user-supplied include directory does not exist.
2981
2982 @item -Wparentheses
2983 @opindex Wparentheses
2984 @opindex Wno-parentheses
2985 Warn if parentheses are omitted in certain contexts, such
2986 as when there is an assignment in a context where a truth value
2987 is expected, or when operators are nested whose precedence people
2988 often get confused about.
2989
2990 Also warn if a comparison like @samp{x<=y<=z} appears; this is
2991 equivalent to @samp{(x<=y ? 1 : 0) <= z}, which is a different
2992 interpretation from that of ordinary mathematical notation.
2993
2994 Also warn about constructions where there may be confusion to which
2995 @code{if} statement an @code{else} branch belongs.  Here is an example of
2996 such a case:
2997
2998 @smallexample
2999 @group
3000 @{
3001   if (a)
3002     if (b)
3003       foo ();
3004   else
3005     bar ();
3006 @}
3007 @end group
3008 @end smallexample
3009
3010 In C/C++, every @code{else} branch belongs to the innermost possible
3011 @code{if} statement, which in this example is @code{if (b)}.  This is
3012 often not what the programmer expected, as illustrated in the above
3013 example by indentation the programmer chose.  When there is the
3014 potential for this confusion, GCC will issue a warning when this flag
3015 is specified.  To eliminate the warning, add explicit braces around
3016 the innermost @code{if} statement so there is no way the @code{else}
3017 could belong to the enclosing @code{if}.  The resulting code would
3018 look like this:
3019
3020 @smallexample
3021 @group
3022 @{
3023   if (a)
3024     @{
3025       if (b)
3026         foo ();
3027       else
3028         bar ();
3029     @}
3030 @}
3031 @end group
3032 @end smallexample
3033
3034 This warning is enabled by @option{-Wall}.
3035
3036 @item -Wsequence-point
3037 @opindex Wsequence-point
3038 @opindex Wno-sequence-point
3039 Warn about code that may have undefined semantics because of violations
3040 of sequence point rules in the C and C++ standards.
3041
3042 The C and C++ standards defines the order in which expressions in a C/C++
3043 program are evaluated in terms of @dfn{sequence points}, which represent
3044 a partial ordering between the execution of parts of the program: those
3045 executed before the sequence point, and those executed after it.  These
3046 occur after the evaluation of a full expression (one which is not part
3047 of a larger expression), after the evaluation of the first operand of a
3048 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
3049 function is called (but after the evaluation of its arguments and the
3050 expression denoting the called function), and in certain other places.
3051 Other than as expressed by the sequence point rules, the order of
3052 evaluation of subexpressions of an expression is not specified.  All
3053 these rules describe only a partial order rather than a total order,
3054 since, for example, if two functions are called within one expression
3055 with no sequence point between them, the order in which the functions
3056 are called is not specified.  However, the standards committee have
3057 ruled that function calls do not overlap.
3058
3059 It is not specified when between sequence points modifications to the
3060 values of objects take effect.  Programs whose behavior depends on this
3061 have undefined behavior; the C and C++ standards specify that ``Between
3062 the previous and next sequence point an object shall have its stored
3063 value modified at most once by the evaluation of an expression.
3064 Furthermore, the prior value shall be read only to determine the value
3065 to be stored.''.  If a program breaks these rules, the results on any
3066 particular implementation are entirely unpredictable.
3067
3068 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
3069 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
3070 diagnosed by this option, and it may give an occasional false positive
3071 result, but in general it has been found fairly effective at detecting
3072 this sort of problem in programs.
3073
3074 The standard is worded confusingly, therefore there is some debate
3075 over the precise meaning of the sequence point rules in subtle cases.
3076 Links to discussions of the problem, including proposed formal
3077 definitions, may be found on the GCC readings page, at
3078 @w{@uref{http://gcc.gnu.org/readings.html}}.
3079
3080 This warning is enabled by @option{-Wall} for C and C++.
3081
3082 @item -Wreturn-type
3083 @opindex Wreturn-type
3084 @opindex Wno-return-type
3085 Warn whenever a function is defined with a return-type that defaults
3086 to @code{int}.  Also warn about any @code{return} statement with no
3087 return-value in a function whose return-type is not @code{void}
3088 (falling off the end of the function body is considered returning
3089 without a value), and about a @code{return} statement with a
3090 expression in a function whose return-type is @code{void}.
3091
3092 For C++, a function without return type always produces a diagnostic
3093 message, even when @option{-Wno-return-type} is specified.  The only
3094 exceptions are @samp{main} and functions defined in system headers.
3095
3096 This warning is enabled by @option{-Wall}.
3097
3098 @item -Wswitch
3099 @opindex Wswitch
3100 @opindex Wno-switch
3101 Warn whenever a @code{switch} statement has an index of enumerated type
3102 and lacks a @code{case} for one or more of the named codes of that
3103 enumeration.  (The presence of a @code{default} label prevents this
3104 warning.)  @code{case} labels outside the enumeration range also
3105 provoke warnings when this option is used.
3106 This warning is enabled by @option{-Wall}.
3107
3108 @item -Wswitch-default
3109 @opindex Wswitch-default
3110 @opindex Wno-switch-default
3111 Warn whenever a @code{switch} statement does not have a @code{default}
3112 case.
3113
3114 @item -Wswitch-enum
3115 @opindex Wswitch-enum
3116 @opindex Wno-switch-enum
3117 Warn whenever a @code{switch} statement has an index of enumerated type
3118 and lacks a @code{case} for one or more of the named codes of that
3119 enumeration.  @code{case} labels outside the enumeration range also
3120 provoke warnings when this option is used.
3121
3122 @item -Wtrigraphs
3123 @opindex Wtrigraphs
3124 @opindex Wno-trigraphs
3125 Warn if any trigraphs are encountered that might change the meaning of
3126 the program (trigraphs within comments are not warned about).
3127 This warning is enabled by @option{-Wall}.
3128
3129 @item -Wunused-function
3130 @opindex Wunused-function
3131 @opindex Wno-unused-function
3132 Warn whenever a static function is declared but not defined or a
3133 non-inline static function is unused.
3134 This warning is enabled by @option{-Wall}.
3135
3136 @item -Wunused-label
3137 @opindex Wunused-label
3138 @opindex Wno-unused-label
3139 Warn whenever a label is declared but not used.
3140 This warning is enabled by @option{-Wall}.
3141
3142 To suppress this warning use the @samp{unused} attribute
3143 (@pxref{Variable Attributes}).
3144
3145 @item -Wunused-parameter
3146 @opindex Wunused-parameter
3147 @opindex Wno-unused-parameter
3148 Warn whenever a function parameter is unused aside from its declaration.
3149
3150 To suppress this warning use the @samp{unused} attribute
3151 (@pxref{Variable Attributes}).
3152
3153 @item -Wunused-variable
3154 @opindex Wunused-variable
3155 @opindex Wno-unused-variable
3156 Warn whenever a local variable or non-constant static variable is unused
3157 aside from its declaration.
3158 This warning is enabled by @option{-Wall}.
3159
3160 To suppress this warning use the @samp{unused} attribute
3161 (@pxref{Variable Attributes}).
3162
3163 @item -Wunused-value
3164 @opindex Wunused-value
3165 @opindex Wno-unused-value
3166 Warn whenever a statement computes a result that is explicitly not
3167 used. To suppress this warning cast the unused expression to
3168 @samp{void}. This includes an expression-statement or the left-hand
3169 side of a comma expression that contains no side effects. For example,
3170 an expression such as @samp{x[i,j]} will cause a warning, while
3171 @samp{x[(void)i,j]} will not.
3172
3173 This warning is enabled by @option{-Wall}.
3174
3175 @item -Wunused
3176 @opindex Wunused
3177 @opindex Wno-unused
3178 All the above @option{-Wunused} options combined.
3179
3180 In order to get a warning about an unused function parameter, you must
3181 either specify @samp{-Wextra -Wunused} (note that @samp{-Wall} implies
3182 @samp{-Wunused}), or separately specify @option{-Wunused-parameter}.
3183
3184 @item -Wuninitialized
3185 @opindex Wuninitialized
3186 @opindex Wno-uninitialized
3187 Warn if an automatic variable is used without first being initialized
3188 or if a variable may be clobbered by a @code{setjmp} call. In C++,
3189 warn if a non-static reference or non-static @samp{const} member
3190 appears in a class without constructors.
3191
3192 If you want to warn about code which uses the uninitialized value of the
3193 variable in its own initializer, use the @option{-Winit-self} option.
3194
3195 These warnings occur for individual uninitialized or clobbered
3196 elements of structure, union or array variables as well as for
3197 variables which are uninitialized or clobbered as a whole.  They do
3198 not occur for variables or elements declared @code{volatile}.  Because
3199 these warnings depend on optimization, the exact variables or elements
3200 for which there are warnings will depend on the precise optimization
3201 options and version of GCC used.
3202
3203 Note that there may be no warning about a variable that is used only
3204 to compute a value that itself is never used, because such
3205 computations may be deleted by data flow analysis before the warnings
3206 are printed.
3207
3208 These warnings are made optional because GCC is not smart
3209 enough to see all the reasons why the code might be correct
3210 despite appearing to have an error.  Here is one example of how
3211 this can happen:
3212
3213 @smallexample
3214 @group
3215 @{
3216   int x;
3217   switch (y)
3218     @{
3219     case 1: x = 1;
3220       break;
3221     case 2: x = 4;
3222       break;
3223     case 3: x = 5;
3224     @}
3225   foo (x);
3226 @}
3227 @end group
3228 @end smallexample
3229
3230 @noindent
3231 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
3232 always initialized, but GCC doesn't know this.  Here is
3233 another common case:
3234
3235 @smallexample
3236 @{
3237   int save_y;
3238   if (change_y) save_y = y, y = new_y;
3239   @dots{}
3240   if (change_y) y = save_y;
3241 @}
3242 @end smallexample
3243
3244 @noindent
3245 This has no bug because @code{save_y} is used only if it is set.
3246
3247 @cindex @code{longjmp} warnings
3248 This option also warns when a non-volatile automatic variable might be
3249 changed by a call to @code{longjmp}.  These warnings as well are possible
3250 only in optimizing compilation.
3251
3252 The compiler sees only the calls to @code{setjmp}.  It cannot know
3253 where @code{longjmp} will be called; in fact, a signal handler could
3254 call it at any point in the code.  As a result, you may get a warning
3255 even when there is in fact no problem because @code{longjmp} cannot
3256 in fact be called at the place which would cause a problem.
3257
3258 Some spurious warnings can be avoided if you declare all the functions
3259 you use that never return as @code{noreturn}.  @xref{Function
3260 Attributes}.
3261
3262 This warning is enabled by @option{-Wall} or @option{-Wextra}.
3263
3264 @item -Wunknown-pragmas
3265 @opindex Wunknown-pragmas
3266 @opindex Wno-unknown-pragmas
3267 @cindex warning for unknown pragmas
3268 @cindex unknown pragmas, warning
3269 @cindex pragmas, warning of unknown
3270 Warn when a #pragma directive is encountered which is not understood by
3271 GCC@.  If this command line option is used, warnings will even be issued
3272 for unknown pragmas in system header files.  This is not the case if
3273 the warnings were only enabled by the @option{-Wall} command line option.
3274
3275 @item -Wno-pragmas
3276 @opindex Wno-pragmas
3277 @opindex Wpragmas
3278 Do not warn about misuses of pragmas, such as incorrect parameters,
3279 invalid syntax, or conflicts between pragmas.  See also
3280 @samp{-Wunknown-pragmas}.
3281
3282 @item -Wstrict-aliasing
3283 @opindex Wstrict-aliasing
3284 @opindex Wno-strict-aliasing
3285 This option is only active when @option{-fstrict-aliasing} is active.
3286 It warns about code which might break the strict aliasing rules that the
3287 compiler is using for optimization.  The warning does not catch all
3288 cases, but does attempt to catch the more common pitfalls.  It is
3289 included in @option{-Wall}.
3290 It is equivalent to @option{-Wstrict-aliasing=3}
3291
3292 @item -Wstrict-aliasing=n
3293 @opindex Wstrict-aliasing=n
3294 @opindex Wno-strict-aliasing=n
3295 This option is only active when @option{-fstrict-aliasing} is active.
3296 It warns about code which might break the strict aliasing rules that the
3297 compiler is using for optimization.
3298 Higher levels correspond to higher accuracy (fewer false positives).
3299 Higher levels also correspond to more effort, similar to the way -O works.
3300 @option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=n},
3301 with n=3.
3302
3303 Level 1: Most aggressive, quick, least accurate.
3304 Possibly useful when higher levels
3305 do not warn but -fstrict-aliasing still breaks the code, as it has very few 
3306 false negatives.  However, it has many false positives.
3307 Warns for all pointer conversions between possibly incompatible types, 
3308 even if never dereferenced.  Runs in the frontend only.
3309
3310 Level 2: Aggressive, quick, not too precise.
3311 May still have many false positives (not as many as level 1 though),
3312 and few false negatives (but possibly more than level 1).
3313 Unlike level 1, it only warns when an address is taken.  Warns about
3314 incomplete types.  Runs in the frontend only.
3315
3316 Level 3 (default for @option{-Wstrict-aliasing}): 
3317 Should have very few false positives and few false 
3318 negatives.  Slightly slower than levels 1 or 2 when optimization is enabled.
3319 Takes care of the common punn+dereference pattern in the frontend:
3320 @code{*(int*)&some_float}.
3321 If optimization is enabled, it also runs in the backend, where it deals 
3322 with multiple statement cases using flow-sensitive points-to information.
3323 Only warns when the converted pointer is dereferenced.
3324 Does not warn about incomplete types.
3325
3326 @item -Wstrict-overflow
3327 @itemx -Wstrict-overflow=@var{n}
3328 @opindex Wstrict-overflow
3329 @opindex Wno-strict-overflow
3330 This option is only active when @option{-fstrict-overflow} is active.
3331 It warns about cases where the compiler optimizes based on the
3332 assumption that signed overflow does not occur.  Note that it does not
3333 warn about all cases where the code might overflow: it only warns
3334 about cases where the compiler implements some optimization.  Thus
3335 this warning depends on the optimization level.
3336
3337 An optimization which assumes that signed overflow does not occur is
3338 perfectly safe if the values of the variables involved are such that
3339 overflow never does, in fact, occur.  Therefore this warning can
3340 easily give a false positive: a warning about code which is not
3341 actually a problem.  To help focus on important issues, several
3342 warning levels are defined.  No warnings are issued for the use of
3343 undefined signed overflow when estimating how many iterations a loop
3344 will require, in particular when determining whether a loop will be
3345 executed at all.
3346
3347 @table @gcctabopt
3348 @item -Wstrict-overflow=1
3349 Warn about cases which are both questionable and easy to avoid.  For
3350 example: @code{x + 1 > x}; with @option{-fstrict-overflow}, the
3351 compiler will simplify this to @code{1}.  This level of
3352 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
3353 are not, and must be explicitly requested.
3354
3355 @item -Wstrict-overflow=2
3356 Also warn about other cases where a comparison is simplified to a
3357 constant.  For example: @code{abs (x) >= 0}.  This can only be
3358 simplified when @option{-fstrict-overflow} is in effect, because
3359 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
3360 zero.  @option{-Wstrict-overflow} (with no level) is the same as
3361 @option{-Wstrict-overflow=2}.
3362
3363 @item -Wstrict-overflow=3
3364 Also warn about other cases where a comparison is simplified.  For
3365 example: @code{x + 1 > 1} will be simplified to @code{x > 0}.
3366
3367 @item -Wstrict-overflow=4
3368 Also warn about other simplifications not covered by the above cases.
3369 For example: @code{(x * 10) / 5} will be simplified to @code{x * 2}.
3370
3371 @item -Wstrict-overflow=5
3372 Also warn about cases where the compiler reduces the magnitude of a
3373 constant involved in a comparison.  For example: @code{x + 2 > y} will
3374 be simplified to @code{x + 1 >= y}.  This is reported only at the
3375 highest warning level because this simplification applies to many
3376 comparisons, so this warning level will give a very large number of
3377 false positives.
3378 @end table
3379
3380 @item -Warray-bounds
3381 @opindex Wno-array-bounds
3382 @opindex Warray-bounds
3383 This option is only active when @option{-ftree-vrp} is active
3384 (default for -O2 and above). It warns about subscripts to arrays
3385 that are always out of bounds. This warning is enabled by @option{-Wall}.
3386
3387 @item -Wno-div-by-zero
3388 @opindex Wno-div-by-zero
3389 @opindex Wdiv-by-zero
3390 Do not warn about compile-time integer division by zero.  Floating point
3391 division by zero is not warned about, as it can be a legitimate way of
3392 obtaining infinities and NaNs.
3393
3394 @item -Wsystem-headers
3395 @opindex Wsystem-headers
3396 @opindex Wno-system-headers
3397 @cindex warnings from system headers
3398 @cindex system headers, warnings from
3399 Print warning messages for constructs found in system header files.
3400 Warnings from system headers are normally suppressed, on the assumption
3401 that they usually do not indicate real problems and would only make the
3402 compiler output harder to read.  Using this command line option tells
3403 GCC to emit warnings from system headers as if they occurred in user
3404 code.  However, note that using @option{-Wall} in conjunction with this
3405 option will @emph{not} warn about unknown pragmas in system
3406 headers---for that, @option{-Wunknown-pragmas} must also be used.
3407
3408 @item -Wfloat-equal
3409 @opindex Wfloat-equal
3410 @opindex Wno-float-equal
3411 Warn if floating point values are used in equality comparisons.
3412
3413 The idea behind this is that sometimes it is convenient (for the
3414 programmer) to consider floating-point values as approximations to
3415 infinitely precise real numbers.  If you are doing this, then you need
3416 to compute (by analyzing the code, or in some other way) the maximum or
3417 likely maximum error that the computation introduces, and allow for it
3418 when performing comparisons (and when producing output, but that's a
3419 different problem).  In particular, instead of testing for equality, you
3420 would check to see whether the two values have ranges that overlap; and
3421 this is done with the relational operators, so equality comparisons are
3422 probably mistaken.
3423
3424 @item -Wtraditional @r{(C and Objective-C only)}
3425 @opindex Wtraditional
3426 @opindex Wno-traditional
3427 Warn about certain constructs that behave differently in traditional and
3428 ISO C@.  Also warn about ISO C constructs that have no traditional C
3429 equivalent, and/or problematic constructs which should be avoided.
3430
3431 @itemize @bullet
3432 @item
3433 Macro parameters that appear within string literals in the macro body.
3434 In traditional C macro replacement takes place within string literals,
3435 but does not in ISO C@.
3436
3437 @item
3438 In traditional C, some preprocessor directives did not exist.
3439 Traditional preprocessors would only consider a line to be a directive
3440 if the @samp{#} appeared in column 1 on the line.  Therefore
3441 @option{-Wtraditional} warns about directives that traditional C
3442 understands but would ignore because the @samp{#} does not appear as the
3443 first character on the line.  It also suggests you hide directives like
3444 @samp{#pragma} not understood by traditional C by indenting them.  Some
3445 traditional implementations would not recognize @samp{#elif}, so it
3446 suggests avoiding it altogether.
3447
3448 @item
3449 A function-like macro that appears without arguments.
3450
3451 @item
3452 The unary plus operator.
3453
3454 @item
3455 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating point
3456 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
3457 constants.)  Note, these suffixes appear in macros defined in the system
3458 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
3459 Use of these macros in user code might normally lead to spurious
3460 warnings, however GCC's integrated preprocessor has enough context to
3461 avoid warning in these cases.
3462
3463 @item
3464 A function declared external in one block and then used after the end of
3465 the block.
3466
3467 @item
3468 A @code{switch} statement has an operand of type @code{long}.
3469
3470 @item
3471 A non-@code{static} function declaration follows a @code{static} one.
3472 This construct is not accepted by some traditional C compilers.
3473
3474 @item
3475 The ISO type of an integer constant has a different width or
3476 signedness from its traditional type.  This warning is only issued if
3477 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
3478 typically represent bit patterns, are not warned about.
3479
3480 @item
3481 Usage of ISO string concatenation is detected.
3482
3483 @item
3484 Initialization of automatic aggregates.
3485
3486 @item
3487 Identifier conflicts with labels.  Traditional C lacks a separate
3488 namespace for labels.
3489
3490 @item
3491 Initialization of unions.  If the initializer is zero, the warning is
3492 omitted.  This is done under the assumption that the zero initializer in
3493 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
3494 initializer warnings and relies on default initialization to zero in the
3495 traditional C case.
3496
3497 @item
3498 Conversions by prototypes between fixed/floating point values and vice
3499 versa.  The absence of these prototypes when compiling with traditional
3500 C would cause serious problems.  This is a subset of the possible
3501 conversion warnings, for the full set use @option{-Wtraditional-conversion}.
3502
3503 @item
3504 Use of ISO C style function definitions.  This warning intentionally is
3505 @emph{not} issued for prototype declarations or variadic functions
3506 because these ISO C features will appear in your code when using
3507 libiberty's traditional C compatibility macros, @code{PARAMS} and
3508 @code{VPARAMS}.  This warning is also bypassed for nested functions
3509 because that feature is already a GCC extension and thus not relevant to
3510 traditional C compatibility.
3511 @end itemize
3512
3513 @item -Wtraditional-conversion @r{(C and Objective-C only)}
3514 @opindex Wtraditional-conversion
3515 @opindex Wno-traditional-conversion
3516 Warn if a prototype causes a type conversion that is different from what
3517 would happen to the same argument in the absence of a prototype.  This
3518 includes conversions of fixed point to floating and vice versa, and
3519 conversions changing the width or signedness of a fixed point argument
3520 except when the same as the default promotion.
3521
3522 @item -Wdeclaration-after-statement @r{(C and Objective-C only)}
3523 @opindex Wdeclaration-after-statement
3524 @opindex Wno-declaration-after-statement
3525 Warn when a declaration is found after a statement in a block.  This
3526 construct, known from C++, was introduced with ISO C99 and is by default
3527 allowed in GCC@.  It is not supported by ISO C90 and was not supported by
3528 GCC versions before GCC 3.0.  @xref{Mixed Declarations}.
3529
3530 @item -Wundef
3531 @opindex Wundef
3532 @opindex Wno-undef
3533 Warn if an undefined identifier is evaluated in an @samp{#if} directive.
3534
3535 @item -Wno-endif-labels
3536 @opindex Wno-endif-labels
3537 @opindex Wendif-labels
3538 Do not warn whenever an @samp{#else} or an @samp{#endif} are followed by text.
3539
3540 @item -Wshadow
3541 @opindex Wshadow
3542 @opindex Wno-shadow
3543 Warn whenever a local variable shadows another local variable, parameter or
3544 global variable or whenever a built-in function is shadowed.
3545
3546 @item -Wlarger-than=@var{len}
3547 @opindex Wlarger-than=@var{len}
3548 @opindex Wlarger-than-@var{len}
3549 Warn whenever an object of larger than @var{len} bytes is defined.
3550
3551 @item -Wframe-larger-than=@var{len}
3552 @opindex Wframe-larger-than
3553 Warn if the size of a function frame is larger than @var{len} bytes.
3554 The computation done to determine the stack frame size is approximate
3555 and not conservative.
3556 The actual requirements may be somewhat greater than @var{len}
3557 even if you do not get a warning.  In addition, any space allocated
3558 via @code{alloca}, variable-length arrays, or related constructs
3559 is not included by the compiler when determining
3560 whether or not to issue a warning.
3561
3562 @item -Wunsafe-loop-optimizations
3563 @opindex Wunsafe-loop-optimizations
3564 @opindex Wno-unsafe-loop-optimizations
3565 Warn if the loop cannot be optimized because the compiler could not
3566 assume anything on the bounds of the loop indices.  With
3567 @option{-funsafe-loop-optimizations} warn if the compiler made
3568 such assumptions.
3569
3570 @item -Wpointer-arith
3571 @opindex Wpointer-arith
3572 @opindex Wno-pointer-arith
3573 Warn about anything that depends on the ``size of'' a function type or
3574 of @code{void}.  GNU C assigns these types a size of 1, for
3575 convenience in calculations with @code{void *} pointers and pointers
3576 to functions.  In C++, warn also when an arithmetic operation involves
3577 @code{NULL}.  This warning is also enabled by @option{-pedantic}.
3578
3579 @item -Wtype-limits
3580 @opindex Wtype-limits
3581 @opindex Wno-type-limits
3582 Warn if a comparison is always true or always false due to the limited
3583 range of the data type, but do not warn for constant expressions.  For
3584 example, warn if an unsigned variable is compared against zero with
3585 @samp{<} or @samp{>=}.  This warning is also enabled by
3586 @option{-Wextra}.
3587
3588 @item -Wbad-function-cast @r{(C and Objective-C only)}
3589 @opindex Wbad-function-cast
3590 @opindex Wno-bad-function-cast
3591 Warn whenever a function call is cast to a non-matching type.
3592 For example, warn if @code{int malloc()} is cast to @code{anything *}.
3593
3594 @item -Wc++-compat @r{(C and Objective-C only)}
3595 Warn about ISO C constructs that are outside of the common subset of
3596 ISO C and ISO C++, e.g.@: request for implicit conversion from
3597 @code{void *} to a pointer to non-@code{void} type.
3598
3599 @item -Wc++0x-compat @r{(C++ and Objective-C++ only)}
3600 Warn about C++ constructs whose meaning differs between ISO C++ 1998 and
3601 ISO C++ 200x, e.g., identifiers in ISO C++ 1998 that will become keywords
3602 in ISO C++ 200x.  This warning is enabled by @option{-Wall}.
3603
3604 @item -Wcast-qual
3605 @opindex Wcast-qual
3606 @opindex Wno-cast-qual
3607 Warn whenever a pointer is cast so as to remove a type qualifier from
3608 the target type.  For example, warn if a @code{const char *} is cast
3609 to an ordinary @code{char *}.
3610
3611 @item -Wcast-align
3612 @opindex Wcast-align
3613 @opindex Wno-cast-align
3614 Warn whenever a pointer is cast such that the required alignment of the
3615 target is increased.  For example, warn if a @code{char *} is cast to
3616 an @code{int *} on machines where integers can only be accessed at
3617 two- or four-byte boundaries.
3618
3619 @item -Wwrite-strings
3620 @opindex Wwrite-strings
3621 @opindex Wno-write-strings
3622 When compiling C, give string constants the type @code{const
3623 char[@var{length}]} so that copying the address of one into a
3624 non-@code{const} @code{char *} pointer will get a warning.  These
3625 warnings will help you find at compile time code that can try to write
3626 into a string constant, but only if you have been very careful about
3627 using @code{const} in declarations and prototypes.  Otherwise, it will
3628 just be a nuisance. This is why we did not make @option{-Wall} request
3629 these warnings.
3630
3631 When compiling C++, warn about the deprecated conversion from string
3632 literals to @code{char *}.  This warning is enabled by default for C++
3633 programs.
3634
3635 @item -Wclobbered
3636 @opindex Wclobbered
3637 @opindex Wno-clobbered
3638 Warn for variables that might be changed by @samp{longjmp} or
3639 @samp{vfork}.  This warning is also enabled by @option{-Wextra}.
3640
3641 @item -Wconversion
3642 @opindex Wconversion
3643 @opindex Wno-conversion
3644 Warn for implicit conversions that may alter a value. This includes
3645 conversions between real and integer, like @code{abs (x)} when
3646 @code{x} is @code{double}; conversions between signed and unsigned,
3647 like @code{unsigned ui = -1}; and conversions to smaller types, like
3648 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
3649 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
3650 changed by the conversion like in @code{abs (2.0)}.  Warnings about
3651 conversions between signed and unsigned integers can be disabled by
3652 using @option{-Wno-sign-conversion}.
3653
3654 For C++, also warn for conversions between @code{NULL} and non-pointer
3655 types; confusing overload resolution for user-defined conversions; and
3656 conversions that will never use a type conversion operator:
3657 conversions to @code{void}, the same type, a base class or a reference
3658 to them. Warnings about conversions between signed and unsigned
3659 integers are disabled by default in C++ unless
3660 @option{-Wsign-conversion} is explicitly enabled.
3661
3662 @item -Wempty-body
3663 @opindex Wempty-body
3664 @opindex Wno-empty-body
3665 Warn if an empty body occurs in an @samp{if}, @samp{else} or @samp{do
3666 while} statement.  Additionally, in C++, warn when an empty body occurs
3667 in a @samp{while} or @samp{for} statement with no whitespacing before
3668 the semicolon.  This warning is also enabled by @option{-Wextra}.
3669
3670 @item -Wenum-compare @r{(C++ and Objective-C++ only)}
3671 @opindex Wenum-compare
3672 @opindex Wno-enum-compare
3673 Warn about a comparison between values of different enum types. This
3674 warning is enabled by default.
3675
3676 @item -Wsign-compare
3677 @opindex Wsign-compare
3678 @opindex Wno-sign-compare
3679 @cindex warning for comparison of signed and unsigned values
3680 @cindex comparison of signed and unsigned values, warning
3681 @cindex signed and unsigned values, comparison warning
3682 Warn when a comparison between signed and unsigned values could produce
3683 an incorrect result when the signed value is converted to unsigned.
3684 This warning is also enabled by @option{-Wextra}; to get the other warnings
3685 of @option{-Wextra} without this warning, use @samp{-Wextra -Wno-sign-compare}.
3686
3687 @item -Wsign-conversion
3688 @opindex Wsign-conversion
3689 @opindex Wno-sign-conversion
3690 Warn for implicit conversions that may change the sign of an integer
3691 value, like assigning a signed integer expression to an unsigned
3692 integer variable. An explicit cast silences the warning. In C, this
3693 option is enabled also by @option{-Wconversion}.
3694
3695 @item -Waddress
3696 @opindex Waddress
3697 @opindex Wno-address
3698 Warn about suspicious uses of memory addresses. These include using
3699 the address of a function in a conditional expression, such as
3700 @code{void func(void); if (func)}, and comparisons against the memory
3701 address of a string literal, such as @code{if (x == "abc")}.  Such
3702 uses typically indicate a programmer error: the address of a function
3703 always evaluates to true, so their use in a conditional usually
3704 indicate that the programmer forgot the parentheses in a function
3705 call; and comparisons against string literals result in unspecified
3706 behavior and are not portable in C, so they usually indicate that the
3707 programmer intended to use @code{strcmp}.  This warning is enabled by
3708 @option{-Wall}.
3709
3710 @item -Wlogical-op
3711 @opindex Wlogical-op
3712 @opindex Wno-logical-op
3713 Warn about suspicious uses of logical operators in expressions.
3714 This includes using logical operators in contexts where a
3715 bit-wise operator is likely to be expected.
3716
3717 @item -Waggregate-return
3718 @opindex Waggregate-return
3719 @opindex Wno-aggregate-return
3720 Warn if any functions that return structures or unions are defined or
3721 called.  (In languages where you can return an array, this also elicits
3722 a warning.)
3723
3724 @item -Wno-attributes
3725 @opindex Wno-attributes
3726 @opindex Wattributes
3727 Do not warn if an unexpected @code{__attribute__} is used, such as
3728 unrecognized attributes, function attributes applied to variables,
3729 etc.  This will not stop errors for incorrect use of supported
3730 attributes.
3731
3732 @item -Wstrict-prototypes @r{(C and Objective-C only)}
3733 @opindex Wstrict-prototypes
3734 @opindex Wno-strict-prototypes
3735 Warn if a function is declared or defined without specifying the
3736 argument types.  (An old-style function definition is permitted without
3737 a warning if preceded by a declaration which specifies the argument
3738 types.)
3739
3740 @item -Wold-style-declaration @r{(C and Objective-C only)}
3741 @opindex Wold-style-declaration
3742 @opindex Wno-old-style-declaration
3743 Warn for obsolescent usages, according to the C Standard, in a
3744 declaration. For example, warn if storage-class specifiers like
3745 @code{static} are not the first things in a declaration.  This warning
3746 is also enabled by @option{-Wextra}.
3747
3748 @item -Wold-style-definition @r{(C and Objective-C only)}
3749 @opindex Wold-style-definition
3750 @opindex Wno-old-style-definition
3751 Warn if an old-style function definition is used.  A warning is given
3752 even if there is a previous prototype.
3753
3754 @item -Wmissing-parameter-type @r{(C and Objective-C only)}
3755 @opindex Wmissing-parameter-type
3756 @opindex Wno-missing-parameter-type
3757 A function parameter is declared without a type specifier in K&R-style
3758 functions:
3759
3760 @smallexample
3761 void foo(bar) @{ @}
3762 @end smallexample
3763
3764 This warning is also enabled by @option{-Wextra}.
3765
3766 @item -Wmissing-prototypes @r{(C and Objective-C only)}
3767 @opindex Wmissing-prototypes
3768 @opindex Wno-missing-prototypes
3769 Warn if a global function is defined without a previous prototype
3770 declaration.  This warning is issued even if the definition itself
3771 provides a prototype.  The aim is to detect global functions that fail
3772 to be declared in header files.
3773
3774 @item -Wmissing-declarations
3775 @opindex Wmissing-declarations
3776 @opindex Wno-missing-declarations
3777 Warn if a global function is defined without a previous declaration.
3778 Do so even if the definition itself provides a prototype.
3779 Use this option to detect global functions that are not declared in
3780 header files.  In C++, no warnings are issued for function templates,
3781 or for inline functions, or for functions in anonymous namespaces.
3782
3783 @item -Wmissing-field-initializers
3784 @opindex Wmissing-field-initializers
3785 @opindex Wno-missing-field-initializers
3786 @opindex W
3787 @opindex Wextra
3788 @opindex Wno-extra
3789 Warn if a structure's initializer has some fields missing.  For
3790 example, the following code would cause such a warning, because
3791 @code{x.h} is implicitly zero:
3792
3793 @smallexample
3794 struct s @{ int f, g, h; @};
3795 struct s x = @{ 3, 4 @};
3796 @end smallexample
3797
3798 This option does not warn about designated initializers, so the following
3799 modification would not trigger a warning:
3800
3801 @smallexample
3802 struct s @{ int f, g, h; @};
3803 struct s x = @{ .f = 3, .g = 4 @};
3804 @end smallexample
3805
3806 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
3807 warnings without this one, use @samp{-Wextra -Wno-missing-field-initializers}.
3808
3809 @item -Wmissing-noreturn
3810 @opindex Wmissing-noreturn
3811 @opindex Wno-missing-noreturn
3812 Warn about functions which might be candidates for attribute @code{noreturn}.
3813 Note these are only possible candidates, not absolute ones.  Care should
3814 be taken to manually verify functions actually do not ever return before
3815 adding the @code{noreturn} attribute, otherwise subtle code generation
3816 bugs could be introduced.  You will not get a warning for @code{main} in
3817 hosted C environments.
3818
3819 @item -Wmissing-format-attribute
3820 @opindex Wmissing-format-attribute
3821 @opindex Wno-missing-format-attribute
3822 @opindex Wformat
3823 @opindex Wno-format
3824 Warn about function pointers which might be candidates for @code{format}
3825 attributes.  Note these are only possible candidates, not absolute ones.
3826 GCC will guess that function pointers with @code{format} attributes that
3827 are used in assignment, initialization, parameter passing or return
3828 statements should have a corresponding @code{format} attribute in the
3829 resulting type.  I.e.@: the left-hand side of the assignment or
3830 initialization, the type of the parameter variable, or the return type
3831 of the containing function respectively should also have a @code{format}
3832 attribute to avoid the warning.
3833
3834 GCC will also warn about function definitions which might be
3835 candidates for @code{format} attributes.  Again, these are only
3836 possible candidates.  GCC will guess that @code{format} attributes
3837 might be appropriate for any function that calls a function like
3838 @code{vprintf} or @code{vscanf}, but this might not always be the
3839 case, and some functions for which @code{format} attributes are
3840 appropriate may not be detected.
3841
3842 @item -Wno-multichar
3843 @opindex Wno-multichar
3844 @opindex Wmultichar
3845 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
3846 Usually they indicate a typo in the user's code, as they have
3847 implementation-defined values, and should not be used in portable code.
3848
3849 @item -Wnormalized=<none|id|nfc|nfkc>
3850 @opindex Wnormalized=
3851 @cindex NFC
3852 @cindex NFKC
3853 @cindex character set, input normalization
3854 In ISO C and ISO C++, two identifiers are different if they are
3855 different sequences of characters.  However, sometimes when characters
3856 outside the basic ASCII character set are used, you can have two
3857 different character sequences that look the same.  To avoid confusion,
3858 the ISO 10646 standard sets out some @dfn{normalization rules} which
3859 when applied ensure that two sequences that look the same are turned into
3860 the same sequence.  GCC can warn you if you are using identifiers which
3861 have not been normalized; this option controls that warning.
3862
3863 There are four levels of warning that GCC supports.  The default is
3864 @option{-Wnormalized=nfc}, which warns about any identifier which is
3865 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
3866 recommended form for most uses.
3867
3868 Unfortunately, there are some characters which ISO C and ISO C++ allow
3869 in identifiers that when turned into NFC aren't allowable as
3870 identifiers.  That is, there's no way to use these symbols in portable
3871 ISO C or C++ and have all your identifiers in NFC@.
3872 @option{-Wnormalized=id} suppresses the warning for these characters.
3873 It is hoped that future versions of the standards involved will correct
3874 this, which is why this option is not the default.
3875
3876 You can switch the warning off for all characters by writing
3877 @option{-Wnormalized=none}.  You would only want to do this if you
3878 were using some other normalization scheme (like ``D''), because
3879 otherwise you can easily create bugs that are literally impossible to see.
3880
3881 Some characters in ISO 10646 have distinct meanings but look identical
3882 in some fonts or display methodologies, especially once formatting has
3883 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
3884 LETTER N'', will display just like a regular @code{n} which has been
3885 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
3886 normalization scheme to convert all these into a standard form as
3887 well, and GCC will warn if your code is not in NFKC if you use
3888 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
3889 about every identifier that contains the letter O because it might be
3890 confused with the digit 0, and so is not the default, but may be
3891 useful as a local coding convention if the programming environment is
3892 unable to be fixed to display these characters distinctly.
3893
3894 @item -Wno-deprecated
3895 @opindex Wno-deprecated
3896 @opindex Wdeprecated
3897 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
3898
3899 @item -Wno-deprecated-declarations
3900 @opindex Wno-deprecated-declarations
3901 @opindex Wdeprecated-declarations
3902 Do not warn about uses of functions (@pxref{Function Attributes}),
3903 variables (@pxref{Variable Attributes}), and types (@pxref{Type
3904 Attributes}) marked as deprecated by using the @code{deprecated}
3905 attribute.
3906
3907 @item -Wno-overflow
3908 @opindex Wno-overflow
3909 @opindex Woverflow
3910 Do not warn about compile-time overflow in constant expressions.
3911
3912 @item -Woverride-init @r{(C and Objective-C only)}
3913 @opindex Woverride-init
3914 @opindex Wno-override-init
3915 @opindex W
3916 @opindex Wextra
3917 @opindex Wno-extra
3918 Warn if an initialized field without side effects is overridden when
3919 using designated initializers (@pxref{Designated Inits, , Designated
3920 Initializers}).
3921
3922 This warning is included in @option{-Wextra}.  To get other
3923 @option{-Wextra} warnings without this one, use @samp{-Wextra
3924 -Wno-override-init}.
3925
3926 @item -Wpacked
3927 @opindex Wpacked
3928 @opindex Wno-packed
3929 Warn if a structure is given the packed attribute, but the packed
3930 attribute has no effect on the layout or size of the structure.
3931 Such structures may be mis-aligned for little benefit.  For
3932 instance, in this code, the variable @code{f.x} in @code{struct bar}
3933 will be misaligned even though @code{struct bar} does not itself
3934 have the packed attribute:
3935
3936 @smallexample
3937 @group
3938 struct foo @{
3939   int x;
3940   char a, b, c, d;
3941 @} __attribute__((packed));
3942 struct bar @{
3943   char z;
3944   struct foo f;
3945 @};
3946 @end group
3947 @end smallexample
3948
3949 @item -Wpadded
3950 @opindex Wpadded
3951 @opindex Wno-padded
3952 Warn if padding is included in a structure, either to align an element
3953 of the structure or to align the whole structure.  Sometimes when this
3954 happens it is possible to rearrange the fields of the structure to
3955 reduce the padding and so make the structure smaller.
3956
3957 @item -Wredundant-decls
3958 @opindex Wredundant-decls
3959 @opindex Wno-redundant-decls
3960 Warn if anything is declared more than once in the same scope, even in
3961 cases where multiple declaration is valid and changes nothing.
3962
3963 @item -Wnested-externs @r{(C and Objective-C only)}
3964 @opindex Wnested-externs
3965 @opindex Wno-nested-externs
3966 Warn if an @code{extern} declaration is encountered within a function.
3967
3968 @item -Wunreachable-code
3969 @opindex Wunreachable-code
3970 @opindex Wno-unreachable-code
3971 Warn if the compiler detects that code will never be executed.
3972
3973 This option is intended to warn when the compiler detects that at
3974 least a whole line of source code will never be executed, because
3975 some condition is never satisfied or because it is after a
3976 procedure that never returns.
3977
3978 It is possible for this option to produce a warning even though there
3979 are circumstances under which part of the affected line can be executed,
3980 so care should be taken when removing apparently-unreachable code.
3981
3982 For instance, when a function is inlined, a warning may mean that the
3983 line is unreachable in only one inlined copy of the function.
3984
3985 This option is not made part of @option{-Wall} because in a debugging
3986 version of a program there is often substantial code which checks
3987 correct functioning of the program and is, hopefully, unreachable
3988 because the program does work.  Another common use of unreachable
3989 code is to provide behavior which is selectable at compile-time.
3990
3991 @item -Winline
3992 @opindex Winline
3993 @opindex Wno-inline
3994 Warn if a function can not be inlined and it was declared as inline.
3995 Even with this option, the compiler will not warn about failures to
3996 inline functions declared in system headers.
3997
3998 The compiler uses a variety of heuristics to determine whether or not
3999 to inline a function.  For example, the compiler takes into account
4000 the size of the function being inlined and the amount of inlining
4001 that has already been done in the current function.  Therefore,
4002 seemingly insignificant changes in the source program can cause the
4003 warnings produced by @option{-Winline} to appear or disappear.
4004
4005 @item -Wno-invalid-offsetof @r{(C++ and Objective-C++ only)}
4006 @opindex Wno-invalid-offsetof
4007 @opindex Winvalid-offsetof
4008 Suppress warnings from applying the @samp{offsetof} macro to a non-POD
4009 type.  According to the 1998 ISO C++ standard, applying @samp{offsetof}
4010 to a non-POD type is undefined.  In existing C++ implementations,
4011 however, @samp{offsetof} typically gives meaningful results even when
4012 applied to certain kinds of non-POD types. (Such as a simple
4013 @samp{struct} that fails to be a POD type only by virtue of having a
4014 constructor.)  This flag is for users who are aware that they are
4015 writing nonportable code and who have deliberately chosen to ignore the
4016 warning about it.
4017
4018 The restrictions on @samp{offsetof} may be relaxed in a future version
4019 of the C++ standard.
4020
4021 @item -Wno-int-to-pointer-cast @r{(C and Objective-C only)}
4022 @opindex Wno-int-to-pointer-cast
4023 @opindex Wint-to-pointer-cast
4024 Suppress warnings from casts to pointer type of an integer of a
4025 different size.
4026
4027 @item -Wno-pointer-to-int-cast @r{(C and Objective-C only)}
4028 @opindex Wno-pointer-to-int-cast
4029 @opindex Wpointer-to-int-cast
4030 Suppress warnings from casts from a pointer to an integer type of a
4031 different size.
4032
4033 @item -Winvalid-pch
4034 @opindex Winvalid-pch
4035 @opindex Wno-invalid-pch
4036 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
4037 the search path but can't be used.
4038
4039 @item -Wlong-long
4040 @opindex Wlong-long
4041 @opindex Wno-long-long
4042 Warn if @samp{long long} type is used.  This is default.  To inhibit
4043 the warning messages, use @option{-Wno-long-long}.  Flags
4044 @option{-Wlong-long} and @option{-Wno-long-long} are taken into account
4045 only when @option{-pedantic} flag is used.
4046
4047 @item -Wvariadic-macros
4048 @opindex Wvariadic-macros
4049 @opindex Wno-variadic-macros
4050 Warn if variadic macros are used in pedantic ISO C90 mode, or the GNU
4051 alternate syntax when in pedantic ISO C99 mode.  This is default.
4052 To inhibit the warning messages, use @option{-Wno-variadic-macros}.
4053
4054 @item -Wvla
4055 @opindex Wvla
4056 @opindex Wno-vla
4057 Warn if variable length array is used in the code.
4058 @option{-Wno-vla} will prevent the @option{-pedantic} warning of
4059 the variable length array.
4060
4061 @item -Wvolatile-register-var
4062 @opindex Wvolatile-register-var
4063 @opindex Wno-volatile-register-var
4064 Warn if a register variable is declared volatile.  The volatile
4065 modifier does not inhibit all optimizations that may eliminate reads
4066 and/or writes to register variables.  This warning is enabled by
4067 @option{-Wall}.
4068
4069 @item -Wdisabled-optimization
4070 @opindex Wdisabled-optimization
4071 @opindex Wno-disabled-optimization
4072 Warn if a requested optimization pass is disabled.  This warning does
4073 not generally indicate that there is anything wrong with your code; it
4074 merely indicates that GCC's optimizers were unable to handle the code
4075 effectively.  Often, the problem is that your code is too big or too
4076 complex; GCC will refuse to optimize programs when the optimization
4077 itself is likely to take inordinate amounts of time.
4078
4079 @item -Wpointer-sign @r{(C and Objective-C only)}
4080 @opindex Wpointer-sign
4081 @opindex Wno-pointer-sign
4082 Warn for pointer argument passing or assignment with different signedness.
4083 This option is only supported for C and Objective-C@.  It is implied by
4084 @option{-Wall} and by @option{-pedantic}, which can be disabled with
4085 @option{-Wno-pointer-sign}.
4086
4087 @item -Wstack-protector
4088 @opindex Wstack-protector
4089 @opindex Wno-stack-protector
4090 This option is only active when @option{-fstack-protector} is active.  It
4091 warns about functions that will not be protected against stack smashing.
4092
4093 @item -Wno-mudflap
4094 @opindex Wno-mudflap
4095 Suppress warnings about constructs that cannot be instrumented by
4096 @option{-fmudflap}.
4097
4098 @item -Woverlength-strings
4099 @opindex Woverlength-strings
4100 @opindex Wno-overlength-strings
4101 Warn about string constants which are longer than the ``minimum
4102 maximum'' length specified in the C standard.  Modern compilers
4103 generally allow string constants which are much longer than the
4104 standard's minimum limit, but very portable programs should avoid
4105 using longer strings.
4106
4107 The limit applies @emph{after} string constant concatenation, and does
4108 not count the trailing NUL@.  In C89, the limit was 509 characters; in
4109 C99, it was raised to 4095.  C++98 does not specify a normative
4110 minimum maximum, so we do not diagnose overlength strings in C++@.
4111
4112 This option is implied by @option{-pedantic}, and can be disabled with
4113 @option{-Wno-overlength-strings}.
4114
4115 @item -Wdisallowed-function-list=@var{sym},@var{sym},@dots{}
4116 @opindex Wdisallowed-function-list
4117
4118 If any of @var{sym} is called, GCC will issue a warning. This can be useful
4119 in enforcing coding conventions that ban calls to certain functions, for
4120 example, @code{alloca}, @code{malloc}, etc.
4121 @end table
4122
4123 @node Debugging Options
4124 @section Options for Debugging Your Program or GCC
4125 @cindex options, debugging
4126 @cindex debugging information options
4127
4128 GCC has various special options that are used for debugging
4129 either your program or GCC:
4130
4131 @table @gcctabopt
4132 @item -g
4133 @opindex g
4134 Produce debugging information in the operating system's native format
4135 (stabs, COFF, XCOFF, or DWARF 2)@.  GDB can work with this debugging
4136 information.
4137
4138 On most systems that use stabs format, @option{-g} enables use of extra
4139 debugging information that only GDB can use; this extra information
4140 makes debugging work better in GDB but will probably make other debuggers
4141 crash or
4142 refuse to read the program.  If you want to control for certain whether
4143 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
4144 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
4145
4146 GCC allows you to use @option{-g} with
4147 @option{-O}.  The shortcuts taken by optimized code may occasionally
4148 produce surprising results: some variables you declared may not exist
4149 at all; flow of control may briefly move where you did not expect it;
4150 some statements may not be executed because they compute constant
4151 results or their values were already at hand; some statements may
4152 execute in different places because they were moved out of loops.
4153
4154 Nevertheless it proves possible to debug optimized output.  This makes
4155 it reasonable to use the optimizer for programs that might have bugs.
4156
4157 The following options are useful when GCC is generated with the
4158 capability for more than one debugging format.
4159
4160 @item -ggdb
4161 @opindex ggdb
4162 Produce debugging information for use by GDB@.  This means to use the
4163 most expressive format available (DWARF 2, stabs, or the native format
4164 if neither of those are supported), including GDB extensions if at all
4165 possible.
4166
4167 @item -gstabs
4168 @opindex gstabs
4169 Produce debugging information in stabs format (if that is supported),
4170 without GDB extensions.  This is the format used by DBX on most BSD
4171 systems.  On MIPS, Alpha and System V Release 4 systems this option
4172 produces stabs debugging output which is not understood by DBX or SDB@.
4173 On System V Release 4 systems this option requires the GNU assembler.
4174
4175 @item -feliminate-unused-debug-symbols
4176 @opindex feliminate-unused-debug-symbols
4177 Produce debugging information in stabs format (if that is supported),
4178 for only symbols that are actually used.
4179
4180 @item -femit-class-debug-always
4181 Instead of emitting debugging information for a C++ class in only one
4182 object file, emit it in all object files using the class.  This option
4183 should be used only with debuggers that are unable to handle the way GCC
4184 normally emits debugging information for classes because using this
4185 option will increase the size of debugging information by as much as a
4186 factor of two.
4187
4188 @item -gstabs+
4189 @opindex gstabs+
4190 Produce debugging information in stabs format (if that is supported),
4191 using GNU extensions understood only by the GNU debugger (GDB)@.  The
4192 use of these extensions is likely to make other debuggers crash or
4193 refuse to read the program.
4194
4195 @item -gcoff
4196 @opindex gcoff
4197 Produce debugging information in COFF format (if that is supported).
4198 This is the format used by SDB on most System V systems prior to
4199 System V Release 4.
4200
4201 @item -gxcoff
4202 @opindex gxcoff
4203 Produce debugging information in XCOFF format (if that is supported).
4204 This is the format used by the DBX debugger on IBM RS/6000 systems.
4205
4206 @item -gxcoff+
4207 @opindex gxcoff+
4208 Produce debugging information in XCOFF format (if that is supported),
4209 using GNU extensions understood only by the GNU debugger (GDB)@.  The
4210 use of these extensions is likely to make other debuggers crash or
4211 refuse to read the program, and may cause assemblers other than the GNU
4212 assembler (GAS) to fail with an error.
4213
4214 @item -gdwarf-2
4215 @opindex gdwarf-2
4216 Produce debugging information in DWARF version 2 format (if that is
4217 supported).  This is the format used by DBX on IRIX 6.  With this
4218 option, GCC uses features of DWARF version 3 when they are useful;
4219 version 3 is upward compatible with version 2, but may still cause
4220 problems for older debuggers.
4221
4222 @item -gvms
4223 @opindex gvms
4224 Produce debugging information in VMS debug format (if that is
4225 supported).  This is the format used by DEBUG on VMS systems.
4226
4227 @item -g@var{level}
4228 @itemx -ggdb@var{level}
4229 @itemx -gstabs@var{level}
4230 @itemx -gcoff@var{level}
4231 @itemx -gxcoff@var{level}
4232 @itemx -gvms@var{level}
4233 Request debugging information and also use @var{level} to specify how
4234 much information.  The default level is 2.
4235
4236 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
4237 @option{-g}.
4238
4239 Level 1 produces minimal information, enough for making backtraces in
4240 parts of the program that you don't plan to debug.  This includes
4241 descriptions of functions and external variables, but no information
4242 about local variables and no line numbers.
4243
4244 Level 3 includes extra information, such as all the macro definitions
4245 present in the program.  Some debuggers support macro expansion when
4246 you use @option{-g3}.
4247
4248 @option{-gdwarf-2} does not accept a concatenated debug level, because
4249 GCC used to support an option @option{-gdwarf} that meant to generate
4250 debug information in version 1 of the DWARF format (which is very
4251 different from version 2), and it would have been too confusing.  That
4252 debug format is long obsolete, but the option cannot be changed now.
4253 Instead use an additional @option{-g@var{level}} option to change the
4254 debug level for DWARF2.
4255
4256 @item -feliminate-dwarf2-dups
4257 @opindex feliminate-dwarf2-dups
4258 Compress DWARF2 debugging information by eliminating duplicated
4259 information about each symbol.  This option only makes sense when
4260 generating DWARF2 debugging information with @option{-gdwarf-2}.
4261
4262 @item -femit-struct-debug-baseonly
4263 Emit debug information for struct-like types
4264 only when the base name of the compilation source file
4265 matches the base name of file in which the struct was defined.
4266
4267 This option substantially reduces the size of debugging information,
4268 but at significant potential loss in type information to the debugger.
4269 See @option{-femit-struct-debug-reduced} for a less aggressive option.
4270 See @option{-femit-struct-debug-detailed} for more detailed control.
4271
4272 This option works only with DWARF 2.
4273
4274 @item -femit-struct-debug-reduced
4275 Emit debug information for struct-like types
4276 only when the base name of the compilation source file
4277 matches the base name of file in which the type was defined,
4278 unless the struct is a template or defined in a system header.
4279
4280 This option significantly reduces the size of debugging information,
4281 with some potential loss in type information to the debugger.
4282 See @option{-femit-struct-debug-baseonly} for a more aggressive option.
4283 See @option{-femit-struct-debug-detailed} for more detailed control.
4284
4285 This option works only with DWARF 2.
4286
4287 @item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
4288 Specify the struct-like types
4289 for which the compiler will generate debug information.
4290 The intent is to reduce duplicate struct debug information
4291 between different object files within the same program.
4292
4293 This option is a detailed version of
4294 @option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
4295 which will serve for most needs.
4296
4297 A specification has the syntax
4298 [@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
4299
4300 The optional first word limits the specification to
4301 structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
4302 A struct type is used directly when it is the type of a variable, member.
4303 Indirect uses arise through pointers to structs.
4304 That is, when use of an incomplete struct would be legal, the use is indirect.
4305 An example is
4306 @samp{struct one direct; struct two * indirect;}.
4307
4308 The optional second word limits the specification to
4309 ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
4310 Generic structs are a bit complicated to explain.
4311 For C++, these are non-explicit specializations of template classes,
4312 or non-template classes within the above.
4313 Other programming languages have generics,
4314 but @samp{-femit-struct-debug-detailed} does not yet implement them.
4315
4316 The third word specifies the source files for those
4317 structs for which the compiler will emit debug information.
4318 The values @samp{none} and @samp{any} have the normal meaning.
4319 The value @samp{base} means that
4320 the base of name of the file in which the type declaration appears
4321 must match the base of the name of the main compilation file.
4322 In practice, this means that
4323 types declared in @file{foo.c} and @file{foo.h} will have debug information,
4324 but types declared in other header will not.
4325 The value @samp{sys} means those types satisfying @samp{base}
4326 or declared in system or compiler headers.
4327
4328 You may need to experiment to determine the best settings for your application.
4329
4330 The default is @samp{-femit-struct-debug-detailed=all}.
4331
4332 This option works only with DWARF 2.
4333
4334 @item -fno-merge-debug-strings
4335 @opindex fmerge-debug-strings
4336 @opindex fno-merge-debug-strings
4337 Direct the linker to merge together strings which are identical in
4338 different object files.  This is not supported by all assemblers or
4339 linker.  This decreases the size of the debug information in the
4340 output file at the cost of increasing link processing time.  This is
4341 on by default.
4342
4343 @item -fdebug-prefix-map=@var{old}=@var{new}
4344 @opindex fdebug-prefix-map
4345 When compiling files in directory @file{@var{old}}, record debugging
4346 information describing them as in @file{@var{new}} instead.
4347
4348 @cindex @command{prof}
4349 @item -p
4350 @opindex p
4351 Generate extra code to write profile information suitable for the
4352 analysis program @command{prof}.  You must use this option when compiling
4353 the source files you want data about, and you must also use it when
4354 linking.
4355
4356 @cindex @command{gprof}
4357 @item -pg
4358 @opindex pg
4359 Generate extra code to write profile information suitable for the
4360 analysis program @command{gprof}.  You must use this option when compiling
4361 the source files you want data about, and you must also use it when
4362 linking.
4363
4364 @item -Q
4365 @opindex Q
4366 Makes the compiler print out each function name as it is compiled, and
4367 print some statistics about each pass when it finishes.
4368
4369 @item -ftime-report
4370 @opindex ftime-report
4371 Makes the compiler print some statistics about the time consumed by each
4372 pass when it finishes.
4373
4374 @item -fmem-report
4375 @opindex fmem-report
4376 Makes the compiler print some statistics about permanent memory
4377 allocation when it finishes.
4378
4379 @item -fpre-ipa-mem-report
4380 @opindex fpre-ipa-mem-report
4381 @item -fpost-ipa-mem-report
4382 @opindex fpost-ipa-mem-report
4383 Makes the compiler print some statistics about permanent memory
4384 allocation before or after interprocedural optimization.
4385
4386 @item -fprofile-arcs
4387 @opindex fprofile-arcs
4388 Add code so that program flow @dfn{arcs} are instrumented.  During
4389 execution the program records how many times each branch and call is
4390 executed and how many times it is taken or returns.  When the compiled
4391 program exits it saves this data to a file called
4392 @file{@var{auxname}.gcda} for each source file.  The data may be used for
4393 profile-directed optimizations (@option{-fbranch-probabilities}), or for
4394 test coverage analysis (@option{-ftest-coverage}).  Each object file's
4395 @var{auxname} is generated from the name of the output file, if
4396 explicitly specified and it is not the final executable, otherwise it is
4397 the basename of the source file.  In both cases any suffix is removed
4398 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
4399 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
4400 @xref{Cross-profiling}.
4401
4402 @cindex @command{gcov}
4403 @item --coverage
4404 @opindex coverage
4405
4406 This option is used to compile and link code instrumented for coverage
4407 analysis.  The option is a synonym for @option{-fprofile-arcs}
4408 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
4409 linking).  See the documentation for those options for more details.
4410
4411 @itemize
4412
4413 @item
4414 Compile the source files with @option{-fprofile-arcs} plus optimization
4415 and code generation options.  For test coverage analysis, use the
4416 additional @option{-ftest-coverage} option.  You do not need to profile
4417 every source file in a program.
4418
4419 @item
4420 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
4421 (the latter implies the former).
4422
4423 @item
4424 Run the program on a representative workload to generate the arc profile
4425 information.  This may be repeated any number of times.  You can run
4426 concurrent instances of your program, and provided that the file system
4427 supports locking, the data files will be correctly updated.  Also
4428 @code{fork} calls are detected and correctly handled (double counting
4429 will not happen).
4430
4431 @item
4432 For profile-directed optimizations, compile the source files again with
4433 the same optimization and code generation options plus
4434 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
4435 Control Optimization}).
4436
4437 @item
4438 For test coverage analysis, use @command{gcov} to produce human readable
4439 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
4440 @command{gcov} documentation for further information.
4441
4442 @end itemize
4443
4444 With @option{-fprofile-arcs}, for each function of your program GCC
4445 creates a program flow graph, then finds a spanning tree for the graph.
4446 Only arcs that are not on the spanning tree have to be instrumented: the
4447 compiler adds code to count the number of times that these arcs are
4448 executed.  When an arc is the only exit or only entrance to a block, the
4449 instrumentation code can be added to the block; otherwise, a new basic
4450 block must be created to hold the instrumentation code.
4451
4452 @need 2000
4453 @item -ftest-coverage
4454 @opindex ftest-coverage
4455 Produce a notes file that the @command{gcov} code-coverage utility
4456 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
4457 show program coverage.  Each source file's note file is called
4458 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
4459 above for a description of @var{auxname} and instructions on how to
4460 generate test coverage data.  Coverage data will match the source files
4461 more closely, if you do not optimize.
4462
4463 @item -fdbg-cnt-list
4464 @opindex fdbg-cnt-list
4465 Print the name and the counter upperbound for all debug counters.
4466
4467 @item -fdbg-cnt=@var{counter-value-list}
4468 @opindex fdbg-cnt
4469 Set the internal debug counter upperbound. @var{counter-value-list} 
4470 is a comma-separated list of @var{name}:@var{value} pairs
4471 which sets the upperbound of each debug counter @var{name} to @var{value}.
4472 All debug counters have the initial upperbound of @var{UINT_MAX},
4473 thus dbg_cnt() returns true always unless the upperbound is set by this option.
4474 e.g. With -fdbg-cnt=dce:10,tail_call:0
4475 dbg_cnt(dce) will return true only for first 10 invocations
4476 and dbg_cnt(tail_call) will return false always.
4477
4478 @item -d@var{letters}
4479 @itemx -fdump-rtl-@var{pass}
4480 @opindex d
4481 Says to make debugging dumps during compilation at times specified by
4482 @var{letters}.    This is used for debugging the RTL-based passes of the
4483 compiler.  The file names for most of the dumps are made by appending a
4484 pass number and a word to the @var{dumpname}.  @var{dumpname} is generated
4485 from the name of the output file, if explicitly specified and it is not
4486 an executable, otherwise it is the basename of the source file. These
4487 switches may have different effects when @option{-E} is used for
4488 preprocessing.
4489
4490 Most debug dumps can be enabled either passing a letter to the @option{-d}
4491 option, or with a long @option{-fdump-rtl} switch; here are the possible
4492 letters for use in @var{letters} and @var{pass}, and their meanings:
4493
4494 @table @gcctabopt
4495 @item -dA
4496 @opindex dA
4497 Annotate the assembler output with miscellaneous debugging information.
4498
4499 @item -fdump-rtl-bbro
4500 @opindex fdump-rtl-bbro
4501 Dump after block reordering, to @file{@var{file}.148r.bbro}.
4502
4503 @item -fdump-rtl-combine
4504 @opindex fdump-rtl-combine
4505 Dump after the RTL instruction combination pass, to the file
4506 @file{@var{file}.129r.combine}.
4507
4508 @item -fdump-rtl-ce1
4509 @itemx -fdump-rtl-ce2
4510 @opindex fdump-rtl-ce1
4511 @opindex fdump-rtl-ce2
4512 @option{-fdump-rtl-ce1} enable dumping after the
4513 first if conversion, to the file @file{@var{file}.117r.ce1}. 
4514 @option{-fdump-rtl-ce2} enable dumping after the second if
4515 conversion, to the file @file{@var{file}.130r.ce2}.
4516
4517 @item -fdump-rtl-btl
4518 @itemx -fdump-rtl-dbr
4519 @opindex fdump-rtl-btl
4520 @opindex fdump-rtl-dbr
4521 @option{-fdump-rtl-btl} enable dumping after branch
4522 target load optimization, to @file{@var{file}.31.btl}.  
4523 @option{-fdump-rtl-dbr} enable dumping after delayed branch
4524 scheduling, to @file{@var{file}.36.dbr}.
4525
4526 @item -dD
4527 @opindex dD
4528 Dump all macro definitions, at the end of preprocessing, in addition to
4529 normal output.
4530
4531 @item -fdump-rtl-ce3
4532 @opindex fdump-rtl-ce3
4533 Dump after the third if conversion, to @file{@var{file}.146r.ce3}.
4534
4535 @item -fdump-rtl-cfg
4536 @itemx -fdump-rtl-life
4537 @opindex fdump-rtl-cfg
4538 @opindex fdump-rtl-life
4539 @option{-fdump-rtl-cfg} enable dumping after control
4540 and data flow analysis, to @file{@var{file}.116r.cfg}.  
4541 @option{-fdump-rtl-cfg} enable dumping dump after life analysis,
4542 to @file{@var{file}.128r.life1} and @file{@var{file}.135r.life2}.
4543
4544 @item -fdump-rtl-greg
4545 @opindex fdump-rtl-greg
4546 Dump after global register allocation, to @file{@var{file}.139r.greg}.
4547
4548 @item -fdump-rtl-gcse
4549 @itemx -fdump-rtl-bypass
4550 @opindex fdump-rtl-gcse
4551 @opindex fdump-rtl-bypass
4552 @option{-fdump-rtl-gcse} enable dumping after GCSE, to
4553 @file{@var{file}.114r.gcse}.  @option{-fdump-rtl-bypass}
4554 enable dumping after jump bypassing and control flow optimizations, to
4555 @file{@var{file}.115r.bypass}.
4556
4557 @item -fdump-rtl-eh
4558 @opindex fdump-rtl-eh
4559 Dump after finalization of EH handling code, to @file{@var{file}.02.eh}.
4560
4561 @item -fdump-rtl-sibling
4562 @opindex fdump-rtl-sibling
4563 Dump after sibling call optimizations, to @file{@var{file}.106r.sibling}.
4564
4565 @item -fdump-rtl-jump
4566 @opindex fdump-rtl-jump
4567 Dump after the first jump optimization, to @file{@var{file}.112r.jump}.
4568
4569 @item -fdump-rtl-stack
4570 @opindex fdump-rtl-stack
4571 Dump after conversion from GCC's "flat register file" registers to the
4572 x87's stack-like registers, to @file{@var{file}.152r.stack}.
4573
4574 @item -fdump-rtl-lreg
4575 @opindex fdump-rtl-lreg
4576 Dump after local register allocation, to @file{@var{file}.138r.lreg}.
4577
4578 @item -fdump-rtl-loop2
4579 @opindex fdump-rtl-loop2
4580 @option{-dL} and @option{-fdump-rtl-loop2} enable dumping after the
4581 loop optimization pass, to @file{@var{file}.119r.loop2},
4582 @file{@var{file}.120r.loop2_init},
4583 @file{@var{file}.121r.loop2_invariant}, and
4584 @file{@var{file}.125r.loop2_done}.
4585
4586 @item -fdump-rtl-sms
4587 @opindex fdump-rtl-sms
4588 Dump after modulo scheduling, to @file{@var{file}.136r.sms}.
4589
4590 @item -fdump-rtl-mach
4591 @opindex fdump-rtl-mach
4592 Dump after performing the machine dependent reorganization pass, to
4593 @file{@var{file}.155r.mach} if that pass exists.
4594
4595 @item -fdump-rtl-rnreg
4596 @opindex fdump-rtl-rnreg
4597 Dump after register renumbering, to @file{@var{file}.147r.rnreg}.
4598
4599 @item -fdump-rtl-regmove
4600 @opindex fdump-rtl-regmove
4601 Dump after the register move pass, to @file{@var{file}.132r.regmove}.
4602
4603 @item -fdump-rtl-postreload
4604 @opindex fdump-rtl-postreload
4605 Dump after post-reload optimizations, to @file{@var{file}.24.postreload}.
4606
4607 @item -fdump-rtl-expand
4608 @opindex fdump-rtl-expand
4609 Dump after RTL generation, to @file{@var{file}.104r.expand}.
4610
4611 @item -fdump-rtl-sched2
4612 @opindex fdump-rtl-sched2
4613 Dump after the second scheduling pass, to @file{@var{file}.149r.sched2}.
4614
4615 @item -fdump-rtl-cse
4616 @opindex fdump-rtl-cse
4617 Dump after CSE (including the jump optimization that sometimes follows
4618 CSE), to @file{@var{file}.113r.cse}.
4619
4620 @item -fdump-rtl-sched1
4621 @opindex fdump-rtl-sched1
4622 Dump after the first scheduling pass, to @file{@var{file}.136r.sched1}.
4623
4624 @item -fdump-rtl-cse2
4625 @opindex fdump-rtl-cse2
4626 Dump after the second CSE pass (including the jump optimization that
4627 sometimes follows CSE), to @file{@var{file}.127r.cse2}.
4628
4629 @item -fdump-rtl-tracer
4630 @opindex fdump-rtl-tracer
4631 Dump after running tracer, to @file{@var{file}.118r.tracer}.
4632
4633 @item -fdump-rtl-vpt
4634 @itemx -fdump-rtl-vartrack
4635 @opindex fdump-rtl-vpt
4636 @opindex fdump-rtl-vartrack
4637 @option{-fdump-rtl-vpt} enable dumping after the value
4638 profile transformations, to @file{@var{file}.10.vpt}.
4639 @option{-fdump-rtl-vartrack} enable dumping after variable tracking,
4640 to @file{@var{file}.154r.vartrack}.
4641
4642 @item -fdump-rtl-flow2
4643 @opindex fdump-rtl-flow2
4644 Dump after the second flow pass, to @file{@var{file}.142r.flow2}.
4645
4646 @item -fdump-rtl-peephole2
4647 @opindex fdump-rtl-peephole2
4648 Dump after the peephole pass, to @file{@var{file}.145r.peephole2}.
4649
4650 @item -fdump-rtl-web
4651 @opindex fdump-rtl-web
4652 Dump after live range splitting, to @file{@var{file}.126r.web}.
4653
4654 @item -fdump-rtl-all
4655 @opindex fdump-rtl-all
4656 Produce all the dumps listed above.
4657
4658 @item -dH
4659 @opindex dH
4660 Produce a core dump whenever an error occurs.
4661
4662 @item -dm
4663 @opindex dm
4664 Print statistics on memory usage, at the end of the run, to
4665 standard error.
4666
4667 @item -dp
4668 @opindex dp
4669 Annotate the assembler output with a comment indicating which
4670 pattern and alternative was used.  The length of each instruction is
4671 also printed.
4672
4673 @item -dP
4674 @opindex dP
4675 Dump the RTL in the assembler output as a comment before each instruction.
4676 Also turns on @option{-dp} annotation.
4677
4678 @item -dv
4679 @opindex dv
4680 For each of the other indicated dump files (either with @option{-d} or
4681 @option{-fdump-rtl-@var{pass}}), dump a representation of the control flow
4682 graph suitable for viewing with VCG to @file{@var{file}.@var{pass}.vcg}.
4683
4684 @item -dx
4685 @opindex dx
4686 Just generate RTL for a function instead of compiling it.  Usually used
4687 with @samp{r} (@option{-fdump-rtl-expand}).
4688
4689 @item -dy
4690 @opindex dy
4691 Dump debugging information during parsing, to standard error.
4692 @end table
4693
4694 @item -fdump-noaddr
4695 @opindex fdump-noaddr
4696 When doing debugging dumps (see @option{-d} option above), suppress
4697 address output.  This makes it more feasible to use diff on debugging
4698 dumps for compiler invocations with different compiler binaries and/or
4699 different text / bss / data / heap / stack / dso start locations.
4700
4701 @item -fdump-unnumbered
4702 @opindex fdump-unnumbered
4703 When doing debugging dumps (see @option{-d} option above), suppress instruction
4704 numbers and address output.  This makes it more feasible to
4705 use diff on debugging dumps for compiler invocations with different
4706 options, in particular with and without @option{-g}.
4707
4708 @item -fdump-translation-unit @r{(C++ only)}
4709 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
4710 @opindex fdump-translation-unit
4711 Dump a representation of the tree structure for the entire translation
4712 unit to a file.  The file name is made by appending @file{.tu} to the
4713 source file name.  If the @samp{-@var{options}} form is used, @var{options}
4714 controls the details of the dump as described for the
4715 @option{-fdump-tree} options.
4716
4717 @item -fdump-class-hierarchy @r{(C++ only)}
4718 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
4719 @opindex fdump-class-hierarchy
4720 Dump a representation of each class's hierarchy and virtual function
4721 table layout to a file.  The file name is made by appending @file{.class}
4722 to the source file name.  If the @samp{-@var{options}} form is used,
4723 @var{options} controls the details of the dump as described for the
4724 @option{-fdump-tree} options.
4725
4726 @item -fdump-ipa-@var{switch}
4727 @opindex fdump-ipa
4728 Control the dumping at various stages of inter-procedural analysis
4729 language tree to a file.  The file name is generated by appending a switch
4730 specific suffix to the source file name.  The following dumps are possible:
4731
4732 @table @samp
4733 @item all
4734 Enables all inter-procedural analysis dumps.
4735
4736 @item cgraph
4737 Dumps information about call-graph optimization, unused function removal,
4738 and inlining decisions.
4739
4740 @item inline
4741 Dump after function inlining.
4742
4743 @end table
4744
4745 @item -fdump-statistics-@var{option}
4746 @opindex -fdump-statistics
4747 Enable and control dumping of pass statistics in a separate file.  The
4748 file name is generated by appending a suffix ending in @samp{.statistics}
4749 to the source file name.  If the @samp{-@var{option}} form is used,
4750 @samp{-stats} will cause counters to be summed over the whole compilation unit
4751 while @samp{-details} will dump every event as the passes generate them.
4752 The default with no option is to sum counters for each function compiled.
4753
4754 @item -fdump-tree-@var{switch}
4755 @itemx -fdump-tree-@var{switch}-@var{options}
4756 @opindex fdump-tree
4757 Control the dumping at various stages of processing the intermediate
4758 language tree to a file.  The file name is generated by appending a switch
4759 specific suffix to the source file name.  If the @samp{-@var{options}}
4760 form is used, @var{options} is a list of @samp{-} separated options that
4761 control the details of the dump.  Not all options are applicable to all
4762 dumps, those which are not meaningful will be ignored.  The following
4763 options are available
4764
4765 @table @samp
4766 @item address
4767 Print the address of each node.  Usually this is not meaningful as it
4768 changes according to the environment and source file.  Its primary use
4769 is for tying up a dump file with a debug environment.
4770 @item slim
4771 Inhibit dumping of members of a scope or body of a function merely
4772 because that scope has been reached.  Only dump such items when they
4773 are directly reachable by some other path.  When dumping pretty-printed
4774 trees, this option inhibits dumping the bodies of control structures.
4775 @item raw
4776 Print a raw representation of the tree.  By default, trees are
4777 pretty-printed into a C-like representation.
4778 @item details
4779 Enable more detailed dumps (not honored by every dump option).
4780 @item stats
4781 Enable dumping various statistics about the pass (not honored by every dump
4782 option).
4783 @item blocks
4784 Enable showing basic block boundaries (disabled in raw dumps).
4785 @item vops
4786 Enable showing virtual operands for every statement.
4787 @item lineno
4788 Enable showing line numbers for statements.
4789 @item uid
4790 Enable showing the unique ID (@code{DECL_UID}) for each variable.
4791 @item verbose
4792 Enable showing the tree dump for each statement.
4793 @item all
4794 Turn on all options, except @option{raw}, @option{slim}, @option{verbose}
4795 and @option{lineno}.
4796 @end table
4797
4798 The following tree dumps are possible:
4799 @table @samp
4800
4801 @item original
4802 Dump before any tree based optimization, to @file{@var{file}.original}.
4803
4804 @item optimized
4805 Dump after all tree based optimization, to @file{@var{file}.optimized}.
4806
4807 @item gimple
4808 @opindex fdump-tree-gimple
4809 Dump each function before and after the gimplification pass to a file.  The
4810 file name is made by appending @file{.gimple} to the source file name.
4811
4812 @item cfg
4813 @opindex fdump-tree-cfg
4814 Dump the control flow graph of each function to a file.  The file name is
4815 made by appending @file{.cfg} to the source file name.
4816
4817 @item vcg
4818 @opindex fdump-tree-vcg
4819 Dump the control flow graph of each function to a file in VCG format.  The
4820 file name is made by appending @file{.vcg} to the source file name.  Note
4821 that if the file contains more than one function, the generated file cannot
4822 be used directly by VCG@.  You will need to cut and paste each function's
4823 graph into its own separate file first.
4824
4825 @item ch
4826 @opindex fdump-tree-ch
4827 Dump each function after copying loop headers.  The file name is made by
4828 appending @file{.ch} to the source file name.
4829
4830 @item ssa
4831 @opindex fdump-tree-ssa
4832 Dump SSA related information to a file.  The file name is made by appending
4833 @file{.ssa} to the source file name.
4834
4835 @item alias
4836 @opindex fdump-tree-alias
4837 Dump aliasing information for each function.  The file name is made by
4838 appending @file{.alias} to the source file name.
4839
4840 @item ccp
4841 @opindex fdump-tree-ccp
4842 Dump each function after CCP@.  The file name is made by appending
4843 @file{.ccp} to the source file name.
4844
4845 @item storeccp
4846 @opindex fdump-tree-storeccp
4847 Dump each function after STORE-CCP@.  The file name is made by appending
4848 @file{.storeccp} to the source file name.
4849
4850 @item pre
4851 @opindex fdump-tree-pre
4852 Dump trees after partial redundancy elimination.  The file name is made
4853 by appending @file{.pre} to the source file name.
4854
4855 @item fre
4856 @opindex fdump-tree-fre
4857 Dump trees after full redundancy elimination.  The file name is made
4858 by appending @file{.fre} to the source file name.
4859
4860 @item copyprop
4861 @opindex fdump-tree-copyprop
4862 Dump trees after copy propagation.  The file name is made
4863 by appending @file{.copyprop} to the source file name.
4864
4865 @item store_copyprop
4866 @opindex fdump-tree-store_copyprop
4867 Dump trees after store copy-propagation.  The file name is made
4868 by appending @file{.store_copyprop} to the source file name.
4869
4870 @item dce
4871 @opindex fdump-tree-dce
4872 Dump each function after dead code elimination.  The file name is made by
4873 appending @file{.dce} to the source file name.
4874
4875 @item mudflap
4876 @opindex fdump-tree-mudflap
4877 Dump each function after adding mudflap instrumentation.  The file name is
4878 made by appending @file{.mudflap} to the source file name.
4879
4880 @item sra
4881 @opindex fdump-tree-sra
4882 Dump each function after performing scalar replacement of aggregates.  The
4883 file name is made by appending @file{.sra} to the source file name.
4884
4885 @item sink
4886 @opindex fdump-tree-sink
4887 Dump each function after performing code sinking.  The file name is made
4888 by appending @file{.sink} to the source file name.
4889
4890 @item dom
4891 @opindex fdump-tree-dom
4892 Dump each function after applying dominator tree optimizations.  The file
4893 name is made by appending @file{.dom} to the source file name.
4894
4895 @item dse
4896 @opindex fdump-tree-dse
4897 Dump each function after applying dead store elimination.  The file
4898 name is made by appending @file{.dse} to the source file name.
4899
4900 @item phiopt
4901 @opindex fdump-tree-phiopt
4902 Dump each function after optimizing PHI nodes into straightline code.  The file
4903 name is made by appending @file{.phiopt} to the source file name.
4904
4905 @item forwprop
4906 @opindex fdump-tree-forwprop
4907 Dump each function after forward propagating single use variables.  The file
4908 name is made by appending @file{.forwprop} to the source file name.
4909
4910 @item copyrename
4911 @opindex fdump-tree-copyrename
4912 Dump each function after applying the copy rename optimization.  The file
4913 name is made by appending @file{.copyrename} to the source file name.
4914
4915 @item nrv
4916 @opindex fdump-tree-nrv
4917 Dump each function after applying the named return value optimization on
4918 generic trees.  The file name is made by appending @file{.nrv} to the source
4919 file name.
4920
4921 @item vect
4922 @opindex fdump-tree-vect
4923 Dump each function after applying vectorization of loops.  The file name is
4924 made by appending @file{.vect} to the source file name.
4925
4926 @item vrp
4927 @opindex fdump-tree-vrp
4928 Dump each function after Value Range Propagation (VRP).  The file name
4929 is made by appending @file{.vrp} to the source file name.
4930
4931 @item all
4932 @opindex fdump-tree-all
4933 Enable all the available tree dumps with the flags provided in this option.
4934 @end table
4935
4936 @item -ftree-vectorizer-verbose=@var{n}
4937 @opindex ftree-vectorizer-verbose
4938 This option controls the amount of debugging output the vectorizer prints.
4939 This information is written to standard error, unless
4940 @option{-fdump-tree-all} or @option{-fdump-tree-vect} is specified,
4941 in which case it is output to the usual dump listing file, @file{.vect}.
4942 For @var{n}=0 no diagnostic information is reported.
4943 If @var{n}=1 the vectorizer reports each loop that got vectorized,
4944 and the total number of loops that got vectorized.
4945 If @var{n}=2 the vectorizer also reports non-vectorized loops that passed
4946 the first analysis phase (vect_analyze_loop_form) - i.e.@: countable,
4947 inner-most, single-bb, single-entry/exit loops.  This is the same verbosity
4948 level that @option{-fdump-tree-vect-stats} uses.
4949 Higher verbosity levels mean either more information dumped for each
4950 reported loop, or same amount of information reported for more loops:
4951 If @var{n}=3, alignment related information is added to the reports.
4952 If @var{n}=4, data-references related information (e.g.@: memory dependences,
4953 memory access-patterns) is added to the reports.
4954 If @var{n}=5, the vectorizer reports also non-vectorized inner-most loops
4955 that did not pass the first analysis phase (i.e., may not be countable, or
4956 may have complicated control-flow).
4957 If @var{n}=6, the vectorizer reports also non-vectorized nested loops.
4958 For @var{n}=7, all the information the vectorizer generates during its
4959 analysis and transformation is reported.  This is the same verbosity level
4960 that @option{-fdump-tree-vect-details} uses.
4961
4962 @item -frandom-seed=@var{string}
4963 @opindex frandom-string
4964 This option provides a seed that GCC uses when it would otherwise use
4965 random numbers.  It is used to generate certain symbol names
4966 that have to be different in every compiled file.  It is also used to
4967 place unique stamps in coverage data files and the object files that
4968 produce them.  You can use the @option{-frandom-seed} option to produce
4969 reproducibly identical object files.
4970
4971 The @var{string} should be different for every file you compile.
4972
4973 @item -fsched-verbose=@var{n}
4974 @opindex fsched-verbose
4975 On targets that use instruction scheduling, this option controls the
4976 amount of debugging output the scheduler prints.  This information is
4977 written to standard error, unless @option{-dS} or @option{-dR} is
4978 specified, in which case it is output to the usual dump
4979 listing file, @file{.sched} or @file{.sched2} respectively.  However
4980 for @var{n} greater than nine, the output is always printed to standard
4981 error.
4982
4983 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
4984 same information as @option{-dRS}.  For @var{n} greater than one, it
4985 also output basic block probabilities, detailed ready list information
4986 and unit/insn info.  For @var{n} greater than two, it includes RTL
4987 at abort point, control-flow and regions info.  And for @var{n} over
4988 four, @option{-fsched-verbose} also includes dependence info.
4989
4990 @item -save-temps
4991 @opindex save-temps
4992 Store the usual ``temporary'' intermediate files permanently; place them
4993 in the current directory and name them based on the source file.  Thus,
4994 compiling @file{foo.c} with @samp{-c -save-temps} would produce files
4995 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
4996 preprocessed @file{foo.i} output file even though the compiler now
4997 normally uses an integrated preprocessor.
4998
4999 When used in combination with the @option{-x} command line option,
5000 @option{-save-temps} is sensible enough to avoid over writing an
5001 input source file with the same extension as an intermediate file.
5002 The corresponding intermediate file may be obtained by renaming the
5003 source file before using @option{-save-temps}.
5004
5005 @item -time
5006 @opindex time
5007 Report the CPU time taken by each subprocess in the compilation
5008 sequence.  For C source files, this is the compiler proper and assembler
5009 (plus the linker if linking is done).  The output looks like this:
5010
5011 @smallexample
5012 # cc1 0.12 0.01
5013 # as 0.00 0.01
5014 @end smallexample
5015
5016 The first number on each line is the ``user time'', that is time spent
5017 executing the program itself.  The second number is ``system time'',
5018 time spent executing operating system routines on behalf of the program.
5019 Both numbers are in seconds.
5020
5021 @item -fvar-tracking
5022 @opindex fvar-tracking
5023 Run variable tracking pass.  It computes where variables are stored at each
5024 position in code.  Better debugging information is then generated
5025 (if the debugging information format supports this information).
5026
5027 It is enabled by default when compiling with optimization (@option{-Os},
5028 @option{-O}, @option{-O2}, @dots{}), debugging information (@option{-g}) and
5029 the debug info format supports it.
5030
5031 @item -print-file-name=@var{library}
5032 @opindex print-file-name
5033 Print the full absolute name of the library file @var{library} that
5034 would be used when linking---and don't do anything else.  With this
5035 option, GCC does not compile or link anything; it just prints the
5036 file name.
5037
5038 @item -print-multi-directory
5039 @opindex print-multi-directory
5040 Print the directory name corresponding to the multilib selected by any
5041 other switches present in the command line.  This directory is supposed
5042 to exist in @env{GCC_EXEC_PREFIX}.
5043
5044 @item -print-multi-lib
5045 @opindex print-multi-lib
5046 Print the mapping from multilib directory names to compiler switches
5047 that enable them.  The directory name is separated from the switches by
5048 @samp{;}, and each switch starts with an @samp{@@} instead of the
5049 @samp{-}, without spaces between multiple switches.  This is supposed to
5050 ease shell-processing.
5051
5052 @item -print-prog-name=@var{program}
5053 @opindex print-prog-name
5054 Like @option{-print-file-name}, but searches for a program such as @samp{cpp}.
5055
5056 @item -print-libgcc-file-name
5057 @opindex print-libgcc-file-name
5058 Same as @option{-print-file-name=libgcc.a}.
5059
5060 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
5061 but you do want to link with @file{libgcc.a}.  You can do
5062
5063 @smallexample
5064 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
5065 @end smallexample
5066
5067 @item -print-search-dirs
5068 @opindex print-search-dirs
5069 Print the name of the configured installation directory and a list of
5070 program and library directories @command{gcc} will search---and don't do anything else.
5071
5072 This is useful when @command{gcc} prints the error message
5073 @samp{installation problem, cannot exec cpp0: No such file or directory}.
5074 To resolve this you either need to put @file{cpp0} and the other compiler
5075 components where @command{gcc} expects to find them, or you can set the environment
5076 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
5077 Don't forget the trailing @samp{/}.
5078 @xref{Environment Variables}.
5079
5080 @item -print-sysroot
5081 @opindex print-sysroot
5082 Print the target sysroot directory that will be used during
5083 compilation.  This is the target sysroot specified either at configure
5084 time or or using the @option{--sysroot} option, possibly with an extra
5085 suffix that depends on compilation options.  If no target sysroot is
5086 specified, the option prints nothing.
5087
5088 @item -print-sysroot-headers-suffix
5089 @opindex print-sysroot-headers-suffix
5090 Print the suffix added to the target sysroot when searching for
5091 headers, or give an error if the compiler is not configured with such
5092 a suffix---and don't do anything else.
5093
5094 @item -dumpmachine
5095 @opindex dumpmachine
5096 Print the compiler's target machine (for example,
5097 @samp{i686-pc-linux-gnu})---and don't do anything else.
5098
5099 @item -dumpversion
5100 @opindex dumpversion
5101 Print the compiler version (for example, @samp{3.0})---and don't do
5102 anything else.
5103
5104 @item -dumpspecs
5105 @opindex dumpspecs
5106 Print the compiler's built-in specs---and don't do anything else.  (This
5107 is used when GCC itself is being built.)  @xref{Spec Files}.
5108
5109 @item -feliminate-unused-debug-types
5110 @opindex feliminate-unused-debug-types
5111 Normally, when producing DWARF2 output, GCC will emit debugging
5112 information for all types declared in a compilation
5113 unit, regardless of whether or not they are actually used
5114 in that compilation unit.  Sometimes this is useful, such as
5115 if, in the debugger, you want to cast a value to a type that is
5116 not actually used in your program (but is declared).  More often,
5117 however, this results in a significant amount of wasted space.
5118 With this option, GCC will avoid producing debug symbol output
5119 for types that are nowhere used in the source file being compiled.
5120 @end table
5121
5122 @node Optimize Options
5123 @section Options That Control Optimization
5124 @cindex optimize options
5125 @cindex options, optimization
5126
5127 These options control various sorts of optimizations.
5128
5129 Without any optimization option, the compiler's goal is to reduce the
5130 cost of compilation and to make debugging produce the expected
5131 results.  Statements are independent: if you stop the program with a
5132 breakpoint between statements, you can then assign a new value to any
5133 variable or change the program counter to any other statement in the
5134 function and get exactly the results you would expect from the source
5135 code.
5136
5137 Turning on optimization flags makes the compiler attempt to improve
5138 the performance and/or code size at the expense of compilation time
5139 and possibly the ability to debug the program.
5140
5141 The compiler performs optimization based on the knowledge it has of the
5142 program.  Compiling multiple files at once to a single output file mode allows
5143 the compiler to use information gained from all of the files when compiling
5144 each of them.
5145
5146 Not all optimizations are controlled directly by a flag.  Only
5147 optimizations that have a flag are listed.
5148
5149 @table @gcctabopt
5150 @item -O
5151 @itemx -O1
5152 @opindex O
5153 @opindex O1
5154 Optimize.  Optimizing compilation takes somewhat more time, and a lot
5155 more memory for a large function.
5156
5157 With @option{-O}, the compiler tries to reduce code size and execution
5158 time, without performing any optimizations that take a great deal of
5159 compilation time.
5160
5161 @option{-O} turns on the following optimization flags:
5162 @gccoptlist{
5163 -fauto-inc-dec @gol
5164 -fcprop-registers @gol
5165 -fdce @gol
5166 -fdefer-pop @gol
5167 -fdelayed-branch @gol
5168 -fdse @gol
5169 -fguess-branch-probability @gol
5170 -fif-conversion2 @gol
5171 -fif-conversion @gol
5172 -finline-small-functions @gol
5173 -fipa-pure-const @gol
5174 -fipa-reference @gol
5175 -fmerge-constants
5176 -fsplit-wide-types @gol
5177 -ftree-builtin-call-dce @gol
5178 -ftree-ccp @gol
5179 -ftree-ch @gol
5180 -ftree-copyrename @gol
5181 -ftree-dce @gol
5182 -ftree-dominator-opts @gol
5183 -ftree-dse @gol
5184 -ftree-fre @gol
5185 -ftree-sra @gol
5186 -ftree-ter @gol
5187 -funit-at-a-time}
5188
5189 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
5190 where doing so does not interfere with debugging.
5191
5192 @item -O2
5193 @opindex O2
5194 Optimize even more.  GCC performs nearly all supported optimizations
5195 that do not involve a space-speed tradeoff.  The compiler does not
5196 perform loop unrolling or function inlining when you specify @option{-O2}.
5197 As compared to @option{-O}, this option increases both compilation time
5198 and the performance of the generated code.
5199
5200 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
5201 also turns on the following optimization flags:
5202 @gccoptlist{-fthread-jumps @gol
5203 -falign-functions  -falign-jumps @gol
5204 -falign-loops  -falign-labels @gol
5205 -fcaller-saves @gol
5206 -fcrossjumping @gol
5207 -fcse-follow-jumps  -fcse-skip-blocks @gol
5208 -fdelete-null-pointer-checks @gol
5209 -fexpensive-optimizations @gol
5210 -fgcse  -fgcse-lm  @gol
5211 -findirect-inlining @gol
5212 -foptimize-sibling-calls @gol
5213 -fpeephole2 @gol
5214 -fregmove @gol
5215 -freorder-blocks  -freorder-functions @gol
5216 -frerun-cse-after-loop  @gol
5217 -fsched-interblock  -fsched-spec @gol
5218 -fschedule-insns  -fschedule-insns2 @gol
5219 -fstrict-aliasing -fstrict-overflow @gol
5220 -ftree-switch-conversion @gol
5221 -ftree-pre @gol
5222 -ftree-vrp}
5223
5224 Please note the warning under @option{-fgcse} about
5225 invoking @option{-O2} on programs that use computed gotos.
5226
5227 @item -O3
5228 @opindex O3
5229 Optimize yet more.  @option{-O3} turns on all optimizations specified
5230 by @option{-O2} and also turns on the @option{-finline-functions},
5231 @option{-funswitch-loops}, @option{-fpredictive-commoning},
5232 @option{-fgcse-after-reload} and @option{-ftree-vectorize} options.
5233
5234 @item -O0
5235 @opindex O0
5236 Reduce compilation time and make debugging produce the expected
5237 results.  This is the default.
5238
5239 @item -Os
5240 @opindex Os
5241 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
5242 do not typically increase code size.  It also performs further
5243 optimizations designed to reduce code size.
5244
5245 @option{-Os} disables the following optimization flags:
5246 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
5247 -falign-labels  -freorder-blocks  -freorder-blocks-and-partition @gol
5248 -fprefetch-loop-arrays  -ftree-vect-loop-version}
5249
5250 If you use multiple @option{-O} options, with or without level numbers,
5251 the last such option is the one that is effective.
5252 @end table
5253
5254 Options of the form @option{-f@var{flag}} specify machine-independent
5255 flags.  Most flags have both positive and negative forms; the negative
5256 form of @option{-ffoo} would be @option{-fno-foo}.  In the table
5257 below, only one of the forms is listed---the one you typically will
5258 use.  You can figure out the other form by either removing @samp{no-}
5259 or adding it.
5260
5261 The following options control specific optimizations.  They are either
5262 activated by @option{-O} options or are related to ones that are.  You
5263 can use the following flags in the rare cases when ``fine-tuning'' of
5264 optimizations to be performed is desired.
5265
5266 @table @gcctabopt
5267 @item -fno-default-inline
5268 @opindex fno-default-inline
5269 Do not make member functions inline by default merely because they are
5270 defined inside the class scope (C++ only).  Otherwise, when you specify
5271 @w{@option{-O}}, member functions defined inside class scope are compiled
5272 inline by default; i.e., you don't need to add @samp{inline} in front of
5273 the member function name.
5274
5275 @item -fno-defer-pop
5276 @opindex fno-defer-pop
5277 Always pop the arguments to each function call as soon as that function
5278 returns.  For machines which must pop arguments after a function call,
5279 the compiler normally lets arguments accumulate on the stack for several
5280 function calls and pops them all at once.
5281
5282 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5283
5284 @item -fforward-propagate
5285 @opindex fforward-propagate
5286 Perform a forward propagation pass on RTL@.  The pass tries to combine two
5287 instructions and checks if the result can be simplified.  If loop unrolling
5288 is active, two passes are performed and the second is scheduled after
5289 loop unrolling.
5290
5291 This option is enabled by default at optimization levels @option{-O2},
5292 @option{-O3}, @option{-Os}.
5293
5294 @item -fomit-frame-pointer
5295 @opindex fomit-frame-pointer
5296 Don't keep the frame pointer in a register for functions that
5297 don't need one.  This avoids the instructions to save, set up and
5298 restore frame pointers; it also makes an extra register available
5299 in many functions.  @strong{It also makes debugging impossible on
5300 some machines.}
5301
5302 On some machines, such as the VAX, this flag has no effect, because
5303 the standard calling sequence automatically handles the frame pointer
5304 and nothing is saved by pretending it doesn't exist.  The
5305 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
5306 whether a target machine supports this flag.  @xref{Registers,,Register
5307 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
5308
5309 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5310
5311 @item -foptimize-sibling-calls
5312 @opindex foptimize-sibling-calls
5313 Optimize sibling and tail recursive calls.
5314
5315 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5316
5317 @item -fno-inline
5318 @opindex fno-inline
5319 Don't pay attention to the @code{inline} keyword.  Normally this option
5320 is used to keep the compiler from expanding any functions inline.
5321 Note that if you are not optimizing, no functions can be expanded inline.
5322
5323 @item -finline-small-functions
5324 @opindex finline-small-functions
5325 Integrate functions into their callers when their body is smaller than expected
5326 function call code (so overall size of program gets smaller).  The compiler
5327 heuristically decides which functions are simple enough to be worth integrating
5328 in this way.
5329
5330 Enabled at level @option{-O2}.
5331
5332 @item -findirect-inlining
5333 @opindex findirect-inlining
5334 Inline also indirect calls that are discovered to be known at compile
5335 time thanks to previous inlining.  This option has any effect only
5336 when inlining itself is turned on by the @option{-finline-functions}
5337 or @option{-finline-small-functions} options.
5338
5339 Enabled at level @option{-O2}.
5340
5341 @item -finline-functions
5342 @opindex finline-functions
5343 Integrate all simple functions into their callers.  The compiler
5344 heuristically decides which functions are simple enough to be worth
5345 integrating in this way.
5346
5347 If all calls to a given function are integrated, and the function is
5348 declared @code{static}, then the function is normally not output as
5349 assembler code in its own right.
5350
5351 Enabled at level @option{-O3}.
5352
5353 @item -finline-functions-called-once
5354 @opindex finline-functions-called-once
5355 Consider all @code{static} functions called once for inlining into their
5356 caller even if they are not marked @code{inline}.  If a call to a given
5357 function is integrated, then the function is not output as assembler code
5358 in its own right.
5359
5360 Enabled at levels @option{-O1}, @option{-O2}, @option{-O3} and @option{-Os}.
5361
5362 @item -fearly-inlining
5363 @opindex fearly-inlining
5364 Inline functions marked by @code{always_inline} and functions whose body seems
5365 smaller than the function call overhead early before doing
5366 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
5367 makes profiling significantly cheaper and usually inlining faster on programs
5368 having large chains of nested wrapper functions.
5369
5370 Enabled by default.
5371
5372 @item -finline-limit=@var{n}
5373 @opindex finline-limit
5374 By default, GCC limits the size of functions that can be inlined.  This flag
5375 allows coarse control of this limit.  @var{n} is the size of functions that
5376 can be inlined in number of pseudo instructions.
5377
5378 Inlining is actually controlled by a number of parameters, which may be
5379 specified individually by using @option{--param @var{name}=@var{value}}.
5380 The @option{-finline-limit=@var{n}} option sets some of these parameters
5381 as follows:
5382
5383 @table @gcctabopt
5384 @item max-inline-insns-single
5385 is set to @var{n}/2.
5386 @item max-inline-insns-auto
5387 is set to @var{n}/2.
5388 @end table
5389
5390 See below for a documentation of the individual
5391 parameters controlling inlining and for the defaults of these parameters.
5392
5393 @emph{Note:} there may be no value to @option{-finline-limit} that results
5394 in default behavior.
5395
5396 @emph{Note:} pseudo instruction represents, in this particular context, an
5397 abstract measurement of function's size.  In no way does it represent a count
5398 of assembly instructions and as such its exact meaning might change from one
5399 release to an another.
5400
5401 @item -fkeep-inline-functions
5402 @opindex fkeep-inline-functions
5403 In C, emit @code{static} functions that are declared @code{inline}
5404 into the object file, even if the function has been inlined into all
5405 of its callers.  This switch does not affect functions using the
5406 @code{extern inline} extension in GNU C89@.  In C++, emit any and all
5407 inline functions into the object file.
5408
5409 @item -fkeep-static-consts
5410 @opindex fkeep-static-consts
5411 Emit variables declared @code{static const} when optimization isn't turned
5412 on, even if the variables aren't referenced.
5413
5414 GCC enables this option by default.  If you want to force the compiler to
5415 check if the variable was referenced, regardless of whether or not
5416 optimization is turned on, use the @option{-fno-keep-static-consts} option.
5417
5418 @item -fmerge-constants
5419 @opindex fmerge-constants
5420 Attempt to merge identical constants (string constants and floating point
5421 constants) across compilation units.
5422
5423 This option is the default for optimized compilation if the assembler and
5424 linker support it.  Use @option{-fno-merge-constants} to inhibit this
5425 behavior.
5426
5427 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5428
5429 @item -fmerge-all-constants
5430 @opindex fmerge-all-constants
5431 Attempt to merge identical constants and identical variables.
5432
5433 This option implies @option{-fmerge-constants}.  In addition to
5434 @option{-fmerge-constants} this considers e.g.@: even constant initialized
5435 arrays or initialized constant variables with integral or floating point
5436 types.  Languages like C or C++ require each non-automatic variable to
5437 have distinct location, so using this option will result in non-conforming
5438 behavior.
5439
5440 @item -fmodulo-sched
5441 @opindex fmodulo-sched
5442 Perform swing modulo scheduling immediately before the first scheduling
5443 pass.  This pass looks at innermost loops and reorders their
5444 instructions by overlapping different iterations.
5445
5446 @item -fmodulo-sched-allow-regmoves
5447 @opindex fmodulo-sched-allow-regmoves
5448 Perform more aggressive SMS based modulo scheduling with register moves
5449 allowed.  By setting this flag certain anti-dependences edges will be
5450 deleted which will trigger the generation of reg-moves based on the
5451 life-range analysis.  This option is effective only with
5452 @option{-fmodulo-sched} enabled.
5453
5454 @item -fno-branch-count-reg
5455 @opindex fno-branch-count-reg
5456 Do not use ``decrement and branch'' instructions on a count register,
5457 but instead generate a sequence of instructions that decrement a
5458 register, compare it against zero, then branch based upon the result.
5459 This option is only meaningful on architectures that support such
5460 instructions, which include x86, PowerPC, IA-64 and S/390.
5461
5462 The default is @option{-fbranch-count-reg}.
5463
5464 @item -fno-function-cse
5465 @opindex fno-function-cse
5466 Do not put function addresses in registers; make each instruction that
5467 calls a constant function contain the function's address explicitly.
5468
5469 This option results in less efficient code, but some strange hacks
5470 that alter the assembler output may be confused by the optimizations
5471 performed when this option is not used.
5472
5473 The default is @option{-ffunction-cse}
5474
5475 @item -fno-zero-initialized-in-bss
5476 @opindex fno-zero-initialized-in-bss
5477 If the target supports a BSS section, GCC by default puts variables that
5478 are initialized to zero into BSS@.  This can save space in the resulting
5479 code.
5480
5481 This option turns off this behavior because some programs explicitly
5482 rely on variables going to the data section.  E.g., so that the
5483 resulting executable can find the beginning of that section and/or make
5484 assumptions based on that.
5485
5486 The default is @option{-fzero-initialized-in-bss}.
5487
5488 @item -fmudflap -fmudflapth -fmudflapir
5489 @opindex fmudflap
5490 @opindex fmudflapth
5491 @opindex fmudflapir
5492 @cindex bounds checking
5493 @cindex mudflap
5494 For front-ends that support it (C and C++), instrument all risky
5495 pointer/array dereferencing operations, some standard library
5496 string/heap functions, and some other associated constructs with
5497 range/validity tests.  Modules so instrumented should be immune to
5498 buffer overflows, invalid heap use, and some other classes of C/C++
5499 programming errors.  The instrumentation relies on a separate runtime
5500 library (@file{libmudflap}), which will be linked into a program if
5501 @option{-fmudflap} is given at link time.  Run-time behavior of the
5502 instrumented program is controlled by the @env{MUDFLAP_OPTIONS}
5503 environment variable.  See @code{env MUDFLAP_OPTIONS=-help a.out}
5504 for its options.
5505
5506 Use @option{-fmudflapth} instead of @option{-fmudflap} to compile and to
5507 link if your program is multi-threaded.  Use @option{-fmudflapir}, in
5508 addition to @option{-fmudflap} or @option{-fmudflapth}, if
5509 instrumentation should ignore pointer reads.  This produces less
5510 instrumentation (and therefore faster execution) and still provides
5511 some protection against outright memory corrupting writes, but allows
5512 erroneously read data to propagate within a program.
5513
5514 @item -fthread-jumps
5515 @opindex fthread-jumps
5516 Perform optimizations where we check to see if a jump branches to a
5517 location where another comparison subsumed by the first is found.  If
5518 so, the first branch is redirected to either the destination of the
5519 second branch or a point immediately following it, depending on whether
5520 the condition is known to be true or false.
5521
5522 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5523
5524 @item -fsplit-wide-types
5525 @opindex fsplit-wide-types
5526 When using a type that occupies multiple registers, such as @code{long
5527 long} on a 32-bit system, split the registers apart and allocate them
5528 independently.  This normally generates better code for those types,
5529 but may make debugging more difficult.
5530
5531 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
5532 @option{-Os}.
5533
5534 @item -fcse-follow-jumps
5535 @opindex fcse-follow-jumps
5536 In common subexpression elimination (CSE), scan through jump instructions
5537 when the target of the jump is not reached by any other path.  For
5538 example, when CSE encounters an @code{if} statement with an
5539 @code{else} clause, CSE will follow the jump when the condition
5540 tested is false.
5541
5542 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5543
5544 @item -fcse-skip-blocks
5545 @opindex fcse-skip-blocks
5546 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
5547 follow jumps which conditionally skip over blocks.  When CSE
5548 encounters a simple @code{if} statement with no else clause,
5549 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
5550 body of the @code{if}.
5551
5552 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5553
5554 @item -frerun-cse-after-loop
5555 @opindex frerun-cse-after-loop
5556 Re-run common subexpression elimination after loop optimizations has been
5557 performed.
5558
5559 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5560
5561 @item -fgcse
5562 @opindex fgcse
5563 Perform a global common subexpression elimination pass.
5564 This pass also performs global constant and copy propagation.
5565
5566 @emph{Note:} When compiling a program using computed gotos, a GCC
5567 extension, you may get better runtime performance if you disable
5568 the global common subexpression elimination pass by adding
5569 @option{-fno-gcse} to the command line.
5570
5571 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5572
5573 @item -fgcse-lm
5574 @opindex fgcse-lm
5575 When @option{-fgcse-lm} is enabled, global common subexpression elimination will
5576 attempt to move loads which are only killed by stores into themselves.  This
5577 allows a loop containing a load/store sequence to be changed to a load outside
5578 the loop, and a copy/store within the loop.
5579
5580 Enabled by default when gcse is enabled.
5581
5582 @item -fgcse-sm
5583 @opindex fgcse-sm
5584 When @option{-fgcse-sm} is enabled, a store motion pass is run after
5585 global common subexpression elimination.  This pass will attempt to move
5586 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
5587 loops containing a load/store sequence can be changed to a load before
5588 the loop and a store after the loop.
5589
5590 Not enabled at any optimization level.
5591
5592 @item -fgcse-las
5593 @opindex fgcse-las
5594 When @option{-fgcse-las} is enabled, the global common subexpression
5595 elimination pass eliminates redundant loads that come after stores to the
5596 same memory location (both partial and full redundancies).
5597
5598 Not enabled at any optimization level.
5599
5600 @item -fgcse-after-reload
5601 @opindex fgcse-after-reload
5602 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
5603 pass is performed after reload.  The purpose of this pass is to cleanup
5604 redundant spilling.
5605
5606 @item -funsafe-loop-optimizations
5607 @opindex funsafe-loop-optimizations
5608 If given, the loop optimizer will assume that loop indices do not
5609 overflow, and that the loops with nontrivial exit condition are not
5610 infinite.  This enables a wider range of loop optimizations even if
5611 the loop optimizer itself cannot prove that these assumptions are valid.
5612 Using @option{-Wunsafe-loop-optimizations}, the compiler will warn you
5613 if it finds this kind of loop.
5614
5615 @item -fcrossjumping
5616 @opindex fcrossjumping
5617 Perform cross-jumping transformation.  This transformation unifies equivalent code and save code size.  The
5618 resulting code may or may not perform better than without cross-jumping.
5619
5620 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5621
5622 @item -fauto-inc-dec
5623 @opindex fauto-inc-dec
5624 Combine increments or decrements of addresses with memory accesses.
5625 This pass is always skipped on architectures that do not have
5626 instructions to support this.  Enabled by default at @option{-O} and
5627 higher on architectures that support this.
5628
5629 @item -fdce
5630 @opindex fdce
5631 Perform dead code elimination (DCE) on RTL@.
5632 Enabled by default at @option{-O} and higher.
5633
5634 @item -fdse
5635 @opindex fdse
5636 Perform dead store elimination (DSE) on RTL@.
5637 Enabled by default at @option{-O} and higher.
5638
5639 @item -fif-conversion
5640 @opindex fif-conversion
5641 Attempt to transform conditional jumps into branch-less equivalents.  This
5642 include use of conditional moves, min, max, set flags and abs instructions, and
5643 some tricks doable by standard arithmetics.  The use of conditional execution
5644 on chips where it is available is controlled by @code{if-conversion2}.
5645
5646 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5647
5648 @item -fif-conversion2
5649 @opindex fif-conversion2
5650 Use conditional execution (where available) to transform conditional jumps into
5651 branch-less equivalents.
5652
5653 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5654
5655 @item -fdelete-null-pointer-checks
5656 @opindex fdelete-null-pointer-checks
5657 Use global dataflow analysis to identify and eliminate useless checks
5658 for null pointers.  The compiler assumes that dereferencing a null
5659 pointer would have halted the program.  If a pointer is checked after
5660 it has already been dereferenced, it cannot be null.
5661
5662 In some environments, this assumption is not true, and programs can
5663 safely dereference null pointers.  Use
5664 @option{-fno-delete-null-pointer-checks} to disable this optimization
5665 for programs which depend on that behavior.
5666
5667 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5668
5669 @item -fexpensive-optimizations
5670 @opindex fexpensive-optimizations
5671 Perform a number of minor optimizations that are relatively expensive.
5672
5673 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5674
5675 @item -foptimize-register-move
5676 @itemx -fregmove
5677 @opindex foptimize-register-move
5678 @opindex fregmove
5679 Attempt to reassign register numbers in move instructions and as
5680 operands of other simple instructions in order to maximize the amount of
5681 register tying.  This is especially helpful on machines with two-operand
5682 instructions.
5683
5684 Note @option{-fregmove} and @option{-foptimize-register-move} are the same
5685 optimization.
5686
5687 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5688
5689 @item -fira
5690 @opindex fira
5691 Use the integrated register allocator (@acronym{IRA}) for register
5692 allocation.  It is a default if @acronym{IRA} has been ported for the
5693 target.
5694
5695 @item -fira-algorithm=@var{algorithm}
5696 Use specified algorithm for the integrated register allocator.  The
5697 @var{algorithm} argument should be one of @code{regional}, @code{CB},
5698 or @code{mixed}.  The second algorithm specifies Chaitin-Briggs
5699 coloring, the first one specifies regional coloring based on
5700 Chaitin-Briggs coloring, and the third one which is the default
5701 specifies a mix of Chaitin-Briggs and regional algorithms where loops
5702 with small register pressure are ignored.  The first algorithm can
5703 give best result for machines with small size and irregular register
5704 set, the second one is faster and generates decent code and the
5705 smallest size code, and the mixed algorithm usually give the best
5706 results in most cases and for most architectures.
5707
5708 @item -fira-coalesce
5709 @opindex fira-coalesce
5710 Do optimistic register coalescing.  This option might be profitable for
5711 architectures with big regular register files.
5712
5713 @item -fno-ira-share-save-slots
5714 @opindex fno-ira-share-save-slots
5715 Switch off sharing stack slots used for saving call used hard
5716 registers living through a call.  Each hard register will get a
5717 separate stack slot and as a result function stack frame will be
5718 bigger.
5719
5720 @item -fno-ira-share-spill-slots
5721 @opindex fno-ira-share-spill-slots
5722 Switch off sharing stack slots allocated for pseudo-registers.  Each
5723 pseudo-register which did not get a hard register will get a separate
5724 stack slot and as a result function stack frame will be bigger.
5725
5726 @item -fira-verbose=@var{n}
5727 @opindex fira-verbose
5728 Set up how verbose dump file for the integrated register allocator
5729 will be.  Default value is 5.  If the value is greater or equal to 10,
5730 the dump file will be stderr as if the value were @var{n} minus 10.
5731
5732 @item -fdelayed-branch
5733 @opindex fdelayed-branch
5734 If supported for the target machine, attempt to reorder instructions
5735 to exploit instruction slots available after delayed branch
5736 instructions.
5737
5738 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5739
5740 @item -fschedule-insns
5741 @opindex fschedule-insns
5742 If supported for the target machine, attempt to reorder instructions to
5743 eliminate execution stalls due to required data being unavailable.  This
5744 helps machines that have slow floating point or memory load instructions
5745 by allowing other instructions to be issued until the result of the load
5746 or floating point instruction is required.
5747
5748 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5749
5750 @item -fschedule-insns2
5751 @opindex fschedule-insns2
5752 Similar to @option{-fschedule-insns}, but requests an additional pass of
5753 instruction scheduling after register allocation has been done.  This is
5754 especially useful on machines with a relatively small number of
5755 registers and where memory load instructions take more than one cycle.
5756
5757 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5758
5759 @item -fno-sched-interblock
5760 @opindex fno-sched-interblock
5761 Don't schedule instructions across basic blocks.  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 -fno-sched-spec
5766 @opindex fno-sched-spec
5767 Don't allow speculative motion of non-load instructions.  This is normally
5768 enabled by default when scheduling before register allocation, i.e.@:
5769 with @option{-fschedule-insns} or at @option{-O2} or higher.
5770
5771 @item -fsched-spec-load
5772 @opindex fsched-spec-load
5773 Allow speculative motion of some 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-spec-load-dangerous
5778 @opindex fsched-spec-load-dangerous
5779 Allow speculative motion of more load instructions.  This only makes
5780 sense when scheduling before register allocation, i.e.@: with
5781 @option{-fschedule-insns} or at @option{-O2} or higher.
5782
5783 @item -fsched-stalled-insns
5784 @itemx -fsched-stalled-insns=@var{n}
5785 @opindex fsched-stalled-insns
5786 Define how many insns (if any) can be moved prematurely from the queue
5787 of stalled insns into the ready list, during the second scheduling pass.
5788 @option{-fno-sched-stalled-insns} means that no insns will be moved
5789 prematurely, @option{-fsched-stalled-insns=0} means there is no limit
5790 on how many queued insns can be moved prematurely.
5791 @option{-fsched-stalled-insns} without a value is equivalent to
5792 @option{-fsched-stalled-insns=1}.
5793
5794 @item -fsched-stalled-insns-dep
5795 @itemx -fsched-stalled-insns-dep=@var{n}
5796 @opindex fsched-stalled-insns-dep
5797 Define how many insn groups (cycles) will be examined for a dependency
5798 on a stalled insn that is candidate for premature removal from the queue
5799 of stalled insns.  This has an effect only during the second scheduling pass,
5800 and only if @option{-fsched-stalled-insns} is used.
5801 @option{-fno-sched-stalled-insns-dep} is equivalent to
5802 @option{-fsched-stalled-insns-dep=0}.
5803 @option{-fsched-stalled-insns-dep} without a value is equivalent to
5804 @option{-fsched-stalled-insns-dep=1}.
5805
5806 @item -fsched2-use-superblocks
5807 @opindex fsched2-use-superblocks
5808 When scheduling after register allocation, do use superblock scheduling
5809 algorithm.  Superblock scheduling allows motion across basic block boundaries
5810 resulting on faster schedules.  This option is experimental, as not all machine
5811 descriptions used by GCC model the CPU closely enough to avoid unreliable
5812 results from the algorithm.
5813
5814 This only makes sense when scheduling after register allocation, i.e.@: with
5815 @option{-fschedule-insns2} or at @option{-O2} or higher.
5816
5817 @item -fsched2-use-traces
5818 @opindex fsched2-use-traces
5819 Use @option{-fsched2-use-superblocks} algorithm when scheduling after register
5820 allocation and additionally perform code duplication in order to increase the
5821 size of superblocks using tracer pass.  See @option{-ftracer} for details on
5822 trace formation.
5823
5824 This mode should produce faster but significantly longer programs.  Also
5825 without @option{-fbranch-probabilities} the traces constructed may not
5826 match the reality and hurt the performance.  This only makes
5827 sense when scheduling after register allocation, i.e.@: with
5828 @option{-fschedule-insns2} or at @option{-O2} or higher.
5829
5830 @item -fsee
5831 @opindex fsee
5832 Eliminate redundant sign extension instructions and move the non-redundant
5833 ones to optimal placement using lazy code motion (LCM).
5834
5835 @item -freschedule-modulo-scheduled-loops
5836 @opindex freschedule-modulo-scheduled-loops
5837 The modulo scheduling comes before the traditional scheduling, if a loop
5838 was modulo scheduled we may want to prevent the later scheduling passes
5839 from changing its schedule, we use this option to control that.
5840
5841 @item -fselective-scheduling
5842 @opindex fselective-scheduling
5843 Schedule instructions using selective scheduling algorithm.  Selective
5844 scheduling runs instead of the first scheduler pass.
5845
5846 @item -fselective-scheduling2
5847 @opindex fselective-scheduling2
5848 Schedule instructions using selective scheduling algorithm.  Selective
5849 scheduling runs instead of the second scheduler pass.
5850
5851 @item -fsel-sched-pipelining
5852 @opindex fsel-sched-pipelining
5853 Enable software pipelining of innermost loops during selective scheduling.  
5854 This option has no effect until one of @option{-fselective-scheduling} or 
5855 @option{-fselective-scheduling2} is turned on.
5856
5857 @item -fsel-sched-pipelining-outer-loops
5858 @opindex fsel-sched-pipelining-outer-loops
5859 When pipelining loops during selective scheduling, also pipeline outer loops.
5860 This option has no effect until @option{-fsel-sched-pipelining} is turned on.
5861
5862 @item -fcaller-saves
5863 @opindex fcaller-saves
5864 Enable values to be allocated in registers that will be clobbered by
5865 function calls, by emitting extra instructions to save and restore the
5866 registers around such calls.  Such allocation is done only when it
5867 seems to result in better code than would otherwise be produced.
5868
5869 This option is always enabled by default on certain machines, usually
5870 those which have no call-preserved registers to use instead.
5871
5872 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5873
5874 @item -ftree-reassoc
5875 @opindex ftree-reassoc
5876 Perform reassociation on trees.  This flag is enabled by default
5877 at @option{-O} and higher.
5878
5879 @item -ftree-pre
5880 @opindex ftree-pre
5881 Perform partial redundancy elimination (PRE) on trees.  This flag is
5882 enabled by default at @option{-O2} and @option{-O3}.
5883
5884 @item -ftree-fre
5885 @opindex ftree-fre
5886 Perform full redundancy elimination (FRE) on trees.  The difference
5887 between FRE and PRE is that FRE only considers expressions
5888 that are computed on all paths leading to the redundant computation.
5889 This analysis is faster than PRE, though it exposes fewer redundancies.
5890 This flag is enabled by default at @option{-O} and higher.
5891
5892 @item -ftree-copy-prop
5893 @opindex ftree-copy-prop
5894 Perform copy propagation on trees.  This pass eliminates unnecessary
5895 copy operations.  This flag is enabled by default at @option{-O} and
5896 higher.
5897
5898 @item -fipa-pure-const
5899 @opindex fipa-pure-const
5900 Discover which functions are pure or constant.
5901 Enabled by default at @option{-O} and higher.
5902
5903 @item -fipa-reference
5904 @opindex fipa-reference
5905 Discover which static variables do not escape cannot escape the
5906 compilation unit.
5907 Enabled by default at @option{-O} and higher.
5908
5909 @item -fipa-struct-reorg
5910 @opindex fipa-struct-reorg
5911 Perform structure reorganization optimization, that change C-like structures 
5912 layout in order to better utilize spatial locality.  This transformation is 
5913 affective for programs containing arrays of structures.  Available in two 
5914 compilation modes: profile-based (enabled with @option{-fprofile-generate})
5915 or static (which uses built-in heuristics).  Require @option{-fipa-type-escape}
5916 to provide the safety of this transformation.  It works only in whole program
5917 mode, so it requires @option{-fwhole-program} and @option{-combine} to be
5918 enabled.  Structures considered @samp{cold} by this transformation are not
5919 affected (see @option{--param struct-reorg-cold-struct-ratio=@var{value}}).
5920
5921 With this flag, the program debug info reflects a new structure layout.
5922
5923 @item -fipa-pta
5924 @opindex fipa-pta
5925 Perform interprocedural pointer analysis.  This option is experimental
5926 and does not affect generated code.
5927
5928 @item -fipa-cp
5929 @opindex fipa-cp
5930 Perform interprocedural constant propagation.
5931 This optimization analyzes the program to determine when values passed
5932 to functions are constants and then optimizes accordingly.  
5933 This optimization can substantially increase performance
5934 if the application has constants passed to functions.
5935 This flag is enabled by default at @option{-O2}, @option{-Os} and @option{-O3}.
5936
5937 @item -fipa-cp-clone
5938 @opindex fipa-cp-clone
5939 Perform function cloning to make interprocedural constant propagation stronger.
5940 When enabled, interprocedural constant propagation will perform function cloning
5941 when externally visible function can be called with constant arguments.
5942 Because this optimization can create multiple copies of functions,
5943 it may significantly increase code size
5944 (see @option{--param ipcp-unit-growth=@var{value}}).
5945 This flag is enabled by default at @option{-O3}.
5946
5947 @item -fipa-matrix-reorg
5948 @opindex fipa-matrix-reorg
5949 Perform matrix flattening and transposing.
5950 Matrix flattening tries to replace a m-dimensional matrix 
5951 with its equivalent n-dimensional matrix, where n < m.
5952 This reduces the level of indirection needed for accessing the elements
5953 of the matrix. The second optimization is matrix transposing that
5954 attemps to change the order of the matrix's dimensions in order to 
5955 improve cache locality.
5956 Both optimizations need fwhole-program flag. 
5957 Transposing is enabled only if profiling information is avaliable.
5958
5959
5960 @item -ftree-sink
5961 @opindex ftree-sink
5962 Perform forward store motion  on trees.  This flag is
5963 enabled by default at @option{-O} and higher.
5964
5965 @item -ftree-ccp
5966 @opindex ftree-ccp
5967 Perform sparse conditional constant propagation (CCP) on trees.  This
5968 pass only operates on local scalar variables and is enabled by default
5969 at @option{-O} and higher.
5970
5971 @item -ftree-switch-conversion
5972 Perform conversion of simple initializations in a switch to
5973 initializations from a scalar array.  This flag is enabled by default
5974 at @option{-O2} and higher.
5975
5976 @item -ftree-dce
5977 @opindex ftree-dce
5978 Perform dead code elimination (DCE) on trees.  This flag is enabled by
5979 default at @option{-O} and higher.
5980
5981 @item -ftree-builtin-call-dce
5982 @opindex ftree-builtin-call-dce
5983 Perform conditional dead code elimination (DCE) for calls to builtin functions 
5984 that may set @code{errno} but are otherwise side-effect free.  This flag is 
5985 enabled by default at @option{-O2} and higher if @option{-Os} is not also 
5986 specified.
5987
5988 @item -ftree-dominator-opts
5989 @opindex ftree-dominator-opts
5990 Perform a variety of simple scalar cleanups (constant/copy
5991 propagation, redundancy elimination, range propagation and expression
5992 simplification) based on a dominator tree traversal.  This also
5993 performs jump threading (to reduce jumps to jumps). This flag is
5994 enabled by default at @option{-O} and higher.
5995
5996 @item -ftree-dse
5997 @opindex ftree-dse
5998 Perform dead store elimination (DSE) on trees.  A dead store is a store into
5999 a memory location which will later be overwritten by another store without
6000 any intervening loads.  In this case the earlier store can be deleted.  This
6001 flag is enabled by default at @option{-O} and higher.
6002
6003 @item -ftree-ch
6004 @opindex ftree-ch
6005 Perform loop header copying on trees.  This is beneficial since it increases
6006 effectiveness of code motion optimizations.  It also saves one jump.  This flag
6007 is enabled by default at @option{-O} and higher.  It is not enabled
6008 for @option{-Os}, since it usually increases code size.
6009
6010 @item -ftree-loop-optimize
6011 @opindex ftree-loop-optimize
6012 Perform loop optimizations on trees.  This flag is enabled by default
6013 at @option{-O} and higher.
6014
6015 @item -ftree-loop-linear
6016 @opindex ftree-loop-linear
6017 Perform linear loop transformations on tree.  This flag can improve cache
6018 performance and allow further loop optimizations to take place.
6019
6020 @item -floop-interchange
6021 Perform loop interchange transformations on loops.  Interchanging two
6022 nested loops switches the inner and outer loops.  For example, given a
6023 loop like:
6024 @smallexample
6025 DO J = 1, M
6026   DO I = 1, N
6027     A(J, I) = A(J, I) * C
6028   ENDDO
6029 ENDDO
6030 @end smallexample
6031 loop interchange will transform the loop as if the user had written:
6032 @smallexample
6033 DO I = 1, N
6034   DO J = 1, M
6035     A(J, I) = A(J, I) * C
6036   ENDDO
6037 ENDDO
6038 @end smallexample
6039 which can be beneficial when @code{N} is larger than the caches,
6040 because in Fortran, the elements of an array are stored in memory
6041 contiguously by column, and the original loop iterates over rows,
6042 potentially creating at each access a cache miss.  This optimization
6043 applies to all the languages supported by GCC and is not limited to
6044 Fortran.
6045
6046 @item -floop-strip-mine
6047 Perform loop strip mining transformations on loops.  Strip mining
6048 splits a loop into two nested loops.  The outer loop has strides 
6049 equal to the strip size and the inner loop has strides of the 
6050 original loop within a strip.  For example, given a loop like:
6051 @smallexample
6052 DO I = 1, N
6053   A(I) = A(I) + C
6054 ENDDO
6055 @end smallexample
6056 loop strip mining will transform the loop as if the user had written:
6057 @smallexample
6058 DO II = 1, N, 4
6059   DO I = II, min (II + 4, N)
6060     A(I) = A(I) + C
6061   ENDDO
6062 ENDDO
6063 @end smallexample
6064 This optimization applies to all the languages supported by GCC and is
6065 not limited to Fortran.
6066
6067 @item -floop-block
6068 Perform loop blocking transformations on loops.  Blocking strip mines
6069 each loop in the loop nest such that the memory accesses of the
6070 element loops fit inside caches.  For example, given a loop like:
6071 @smallexample
6072 DO I = 1, N
6073   DO J = 1, M
6074     A(J, I) = B(I) + C(J)
6075   ENDDO
6076 ENDDO
6077 @end smallexample
6078 loop blocking will transform the loop as if the user had written:
6079 @smallexample
6080 DO II = 1, N, 64
6081   DO JJ = 1, M, 64
6082     DO I = II, min (II + 64, N)
6083       DO J = JJ, min (JJ + 64, M)
6084         A(J, I) = B(I) + C(J)
6085       ENDDO
6086     ENDDO
6087   ENDDO
6088 ENDDO
6089 @end smallexample
6090 which can be beneficial when @code{M} is larger than the caches,
6091 because the innermost loop will iterate over a smaller amount of data
6092 that can be kept in the caches.  This optimization applies to all the
6093 languages supported by GCC and is not limited to Fortran.
6094
6095 @item -fcheck-data-deps
6096 @opindex fcheck-data-deps
6097 Compare the results of several data dependence analyzers.  This option
6098 is used for debugging the data dependence analyzers.
6099
6100 @item -ftree-loop-distribution
6101 Perform loop distribution.  This flag can improve cache performance on
6102 big loop bodies and allow further loop optimizations, like
6103 parallelization or vectorization, to take place.  For example, the loop
6104 @smallexample
6105 DO I = 1, N
6106   A(I) = B(I) + C
6107   D(I) = E(I) * F
6108 ENDDO
6109 @end smallexample
6110 is transformed to
6111 @smallexample
6112 DO I = 1, N
6113    A(I) = B(I) + C
6114 ENDDO
6115 DO I = 1, N
6116    D(I) = E(I) * F
6117 ENDDO
6118 @end smallexample
6119
6120 @item -ftree-loop-im
6121 @opindex ftree-loop-im
6122 Perform loop invariant motion on trees.  This pass moves only invariants that
6123 would be hard to handle at RTL level (function calls, operations that expand to
6124 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
6125 operands of conditions that are invariant out of the loop, so that we can use
6126 just trivial invariantness analysis in loop unswitching.  The pass also includes
6127 store motion.
6128
6129 @item -ftree-loop-ivcanon
6130 @opindex ftree-loop-ivcanon
6131 Create a canonical counter for number of iterations in the loop for that
6132 determining number of iterations requires complicated analysis.  Later
6133 optimizations then may determine the number easily.  Useful especially
6134 in connection with unrolling.
6135
6136 @item -fivopts
6137 @opindex fivopts
6138 Perform induction variable optimizations (strength reduction, induction
6139 variable merging and induction variable elimination) on trees.
6140
6141 @item -ftree-parallelize-loops=n
6142 @opindex ftree-parallelize-loops
6143 Parallelize loops, i.e., split their iteration space to run in n threads.
6144 This is only possible for loops whose iterations are independent
6145 and can be arbitrarily reordered.  The optimization is only
6146 profitable on multiprocessor machines, for loops that are CPU-intensive,
6147 rather than constrained e.g.@: by memory bandwidth.  This option
6148 implies @option{-pthread}, and thus is only supported on targets
6149 that have support for @option{-pthread}.
6150
6151 @item -ftree-sra
6152 @opindex ftree-sra
6153 Perform scalar replacement of aggregates.  This pass replaces structure
6154 references with scalars to prevent committing structures to memory too
6155 early.  This flag is enabled by default at @option{-O} and higher.
6156
6157 @item -ftree-copyrename
6158 @opindex ftree-copyrename
6159 Perform copy renaming on trees.  This pass attempts to rename compiler
6160 temporaries to other variables at copy locations, usually resulting in
6161 variable names which more closely resemble the original variables.  This flag
6162 is enabled by default at @option{-O} and higher.
6163
6164 @item -ftree-ter
6165 @opindex ftree-ter
6166 Perform temporary expression replacement during the SSA->normal phase.  Single
6167 use/single def temporaries are replaced at their use location with their
6168 defining expression.  This results in non-GIMPLE code, but gives the expanders
6169 much more complex trees to work on resulting in better RTL generation.  This is
6170 enabled by default at @option{-O} and higher.
6171
6172 @item -ftree-vectorize
6173 @opindex ftree-vectorize
6174 Perform loop vectorization on trees. This flag is enabled by default at
6175 @option{-O3}.
6176
6177 @item -ftree-vect-loop-version
6178 @opindex ftree-vect-loop-version
6179 Perform loop versioning when doing loop vectorization on trees.  When a loop
6180 appears to be vectorizable except that data alignment or data dependence cannot
6181 be determined at compile time then vectorized and non-vectorized versions of
6182 the loop are generated along with runtime checks for alignment or dependence
6183 to control which version is executed.  This option is enabled by default
6184 except at level @option{-Os} where it is disabled.
6185
6186 @item -fvect-cost-model
6187 @opindex fvect-cost-model
6188 Enable cost model for vectorization.
6189
6190 @item -ftree-vrp
6191 @opindex ftree-vrp
6192 Perform Value Range Propagation on trees.  This is similar to the
6193 constant propagation pass, but instead of values, ranges of values are
6194 propagated.  This allows the optimizers to remove unnecessary range
6195 checks like array bound checks and null pointer checks.  This is
6196 enabled by default at @option{-O2} and higher.  Null pointer check
6197 elimination is only done if @option{-fdelete-null-pointer-checks} is
6198 enabled.
6199
6200 @item -ftracer
6201 @opindex ftracer
6202 Perform tail duplication to enlarge superblock size.  This transformation
6203 simplifies the control flow of the function allowing other optimizations to do
6204 better job.
6205
6206 @item -funroll-loops
6207 @opindex funroll-loops
6208 Unroll loops whose number of iterations can be determined at compile
6209 time or upon entry to the loop.  @option{-funroll-loops} implies
6210 @option{-frerun-cse-after-loop}.  This option makes code larger,
6211 and may or may not make it run faster.
6212
6213 @item -funroll-all-loops
6214 @opindex funroll-all-loops
6215 Unroll all loops, even if their number of iterations is uncertain when
6216 the loop is entered.  This usually makes programs run more slowly.
6217 @option{-funroll-all-loops} implies the same options as
6218 @option{-funroll-loops},
6219
6220 @item -fsplit-ivs-in-unroller
6221 @opindex fsplit-ivs-in-unroller
6222 Enables expressing of values of induction variables in later iterations
6223 of the unrolled loop using the value in the first iteration.  This breaks
6224 long dependency chains, thus improving efficiency of the scheduling passes.
6225
6226 Combination of @option{-fweb} and CSE is often sufficient to obtain the
6227 same effect.  However in cases the loop body is more complicated than
6228 a single basic block, this is not reliable.  It also does not work at all
6229 on some of the architectures due to restrictions in the CSE pass.
6230
6231 This optimization is enabled by default.
6232
6233 @item -fvariable-expansion-in-unroller
6234 @opindex fvariable-expansion-in-unroller
6235 With this option, the compiler will create multiple copies of some
6236 local variables when unrolling a loop which can result in superior code.
6237
6238 @item -fpredictive-commoning
6239 @opindex fpredictive-commoning
6240 Perform predictive commoning optimization, i.e., reusing computations
6241 (especially memory loads and stores) performed in previous
6242 iterations of loops.
6243
6244 This option is enabled at level @option{-O3}.
6245
6246 @item -fprefetch-loop-arrays
6247 @opindex fprefetch-loop-arrays
6248 If supported by the target machine, generate instructions to prefetch
6249 memory to improve the performance of loops that access large arrays.
6250
6251 This option may generate better or worse code; results are highly
6252 dependent on the structure of loops within the source code.
6253
6254 Disabled at level @option{-Os}.
6255
6256 @item -fno-peephole
6257 @itemx -fno-peephole2
6258 @opindex fno-peephole
6259 @opindex fno-peephole2
6260 Disable any machine-specific peephole optimizations.  The difference
6261 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
6262 are implemented in the compiler; some targets use one, some use the
6263 other, a few use both.
6264
6265 @option{-fpeephole} is enabled by default.
6266 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6267
6268 @item -fno-guess-branch-probability
6269 @opindex fno-guess-branch-probability
6270 Do not guess branch probabilities using heuristics.
6271
6272 GCC will use heuristics to guess branch probabilities if they are
6273 not provided by profiling feedback (@option{-fprofile-arcs}).  These
6274 heuristics are based on the control flow graph.  If some branch probabilities
6275 are specified by @samp{__builtin_expect}, then the heuristics will be
6276 used to guess branch probabilities for the rest of the control flow graph,
6277 taking the @samp{__builtin_expect} info into account.  The interactions
6278 between the heuristics and @samp{__builtin_expect} can be complex, and in
6279 some cases, it may be useful to disable the heuristics so that the effects
6280 of @samp{__builtin_expect} are easier to understand.
6281
6282 The default is @option{-fguess-branch-probability} at levels
6283 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6284
6285 @item -freorder-blocks
6286 @opindex freorder-blocks
6287 Reorder basic blocks in the compiled function in order to reduce number of
6288 taken branches and improve code locality.
6289
6290 Enabled at levels @option{-O2}, @option{-O3}.
6291
6292 @item -freorder-blocks-and-partition
6293 @opindex freorder-blocks-and-partition
6294 In addition to reordering basic blocks in the compiled function, in order
6295 to reduce number of taken branches, partitions hot and cold basic blocks
6296 into separate sections of the assembly and .o files, to improve
6297 paging and cache locality performance.
6298
6299 This optimization is automatically turned off in the presence of
6300 exception handling, for linkonce sections, for functions with a user-defined
6301 section attribute and on any architecture that does not support named
6302 sections.
6303
6304 @item -freorder-functions
6305 @opindex freorder-functions
6306 Reorder functions in the object file in order to
6307 improve code locality.  This is implemented by using special
6308 subsections @code{.text.hot} for most frequently executed functions and
6309 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
6310 the linker so object file format must support named sections and linker must
6311 place them in a reasonable way.
6312
6313 Also profile feedback must be available in to make this option effective.  See
6314 @option{-fprofile-arcs} for details.
6315
6316 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6317
6318 @item -fstrict-aliasing
6319 @opindex fstrict-aliasing
6320 Allows the compiler to assume the strictest aliasing rules applicable to
6321 the language being compiled.  For C (and C++), this activates
6322 optimizations based on the type of expressions.  In particular, an
6323 object of one type is assumed never to reside at the same address as an
6324 object of a different type, unless the types are almost the same.  For
6325 example, an @code{unsigned int} can alias an @code{int}, but not a
6326 @code{void*} or a @code{double}.  A character type may alias any other
6327 type.
6328
6329 @anchor{Type-punning}Pay special attention to code like this:
6330 @smallexample
6331 union a_union @{
6332   int i;
6333   double d;
6334 @};
6335
6336 int f() @{
6337   a_union t;
6338   t.d = 3.0;
6339   return t.i;
6340 @}
6341 @end smallexample
6342 The practice of reading from a different union member than the one most
6343 recently written to (called ``type-punning'') is common.  Even with
6344 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
6345 is accessed through the union type.  So, the code above will work as
6346 expected.  @xref{Structures unions enumerations and bit-fields
6347 implementation}.  However, this code might not:
6348 @smallexample
6349 int f() @{
6350   a_union t;
6351   int* ip;
6352   t.d = 3.0;
6353   ip = &t.i;
6354   return *ip;
6355 @}
6356 @end smallexample
6357
6358 Similarly, access by taking the address, casting the resulting pointer
6359 and dereferencing the result has undefined behavior, even if the cast
6360 uses a union type, e.g.:
6361 @smallexample
6362 int f() @{
6363   double d = 3.0;
6364   return ((union a_union *) &d)->i;
6365 @}
6366 @end smallexample
6367
6368 The @option{-fstrict-aliasing} option is enabled at levels
6369 @option{-O2}, @option{-O3}, @option{-Os}.
6370
6371 @item -fstrict-overflow
6372 @opindex fstrict-overflow
6373 Allow the compiler to assume strict signed overflow rules, depending
6374 on the language being compiled.  For C (and C++) this means that
6375 overflow when doing arithmetic with signed numbers is undefined, which
6376 means that the compiler may assume that it will not happen.  This
6377 permits various optimizations.  For example, the compiler will assume
6378 that an expression like @code{i + 10 > i} will always be true for
6379 signed @code{i}.  This assumption is only valid if signed overflow is
6380 undefined, as the expression is false if @code{i + 10} overflows when
6381 using twos complement arithmetic.  When this option is in effect any
6382 attempt to determine whether an operation on signed numbers will
6383 overflow must be written carefully to not actually involve overflow.
6384
6385 This option also allows the compiler to assume strict pointer
6386 semantics: given a pointer to an object, if adding an offset to that
6387 pointer does not produce a pointer to the same object, the addition is
6388 undefined.  This permits the compiler to conclude that @code{p + u >
6389 p} is always true for a pointer @code{p} and unsigned integer
6390 @code{u}.  This assumption is only valid because pointer wraparound is
6391 undefined, as the expression is false if @code{p + u} overflows using
6392 twos complement arithmetic.
6393
6394 See also the @option{-fwrapv} option.  Using @option{-fwrapv} means
6395 that integer signed overflow is fully defined: it wraps.  When
6396 @option{-fwrapv} is used, there is no difference between
6397 @option{-fstrict-overflow} and @option{-fno-strict-overflow} for
6398 integers.  With @option{-fwrapv} certain types of overflow are
6399 permitted.  For example, if the compiler gets an overflow when doing
6400 arithmetic on constants, the overflowed value can still be used with
6401 @option{-fwrapv}, but not otherwise.
6402
6403 The @option{-fstrict-overflow} option is enabled at levels
6404 @option{-O2}, @option{-O3}, @option{-Os}.
6405
6406 @item -falign-functions
6407 @itemx -falign-functions=@var{n}
6408 @opindex falign-functions
6409 Align the start of functions to the next power-of-two greater than
6410 @var{n}, skipping up to @var{n} bytes.  For instance,
6411 @option{-falign-functions=32} aligns functions to the next 32-byte
6412 boundary, but @option{-falign-functions=24} would align to the next
6413 32-byte boundary only if this can be done by skipping 23 bytes or less.
6414
6415 @option{-fno-align-functions} and @option{-falign-functions=1} are
6416 equivalent and mean that functions will not be aligned.
6417
6418 Some assemblers only support this flag when @var{n} is a power of two;
6419 in that case, it is rounded up.
6420
6421 If @var{n} is not specified or is zero, use a machine-dependent default.
6422
6423 Enabled at levels @option{-O2}, @option{-O3}.
6424
6425 @item -falign-labels
6426 @itemx -falign-labels=@var{n}
6427 @opindex falign-labels
6428 Align all branch targets to a power-of-two boundary, skipping up to
6429 @var{n} bytes like @option{-falign-functions}.  This option can easily
6430 make code slower, because it must insert dummy operations for when the
6431 branch target is reached in the usual flow of the code.
6432
6433 @option{-fno-align-labels} and @option{-falign-labels=1} are
6434 equivalent and mean that labels will not be aligned.
6435
6436 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
6437 are greater than this value, then their values are used instead.
6438
6439 If @var{n} is not specified or is zero, use a machine-dependent default
6440 which is very likely to be @samp{1}, meaning no alignment.
6441
6442 Enabled at levels @option{-O2}, @option{-O3}.
6443
6444 @item -falign-loops
6445 @itemx -falign-loops=@var{n}
6446 @opindex falign-loops
6447 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
6448 like @option{-falign-functions}.  The hope is that the loop will be
6449 executed many times, which will make up for any execution of the dummy
6450 operations.
6451
6452 @option{-fno-align-loops} and @option{-falign-loops=1} are
6453 equivalent and mean that loops will not be aligned.
6454
6455 If @var{n} is not specified or is zero, use a machine-dependent default.
6456
6457 Enabled at levels @option{-O2}, @option{-O3}.
6458
6459 @item -falign-jumps
6460 @itemx -falign-jumps=@var{n}
6461 @opindex falign-jumps
6462 Align branch targets to a power-of-two boundary, for branch targets
6463 where the targets can only be reached by jumping, skipping up to @var{n}
6464 bytes like @option{-falign-functions}.  In this case, no dummy operations
6465 need be executed.
6466
6467 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
6468 equivalent and mean that loops will not be aligned.
6469
6470 If @var{n} is not specified or is zero, use a machine-dependent default.
6471
6472 Enabled at levels @option{-O2}, @option{-O3}.
6473
6474 @item -funit-at-a-time
6475 @opindex funit-at-a-time
6476 This option is left for compatibility reasons. @option{-funit-at-a-time}
6477 has no effect, while @option{-fno-unit-at-a-time} implies
6478 @option{-fno-toplevel-reorder} and @option{-fno-section-anchors}.
6479
6480 Enabled by default.
6481
6482 @item -fno-toplevel-reorder
6483 @opindex fno-toplevel-reorder
6484 Do not reorder top-level functions, variables, and @code{asm}
6485 statements.  Output them in the same order that they appear in the
6486 input file.  When this option is used, unreferenced static variables
6487 will not be removed.  This option is intended to support existing code
6488 which relies on a particular ordering.  For new code, it is better to
6489 use attributes.
6490
6491 Enabled at level @option{-O0}.  When disabled explicitly, it also imply
6492 @option{-fno-section-anchors} that is otherwise enabled at @option{-O0} on some
6493 targets.
6494
6495 @item -fweb
6496 @opindex fweb
6497 Constructs webs as commonly used for register allocation purposes and assign
6498 each web individual pseudo register.  This allows the register allocation pass
6499 to operate on pseudos directly, but also strengthens several other optimization
6500 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
6501 however, make debugging impossible, since variables will no longer stay in a
6502 ``home register''.
6503
6504 Enabled by default with @option{-funroll-loops}.
6505
6506 @item -fwhole-program
6507 @opindex fwhole-program
6508 Assume that the current compilation unit represents whole program being
6509 compiled.  All public functions and variables with the exception of @code{main}
6510 and those merged by attribute @code{externally_visible} become static functions
6511 and in a affect gets more aggressively optimized by interprocedural optimizers.
6512 While this option is equivalent to proper use of @code{static} keyword for
6513 programs consisting of single file, in combination with option
6514 @option{--combine} this flag can be used to compile most of smaller scale C
6515 programs since the functions and variables become local for the whole combined
6516 compilation unit, not for the single source file itself.
6517
6518 This option is not supported for Fortran programs.
6519
6520 @item -fcprop-registers
6521 @opindex fcprop-registers
6522 After register allocation and post-register allocation instruction splitting,
6523 we perform a copy-propagation pass to try to reduce scheduling dependencies
6524 and occasionally eliminate the copy.
6525
6526 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6527
6528 @item -fprofile-correction
6529 @opindex fprofile-correction
6530 Profiles collected using an instrumented binary for multi-threaded programs may
6531 be inconsistent due to missed counter updates. When this option is specified,
6532 GCC will use heuristics to correct or smooth out such inconsistencies. By
6533 default, GCC will emit an error message when an inconsistent profile is detected.
6534
6535 @item -fprofile-dir=@var{path}
6536 @opindex fprofile-dir
6537
6538 Set the directory to search the profile data files in to @var{path}.
6539 This option affects only the profile data generated by
6540 @option{-fprofile-generate}, @option{-ftest-coverage}, @option{-fprofile-arcs}
6541 and used by @option{-fprofile-use} and @option{-fbranch-probabilities} 
6542 and its related options.
6543 By default, GCC will use the current directory as @var{path}
6544 thus the profile data file will appear in the same directory as the object file.
6545
6546 @item -fprofile-generate
6547 @itemx -fprofile-generate=@var{path}
6548 @opindex fprofile-generate
6549
6550 Enable options usually used for instrumenting application to produce
6551 profile useful for later recompilation with profile feedback based
6552 optimization.  You must use @option{-fprofile-generate} both when
6553 compiling and when linking your program.
6554
6555 The following options are enabled: @code{-fprofile-arcs}, @code{-fprofile-values}, @code{-fvpt}.
6556
6557 If @var{path} is specified, GCC will look at the @var{path} to find
6558 the profile feeedback data files. See @option{-fprofile-dir}.
6559
6560 @item -fprofile-use
6561 @itemx -fprofile-use=@var{path}
6562 @opindex fprofile-use
6563 Enable profile feedback directed optimizations, and optimizations
6564 generally profitable only with profile feedback available.
6565
6566 The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt},
6567 @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}
6568
6569 By default, GCC emits an error message if the feedback profiles do not
6570 match the source code.  This error can be turned into a warning by using
6571 @option{-Wcoverage-mismatch}.  Note this may result in poorly optimized
6572 code.
6573
6574 If @var{path} is specified, GCC will look at the @var{path} to find
6575 the profile feedback data files. See @option{-fprofile-dir}.
6576 @end table
6577
6578 The following options control compiler behavior regarding floating
6579 point arithmetic.  These options trade off between speed and
6580 correctness.  All must be specifically enabled.
6581
6582 @table @gcctabopt
6583 @item -ffloat-store
6584 @opindex ffloat-store
6585 Do not store floating point variables in registers, and inhibit other
6586 options that might change whether a floating point value is taken from a
6587 register or memory.
6588
6589 @cindex floating point precision
6590 This option prevents undesirable excess precision on machines such as
6591 the 68000 where the floating registers (of the 68881) keep more
6592 precision than a @code{double} is supposed to have.  Similarly for the
6593 x86 architecture.  For most programs, the excess precision does only
6594 good, but a few programs rely on the precise definition of IEEE floating
6595 point.  Use @option{-ffloat-store} for such programs, after modifying
6596 them to store all pertinent intermediate computations into variables.
6597
6598 @item -ffast-math
6599 @opindex ffast-math
6600 Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations},
6601 @option{-ffinite-math-only}, @option{-fno-rounding-math},
6602 @option{-fno-signaling-nans} and @option{-fcx-limited-range}.
6603
6604 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
6605
6606 This option is not turned on by any @option{-O} option since
6607 it can result in incorrect output for programs which depend on
6608 an exact implementation of IEEE or ISO rules/specifications for
6609 math functions. It may, however, yield faster code for programs
6610 that do not require the guarantees of these specifications.
6611
6612 @item -fno-math-errno
6613 @opindex fno-math-errno
6614 Do not set ERRNO after calling math functions that are executed
6615 with a single instruction, e.g., sqrt.  A program that relies on
6616 IEEE exceptions for math error handling may want to use this flag
6617 for speed while maintaining IEEE arithmetic compatibility.
6618
6619 This option is not turned on by any @option{-O} option since
6620 it can result in incorrect output for programs which depend on
6621 an exact implementation of IEEE or ISO rules/specifications for
6622 math functions. It may, however, yield faster code for programs
6623 that do not require the guarantees of these specifications.
6624
6625 The default is @option{-fmath-errno}.
6626
6627 On Darwin systems, the math library never sets @code{errno}.  There is
6628 therefore no reason for the compiler to consider the possibility that
6629 it might, and @option{-fno-math-errno} is the default.
6630
6631 @item -funsafe-math-optimizations
6632 @opindex funsafe-math-optimizations
6633
6634 Allow optimizations for floating-point arithmetic that (a) assume
6635 that arguments and results are valid and (b) may violate IEEE or
6636 ANSI standards.  When used at link-time, it may include libraries
6637 or startup files that change the default FPU control word or other
6638 similar optimizations.
6639
6640 This option is not turned on by any @option{-O} option since
6641 it can result in incorrect output for programs which depend on
6642 an exact implementation of IEEE or ISO rules/specifications for
6643 math functions. It may, however, yield faster code for programs
6644 that do not require the guarantees of these specifications.
6645 Enables @option{-fno-signed-zeros}, @option{-fno-trapping-math},
6646 @option{-fassociative-math} and @option{-freciprocal-math}.
6647
6648 The default is @option{-fno-unsafe-math-optimizations}.
6649
6650 @item -fassociative-math
6651 @opindex fassociative-math
6652
6653 Allow re-association of operands in series of floating-point operations.
6654 This violates the ISO C and C++ language standard by possibly changing
6655 computation result.  NOTE: re-ordering may change the sign of zero as
6656 well as ignore NaNs and inhibit or create underflow or overflow (and
6657 thus cannot be used on a code which relies on rounding behavior like
6658 @code{(x + 2**52) - 2**52)}.  May also reorder floating-point comparisons
6659 and thus may not be used when ordered comparisons are required.
6660 This option requires that both @option{-fno-signed-zeros} and
6661 @option{-fno-trapping-math} be in effect.  Moreover, it doesn't make
6662 much sense with @option{-frounding-math}.
6663
6664 The default is @option{-fno-associative-math}.
6665
6666 @item -freciprocal-math
6667 @opindex freciprocal-math
6668
6669 Allow the reciprocal of a value to be used instead of dividing by
6670 the value if this enables optimizations.  For example @code{x / y}
6671 can be replaced with @code{x * (1/y)} which is useful if @code{(1/y)}
6672 is subject to common subexpression elimination.  Note that this loses
6673 precision and increases the number of flops operating on the value.
6674
6675 The default is @option{-fno-reciprocal-math}.
6676
6677 @item -ffinite-math-only
6678 @opindex ffinite-math-only
6679 Allow optimizations for floating-point arithmetic that assume
6680 that arguments and results are not NaNs or +-Infs.
6681
6682 This option is not turned on by any @option{-O} option since
6683 it can result in incorrect output for programs which depend on
6684 an exact implementation of IEEE or ISO rules/specifications for
6685 math functions. It may, however, yield faster code for programs
6686 that do not require the guarantees of these specifications.
6687
6688 The default is @option{-fno-finite-math-only}.
6689
6690 @item -fno-signed-zeros
6691 @opindex fno-signed-zeros
6692 Allow optimizations for floating point arithmetic that ignore the
6693 signedness of zero.  IEEE arithmetic specifies the behavior of
6694 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
6695 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
6696 This option implies that the sign of a zero result isn't significant.
6697
6698 The default is @option{-fsigned-zeros}.
6699
6700 @item -fno-trapping-math
6701 @opindex fno-trapping-math
6702 Compile code assuming that floating-point operations cannot generate
6703 user-visible traps.  These traps include division by zero, overflow,
6704 underflow, inexact result and invalid operation.  This option requires
6705 that @option{-fno-signaling-nans} be in effect.  Setting this option may
6706 allow faster code if one relies on ``non-stop'' IEEE arithmetic, for example.
6707
6708 This option should never be turned on by any @option{-O} option since
6709 it can result in incorrect output for programs which depend on
6710 an exact implementation of IEEE or ISO rules/specifications for
6711 math functions.
6712
6713 The default is @option{-ftrapping-math}.
6714
6715 @item -frounding-math
6716 @opindex frounding-math
6717 Disable transformations and optimizations that assume default floating
6718 point rounding behavior.  This is round-to-zero for all floating point
6719 to integer conversions, and round-to-nearest for all other arithmetic
6720 truncations.  This option should be specified for programs that change
6721 the FP rounding mode dynamically, or that may be executed with a
6722 non-default rounding mode.  This option disables constant folding of
6723 floating point expressions at compile-time (which may be affected by
6724 rounding mode) and arithmetic transformations that are unsafe in the
6725 presence of sign-dependent rounding modes.
6726
6727 The default is @option{-fno-rounding-math}.
6728
6729 This option is experimental and does not currently guarantee to
6730 disable all GCC optimizations that are affected by rounding mode.
6731 Future versions of GCC may provide finer control of this setting
6732 using C99's @code{FENV_ACCESS} pragma.  This command line option
6733 will be used to specify the default state for @code{FENV_ACCESS}.
6734
6735 @item -frtl-abstract-sequences
6736 @opindex frtl-abstract-sequences
6737 It is a size optimization method. This option is to find identical
6738 sequences of code, which can be turned into pseudo-procedures  and
6739 then  replace  all  occurrences with  calls to  the  newly created
6740 subroutine. It is kind of an opposite of @option{-finline-functions}.
6741 This optimization runs at RTL level.
6742
6743 @item -fsignaling-nans
6744 @opindex fsignaling-nans
6745 Compile code assuming that IEEE signaling NaNs may generate user-visible
6746 traps during floating-point operations.  Setting this option disables
6747 optimizations that may change the number of exceptions visible with
6748 signaling NaNs.  This option implies @option{-ftrapping-math}.
6749
6750 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
6751 be defined.
6752
6753 The default is @option{-fno-signaling-nans}.
6754
6755 This option is experimental and does not currently guarantee to
6756 disable all GCC optimizations that affect signaling NaN behavior.
6757
6758 @item -fsingle-precision-constant
6759 @opindex fsingle-precision-constant
6760 Treat floating point constant as single precision constant instead of
6761 implicitly converting it to double precision constant.
6762
6763 @item -fcx-limited-range
6764 @opindex fcx-limited-range
6765 When enabled, this option states that a range reduction step is not
6766 needed when performing complex division.  Also, there is no checking
6767 whether the result of a complex multiplication or division is @code{NaN
6768 + I*NaN}, with an attempt to rescue the situation in that case.  The
6769 default is @option{-fno-cx-limited-range}, but is enabled by
6770 @option{-ffast-math}.
6771
6772 This option controls the default setting of the ISO C99
6773 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
6774 all languages.
6775
6776 @item -fcx-fortran-rules
6777 @opindex fcx-fortran-rules
6778 Complex multiplication and division follow Fortran rules.  Range
6779 reduction is done as part of complex division, but there is no checking
6780 whether the result of a complex multiplication or division is @code{NaN
6781 + I*NaN}, with an attempt to rescue the situation in that case.
6782
6783 The default is @option{-fno-cx-fortran-rules}.
6784
6785 @end table
6786
6787 The following options control optimizations that may improve
6788 performance, but are not enabled by any @option{-O} options.  This
6789 section includes experimental options that may produce broken code.
6790
6791 @table @gcctabopt
6792 @item -fbranch-probabilities
6793 @opindex fbranch-probabilities
6794 After running a program compiled with @option{-fprofile-arcs}
6795 (@pxref{Debugging Options,, Options for Debugging Your Program or
6796 @command{gcc}}), you can compile it a second time using
6797 @option{-fbranch-probabilities}, to improve optimizations based on
6798 the number of times each branch was taken.  When the program
6799 compiled with @option{-fprofile-arcs} exits it saves arc execution
6800 counts to a file called @file{@var{sourcename}.gcda} for each source
6801 file.  The information in this data file is very dependent on the
6802 structure of the generated code, so you must use the same source code
6803 and the same optimization options for both compilations.
6804
6805 With @option{-fbranch-probabilities}, GCC puts a
6806 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
6807 These can be used to improve optimization.  Currently, they are only
6808 used in one place: in @file{reorg.c}, instead of guessing which path a
6809 branch is mostly to take, the @samp{REG_BR_PROB} values are used to
6810 exactly determine which path is taken more often.
6811
6812 @item -fprofile-values
6813 @opindex fprofile-values
6814 If combined with @option{-fprofile-arcs}, it adds code so that some
6815 data about values of expressions in the program is gathered.
6816
6817 With @option{-fbranch-probabilities}, it reads back the data gathered
6818 from profiling values of expressions and adds @samp{REG_VALUE_PROFILE}
6819 notes to instructions for their later usage in optimizations.
6820
6821 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
6822
6823 @item -fvpt
6824 @opindex fvpt
6825 If combined with @option{-fprofile-arcs}, it instructs the compiler to add
6826 a code to gather information about values of expressions.
6827
6828 With @option{-fbranch-probabilities}, it reads back the data gathered
6829 and actually performs the optimizations based on them.
6830 Currently the optimizations include specialization of division operation
6831 using the knowledge about the value of the denominator.
6832
6833 @item -frename-registers
6834 @opindex frename-registers
6835 Attempt to avoid false dependencies in scheduled code by making use
6836 of registers left over after register allocation.  This optimization
6837 will most benefit processors with lots of registers.  Depending on the
6838 debug information format adopted by the target, however, it can
6839 make debugging impossible, since variables will no longer stay in
6840 a ``home register''.
6841
6842 Enabled by default with @option{-funroll-loops}.
6843
6844 @item -ftracer
6845 @opindex ftracer
6846 Perform tail duplication to enlarge superblock size.  This transformation
6847 simplifies the control flow of the function allowing other optimizations to do
6848 better job.
6849
6850 Enabled with @option{-fprofile-use}.
6851
6852 @item -funroll-loops
6853 @opindex funroll-loops
6854 Unroll loops whose number of iterations can be determined at compile time or
6855 upon entry to the loop.  @option{-funroll-loops} implies
6856 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
6857 It also turns on complete loop peeling (i.e.@: complete removal of loops with
6858 small constant number of iterations).  This option makes code larger, and may
6859 or may not make it run faster.
6860
6861 Enabled with @option{-fprofile-use}.
6862
6863 @item -funroll-all-loops
6864 @opindex funroll-all-loops
6865 Unroll all loops, even if their number of iterations is uncertain when
6866 the loop is entered.  This usually makes programs run more slowly.
6867 @option{-funroll-all-loops} implies the same options as
6868 @option{-funroll-loops}.
6869
6870 @item -fpeel-loops
6871 @opindex fpeel-loops
6872 Peels the loops for that there is enough information that they do not
6873 roll much (from profile feedback).  It also turns on complete loop peeling
6874 (i.e.@: complete removal of loops with small constant number of iterations).
6875
6876 Enabled with @option{-fprofile-use}.
6877
6878 @item -fmove-loop-invariants
6879 @opindex fmove-loop-invariants
6880 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
6881 at level @option{-O1}
6882
6883 @item -funswitch-loops
6884 @opindex funswitch-loops
6885 Move branches with loop invariant conditions out of the loop, with duplicates
6886 of the loop on both branches (modified according to result of the condition).
6887
6888 @item -ffunction-sections
6889 @itemx -fdata-sections
6890 @opindex ffunction-sections
6891 @opindex fdata-sections
6892 Place each function or data item into its own section in the output
6893 file if the target supports arbitrary sections.  The name of the
6894 function or the name of the data item determines the section's name
6895 in the output file.
6896
6897 Use these options on systems where the linker can perform optimizations
6898 to improve locality of reference in the instruction space.  Most systems
6899 using the ELF object format and SPARC processors running Solaris 2 have
6900 linkers with such optimizations.  AIX may have these optimizations in
6901 the future.
6902
6903 Only use these options when there are significant benefits from doing
6904 so.  When you specify these options, the assembler and linker will
6905 create larger object and executable files and will also be slower.
6906 You will not be able to use @code{gprof} on all systems if you
6907 specify this option and you may have problems with debugging if
6908 you specify both this option and @option{-g}.
6909
6910 @item -fbranch-target-load-optimize
6911 @opindex fbranch-target-load-optimize
6912 Perform branch target register load optimization before prologue / epilogue
6913 threading.
6914 The use of target registers can typically be exposed only during reload,
6915 thus hoisting loads out of loops and doing inter-block scheduling needs
6916 a separate optimization pass.
6917
6918 @item -fbranch-target-load-optimize2
6919 @opindex fbranch-target-load-optimize2
6920 Perform branch target register load optimization after prologue / epilogue
6921 threading.
6922
6923 @item -fbtr-bb-exclusive
6924 @opindex fbtr-bb-exclusive
6925 When performing branch target register load optimization, don't reuse
6926 branch target registers in within any basic block.
6927
6928 @item -fstack-protector
6929 @opindex fstack-protector
6930 Emit extra code to check for buffer overflows, such as stack smashing
6931 attacks.  This is done by adding a guard variable to functions with
6932 vulnerable objects.  This includes functions that call alloca, and
6933 functions with buffers larger than 8 bytes.  The guards are initialized
6934 when a function is entered and then checked when the function exits.
6935 If a guard check fails, an error message is printed and the program exits.
6936
6937 @item -fstack-protector-all
6938 @opindex fstack-protector-all
6939 Like @option{-fstack-protector} except that all functions are protected.
6940
6941 @item -fsection-anchors
6942 @opindex fsection-anchors
6943 Try to reduce the number of symbolic address calculations by using
6944 shared ``anchor'' symbols to address nearby objects.  This transformation
6945 can help to reduce the number of GOT entries and GOT accesses on some
6946 targets.
6947
6948 For example, the implementation of the following function @code{foo}:
6949
6950 @smallexample
6951 static int a, b, c;
6952 int foo (void) @{ return a + b + c; @}
6953 @end smallexample
6954
6955 would usually calculate the addresses of all three variables, but if you
6956 compile it with @option{-fsection-anchors}, it will access the variables
6957 from a common anchor point instead.  The effect is similar to the
6958 following pseudocode (which isn't valid C):
6959
6960 @smallexample
6961 int foo (void)
6962 @{
6963   register int *xr = &x;
6964   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
6965 @}
6966 @end smallexample
6967
6968 Not all targets support this option.
6969
6970 @item --param @var{name}=@var{value}
6971 @opindex param
6972 In some places, GCC uses various constants to control the amount of
6973 optimization that is done.  For example, GCC will not inline functions
6974 that contain more that a certain number of instructions.  You can
6975 control some of these constants on the command-line using the
6976 @option{--param} option.
6977
6978 The names of specific parameters, and the meaning of the values, are
6979 tied to the internals of the compiler, and are subject to change
6980 without notice in future releases.
6981
6982 In each case, the @var{value} is an integer.  The allowable choices for
6983 @var{name} are given in the following table:
6984
6985 @table @gcctabopt
6986 @item sra-max-structure-size
6987 The maximum structure size, in bytes, at which the scalar replacement
6988 of aggregates (SRA) optimization will perform block copies.  The
6989 default value, 0, implies that GCC will select the most appropriate
6990 size itself.
6991
6992 @item sra-field-structure-ratio
6993 The threshold ratio (as a percentage) between instantiated fields and
6994 the complete structure size.  We say that if the ratio of the number
6995 of bytes in instantiated fields to the number of bytes in the complete
6996 structure exceeds this parameter, then block copies are not used.  The
6997 default is 75.
6998
6999 @item struct-reorg-cold-struct-ratio
7000 The threshold ratio (as a percentage) between a structure frequency
7001 and the frequency of the hottest structure in the program.  This parameter
7002 is used by struct-reorg optimization enabled by @option{-fipa-struct-reorg}.
7003 We say that if the ratio of a structure frequency, calculated by profiling, 
7004 to the hottest structure frequency in the program is less than this 
7005 parameter, then structure reorganization is not applied to this structure.
7006 The default is 10.
7007
7008 @item predictable-branch-cost-outcome
7009 When branch is predicted to be taken with probability lower than this threshold
7010 (in percent), then it is considered well predictable. The default is 10.
7011
7012 @item max-crossjump-edges
7013 The maximum number of incoming edges to consider for crossjumping.
7014 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
7015 the number of edges incoming to each block.  Increasing values mean
7016 more aggressive optimization, making the compile time increase with
7017 probably small improvement in executable size.
7018
7019 @item min-crossjump-insns
7020 The minimum number of instructions which must be matched at the end
7021 of two blocks before crossjumping will be performed on them.  This
7022 value is ignored in the case where all instructions in the block being
7023 crossjumped from are matched.  The default value is 5.
7024
7025 @item max-grow-copy-bb-insns
7026 The maximum code size expansion factor when copying basic blocks
7027 instead of jumping.  The expansion is relative to a jump instruction.
7028 The default value is 8.
7029
7030 @item max-goto-duplication-insns
7031 The maximum number of instructions to duplicate to a block that jumps
7032 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
7033 passes, GCC factors computed gotos early in the compilation process,
7034 and unfactors them as late as possible.  Only computed jumps at the
7035 end of a basic blocks with no more than max-goto-duplication-insns are
7036 unfactored.  The default value is 8.
7037
7038 @item max-delay-slot-insn-search
7039 The maximum number of instructions to consider when looking for an
7040 instruction to fill a delay slot.  If more than this arbitrary number of
7041 instructions is searched, the time savings from filling the delay slot
7042 will be minimal so stop searching.  Increasing values mean more
7043 aggressive optimization, making the compile time increase with probably
7044 small improvement in executable run time.
7045
7046 @item max-delay-slot-live-search
7047 When trying to fill delay slots, the maximum number of instructions to
7048 consider when searching for a block with valid live register
7049 information.  Increasing this arbitrarily chosen value means more
7050 aggressive optimization, increasing the compile time.  This parameter
7051 should be removed when the delay slot code is rewritten to maintain the
7052 control-flow graph.
7053
7054 @item max-gcse-memory
7055 The approximate maximum amount of memory that will be allocated in
7056 order to perform the global common subexpression elimination
7057 optimization.  If more memory than specified is required, the
7058 optimization will not be done.
7059
7060 @item max-gcse-passes
7061 The maximum number of passes of GCSE to run.  The default is 1.
7062
7063 @item max-pending-list-length
7064 The maximum number of pending dependencies scheduling will allow
7065 before flushing the current state and starting over.  Large functions
7066 with few branches or calls can create excessively large lists which
7067 needlessly consume memory and resources.
7068
7069 @item max-inline-insns-single
7070 Several parameters control the tree inliner used in gcc.
7071 This number sets the maximum number of instructions (counted in GCC's
7072 internal representation) in a single function that the tree inliner
7073 will consider for inlining.  This only affects functions declared
7074 inline and methods implemented in a class declaration (C++).
7075 The default value is 450.
7076
7077 @item max-inline-insns-auto
7078 When you use @option{-finline-functions} (included in @option{-O3}),
7079 a lot of functions that would otherwise not be considered for inlining
7080 by the compiler will be investigated.  To those functions, a different
7081 (more restrictive) limit compared to functions declared inline can
7082 be applied.
7083 The default value is 90.
7084
7085 @item large-function-insns
7086 The limit specifying really large functions.  For functions larger than this
7087 limit after inlining inlining is constrained by
7088 @option{--param large-function-growth}.  This parameter is useful primarily
7089 to avoid extreme compilation time caused by non-linear algorithms used by the
7090 backend.
7091 The default value is 2700.
7092
7093 @item large-function-growth
7094 Specifies maximal growth of large function caused by inlining in percents.
7095 The default value is 100 which limits large function growth to 2.0 times
7096 the original size.
7097
7098 @item large-unit-insns
7099 The limit specifying large translation unit.  Growth caused by inlining of
7100 units larger than this limit is limited by @option{--param inline-unit-growth}.
7101 For small units this might be too tight (consider unit consisting of function A
7102 that is inline and B that just calls A three time.  If B is small relative to
7103 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
7104 large units consisting of small inlineable functions however the overall unit
7105 growth limit is needed to avoid exponential explosion of code size.  Thus for
7106 smaller units, the size is increased to @option{--param large-unit-insns}
7107 before applying @option{--param inline-unit-growth}.  The default is 10000
7108
7109 @item inline-unit-growth
7110 Specifies maximal overall growth of the compilation unit caused by inlining.
7111 The default value is 30 which limits unit growth to 1.3 times the original
7112 size.
7113
7114 @item ipcp-unit-growth
7115 Specifies maximal overall growth of the compilation unit caused by
7116 interprocedural constant propagation.  The default value is 10 which limits
7117 unit growth to 1.1 times the original size.
7118
7119 @item large-stack-frame
7120 The limit specifying large stack frames.  While inlining the algorithm is trying
7121 to not grow past this limit too much.  Default value is 256 bytes.
7122
7123 @item large-stack-frame-growth
7124 Specifies maximal growth of large stack frames caused by inlining in percents.
7125 The default value is 1000 which limits large stack frame growth to 11 times
7126 the original size.
7127
7128 @item max-inline-insns-recursive
7129 @itemx max-inline-insns-recursive-auto
7130 Specifies maximum number of instructions out-of-line copy of self recursive inline
7131 function can grow into by performing recursive inlining.
7132
7133 For functions declared inline @option{--param max-inline-insns-recursive} is
7134 taken into account.  For function not declared inline, recursive inlining
7135 happens only when @option{-finline-functions} (included in @option{-O3}) is
7136 enabled and @option{--param max-inline-insns-recursive-auto} is used.  The
7137 default value is 450.
7138
7139 @item max-inline-recursive-depth
7140 @itemx max-inline-recursive-depth-auto
7141 Specifies maximum recursion depth used by the recursive inlining.
7142
7143 For functions declared inline @option{--param max-inline-recursive-depth} is
7144 taken into account.  For function not declared inline, recursive inlining
7145 happens only when @option{-finline-functions} (included in @option{-O3}) is
7146 enabled and @option{--param max-inline-recursive-depth-auto} is used.  The
7147 default value is 8.
7148
7149 @item min-inline-recursive-probability
7150 Recursive inlining is profitable only for function having deep recursion
7151 in average and can hurt for function having little recursion depth by
7152 increasing the prologue size or complexity of function body to other
7153 optimizers.
7154
7155 When profile feedback is available (see @option{-fprofile-generate}) the actual
7156 recursion depth can be guessed from probability that function will recurse via
7157 given call expression.  This parameter limits inlining only to call expression
7158 whose probability exceeds given threshold (in percents).  The default value is
7159 10.
7160
7161 @item inline-call-cost
7162 Specify cost of call instruction relative to simple arithmetics operations
7163 (having cost of 1).  Increasing this cost disqualifies inlining of non-leaf
7164 functions and at the same time increases size of leaf function that is believed to
7165 reduce function size by being inlined.  In effect it increases amount of
7166 inlining for code having large abstraction penalty (many functions that just
7167 pass the arguments to other functions) and decrease inlining for code with low
7168 abstraction penalty.  The default value is 12.
7169
7170 @item min-vect-loop-bound
7171 The minimum number of iterations under which a loop will not get vectorized
7172 when @option{-ftree-vectorize} is used.  The number of iterations after
7173 vectorization needs to be greater than the value specified by this option
7174 to allow vectorization.  The default value is 0.
7175
7176 @item max-unrolled-insns
7177 The maximum number of instructions that a loop should have if that loop
7178 is unrolled, and if the loop is unrolled, it determines how many times
7179 the loop code is unrolled.
7180
7181 @item max-average-unrolled-insns
7182 The maximum number of instructions biased by probabilities of their execution
7183 that a loop should have if that loop is unrolled, and if the loop is unrolled,
7184 it determines how many times the loop code is unrolled.
7185
7186 @item max-unroll-times
7187 The maximum number of unrollings of a single loop.
7188
7189 @item max-peeled-insns
7190 The maximum number of instructions that a loop should have if that loop
7191 is peeled, and if the loop is peeled, it determines how many times
7192 the loop code is peeled.
7193
7194 @item max-peel-times
7195 The maximum number of peelings of a single loop.
7196
7197 @item max-completely-peeled-insns
7198 The maximum number of insns of a completely peeled loop.
7199
7200 @item max-completely-peel-times
7201 The maximum number of iterations of a loop to be suitable for complete peeling.
7202
7203 @item max-unswitch-insns
7204 The maximum number of insns of an unswitched loop.
7205
7206 @item max-unswitch-level
7207 The maximum number of branches unswitched in a single loop.
7208
7209 @item lim-expensive
7210 The minimum cost of an expensive expression in the loop invariant motion.
7211
7212 @item iv-consider-all-candidates-bound
7213 Bound on number of candidates for induction variables below that
7214 all candidates are considered for each use in induction variable
7215 optimizations.  Only the most relevant candidates are considered
7216 if there are more candidates, to avoid quadratic time complexity.
7217
7218 @item iv-max-considered-uses
7219 The induction variable optimizations give up on loops that contain more
7220 induction variable uses.
7221
7222 @item iv-always-prune-cand-set-bound
7223 If number of candidates in the set is smaller than this value,
7224 we always try to remove unnecessary ivs from the set during its
7225 optimization when a new iv is added to the set.
7226
7227 @item scev-max-expr-size
7228 Bound on size of expressions used in the scalar evolutions analyzer.
7229 Large expressions slow the analyzer.
7230
7231 @item omega-max-vars
7232 The maximum number of variables in an Omega constraint system.
7233 The default value is 128.
7234
7235 @item omega-max-geqs
7236 The maximum number of inequalities in an Omega constraint system.
7237 The default value is 256.
7238
7239 @item omega-max-eqs
7240 The maximum number of equalities in an Omega constraint system.
7241 The default value is 128.
7242
7243 @item omega-max-wild-cards
7244 The maximum number of wildcard variables that the Omega solver will
7245 be able to insert.  The default value is 18.
7246
7247 @item omega-hash-table-size
7248 The size of the hash table in the Omega solver.  The default value is
7249 550.
7250
7251 @item omega-max-keys
7252 The maximal number of keys used by the Omega solver.  The default
7253 value is 500.
7254
7255 @item omega-eliminate-redundant-constraints
7256 When set to 1, use expensive methods to eliminate all redundant
7257 constraints.  The default value is 0.
7258
7259 @item vect-max-version-for-alignment-checks
7260 The maximum number of runtime checks that can be performed when
7261 doing loop versioning for alignment in the vectorizer.  See option
7262 ftree-vect-loop-version for more information.
7263
7264 @item vect-max-version-for-alias-checks
7265 The maximum number of runtime checks that can be performed when
7266 doing loop versioning for alias in the vectorizer.  See option
7267 ftree-vect-loop-version for more information.
7268
7269 @item max-iterations-to-track
7270
7271 The maximum number of iterations of a loop the brute force algorithm
7272 for analysis of # of iterations of the loop tries to evaluate.
7273
7274 @item hot-bb-count-fraction
7275 Select fraction of the maximal count of repetitions of basic block in program
7276 given basic block needs to have to be considered hot.
7277
7278 @item hot-bb-frequency-fraction
7279 Select fraction of the maximal frequency of executions of basic block in
7280 function given basic block needs to have to be considered hot
7281
7282 @item max-predicted-iterations
7283 The maximum number of loop iterations we predict statically.  This is useful
7284 in cases where function contain single loop with known bound and other loop
7285 with unknown.  We predict the known number of iterations correctly, while
7286 the unknown number of iterations average to roughly 10.  This means that the
7287 loop without bounds would appear artificially cold relative to the other one.
7288
7289 @item align-threshold
7290
7291 Select fraction of the maximal frequency of executions of basic block in
7292 function given basic block will get aligned.
7293
7294 @item align-loop-iterations
7295
7296 A loop expected to iterate at lest the selected number of iterations will get
7297 aligned.
7298
7299 @item tracer-dynamic-coverage
7300 @itemx tracer-dynamic-coverage-feedback
7301
7302 This value is used to limit superblock formation once the given percentage of
7303 executed instructions is covered.  This limits unnecessary code size
7304 expansion.
7305
7306 The @option{tracer-dynamic-coverage-feedback} is used only when profile
7307 feedback is available.  The real profiles (as opposed to statically estimated
7308 ones) are much less balanced allowing the threshold to be larger value.
7309
7310 @item tracer-max-code-growth
7311 Stop tail duplication once code growth has reached given percentage.  This is
7312 rather hokey argument, as most of the duplicates will be eliminated later in
7313 cross jumping, so it may be set to much higher values than is the desired code
7314 growth.
7315
7316 @item tracer-min-branch-ratio
7317
7318 Stop reverse growth when the reverse probability of best edge is less than this
7319 threshold (in percent).
7320
7321 @item tracer-min-branch-ratio
7322 @itemx tracer-min-branch-ratio-feedback
7323
7324 Stop forward growth if the best edge do have probability lower than this
7325 threshold.
7326
7327 Similarly to @option{tracer-dynamic-coverage} two values are present, one for
7328 compilation for profile feedback and one for compilation without.  The value
7329 for compilation with profile feedback needs to be more conservative (higher) in
7330 order to make tracer effective.
7331
7332 @item max-cse-path-length
7333
7334 Maximum number of basic blocks on path that cse considers.  The default is 10.
7335
7336 @item max-cse-insns
7337 The maximum instructions CSE process before flushing. The default is 1000.
7338
7339 @item max-aliased-vops
7340
7341 Maximum number of virtual operands per function allowed to represent
7342 aliases before triggering the alias partitioning heuristic.  Alias
7343 partitioning reduces compile times and memory consumption needed for
7344 aliasing at the expense of precision loss in alias information.  The
7345 default value for this parameter is 100 for -O1, 500 for -O2 and 1000
7346 for -O3.
7347
7348 Notice that if a function contains more memory statements than the
7349 value of this parameter, it is not really possible to achieve this
7350 reduction.  In this case, the compiler will use the number of memory
7351 statements as the value for @option{max-aliased-vops}.
7352
7353 @item avg-aliased-vops
7354
7355 Average number of virtual operands per statement allowed to represent
7356 aliases before triggering the alias partitioning heuristic.  This
7357 works in conjunction with @option{max-aliased-vops}.  If a function
7358 contains more than @option{max-aliased-vops} virtual operators, then
7359 memory symbols will be grouped into memory partitions until either the
7360 total number of virtual operators is below @option{max-aliased-vops}
7361 or the average number of virtual operators per memory statement is
7362 below @option{avg-aliased-vops}.  The default value for this parameter
7363 is 1 for -O1 and -O2, and 3 for -O3.
7364
7365 @item ggc-min-expand
7366
7367 GCC uses a garbage collector to manage its own memory allocation.  This
7368 parameter specifies the minimum percentage by which the garbage
7369 collector's heap should be allowed to expand between collections.
7370 Tuning this may improve compilation speed; it has no effect on code
7371 generation.
7372
7373 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
7374 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of "RAM" is
7375 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
7376 GCC is not able to calculate RAM on a particular platform, the lower
7377 bound of 30% is used.  Setting this parameter and
7378 @option{ggc-min-heapsize} to zero causes a full collection to occur at
7379 every opportunity.  This is extremely slow, but can be useful for
7380 debugging.
7381
7382 @item ggc-min-heapsize
7383
7384 Minimum size of the garbage collector's heap before it begins bothering
7385 to collect garbage.  The first collection occurs after the heap expands
7386 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
7387 tuning this may improve compilation speed, and has no effect on code
7388 generation.
7389
7390 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit which
7391 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
7392 with a lower bound of 4096 (four megabytes) and an upper bound of
7393 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
7394 particular platform, the lower bound is used.  Setting this parameter
7395 very large effectively disables garbage collection.  Setting this
7396 parameter and @option{ggc-min-expand} to zero causes a full collection
7397 to occur at every opportunity.
7398
7399 @item max-reload-search-insns
7400 The maximum number of instruction reload should look backward for equivalent
7401 register.  Increasing values mean more aggressive optimization, making the
7402 compile time increase with probably slightly better performance.  The default
7403 value is 100.
7404
7405 @item max-cselib-memory-locations
7406 The maximum number of memory locations cselib should take into account.
7407 Increasing values mean more aggressive optimization, making the compile time
7408 increase with probably slightly better performance.  The default value is 500.
7409
7410 @item reorder-blocks-duplicate
7411 @itemx reorder-blocks-duplicate-feedback
7412
7413 Used by basic block reordering pass to decide whether to use unconditional
7414 branch or duplicate the code on its destination.  Code is duplicated when its
7415 estimated size is smaller than this value multiplied by the estimated size of
7416 unconditional jump in the hot spots of the program.
7417
7418 The @option{reorder-block-duplicate-feedback} is used only when profile
7419 feedback is available and may be set to higher values than
7420 @option{reorder-block-duplicate} since information about the hot spots is more
7421 accurate.
7422
7423 @item max-sched-ready-insns
7424 The maximum number of instructions ready to be issued the scheduler should
7425 consider at any given time during the first scheduling pass.  Increasing
7426 values mean more thorough searches, making the compilation time increase
7427 with probably little benefit.  The default value is 100.
7428
7429 @item max-sched-region-blocks
7430 The maximum number of blocks in a region to be considered for
7431 interblock scheduling.  The default value is 10.
7432
7433 @item max-pipeline-region-blocks
7434 The maximum number of blocks in a region to be considered for
7435 pipelining in the selective scheduler.  The default value is 15.
7436
7437 @item max-sched-region-insns
7438 The maximum number of insns in a region to be considered for
7439 interblock scheduling.  The default value is 100.
7440
7441 @item max-pipeline-region-insns
7442 The maximum number of insns in a region to be considered for
7443 pipelining in the selective scheduler.  The default value is 200.
7444
7445 @item min-spec-prob
7446 The minimum probability (in percents) of reaching a source block
7447 for interblock speculative scheduling.  The default value is 40.
7448
7449 @item max-sched-extend-regions-iters
7450 The maximum number of iterations through CFG to extend regions.
7451 0 - disable region extension,
7452 N - do at most N iterations.
7453 The default value is 0.
7454
7455 @item max-sched-insn-conflict-delay
7456 The maximum conflict delay for an insn to be considered for speculative motion.
7457 The default value is 3.
7458
7459 @item sched-spec-prob-cutoff
7460 The minimal probability of speculation success (in percents), so that
7461 speculative insn will be scheduled.
7462 The default value is 40.
7463
7464 @item sched-mem-true-dep-cost
7465 Minimal distance (in CPU cycles) between store and load targeting same
7466 memory locations.  The default value is 1.
7467
7468 @item selsched-max-lookahead
7469 The maximum size of the lookahead window of selective scheduling.  It is a
7470 depth of search for available instructions.
7471 The default value is 50.
7472
7473 @item selsched-max-sched-times
7474 The maximum number of times that an instruction will be scheduled during 
7475 selective scheduling.  This is the limit on the number of iterations 
7476 through which the instruction may be pipelined.  The default value is 2.
7477
7478 @item selsched-max-insns-to-rename
7479 The maximum number of best instructions in the ready list that are considered
7480 for renaming in the selective scheduler.  The default value is 2.
7481
7482 @item max-last-value-rtl
7483 The maximum size measured as number of RTLs that can be recorded in an expression
7484 in combiner for a pseudo register as last known value of that register.  The default
7485 is 10000.
7486
7487 @item integer-share-limit
7488 Small integer constants can use a shared data structure, reducing the
7489 compiler's memory usage and increasing its speed.  This sets the maximum
7490 value of a shared integer constant.  The default value is 256.
7491
7492 @item min-virtual-mappings
7493 Specifies the minimum number of virtual mappings in the incremental
7494 SSA updater that should be registered to trigger the virtual mappings
7495 heuristic defined by virtual-mappings-ratio.  The default value is
7496 100.
7497
7498 @item virtual-mappings-ratio
7499 If the number of virtual mappings is virtual-mappings-ratio bigger
7500 than the number of virtual symbols to be updated, then the incremental
7501 SSA updater switches to a full update for those symbols.  The default
7502 ratio is 3.
7503
7504 @item ssp-buffer-size
7505 The minimum size of buffers (i.e.@: arrays) that will receive stack smashing
7506 protection when @option{-fstack-protection} is used.
7507
7508 @item max-jump-thread-duplication-stmts
7509 Maximum number of statements allowed in a block that needs to be
7510 duplicated when threading jumps.
7511
7512 @item max-fields-for-field-sensitive
7513 Maximum number of fields in a structure we will treat in
7514 a field sensitive manner during pointer analysis.  The default is zero
7515 for -O0, and -O1 and 100 for -Os, -O2, and -O3.
7516
7517 @item prefetch-latency
7518 Estimate on average number of instructions that are executed before
7519 prefetch finishes.  The distance we prefetch ahead is proportional
7520 to this constant.  Increasing this number may also lead to less
7521 streams being prefetched (see @option{simultaneous-prefetches}).
7522
7523 @item simultaneous-prefetches
7524 Maximum number of prefetches that can run at the same time.
7525
7526 @item l1-cache-line-size
7527 The size of cache line in L1 cache, in bytes.
7528
7529 @item l1-cache-size
7530 The size of L1 cache, in kilobytes.
7531
7532 @item l2-cache-size
7533 The size of L2 cache, in kilobytes.
7534
7535 @item use-canonical-types
7536 Whether the compiler should use the ``canonical'' type system.  By
7537 default, this should always be 1, which uses a more efficient internal
7538 mechanism for comparing types in C++ and Objective-C++.  However, if
7539 bugs in the canonical type system are causing compilation failures,
7540 set this value to 0 to disable canonical types.
7541
7542 @item switch-conversion-max-branch-ratio
7543 Switch initialization conversion will refuse to create arrays that are
7544 bigger than @option{switch-conversion-max-branch-ratio} times the number of
7545 branches in the switch.
7546
7547 @item max-partial-antic-length
7548 Maximum length of the partial antic set computed during the tree
7549 partial redundancy elimination optimization (@option{-ftree-pre}) when
7550 optimizing at @option{-O3} and above.  For some sorts of source code
7551 the enhanced partial redundancy elimination optimization can run away,
7552 consuming all of the memory available on the host machine.  This
7553 parameter sets a limit on the length of the sets that are computed,
7554 which prevents the runaway behaviour.  Setting a value of 0 for
7555 this paramter will allow an unlimited set length.
7556
7557 @item sccvn-max-scc-size
7558 Maximum size of a strongly connected component (SCC) during SCCVN
7559 processing.  If this limit is hit, SCCVN processing for the whole
7560 function will not be done and optimizations depending on it will
7561 be disabled.  The default maximum SCC size is 10000.
7562
7563 @item ira-max-loops-num
7564 IRA uses a regional register allocation by default.  If a function
7565 contains loops more than number given by the parameter, non-regional
7566 register allocator will be used even when option
7567 @option{-fira-algorithm} is given.  The default value of the parameter
7568 is 20.
7569
7570 @end table
7571 @end table
7572
7573 @node Preprocessor Options
7574 @section Options Controlling the Preprocessor
7575 @cindex preprocessor options
7576 @cindex options, preprocessor
7577
7578 These options control the C preprocessor, which is run on each C source
7579 file before actual compilation.
7580
7581 If you use the @option{-E} option, nothing is done except preprocessing.
7582 Some of these options make sense only together with @option{-E} because
7583 they cause the preprocessor output to be unsuitable for actual
7584 compilation.
7585
7586 @table @gcctabopt
7587 @opindex Wp
7588 You can use @option{-Wp,@var{option}} to bypass the compiler driver
7589 and pass @var{option} directly through to the preprocessor.  If
7590 @var{option} contains commas, it is split into multiple options at the
7591 commas.  However, many options are modified, translated or interpreted
7592 by the compiler driver before being passed to the preprocessor, and
7593 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
7594 interface is undocumented and subject to change, so whenever possible
7595 you should avoid using @option{-Wp} and let the driver handle the
7596 options instead.
7597
7598 @item -Xpreprocessor @var{option}
7599 @opindex preprocessor
7600 Pass @var{option} as an option to the preprocessor.  You can use this to
7601 supply system-specific preprocessor options which GCC does not know how to
7602 recognize.
7603
7604 If you want to pass an option that takes an argument, you must use
7605 @option{-Xpreprocessor} twice, once for the option and once for the argument.
7606 @end table
7607
7608 @include cppopts.texi
7609
7610 @node Assembler Options
7611 @section Passing Options to the Assembler
7612
7613 @c prevent bad page break with this line
7614 You can pass options to the assembler.
7615
7616 @table @gcctabopt
7617 @item -Wa,@var{option}
7618 @opindex Wa
7619 Pass @var{option} as an option to the assembler.  If @var{option}
7620 contains commas, it is split into multiple options at the commas.
7621
7622 @item -Xassembler @var{option}
7623 @opindex Xassembler
7624 Pass @var{option} as an option to the assembler.  You can use this to
7625 supply system-specific assembler options which GCC does not know how to
7626 recognize.
7627
7628 If you want to pass an option that takes an argument, you must use
7629 @option{-Xassembler} twice, once for the option and once for the argument.
7630
7631 @end table
7632
7633 @node Link Options
7634 @section Options for Linking
7635 @cindex link options
7636 @cindex options, linking
7637
7638 These options come into play when the compiler links object files into
7639 an executable output file.  They are meaningless if the compiler is
7640 not doing a link step.
7641
7642 @table @gcctabopt
7643 @cindex file names
7644 @item @var{object-file-name}
7645 A file name that does not end in a special recognized suffix is
7646 considered to name an object file or library.  (Object files are
7647 distinguished from libraries by the linker according to the file
7648 contents.)  If linking is done, these object files are used as input
7649 to the linker.
7650
7651 @item -c
7652 @itemx -S
7653 @itemx -E
7654 @opindex c
7655 @opindex S
7656 @opindex E
7657 If any of these options is used, then the linker is not run, and
7658 object file names should not be used as arguments.  @xref{Overall
7659 Options}.
7660
7661 @cindex Libraries
7662 @item -l@var{library}
7663 @itemx -l @var{library}
7664 @opindex l
7665 Search the library named @var{library} when linking.  (The second
7666 alternative with the library as a separate argument is only for
7667 POSIX compliance and is not recommended.)
7668
7669 It makes a difference where in the command you write this option; the
7670 linker searches and processes libraries and object files in the order they
7671 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
7672 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
7673 to functions in @samp{z}, those functions may not be loaded.
7674
7675 The linker searches a standard list of directories for the library,
7676 which is actually a file named @file{lib@var{library}.a}.  The linker
7677 then uses this file as if it had been specified precisely by name.
7678
7679 The directories searched include several standard system directories
7680 plus any that you specify with @option{-L}.
7681
7682 Normally the files found this way are library files---archive files
7683 whose members are object files.  The linker handles an archive file by
7684 scanning through it for members which define symbols that have so far
7685 been referenced but not defined.  But if the file that is found is an
7686 ordinary object file, it is linked in the usual fashion.  The only
7687 difference between using an @option{-l} option and specifying a file name
7688 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
7689 and searches several directories.
7690
7691 @item -lobjc
7692 @opindex lobjc
7693 You need this special case of the @option{-l} option in order to
7694 link an Objective-C or Objective-C++ program.
7695
7696 @item -nostartfiles
7697 @opindex nostartfiles
7698 Do not use the standard system startup files when linking.
7699 The standard system libraries are used normally, unless @option{-nostdlib}
7700 or @option{-nodefaultlibs} is used.
7701
7702 @item -nodefaultlibs
7703 @opindex nodefaultlibs
7704 Do not use the standard system libraries when linking.
7705 Only the libraries you specify will be passed to the linker.
7706 The standard startup files are used normally, unless @option{-nostartfiles}
7707 is used.  The compiler may generate calls to @code{memcmp},
7708 @code{memset}, @code{memcpy} and @code{memmove}.
7709 These entries are usually resolved by entries in
7710 libc.  These entry points should be supplied through some other
7711 mechanism when this option is specified.
7712
7713 @item -nostdlib
7714 @opindex nostdlib
7715 Do not use the standard system startup files or libraries when linking.
7716 No startup files and only the libraries you specify will be passed to
7717 the linker.  The compiler may generate calls to @code{memcmp}, @code{memset},
7718 @code{memcpy} and @code{memmove}.
7719 These entries are usually resolved by entries in
7720 libc.  These entry points should be supplied through some other
7721 mechanism when this option is specified.
7722
7723 @cindex @option{-lgcc}, use with @option{-nostdlib}
7724 @cindex @option{-nostdlib} and unresolved references
7725 @cindex unresolved references and @option{-nostdlib}
7726 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
7727 @cindex @option{-nodefaultlibs} and unresolved references
7728 @cindex unresolved references and @option{-nodefaultlibs}
7729 One of the standard libraries bypassed by @option{-nostdlib} and
7730 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
7731 that GCC uses to overcome shortcomings of particular machines, or special
7732 needs for some languages.
7733 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
7734 Collection (GCC) Internals},
7735 for more discussion of @file{libgcc.a}.)
7736 In most cases, you need @file{libgcc.a} even when you want to avoid
7737 other standard libraries.  In other words, when you specify @option{-nostdlib}
7738 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
7739 This ensures that you have no unresolved references to internal GCC
7740 library subroutines.  (For example, @samp{__main}, used to ensure C++
7741 constructors will be called; @pxref{Collect2,,@code{collect2}, gccint,
7742 GNU Compiler Collection (GCC) Internals}.)
7743
7744 @item -pie
7745 @opindex pie
7746 Produce a position independent executable on targets which support it.
7747 For predictable results, you must also specify the same set of options
7748 that were used to generate code (@option{-fpie}, @option{-fPIE},
7749 or model suboptions) when you specify this option.
7750
7751 @item -rdynamic
7752 @opindex rdynamic
7753 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
7754 that support it. This instructs the linker to add all symbols, not
7755 only used ones, to the dynamic symbol table. This option is needed
7756 for some uses of @code{dlopen} or to allow obtaining backtraces
7757 from within a program.
7758
7759 @item -s
7760 @opindex s
7761 Remove all symbol table and relocation information from the executable.
7762
7763 @item -static
7764 @opindex static
7765 On systems that support dynamic linking, this prevents linking with the shared
7766 libraries.  On other systems, this option has no effect.
7767
7768 @item -shared
7769 @opindex shared
7770 Produce a shared object which can then be linked with other objects to
7771 form an executable.  Not all systems support this option.  For predictable
7772 results, you must also specify the same set of options that were used to
7773 generate code (@option{-fpic}, @option{-fPIC}, or model suboptions)
7774 when you specify this option.@footnote{On some systems, @samp{gcc -shared}
7775 needs to build supplementary stub code for constructors to work.  On
7776 multi-libbed systems, @samp{gcc -shared} must select the correct support
7777 libraries to link against.  Failing to supply the correct flags may lead
7778 to subtle defects.  Supplying them in cases where they are not necessary
7779 is innocuous.}
7780
7781 @item -shared-libgcc
7782 @itemx -static-libgcc
7783 @opindex shared-libgcc
7784 @opindex static-libgcc
7785 On systems that provide @file{libgcc} as a shared library, these options
7786 force the use of either the shared or static version respectively.
7787 If no shared version of @file{libgcc} was built when the compiler was
7788 configured, these options have no effect.
7789
7790 There are several situations in which an application should use the
7791 shared @file{libgcc} instead of the static version.  The most common
7792 of these is when the application wishes to throw and catch exceptions
7793 across different shared libraries.  In that case, each of the libraries
7794 as well as the application itself should use the shared @file{libgcc}.
7795
7796 Therefore, the G++ and GCJ drivers automatically add
7797 @option{-shared-libgcc} whenever you build a shared library or a main
7798 executable, because C++ and Java programs typically use exceptions, so
7799 this is the right thing to do.
7800
7801 If, instead, you use the GCC driver to create shared libraries, you may
7802 find that they will not always be linked with the shared @file{libgcc}.
7803 If GCC finds, at its configuration time, that you have a non-GNU linker
7804 or a GNU linker that does not support option @option{--eh-frame-hdr},
7805 it will link the shared version of @file{libgcc} into shared libraries
7806 by default.  Otherwise, it will take advantage of the linker and optimize
7807 away the linking with the shared version of @file{libgcc}, linking with
7808 the static version of libgcc by default.  This allows exceptions to
7809 propagate through such shared libraries, without incurring relocation
7810 costs at library load time.
7811
7812 However, if a library or main executable is supposed to throw or catch
7813 exceptions, you must link it using the G++ or GCJ driver, as appropriate
7814 for the languages used in the program, or using the option
7815 @option{-shared-libgcc}, such that it is linked with the shared
7816 @file{libgcc}.
7817
7818 @item -symbolic
7819 @opindex symbolic
7820 Bind references to global symbols when building a shared object.  Warn
7821 about any unresolved references (unless overridden by the link editor
7822 option @samp{-Xlinker -z -Xlinker defs}).  Only a few systems support
7823 this option.
7824
7825 @item -Xlinker @var{option}
7826 @opindex Xlinker
7827 Pass @var{option} as an option to the linker.  You can use this to
7828 supply system-specific linker options which GCC does not know how to
7829 recognize.
7830
7831 If you want to pass an option that takes an argument, you must use
7832 @option{-Xlinker} twice, once for the option and once for the argument.
7833 For example, to pass @option{-assert definitions}, you must write
7834 @samp{-Xlinker -assert -Xlinker definitions}.  It does not work to write
7835 @option{-Xlinker "-assert definitions"}, because this passes the entire
7836 string as a single argument, which is not what the linker expects.
7837
7838 @item -Wl,@var{option}
7839 @opindex Wl
7840 Pass @var{option} as an option to the linker.  If @var{option} contains
7841 commas, it is split into multiple options at the commas.
7842
7843 @item -u @var{symbol}
7844 @opindex u
7845 Pretend the symbol @var{symbol} is undefined, to force linking of
7846 library modules to define it.  You can use @option{-u} multiple times with
7847 different symbols to force loading of additional library modules.
7848 @end table
7849
7850 @node Directory Options
7851 @section Options for Directory Search
7852 @cindex directory options
7853 @cindex options, directory search
7854 @cindex search path
7855
7856 These options specify directories to search for header files, for
7857 libraries and for parts of the compiler:
7858
7859 @table @gcctabopt
7860 @item -I@var{dir}
7861 @opindex I
7862 Add the directory @var{dir} to the head of the list of directories to be
7863 searched for header files.  This can be used to override a system header
7864 file, substituting your own version, since these directories are
7865 searched before the system header file directories.  However, you should
7866 not use this option to add directories that contain vendor-supplied
7867 system header files (use @option{-isystem} for that).  If you use more than
7868 one @option{-I} option, the directories are scanned in left-to-right
7869 order; the standard system directories come after.
7870
7871 If a standard system include directory, or a directory specified with
7872 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
7873 option will be ignored.  The directory will still be searched but as a
7874 system directory at its normal position in the system include chain.
7875 This is to ensure that GCC's procedure to fix buggy system headers and
7876 the ordering for the include_next directive are not inadvertently changed.
7877 If you really need to change the search order for system directories,
7878 use the @option{-nostdinc} and/or @option{-isystem} options.
7879
7880 @item -iquote@var{dir}
7881 @opindex iquote
7882 Add the directory @var{dir} to the head of the list of directories to
7883 be searched for header files only for the case of @samp{#include
7884 "@var{file}"}; they are not searched for @samp{#include <@var{file}>},
7885 otherwise just like @option{-I}.
7886
7887 @item -L@var{dir}
7888 @opindex L
7889 Add directory @var{dir} to the list of directories to be searched
7890 for @option{-l}.
7891
7892 @item -B@var{prefix}
7893 @opindex B
7894 This option specifies where to find the executables, libraries,
7895 include files, and data files of the compiler itself.
7896
7897 The compiler driver program runs one or more of the subprograms
7898 @file{cpp}, @file{cc1}, @file{as} and @file{ld}.  It tries
7899 @var{prefix} as a prefix for each program it tries to run, both with and
7900 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
7901
7902 For each subprogram to be run, the compiler driver first tries the
7903 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
7904 was not specified, the driver tries two standard prefixes, which are
7905 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
7906 those results in a file name that is found, the unmodified program
7907 name is searched for using the directories specified in your
7908 @env{PATH} environment variable.
7909
7910 The compiler will check to see if the path provided by the @option{-B}
7911 refers to a directory, and if necessary it will add a directory
7912 separator character at the end of the path.
7913
7914 @option{-B} prefixes that effectively specify directory names also apply
7915 to libraries in the linker, because the compiler translates these
7916 options into @option{-L} options for the linker.  They also apply to
7917 includes files in the preprocessor, because the compiler translates these
7918 options into @option{-isystem} options for the preprocessor.  In this case,
7919 the compiler appends @samp{include} to the prefix.
7920
7921 The run-time support file @file{libgcc.a} can also be searched for using
7922 the @option{-B} prefix, if needed.  If it is not found there, the two
7923 standard prefixes above are tried, and that is all.  The file is left
7924 out of the link if it is not found by those means.
7925
7926 Another way to specify a prefix much like the @option{-B} prefix is to use
7927 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
7928 Variables}.
7929
7930 As a special kludge, if the path provided by @option{-B} is
7931 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
7932 9, then it will be replaced by @file{[dir/]include}.  This is to help
7933 with boot-strapping the compiler.
7934
7935 @item -specs=@var{file}
7936 @opindex specs
7937 Process @var{file} after the compiler reads in the standard @file{specs}
7938 file, in order to override the defaults that the @file{gcc} driver
7939 program uses when determining what switches to pass to @file{cc1},
7940 @file{cc1plus}, @file{as}, @file{ld}, etc.  More than one
7941 @option{-specs=@var{file}} can be specified on the command line, and they
7942 are processed in order, from left to right.
7943
7944 @item --sysroot=@var{dir}
7945 @opindex sysroot
7946 Use @var{dir} as the logical root directory for headers and libraries.
7947 For example, if the compiler would normally search for headers in
7948 @file{/usr/include} and libraries in @file{/usr/lib}, it will instead
7949 search @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
7950
7951 If you use both this option and the @option{-isysroot} option, then
7952 the @option{--sysroot} option will apply to libraries, but the
7953 @option{-isysroot} option will apply to header files.
7954
7955 The GNU linker (beginning with version 2.16) has the necessary support
7956 for this option.  If your linker does not support this option, the
7957 header file aspect of @option{--sysroot} will still work, but the
7958 library aspect will not.
7959
7960 @item -I-
7961 @opindex I-
7962 This option has been deprecated.  Please use @option{-iquote} instead for
7963 @option{-I} directories before the @option{-I-} and remove the @option{-I-}.
7964 Any directories you specify with @option{-I} options before the @option{-I-}
7965 option are searched only for the case of @samp{#include "@var{file}"};
7966 they are not searched for @samp{#include <@var{file}>}.
7967
7968 If additional directories are specified with @option{-I} options after
7969 the @option{-I-}, these directories are searched for all @samp{#include}
7970 directives.  (Ordinarily @emph{all} @option{-I} directories are used
7971 this way.)
7972
7973 In addition, the @option{-I-} option inhibits the use of the current
7974 directory (where the current input file came from) as the first search
7975 directory for @samp{#include "@var{file}"}.  There is no way to
7976 override this effect of @option{-I-}.  With @option{-I.} you can specify
7977 searching the directory which was current when the compiler was
7978 invoked.  That is not exactly the same as what the preprocessor does
7979 by default, but it is often satisfactory.
7980
7981 @option{-I-} does not inhibit the use of the standard system directories
7982 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
7983 independent.
7984 @end table
7985
7986 @c man end
7987
7988 @node Spec Files
7989 @section Specifying subprocesses and the switches to pass to them
7990 @cindex Spec Files
7991
7992 @command{gcc} is a driver program.  It performs its job by invoking a
7993 sequence of other programs to do the work of compiling, assembling and
7994 linking.  GCC interprets its command-line parameters and uses these to
7995 deduce which programs it should invoke, and which command-line options
7996 it ought to place on their command lines.  This behavior is controlled
7997 by @dfn{spec strings}.  In most cases there is one spec string for each
7998 program that GCC can invoke, but a few programs have multiple spec
7999 strings to control their behavior.  The spec strings built into GCC can
8000 be overridden by using the @option{-specs=} command-line switch to specify
8001 a spec file.
8002
8003 @dfn{Spec files} are plaintext files that are used to construct spec
8004 strings.  They consist of a sequence of directives separated by blank
8005 lines.  The type of directive is determined by the first non-whitespace
8006 character on the line and it can be one of the following:
8007
8008 @table @code
8009 @item %@var{command}
8010 Issues a @var{command} to the spec file processor.  The commands that can
8011 appear here are:
8012
8013 @table @code
8014 @item %include <@var{file}>
8015 @cindex %include
8016 Search for @var{file} and insert its text at the current point in the
8017 specs file.
8018
8019 @item %include_noerr <@var{file}>
8020 @cindex %include_noerr
8021 Just like @samp{%include}, but do not generate an error message if the include
8022 file cannot be found.
8023
8024 @item %rename @var{old_name} @var{new_name}
8025 @cindex %rename
8026 Rename the spec string @var{old_name} to @var{new_name}.
8027
8028 @end table
8029
8030 @item *[@var{spec_name}]:
8031 This tells the compiler to create, override or delete the named spec
8032 string.  All lines after this directive up to the next directive or
8033 blank line are considered to be the text for the spec string.  If this
8034 results in an empty string then the spec will be deleted.  (Or, if the
8035 spec did not exist, then nothing will happened.)  Otherwise, if the spec
8036 does not currently exist a new spec will be created.  If the spec does
8037 exist then its contents will be overridden by the text of this
8038 directive, unless the first character of that text is the @samp{+}
8039 character, in which case the text will be appended to the spec.
8040
8041 @item [@var{suffix}]:
8042 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
8043 and up to the next directive or blank line are considered to make up the
8044 spec string for the indicated suffix.  When the compiler encounters an
8045 input file with the named suffix, it will processes the spec string in
8046 order to work out how to compile that file.  For example:
8047
8048 @smallexample
8049 .ZZ:
8050 z-compile -input %i
8051 @end smallexample
8052
8053 This says that any input file whose name ends in @samp{.ZZ} should be
8054 passed to the program @samp{z-compile}, which should be invoked with the
8055 command-line switch @option{-input} and with the result of performing the
8056 @samp{%i} substitution.  (See below.)
8057
8058 As an alternative to providing a spec string, the text that follows a
8059 suffix directive can be one of the following:
8060
8061 @table @code
8062 @item @@@var{language}
8063 This says that the suffix is an alias for a known @var{language}.  This is
8064 similar to using the @option{-x} command-line switch to GCC to specify a
8065 language explicitly.  For example:
8066
8067 @smallexample
8068 .ZZ:
8069 @@c++
8070 @end smallexample
8071
8072 Says that .ZZ files are, in fact, C++ source files.
8073
8074 @item #@var{name}
8075 This causes an error messages saying:
8076
8077 @smallexample
8078 @var{name} compiler not installed on this system.
8079 @end smallexample
8080 @end table
8081
8082 GCC already has an extensive list of suffixes built into it.
8083 This directive will add an entry to the end of the list of suffixes, but
8084 since the list is searched from the end backwards, it is effectively
8085 possible to override earlier entries using this technique.
8086
8087 @end table
8088
8089 GCC has the following spec strings built into it.  Spec files can
8090 override these strings or create their own.  Note that individual
8091 targets can also add their own spec strings to this list.
8092
8093 @smallexample
8094 asm          Options to pass to the assembler
8095 asm_final    Options to pass to the assembler post-processor
8096 cpp          Options to pass to the C preprocessor
8097 cc1          Options to pass to the C compiler
8098 cc1plus      Options to pass to the C++ compiler
8099 endfile      Object files to include at the end of the link
8100 link         Options to pass to the linker
8101 lib          Libraries to include on the command line to the linker
8102 libgcc       Decides which GCC support library to pass to the linker
8103 linker       Sets the name of the linker
8104 predefines   Defines to be passed to the C preprocessor
8105 signed_char  Defines to pass to CPP to say whether @code{char} is signed
8106              by default
8107 startfile    Object files to include at the start of the link
8108 @end smallexample
8109
8110 Here is a small example of a spec file:
8111
8112 @smallexample
8113 %rename lib                 old_lib
8114
8115 *lib:
8116 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
8117 @end smallexample
8118
8119 This example renames the spec called @samp{lib} to @samp{old_lib} and
8120 then overrides the previous definition of @samp{lib} with a new one.
8121 The new definition adds in some extra command-line options before
8122 including the text of the old definition.
8123
8124 @dfn{Spec strings} are a list of command-line options to be passed to their
8125 corresponding program.  In addition, the spec strings can contain
8126 @samp{%}-prefixed sequences to substitute variable text or to
8127 conditionally insert text into the command line.  Using these constructs
8128 it is possible to generate quite complex command lines.
8129
8130 Here is a table of all defined @samp{%}-sequences for spec
8131 strings.  Note that spaces are not generated automatically around the
8132 results of expanding these sequences.  Therefore you can concatenate them
8133 together or combine them with constant text in a single argument.
8134
8135 @table @code
8136 @item %%
8137 Substitute one @samp{%} into the program name or argument.
8138
8139 @item %i
8140 Substitute the name of the input file being processed.
8141
8142 @item %b
8143 Substitute the basename of the input file being processed.
8144 This is the substring up to (and not including) the last period
8145 and not including the directory.
8146
8147 @item %B
8148 This is the same as @samp{%b}, but include the file suffix (text after
8149 the last period).
8150
8151 @item %d
8152 Marks the argument containing or following the @samp{%d} as a
8153 temporary file name, so that that file will be deleted if GCC exits
8154 successfully.  Unlike @samp{%g}, this contributes no text to the
8155 argument.
8156
8157 @item %g@var{suffix}
8158 Substitute a file name that has suffix @var{suffix} and is chosen
8159 once per compilation, and mark the argument in the same way as
8160 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
8161 name is now chosen in a way that is hard to predict even when previously
8162 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
8163 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
8164 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
8165 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
8166 was simply substituted with a file name chosen once per compilation,
8167 without regard to any appended suffix (which was therefore treated
8168 just like ordinary text), making such attacks more likely to succeed.
8169
8170 @item %u@var{suffix}
8171 Like @samp{%g}, but generates a new temporary file name even if
8172 @samp{%u@var{suffix}} was already seen.
8173
8174 @item %U@var{suffix}
8175 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
8176 new one if there is no such last file name.  In the absence of any
8177 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
8178 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
8179 would involve the generation of two distinct file names, one
8180 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
8181 simply substituted with a file name chosen for the previous @samp{%u},
8182 without regard to any appended suffix.
8183
8184 @item %j@var{suffix}
8185 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
8186 writable, and if save-temps is off; otherwise, substitute the name
8187 of a temporary file, just like @samp{%u}.  This temporary file is not
8188 meant for communication between processes, but rather as a junk
8189 disposal mechanism.
8190
8191 @item %|@var{suffix}
8192 @itemx %m@var{suffix}
8193 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
8194 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
8195 all.  These are the two most common ways to instruct a program that it
8196 should read from standard input or write to standard output.  If you
8197 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
8198 construct: see for example @file{f/lang-specs.h}.
8199
8200 @item %.@var{SUFFIX}
8201 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
8202 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
8203 terminated by the next space or %.
8204
8205 @item %w
8206 Marks the argument containing or following the @samp{%w} as the
8207 designated output file of this compilation.  This puts the argument
8208 into the sequence of arguments that @samp{%o} will substitute later.
8209
8210 @item %o
8211 Substitutes the names of all the output files, with spaces
8212 automatically placed around them.  You should write spaces
8213 around the @samp{%o} as well or the results are undefined.
8214 @samp{%o} is for use in the specs for running the linker.
8215 Input files whose names have no recognized suffix are not compiled
8216 at all, but they are included among the output files, so they will
8217 be linked.
8218
8219 @item %O
8220 Substitutes the suffix for object files.  Note that this is
8221 handled specially when it immediately follows @samp{%g, %u, or %U},
8222 because of the need for those to form complete file names.  The
8223 handling is such that @samp{%O} is treated exactly as if it had already
8224 been substituted, except that @samp{%g, %u, and %U} do not currently
8225 support additional @var{suffix} characters following @samp{%O} as they would
8226 following, for example, @samp{.o}.
8227
8228 @item %p
8229 Substitutes the standard macro predefinitions for the
8230 current target machine.  Use this when running @code{cpp}.
8231
8232 @item %P
8233 Like @samp{%p}, but puts @samp{__} before and after the name of each
8234 predefined macro, except for macros that start with @samp{__} or with
8235 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
8236 C@.
8237
8238 @item %I
8239 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
8240 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
8241 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
8242 and @option{-imultilib} as necessary.
8243
8244 @item %s
8245 Current argument is the name of a library or startup file of some sort.
8246 Search for that file in a standard list of directories and substitute
8247 the full name found.
8248
8249 @item %e@var{str}
8250 Print @var{str} as an error message.  @var{str} is terminated by a newline.
8251 Use this when inconsistent options are detected.
8252
8253 @item %(@var{name})
8254 Substitute the contents of spec string @var{name} at this point.
8255
8256 @item %[@var{name}]
8257 Like @samp{%(@dots{})} but put @samp{__} around @option{-D} arguments.
8258
8259 @item %x@{@var{option}@}
8260 Accumulate an option for @samp{%X}.
8261
8262 @item %X
8263 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
8264 spec string.
8265
8266 @item %Y
8267 Output the accumulated assembler options specified by @option{-Wa}.
8268
8269 @item %Z
8270 Output the accumulated preprocessor options specified by @option{-Wp}.
8271
8272 @item %a
8273 Process the @code{asm} spec.  This is used to compute the
8274 switches to be passed to the assembler.
8275
8276 @item %A
8277 Process the @code{asm_final} spec.  This is a spec string for
8278 passing switches to an assembler post-processor, if such a program is
8279 needed.
8280
8281 @item %l
8282 Process the @code{link} spec.  This is the spec for computing the
8283 command line passed to the linker.  Typically it will make use of the
8284 @samp{%L %G %S %D and %E} sequences.
8285
8286 @item %D
8287 Dump out a @option{-L} option for each directory that GCC believes might
8288 contain startup files.  If the target supports multilibs then the
8289 current multilib directory will be prepended to each of these paths.
8290
8291 @item %L
8292 Process the @code{lib} spec.  This is a spec string for deciding which
8293 libraries should be included on the command line to the linker.
8294
8295 @item %G
8296 Process the @code{libgcc} spec.  This is a spec string for deciding
8297 which GCC support library should be included on the command line to the linker.
8298
8299 @item %S
8300 Process the @code{startfile} spec.  This is a spec for deciding which
8301 object files should be the first ones passed to the linker.  Typically
8302 this might be a file named @file{crt0.o}.
8303
8304 @item %E
8305 Process the @code{endfile} spec.  This is a spec string that specifies
8306 the last object files that will be passed to the linker.
8307
8308 @item %C
8309 Process the @code{cpp} spec.  This is used to construct the arguments
8310 to be passed to the C preprocessor.
8311
8312 @item %1
8313 Process the @code{cc1} spec.  This is used to construct the options to be
8314 passed to the actual C compiler (@samp{cc1}).
8315
8316 @item %2
8317 Process the @code{cc1plus} spec.  This is used to construct the options to be
8318 passed to the actual C++ compiler (@samp{cc1plus}).
8319
8320 @item %*
8321 Substitute the variable part of a matched option.  See below.
8322 Note that each comma in the substituted string is replaced by
8323 a single space.
8324
8325 @item %<@code{S}
8326 Remove all occurrences of @code{-S} from the command line.  Note---this
8327 command is position dependent.  @samp{%} commands in the spec string
8328 before this one will see @code{-S}, @samp{%} commands in the spec string
8329 after this one will not.
8330
8331 @item %:@var{function}(@var{args})
8332 Call the named function @var{function}, passing it @var{args}.
8333 @var{args} is first processed as a nested spec string, then split
8334 into an argument vector in the usual fashion.  The function returns
8335 a string which is processed as if it had appeared literally as part
8336 of the current spec.
8337
8338 The following built-in spec functions are provided:
8339
8340 @table @code
8341 @item @code{getenv}
8342 The @code{getenv} spec function takes two arguments: an environment
8343 variable name and a string.  If the environment variable is not
8344 defined, a fatal error is issued.  Otherwise, the return value is the
8345 value of the environment variable concatenated with the string.  For
8346 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
8347
8348 @smallexample
8349 %:getenv(TOPDIR /include)
8350 @end smallexample
8351
8352 expands to @file{/path/to/top/include}.
8353
8354 @item @code{if-exists}
8355 The @code{if-exists} spec function takes one argument, an absolute
8356 pathname to a file.  If the file exists, @code{if-exists} returns the
8357 pathname.  Here is a small example of its usage:
8358
8359 @smallexample
8360 *startfile:
8361 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
8362 @end smallexample
8363
8364 @item @code{if-exists-else}
8365 The @code{if-exists-else} spec function is similar to the @code{if-exists}
8366 spec function, except that it takes two arguments.  The first argument is
8367 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
8368 returns the pathname.  If it does not exist, it returns the second argument.
8369 This way, @code{if-exists-else} can be used to select one file or another,
8370 based on the existence of the first.  Here is a small example of its usage:
8371
8372 @smallexample
8373 *startfile:
8374 crt0%O%s %:if-exists(crti%O%s) \
8375 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
8376 @end smallexample
8377
8378 @item @code{replace-outfile}
8379 The @code{replace-outfile} spec function takes two arguments.  It looks for the
8380 first argument in the outfiles array and replaces it with the second argument.  Here
8381 is a small example of its usage:
8382
8383 @smallexample
8384 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
8385 @end smallexample
8386
8387 @item @code{print-asm-header}
8388 The @code{print-asm-header} function takes no arguments and simply
8389 prints a banner like:
8390
8391 @smallexample
8392 Assembler options
8393 =================
8394
8395 Use "-Wa,OPTION" to pass "OPTION" to the assembler.
8396 @end smallexample
8397
8398 It is used to separate compiler options from assembler options
8399 in the @option{--target-help} output.
8400 @end table
8401
8402 @item %@{@code{S}@}
8403 Substitutes the @code{-S} switch, if that switch was given to GCC@.
8404 If that switch was not specified, this substitutes nothing.  Note that
8405 the leading dash is omitted when specifying this option, and it is
8406 automatically inserted if the substitution is performed.  Thus the spec
8407 string @samp{%@{foo@}} would match the command-line option @option{-foo}
8408 and would output the command line option @option{-foo}.
8409
8410 @item %W@{@code{S}@}
8411 Like %@{@code{S}@} but mark last argument supplied within as a file to be
8412 deleted on failure.
8413
8414 @item %@{@code{S}*@}
8415 Substitutes all the switches specified to GCC whose names start
8416 with @code{-S}, but which also take an argument.  This is used for
8417 switches like @option{-o}, @option{-D}, @option{-I}, etc.
8418 GCC considers @option{-o foo} as being
8419 one switch whose names starts with @samp{o}.  %@{o*@} would substitute this
8420 text, including the space.  Thus two arguments would be generated.
8421
8422 @item %@{@code{S}*&@code{T}*@}
8423 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
8424 (the order of @code{S} and @code{T} in the spec is not significant).
8425 There can be any number of ampersand-separated variables; for each the
8426 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
8427
8428 @item %@{@code{S}:@code{X}@}
8429 Substitutes @code{X}, if the @samp{-S} switch was given to GCC@.
8430
8431 @item %@{!@code{S}:@code{X}@}
8432 Substitutes @code{X}, if the @samp{-S} switch was @emph{not} given to GCC@.
8433
8434 @item %@{@code{S}*:@code{X}@}
8435 Substitutes @code{X} if one or more switches whose names start with
8436 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
8437 once, no matter how many such switches appeared.  However, if @code{%*}
8438 appears somewhere in @code{X}, then @code{X} will be substituted once
8439 for each matching switch, with the @code{%*} replaced by the part of
8440 that switch that matched the @code{*}.
8441
8442 @item %@{.@code{S}:@code{X}@}
8443 Substitutes @code{X}, if processing a file with suffix @code{S}.
8444
8445 @item %@{!.@code{S}:@code{X}@}
8446 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
8447
8448 @item %@{,@code{S}:@code{X}@}
8449 Substitutes @code{X}, if processing a file for language @code{S}.
8450
8451 @item %@{!,@code{S}:@code{X}@}
8452 Substitutes @code{X}, if not processing a file for language @code{S}.
8453
8454 @item %@{@code{S}|@code{P}:@code{X}@}
8455 Substitutes @code{X} if either @code{-S} or @code{-P} was given to
8456 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
8457 @code{*} sequences as well, although they have a stronger binding than
8458 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
8459 alternatives must be starred, and only the first matching alternative
8460 is substituted.
8461
8462 For example, a spec string like this:
8463
8464 @smallexample
8465 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
8466 @end smallexample
8467
8468 will output the following command-line options from the following input
8469 command-line options:
8470
8471 @smallexample
8472 fred.c        -foo -baz
8473 jim.d         -bar -boggle
8474 -d fred.c     -foo -baz -boggle
8475 -d jim.d      -bar -baz -boggle
8476 @end smallexample
8477
8478 @item %@{S:X; T:Y; :D@}
8479
8480 If @code{S} was given to GCC, substitutes @code{X}; else if @code{T} was
8481 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
8482 be as many clauses as you need.  This may be combined with @code{.},
8483 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
8484
8485
8486 @end table
8487
8488 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
8489 construct may contain other nested @samp{%} constructs or spaces, or
8490 even newlines.  They are processed as usual, as described above.
8491 Trailing white space in @code{X} is ignored.  White space may also
8492 appear anywhere on the left side of the colon in these constructs,
8493 except between @code{.} or @code{*} and the corresponding word.
8494
8495 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
8496 handled specifically in these constructs.  If another value of
8497 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
8498 @option{-W} switch is found later in the command line, the earlier
8499 switch value is ignored, except with @{@code{S}*@} where @code{S} is
8500 just one letter, which passes all matching options.
8501
8502 The character @samp{|} at the beginning of the predicate text is used to
8503 indicate that a command should be piped to the following command, but
8504 only if @option{-pipe} is specified.
8505
8506 It is built into GCC which switches take arguments and which do not.
8507 (You might think it would be useful to generalize this to allow each
8508 compiler's spec to say which switches take arguments.  But this cannot
8509 be done in a consistent fashion.  GCC cannot even decide which input
8510 files have been specified without knowing which switches take arguments,
8511 and it must know which input files to compile in order to tell which
8512 compilers to run).
8513
8514 GCC also knows implicitly that arguments starting in @option{-l} are to be
8515 treated as compiler output files, and passed to the linker in their
8516 proper position among the other output files.
8517
8518 @c man begin OPTIONS
8519
8520 @node Target Options
8521 @section Specifying Target Machine and Compiler Version
8522 @cindex target options
8523 @cindex cross compiling
8524 @cindex specifying machine version
8525 @cindex specifying compiler version and target machine
8526 @cindex compiler version, specifying
8527 @cindex target machine, specifying
8528
8529 The usual way to run GCC is to run the executable called @file{gcc}, or
8530 @file{<machine>-gcc} when cross-compiling, or
8531 @file{<machine>-gcc-<version>} to run a version other than the one that
8532 was installed last.  Sometimes this is inconvenient, so GCC provides
8533 options that will switch to another cross-compiler or version.
8534
8535 @table @gcctabopt
8536 @item -b @var{machine}
8537 @opindex b
8538 The argument @var{machine} specifies the target machine for compilation.
8539
8540 The value to use for @var{machine} is the same as was specified as the
8541 machine type when configuring GCC as a cross-compiler.  For
8542 example, if a cross-compiler was configured with @samp{configure
8543 arm-elf}, meaning to compile for an arm processor with elf binaries,
8544 then you would specify @option{-b arm-elf} to run that cross compiler.
8545 Because there are other options beginning with @option{-b}, the
8546 configuration must contain a hyphen.
8547
8548 @item -V @var{version}
8549 @opindex V
8550 The argument @var{version} specifies which version of GCC to run.
8551 This is useful when multiple versions are installed.  For example,
8552 @var{version} might be @samp{4.0}, meaning to run GCC version 4.0.
8553 @end table
8554
8555 The @option{-V} and @option{-b} options work by running the
8556 @file{<machine>-gcc-<version>} executable, so there's no real reason to
8557 use them if you can just run that directly.
8558
8559 @node Submodel Options
8560 @section Hardware Models and Configurations
8561 @cindex submodel options
8562 @cindex specifying hardware config
8563 @cindex hardware models and configurations, specifying
8564 @cindex machine dependent options
8565
8566 Earlier we discussed the standard option @option{-b} which chooses among
8567 different installed compilers for completely different target
8568 machines, such as VAX vs.@: 68000 vs.@: 80386.
8569
8570 In addition, each of these target machine types can have its own
8571 special options, starting with @samp{-m}, to choose among various
8572 hardware models or configurations---for example, 68010 vs 68020,
8573 floating coprocessor or none.  A single installed version of the
8574 compiler can compile for any model or configuration, according to the
8575 options specified.
8576
8577 Some configurations of the compiler also support additional special
8578 options, usually for compatibility with other compilers on the same
8579 platform.
8580
8581 @c This list is ordered alphanumerically by subsection name.
8582 @c It should be the same order and spelling as these options are listed
8583 @c in Machine Dependent Options
8584
8585 @menu
8586 * ARC Options::
8587 * ARM Options::
8588 * AVR Options::
8589 * Blackfin Options::
8590 * CRIS Options::
8591 * CRX Options::
8592 * Darwin Options::
8593 * DEC Alpha Options::
8594 * DEC Alpha/VMS Options::
8595 * FRV Options::
8596 * GNU/Linux Options::
8597 * H8/300 Options::
8598 * HPPA Options::
8599 * i386 and x86-64 Options::
8600 * IA-64 Options::
8601 * M32C Options::
8602 * M32R/D Options::
8603 * M680x0 Options::
8604 * M68hc1x Options::
8605 * MCore Options::
8606 * MIPS Options::
8607 * MMIX Options::
8608 * MN10300 Options::
8609 * PDP-11 Options::
8610 * picoChip Options::
8611 * PowerPC Options::
8612 * RS/6000 and PowerPC Options::
8613 * S/390 and zSeries Options::
8614 * Score Options::
8615 * SH Options::
8616 * SPARC Options::
8617 * SPU Options::
8618 * System V Options::
8619 * V850 Options::
8620 * VAX Options::
8621 * VxWorks Options::
8622 * x86-64 Options::
8623 * Xstormy16 Options::
8624 * Xtensa Options::
8625 * zSeries Options::
8626 @end menu
8627
8628 @node ARC Options
8629 @subsection ARC Options
8630 @cindex ARC Options
8631
8632 These options are defined for ARC implementations:
8633
8634 @table @gcctabopt
8635 @item -EL
8636 @opindex EL
8637 Compile code for little endian mode.  This is the default.
8638
8639 @item -EB
8640 @opindex EB
8641 Compile code for big endian mode.
8642
8643 @item -mmangle-cpu
8644 @opindex mmangle-cpu
8645 Prepend the name of the cpu to all public symbol names.
8646 In multiple-processor systems, there are many ARC variants with different
8647 instruction and register set characteristics.  This flag prevents code
8648 compiled for one cpu to be linked with code compiled for another.
8649 No facility exists for handling variants that are ``almost identical''.
8650 This is an all or nothing option.
8651
8652 @item -mcpu=@var{cpu}
8653 @opindex mcpu
8654 Compile code for ARC variant @var{cpu}.
8655 Which variants are supported depend on the configuration.
8656 All variants support @option{-mcpu=base}, this is the default.
8657
8658 @item -mtext=@var{text-section}
8659 @itemx -mdata=@var{data-section}
8660 @itemx -mrodata=@var{readonly-data-section}
8661 @opindex mtext
8662 @opindex mdata
8663 @opindex mrodata
8664 Put functions, data, and readonly data in @var{text-section},
8665 @var{data-section}, and @var{readonly-data-section} respectively
8666 by default.  This can be overridden with the @code{section} attribute.
8667 @xref{Variable Attributes}.
8668
8669 @end table
8670
8671 @node ARM Options
8672 @subsection ARM Options
8673 @cindex ARM options
8674
8675 These @samp{-m} options are defined for Advanced RISC Machines (ARM)
8676 architectures:
8677
8678 @table @gcctabopt
8679 @item -mabi=@var{name}
8680 @opindex mabi
8681 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
8682 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
8683
8684 @item -mapcs-frame
8685 @opindex mapcs-frame
8686 Generate a stack frame that is compliant with the ARM Procedure Call
8687 Standard for all functions, even if this is not strictly necessary for
8688 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
8689 with this option will cause the stack frames not to be generated for
8690 leaf functions.  The default is @option{-mno-apcs-frame}.
8691
8692 @item -mapcs
8693 @opindex mapcs
8694 This is a synonym for @option{-mapcs-frame}.
8695
8696 @ignore
8697 @c not currently implemented
8698 @item -mapcs-stack-check
8699 @opindex mapcs-stack-check
8700 Generate code to check the amount of stack space available upon entry to
8701 every function (that actually uses some stack space).  If there is
8702 insufficient space available then either the function
8703 @samp{__rt_stkovf_split_small} or @samp{__rt_stkovf_split_big} will be
8704 called, depending upon the amount of stack space required.  The run time
8705 system is required to provide these functions.  The default is
8706 @option{-mno-apcs-stack-check}, since this produces smaller code.
8707
8708 @c not currently implemented
8709 @item -mapcs-float
8710 @opindex mapcs-float
8711 Pass floating point arguments using the float point registers.  This is
8712 one of the variants of the APCS@.  This option is recommended if the
8713 target hardware has a floating point unit or if a lot of floating point
8714 arithmetic is going to be performed by the code.  The default is
8715 @option{-mno-apcs-float}, since integer only code is slightly increased in
8716 size if @option{-mapcs-float} is used.
8717
8718 @c not currently implemented
8719 @item -mapcs-reentrant
8720 @opindex mapcs-reentrant
8721 Generate reentrant, position independent code.  The default is
8722 @option{-mno-apcs-reentrant}.
8723 @end ignore
8724
8725 @item -mthumb-interwork
8726 @opindex mthumb-interwork
8727 Generate code which supports calling between the ARM and Thumb
8728 instruction sets.  Without this option the two instruction sets cannot
8729 be reliably used inside one program.  The default is
8730 @option{-mno-thumb-interwork}, since slightly larger code is generated
8731 when @option{-mthumb-interwork} is specified.
8732
8733 @item -mno-sched-prolog
8734 @opindex mno-sched-prolog
8735 Prevent the reordering of instructions in the function prolog, or the
8736 merging of those instruction with the instructions in the function's
8737 body.  This means that all functions will start with a recognizable set
8738 of instructions (or in fact one of a choice from a small set of
8739 different function prologues), and this information can be used to
8740 locate the start if functions inside an executable piece of code.  The
8741 default is @option{-msched-prolog}.
8742
8743 @item -mhard-float
8744 @opindex mhard-float
8745 Generate output containing floating point instructions.  This is the
8746 default.
8747
8748 @item -msoft-float
8749 @opindex msoft-float
8750 Generate output containing library calls for floating point.
8751 @strong{Warning:} the requisite libraries are not available for all ARM
8752 targets.  Normally the facilities of the machine's usual C compiler are
8753 used, but this cannot be done directly in cross-compilation.  You must make
8754 your own arrangements to provide suitable library functions for
8755 cross-compilation.
8756
8757 @option{-msoft-float} changes the calling convention in the output file;
8758 therefore, it is only useful if you compile @emph{all} of a program with
8759 this option.  In particular, you need to compile @file{libgcc.a}, the
8760 library that comes with GCC, with @option{-msoft-float} in order for
8761 this to work.
8762
8763 @item -mfloat-abi=@var{name}
8764 @opindex mfloat-abi
8765 Specifies which ABI to use for floating point values.  Permissible values
8766 are: @samp{soft}, @samp{softfp} and @samp{hard}.
8767
8768 @samp{soft} and @samp{hard} are equivalent to @option{-msoft-float}
8769 and @option{-mhard-float} respectively.  @samp{softfp} allows the generation
8770 of floating point instructions, but still uses the soft-float calling
8771 conventions.
8772
8773 @item -mlittle-endian
8774 @opindex mlittle-endian
8775 Generate code for a processor running in little-endian mode.  This is
8776 the default for all standard configurations.
8777
8778 @item -mbig-endian
8779 @opindex mbig-endian
8780 Generate code for a processor running in big-endian mode; the default is
8781 to compile code for a little-endian processor.
8782
8783 @item -mwords-little-endian
8784 @opindex mwords-little-endian
8785 This option only applies when generating code for big-endian processors.
8786 Generate code for a little-endian word order but a big-endian byte
8787 order.  That is, a byte order of the form @samp{32107654}.  Note: this
8788 option should only be used if you require compatibility with code for
8789 big-endian ARM processors generated by versions of the compiler prior to
8790 2.8.
8791
8792 @item -mcpu=@var{name}
8793 @opindex mcpu
8794 This specifies the name of the target ARM processor.  GCC uses this name
8795 to determine what kind of instructions it can emit when generating
8796 assembly code.  Permissible names are: @samp{arm2}, @samp{arm250},
8797 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
8798 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
8799 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
8800 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
8801 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
8802 @samp{arm8}, @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
8803 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
8804 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
8805 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
8806 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
8807 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
8808 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
8809 @samp{arm1156t2-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
8810 @samp{cortex-a8}, @samp{cortex-r4}, @samp{cortex-r4f}, @samp{cortex-m3},
8811 @samp{cortex-m1},
8812 @samp{xscale}, @samp{iwmmxt}, @samp{ep9312}.
8813
8814 @item -mtune=@var{name}
8815 @opindex mtune
8816 This option is very similar to the @option{-mcpu=} option, except that
8817 instead of specifying the actual target processor type, and hence
8818 restricting which instructions can be used, it specifies that GCC should
8819 tune the performance of the code as if the target were of the type
8820 specified in this option, but still choosing the instructions that it
8821 will generate based on the cpu specified by a @option{-mcpu=} option.
8822 For some ARM implementations better performance can be obtained by using
8823 this option.
8824
8825 @item -march=@var{name}
8826 @opindex march
8827 This specifies the name of the target ARM architecture.  GCC uses this
8828 name to determine what kind of instructions it can emit when generating
8829 assembly code.  This option can be used in conjunction with or instead
8830 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
8831 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
8832 @samp{armv5}, @samp{armv5t}, @samp{armv5te}, @samp{armv6}, @samp{armv6j},
8833 @samp{armv6t2}, @samp{armv6z}, @samp{armv6zk}, @samp{armv6-m},
8834 @samp{armv7}, @samp{armv7-a}, @samp{armv7-r}, @samp{armv7-m},
8835 @samp{iwmmxt}, @samp{ep9312}.
8836
8837 @item -mfpu=@var{name}
8838 @itemx -mfpe=@var{number}
8839 @itemx -mfp=@var{number}
8840 @opindex mfpu
8841 @opindex mfpe
8842 @opindex mfp
8843 This specifies what floating point hardware (or hardware emulation) is
8844 available on the target.  Permissible names are: @samp{fpa}, @samp{fpe2},
8845 @samp{fpe3}, @samp{maverick}, @samp{vfp}, @samp{vfpv3}, @samp{vfpv3-d16} and
8846 @samp{neon}.  @option{-mfp} and @option{-mfpe}
8847 are synonyms for @option{-mfpu}=@samp{fpe}@var{number}, for compatibility
8848 with older versions of GCC@.
8849
8850 If @option{-msoft-float} is specified this specifies the format of
8851 floating point values.
8852
8853 @item -mstructure-size-boundary=@var{n}
8854 @opindex mstructure-size-boundary
8855 The size of all structures and unions will be rounded up to a multiple
8856 of the number of bits set by this option.  Permissible values are 8, 32
8857 and 64.  The default value varies for different toolchains.  For the COFF
8858 targeted toolchain the default value is 8.  A value of 64 is only allowed
8859 if the underlying ABI supports it.
8860
8861 Specifying the larger number can produce faster, more efficient code, but
8862 can also increase the size of the program.  Different values are potentially
8863 incompatible.  Code compiled with one value cannot necessarily expect to
8864 work with code or libraries compiled with another value, if they exchange
8865 information using structures or unions.
8866
8867 @item -mabort-on-noreturn
8868 @opindex mabort-on-noreturn
8869 Generate a call to the function @code{abort} at the end of a
8870 @code{noreturn} function.  It will be executed if the function tries to
8871 return.
8872
8873 @item -mlong-calls
8874 @itemx -mno-long-calls
8875 @opindex mlong-calls
8876 @opindex mno-long-calls
8877 Tells the compiler to perform function calls by first loading the
8878 address of the function into a register and then performing a subroutine
8879 call on this register.  This switch is needed if the target function
8880 will lie outside of the 64 megabyte addressing range of the offset based
8881 version of subroutine call instruction.
8882
8883 Even if this switch is enabled, not all function calls will be turned
8884 into long calls.  The heuristic is that static functions, functions
8885 which have the @samp{short-call} attribute, functions that are inside
8886 the scope of a @samp{#pragma no_long_calls} directive and functions whose
8887 definitions have already been compiled within the current compilation
8888 unit, will not be turned into long calls.  The exception to this rule is
8889 that weak function definitions, functions with the @samp{long-call}
8890 attribute or the @samp{section} attribute, and functions that are within
8891 the scope of a @samp{#pragma long_calls} directive, will always be
8892 turned into long calls.
8893
8894 This feature is not enabled by default.  Specifying
8895 @option{-mno-long-calls} will restore the default behavior, as will
8896 placing the function calls within the scope of a @samp{#pragma
8897 long_calls_off} directive.  Note these switches have no effect on how
8898 the compiler generates code to handle function calls via function
8899 pointers.
8900
8901 @item -mnop-fun-dllimport
8902 @opindex mnop-fun-dllimport
8903 Disable support for the @code{dllimport} attribute.
8904
8905 @item -msingle-pic-base
8906 @opindex msingle-pic-base
8907 Treat the register used for PIC addressing as read-only, rather than
8908 loading it in the prologue for each function.  The run-time system is
8909 responsible for initializing this register with an appropriate value
8910 before execution begins.
8911
8912 @item -mpic-register=@var{reg}
8913 @opindex mpic-register
8914 Specify the register to be used for PIC addressing.  The default is R10
8915 unless stack-checking is enabled, when R9 is used.
8916
8917 @item -mcirrus-fix-invalid-insns
8918 @opindex mcirrus-fix-invalid-insns
8919 @opindex mno-cirrus-fix-invalid-insns
8920 Insert NOPs into the instruction stream to in order to work around
8921 problems with invalid Maverick instruction combinations.  This option
8922 is only valid if the @option{-mcpu=ep9312} option has been used to
8923 enable generation of instructions for the Cirrus Maverick floating
8924 point co-processor.  This option is not enabled by default, since the
8925 problem is only present in older Maverick implementations.  The default
8926 can be re-enabled by use of the @option{-mno-cirrus-fix-invalid-insns}
8927 switch.
8928
8929 @item -mpoke-function-name
8930 @opindex mpoke-function-name
8931 Write the name of each function into the text section, directly
8932 preceding the function prologue.  The generated code is similar to this:
8933
8934 @smallexample
8935      t0
8936          .ascii "arm_poke_function_name", 0
8937          .align
8938      t1
8939          .word 0xff000000 + (t1 - t0)
8940      arm_poke_function_name
8941          mov     ip, sp
8942          stmfd   sp!, @{fp, ip, lr, pc@}
8943          sub     fp, ip, #4
8944 @end smallexample
8945
8946 When performing a stack backtrace, code can inspect the value of
8947 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
8948 location @code{pc - 12} and the top 8 bits are set, then we know that
8949 there is a function name embedded immediately preceding this location
8950 and has length @code{((pc[-3]) & 0xff000000)}.
8951
8952 @item -mthumb
8953 @opindex mthumb
8954 Generate code for the Thumb instruction set.  The default is to
8955 use the 32-bit ARM instruction set.
8956 This option automatically enables either 16-bit Thumb-1 or
8957 mixed 16/32-bit Thumb-2 instructions based on the @option{-mcpu=@var{name}}
8958 and @option{-march=@var{name}} options.
8959
8960 @item -mtpcs-frame
8961 @opindex mtpcs-frame
8962 Generate a stack frame that is compliant with the Thumb Procedure Call
8963 Standard for all non-leaf functions.  (A leaf function is one that does
8964 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
8965
8966 @item -mtpcs-leaf-frame
8967 @opindex mtpcs-leaf-frame
8968 Generate a stack frame that is compliant with the Thumb Procedure Call
8969 Standard for all leaf functions.  (A leaf function is one that does
8970 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
8971
8972 @item -mcallee-super-interworking
8973 @opindex mcallee-super-interworking
8974 Gives all externally visible functions in the file being compiled an ARM
8975 instruction set header which switches to Thumb mode before executing the
8976 rest of the function.  This allows these functions to be called from
8977 non-interworking code.
8978
8979 @item -mcaller-super-interworking
8980 @opindex mcaller-super-interworking
8981 Allows calls via function pointers (including virtual functions) to
8982 execute correctly regardless of whether the target code has been
8983 compiled for interworking or not.  There is a small overhead in the cost
8984 of executing a function pointer if this option is enabled.
8985
8986 @item -mtp=@var{name}
8987 @opindex mtp
8988 Specify the access model for the thread local storage pointer.  The valid
8989 models are @option{soft}, which generates calls to @code{__aeabi_read_tp},
8990 @option{cp15}, which fetches the thread pointer from @code{cp15} directly
8991 (supported in the arm6k architecture), and @option{auto}, which uses the
8992 best available method for the selected processor.  The default setting is
8993 @option{auto}.
8994
8995 @item -mword-relocations
8996 @opindex mword-relocations
8997 Only generate absolute relocations on word sized values (i.e. R_ARM_ABS32).
8998 This is enabled by default on targets (uClinux, SymbianOS) where the runtime
8999 loader imposes this restriction, and when @option{-fpic} or @option{-fPIC}
9000 is speficied.
9001
9002 @end table
9003
9004 @node AVR Options
9005 @subsection AVR Options
9006 @cindex AVR Options
9007
9008 These options are defined for AVR implementations:
9009
9010 @table @gcctabopt
9011 @item -mmcu=@var{mcu}
9012 @opindex mmcu
9013 Specify ATMEL AVR instruction set or MCU type.
9014
9015 Instruction set avr1 is for the minimal AVR core, not supported by the C
9016 compiler, only for assembler programs (MCU types: at90s1200, attiny10,
9017 attiny11, attiny12, attiny15, attiny28).
9018
9019 Instruction set avr2 (default) is for the classic AVR core with up to
9020 8K program memory space (MCU types: at90s2313, at90s2323, attiny22,
9021 at90s2333, at90s2343, at90s4414, at90s4433, at90s4434, at90s8515,
9022 at90c8534, at90s8535).
9023
9024 Instruction set avr3 is for the classic AVR core with up to 128K program
9025 memory space (MCU types: atmega103, atmega603, at43usb320, at76c711).
9026
9027 Instruction set avr4 is for the enhanced AVR core with up to 8K program
9028 memory space (MCU types: atmega8, atmega83, atmega85).
9029
9030 Instruction set avr5 is for the enhanced AVR core with up to 128K program
9031 memory space (MCU types: atmega16, atmega161, atmega163, atmega32, atmega323,
9032 atmega64, atmega128, at43usb355, at94k).
9033
9034 @item -msize
9035 @opindex msize
9036 Output instruction sizes to the asm file.
9037
9038 @item -minit-stack=@var{N}
9039 @opindex minit-stack
9040 Specify the initial stack address, which may be a symbol or numeric value,
9041 @samp{__stack} is the default.
9042
9043 @item -mno-interrupts
9044 @opindex mno-interrupts
9045 Generated code is not compatible with hardware interrupts.
9046 Code size will be smaller.
9047
9048 @item -mcall-prologues
9049 @opindex mcall-prologues
9050 Functions prologues/epilogues expanded as call to appropriate
9051 subroutines.  Code size will be smaller.
9052
9053 @item -mno-tablejump
9054 @opindex mno-tablejump
9055 Do not generate tablejump insns which sometimes increase code size.
9056
9057 @item -mtiny-stack
9058 @opindex mtiny-stack
9059 Change only the low 8 bits of the stack pointer.
9060
9061 @item -mint8
9062 @opindex mint8
9063 Assume int to be 8 bit integer.  This affects the sizes of all types: A
9064 char will be 1 byte, an int will be 1 byte, an long will be 2 bytes
9065 and long long will be 4 bytes.  Please note that this option does not
9066 comply to the C standards, but it will provide you with smaller code
9067 size.
9068 @end table
9069
9070 @node Blackfin Options
9071 @subsection Blackfin Options
9072 @cindex Blackfin Options
9073
9074 @table @gcctabopt
9075 @item -mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]}
9076 @opindex mcpu=
9077 Specifies the name of the target Blackfin processor.  Currently, @var{cpu}
9078 can be one of @samp{bf522}, @samp{bf523}, @samp{bf524},
9079 @samp{bf525}, @samp{bf526}, @samp{bf527},
9080 @samp{bf531}, @samp{bf532}, @samp{bf533}, @samp{bf534},
9081 @samp{bf536}, @samp{bf537}, @samp{bf538}, @samp{bf539},
9082 @samp{bf542}, @samp{bf544}, @samp{bf547}, @samp{bf548}, @samp{bf549},
9083 @samp{bf561}.
9084 The optional @var{sirevision} specifies the silicon revision of the target
9085 Blackfin processor.  Any workarounds available for the targeted silicon revision
9086 will be enabled.  If @var{sirevision} is @samp{none}, no workarounds are enabled.
9087 If @var{sirevision} is @samp{any}, all workarounds for the targeted processor
9088 will be enabled.  The @code{__SILICON_REVISION__} macro is defined to two
9089 hexadecimal digits representing the major and minor numbers in the silicon
9090 revision.  If @var{sirevision} is @samp{none}, the @code{__SILICON_REVISION__}
9091 is not defined.  If @var{sirevision} is @samp{any}, the
9092 @code{__SILICON_REVISION__} is defined to be @code{0xffff}.
9093 If this optional @var{sirevision} is not used, GCC assumes the latest known
9094 silicon revision of the targeted Blackfin processor.
9095
9096 Support for @samp{bf561} is incomplete.  For @samp{bf561},
9097 Only the processor macro is defined.
9098 Without this option, @samp{bf532} is used as the processor by default.
9099 The corresponding predefined processor macros for @var{cpu} is to
9100 be defined.  And for @samp{bfin-elf} toolchain, this causes the hardware BSP
9101 provided by libgloss to be linked in if @option{-msim} is not given.
9102
9103 @item -msim
9104 @opindex msim
9105 Specifies that the program will be run on the simulator.  This causes
9106 the simulator BSP provided by libgloss to be linked in.  This option
9107 has effect only for @samp{bfin-elf} toolchain.
9108 Certain other options, such as @option{-mid-shared-library} and
9109 @option{-mfdpic}, imply @option{-msim}.
9110
9111 @item -momit-leaf-frame-pointer
9112 @opindex momit-leaf-frame-pointer
9113 Don't keep the frame pointer in a register for leaf functions.  This
9114 avoids the instructions to save, set up and restore frame pointers and
9115 makes an extra register available in leaf functions.  The option
9116 @option{-fomit-frame-pointer} removes the frame pointer for all functions
9117 which might make debugging harder.
9118
9119 @item -mspecld-anomaly
9120 @opindex mspecld-anomaly
9121 When enabled, the compiler will ensure that the generated code does not
9122 contain speculative loads after jump instructions. If this option is used,
9123 @code{__WORKAROUND_SPECULATIVE_LOADS} is defined.
9124
9125 @item -mno-specld-anomaly
9126 @opindex mno-specld-anomaly
9127 Don't generate extra code to prevent speculative loads from occurring.
9128
9129 @item -mcsync-anomaly
9130 @opindex mcsync-anomaly
9131 When enabled, the compiler will ensure that the generated code does not
9132 contain CSYNC or SSYNC instructions too soon after conditional branches.
9133 If this option is used, @code{__WORKAROUND_SPECULATIVE_SYNCS} is defined.
9134
9135 @item -mno-csync-anomaly
9136 @opindex mno-csync-anomaly
9137 Don't generate extra code to prevent CSYNC or SSYNC instructions from
9138 occurring too soon after a conditional branch.
9139
9140 @item -mlow-64k
9141 @opindex mlow-64k
9142 When enabled, the compiler is free to take advantage of the knowledge that
9143 the entire program fits into the low 64k of memory.
9144
9145 @item -mno-low-64k
9146 @opindex mno-low-64k
9147 Assume that the program is arbitrarily large.  This is the default.
9148
9149 @item -mstack-check-l1
9150 @opindex mstack-check-l1
9151 Do stack checking using information placed into L1 scratchpad memory by the
9152 uClinux kernel.
9153
9154 @item -mid-shared-library
9155 @opindex mid-shared-library
9156 Generate code that supports shared libraries via the library ID method.
9157 This allows for execute in place and shared libraries in an environment
9158 without virtual memory management.  This option implies @option{-fPIC}.
9159 With a @samp{bfin-elf} target, this option implies @option{-msim}.
9160
9161 @item -mno-id-shared-library
9162 @opindex mno-id-shared-library
9163 Generate code that doesn't assume ID based shared libraries are being used.
9164 This is the default.
9165
9166 @item -mleaf-id-shared-library
9167 @opindex mleaf-id-shared-library
9168 Generate code that supports shared libraries via the library ID method,
9169 but assumes that this library or executable won't link against any other
9170 ID shared libraries.  That allows the compiler to use faster code for jumps
9171 and calls.
9172
9173 @item -mno-leaf-id-shared-library
9174 @opindex mno-leaf-id-shared-library
9175 Do not assume that the code being compiled won't link against any ID shared
9176 libraries.  Slower code will be generated for jump and call insns.
9177
9178 @item -mshared-library-id=n
9179 @opindex mshared-library-id
9180 Specified the identification number of the ID based shared library being
9181 compiled.  Specifying a value of 0 will generate more compact code, specifying
9182 other values will force the allocation of that number to the current
9183 library but is no more space or time efficient than omitting this option.
9184
9185 @item -msep-data
9186 @opindex msep-data
9187 Generate code that allows the data segment to be located in a different
9188 area of memory from the text segment.  This allows for execute in place in
9189 an environment without virtual memory management by eliminating relocations
9190 against the text section.
9191
9192 @item -mno-sep-data
9193 @opindex mno-sep-data
9194 Generate code that assumes that the data segment follows the text segment.
9195 This is the default.
9196
9197 @item -mlong-calls
9198 @itemx -mno-long-calls
9199 @opindex mlong-calls
9200 @opindex mno-long-calls
9201 Tells the compiler to perform function calls by first loading the
9202 address of the function into a register and then performing a subroutine
9203 call on this register.  This switch is needed if the target function
9204 will lie outside of the 24 bit addressing range of the offset based
9205 version of subroutine call instruction.
9206
9207 This feature is not enabled by default.  Specifying
9208 @option{-mno-long-calls} will restore the default behavior.  Note these
9209 switches have no effect on how the compiler generates code to handle
9210 function calls via function pointers.
9211
9212 @item -mfast-fp
9213 @opindex mfast-fp
9214 Link with the fast floating-point library. This library relaxes some of
9215 the IEEE floating-point standard's rules for checking inputs against
9216 Not-a-Number (NAN), in the interest of performance.
9217
9218 @item -minline-plt
9219 @opindex minline-plt
9220 Enable inlining of PLT entries in function calls to functions that are
9221 not known to bind locally.  It has no effect without @option{-mfdpic}.
9222
9223 @item -mmulticore
9224 @opindex mmulticore
9225 Build standalone application for multicore Blackfin processor. Proper
9226 start files and link scripts will be used to support multicore.
9227 This option defines @code{__BFIN_MULTICORE}. It can only be used with
9228 @option{-mcpu=bf561@r{[}-@var{sirevision}@r{]}}. It can be used with
9229 @option{-mcorea} or @option{-mcoreb}. If it's used without
9230 @option{-mcorea} or @option{-mcoreb}, single application/dual core
9231 programming model is used. In this model, the main function of Core B
9232 should be named as coreb_main. If it's used with @option{-mcorea} or
9233 @option{-mcoreb}, one application per core programming model is used.
9234 If this option is not used, single core application programming
9235 model is used.
9236
9237 @item -mcorea
9238 @opindex mcorea
9239 Build standalone application for Core A of BF561 when using
9240 one application per core programming model. Proper start files
9241 and link scripts will be used to support Core A. This option
9242 defines @code{__BFIN_COREA}. It must be used with @option{-mmulticore}.
9243
9244 @item -mcoreb
9245 @opindex mcoreb
9246 Build standalone application for Core B of BF561 when using
9247 one application per core programming model. Proper start files
9248 and link scripts will be used to support Core B. This option
9249 defines @code{__BFIN_COREB}. When this option is used, coreb_main
9250 should be used instead of main. It must be used with
9251 @option{-mmulticore}. 
9252
9253 @item -msdram
9254 @opindex msdram
9255 Build standalone application for SDRAM. Proper start files and
9256 link scripts will be used to put the application into SDRAM.
9257 Loader should initialize SDRAM before loading the application
9258 into SDRAM. This option defines @code{__BFIN_SDRAM}.
9259 @end table
9260
9261 @node CRIS Options
9262 @subsection CRIS Options
9263 @cindex CRIS Options
9264
9265 These options are defined specifically for the CRIS ports.
9266
9267 @table @gcctabopt
9268 @item -march=@var{architecture-type}
9269 @itemx -mcpu=@var{architecture-type}
9270 @opindex march
9271 @opindex mcpu
9272 Generate code for the specified architecture.  The choices for
9273 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
9274 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
9275 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
9276 @samp{v10}.
9277
9278 @item -mtune=@var{architecture-type}
9279 @opindex mtune
9280 Tune to @var{architecture-type} everything applicable about the generated
9281 code, except for the ABI and the set of available instructions.  The
9282 choices for @var{architecture-type} are the same as for
9283 @option{-march=@var{architecture-type}}.
9284
9285 @item -mmax-stack-frame=@var{n}
9286 @opindex mmax-stack-frame
9287 Warn when the stack frame of a function exceeds @var{n} bytes.
9288
9289 @item -metrax4
9290 @itemx -metrax100
9291 @opindex metrax4
9292 @opindex metrax100
9293 The options @option{-metrax4} and @option{-metrax100} are synonyms for
9294 @option{-march=v3} and @option{-march=v8} respectively.
9295
9296 @item -mmul-bug-workaround
9297 @itemx -mno-mul-bug-workaround
9298 @opindex mmul-bug-workaround
9299 @opindex mno-mul-bug-workaround
9300 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
9301 models where it applies.  This option is active by default.
9302
9303 @item -mpdebug
9304 @opindex mpdebug
9305 Enable CRIS-specific verbose debug-related information in the assembly
9306 code.  This option also has the effect to turn off the @samp{#NO_APP}
9307 formatted-code indicator to the assembler at the beginning of the
9308 assembly file.
9309
9310 @item -mcc-init
9311 @opindex mcc-init
9312 Do not use condition-code results from previous instruction; always emit
9313 compare and test instructions before use of condition codes.
9314
9315 @item -mno-side-effects
9316 @opindex mno-side-effects
9317 Do not emit instructions with side-effects in addressing modes other than
9318 post-increment.
9319
9320 @item -mstack-align
9321 @itemx -mno-stack-align
9322 @itemx -mdata-align
9323 @itemx -mno-data-align
9324 @itemx -mconst-align
9325 @itemx -mno-const-align
9326 @opindex mstack-align
9327 @opindex mno-stack-align
9328 @opindex mdata-align
9329 @opindex mno-data-align
9330 @opindex mconst-align
9331 @opindex mno-const-align
9332 These options (no-options) arranges (eliminate arrangements) for the
9333 stack-frame, individual data and constants to be aligned for the maximum
9334 single data access size for the chosen CPU model.  The default is to
9335 arrange for 32-bit alignment.  ABI details such as structure layout are
9336 not affected by these options.
9337
9338 @item -m32-bit
9339 @itemx -m16-bit
9340 @itemx -m8-bit
9341 @opindex m32-bit
9342 @opindex m16-bit
9343 @opindex m8-bit
9344 Similar to the stack- data- and const-align options above, these options
9345 arrange for stack-frame, writable data and constants to all be 32-bit,
9346 16-bit or 8-bit aligned.  The default is 32-bit alignment.
9347
9348 @item -mno-prologue-epilogue
9349 @itemx -mprologue-epilogue
9350 @opindex mno-prologue-epilogue
9351 @opindex mprologue-epilogue
9352 With @option{-mno-prologue-epilogue}, the normal function prologue and
9353 epilogue that sets up the stack-frame are omitted and no return
9354 instructions or return sequences are generated in the code.  Use this
9355 option only together with visual inspection of the compiled code: no
9356 warnings or errors are generated when call-saved registers must be saved,
9357 or storage for local variable needs to be allocated.
9358
9359 @item -mno-gotplt
9360 @itemx -mgotplt
9361 @opindex mno-gotplt
9362 @opindex mgotplt
9363 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
9364 instruction sequences that load addresses for functions from the PLT part
9365 of the GOT rather than (traditional on other architectures) calls to the
9366 PLT@.  The default is @option{-mgotplt}.
9367
9368 @item -melf
9369 @opindex melf
9370 Legacy no-op option only recognized with the cris-axis-elf and
9371 cris-axis-linux-gnu targets.
9372
9373 @item -mlinux
9374 @opindex mlinux
9375 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
9376
9377 @item -sim
9378 @opindex sim
9379 This option, recognized for the cris-axis-elf arranges
9380 to link with input-output functions from a simulator library.  Code,
9381 initialized data and zero-initialized data are allocated consecutively.
9382
9383 @item -sim2
9384 @opindex sim2
9385 Like @option{-sim}, but pass linker options to locate initialized data at
9386 0x40000000 and zero-initialized data at 0x80000000.
9387 @end table
9388
9389 @node CRX Options
9390 @subsection CRX Options
9391 @cindex CRX Options
9392
9393 These options are defined specifically for the CRX ports.
9394
9395 @table @gcctabopt
9396
9397 @item -mmac
9398 @opindex mmac
9399 Enable the use of multiply-accumulate instructions. Disabled by default.
9400
9401 @item -mpush-args
9402 @opindex mpush-args
9403 Push instructions will be used to pass outgoing arguments when functions
9404 are called. Enabled by default.
9405 @end table
9406
9407 @node Darwin Options
9408 @subsection Darwin Options
9409 @cindex Darwin options
9410
9411 These options are defined for all architectures running the Darwin operating
9412 system.
9413
9414 FSF GCC on Darwin does not create ``fat'' object files; it will create
9415 an object file for the single architecture that it was built to
9416 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
9417 @option{-arch} options are used; it does so by running the compiler or
9418 linker multiple times and joining the results together with
9419 @file{lipo}.
9420
9421 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
9422 @samp{i686}) is determined by the flags that specify the ISA
9423 that GCC is targetting, like @option{-mcpu} or @option{-march}.  The
9424 @option{-force_cpusubtype_ALL} option can be used to override this.
9425
9426 The Darwin tools vary in their behavior when presented with an ISA
9427 mismatch.  The assembler, @file{as}, will only permit instructions to
9428 be used that are valid for the subtype of the file it is generating,
9429 so you cannot put 64-bit instructions in an @samp{ppc750} object file.
9430 The linker for shared libraries, @file{/usr/bin/libtool}, will fail
9431 and print an error if asked to create a shared library with a less
9432 restrictive subtype than its input files (for instance, trying to put
9433 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
9434 for executables, @file{ld}, will quietly give the executable the most
9435 restrictive subtype of any of its input files.
9436
9437 @table @gcctabopt
9438 @item -F@var{dir}
9439 @opindex F
9440 Add the framework directory @var{dir} to the head of the list of
9441 directories to be searched for header files.  These directories are
9442 interleaved with those specified by @option{-I} options and are
9443 scanned in a left-to-right order.
9444
9445 A framework directory is a directory with frameworks in it.  A
9446 framework is a directory with a @samp{"Headers"} and/or
9447 @samp{"PrivateHeaders"} directory contained directly in it that ends
9448 in @samp{".framework"}.  The name of a framework is the name of this
9449 directory excluding the @samp{".framework"}.  Headers associated with
9450 the framework are found in one of those two directories, with
9451 @samp{"Headers"} being searched first.  A subframework is a framework
9452 directory that is in a framework's @samp{"Frameworks"} directory.
9453 Includes of subframework headers can only appear in a header of a
9454 framework that contains the subframework, or in a sibling subframework
9455 header.  Two subframeworks are siblings if they occur in the same
9456 framework.  A subframework should not have the same name as a
9457 framework, a warning will be issued if this is violated.  Currently a
9458 subframework cannot have subframeworks, in the future, the mechanism
9459 may be extended to support this.  The standard frameworks can be found
9460 in @samp{"/System/Library/Frameworks"} and
9461 @samp{"/Library/Frameworks"}.  An example include looks like
9462 @code{#include <Framework/header.h>}, where @samp{Framework} denotes
9463 the name of the framework and header.h is found in the
9464 @samp{"PrivateHeaders"} or @samp{"Headers"} directory.
9465
9466 @item -iframework@var{dir}
9467 @opindex iframework
9468 Like @option{-F} except the directory is a treated as a system
9469 directory.  The main difference between this @option{-iframework} and
9470 @option{-F} is that with @option{-iframework} the compiler does not
9471 warn about constructs contained within header files found via
9472 @var{dir}.  This option is valid only for the C family of languages.
9473
9474 @item -gused
9475 @opindex gused
9476 Emit debugging information for symbols that are used.  For STABS
9477 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
9478 This is by default ON@.
9479
9480 @item -gfull
9481 @opindex gfull
9482 Emit debugging information for all symbols and types.
9483
9484 @item -mmacosx-version-min=@var{version}
9485 The earliest version of MacOS X that this executable will run on
9486 is @var{version}.  Typical values of @var{version} include @code{10.1},
9487 @code{10.2}, and @code{10.3.9}.
9488
9489 If the compiler was built to use the system's headers by default,
9490 then the default for this option is the system version on which the
9491 compiler is running, otherwise the default is to make choices which
9492 are compatible with as many systems and code bases as possible.
9493
9494 @item -mkernel
9495 @opindex mkernel
9496 Enable kernel development mode.  The @option{-mkernel} option sets
9497 @option{-static}, @option{-fno-common}, @option{-fno-cxa-atexit},
9498 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
9499 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
9500 applicable.  This mode also sets @option{-mno-altivec},
9501 @option{-msoft-float}, @option{-fno-builtin} and
9502 @option{-mlong-branch} for PowerPC targets.
9503
9504 @item -mone-byte-bool
9505 @opindex mone-byte-bool
9506 Override the defaults for @samp{bool} so that @samp{sizeof(bool)==1}.
9507 By default @samp{sizeof(bool)} is @samp{4} when compiling for
9508 Darwin/PowerPC and @samp{1} when compiling for Darwin/x86, so this
9509 option has no effect on x86.
9510
9511 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
9512 to generate code that is not binary compatible with code generated
9513 without that switch.  Using this switch may require recompiling all
9514 other modules in a program, including system libraries.  Use this
9515 switch to conform to a non-default data model.
9516
9517 @item -mfix-and-continue
9518 @itemx -ffix-and-continue
9519 @itemx -findirect-data
9520 @opindex mfix-and-continue
9521 @opindex ffix-and-continue
9522 @opindex findirect-data
9523 Generate code suitable for fast turn around development.  Needed to
9524 enable gdb to dynamically load @code{.o} files into already running
9525 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
9526 are provided for backwards compatibility.
9527
9528 @item -all_load
9529 @opindex all_load
9530 Loads all members of static archive libraries.
9531 See man ld(1) for more information.
9532
9533 @item -arch_errors_fatal
9534 @opindex arch_errors_fatal
9535 Cause the errors having to do with files that have the wrong architecture
9536 to be fatal.
9537
9538 @item -bind_at_load
9539 @opindex bind_at_load
9540 Causes the output file to be marked such that the dynamic linker will
9541 bind all undefined references when the file is loaded or launched.
9542
9543 @item -bundle
9544 @opindex bundle
9545 Produce a Mach-o bundle format file.
9546 See man ld(1) for more information.
9547
9548 @item -bundle_loader @var{executable}
9549 @opindex bundle_loader
9550 This option specifies the @var{executable} that will be loading the build
9551 output file being linked.  See man ld(1) for more information.
9552
9553 @item -dynamiclib
9554 @opindex dynamiclib
9555 When passed this option, GCC will produce a dynamic library instead of
9556 an executable when linking, using the Darwin @file{libtool} command.
9557
9558 @item -force_cpusubtype_ALL
9559 @opindex force_cpusubtype_ALL
9560 This causes GCC's output file to have the @var{ALL} subtype, instead of
9561 one controlled by the @option{-mcpu} or @option{-march} option.
9562
9563 @item -allowable_client  @var{client_name}
9564 @itemx -client_name
9565 @itemx -compatibility_version
9566 @itemx -current_version
9567 @itemx -dead_strip
9568 @itemx -dependency-file
9569 @itemx -dylib_file
9570 @itemx -dylinker_install_name
9571 @itemx -dynamic
9572 @itemx -exported_symbols_list
9573 @itemx -filelist
9574 @itemx -flat_namespace
9575 @itemx -force_flat_namespace
9576 @itemx -headerpad_max_install_names
9577 @itemx -image_base
9578 @itemx -init
9579 @itemx -install_name
9580 @itemx -keep_private_externs
9581 @itemx -multi_module
9582 @itemx -multiply_defined
9583 @itemx -multiply_defined_unused
9584 @itemx -noall_load
9585 @itemx -no_dead_strip_inits_and_terms
9586 @itemx -nofixprebinding
9587 @itemx -nomultidefs
9588 @itemx -noprebind
9589 @itemx -noseglinkedit
9590 @itemx -pagezero_size
9591 @itemx -prebind
9592 @itemx -prebind_all_twolevel_modules
9593 @itemx -private_bundle
9594 @itemx -read_only_relocs
9595 @itemx -sectalign
9596 @itemx -sectobjectsymbols
9597 @itemx -whyload
9598 @itemx -seg1addr
9599 @itemx -sectcreate
9600 @itemx -sectobjectsymbols
9601 @itemx -sectorder
9602 @itemx -segaddr
9603 @itemx -segs_read_only_addr
9604 @itemx -segs_read_write_addr
9605 @itemx -seg_addr_table
9606 @itemx -seg_addr_table_filename
9607 @itemx -seglinkedit
9608 @itemx -segprot
9609 @itemx -segs_read_only_addr
9610 @itemx -segs_read_write_addr
9611 @itemx -single_module
9612 @itemx -static
9613 @itemx -sub_library
9614 @itemx -sub_umbrella
9615 @itemx -twolevel_namespace
9616 @itemx -umbrella
9617 @itemx -undefined
9618 @itemx -unexported_symbols_list
9619 @itemx -weak_reference_mismatches
9620 @itemx -whatsloaded
9621 @opindex allowable_client
9622 @opindex client_name
9623 @opindex compatibility_version
9624 @opindex current_version
9625 @opindex dead_strip
9626 @opindex dependency-file
9627 @opindex dylib_file
9628 @opindex dylinker_install_name
9629 @opindex dynamic
9630 @opindex exported_symbols_list
9631 @opindex filelist
9632 @opindex flat_namespace
9633 @opindex force_flat_namespace
9634 @opindex headerpad_max_install_names
9635 @opindex image_base
9636 @opindex init
9637 @opindex install_name
9638 @opindex keep_private_externs
9639 @opindex multi_module
9640 @opindex multiply_defined
9641 @opindex multiply_defined_unused
9642 @opindex noall_load
9643 @opindex no_dead_strip_inits_and_terms
9644 @opindex nofixprebinding
9645 @opindex nomultidefs
9646 @opindex noprebind
9647 @opindex noseglinkedit
9648 @opindex pagezero_size
9649 @opindex prebind
9650 @opindex prebind_all_twolevel_modules
9651 @opindex private_bundle
9652 @opindex read_only_relocs
9653 @opindex sectalign
9654 @opindex sectobjectsymbols
9655 @opindex whyload
9656 @opindex seg1addr
9657 @opindex sectcreate
9658 @opindex sectobjectsymbols
9659 @opindex sectorder
9660 @opindex segaddr
9661 @opindex segs_read_only_addr
9662 @opindex segs_read_write_addr
9663 @opindex seg_addr_table
9664 @opindex seg_addr_table_filename
9665 @opindex seglinkedit
9666 @opindex segprot
9667 @opindex segs_read_only_addr
9668 @opindex segs_read_write_addr
9669 @opindex single_module
9670 @opindex static
9671 @opindex sub_library
9672 @opindex sub_umbrella
9673 @opindex twolevel_namespace
9674 @opindex umbrella
9675 @opindex undefined
9676 @opindex unexported_symbols_list
9677 @opindex weak_reference_mismatches
9678 @opindex whatsloaded
9679 These options are passed to the Darwin linker.  The Darwin linker man page
9680 describes them in detail.
9681 @end table
9682
9683 @node DEC Alpha Options
9684 @subsection DEC Alpha Options
9685
9686 These @samp{-m} options are defined for the DEC Alpha implementations:
9687
9688 @table @gcctabopt
9689 @item -mno-soft-float
9690 @itemx -msoft-float
9691 @opindex mno-soft-float
9692 @opindex msoft-float
9693 Use (do not use) the hardware floating-point instructions for
9694 floating-point operations.  When @option{-msoft-float} is specified,
9695 functions in @file{libgcc.a} will be used to perform floating-point
9696 operations.  Unless they are replaced by routines that emulate the
9697 floating-point operations, or compiled in such a way as to call such
9698 emulations routines, these routines will issue floating-point
9699 operations.   If you are compiling for an Alpha without floating-point
9700 operations, you must ensure that the library is built so as not to call
9701 them.
9702
9703 Note that Alpha implementations without floating-point operations are
9704 required to have floating-point registers.
9705
9706 @item -mfp-reg
9707 @itemx -mno-fp-regs
9708 @opindex mfp-reg
9709 @opindex mno-fp-regs
9710 Generate code that uses (does not use) the floating-point register set.
9711 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
9712 register set is not used, floating point operands are passed in integer
9713 registers as if they were integers and floating-point results are passed
9714 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
9715 so any function with a floating-point argument or return value called by code
9716 compiled with @option{-mno-fp-regs} must also be compiled with that
9717 option.
9718
9719 A typical use of this option is building a kernel that does not use,
9720 and hence need not save and restore, any floating-point registers.
9721
9722 @item -mieee
9723 @opindex mieee
9724 The Alpha architecture implements floating-point hardware optimized for
9725 maximum performance.  It is mostly compliant with the IEEE floating
9726 point standard.  However, for full compliance, software assistance is
9727 required.  This option generates code fully IEEE compliant code
9728 @emph{except} that the @var{inexact-flag} is not maintained (see below).
9729 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
9730 defined during compilation.  The resulting code is less efficient but is
9731 able to correctly support denormalized numbers and exceptional IEEE
9732 values such as not-a-number and plus/minus infinity.  Other Alpha
9733 compilers call this option @option{-ieee_with_no_inexact}.
9734
9735 @item -mieee-with-inexact
9736 @opindex mieee-with-inexact
9737 This is like @option{-mieee} except the generated code also maintains
9738 the IEEE @var{inexact-flag}.  Turning on this option causes the
9739 generated code to implement fully-compliant IEEE math.  In addition to
9740 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
9741 macro.  On some Alpha implementations the resulting code may execute
9742 significantly slower than the code generated by default.  Since there is
9743 very little code that depends on the @var{inexact-flag}, you should
9744 normally not specify this option.  Other Alpha compilers call this
9745 option @option{-ieee_with_inexact}.
9746
9747 @item -mfp-trap-mode=@var{trap-mode}
9748 @opindex mfp-trap-mode
9749 This option controls what floating-point related traps are enabled.
9750 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
9751 The trap mode can be set to one of four values:
9752
9753 @table @samp
9754 @item n
9755 This is the default (normal) setting.  The only traps that are enabled
9756 are the ones that cannot be disabled in software (e.g., division by zero
9757 trap).
9758
9759 @item u
9760 In addition to the traps enabled by @samp{n}, underflow traps are enabled
9761 as well.
9762
9763 @item su
9764 Like @samp{u}, but the instructions are marked to be safe for software
9765 completion (see Alpha architecture manual for details).
9766
9767 @item sui
9768 Like @samp{su}, but inexact traps are enabled as well.
9769 @end table
9770
9771 @item -mfp-rounding-mode=@var{rounding-mode}
9772 @opindex mfp-rounding-mode
9773 Selects the IEEE rounding mode.  Other Alpha compilers call this option
9774 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
9775 of:
9776
9777 @table @samp
9778 @item n
9779 Normal IEEE rounding mode.  Floating point numbers are rounded towards
9780 the nearest machine number or towards the even machine number in case
9781 of a tie.
9782
9783 @item m
9784 Round towards minus infinity.
9785
9786 @item c
9787 Chopped rounding mode.  Floating point numbers are rounded towards zero.
9788
9789 @item d
9790 Dynamic rounding mode.  A field in the floating point control register
9791 (@var{fpcr}, see Alpha architecture reference manual) controls the
9792 rounding mode in effect.  The C library initializes this register for
9793 rounding towards plus infinity.  Thus, unless your program modifies the
9794 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
9795 @end table
9796
9797 @item -mtrap-precision=@var{trap-precision}
9798 @opindex mtrap-precision
9799 In the Alpha architecture, floating point traps are imprecise.  This
9800 means without software assistance it is impossible to recover from a
9801 floating trap and program execution normally needs to be terminated.
9802 GCC can generate code that can assist operating system trap handlers
9803 in determining the exact location that caused a floating point trap.
9804 Depending on the requirements of an application, different levels of
9805 precisions can be selected:
9806
9807 @table @samp
9808 @item p
9809 Program precision.  This option is the default and means a trap handler
9810 can only identify which program caused a floating point exception.
9811
9812 @item f
9813 Function precision.  The trap handler can determine the function that
9814 caused a floating point exception.
9815
9816 @item i
9817 Instruction precision.  The trap handler can determine the exact
9818 instruction that caused a floating point exception.
9819 @end table
9820
9821 Other Alpha compilers provide the equivalent options called
9822 @option{-scope_safe} and @option{-resumption_safe}.
9823
9824 @item -mieee-conformant
9825 @opindex mieee-conformant
9826 This option marks the generated code as IEEE conformant.  You must not
9827 use this option unless you also specify @option{-mtrap-precision=i} and either
9828 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
9829 is to emit the line @samp{.eflag 48} in the function prologue of the
9830 generated assembly file.  Under DEC Unix, this has the effect that
9831 IEEE-conformant math library routines will be linked in.
9832
9833 @item -mbuild-constants
9834 @opindex mbuild-constants
9835 Normally GCC examines a 32- or 64-bit integer constant to
9836 see if it can construct it from smaller constants in two or three
9837 instructions.  If it cannot, it will output the constant as a literal and
9838 generate code to load it from the data segment at runtime.
9839
9840 Use this option to require GCC to construct @emph{all} integer constants
9841 using code, even if it takes more instructions (the maximum is six).
9842
9843 You would typically use this option to build a shared library dynamic
9844 loader.  Itself a shared library, it must relocate itself in memory
9845 before it can find the variables and constants in its own data segment.
9846
9847 @item -malpha-as
9848 @itemx -mgas
9849 @opindex malpha-as
9850 @opindex mgas
9851 Select whether to generate code to be assembled by the vendor-supplied
9852 assembler (@option{-malpha-as}) or by the GNU assembler @option{-mgas}.
9853
9854 @item -mbwx
9855 @itemx -mno-bwx
9856 @itemx -mcix
9857 @itemx -mno-cix
9858 @itemx -mfix
9859 @itemx -mno-fix
9860 @itemx -mmax
9861 @itemx -mno-max
9862 @opindex mbwx
9863 @opindex mno-bwx
9864 @opindex mcix
9865 @opindex mno-cix
9866 @opindex mfix
9867 @opindex mno-fix
9868 @opindex mmax
9869 @opindex mno-max
9870 Indicate whether GCC should generate code to use the optional BWX,
9871 CIX, FIX and MAX instruction sets.  The default is to use the instruction
9872 sets supported by the CPU type specified via @option{-mcpu=} option or that
9873 of the CPU on which GCC was built if none was specified.
9874
9875 @item -mfloat-vax
9876 @itemx -mfloat-ieee
9877 @opindex mfloat-vax
9878 @opindex mfloat-ieee
9879 Generate code that uses (does not use) VAX F and G floating point
9880 arithmetic instead of IEEE single and double precision.
9881
9882 @item -mexplicit-relocs
9883 @itemx -mno-explicit-relocs
9884 @opindex mexplicit-relocs
9885 @opindex mno-explicit-relocs
9886 Older Alpha assemblers provided no way to generate symbol relocations
9887 except via assembler macros.  Use of these macros does not allow
9888 optimal instruction scheduling.  GNU binutils as of version 2.12
9889 supports a new syntax that allows the compiler to explicitly mark
9890 which relocations should apply to which instructions.  This option
9891 is mostly useful for debugging, as GCC detects the capabilities of
9892 the assembler when it is built and sets the default accordingly.
9893
9894 @item -msmall-data
9895 @itemx -mlarge-data
9896 @opindex msmall-data
9897 @opindex mlarge-data
9898 When @option{-mexplicit-relocs} is in effect, static data is
9899 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
9900 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
9901 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
9902 16-bit relocations off of the @code{$gp} register.  This limits the
9903 size of the small data area to 64KB, but allows the variables to be
9904 directly accessed via a single instruction.
9905
9906 The default is @option{-mlarge-data}.  With this option the data area
9907 is limited to just below 2GB@.  Programs that require more than 2GB of
9908 data must use @code{malloc} or @code{mmap} to allocate the data in the
9909 heap instead of in the program's data segment.
9910
9911 When generating code for shared libraries, @option{-fpic} implies
9912 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
9913
9914 @item -msmall-text
9915 @itemx -mlarge-text
9916 @opindex msmall-text
9917 @opindex mlarge-text
9918 When @option{-msmall-text} is used, the compiler assumes that the
9919 code of the entire program (or shared library) fits in 4MB, and is
9920 thus reachable with a branch instruction.  When @option{-msmall-data}
9921 is used, the compiler can assume that all local symbols share the
9922 same @code{$gp} value, and thus reduce the number of instructions
9923 required for a function call from 4 to 1.
9924
9925 The default is @option{-mlarge-text}.
9926
9927 @item -mcpu=@var{cpu_type}
9928 @opindex mcpu
9929 Set the instruction set and instruction scheduling parameters for
9930 machine type @var{cpu_type}.  You can specify either the @samp{EV}
9931 style name or the corresponding chip number.  GCC supports scheduling
9932 parameters for the EV4, EV5 and EV6 family of processors and will
9933 choose the default values for the instruction set from the processor
9934 you specify.  If you do not specify a processor type, GCC will default
9935 to the processor on which the compiler was built.
9936
9937 Supported values for @var{cpu_type} are
9938
9939 @table @samp
9940 @item ev4
9941 @itemx ev45
9942 @itemx 21064
9943 Schedules as an EV4 and has no instruction set extensions.
9944
9945 @item ev5
9946 @itemx 21164
9947 Schedules as an EV5 and has no instruction set extensions.
9948
9949 @item ev56
9950 @itemx 21164a
9951 Schedules as an EV5 and supports the BWX extension.
9952
9953 @item pca56
9954 @itemx 21164pc
9955 @itemx 21164PC
9956 Schedules as an EV5 and supports the BWX and MAX extensions.
9957
9958 @item ev6
9959 @itemx 21264
9960 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
9961
9962 @item ev67
9963 @itemx 21264a
9964 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
9965 @end table
9966
9967 @item -mtune=@var{cpu_type}
9968 @opindex mtune
9969 Set only the instruction scheduling parameters for machine type
9970 @var{cpu_type}.  The instruction set is not changed.
9971
9972 @item -mmemory-latency=@var{time}
9973 @opindex mmemory-latency
9974 Sets the latency the scheduler should assume for typical memory
9975 references as seen by the application.  This number is highly
9976 dependent on the memory access patterns used by the application
9977 and the size of the external cache on the machine.
9978
9979 Valid options for @var{time} are
9980
9981 @table @samp
9982 @item @var{number}
9983 A decimal number representing clock cycles.
9984
9985 @item L1
9986 @itemx L2
9987 @itemx L3
9988 @itemx main
9989 The compiler contains estimates of the number of clock cycles for
9990 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
9991 (also called Dcache, Scache, and Bcache), as well as to main memory.
9992 Note that L3 is only valid for EV5.
9993
9994 @end table
9995 @end table
9996
9997 @node DEC Alpha/VMS Options
9998 @subsection DEC Alpha/VMS Options
9999
10000 These @samp{-m} options are defined for the DEC Alpha/VMS implementations:
10001
10002 @table @gcctabopt
10003 @item -mvms-return-codes
10004 @opindex mvms-return-codes
10005 Return VMS condition codes from main.  The default is to return POSIX
10006 style condition (e.g.@: error) codes.
10007 @end table
10008
10009 @node FRV Options
10010 @subsection FRV Options
10011 @cindex FRV Options
10012
10013 @table @gcctabopt
10014 @item -mgpr-32
10015 @opindex mgpr-32
10016
10017 Only use the first 32 general purpose registers.
10018
10019 @item -mgpr-64
10020 @opindex mgpr-64
10021
10022 Use all 64 general purpose registers.
10023
10024 @item -mfpr-32
10025 @opindex mfpr-32
10026
10027 Use only the first 32 floating point registers.
10028
10029 @item -mfpr-64
10030 @opindex mfpr-64
10031
10032 Use all 64 floating point registers
10033
10034 @item -mhard-float
10035 @opindex mhard-float
10036
10037 Use hardware instructions for floating point operations.
10038
10039 @item -msoft-float
10040 @opindex msoft-float
10041
10042 Use library routines for floating point operations.
10043
10044 @item -malloc-cc
10045 @opindex malloc-cc
10046
10047 Dynamically allocate condition code registers.
10048
10049 @item -mfixed-cc
10050 @opindex mfixed-cc
10051
10052 Do not try to dynamically allocate condition code registers, only
10053 use @code{icc0} and @code{fcc0}.
10054
10055 @item -mdword
10056 @opindex mdword
10057
10058 Change ABI to use double word insns.
10059
10060 @item -mno-dword
10061 @opindex mno-dword
10062
10063 Do not use double word instructions.
10064
10065 @item -mdouble
10066 @opindex mdouble
10067
10068 Use floating point double instructions.
10069
10070 @item -mno-double
10071 @opindex mno-double
10072
10073 Do not use floating point double instructions.
10074
10075 @item -mmedia
10076 @opindex mmedia
10077
10078 Use media instructions.
10079
10080 @item -mno-media
10081 @opindex mno-media
10082
10083 Do not use media instructions.
10084
10085 @item -mmuladd
10086 @opindex mmuladd
10087
10088 Use multiply and add/subtract instructions.
10089
10090 @item -mno-muladd
10091 @opindex mno-muladd
10092
10093 Do not use multiply and add/subtract instructions.
10094
10095 @item -mfdpic
10096 @opindex mfdpic
10097
10098 Select the FDPIC ABI, that uses function descriptors to represent
10099 pointers to functions.  Without any PIC/PIE-related options, it
10100 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
10101 assumes GOT entries and small data are within a 12-bit range from the
10102 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
10103 are computed with 32 bits.
10104 With a @samp{bfin-elf} target, this option implies @option{-msim}.
10105
10106 @item -minline-plt
10107 @opindex minline-plt
10108
10109 Enable inlining of PLT entries in function calls to functions that are
10110 not known to bind locally.  It has no effect without @option{-mfdpic}.
10111 It's enabled by default if optimizing for speed and compiling for
10112 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
10113 optimization option such as @option{-O3} or above is present in the
10114 command line.
10115
10116 @item -mTLS
10117 @opindex TLS
10118
10119 Assume a large TLS segment when generating thread-local code.
10120
10121 @item -mtls
10122 @opindex tls
10123
10124 Do not assume a large TLS segment when generating thread-local code.
10125
10126 @item -mgprel-ro
10127 @opindex mgprel-ro
10128
10129 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
10130 that is known to be in read-only sections.  It's enabled by default,
10131 except for @option{-fpic} or @option{-fpie}: even though it may help
10132 make the global offset table smaller, it trades 1 instruction for 4.
10133 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
10134 one of which may be shared by multiple symbols, and it avoids the need
10135 for a GOT entry for the referenced symbol, so it's more likely to be a
10136 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
10137
10138 @item -multilib-library-pic
10139 @opindex multilib-library-pic
10140
10141 Link with the (library, not FD) pic libraries.  It's implied by
10142 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
10143 @option{-fpic} without @option{-mfdpic}.  You should never have to use
10144 it explicitly.
10145
10146 @item -mlinked-fp
10147 @opindex mlinked-fp
10148
10149 Follow the EABI requirement of always creating a frame pointer whenever
10150 a stack frame is allocated.  This option is enabled by default and can
10151 be disabled with @option{-mno-linked-fp}.
10152
10153 @item -mlong-calls
10154 @opindex mlong-calls
10155
10156 Use indirect addressing to call functions outside the current
10157 compilation unit.  This allows the functions to be placed anywhere
10158 within the 32-bit address space.
10159
10160 @item -malign-labels
10161 @opindex malign-labels
10162
10163 Try to align labels to an 8-byte boundary by inserting nops into the
10164 previous packet.  This option only has an effect when VLIW packing
10165 is enabled.  It doesn't create new packets; it merely adds nops to
10166 existing ones.
10167
10168 @item -mlibrary-pic
10169 @opindex mlibrary-pic
10170
10171 Generate position-independent EABI code.
10172
10173 @item -macc-4
10174 @opindex macc-4
10175
10176 Use only the first four media accumulator registers.
10177
10178 @item -macc-8
10179 @opindex macc-8
10180
10181 Use all eight media accumulator registers.
10182
10183 @item -mpack
10184 @opindex mpack
10185
10186 Pack VLIW instructions.
10187
10188 @item -mno-pack
10189 @opindex mno-pack
10190
10191 Do not pack VLIW instructions.
10192
10193 @item -mno-eflags
10194 @opindex mno-eflags
10195
10196 Do not mark ABI switches in e_flags.
10197
10198 @item -mcond-move
10199 @opindex mcond-move
10200
10201 Enable the use of conditional-move instructions (default).
10202
10203 This switch is mainly for debugging the compiler and will likely be removed
10204 in a future version.
10205
10206 @item -mno-cond-move
10207 @opindex mno-cond-move
10208
10209 Disable the use of conditional-move instructions.
10210
10211 This switch is mainly for debugging the compiler and will likely be removed
10212 in a future version.
10213
10214 @item -mscc
10215 @opindex mscc
10216
10217 Enable the use of conditional set instructions (default).
10218
10219 This switch is mainly for debugging the compiler and will likely be removed
10220 in a future version.
10221
10222 @item -mno-scc
10223 @opindex mno-scc
10224
10225 Disable the use of conditional set instructions.
10226
10227 This switch is mainly for debugging the compiler and will likely be removed
10228 in a future version.
10229
10230 @item -mcond-exec
10231 @opindex mcond-exec
10232
10233 Enable the use of conditional execution (default).
10234
10235 This switch is mainly for debugging the compiler and will likely be removed
10236 in a future version.
10237
10238 @item -mno-cond-exec
10239 @opindex mno-cond-exec
10240
10241 Disable the use of conditional execution.
10242
10243 This switch is mainly for debugging the compiler and will likely be removed
10244 in a future version.
10245
10246 @item -mvliw-branch
10247 @opindex mvliw-branch
10248
10249 Run a pass to pack branches into VLIW instructions (default).
10250
10251 This switch is mainly for debugging the compiler and will likely be removed
10252 in a future version.
10253
10254 @item -mno-vliw-branch
10255 @opindex mno-vliw-branch
10256
10257 Do not run a pass to pack branches into VLIW instructions.
10258
10259 This switch is mainly for debugging the compiler and will likely be removed
10260 in a future version.
10261
10262 @item -mmulti-cond-exec
10263 @opindex mmulti-cond-exec
10264
10265 Enable optimization of @code{&&} and @code{||} in conditional execution
10266 (default).
10267
10268 This switch is mainly for debugging the compiler and will likely be removed
10269 in a future version.
10270
10271 @item -mno-multi-cond-exec
10272 @opindex mno-multi-cond-exec
10273
10274 Disable optimization of @code{&&} and @code{||} in conditional execution.
10275
10276 This switch is mainly for debugging the compiler and will likely be removed
10277 in a future version.
10278
10279 @item -mnested-cond-exec
10280 @opindex mnested-cond-exec
10281
10282 Enable nested conditional execution optimizations (default).
10283
10284 This switch is mainly for debugging the compiler and will likely be removed
10285 in a future version.
10286
10287 @item -mno-nested-cond-exec
10288 @opindex mno-nested-cond-exec
10289
10290 Disable nested conditional execution optimizations.
10291
10292 This switch is mainly for debugging the compiler and will likely be removed
10293 in a future version.
10294
10295 @item -moptimize-membar
10296 @opindex moptimize-membar
10297
10298 This switch removes redundant @code{membar} instructions from the
10299 compiler generated code.  It is enabled by default.
10300
10301 @item -mno-optimize-membar
10302 @opindex mno-optimize-membar
10303
10304 This switch disables the automatic removal of redundant @code{membar}
10305 instructions from the generated code.
10306
10307 @item -mtomcat-stats
10308 @opindex mtomcat-stats
10309
10310 Cause gas to print out tomcat statistics.
10311
10312 @item -mcpu=@var{cpu}
10313 @opindex mcpu
10314
10315 Select the processor type for which to generate code.  Possible values are
10316 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
10317 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
10318
10319 @end table
10320
10321 @node GNU/Linux Options
10322 @subsection GNU/Linux Options
10323
10324 These @samp{-m} options are defined for GNU/Linux targets:
10325
10326 @table @gcctabopt
10327 @item -mglibc
10328 @opindex mglibc
10329 Use the GNU C library instead of uClibc.  This is the default except
10330 on @samp{*-*-linux-*uclibc*} targets.
10331
10332 @item -muclibc
10333 @opindex muclibc
10334 Use uClibc instead of the GNU C library.  This is the default on
10335 @samp{*-*-linux-*uclibc*} targets.
10336 @end table
10337
10338 @node H8/300 Options
10339 @subsection H8/300 Options
10340
10341 These @samp{-m} options are defined for the H8/300 implementations:
10342
10343 @table @gcctabopt
10344 @item -mrelax
10345 @opindex mrelax
10346 Shorten some address references at link time, when possible; uses the
10347 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
10348 ld, Using ld}, for a fuller description.
10349
10350 @item -mh
10351 @opindex mh
10352 Generate code for the H8/300H@.
10353
10354 @item -ms
10355 @opindex ms
10356 Generate code for the H8S@.
10357
10358 @item -mn
10359 @opindex mn
10360 Generate code for the H8S and H8/300H in the normal mode.  This switch
10361 must be used either with @option{-mh} or @option{-ms}.
10362
10363 @item -ms2600
10364 @opindex ms2600
10365 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
10366
10367 @item -mint32
10368 @opindex mint32
10369 Make @code{int} data 32 bits by default.
10370
10371 @item -malign-300
10372 @opindex malign-300
10373 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
10374 The default for the H8/300H and H8S is to align longs and floats on 4
10375 byte boundaries.
10376 @option{-malign-300} causes them to be aligned on 2 byte boundaries.
10377 This option has no effect on the H8/300.
10378 @end table
10379
10380 @node HPPA Options
10381 @subsection HPPA Options
10382 @cindex HPPA Options
10383
10384 These @samp{-m} options are defined for the HPPA family of computers:
10385
10386 @table @gcctabopt
10387 @item -march=@var{architecture-type}
10388 @opindex march
10389 Generate code for the specified architecture.  The choices for
10390 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
10391 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
10392 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
10393 architecture option for your machine.  Code compiled for lower numbered
10394 architectures will run on higher numbered architectures, but not the
10395 other way around.
10396
10397 @item -mpa-risc-1-0
10398 @itemx -mpa-risc-1-1
10399 @itemx -mpa-risc-2-0
10400 @opindex mpa-risc-1-0
10401 @opindex mpa-risc-1-1
10402 @opindex mpa-risc-2-0
10403 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
10404
10405 @item -mbig-switch
10406 @opindex mbig-switch
10407 Generate code suitable for big switch tables.  Use this option only if
10408 the assembler/linker complain about out of range branches within a switch
10409 table.
10410
10411 @item -mjump-in-delay
10412 @opindex mjump-in-delay
10413 Fill delay slots of function calls with unconditional jump instructions
10414 by modifying the return pointer for the function call to be the target
10415 of the conditional jump.
10416
10417 @item -mdisable-fpregs
10418 @opindex mdisable-fpregs
10419 Prevent floating point registers from being used in any manner.  This is
10420 necessary for compiling kernels which perform lazy context switching of
10421 floating point registers.  If you use this option and attempt to perform
10422 floating point operations, the compiler will abort.
10423
10424 @item -mdisable-indexing
10425 @opindex mdisable-indexing
10426 Prevent the compiler from using indexing address modes.  This avoids some
10427 rather obscure problems when compiling MIG generated code under MACH@.
10428
10429 @item -mno-space-regs
10430 @opindex mno-space-regs
10431 Generate code that assumes the target has no space registers.  This allows
10432 GCC to generate faster indirect calls and use unscaled index address modes.
10433
10434 Such code is suitable for level 0 PA systems and kernels.
10435
10436 @item -mfast-indirect-calls
10437 @opindex mfast-indirect-calls
10438 Generate code that assumes calls never cross space boundaries.  This
10439 allows GCC to emit code which performs faster indirect calls.
10440
10441 This option will not work in the presence of shared libraries or nested
10442 functions.
10443
10444 @item -mfixed-range=@var{register-range}
10445 @opindex mfixed-range
10446 Generate code treating the given register range as fixed registers.
10447 A fixed register is one that the register allocator can not use.  This is
10448 useful when compiling kernel code.  A register range is specified as
10449 two registers separated by a dash.  Multiple register ranges can be
10450 specified separated by a comma.
10451
10452 @item -mlong-load-store
10453 @opindex mlong-load-store
10454 Generate 3-instruction load and store sequences as sometimes required by
10455 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
10456 the HP compilers.
10457
10458 @item -mportable-runtime
10459 @opindex mportable-runtime
10460 Use the portable calling conventions proposed by HP for ELF systems.
10461
10462 @item -mgas
10463 @opindex mgas
10464 Enable the use of assembler directives only GAS understands.
10465
10466 @item -mschedule=@var{cpu-type}
10467 @opindex mschedule
10468 Schedule code according to the constraints for the machine type
10469 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
10470 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
10471 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
10472 proper scheduling option for your machine.  The default scheduling is
10473 @samp{8000}.
10474
10475 @item -mlinker-opt
10476 @opindex mlinker-opt
10477 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
10478 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
10479 linkers in which they give bogus error messages when linking some programs.
10480
10481 @item -msoft-float
10482 @opindex msoft-float
10483 Generate output containing library calls for floating point.
10484 @strong{Warning:} the requisite libraries are not available for all HPPA
10485 targets.  Normally the facilities of the machine's usual C compiler are
10486 used, but this cannot be done directly in cross-compilation.  You must make
10487 your own arrangements to provide suitable library functions for
10488 cross-compilation.
10489
10490 @option{-msoft-float} changes the calling convention in the output file;
10491 therefore, it is only useful if you compile @emph{all} of a program with
10492 this option.  In particular, you need to compile @file{libgcc.a}, the
10493 library that comes with GCC, with @option{-msoft-float} in order for
10494 this to work.
10495
10496 @item -msio
10497 @opindex msio
10498 Generate the predefine, @code{_SIO}, for server IO@.  The default is
10499 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
10500 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
10501 options are available under HP-UX and HI-UX@.
10502
10503 @item -mgnu-ld
10504 @opindex gnu-ld
10505 Use GNU ld specific options.  This passes @option{-shared} to ld when
10506 building a shared library.  It is the default when GCC is configured,
10507 explicitly or implicitly, with the GNU linker.  This option does not
10508 have any affect on which ld is called, it only changes what parameters
10509 are passed to that ld.  The ld that is called is determined by the
10510 @option{--with-ld} configure option, GCC's program search path, and
10511 finally by the user's @env{PATH}.  The linker used by GCC can be printed
10512 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
10513 on the 64 bit HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
10514
10515 @item -mhp-ld
10516 @opindex hp-ld
10517 Use HP ld specific options.  This passes @option{-b} to ld when building
10518 a shared library and passes @option{+Accept TypeMismatch} to ld on all
10519 links.  It is the default when GCC is configured, explicitly or
10520 implicitly, with the HP linker.  This option does not have any affect on
10521 which ld is called, it only changes what parameters are passed to that
10522 ld.  The ld that is called is determined by the @option{--with-ld}
10523 configure option, GCC's program search path, and finally by the user's
10524 @env{PATH}.  The linker used by GCC can be printed using @samp{which
10525 `gcc -print-prog-name=ld`}.  This option is only available on the 64 bit
10526 HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
10527
10528 @item -mlong-calls
10529 @opindex mno-long-calls
10530 Generate code that uses long call sequences.  This ensures that a call
10531 is always able to reach linker generated stubs.  The default is to generate
10532 long calls only when the distance from the call site to the beginning
10533 of the function or translation unit, as the case may be, exceeds a
10534 predefined limit set by the branch type being used.  The limits for
10535 normal calls are 7,600,000 and 240,000 bytes, respectively for the
10536 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
10537 240,000 bytes.
10538
10539 Distances are measured from the beginning of functions when using the
10540 @option{-ffunction-sections} option, or when using the @option{-mgas}
10541 and @option{-mno-portable-runtime} options together under HP-UX with
10542 the SOM linker.
10543
10544 It is normally not desirable to use this option as it will degrade
10545 performance.  However, it may be useful in large applications,
10546 particularly when partial linking is used to build the application.
10547
10548 The types of long calls used depends on the capabilities of the
10549 assembler and linker, and the type of code being generated.  The
10550 impact on systems that support long absolute calls, and long pic
10551 symbol-difference or pc-relative calls should be relatively small.
10552 However, an indirect call is used on 32-bit ELF systems in pic code
10553 and it is quite long.
10554
10555 @item -munix=@var{unix-std}
10556 @opindex march
10557 Generate compiler predefines and select a startfile for the specified
10558 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
10559 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
10560 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
10561 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
10562 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
10563 and later.
10564
10565 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
10566 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
10567 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
10568 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
10569 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
10570 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
10571
10572 It is @emph{important} to note that this option changes the interfaces
10573 for various library routines.  It also affects the operational behavior
10574 of the C library.  Thus, @emph{extreme} care is needed in using this
10575 option.
10576
10577 Library code that is intended to operate with more than one UNIX
10578 standard must test, set and restore the variable @var{__xpg4_extended_mask}
10579 as appropriate.  Most GNU software doesn't provide this capability.
10580
10581 @item -nolibdld
10582 @opindex nolibdld
10583 Suppress the generation of link options to search libdld.sl when the
10584 @option{-static} option is specified on HP-UX 10 and later.
10585
10586 @item -static
10587 @opindex static
10588 The HP-UX implementation of setlocale in libc has a dependency on
10589 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
10590 when the @option{-static} option is specified, special link options
10591 are needed to resolve this dependency.
10592
10593 On HP-UX 10 and later, the GCC driver adds the necessary options to
10594 link with libdld.sl when the @option{-static} option is specified.
10595 This causes the resulting binary to be dynamic.  On the 64-bit port,
10596 the linkers generate dynamic binaries by default in any case.  The
10597 @option{-nolibdld} option can be used to prevent the GCC driver from
10598 adding these link options.
10599
10600 @item -threads
10601 @opindex threads
10602 Add support for multithreading with the @dfn{dce thread} library
10603 under HP-UX@.  This option sets flags for both the preprocessor and
10604 linker.
10605 @end table
10606
10607 @node i386 and x86-64 Options
10608 @subsection Intel 386 and AMD x86-64 Options
10609 @cindex i386 Options
10610 @cindex x86-64 Options
10611 @cindex Intel 386 Options
10612 @cindex AMD x86-64 Options
10613
10614 These @samp{-m} options are defined for the i386 and x86-64 family of
10615 computers:
10616
10617 @table @gcctabopt
10618 @item -mtune=@var{cpu-type}
10619 @opindex mtune
10620 Tune to @var{cpu-type} everything applicable about the generated code, except
10621 for the ABI and the set of available instructions.  The choices for
10622 @var{cpu-type} are:
10623 @table @emph
10624 @item generic
10625 Produce code optimized for the most common IA32/AMD64/EM64T processors.
10626 If you know the CPU on which your code will run, then you should use
10627 the corresponding @option{-mtune} option instead of
10628 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
10629 of your application will have, then you should use this option.
10630
10631 As new processors are deployed in the marketplace, the behavior of this
10632 option will change.  Therefore, if you upgrade to a newer version of
10633 GCC, the code generated option will change to reflect the processors
10634 that were most common when that version of GCC was released.
10635
10636 There is no @option{-march=generic} option because @option{-march}
10637 indicates the instruction set the compiler can use, and there is no
10638 generic instruction set applicable to all processors.  In contrast,
10639 @option{-mtune} indicates the processor (or, in this case, collection of
10640 processors) for which the code is optimized.
10641 @item native
10642 This selects the CPU to tune for at compilation time by determining
10643 the processor type of the compiling machine.  Using @option{-mtune=native}
10644 will produce code optimized for the local machine under the constraints
10645 of the selected instruction set.  Using @option{-march=native} will
10646 enable all instruction subsets supported by the local machine (hence
10647 the result might not run on different machines).
10648 @item i386
10649 Original Intel's i386 CPU@.
10650 @item i486
10651 Intel's i486 CPU@.  (No scheduling is implemented for this chip.)
10652 @item i586, pentium
10653 Intel Pentium CPU with no MMX support.
10654 @item pentium-mmx
10655 Intel PentiumMMX CPU based on Pentium core with MMX instruction set support.
10656 @item pentiumpro
10657 Intel PentiumPro CPU@.
10658 @item i686
10659 Same as @code{generic}, but when used as @code{march} option, PentiumPro
10660 instruction set will be used, so the code will run on all i686 family chips.
10661 @item pentium2
10662 Intel Pentium2 CPU based on PentiumPro core with MMX instruction set support.
10663 @item pentium3, pentium3m
10664 Intel Pentium3 CPU based on PentiumPro core with MMX and SSE instruction set
10665 support.
10666 @item pentium-m
10667 Low power version of Intel Pentium3 CPU with MMX, SSE and SSE2 instruction set
10668 support.  Used by Centrino notebooks.
10669 @item pentium4, pentium4m
10670 Intel Pentium4 CPU with MMX, SSE and SSE2 instruction set support.
10671 @item prescott
10672 Improved version of Intel Pentium4 CPU with MMX, SSE, SSE2 and SSE3 instruction
10673 set support.
10674 @item nocona
10675 Improved version of Intel Pentium4 CPU with 64-bit extensions, MMX, SSE,
10676 SSE2 and SSE3 instruction set support.
10677 @item core2
10678 Intel Core2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
10679 instruction set support.
10680 @item k6
10681 AMD K6 CPU with MMX instruction set support.
10682 @item k6-2, k6-3
10683 Improved versions of AMD K6 CPU with MMX and 3dNOW!@: instruction set support.
10684 @item athlon, athlon-tbird
10685 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW!@: and SSE prefetch instructions
10686 support.
10687 @item athlon-4, athlon-xp, athlon-mp
10688 Improved AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW!@: and full SSE
10689 instruction set support.
10690 @item k8, opteron, athlon64, athlon-fx
10691 AMD K8 core based CPUs with x86-64 instruction set support.  (This supersets
10692 MMX, SSE, SSE2, 3dNOW!, enhanced 3dNOW!@: and 64-bit instruction set extensions.)
10693 @item k8-sse3, opteron-sse3, athlon64-sse3
10694 Improved versions of k8, opteron and athlon64 with SSE3 instruction set support.
10695 @item amdfam10, barcelona
10696 AMD Family 10h core based CPUs with x86-64 instruction set support.  (This
10697 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3dNOW!, enhanced 3dNOW!, ABM and 64-bit
10698 instruction set extensions.)
10699 @item winchip-c6
10700 IDT Winchip C6 CPU, dealt in same way as i486 with additional MMX instruction
10701 set support.
10702 @item winchip2
10703 IDT Winchip2 CPU, dealt in same way as i486 with additional MMX and 3dNOW!@:
10704 instruction set support.
10705 @item c3
10706 Via C3 CPU with MMX and 3dNOW!@: instruction set support.  (No scheduling is
10707 implemented for this chip.)
10708 @item c3-2
10709 Via C3-2 CPU with MMX and SSE instruction set support.  (No scheduling is
10710 implemented for this chip.)
10711 @item geode
10712 Embedded AMD CPU with MMX and 3dNOW! instruction set support.
10713 @end table
10714
10715 While picking a specific @var{cpu-type} will schedule things appropriately
10716 for that particular chip, the compiler will not generate any code that
10717 does not run on the i386 without the @option{-march=@var{cpu-type}} option
10718 being used.
10719
10720 @item -march=@var{cpu-type}
10721 @opindex march
10722 Generate instructions for the machine type @var{cpu-type}.  The choices
10723 for @var{cpu-type} are the same as for @option{-mtune}.  Moreover,
10724 specifying @option{-march=@var{cpu-type}} implies @option{-mtune=@var{cpu-type}}.
10725
10726 @item -mcpu=@var{cpu-type}
10727 @opindex mcpu
10728 A deprecated synonym for @option{-mtune}.
10729
10730 @item -mfpmath=@var{unit}
10731 @opindex march
10732 Generate floating point arithmetics for selected unit @var{unit}.  The choices
10733 for @var{unit} are:
10734
10735 @table @samp
10736 @item 387
10737 Use the standard 387 floating point coprocessor present majority of chips and
10738 emulated otherwise.  Code compiled with this option will run almost everywhere.
10739 The temporary results are computed in 80bit precision instead of precision
10740 specified by the type resulting in slightly different results compared to most
10741 of other chips.  See @option{-ffloat-store} for more detailed description.
10742
10743 This is the default choice for i386 compiler.
10744
10745 @item sse
10746 Use scalar floating point instructions present in the SSE instruction set.
10747 This instruction set is supported by Pentium3 and newer chips, in the AMD line
10748 by Athlon-4, Athlon-xp and Athlon-mp chips.  The earlier version of SSE
10749 instruction set supports only single precision arithmetics, thus the double and
10750 extended precision arithmetics is still done using 387.  Later version, present
10751 only in Pentium4 and the future AMD x86-64 chips supports double precision
10752 arithmetics too.
10753
10754 For the i386 compiler, you need to use @option{-march=@var{cpu-type}}, @option{-msse}
10755 or @option{-msse2} switches to enable SSE extensions and make this option
10756 effective.  For the x86-64 compiler, these extensions are enabled by default.
10757
10758 The resulting code should be considerably faster in the majority of cases and avoid
10759 the numerical instability problems of 387 code, but may break some existing
10760 code that expects temporaries to be 80bit.
10761
10762 This is the default choice for the x86-64 compiler.
10763
10764 @item sse,387
10765 @itemx sse+387
10766 @itemx both
10767 Attempt to utilize both instruction sets at once.  This effectively double the
10768 amount of available registers and on chips with separate execution units for
10769 387 and SSE the execution resources too.  Use this option with care, as it is
10770 still experimental, because the GCC register allocator does not model separate
10771 functional units well resulting in instable performance.
10772 @end table
10773
10774 @item -masm=@var{dialect}
10775 @opindex masm=@var{dialect}
10776 Output asm instructions using selected @var{dialect}.  Supported
10777 choices are @samp{intel} or @samp{att} (the default one).  Darwin does
10778 not support @samp{intel}.
10779
10780 @item -mieee-fp
10781 @itemx -mno-ieee-fp
10782 @opindex mieee-fp
10783 @opindex mno-ieee-fp
10784 Control whether or not the compiler uses IEEE floating point
10785 comparisons.  These handle correctly the case where the result of a
10786 comparison is unordered.
10787
10788 @item -msoft-float
10789 @opindex msoft-float
10790 Generate output containing library calls for floating point.
10791 @strong{Warning:} the requisite libraries are not part of GCC@.
10792 Normally the facilities of the machine's usual C compiler are used, but
10793 this can't be done directly in cross-compilation.  You must make your
10794 own arrangements to provide suitable library functions for
10795 cross-compilation.
10796
10797 On machines where a function returns floating point results in the 80387
10798 register stack, some floating point opcodes may be emitted even if
10799 @option{-msoft-float} is used.
10800
10801 @item -mno-fp-ret-in-387
10802 @opindex mno-fp-ret-in-387
10803 Do not use the FPU registers for return values of functions.
10804
10805 The usual calling convention has functions return values of types
10806 @code{float} and @code{double} in an FPU register, even if there
10807 is no FPU@.  The idea is that the operating system should emulate
10808 an FPU@.
10809
10810 The option @option{-mno-fp-ret-in-387} causes such values to be returned
10811 in ordinary CPU registers instead.
10812
10813 @item -mno-fancy-math-387
10814 @opindex mno-fancy-math-387
10815 Some 387 emulators do not support the @code{sin}, @code{cos} and
10816 @code{sqrt} instructions for the 387.  Specify this option to avoid
10817 generating those instructions.  This option is the default on FreeBSD,
10818 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
10819 indicates that the target cpu will always have an FPU and so the
10820 instruction will not need emulation.  As of revision 2.6.1, these
10821 instructions are not generated unless you also use the
10822 @option{-funsafe-math-optimizations} switch.
10823
10824 @item -malign-double
10825 @itemx -mno-align-double
10826 @opindex malign-double
10827 @opindex mno-align-double
10828 Control whether GCC aligns @code{double}, @code{long double}, and
10829 @code{long long} variables on a two word boundary or a one word
10830 boundary.  Aligning @code{double} variables on a two word boundary will
10831 produce code that runs somewhat faster on a @samp{Pentium} at the
10832 expense of more memory.
10833
10834 On x86-64, @option{-malign-double} is enabled by default.
10835
10836 @strong{Warning:} if you use the @option{-malign-double} switch,
10837 structures containing the above types will be aligned differently than
10838 the published application binary interface specifications for the 386
10839 and will not be binary compatible with structures in code compiled
10840 without that switch.
10841
10842 @item -m96bit-long-double
10843 @itemx -m128bit-long-double
10844 @opindex m96bit-long-double
10845 @opindex m128bit-long-double
10846 These switches control the size of @code{long double} type.  The i386
10847 application binary interface specifies the size to be 96 bits,
10848 so @option{-m96bit-long-double} is the default in 32 bit mode.
10849
10850 Modern architectures (Pentium and newer) would prefer @code{long double}
10851 to be aligned to an 8 or 16 byte boundary.  In arrays or structures
10852 conforming to the ABI, this would not be possible.  So specifying a
10853 @option{-m128bit-long-double} will align @code{long double}
10854 to a 16 byte boundary by padding the @code{long double} with an additional
10855 32 bit zero.
10856
10857 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
10858 its ABI specifies that @code{long double} is to be aligned on 16 byte boundary.
10859
10860 Notice that neither of these options enable any extra precision over the x87
10861 standard of 80 bits for a @code{long double}.
10862
10863 @strong{Warning:} if you override the default value for your target ABI, the
10864 structures and arrays containing @code{long double} variables will change
10865 their size as well as function calling convention for function taking
10866 @code{long double} will be modified.  Hence they will not be binary
10867 compatible with arrays or structures in code compiled without that switch.
10868
10869 @item -mmlarge-data-threshold=@var{number}
10870 @opindex mlarge-data-threshold=@var{number}
10871 When @option{-mcmodel=medium} is specified, the data greater than
10872 @var{threshold} are placed in large data section.  This value must be the
10873 same across all object linked into the binary and defaults to 65535.
10874
10875 @item -mrtd
10876 @opindex mrtd
10877 Use a different function-calling convention, in which functions that
10878 take a fixed number of arguments return with the @code{ret} @var{num}
10879 instruction, which pops their arguments while returning.  This saves one
10880 instruction in the caller since there is no need to pop the arguments
10881 there.
10882
10883 You can specify that an individual function is called with this calling
10884 sequence with the function attribute @samp{stdcall}.  You can also
10885 override the @option{-mrtd} option by using the function attribute
10886 @samp{cdecl}.  @xref{Function Attributes}.
10887
10888 @strong{Warning:} this calling convention is incompatible with the one
10889 normally used on Unix, so you cannot use it if you need to call
10890 libraries compiled with the Unix compiler.
10891
10892 Also, you must provide function prototypes for all functions that
10893 take variable numbers of arguments (including @code{printf});
10894 otherwise incorrect code will be generated for calls to those
10895 functions.
10896
10897 In addition, seriously incorrect code will result if you call a
10898 function with too many arguments.  (Normally, extra arguments are
10899 harmlessly ignored.)
10900
10901 @item -mregparm=@var{num}
10902 @opindex mregparm
10903 Control how many registers are used to pass integer arguments.  By
10904 default, no registers are used to pass arguments, and at most 3
10905 registers can be used.  You can control this behavior for a specific
10906 function by using the function attribute @samp{regparm}.
10907 @xref{Function Attributes}.
10908
10909 @strong{Warning:} if you use this switch, and
10910 @var{num} is nonzero, then you must build all modules with the same
10911 value, including any libraries.  This includes the system libraries and
10912 startup modules.
10913
10914 @item -msseregparm
10915 @opindex msseregparm
10916 Use SSE register passing conventions for float and double arguments
10917 and return values.  You can control this behavior for a specific
10918 function by using the function attribute @samp{sseregparm}.
10919 @xref{Function Attributes}.
10920
10921 @strong{Warning:} if you use this switch then you must build all
10922 modules with the same value, including any libraries.  This includes
10923 the system libraries and startup modules.
10924
10925 @item -mpc32
10926 @itemx -mpc64
10927 @itemx -mpc80
10928 @opindex mpc32
10929 @opindex mpc64
10930 @opindex mpc80
10931
10932 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
10933 is specified, the significands of results of floating-point operations are
10934 rounded to 24 bits (single precision); @option{-mpc64} rounds the the
10935 significands of results of floating-point operations to 53 bits (double
10936 precision) and @option{-mpc80} rounds the significands of results of
10937 floating-point operations to 64 bits (extended double precision), which is
10938 the default.  When this option is used, floating-point operations in higher
10939 precisions are not available to the programmer without setting the FPU
10940 control word explicitly.
10941
10942 Setting the rounding of floating-point operations to less than the default
10943 80 bits can speed some programs by 2% or more.  Note that some mathematical
10944 libraries assume that extended precision (80 bit) floating-point operations
10945 are enabled by default; routines in such libraries could suffer significant
10946 loss of accuracy, typically through so-called "catastrophic cancellation",
10947 when this option is used to set the precision to less than extended precision. 
10948
10949 @item -mstackrealign
10950 @opindex mstackrealign
10951 Realign the stack at entry.  On the Intel x86, the @option{-mstackrealign}
10952 option will generate an alternate prologue and epilogue that realigns the
10953 runtime stack if necessary.  This supports mixing legacy codes that keep
10954 a 4-byte aligned stack with modern codes that keep a 16-byte stack for
10955 SSE compatibility.  See also the attribute @code{force_align_arg_pointer},
10956 applicable to individual functions.
10957
10958 @item -mpreferred-stack-boundary=@var{num}
10959 @opindex mpreferred-stack-boundary
10960 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
10961 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
10962 the default is 4 (16 bytes or 128 bits).
10963
10964 @item -mincoming-stack-boundary=@var{num}
10965 @opindex mincoming-stack-boundary
10966 Assume the incoming stack is aligned to a 2 raised to @var{num} byte
10967 boundary.  If @option{-mincoming-stack-boundary} is not specified,
10968 the one specified by @option{-mpreferred-stack-boundary} will be used.
10969
10970 On Pentium and PentiumPro, @code{double} and @code{long double} values
10971 should be aligned to an 8 byte boundary (see @option{-malign-double}) or
10972 suffer significant run time performance penalties.  On Pentium III, the
10973 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
10974 properly if it is not 16 byte aligned.
10975
10976 To ensure proper alignment of this values on the stack, the stack boundary
10977 must be as aligned as that required by any value stored on the stack.
10978 Further, every function must be generated such that it keeps the stack
10979 aligned.  Thus calling a function compiled with a higher preferred
10980 stack boundary from a function compiled with a lower preferred stack
10981 boundary will most likely misalign the stack.  It is recommended that
10982 libraries that use callbacks always use the default setting.
10983
10984 This extra alignment does consume extra stack space, and generally
10985 increases code size.  Code that is sensitive to stack space usage, such
10986 as embedded systems and operating system kernels, may want to reduce the
10987 preferred alignment to @option{-mpreferred-stack-boundary=2}.
10988
10989 @item -mmmx
10990 @itemx -mno-mmx
10991 @itemx -msse
10992 @itemx -mno-sse
10993 @itemx -msse2
10994 @itemx -mno-sse2
10995 @itemx -msse3
10996 @itemx -mno-sse3
10997 @itemx -mssse3
10998 @itemx -mno-ssse3
10999 @itemx -msse4.1
11000 @itemx -mno-sse4.1
11001 @itemx -msse4.2
11002 @itemx -mno-sse4.2
11003 @itemx -msse4
11004 @itemx -mno-sse4
11005 @itemx -mavx
11006 @itemx -mno-avx
11007 @itemx -maes
11008 @itemx -mno-aes
11009 @itemx -mpclmul
11010 @itemx -mno-pclmul
11011 @itemx -msse4a
11012 @itemx -mno-sse4a
11013 @itemx -msse5
11014 @itemx -mno-sse5
11015 @itemx -m3dnow
11016 @itemx -mno-3dnow
11017 @itemx -mpopcnt
11018 @itemx -mno-popcnt
11019 @itemx -mabm
11020 @itemx -mno-abm
11021 @opindex mmmx
11022 @opindex mno-mmx
11023 @opindex msse
11024 @opindex mno-sse
11025 @opindex m3dnow
11026 @opindex mno-3dnow
11027 These switches enable or disable the use of instructions in the MMX,
11028 SSE, SSE2, SSE3, SSSE3, SSE4.1, AVX, AES, PCLMUL, SSE4A, SSE5, ABM or
11029 3DNow!@: extended instruction sets.
11030 These extensions are also available as built-in functions: see
11031 @ref{X86 Built-in Functions}, for details of the functions enabled and
11032 disabled by these switches.
11033
11034 To have SSE/SSE2 instructions generated automatically from floating-point
11035 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
11036
11037 GCC depresses SSEx instructions when @option{-mavx} is used. Instead, it
11038 generates new AVX instructions or AVX equivalence for all SSEx instructions
11039 when needed.
11040
11041 These options will enable GCC to use these extended instructions in
11042 generated code, even without @option{-mfpmath=sse}.  Applications which
11043 perform runtime CPU detection must compile separate files for each
11044 supported architecture, using the appropriate flags.  In particular,
11045 the file containing the CPU detection code should be compiled without
11046 these options.
11047
11048 @item -mcld
11049 @opindex mcld
11050 This option instructs GCC to emit a @code{cld} instruction in the prologue
11051 of functions that use string instructions.  String instructions depend on
11052 the DF flag to select between autoincrement or autodecrement mode.  While the
11053 ABI specifies the DF flag to be cleared on function entry, some operating
11054 systems violate this specification by not clearing the DF flag in their
11055 exception dispatchers.  The exception handler can be invoked with the DF flag
11056 set which leads to wrong direction mode, when string instructions are used.
11057 This option can be enabled by default on 32-bit x86 targets by configuring
11058 GCC with the @option{--enable-cld} configure option.  Generation of @code{cld}
11059 instructions can be suppressed with the @option{-mno-cld} compiler option
11060 in this case.
11061
11062 @item -mcx16
11063 @opindex mcx16
11064 This option will enable GCC to use CMPXCHG16B instruction in generated code.
11065 CMPXCHG16B allows for atomic operations on 128-bit double quadword (or oword)
11066 data types.  This is useful for high resolution counters that could be updated
11067 by multiple processors (or cores).  This instruction is generated as part of
11068 atomic built-in functions: see @ref{Atomic Builtins} for details.
11069
11070 @item -msahf
11071 @opindex msahf
11072 This option will enable GCC to use SAHF instruction in generated 64-bit code.
11073 Early Intel CPUs with Intel 64 lacked LAHF and SAHF instructions supported
11074 by AMD64 until introduction of Pentium 4 G1 step in December 2005.  LAHF and
11075 SAHF are load and store instructions, respectively, for certain status flags.
11076 In 64-bit mode, SAHF instruction is used to optimize @code{fmod}, @code{drem}
11077 or @code{remainder} built-in functions: see @ref{Other Builtins} for details.
11078
11079 @item -mrecip
11080 @opindex mrecip
11081 This option will enable GCC to use RCPSS and RSQRTSS instructions (and their
11082 vectorized variants RCPPS and RSQRTPS) with an additional Newton-Rhapson step
11083 to increase precision instead of DIVSS and SQRTSS (and their vectorized
11084 variants) for single precision floating point arguments.  These instructions
11085 are generated only when @option{-funsafe-math-optimizations} is enabled
11086 together with @option{-finite-math-only} and @option{-fno-trapping-math}.
11087 Note that while the throughput of the sequence is higher than the throughput
11088 of the non-reciprocal instruction, the precision of the sequence can be
11089 decreased by up to 2 ulp (i.e. the inverse of 1.0 equals 0.99999994).
11090
11091 @item -mveclibabi=@var{type}
11092 @opindex mveclibabi
11093 Specifies the ABI type to use for vectorizing intrinsics using an
11094 external library.  Supported types are @code{svml} for the Intel short
11095 vector math library and @code{acml} for the AMD math core library style
11096 of interfacing.  GCC will currently emit calls to @code{vmldExp2},
11097 @code{vmldLn2}, @code{vmldLog102}, @code{vmldLog102}, @code{vmldPow2},
11098 @code{vmldTanh2}, @code{vmldTan2}, @code{vmldAtan2}, @code{vmldAtanh2},
11099 @code{vmldCbrt2}, @code{vmldSinh2}, @code{vmldSin2}, @code{vmldAsinh2},
11100 @code{vmldAsin2}, @code{vmldCosh2}, @code{vmldCos2}, @code{vmldAcosh2},
11101 @code{vmldAcos2}, @code{vmlsExp4}, @code{vmlsLn4}, @code{vmlsLog104},
11102 @code{vmlsLog104}, @code{vmlsPow4}, @code{vmlsTanh4}, @code{vmlsTan4},
11103 @code{vmlsAtan4}, @code{vmlsAtanh4}, @code{vmlsCbrt4}, @code{vmlsSinh4},
11104 @code{vmlsSin4}, @code{vmlsAsinh4}, @code{vmlsAsin4}, @code{vmlsCosh4},
11105 @code{vmlsCos4}, @code{vmlsAcosh4} and @code{vmlsAcos4} for corresponding
11106 function type when @option{-mveclibabi=svml} is used and @code{__vrd2_sin},
11107 @code{__vrd2_cos}, @code{__vrd2_exp}, @code{__vrd2_log}, @code{__vrd2_log2},
11108 @code{__vrd2_log10}, @code{__vrs4_sinf}, @code{__vrs4_cosf},
11109 @code{__vrs4_expf}, @code{__vrs4_logf}, @code{__vrs4_log2f},
11110 @code{__vrs4_log10f} and @code{__vrs4_powf} for corresponding function type
11111 when @option{-mveclibabi=acml} is used. Both @option{-ftree-vectorize} and
11112 @option{-funsafe-math-optimizations} have to be enabled. A SVML or ACML ABI
11113 compatible library will have to be specified at link time.
11114
11115 @item -mpush-args
11116 @itemx -mno-push-args
11117 @opindex mpush-args
11118 @opindex mno-push-args
11119 Use PUSH operations to store outgoing parameters.  This method is shorter
11120 and usually equally fast as method using SUB/MOV operations and is enabled
11121 by default.  In some cases disabling it may improve performance because of
11122 improved scheduling and reduced dependencies.
11123
11124 @item -maccumulate-outgoing-args
11125 @opindex maccumulate-outgoing-args
11126 If enabled, the maximum amount of space required for outgoing arguments will be
11127 computed in the function prologue.  This is faster on most modern CPUs
11128 because of reduced dependencies, improved scheduling and reduced stack usage
11129 when preferred stack boundary is not equal to 2.  The drawback is a notable
11130 increase in code size.  This switch implies @option{-mno-push-args}.
11131
11132 @item -mthreads
11133 @opindex mthreads
11134 Support thread-safe exception handling on @samp{Mingw32}.  Code that relies
11135 on thread-safe exception handling must compile and link all code with the
11136 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
11137 @option{-D_MT}; when linking, it links in a special thread helper library
11138 @option{-lmingwthrd} which cleans up per thread exception handling data.
11139
11140 @item -mno-align-stringops
11141 @opindex mno-align-stringops
11142 Do not align destination of inlined string operations.  This switch reduces
11143 code size and improves performance in case the destination is already aligned,
11144 but GCC doesn't know about it.
11145
11146 @item -minline-all-stringops
11147 @opindex minline-all-stringops
11148 By default GCC inlines string operations only when destination is known to be
11149 aligned at least to 4 byte boundary.  This enables more inlining, increase code
11150 size, but may improve performance of code that depends on fast memcpy, strlen
11151 and memset for short lengths.
11152
11153 @item -minline-stringops-dynamically
11154 @opindex minline-stringops-dynamically
11155 For string operation of unknown size, inline runtime checks so for small
11156 blocks inline code is used, while for large blocks library call is used.
11157
11158 @item -mstringop-strategy=@var{alg}
11159 @opindex mstringop-strategy=@var{alg}
11160 Overwrite internal decision heuristic about particular algorithm to inline
11161 string operation with.  The allowed values are @code{rep_byte},
11162 @code{rep_4byte}, @code{rep_8byte} for expanding using i386 @code{rep} prefix
11163 of specified size, @code{byte_loop}, @code{loop}, @code{unrolled_loop} for
11164 expanding inline loop, @code{libcall} for always expanding library call.
11165
11166 @item -momit-leaf-frame-pointer
11167 @opindex momit-leaf-frame-pointer
11168 Don't keep the frame pointer in a register for leaf functions.  This
11169 avoids the instructions to save, set up and restore frame pointers and
11170 makes an extra register available in leaf functions.  The option
11171 @option{-fomit-frame-pointer} removes the frame pointer for all functions
11172 which might make debugging harder.
11173
11174 @item -mtls-direct-seg-refs
11175 @itemx -mno-tls-direct-seg-refs
11176 @opindex mtls-direct-seg-refs
11177 Controls whether TLS variables may be accessed with offsets from the
11178 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
11179 or whether the thread base pointer must be added.  Whether or not this
11180 is legal depends on the operating system, and whether it maps the
11181 segment to cover the entire TLS area.
11182
11183 For systems that use GNU libc, the default is on.
11184
11185 @item -mfused-madd
11186 @itemx -mno-fused-madd
11187 @opindex mfused-madd
11188 Enable automatic generation of fused floating point multiply-add instructions
11189 if the ISA supports such instructions.  The -mfused-madd option is on by
11190 default.  The fused multiply-add instructions have a different
11191 rounding behavior compared to executing a multiply followed by an add.
11192 @end table
11193
11194 These @samp{-m} switches are supported in addition to the above
11195 on AMD x86-64 processors in 64-bit environments.
11196
11197 @table @gcctabopt
11198 @item -m32
11199 @itemx -m64
11200 @opindex m32
11201 @opindex m64
11202 Generate code for a 32-bit or 64-bit environment.
11203 The 32-bit environment sets int, long and pointer to 32 bits and
11204 generates code that runs on any i386 system.
11205 The 64-bit environment sets int to 32 bits and long and pointer
11206 to 64 bits and generates code for AMD's x86-64 architecture. For
11207 darwin only the -m64 option turns off the @option{-fno-pic} and
11208 @option{-mdynamic-no-pic} options.
11209
11210 @item -mno-red-zone
11211 @opindex no-red-zone
11212 Do not use a so called red zone for x86-64 code.  The red zone is mandated
11213 by the x86-64 ABI, it is a 128-byte area beyond the location of the
11214 stack pointer that will not be modified by signal or interrupt handlers
11215 and therefore can be used for temporary data without adjusting the stack
11216 pointer.  The flag @option{-mno-red-zone} disables this red zone.
11217
11218 @item -mcmodel=small
11219 @opindex mcmodel=small
11220 Generate code for the small code model: the program and its symbols must
11221 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
11222 Programs can be statically or dynamically linked.  This is the default
11223 code model.
11224
11225 @item -mcmodel=kernel
11226 @opindex mcmodel=kernel
11227 Generate code for the kernel code model.  The kernel runs in the
11228 negative 2 GB of the address space.
11229 This model has to be used for Linux kernel code.
11230
11231 @item -mcmodel=medium
11232 @opindex mcmodel=medium
11233 Generate code for the medium model: The program is linked in the lower 2
11234 GB of the address space but symbols can be located anywhere in the
11235 address space.  Programs can be statically or dynamically linked, but
11236 building of shared libraries are not supported with the medium model.
11237
11238 @item -mcmodel=large
11239 @opindex mcmodel=large
11240 Generate code for the large model: This model makes no assumptions
11241 about addresses and sizes of sections.
11242 @end table
11243
11244 @node IA-64 Options
11245 @subsection IA-64 Options
11246 @cindex IA-64 Options
11247
11248 These are the @samp{-m} options defined for the Intel IA-64 architecture.
11249
11250 @table @gcctabopt
11251 @item -mbig-endian
11252 @opindex mbig-endian
11253 Generate code for a big endian target.  This is the default for HP-UX@.
11254
11255 @item -mlittle-endian
11256 @opindex mlittle-endian
11257 Generate code for a little endian target.  This is the default for AIX5
11258 and GNU/Linux.
11259
11260 @item -mgnu-as
11261 @itemx -mno-gnu-as
11262 @opindex mgnu-as
11263 @opindex mno-gnu-as
11264 Generate (or don't) code for the GNU assembler.  This is the default.
11265 @c Also, this is the default if the configure option @option{--with-gnu-as}
11266 @c is used.
11267
11268 @item -mgnu-ld
11269 @itemx -mno-gnu-ld
11270 @opindex mgnu-ld
11271 @opindex mno-gnu-ld
11272 Generate (or don't) code for the GNU linker.  This is the default.
11273 @c Also, this is the default if the configure option @option{--with-gnu-ld}
11274 @c is used.
11275
11276 @item -mno-pic
11277 @opindex mno-pic
11278 Generate code that does not use a global pointer register.  The result
11279 is not position independent code, and violates the IA-64 ABI@.
11280
11281 @item -mvolatile-asm-stop
11282 @itemx -mno-volatile-asm-stop
11283 @opindex mvolatile-asm-stop
11284 @opindex mno-volatile-asm-stop
11285 Generate (or don't) a stop bit immediately before and after volatile asm
11286 statements.
11287
11288 @item -mregister-names
11289 @itemx -mno-register-names
11290 @opindex mregister-names
11291 @opindex mno-register-names
11292 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
11293 the stacked registers.  This may make assembler output more readable.
11294
11295 @item -mno-sdata
11296 @itemx -msdata
11297 @opindex mno-sdata
11298 @opindex msdata
11299 Disable (or enable) optimizations that use the small data section.  This may
11300 be useful for working around optimizer bugs.
11301
11302 @item -mconstant-gp
11303 @opindex mconstant-gp
11304 Generate code that uses a single constant global pointer value.  This is
11305 useful when compiling kernel code.
11306
11307 @item -mauto-pic
11308 @opindex mauto-pic
11309 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
11310 This is useful when compiling firmware code.
11311
11312 @item -minline-float-divide-min-latency
11313 @opindex minline-float-divide-min-latency
11314 Generate code for inline divides of floating point values
11315 using the minimum latency algorithm.
11316
11317 @item -minline-float-divide-max-throughput
11318 @opindex minline-float-divide-max-throughput
11319 Generate code for inline divides of floating point values
11320 using the maximum throughput algorithm.
11321
11322 @item -minline-int-divide-min-latency
11323 @opindex minline-int-divide-min-latency
11324 Generate code for inline divides of integer values
11325 using the minimum latency algorithm.
11326
11327 @item -minline-int-divide-max-throughput
11328 @opindex minline-int-divide-max-throughput
11329 Generate code for inline divides of integer values
11330 using the maximum throughput algorithm.
11331
11332 @item -minline-sqrt-min-latency
11333 @opindex minline-sqrt-min-latency
11334 Generate code for inline square roots
11335 using the minimum latency algorithm.
11336
11337 @item -minline-sqrt-max-throughput
11338 @opindex minline-sqrt-max-throughput
11339 Generate code for inline square roots
11340 using the maximum throughput algorithm.
11341
11342 @item -mno-dwarf2-asm
11343 @itemx -mdwarf2-asm
11344 @opindex mno-dwarf2-asm
11345 @opindex mdwarf2-asm
11346 Don't (or do) generate assembler code for the DWARF2 line number debugging
11347 info.  This may be useful when not using the GNU assembler.
11348
11349 @item -mearly-stop-bits
11350 @itemx -mno-early-stop-bits
11351 @opindex mearly-stop-bits
11352 @opindex mno-early-stop-bits
11353 Allow stop bits to be placed earlier than immediately preceding the
11354 instruction that triggered the stop bit.  This can improve instruction
11355 scheduling, but does not always do so.
11356
11357 @item -mfixed-range=@var{register-range}
11358 @opindex mfixed-range
11359 Generate code treating the given register range as fixed registers.
11360 A fixed register is one that the register allocator can not use.  This is
11361 useful when compiling kernel code.  A register range is specified as
11362 two registers separated by a dash.  Multiple register ranges can be
11363 specified separated by a comma.
11364
11365 @item -mtls-size=@var{tls-size}
11366 @opindex mtls-size
11367 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
11368 64.
11369
11370 @item -mtune=@var{cpu-type}
11371 @opindex mtune
11372 Tune the instruction scheduling for a particular CPU, Valid values are
11373 itanium, itanium1, merced, itanium2, and mckinley.
11374
11375 @item -mt
11376 @itemx -pthread
11377 @opindex mt
11378 @opindex pthread
11379 Add support for multithreading using the POSIX threads library.  This
11380 option sets flags for both the preprocessor and linker.  It does
11381 not affect the thread safety of object code produced by the compiler or
11382 that of libraries supplied with it.  These are HP-UX specific flags.
11383
11384 @item -milp32
11385 @itemx -mlp64
11386 @opindex milp32
11387 @opindex mlp64
11388 Generate code for a 32-bit or 64-bit environment.
11389 The 32-bit environment sets int, long and pointer to 32 bits.
11390 The 64-bit environment sets int to 32 bits and long and pointer
11391 to 64 bits.  These are HP-UX specific flags.
11392
11393 @item -mno-sched-br-data-spec
11394 @itemx -msched-br-data-spec
11395 @opindex mno-sched-br-data-spec
11396 @opindex msched-br-data-spec
11397 (Dis/En)able data speculative scheduling before reload.
11398 This will result in generation of the ld.a instructions and
11399 the corresponding check instructions (ld.c / chk.a).
11400 The default is 'disable'.
11401
11402 @item -msched-ar-data-spec
11403 @itemx -mno-sched-ar-data-spec
11404 @opindex msched-ar-data-spec
11405 @opindex mno-sched-ar-data-spec
11406 (En/Dis)able data speculative scheduling after reload.
11407 This will result in generation of the ld.a instructions and
11408 the corresponding check instructions (ld.c / chk.a).
11409 The default is 'enable'.
11410
11411 @item -mno-sched-control-spec
11412 @itemx -msched-control-spec
11413 @opindex mno-sched-control-spec
11414 @opindex msched-control-spec
11415 (Dis/En)able control speculative scheduling.  This feature is
11416 available only during region scheduling (i.e.@: before reload).
11417 This will result in generation of the ld.s instructions and
11418 the corresponding check instructions chk.s .
11419 The default is 'disable'.
11420
11421 @item -msched-br-in-data-spec
11422 @itemx -mno-sched-br-in-data-spec
11423 @opindex msched-br-in-data-spec
11424 @opindex mno-sched-br-in-data-spec
11425 (En/Dis)able speculative scheduling of the instructions that
11426 are dependent on the data speculative loads before reload.
11427 This is effective only with @option{-msched-br-data-spec} enabled.
11428 The default is 'enable'.
11429
11430 @item -msched-ar-in-data-spec
11431 @itemx -mno-sched-ar-in-data-spec
11432 @opindex msched-ar-in-data-spec
11433 @opindex mno-sched-ar-in-data-spec
11434 (En/Dis)able speculative scheduling of the instructions that
11435 are dependent on the data speculative loads after reload.
11436 This is effective only with @option{-msched-ar-data-spec} enabled.
11437 The default is 'enable'.
11438
11439 @item -msched-in-control-spec
11440 @itemx -mno-sched-in-control-spec
11441 @opindex msched-in-control-spec
11442 @opindex mno-sched-in-control-spec
11443 (En/Dis)able speculative scheduling of the instructions that
11444 are dependent on the control speculative loads.
11445 This is effective only with @option{-msched-control-spec} enabled.
11446 The default is 'enable'.
11447
11448 @item -msched-ldc
11449 @itemx -mno-sched-ldc
11450 @opindex msched-ldc
11451 @opindex mno-sched-ldc
11452 (En/Dis)able use of simple data speculation checks ld.c .
11453 If disabled, only chk.a instructions will be emitted to check
11454 data speculative loads.
11455 The default is 'enable'.
11456
11457 @item -mno-sched-control-ldc
11458 @itemx -msched-control-ldc
11459 @opindex mno-sched-control-ldc
11460 @opindex msched-control-ldc
11461 (Dis/En)able use of ld.c instructions to check control speculative loads.
11462 If enabled, in case of control speculative load with no speculatively
11463 scheduled dependent instructions this load will be emitted as ld.sa and
11464 ld.c will be used to check it.
11465 The default is 'disable'.
11466
11467 @item -mno-sched-spec-verbose
11468 @itemx -msched-spec-verbose
11469 @opindex mno-sched-spec-verbose
11470 @opindex msched-spec-verbose
11471 (Dis/En)able printing of the information about speculative motions.
11472
11473 @item -mno-sched-prefer-non-data-spec-insns
11474 @itemx -msched-prefer-non-data-spec-insns
11475 @opindex mno-sched-prefer-non-data-spec-insns
11476 @opindex msched-prefer-non-data-spec-insns
11477 If enabled, data speculative instructions will be chosen for schedule
11478 only if there are no other choices at the moment.  This will make
11479 the use of the data speculation much more conservative.
11480 The default is 'disable'.
11481
11482 @item -mno-sched-prefer-non-control-spec-insns
11483 @itemx -msched-prefer-non-control-spec-insns
11484 @opindex mno-sched-prefer-non-control-spec-insns
11485 @opindex msched-prefer-non-control-spec-insns
11486 If enabled, control speculative instructions will be chosen for schedule
11487 only if there are no other choices at the moment.  This will make
11488 the use of the control speculation much more conservative.
11489 The default is 'disable'.
11490
11491 @item -mno-sched-count-spec-in-critical-path
11492 @itemx -msched-count-spec-in-critical-path
11493 @opindex mno-sched-count-spec-in-critical-path
11494 @opindex msched-count-spec-in-critical-path
11495 If enabled, speculative dependencies will be considered during
11496 computation of the instructions priorities.  This will make the use of the
11497 speculation a bit more conservative.
11498 The default is 'disable'.
11499
11500 @end table
11501
11502 @node M32C Options
11503 @subsection M32C Options
11504 @cindex M32C options
11505
11506 @table @gcctabopt
11507 @item -mcpu=@var{name}
11508 @opindex mcpu=
11509 Select the CPU for which code is generated.  @var{name} may be one of
11510 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
11511 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
11512 the M32C/80 series.
11513
11514 @item -msim
11515 @opindex msim
11516 Specifies that the program will be run on the simulator.  This causes
11517 an alternate runtime library to be linked in which supports, for
11518 example, file I/O@.  You must not use this option when generating
11519 programs that will run on real hardware; you must provide your own
11520 runtime library for whatever I/O functions are needed.
11521
11522 @item -memregs=@var{number}
11523 @opindex memregs=
11524 Specifies the number of memory-based pseudo-registers GCC will use
11525 during code generation.  These pseudo-registers will be used like real
11526 registers, so there is a tradeoff between GCC's ability to fit the
11527 code into available registers, and the performance penalty of using
11528 memory instead of registers.  Note that all modules in a program must
11529 be compiled with the same value for this option.  Because of that, you
11530 must not use this option with the default runtime libraries gcc
11531 builds.
11532
11533 @end table
11534
11535 @node M32R/D Options
11536 @subsection M32R/D Options
11537 @cindex M32R/D options
11538
11539 These @option{-m} options are defined for Renesas M32R/D architectures:
11540
11541 @table @gcctabopt
11542 @item -m32r2
11543 @opindex m32r2
11544 Generate code for the M32R/2@.
11545
11546 @item -m32rx
11547 @opindex m32rx
11548 Generate code for the M32R/X@.
11549
11550 @item -m32r
11551 @opindex m32r
11552 Generate code for the M32R@.  This is the default.
11553
11554 @item -mmodel=small
11555 @opindex mmodel=small
11556 Assume all objects live in the lower 16MB of memory (so that their addresses
11557 can be loaded with the @code{ld24} instruction), and assume all subroutines
11558 are reachable with the @code{bl} instruction.
11559 This is the default.
11560
11561 The addressability of a particular object can be set with the
11562 @code{model} attribute.
11563
11564 @item -mmodel=medium
11565 @opindex mmodel=medium
11566 Assume objects may be anywhere in the 32-bit address space (the compiler
11567 will generate @code{seth/add3} instructions to load their addresses), and
11568 assume all subroutines are reachable with the @code{bl} instruction.
11569
11570 @item -mmodel=large
11571 @opindex mmodel=large
11572 Assume objects may be anywhere in the 32-bit address space (the compiler
11573 will generate @code{seth/add3} instructions to load their addresses), and
11574 assume subroutines may not be reachable with the @code{bl} instruction
11575 (the compiler will generate the much slower @code{seth/add3/jl}
11576 instruction sequence).
11577
11578 @item -msdata=none
11579 @opindex msdata=none
11580 Disable use of the small data area.  Variables will be put into
11581 one of @samp{.data}, @samp{bss}, or @samp{.rodata} (unless the
11582 @code{section} attribute has been specified).
11583 This is the default.
11584
11585 The small data area consists of sections @samp{.sdata} and @samp{.sbss}.
11586 Objects may be explicitly put in the small data area with the
11587 @code{section} attribute using one of these sections.
11588
11589 @item -msdata=sdata
11590 @opindex msdata=sdata
11591 Put small global and static data in the small data area, but do not
11592 generate special code to reference them.
11593
11594 @item -msdata=use
11595 @opindex msdata=use
11596 Put small global and static data in the small data area, and generate
11597 special instructions to reference them.
11598
11599 @item -G @var{num}
11600 @opindex G
11601 @cindex smaller data references
11602 Put global and static objects less than or equal to @var{num} bytes
11603 into the small data or bss sections instead of the normal data or bss
11604 sections.  The default value of @var{num} is 8.
11605 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
11606 for this option to have any effect.
11607
11608 All modules should be compiled with the same @option{-G @var{num}} value.
11609 Compiling with different values of @var{num} may or may not work; if it
11610 doesn't the linker will give an error message---incorrect code will not be
11611 generated.
11612
11613 @item -mdebug
11614 @opindex mdebug
11615 Makes the M32R specific code in the compiler display some statistics
11616 that might help in debugging programs.
11617
11618 @item -malign-loops
11619 @opindex malign-loops
11620 Align all loops to a 32-byte boundary.
11621
11622 @item -mno-align-loops
11623 @opindex mno-align-loops
11624 Do not enforce a 32-byte alignment for loops.  This is the default.
11625
11626 @item -missue-rate=@var{number}
11627 @opindex missue-rate=@var{number}
11628 Issue @var{number} instructions per cycle.  @var{number} can only be 1
11629 or 2.
11630
11631 @item -mbranch-cost=@var{number}
11632 @opindex mbranch-cost=@var{number}
11633 @var{number} can only be 1 or 2.  If it is 1 then branches will be
11634 preferred over conditional code, if it is 2, then the opposite will
11635 apply.
11636
11637 @item -mflush-trap=@var{number}
11638 @opindex mflush-trap=@var{number}
11639 Specifies the trap number to use to flush the cache.  The default is
11640 12.  Valid numbers are between 0 and 15 inclusive.
11641
11642 @item -mno-flush-trap
11643 @opindex mno-flush-trap
11644 Specifies that the cache cannot be flushed by using a trap.
11645
11646 @item -mflush-func=@var{name}
11647 @opindex mflush-func=@var{name}
11648 Specifies the name of the operating system function to call to flush
11649 the cache.  The default is @emph{_flush_cache}, but a function call
11650 will only be used if a trap is not available.
11651
11652 @item -mno-flush-func
11653 @opindex mno-flush-func
11654 Indicates that there is no OS function for flushing the cache.
11655
11656 @end table
11657
11658 @node M680x0 Options
11659 @subsection M680x0 Options
11660 @cindex M680x0 options
11661
11662 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
11663 The default settings depend on which architecture was selected when
11664 the compiler was configured; the defaults for the most common choices
11665 are given below.
11666
11667 @table @gcctabopt
11668 @item -march=@var{arch}
11669 @opindex march
11670 Generate code for a specific M680x0 or ColdFire instruction set
11671 architecture.  Permissible values of @var{arch} for M680x0
11672 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
11673 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
11674 architectures are selected according to Freescale's ISA classification
11675 and the permissible values are: @samp{isaa}, @samp{isaaplus},
11676 @samp{isab} and @samp{isac}.
11677
11678 gcc defines a macro @samp{__mcf@var{arch}__} whenever it is generating
11679 code for a ColdFire target.  The @var{arch} in this macro is one of the
11680 @option{-march} arguments given above.
11681
11682 When used together, @option{-march} and @option{-mtune} select code
11683 that runs on a family of similar processors but that is optimized
11684 for a particular microarchitecture.
11685
11686 @item -mcpu=@var{cpu}
11687 @opindex mcpu
11688 Generate code for a specific M680x0 or ColdFire processor.
11689 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
11690 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
11691 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
11692 below, which also classifies the CPUs into families:
11693
11694 @multitable @columnfractions 0.20 0.80
11695 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
11696 @item @samp{51qe} @tab @samp{51qe}
11697 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
11698 @item @samp{5206e} @tab @samp{5206e}
11699 @item @samp{5208} @tab @samp{5207} @samp{5208}
11700 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
11701 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
11702 @item @samp{5216} @tab @samp{5214} @samp{5216}
11703 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
11704 @item @samp{5225} @tab @samp{5224} @samp{5225}
11705 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
11706 @item @samp{5249} @tab @samp{5249}
11707 @item @samp{5250} @tab @samp{5250}
11708 @item @samp{5271} @tab @samp{5270} @samp{5271}
11709 @item @samp{5272} @tab @samp{5272}
11710 @item @samp{5275} @tab @samp{5274} @samp{5275}
11711 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
11712 @item @samp{5307} @tab @samp{5307}
11713 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
11714 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
11715 @item @samp{5407} @tab @samp{5407}
11716 @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}
11717 @end multitable
11718
11719 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
11720 @var{arch} is compatible with @var{cpu}.  Other combinations of
11721 @option{-mcpu} and @option{-march} are rejected.
11722
11723 gcc defines the macro @samp{__mcf_cpu_@var{cpu}} when ColdFire target
11724 @var{cpu} is selected.  It also defines @samp{__mcf_family_@var{family}},
11725 where the value of @var{family} is given by the table above.
11726
11727 @item -mtune=@var{tune}
11728 @opindex mtune
11729 Tune the code for a particular microarchitecture, within the
11730 constraints set by @option{-march} and @option{-mcpu}.
11731 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
11732 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
11733 and @samp{cpu32}.  The ColdFire microarchitectures
11734 are: @samp{cfv1}, @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
11735
11736 You can also use @option{-mtune=68020-40} for code that needs
11737 to run relatively well on 68020, 68030 and 68040 targets.
11738 @option{-mtune=68020-60} is similar but includes 68060 targets
11739 as well.  These two options select the same tuning decisions as
11740 @option{-m68020-40} and @option{-m68020-60} respectively.
11741
11742 gcc defines the macros @samp{__mc@var{arch}} and @samp{__mc@var{arch}__}
11743 when tuning for 680x0 architecture @var{arch}.  It also defines
11744 @samp{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
11745 option is used.  If gcc is tuning for a range of architectures,
11746 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
11747 it defines the macros for every architecture in the range.
11748
11749 gcc also defines the macro @samp{__m@var{uarch}__} when tuning for
11750 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
11751 of the arguments given above.
11752
11753 @item -m68000
11754 @itemx -mc68000
11755 @opindex m68000
11756 @opindex mc68000
11757 Generate output for a 68000.  This is the default
11758 when the compiler is configured for 68000-based systems.
11759 It is equivalent to @option{-march=68000}.
11760
11761 Use this option for microcontrollers with a 68000 or EC000 core,
11762 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
11763
11764 @item -m68010
11765 @opindex m68010
11766 Generate output for a 68010.  This is the default
11767 when the compiler is configured for 68010-based systems.
11768 It is equivalent to @option{-march=68010}.
11769
11770 @item -m68020
11771 @itemx -mc68020
11772 @opindex m68020
11773 @opindex mc68020
11774 Generate output for a 68020.  This is the default
11775 when the compiler is configured for 68020-based systems.
11776 It is equivalent to @option{-march=68020}.
11777
11778 @item -m68030
11779 @opindex m68030
11780 Generate output for a 68030.  This is the default when the compiler is
11781 configured for 68030-based systems.  It is equivalent to
11782 @option{-march=68030}.
11783
11784 @item -m68040
11785 @opindex m68040
11786 Generate output for a 68040.  This is the default when the compiler is
11787 configured for 68040-based systems.  It is equivalent to
11788 @option{-march=68040}.
11789
11790 This option inhibits the use of 68881/68882 instructions that have to be
11791 emulated by software on the 68040.  Use this option if your 68040 does not
11792 have code to emulate those instructions.
11793
11794 @item -m68060
11795 @opindex m68060
11796 Generate output for a 68060.  This is the default when the compiler is
11797 configured for 68060-based systems.  It is equivalent to
11798 @option{-march=68060}.
11799
11800 This option inhibits the use of 68020 and 68881/68882 instructions that
11801 have to be emulated by software on the 68060.  Use this option if your 68060
11802 does not have code to emulate those instructions.
11803
11804 @item -mcpu32
11805 @opindex mcpu32
11806 Generate output for a CPU32.  This is the default
11807 when the compiler is configured for CPU32-based systems.
11808 It is equivalent to @option{-march=cpu32}.
11809
11810 Use this option for microcontrollers with a
11811 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
11812 68336, 68340, 68341, 68349 and 68360.
11813
11814 @item -m5200
11815 @opindex m5200
11816 Generate output for a 520X ColdFire CPU@.  This is the default
11817 when the compiler is configured for 520X-based systems.
11818 It is equivalent to @option{-mcpu=5206}, and is now deprecated
11819 in favor of that option.
11820
11821 Use this option for microcontroller with a 5200 core, including
11822 the MCF5202, MCF5203, MCF5204 and MCF5206.
11823
11824 @item -m5206e
11825 @opindex m5206e
11826 Generate output for a 5206e ColdFire CPU@.  The option is now
11827 deprecated in favor of the equivalent @option{-mcpu=5206e}.
11828
11829 @item -m528x
11830 @opindex m528x
11831 Generate output for a member of the ColdFire 528X family.
11832 The option is now deprecated in favor of the equivalent
11833 @option{-mcpu=528x}.
11834
11835 @item -m5307
11836 @opindex m5307
11837 Generate output for a ColdFire 5307 CPU@.  The option is now deprecated
11838 in favor of the equivalent @option{-mcpu=5307}.
11839
11840 @item -m5407
11841 @opindex m5407
11842 Generate output for a ColdFire 5407 CPU@.  The option is now deprecated
11843 in favor of the equivalent @option{-mcpu=5407}.
11844
11845 @item -mcfv4e
11846 @opindex mcfv4e
11847 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
11848 This includes use of hardware floating point instructions.
11849 The option is equivalent to @option{-mcpu=547x}, and is now
11850 deprecated in favor of that option.
11851
11852 @item -m68020-40
11853 @opindex m68020-40
11854 Generate output for a 68040, without using any of the new instructions.
11855 This results in code which can run relatively efficiently on either a
11856 68020/68881 or a 68030 or a 68040.  The generated code does use the
11857 68881 instructions that are emulated on the 68040.
11858
11859 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
11860
11861 @item -m68020-60
11862 @opindex m68020-60
11863 Generate output for a 68060, without using any of the new instructions.
11864 This results in code which can run relatively efficiently on either a
11865 68020/68881 or a 68030 or a 68040.  The generated code does use the
11866 68881 instructions that are emulated on the 68060.
11867
11868 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
11869
11870 @item -mhard-float
11871 @itemx -m68881
11872 @opindex mhard-float
11873 @opindex m68881
11874 Generate floating-point instructions.  This is the default for 68020
11875 and above, and for ColdFire devices that have an FPU@.  It defines the
11876 macro @samp{__HAVE_68881__} on M680x0 targets and @samp{__mcffpu__}
11877 on ColdFire targets.
11878
11879 @item -msoft-float
11880 @opindex msoft-float
11881 Do not generate floating-point instructions; use library calls instead.
11882 This is the default for 68000, 68010, and 68832 targets.  It is also
11883 the default for ColdFire devices that have no FPU.
11884
11885 @item -mdiv
11886 @itemx -mno-div
11887 @opindex mdiv
11888 @opindex mno-div
11889 Generate (do not generate) ColdFire hardware divide and remainder
11890 instructions.  If @option{-march} is used without @option{-mcpu},
11891 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
11892 architectures.  Otherwise, the default is taken from the target CPU
11893 (either the default CPU, or the one specified by @option{-mcpu}).  For
11894 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
11895 @option{-mcpu=5206e}.
11896
11897 gcc defines the macro @samp{__mcfhwdiv__} when this option is enabled.
11898
11899 @item -mshort
11900 @opindex mshort
11901 Consider type @code{int} to be 16 bits wide, like @code{short int}.
11902 Additionally, parameters passed on the stack are also aligned to a
11903 16-bit boundary even on targets whose API mandates promotion to 32-bit.
11904
11905 @item -mno-short
11906 @opindex mno-short
11907 Do not consider type @code{int} to be 16 bits wide.  This is the default.
11908
11909 @item -mnobitfield
11910 @itemx -mno-bitfield
11911 @opindex mnobitfield
11912 @opindex mno-bitfield
11913 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
11914 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
11915
11916 @item -mbitfield
11917 @opindex mbitfield
11918 Do use the bit-field instructions.  The @option{-m68020} option implies
11919 @option{-mbitfield}.  This is the default if you use a configuration
11920 designed for a 68020.
11921
11922 @item -mrtd
11923 @opindex mrtd
11924 Use a different function-calling convention, in which functions
11925 that take a fixed number of arguments return with the @code{rtd}
11926 instruction, which pops their arguments while returning.  This
11927 saves one instruction in the caller since there is no need to pop
11928 the arguments there.
11929
11930 This calling convention is incompatible with the one normally
11931 used on Unix, so you cannot use it if you need to call libraries
11932 compiled with the Unix compiler.
11933
11934 Also, you must provide function prototypes for all functions that
11935 take variable numbers of arguments (including @code{printf});
11936 otherwise incorrect code will be generated for calls to those
11937 functions.
11938
11939 In addition, seriously incorrect code will result if you call a
11940 function with too many arguments.  (Normally, extra arguments are
11941 harmlessly ignored.)
11942
11943 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
11944 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
11945
11946 @item -mno-rtd
11947 @opindex mno-rtd
11948 Do not use the calling conventions selected by @option{-mrtd}.
11949 This is the default.
11950
11951 @item -malign-int
11952 @itemx -mno-align-int
11953 @opindex malign-int
11954 @opindex mno-align-int
11955 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
11956 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
11957 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
11958 Aligning variables on 32-bit boundaries produces code that runs somewhat
11959 faster on processors with 32-bit busses at the expense of more memory.
11960
11961 @strong{Warning:} if you use the @option{-malign-int} switch, GCC will
11962 align structures containing the above types  differently than
11963 most published application binary interface specifications for the m68k.
11964
11965 @item -mpcrel
11966 @opindex mpcrel
11967 Use the pc-relative addressing mode of the 68000 directly, instead of
11968 using a global offset table.  At present, this option implies @option{-fpic},
11969 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
11970 not presently supported with @option{-mpcrel}, though this could be supported for
11971 68020 and higher processors.
11972
11973 @item -mno-strict-align
11974 @itemx -mstrict-align
11975 @opindex mno-strict-align
11976 @opindex mstrict-align
11977 Do not (do) assume that unaligned memory references will be handled by
11978 the system.
11979
11980 @item -msep-data
11981 Generate code that allows the data segment to be located in a different
11982 area of memory from the text segment.  This allows for execute in place in
11983 an environment without virtual memory management.  This option implies
11984 @option{-fPIC}.
11985
11986 @item -mno-sep-data
11987 Generate code that assumes that the data segment follows the text segment.
11988 This is the default.
11989
11990 @item -mid-shared-library
11991 Generate code that supports shared libraries via the library ID method.
11992 This allows for execute in place and shared libraries in an environment
11993 without virtual memory management.  This option implies @option{-fPIC}.
11994
11995 @item -mno-id-shared-library
11996 Generate code that doesn't assume ID based shared libraries are being used.
11997 This is the default.
11998
11999 @item -mshared-library-id=n
12000 Specified the identification number of the ID based shared library being
12001 compiled.  Specifying a value of 0 will generate more compact code, specifying
12002 other values will force the allocation of that number to the current
12003 library but is no more space or time efficient than omitting this option.
12004
12005 @item -mxgot
12006 @itemx -mno-xgot
12007 @opindex mxgot
12008 @opindex mno-xgot
12009 When generating position-independent code for ColdFire, generate code
12010 that works if the GOT has more than 8192 entries.  This code is
12011 larger and slower than code generated without this option.  On M680x0
12012 processors, this option is not needed; @option{-fPIC} suffices.
12013
12014 GCC normally uses a single instruction to load values from the GOT@.
12015 While this is relatively efficient, it only works if the GOT
12016 is smaller than about 64k.  Anything larger causes the linker
12017 to report an error such as:
12018
12019 @cindex relocation truncated to fit (ColdFire)
12020 @smallexample
12021 relocation truncated to fit: R_68K_GOT16O foobar
12022 @end smallexample
12023
12024 If this happens, you should recompile your code with @option{-mxgot}.
12025 It should then work with very large GOTs.  However, code generated with
12026 @option{-mxgot} is less efficient, since it takes 4 instructions to fetch
12027 the value of a global symbol.
12028
12029 Note that some linkers, including newer versions of the GNU linker,
12030 can create multiple GOTs and sort GOT entries.  If you have such a linker,
12031 you should only need to use @option{-mxgot} when compiling a single
12032 object file that accesses more than 8192 GOT entries.  Very few do.
12033
12034 These options have no effect unless GCC is generating
12035 position-independent code.
12036
12037 @end table
12038
12039 @node M68hc1x Options
12040 @subsection M68hc1x Options
12041 @cindex M68hc1x options
12042
12043 These are the @samp{-m} options defined for the 68hc11 and 68hc12
12044 microcontrollers.  The default values for these options depends on
12045 which style of microcontroller was selected when the compiler was configured;
12046 the defaults for the most common choices are given below.
12047
12048 @table @gcctabopt
12049 @item -m6811
12050 @itemx -m68hc11
12051 @opindex m6811
12052 @opindex m68hc11
12053 Generate output for a 68HC11.  This is the default
12054 when the compiler is configured for 68HC11-based systems.
12055
12056 @item -m6812
12057 @itemx -m68hc12
12058 @opindex m6812
12059 @opindex m68hc12
12060 Generate output for a 68HC12.  This is the default
12061 when the compiler is configured for 68HC12-based systems.
12062
12063 @item -m68S12
12064 @itemx -m68hcs12
12065 @opindex m68S12
12066 @opindex m68hcs12
12067 Generate output for a 68HCS12.
12068
12069 @item -mauto-incdec
12070 @opindex mauto-incdec
12071 Enable the use of 68HC12 pre and post auto-increment and auto-decrement
12072 addressing modes.
12073
12074 @item -minmax
12075 @itemx -nominmax
12076 @opindex minmax
12077 @opindex mnominmax
12078 Enable the use of 68HC12 min and max instructions.
12079
12080 @item -mlong-calls
12081 @itemx -mno-long-calls
12082 @opindex mlong-calls
12083 @opindex mno-long-calls
12084 Treat all calls as being far away (near).  If calls are assumed to be
12085 far away, the compiler will use the @code{call} instruction to
12086 call a function and the @code{rtc} instruction for returning.
12087
12088 @item -mshort
12089 @opindex mshort
12090 Consider type @code{int} to be 16 bits wide, like @code{short int}.
12091
12092 @item -msoft-reg-count=@var{count}
12093 @opindex msoft-reg-count
12094 Specify the number of pseudo-soft registers which are used for the
12095 code generation.  The maximum number is 32.  Using more pseudo-soft
12096 register may or may not result in better code depending on the program.
12097 The default is 4 for 68HC11 and 2 for 68HC12.
12098
12099 @end table
12100
12101 @node MCore Options
12102 @subsection MCore Options
12103 @cindex MCore options
12104
12105 These are the @samp{-m} options defined for the Motorola M*Core
12106 processors.
12107
12108 @table @gcctabopt
12109
12110 @item -mhardlit
12111 @itemx -mno-hardlit
12112 @opindex mhardlit
12113 @opindex mno-hardlit
12114 Inline constants into the code stream if it can be done in two
12115 instructions or less.
12116
12117 @item -mdiv
12118 @itemx -mno-div
12119 @opindex mdiv
12120 @opindex mno-div
12121 Use the divide instruction.  (Enabled by default).
12122
12123 @item -mrelax-immediate
12124 @itemx -mno-relax-immediate
12125 @opindex mrelax-immediate
12126 @opindex mno-relax-immediate
12127 Allow arbitrary sized immediates in bit operations.
12128
12129 @item -mwide-bitfields
12130 @itemx -mno-wide-bitfields
12131 @opindex mwide-bitfields
12132 @opindex mno-wide-bitfields
12133 Always treat bit-fields as int-sized.
12134
12135 @item -m4byte-functions
12136 @itemx -mno-4byte-functions
12137 @opindex m4byte-functions
12138 @opindex mno-4byte-functions
12139 Force all functions to be aligned to a four byte boundary.
12140
12141 @item -mcallgraph-data
12142 @itemx -mno-callgraph-data
12143 @opindex mcallgraph-data
12144 @opindex mno-callgraph-data
12145 Emit callgraph information.
12146
12147 @item -mslow-bytes
12148 @itemx -mno-slow-bytes
12149 @opindex mslow-bytes
12150 @opindex mno-slow-bytes
12151 Prefer word access when reading byte quantities.
12152
12153 @item -mlittle-endian
12154 @itemx -mbig-endian
12155 @opindex mlittle-endian
12156 @opindex mbig-endian
12157 Generate code for a little endian target.
12158
12159 @item -m210
12160 @itemx -m340
12161 @opindex m210
12162 @opindex m340
12163 Generate code for the 210 processor.
12164 @end table
12165
12166 @node MIPS Options
12167 @subsection MIPS Options
12168 @cindex MIPS options
12169
12170 @table @gcctabopt
12171
12172 @item -EB
12173 @opindex EB
12174 Generate big-endian code.
12175
12176 @item -EL
12177 @opindex EL
12178 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
12179 configurations.
12180
12181 @item -march=@var{arch}
12182 @opindex march
12183 Generate code that will run on @var{arch}, which can be the name of a
12184 generic MIPS ISA, or the name of a particular processor.
12185 The ISA names are:
12186 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
12187 @samp{mips32}, @samp{mips32r2}, @samp{mips64} and @samp{mips64r2}.
12188 The processor names are:
12189 @samp{4kc}, @samp{4km}, @samp{4kp}, @samp{4ksc},
12190 @samp{4kec}, @samp{4kem}, @samp{4kep}, @samp{4ksd},
12191 @samp{5kc}, @samp{5kf},
12192 @samp{20kc},
12193 @samp{24kc}, @samp{24kf2_1}, @samp{24kf1_1},
12194 @samp{24kec}, @samp{24kef2_1}, @samp{24kef1_1},
12195 @samp{34kc}, @samp{34kf2_1}, @samp{34kf1_1},
12196 @samp{74kc}, @samp{74kf2_1}, @samp{74kf1_1}, @samp{74kf3_2},
12197 @samp{loongson2e}, @samp{loongson2f},
12198 @samp{m4k},
12199 @samp{octeon},
12200 @samp{orion},
12201 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
12202 @samp{r4600}, @samp{r4650}, @samp{r6000}, @samp{r8000},
12203 @samp{rm7000}, @samp{rm9000},
12204 @samp{sb1},
12205 @samp{sr71000},
12206 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
12207 @samp{vr5000}, @samp{vr5400}, @samp{vr5500}
12208 and @samp{xlr}.
12209 The special value @samp{from-abi} selects the
12210 most compatible architecture for the selected ABI (that is,
12211 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
12212
12213 Native Linux/GNU toolchains also support the value @samp{native},
12214 which selects the best architecture option for the host processor.
12215 @option{-march=native} has no effect if GCC does not recognize
12216 the processor.
12217
12218 In processor names, a final @samp{000} can be abbreviated as @samp{k}
12219 (for example, @samp{-march=r2k}).  Prefixes are optional, and
12220 @samp{vr} may be written @samp{r}.
12221
12222 Names of the form @samp{@var{n}f2_1} refer to processors with
12223 FPUs clocked at half the rate of the core, names of the form
12224 @samp{@var{n}f1_1} refer to processors with FPUs clocked at the same
12225 rate as the core, and names of the form @samp{@var{n}f3_2} refer to
12226 processors with FPUs clocked a ratio of 3:2 with respect to the core.
12227 For compatibility reasons, @samp{@var{n}f} is accepted as a synonym
12228 for @samp{@var{n}f2_1} while @samp{@var{n}x} and @samp{@var{b}fx} are
12229 accepted as synonyms for @samp{@var{n}f1_1}.
12230
12231 GCC defines two macros based on the value of this option.  The first
12232 is @samp{_MIPS_ARCH}, which gives the name of target architecture, as
12233 a string.  The second has the form @samp{_MIPS_ARCH_@var{foo}},
12234 where @var{foo} is the capitalized value of @samp{_MIPS_ARCH}@.
12235 For example, @samp{-march=r2000} will set @samp{_MIPS_ARCH}
12236 to @samp{"r2000"} and define the macro @samp{_MIPS_ARCH_R2000}.
12237
12238 Note that the @samp{_MIPS_ARCH} macro uses the processor names given
12239 above.  In other words, it will have the full prefix and will not
12240 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
12241 the macro names the resolved architecture (either @samp{"mips1"} or
12242 @samp{"mips3"}).  It names the default architecture when no
12243 @option{-march} option is given.
12244
12245 @item -mtune=@var{arch}
12246 @opindex mtune
12247 Optimize for @var{arch}.  Among other things, this option controls
12248 the way instructions are scheduled, and the perceived cost of arithmetic
12249 operations.  The list of @var{arch} values is the same as for
12250 @option{-march}.
12251
12252 When this option is not used, GCC will optimize for the processor
12253 specified by @option{-march}.  By using @option{-march} and
12254 @option{-mtune} together, it is possible to generate code that will
12255 run on a family of processors, but optimize the code for one
12256 particular member of that family.
12257
12258 @samp{-mtune} defines the macros @samp{_MIPS_TUNE} and
12259 @samp{_MIPS_TUNE_@var{foo}}, which work in the same way as the
12260 @samp{-march} ones described above.
12261
12262 @item -mips1
12263 @opindex mips1
12264 Equivalent to @samp{-march=mips1}.
12265
12266 @item -mips2
12267 @opindex mips2
12268 Equivalent to @samp{-march=mips2}.
12269
12270 @item -mips3
12271 @opindex mips3
12272 Equivalent to @samp{-march=mips3}.
12273
12274 @item -mips4
12275 @opindex mips4
12276 Equivalent to @samp{-march=mips4}.
12277
12278 @item -mips32
12279 @opindex mips32
12280 Equivalent to @samp{-march=mips32}.
12281
12282 @item -mips32r2
12283 @opindex mips32r2
12284 Equivalent to @samp{-march=mips32r2}.
12285
12286 @item -mips64
12287 @opindex mips64
12288 Equivalent to @samp{-march=mips64}.
12289
12290 @item -mips64r2
12291 @opindex mips64r2
12292 Equivalent to @samp{-march=mips64r2}.
12293
12294 @item -mips16
12295 @itemx -mno-mips16
12296 @opindex mips16
12297 @opindex mno-mips16
12298 Generate (do not generate) MIPS16 code.  If GCC is targetting a
12299 MIPS32 or MIPS64 architecture, it will make use of the MIPS16e ASE@.
12300
12301 MIPS16 code generation can also be controlled on a per-function basis
12302 by means of @code{mips16} and @code{nomips16} attributes.  
12303 @xref{Function Attributes}, for more information.
12304
12305 @item -mflip-mips16
12306 @opindex mflip-mips16
12307 Generate MIPS16 code on alternating functions.  This option is provided
12308 for regression testing of mixed MIPS16/non-MIPS16 code generation, and is
12309 not intended for ordinary use in compiling user code.
12310
12311 @item -minterlink-mips16
12312 @itemx -mno-interlink-mips16
12313 @opindex minterlink-mips16
12314 @opindex mno-interlink-mips16
12315 Require (do not require) that non-MIPS16 code be link-compatible with
12316 MIPS16 code.
12317
12318 For example, non-MIPS16 code cannot jump directly to MIPS16 code;
12319 it must either use a call or an indirect jump.  @option{-minterlink-mips16}
12320 therefore disables direct jumps unless GCC knows that the target of the
12321 jump is not MIPS16.
12322
12323 @item -mabi=32
12324 @itemx -mabi=o64
12325 @itemx -mabi=n32
12326 @itemx -mabi=64
12327 @itemx -mabi=eabi
12328 @opindex mabi=32
12329 @opindex mabi=o64
12330 @opindex mabi=n32
12331 @opindex mabi=64
12332 @opindex mabi=eabi
12333 Generate code for the given ABI@.
12334
12335 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
12336 generates 64-bit code when you select a 64-bit architecture, but you
12337 can use @option{-mgp32} to get 32-bit code instead.
12338
12339 For information about the O64 ABI, see
12340 @w{@uref{http://gcc.gnu.org/projects/mipso64-abi.html}}.
12341
12342 GCC supports a variant of the o32 ABI in which floating-point registers
12343 are 64 rather than 32 bits wide.  You can select this combination with
12344 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @samp{mthc1}
12345 and @samp{mfhc1} instructions and is therefore only supported for
12346 MIPS32R2 processors.
12347
12348 The register assignments for arguments and return values remain the
12349 same, but each scalar value is passed in a single 64-bit register
12350 rather than a pair of 32-bit registers.  For example, scalar
12351 floating-point values are returned in @samp{$f0} only, not a
12352 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
12353 remains the same, but all 64 bits are saved.
12354
12355 @item -mabicalls
12356 @itemx -mno-abicalls
12357 @opindex mabicalls
12358 @opindex mno-abicalls
12359 Generate (do not generate) code that is suitable for SVR4-style
12360 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
12361 systems.
12362
12363 @item -mshared
12364 @itemx -mno-shared
12365 Generate (do not generate) code that is fully position-independent,
12366 and that can therefore be linked into shared libraries.  This option
12367 only affects @option{-mabicalls}.
12368
12369 All @option{-mabicalls} code has traditionally been position-independent,
12370 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
12371 as an extension, the GNU toolchain allows executables to use absolute
12372 accesses for locally-binding symbols.  It can also use shorter GP
12373 initialization sequences and generate direct calls to locally-defined
12374 functions.  This mode is selected by @option{-mno-shared}.
12375
12376 @option{-mno-shared} depends on binutils 2.16 or higher and generates
12377 objects that can only be linked by the GNU linker.  However, the option
12378 does not affect the ABI of the final executable; it only affects the ABI
12379 of relocatable objects.  Using @option{-mno-shared} will generally make
12380 executables both smaller and quicker.
12381
12382 @option{-mshared} is the default.
12383
12384 @item -mplt
12385 @itemx -mno-plt
12386 @opindex mplt
12387 @opindex mno-plt
12388 Assume (do not assume) that the static and dynamic linkers
12389 support PLTs and copy relocations.  This option only affects
12390 @samp{-mno-shared -mabicalls}.  For the n64 ABI, this option
12391 has no effect without @samp{-msym32}.
12392
12393 You can make @option{-mplt} the default by configuring
12394 GCC with @option{--with-mips-plt}.  The default is
12395 @option{-mno-plt} otherwise.
12396
12397 @item -mxgot
12398 @itemx -mno-xgot
12399 @opindex mxgot
12400 @opindex mno-xgot
12401 Lift (do not lift) the usual restrictions on the size of the global
12402 offset table.
12403
12404 GCC normally uses a single instruction to load values from the GOT@.
12405 While this is relatively efficient, it will only work if the GOT
12406 is smaller than about 64k.  Anything larger will cause the linker
12407 to report an error such as:
12408
12409 @cindex relocation truncated to fit (MIPS)
12410 @smallexample
12411 relocation truncated to fit: R_MIPS_GOT16 foobar
12412 @end smallexample
12413
12414 If this happens, you should recompile your code with @option{-mxgot}.
12415 It should then work with very large GOTs, although it will also be
12416 less efficient, since it will take three instructions to fetch the
12417 value of a global symbol.
12418
12419 Note that some linkers can create multiple GOTs.  If you have such a
12420 linker, you should only need to use @option{-mxgot} when a single object
12421 file accesses more than 64k's worth of GOT entries.  Very few do.
12422
12423 These options have no effect unless GCC is generating position
12424 independent code.
12425
12426 @item -mgp32
12427 @opindex mgp32
12428 Assume that general-purpose registers are 32 bits wide.
12429
12430 @item -mgp64
12431 @opindex mgp64
12432 Assume that general-purpose registers are 64 bits wide.
12433
12434 @item -mfp32
12435 @opindex mfp32
12436 Assume that floating-point registers are 32 bits wide.
12437
12438 @item -mfp64
12439 @opindex mfp64
12440 Assume that floating-point registers are 64 bits wide.
12441
12442 @item -mhard-float
12443 @opindex mhard-float
12444 Use floating-point coprocessor instructions.
12445
12446 @item -msoft-float
12447 @opindex msoft-float
12448 Do not use floating-point coprocessor instructions.  Implement
12449 floating-point calculations using library calls instead.
12450
12451 @item -msingle-float
12452 @opindex msingle-float
12453 Assume that the floating-point coprocessor only supports single-precision
12454 operations.
12455
12456 @item -mdouble-float
12457 @opindex mdouble-float
12458 Assume that the floating-point coprocessor supports double-precision
12459 operations.  This is the default.
12460
12461 @item -mllsc
12462 @itemx -mno-llsc
12463 @opindex mllsc
12464 @opindex mno-llsc
12465 Use (do not use) @samp{ll}, @samp{sc}, and @samp{sync} instructions to
12466 implement atomic memory built-in functions.  When neither option is
12467 specified, GCC will use the instructions if the target architecture
12468 supports them.
12469
12470 @option{-mllsc} is useful if the runtime environment can emulate the
12471 instructions and @option{-mno-llsc} can be useful when compiling for
12472 nonstandard ISAs.  You can make either option the default by
12473 configuring GCC with @option{--with-llsc} and @option{--without-llsc}
12474 respectively.  @option{--with-llsc} is the default for some
12475 configurations; see the installation documentation for details.
12476
12477 @item -mdsp
12478 @itemx -mno-dsp
12479 @opindex mdsp
12480 @opindex mno-dsp
12481 Use (do not use) revision 1 of the MIPS DSP ASE@.
12482 @xref{MIPS DSP Built-in Functions}.  This option defines the
12483 preprocessor macro @samp{__mips_dsp}.  It also defines
12484 @samp{__mips_dsp_rev} to 1.
12485
12486 @item -mdspr2
12487 @itemx -mno-dspr2
12488 @opindex mdspr2
12489 @opindex mno-dspr2
12490 Use (do not use) revision 2 of the MIPS DSP ASE@.
12491 @xref{MIPS DSP Built-in Functions}.  This option defines the
12492 preprocessor macros @samp{__mips_dsp} and @samp{__mips_dspr2}.
12493 It also defines @samp{__mips_dsp_rev} to 2.
12494
12495 @item -msmartmips
12496 @itemx -mno-smartmips
12497 @opindex msmartmips
12498 @opindex mno-smartmips
12499 Use (do not use) the MIPS SmartMIPS ASE.
12500
12501 @item -mpaired-single
12502 @itemx -mno-paired-single
12503 @opindex mpaired-single
12504 @opindex mno-paired-single
12505 Use (do not use) paired-single floating-point instructions.
12506 @xref{MIPS Paired-Single Support}.  This option requires
12507 hardware floating-point support to be enabled.
12508
12509 @item -mdmx
12510 @itemx -mno-mdmx
12511 @opindex mdmx
12512 @opindex mno-mdmx
12513 Use (do not use) MIPS Digital Media Extension instructions.
12514 This option can only be used when generating 64-bit code and requires
12515 hardware floating-point support to be enabled.
12516
12517 @item -mips3d
12518 @itemx -mno-mips3d
12519 @opindex mips3d
12520 @opindex mno-mips3d
12521 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
12522 The option @option{-mips3d} implies @option{-mpaired-single}.
12523
12524 @item -mmt
12525 @itemx -mno-mt
12526 @opindex mmt
12527 @opindex mno-mt
12528 Use (do not use) MT Multithreading instructions.
12529
12530 @item -mlong64
12531 @opindex mlong64
12532 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
12533 an explanation of the default and the way that the pointer size is
12534 determined.
12535
12536 @item -mlong32
12537 @opindex mlong32
12538 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
12539
12540 The default size of @code{int}s, @code{long}s and pointers depends on
12541 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
12542 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
12543 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
12544 or the same size as integer registers, whichever is smaller.
12545
12546 @item -msym32
12547 @itemx -mno-sym32
12548 @opindex msym32
12549 @opindex mno-sym32
12550 Assume (do not assume) that all symbols have 32-bit values, regardless
12551 of the selected ABI@.  This option is useful in combination with
12552 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
12553 to generate shorter and faster references to symbolic addresses.
12554
12555 @item -G @var{num}
12556 @opindex G
12557 Put definitions of externally-visible data in a small data section
12558 if that data is no bigger than @var{num} bytes.  GCC can then access
12559 the data more efficiently; see @option{-mgpopt} for details.
12560
12561 The default @option{-G} option depends on the configuration.
12562
12563 @item -mlocal-sdata
12564 @itemx -mno-local-sdata
12565 @opindex mlocal-sdata
12566 @opindex mno-local-sdata
12567 Extend (do not extend) the @option{-G} behavior to local data too,
12568 such as to static variables in C@.  @option{-mlocal-sdata} is the
12569 default for all configurations.
12570
12571 If the linker complains that an application is using too much small data,
12572 you might want to try rebuilding the less performance-critical parts with
12573 @option{-mno-local-sdata}.  You might also want to build large
12574 libraries with @option{-mno-local-sdata}, so that the libraries leave
12575 more room for the main program.
12576
12577 @item -mextern-sdata
12578 @itemx -mno-extern-sdata
12579 @opindex mextern-sdata
12580 @opindex mno-extern-sdata
12581 Assume (do not assume) that externally-defined data will be in
12582 a small data section if that data is within the @option{-G} limit.
12583 @option{-mextern-sdata} is the default for all configurations.
12584
12585 If you compile a module @var{Mod} with @option{-mextern-sdata} @option{-G
12586 @var{num}} @option{-mgpopt}, and @var{Mod} references a variable @var{Var}
12587 that is no bigger than @var{num} bytes, you must make sure that @var{Var}
12588 is placed in a small data section.  If @var{Var} is defined by another
12589 module, you must either compile that module with a high-enough
12590 @option{-G} setting or attach a @code{section} attribute to @var{Var}'s
12591 definition.  If @var{Var} is common, you must link the application
12592 with a high-enough @option{-G} setting.
12593
12594 The easiest way of satisfying these restrictions is to compile
12595 and link every module with the same @option{-G} option.  However,
12596 you may wish to build a library that supports several different
12597 small data limits.  You can do this by compiling the library with
12598 the highest supported @option{-G} setting and additionally using
12599 @option{-mno-extern-sdata} to stop the library from making assumptions
12600 about externally-defined data.
12601
12602 @item -mgpopt
12603 @itemx -mno-gpopt
12604 @opindex mgpopt
12605 @opindex mno-gpopt
12606 Use (do not use) GP-relative accesses for symbols that are known to be
12607 in a small data section; see @option{-G}, @option{-mlocal-sdata} and
12608 @option{-mextern-sdata}.  @option{-mgpopt} is the default for all
12609 configurations.
12610
12611 @option{-mno-gpopt} is useful for cases where the @code{$gp} register
12612 might not hold the value of @code{_gp}.  For example, if the code is
12613 part of a library that might be used in a boot monitor, programs that
12614 call boot monitor routines will pass an unknown value in @code{$gp}.
12615 (In such situations, the boot monitor itself would usually be compiled
12616 with @option{-G0}.)
12617
12618 @option{-mno-gpopt} implies @option{-mno-local-sdata} and
12619 @option{-mno-extern-sdata}.
12620
12621 @item -membedded-data
12622 @itemx -mno-embedded-data
12623 @opindex membedded-data
12624 @opindex mno-embedded-data
12625 Allocate variables to the read-only data section first if possible, then
12626 next in the small data section if possible, otherwise in data.  This gives
12627 slightly slower code than the default, but reduces the amount of RAM required
12628 when executing, and thus may be preferred for some embedded systems.
12629
12630 @item -muninit-const-in-rodata
12631 @itemx -mno-uninit-const-in-rodata
12632 @opindex muninit-const-in-rodata
12633 @opindex mno-uninit-const-in-rodata
12634 Put uninitialized @code{const} variables in the read-only data section.
12635 This option is only meaningful in conjunction with @option{-membedded-data}.
12636
12637 @item -mcode-readable=@var{setting}
12638 @opindex mcode-readable
12639 Specify whether GCC may generate code that reads from executable sections.
12640 There are three possible settings:
12641
12642 @table @gcctabopt
12643 @item -mcode-readable=yes
12644 Instructions may freely access executable sections.  This is the
12645 default setting.
12646
12647 @item -mcode-readable=pcrel
12648 MIPS16 PC-relative load instructions can access executable sections,
12649 but other instructions must not do so.  This option is useful on 4KSc
12650 and 4KSd processors when the code TLBs have the Read Inhibit bit set.
12651 It is also useful on processors that can be configured to have a dual
12652 instruction/data SRAM interface and that, like the M4K, automatically
12653 redirect PC-relative loads to the instruction RAM.
12654
12655 @item -mcode-readable=no
12656 Instructions must not access executable sections.  This option can be
12657 useful on targets that are configured to have a dual instruction/data
12658 SRAM interface but that (unlike the M4K) do not automatically redirect
12659 PC-relative loads to the instruction RAM.
12660 @end table
12661
12662 @item -msplit-addresses
12663 @itemx -mno-split-addresses
12664 @opindex msplit-addresses
12665 @opindex mno-split-addresses
12666 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
12667 relocation operators.  This option has been superseded by
12668 @option{-mexplicit-relocs} but is retained for backwards compatibility.
12669
12670 @item -mexplicit-relocs
12671 @itemx -mno-explicit-relocs
12672 @opindex mexplicit-relocs
12673 @opindex mno-explicit-relocs
12674 Use (do not use) assembler relocation operators when dealing with symbolic
12675 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
12676 is to use assembler macros instead.
12677
12678 @option{-mexplicit-relocs} is the default if GCC was configured
12679 to use an assembler that supports relocation operators.
12680
12681 @item -mcheck-zero-division
12682 @itemx -mno-check-zero-division
12683 @opindex mcheck-zero-division
12684 @opindex mno-check-zero-division
12685 Trap (do not trap) on integer division by zero.
12686
12687 The default is @option{-mcheck-zero-division}.
12688
12689 @item -mdivide-traps
12690 @itemx -mdivide-breaks
12691 @opindex mdivide-traps
12692 @opindex mdivide-breaks
12693 MIPS systems check for division by zero by generating either a
12694 conditional trap or a break instruction.  Using traps results in
12695 smaller code, but is only supported on MIPS II and later.  Also, some
12696 versions of the Linux kernel have a bug that prevents trap from
12697 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
12698 allow conditional traps on architectures that support them and
12699 @option{-mdivide-breaks} to force the use of breaks.
12700
12701 The default is usually @option{-mdivide-traps}, but this can be
12702 overridden at configure time using @option{--with-divide=breaks}.
12703 Divide-by-zero checks can be completely disabled using
12704 @option{-mno-check-zero-division}.
12705
12706 @item -mmemcpy
12707 @itemx -mno-memcpy
12708 @opindex mmemcpy
12709 @opindex mno-memcpy
12710 Force (do not force) the use of @code{memcpy()} for non-trivial block
12711 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
12712 most constant-sized copies.
12713
12714 @item -mlong-calls
12715 @itemx -mno-long-calls
12716 @opindex mlong-calls
12717 @opindex mno-long-calls
12718 Disable (do not disable) use of the @code{jal} instruction.  Calling
12719 functions using @code{jal} is more efficient but requires the caller
12720 and callee to be in the same 256 megabyte segment.
12721
12722 This option has no effect on abicalls code.  The default is
12723 @option{-mno-long-calls}.
12724
12725 @item -mmad
12726 @itemx -mno-mad
12727 @opindex mmad
12728 @opindex mno-mad
12729 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
12730 instructions, as provided by the R4650 ISA@.
12731
12732 @item -mfused-madd
12733 @itemx -mno-fused-madd
12734 @opindex mfused-madd
12735 @opindex mno-fused-madd
12736 Enable (disable) use of the floating point multiply-accumulate
12737 instructions, when they are available.  The default is
12738 @option{-mfused-madd}.
12739
12740 When multiply-accumulate instructions are used, the intermediate
12741 product is calculated to infinite precision and is not subject to
12742 the FCSR Flush to Zero bit.  This may be undesirable in some
12743 circumstances.
12744
12745 @item -nocpp
12746 @opindex nocpp
12747 Tell the MIPS assembler to not run its preprocessor over user
12748 assembler files (with a @samp{.s} suffix) when assembling them.
12749
12750 @item -mfix-r4000
12751 @itemx -mno-fix-r4000
12752 @opindex mfix-r4000
12753 @opindex mno-fix-r4000
12754 Work around certain R4000 CPU errata:
12755 @itemize @minus
12756 @item
12757 A double-word or a variable shift may give an incorrect result if executed
12758 immediately after starting an integer division.
12759 @item
12760 A double-word or a variable shift may give an incorrect result if executed
12761 while an integer multiplication is in progress.
12762 @item
12763 An integer division may give an incorrect result if started in a delay slot
12764 of a taken branch or a jump.
12765 @end itemize
12766
12767 @item -mfix-r4400
12768 @itemx -mno-fix-r4400
12769 @opindex mfix-r4400
12770 @opindex mno-fix-r4400
12771 Work around certain R4400 CPU errata:
12772 @itemize @minus
12773 @item
12774 A double-word or a variable shift may give an incorrect result if executed
12775 immediately after starting an integer division.
12776 @end itemize
12777
12778 @item -mfix-vr4120
12779 @itemx -mno-fix-vr4120
12780 @opindex mfix-vr4120
12781 Work around certain VR4120 errata:
12782 @itemize @minus
12783 @item
12784 @code{dmultu} does not always produce the correct result.
12785 @item
12786 @code{div} and @code{ddiv} do not always produce the correct result if one
12787 of the operands is negative.
12788 @end itemize
12789 The workarounds for the division errata rely on special functions in
12790 @file{libgcc.a}.  At present, these functions are only provided by
12791 the @code{mips64vr*-elf} configurations.
12792
12793 Other VR4120 errata require a nop to be inserted between certain pairs of
12794 instructions.  These errata are handled by the assembler, not by GCC itself.
12795
12796 @item -mfix-vr4130
12797 @opindex mfix-vr4130
12798 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
12799 workarounds are implemented by the assembler rather than by GCC,
12800 although GCC will avoid using @code{mflo} and @code{mfhi} if the
12801 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
12802 instructions are available instead.
12803
12804 @item -mfix-sb1
12805 @itemx -mno-fix-sb1
12806 @opindex mfix-sb1
12807 Work around certain SB-1 CPU core errata.
12808 (This flag currently works around the SB-1 revision 2
12809 ``F1'' and ``F2'' floating point errata.)
12810
12811 @item -mr10k-cache-barrier=@var{setting}
12812 @opindex mr10k-cache-barrier
12813 Specify whether GCC should insert cache barriers to avoid the
12814 side-effects of speculation on R10K processors.
12815
12816 In common with many processors, the R10K tries to predict the outcome
12817 of a conditional branch and speculatively executes instructions from
12818 the ``taken'' branch.  It later aborts these instructions if the
12819 predicted outcome was wrong.  However, on the R10K, even aborted
12820 instructions can have side effects.
12821
12822 This problem only affects kernel stores and, depending on the system,
12823 kernel loads.  As an example, a speculatively-executed store may load
12824 the target memory into cache and mark the cache line as dirty, even if
12825 the store itself is later aborted.  If a DMA operation writes to the
12826 same area of memory before the ``dirty'' line is flushed, the cached
12827 data will overwrite the DMA-ed data.  See the R10K processor manual
12828 for a full description, including other potential problems.
12829
12830 One workaround is to insert cache barrier instructions before every memory
12831 access that might be speculatively executed and that might have side
12832 effects even if aborted.  @option{-mr10k-cache-barrier=@var{setting}}
12833 controls GCC's implementation of this workaround.  It assumes that
12834 aborted accesses to any byte in the following regions will not have
12835 side effects:
12836
12837 @enumerate
12838 @item
12839 the memory occupied by the current function's stack frame;
12840
12841 @item
12842 the memory occupied by an incoming stack argument;
12843
12844 @item
12845 the memory occupied by an object with a link-time-constant address.
12846 @end enumerate
12847
12848 It is the kernel's responsibility to ensure that speculative
12849 accesses to these regions are indeed safe.
12850
12851 If the input program contains a function declaration such as:
12852
12853 @smallexample
12854 void foo (void);
12855 @end smallexample
12856
12857 then the implementation of @code{foo} must allow @code{j foo} and
12858 @code{jal foo} to be executed speculatively.  GCC honors this
12859 restriction for functions it compiles itself.  It expects non-GCC
12860 functions (such as hand-written assembly code) to do the same.
12861
12862 The option has three forms:
12863
12864 @table @gcctabopt
12865 @item -mr10k-cache-barrier=load-store
12866 Insert a cache barrier before a load or store that might be
12867 speculatively executed and that might have side effects even
12868 if aborted.
12869
12870 @item -mr10k-cache-barrier=store
12871 Insert a cache barrier before a store that might be speculatively
12872 executed and that might have side effects even if aborted.
12873
12874 @item -mr10k-cache-barrier=none
12875 Disable the insertion of cache barriers.  This is the default setting.
12876 @end table
12877
12878 @item -mflush-func=@var{func}
12879 @itemx -mno-flush-func
12880 @opindex mflush-func
12881 Specifies the function to call to flush the I and D caches, or to not
12882 call any such function.  If called, the function must take the same
12883 arguments as the common @code{_flush_func()}, that is, the address of the
12884 memory range for which the cache is being flushed, the size of the
12885 memory range, and the number 3 (to flush both caches).  The default
12886 depends on the target GCC was configured for, but commonly is either
12887 @samp{_flush_func} or @samp{__cpu_flush}.
12888
12889 @item mbranch-cost=@var{num}
12890 @opindex mbranch-cost
12891 Set the cost of branches to roughly @var{num} ``simple'' instructions.
12892 This cost is only a heuristic and is not guaranteed to produce
12893 consistent results across releases.  A zero cost redundantly selects
12894 the default, which is based on the @option{-mtune} setting.
12895
12896 @item -mbranch-likely
12897 @itemx -mno-branch-likely
12898 @opindex mbranch-likely
12899 @opindex mno-branch-likely
12900 Enable or disable use of Branch Likely instructions, regardless of the
12901 default for the selected architecture.  By default, Branch Likely
12902 instructions may be generated if they are supported by the selected
12903 architecture.  An exception is for the MIPS32 and MIPS64 architectures
12904 and processors which implement those architectures; for those, Branch
12905 Likely instructions will not be generated by default because the MIPS32
12906 and MIPS64 architectures specifically deprecate their use.
12907
12908 @item -mfp-exceptions
12909 @itemx -mno-fp-exceptions
12910 @opindex mfp-exceptions
12911 Specifies whether FP exceptions are enabled.  This affects how we schedule
12912 FP instructions for some processors.  The default is that FP exceptions are
12913 enabled.
12914
12915 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
12916 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
12917 FP pipe.
12918
12919 @item -mvr4130-align
12920 @itemx -mno-vr4130-align
12921 @opindex mvr4130-align
12922 The VR4130 pipeline is two-way superscalar, but can only issue two
12923 instructions together if the first one is 8-byte aligned.  When this
12924 option is enabled, GCC will align pairs of instructions that it
12925 thinks should execute in parallel.
12926
12927 This option only has an effect when optimizing for the VR4130.
12928 It normally makes code faster, but at the expense of making it bigger.
12929 It is enabled by default at optimization level @option{-O3}.
12930 @end table
12931
12932 @node MMIX Options
12933 @subsection MMIX Options
12934 @cindex MMIX Options
12935
12936 These options are defined for the MMIX:
12937
12938 @table @gcctabopt
12939 @item -mlibfuncs
12940 @itemx -mno-libfuncs
12941 @opindex mlibfuncs
12942 @opindex mno-libfuncs
12943 Specify that intrinsic library functions are being compiled, passing all
12944 values in registers, no matter the size.
12945
12946 @item -mepsilon
12947 @itemx -mno-epsilon
12948 @opindex mepsilon
12949 @opindex mno-epsilon
12950 Generate floating-point comparison instructions that compare with respect
12951 to the @code{rE} epsilon register.
12952
12953 @item -mabi=mmixware
12954 @itemx -mabi=gnu
12955 @opindex mabi-mmixware
12956 @opindex mabi=gnu
12957 Generate code that passes function parameters and return values that (in
12958 the called function) are seen as registers @code{$0} and up, as opposed to
12959 the GNU ABI which uses global registers @code{$231} and up.
12960
12961 @item -mzero-extend
12962 @itemx -mno-zero-extend
12963 @opindex mzero-extend
12964 @opindex mno-zero-extend
12965 When reading data from memory in sizes shorter than 64 bits, use (do not
12966 use) zero-extending load instructions by default, rather than
12967 sign-extending ones.
12968
12969 @item -mknuthdiv
12970 @itemx -mno-knuthdiv
12971 @opindex mknuthdiv
12972 @opindex mno-knuthdiv
12973 Make the result of a division yielding a remainder have the same sign as
12974 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
12975 remainder follows the sign of the dividend.  Both methods are
12976 arithmetically valid, the latter being almost exclusively used.
12977
12978 @item -mtoplevel-symbols
12979 @itemx -mno-toplevel-symbols
12980 @opindex mtoplevel-symbols
12981 @opindex mno-toplevel-symbols
12982 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
12983 code can be used with the @code{PREFIX} assembly directive.
12984
12985 @item -melf
12986 @opindex melf
12987 Generate an executable in the ELF format, rather than the default
12988 @samp{mmo} format used by the @command{mmix} simulator.
12989
12990 @item -mbranch-predict
12991 @itemx -mno-branch-predict
12992 @opindex mbranch-predict
12993 @opindex mno-branch-predict
12994 Use (do not use) the probable-branch instructions, when static branch
12995 prediction indicates a probable branch.
12996
12997 @item -mbase-addresses
12998 @itemx -mno-base-addresses
12999 @opindex mbase-addresses
13000 @opindex mno-base-addresses
13001 Generate (do not generate) code that uses @emph{base addresses}.  Using a
13002 base address automatically generates a request (handled by the assembler
13003 and the linker) for a constant to be set up in a global register.  The
13004 register is used for one or more base address requests within the range 0
13005 to 255 from the value held in the register.  The generally leads to short
13006 and fast code, but the number of different data items that can be
13007 addressed is limited.  This means that a program that uses lots of static
13008 data may require @option{-mno-base-addresses}.
13009
13010 @item -msingle-exit
13011 @itemx -mno-single-exit
13012 @opindex msingle-exit
13013 @opindex mno-single-exit
13014 Force (do not force) generated code to have a single exit point in each
13015 function.
13016 @end table
13017
13018 @node MN10300 Options
13019 @subsection MN10300 Options
13020 @cindex MN10300 options
13021
13022 These @option{-m} options are defined for Matsushita MN10300 architectures:
13023
13024 @table @gcctabopt
13025 @item -mmult-bug
13026 @opindex mmult-bug
13027 Generate code to avoid bugs in the multiply instructions for the MN10300
13028 processors.  This is the default.
13029
13030 @item -mno-mult-bug
13031 @opindex mno-mult-bug
13032 Do not generate code to avoid bugs in the multiply instructions for the
13033 MN10300 processors.
13034
13035 @item -mam33
13036 @opindex mam33
13037 Generate code which uses features specific to the AM33 processor.
13038
13039 @item -mno-am33
13040 @opindex mno-am33
13041 Do not generate code which uses features specific to the AM33 processor.  This
13042 is the default.
13043
13044 @item -mreturn-pointer-on-d0
13045 @opindex mreturn-pointer-on-d0
13046 When generating a function which returns a pointer, return the pointer
13047 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
13048 only in a0, and attempts to call such functions without a prototype
13049 would result in errors.  Note that this option is on by default; use
13050 @option{-mno-return-pointer-on-d0} to disable it.
13051
13052 @item -mno-crt0
13053 @opindex mno-crt0
13054 Do not link in the C run-time initialization object file.
13055
13056 @item -mrelax
13057 @opindex mrelax
13058 Indicate to the linker that it should perform a relaxation optimization pass
13059 to shorten branches, calls and absolute memory addresses.  This option only
13060 has an effect when used on the command line for the final link step.
13061
13062 This option makes symbolic debugging impossible.
13063 @end table
13064
13065 @node PDP-11 Options
13066 @subsection PDP-11 Options
13067 @cindex PDP-11 Options
13068
13069 These options are defined for the PDP-11:
13070
13071 @table @gcctabopt
13072 @item -mfpu
13073 @opindex mfpu
13074 Use hardware FPP floating point.  This is the default.  (FIS floating
13075 point on the PDP-11/40 is not supported.)
13076
13077 @item -msoft-float
13078 @opindex msoft-float
13079 Do not use hardware floating point.
13080
13081 @item -mac0
13082 @opindex mac0
13083 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
13084
13085 @item -mno-ac0
13086 @opindex mno-ac0
13087 Return floating-point results in memory.  This is the default.
13088
13089 @item -m40
13090 @opindex m40
13091 Generate code for a PDP-11/40.
13092
13093 @item -m45
13094 @opindex m45
13095 Generate code for a PDP-11/45.  This is the default.
13096
13097 @item -m10
13098 @opindex m10
13099 Generate code for a PDP-11/10.
13100
13101 @item -mbcopy-builtin
13102 @opindex bcopy-builtin
13103 Use inline @code{movmemhi} patterns for copying memory.  This is the
13104 default.
13105
13106 @item -mbcopy
13107 @opindex mbcopy
13108 Do not use inline @code{movmemhi} patterns for copying memory.
13109
13110 @item -mint16
13111 @itemx -mno-int32
13112 @opindex mint16
13113 @opindex mno-int32
13114 Use 16-bit @code{int}.  This is the default.
13115
13116 @item -mint32
13117 @itemx -mno-int16
13118 @opindex mint32
13119 @opindex mno-int16
13120 Use 32-bit @code{int}.
13121
13122 @item -mfloat64
13123 @itemx -mno-float32
13124 @opindex mfloat64
13125 @opindex mno-float32
13126 Use 64-bit @code{float}.  This is the default.
13127
13128 @item -mfloat32
13129 @itemx -mno-float64
13130 @opindex mfloat32
13131 @opindex mno-float64
13132 Use 32-bit @code{float}.
13133
13134 @item -mabshi
13135 @opindex mabshi
13136 Use @code{abshi2} pattern.  This is the default.
13137
13138 @item -mno-abshi
13139 @opindex mno-abshi
13140 Do not use @code{abshi2} pattern.
13141
13142 @item -mbranch-expensive
13143 @opindex mbranch-expensive
13144 Pretend that branches are expensive.  This is for experimenting with
13145 code generation only.
13146
13147 @item -mbranch-cheap
13148 @opindex mbranch-cheap
13149 Do not pretend that branches are expensive.  This is the default.
13150
13151 @item -msplit
13152 @opindex msplit
13153 Generate code for a system with split I&D@.
13154
13155 @item -mno-split
13156 @opindex mno-split
13157 Generate code for a system without split I&D@.  This is the default.
13158
13159 @item -munix-asm
13160 @opindex munix-asm
13161 Use Unix assembler syntax.  This is the default when configured for
13162 @samp{pdp11-*-bsd}.
13163
13164 @item -mdec-asm
13165 @opindex mdec-asm
13166 Use DEC assembler syntax.  This is the default when configured for any
13167 PDP-11 target other than @samp{pdp11-*-bsd}.
13168 @end table
13169
13170 @node picoChip Options
13171 @subsection picoChip Options
13172 @cindex picoChip options
13173
13174 These @samp{-m} options are defined for picoChip implementations:
13175
13176 @table @gcctabopt
13177
13178 @item -mae=@var{ae_type}
13179 @opindex mcpu
13180 Set the instruction set, register set, and instruction scheduling
13181 parameters for array element type @var{ae_type}.  Supported values
13182 for @var{ae_type} are @samp{ANY}, @samp{MUL}, and @samp{MAC}.
13183
13184 @option{-mae=ANY} selects a completely generic AE type.  Code
13185 generated with this option will run on any of the other AE types.  The
13186 code will not be as efficient as it would be if compiled for a specific
13187 AE type, and some types of operation (e.g., multiplication) will not
13188 work properly on all types of AE.
13189
13190 @option{-mae=MUL} selects a MUL AE type.  This is the most useful AE type
13191 for compiled code, and is the default.
13192
13193 @option{-mae=MAC} selects a DSP-style MAC AE.  Code compiled with this
13194 option may suffer from poor performance of byte (char) manipulation,
13195 since the DSP AE does not provide hardware support for byte load/stores.
13196
13197 @item -msymbol-as-address
13198 Enable the compiler to directly use a symbol name as an address in a
13199 load/store instruction, without first loading it into a
13200 register.  Typically, the use of this option will generate larger
13201 programs, which run faster than when the option isn't used.  However, the
13202 results vary from program to program, so it is left as a user option,
13203 rather than being permanently enabled.
13204
13205 @item -mno-inefficient-warnings
13206 Disables warnings about the generation of inefficient code.  These
13207 warnings can be generated, for example, when compiling code which
13208 performs byte-level memory operations on the MAC AE type.  The MAC AE has
13209 no hardware support for byte-level memory operations, so all byte
13210 load/stores must be synthesised from word load/store operations.  This is
13211 inefficient and a warning will be generated indicating to the programmer
13212 that they should rewrite the code to avoid byte operations, or to target
13213 an AE type which has the necessary hardware support.  This option enables
13214 the warning to be turned off.
13215
13216 @end table
13217
13218 @node PowerPC Options
13219 @subsection PowerPC Options
13220 @cindex PowerPC options
13221
13222 These are listed under @xref{RS/6000 and PowerPC Options}.
13223
13224 @node RS/6000 and PowerPC Options
13225 @subsection IBM RS/6000 and PowerPC Options
13226 @cindex RS/6000 and PowerPC Options
13227 @cindex IBM RS/6000 and PowerPC Options
13228
13229 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
13230 @table @gcctabopt
13231 @item -mpower
13232 @itemx -mno-power
13233 @itemx -mpower2
13234 @itemx -mno-power2
13235 @itemx -mpowerpc
13236 @itemx -mno-powerpc
13237 @itemx -mpowerpc-gpopt
13238 @itemx -mno-powerpc-gpopt
13239 @itemx -mpowerpc-gfxopt
13240 @itemx -mno-powerpc-gfxopt
13241 @itemx -mpowerpc64
13242 @itemx -mno-powerpc64
13243 @itemx -mmfcrf
13244 @itemx -mno-mfcrf
13245 @itemx -mpopcntb
13246 @itemx -mno-popcntb
13247 @itemx -mfprnd
13248 @itemx -mno-fprnd
13249 @itemx -mcmpb
13250 @itemx -mno-cmpb
13251 @itemx -mmfpgpr
13252 @itemx -mno-mfpgpr
13253 @itemx -mhard-dfp
13254 @itemx -mno-hard-dfp
13255 @opindex mpower
13256 @opindex mno-power
13257 @opindex mpower2
13258 @opindex mno-power2
13259 @opindex mpowerpc
13260 @opindex mno-powerpc
13261 @opindex mpowerpc-gpopt
13262 @opindex mno-powerpc-gpopt
13263 @opindex mpowerpc-gfxopt
13264 @opindex mno-powerpc-gfxopt
13265 @opindex mpowerpc64
13266 @opindex mno-powerpc64
13267 @opindex mmfcrf
13268 @opindex mno-mfcrf
13269 @opindex mpopcntb
13270 @opindex mno-popcntb
13271 @opindex mfprnd
13272 @opindex mno-fprnd
13273 @opindex mcmpb
13274 @opindex mno-cmpb
13275 @opindex mmfpgpr
13276 @opindex mno-mfpgpr
13277 @opindex mhard-dfp
13278 @opindex mno-hard-dfp
13279 GCC supports two related instruction set architectures for the
13280 RS/6000 and PowerPC@.  The @dfn{POWER} instruction set are those
13281 instructions supported by the @samp{rios} chip set used in the original
13282 RS/6000 systems and the @dfn{PowerPC} instruction set is the
13283 architecture of the Freescale MPC5xx, MPC6xx, MPC8xx microprocessors, and
13284 the IBM 4xx, 6xx, and follow-on microprocessors.
13285
13286 Neither architecture is a subset of the other.  However there is a
13287 large common subset of instructions supported by both.  An MQ
13288 register is included in processors supporting the POWER architecture.
13289
13290 You use these options to specify which instructions are available on the
13291 processor you are using.  The default value of these options is
13292 determined when configuring GCC@.  Specifying the
13293 @option{-mcpu=@var{cpu_type}} overrides the specification of these
13294 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
13295 rather than the options listed above.
13296
13297 The @option{-mpower} option allows GCC to generate instructions that
13298 are found only in the POWER architecture and to use the MQ register.
13299 Specifying @option{-mpower2} implies @option{-power} and also allows GCC
13300 to generate instructions that are present in the POWER2 architecture but
13301 not the original POWER architecture.
13302
13303 The @option{-mpowerpc} option allows GCC to generate instructions that
13304 are found only in the 32-bit subset of the PowerPC architecture.
13305 Specifying @option{-mpowerpc-gpopt} implies @option{-mpowerpc} and also allows
13306 GCC to use the optional PowerPC architecture instructions in the
13307 General Purpose group, including floating-point square root.  Specifying
13308 @option{-mpowerpc-gfxopt} implies @option{-mpowerpc} and also allows GCC to
13309 use the optional PowerPC architecture instructions in the Graphics
13310 group, including floating-point select.
13311
13312 The @option{-mmfcrf} option allows GCC to generate the move from
13313 condition register field instruction implemented on the POWER4
13314 processor and other processors that support the PowerPC V2.01
13315 architecture.
13316 The @option{-mpopcntb} option allows GCC to generate the popcount and
13317 double precision FP reciprocal estimate instruction implemented on the
13318 POWER5 processor and other processors that support the PowerPC V2.02
13319 architecture.
13320 The @option{-mfprnd} option allows GCC to generate the FP round to
13321 integer instructions implemented on the POWER5+ processor and other
13322 processors that support the PowerPC V2.03 architecture.
13323 The @option{-mcmpb} option allows GCC to generate the compare bytes
13324 instruction implemented on the POWER6 processor and other processors
13325 that support the PowerPC V2.05 architecture.
13326 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
13327 general purpose register instructions implemented on the POWER6X
13328 processor and other processors that support the extended PowerPC V2.05
13329 architecture.
13330 The @option{-mhard-dfp} option allows GCC to generate the decimal floating
13331 point instructions implemented on some POWER processors.
13332
13333 The @option{-mpowerpc64} option allows GCC to generate the additional
13334 64-bit instructions that are found in the full PowerPC64 architecture
13335 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
13336 @option{-mno-powerpc64}.
13337
13338 If you specify both @option{-mno-power} and @option{-mno-powerpc}, GCC
13339 will use only the instructions in the common subset of both
13340 architectures plus some special AIX common-mode calls, and will not use
13341 the MQ register.  Specifying both @option{-mpower} and @option{-mpowerpc}
13342 permits GCC to use any instruction from either architecture and to
13343 allow use of the MQ register; specify this for the Motorola MPC601.
13344
13345 @item -mnew-mnemonics
13346 @itemx -mold-mnemonics
13347 @opindex mnew-mnemonics
13348 @opindex mold-mnemonics
13349 Select which mnemonics to use in the generated assembler code.  With
13350 @option{-mnew-mnemonics}, GCC uses the assembler mnemonics defined for
13351 the PowerPC architecture.  With @option{-mold-mnemonics} it uses the
13352 assembler mnemonics defined for the POWER architecture.  Instructions
13353 defined in only one architecture have only one mnemonic; GCC uses that
13354 mnemonic irrespective of which of these options is specified.
13355
13356 GCC defaults to the mnemonics appropriate for the architecture in
13357 use.  Specifying @option{-mcpu=@var{cpu_type}} sometimes overrides the
13358 value of these option.  Unless you are building a cross-compiler, you
13359 should normally not specify either @option{-mnew-mnemonics} or
13360 @option{-mold-mnemonics}, but should instead accept the default.
13361
13362 @item -mcpu=@var{cpu_type}
13363 @opindex mcpu
13364 Set architecture type, register usage, choice of mnemonics, and
13365 instruction scheduling parameters for machine type @var{cpu_type}.
13366 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
13367 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{464}, @samp{464fp},
13368 @samp{505}, @samp{601}, @samp{602}, @samp{603}, @samp{603e}, @samp{604},
13369 @samp{604e}, @samp{620}, @samp{630}, @samp{740}, @samp{7400},
13370 @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
13371 @samp{860}, @samp{970}, @samp{8540}, @samp{e300c2}, @samp{e300c3},
13372 @samp{e500mc}, @samp{ec603e}, @samp{G3}, @samp{G4}, @samp{G5},
13373 @samp{power}, @samp{power2}, @samp{power3}, @samp{power4},
13374 @samp{power5}, @samp{power5+}, @samp{power6}, @samp{power6x}, @samp{power7}
13375 @samp{common}, @samp{powerpc}, @samp{powerpc64}, @samp{rios},
13376 @samp{rios1}, @samp{rios2}, @samp{rsc}, and @samp{rs64}.
13377
13378 @option{-mcpu=common} selects a completely generic processor.  Code
13379 generated under this option will run on any POWER or PowerPC processor.
13380 GCC will use only the instructions in the common subset of both
13381 architectures, and will not use the MQ register.  GCC assumes a generic
13382 processor model for scheduling purposes.
13383
13384 @option{-mcpu=power}, @option{-mcpu=power2}, @option{-mcpu=powerpc}, and
13385 @option{-mcpu=powerpc64} specify generic POWER, POWER2, pure 32-bit
13386 PowerPC (i.e., not MPC601), and 64-bit PowerPC architecture machine
13387 types, with an appropriate, generic processor model assumed for
13388 scheduling purposes.
13389
13390 The other options specify a specific processor.  Code generated under
13391 those options will run best on that processor, and may not run at all on
13392 others.
13393
13394 The @option{-mcpu} options automatically enable or disable the
13395 following options:
13396
13397 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
13398 -mnew-mnemonics  -mpopcntb  -mpower  -mpower2  -mpowerpc64 @gol
13399 -mpowerpc-gpopt  -mpowerpc-gfxopt  -mstring  -mmulhw  -mdlmzb  -mmfpgpr}
13400
13401 The particular options set for any particular CPU will vary between
13402 compiler versions, depending on what setting seems to produce optimal
13403 code for that CPU; it doesn't necessarily reflect the actual hardware's
13404 capabilities.  If you wish to set an individual option to a particular
13405 value, you may specify it after the @option{-mcpu} option, like
13406 @samp{-mcpu=970 -mno-altivec}.
13407
13408 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
13409 not enabled or disabled by the @option{-mcpu} option at present because
13410 AIX does not have full support for these options.  You may still
13411 enable or disable them individually if you're sure it'll work in your
13412 environment.
13413
13414 @item -mtune=@var{cpu_type}
13415 @opindex mtune
13416 Set the instruction scheduling parameters for machine type
13417 @var{cpu_type}, but do not set the architecture type, register usage, or
13418 choice of mnemonics, as @option{-mcpu=@var{cpu_type}} would.  The same
13419 values for @var{cpu_type} are used for @option{-mtune} as for
13420 @option{-mcpu}.  If both are specified, the code generated will use the
13421 architecture, registers, and mnemonics set by @option{-mcpu}, but the
13422 scheduling parameters set by @option{-mtune}.
13423
13424 @item -mswdiv
13425 @itemx -mno-swdiv
13426 @opindex mswdiv
13427 @opindex mno-swdiv
13428 Generate code to compute division as reciprocal estimate and iterative
13429 refinement, creating opportunities for increased throughput.  This
13430 feature requires: optional PowerPC Graphics instruction set for single
13431 precision and FRE instruction for double precision, assuming divides
13432 cannot generate user-visible traps, and the domain values not include
13433 Infinities, denormals or zero denominator.
13434
13435 @item -maltivec
13436 @itemx -mno-altivec
13437 @opindex maltivec
13438 @opindex mno-altivec
13439 Generate code that uses (does not use) AltiVec instructions, and also
13440 enable the use of built-in functions that allow more direct access to
13441 the AltiVec instruction set.  You may also need to set
13442 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
13443 enhancements.
13444
13445 @item -mvrsave
13446 @itemx -mno-vrsave
13447 @opindex mvrsave
13448 @opindex mno-vrsave
13449 Generate VRSAVE instructions when generating AltiVec code.
13450
13451 @item -msecure-plt
13452 @opindex msecure-plt
13453 Generate code that allows ld and ld.so to build executables and shared
13454 libraries with non-exec .plt and .got sections.  This is a PowerPC
13455 32-bit SYSV ABI option.
13456
13457 @item -mbss-plt
13458 @opindex mbss-plt
13459 Generate code that uses a BSS .plt section that ld.so fills in, and
13460 requires .plt and .got sections that are both writable and executable.
13461 This is a PowerPC 32-bit SYSV ABI option.
13462
13463 @item -misel
13464 @itemx -mno-isel
13465 @opindex misel
13466 @opindex mno-isel
13467 This switch enables or disables the generation of ISEL instructions.
13468
13469 @item -misel=@var{yes/no}
13470 This switch has been deprecated.  Use @option{-misel} and
13471 @option{-mno-isel} instead.
13472
13473 @item -mspe
13474 @itemx -mno-spe
13475 @opindex mspe
13476 @opindex mno-spe
13477 This switch enables or disables the generation of SPE simd
13478 instructions.
13479
13480 @item -mpaired
13481 @itemx -mno-paired
13482 @opindex mpaired
13483 @opindex mno-paired
13484 This switch enables or disables the generation of PAIRED simd
13485 instructions.
13486
13487 @item -mspe=@var{yes/no}
13488 This option has been deprecated.  Use @option{-mspe} and
13489 @option{-mno-spe} instead.
13490
13491 @item -mfloat-gprs=@var{yes/single/double/no}
13492 @itemx -mfloat-gprs
13493 @opindex mfloat-gprs
13494 This switch enables or disables the generation of floating point
13495 operations on the general purpose registers for architectures that
13496 support it.
13497
13498 The argument @var{yes} or @var{single} enables the use of
13499 single-precision floating point operations.
13500
13501 The argument @var{double} enables the use of single and
13502 double-precision floating point operations.
13503
13504 The argument @var{no} disables floating point operations on the
13505 general purpose registers.
13506
13507 This option is currently only available on the MPC854x.
13508
13509 @item -m32
13510 @itemx -m64
13511 @opindex m32
13512 @opindex m64
13513 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
13514 targets (including GNU/Linux).  The 32-bit environment sets int, long
13515 and pointer to 32 bits and generates code that runs on any PowerPC
13516 variant.  The 64-bit environment sets int to 32 bits and long and
13517 pointer to 64 bits, and generates code for PowerPC64, as for
13518 @option{-mpowerpc64}.
13519
13520 @item -mfull-toc
13521 @itemx -mno-fp-in-toc
13522 @itemx -mno-sum-in-toc
13523 @itemx -mminimal-toc
13524 @opindex mfull-toc
13525 @opindex mno-fp-in-toc
13526 @opindex mno-sum-in-toc
13527 @opindex mminimal-toc
13528 Modify generation of the TOC (Table Of Contents), which is created for
13529 every executable file.  The @option{-mfull-toc} option is selected by
13530 default.  In that case, GCC will allocate at least one TOC entry for
13531 each unique non-automatic variable reference in your program.  GCC
13532 will also place floating-point constants in the TOC@.  However, only
13533 16,384 entries are available in the TOC@.
13534
13535 If you receive a linker error message that saying you have overflowed
13536 the available TOC space, you can reduce the amount of TOC space used
13537 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
13538 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
13539 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
13540 generate code to calculate the sum of an address and a constant at
13541 run-time instead of putting that sum into the TOC@.  You may specify one
13542 or both of these options.  Each causes GCC to produce very slightly
13543 slower and larger code at the expense of conserving TOC space.
13544
13545 If you still run out of space in the TOC even when you specify both of
13546 these options, specify @option{-mminimal-toc} instead.  This option causes
13547 GCC to make only one TOC entry for every file.  When you specify this
13548 option, GCC will produce code that is slower and larger but which
13549 uses extremely little TOC space.  You may wish to use this option
13550 only on files that contain less frequently executed code.
13551
13552 @item -maix64
13553 @itemx -maix32
13554 @opindex maix64
13555 @opindex maix32
13556 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
13557 @code{long} type, and the infrastructure needed to support them.
13558 Specifying @option{-maix64} implies @option{-mpowerpc64} and
13559 @option{-mpowerpc}, while @option{-maix32} disables the 64-bit ABI and
13560 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
13561
13562 @item -mxl-compat
13563 @itemx -mno-xl-compat
13564 @opindex mxl-compat
13565 @opindex mno-xl-compat
13566 Produce code that conforms more closely to IBM XL compiler semantics
13567 when using AIX-compatible ABI@.  Pass floating-point arguments to
13568 prototyped functions beyond the register save area (RSA) on the stack
13569 in addition to argument FPRs.  Do not assume that most significant
13570 double in 128-bit long double value is properly rounded when comparing
13571 values and converting to double.  Use XL symbol names for long double
13572 support routines.
13573
13574 The AIX calling convention was extended but not initially documented to
13575 handle an obscure K&R C case of calling a function that takes the
13576 address of its arguments with fewer arguments than declared.  IBM XL
13577 compilers access floating point arguments which do not fit in the
13578 RSA from the stack when a subroutine is compiled without
13579 optimization.  Because always storing floating-point arguments on the
13580 stack is inefficient and rarely needed, this option is not enabled by
13581 default and only is necessary when calling subroutines compiled by IBM
13582 XL compilers without optimization.
13583
13584 @item -mpe
13585 @opindex mpe
13586 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
13587 application written to use message passing with special startup code to
13588 enable the application to run.  The system must have PE installed in the
13589 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
13590 must be overridden with the @option{-specs=} option to specify the
13591 appropriate directory location.  The Parallel Environment does not
13592 support threads, so the @option{-mpe} option and the @option{-pthread}
13593 option are incompatible.
13594
13595 @item -malign-natural
13596 @itemx -malign-power
13597 @opindex malign-natural
13598 @opindex malign-power
13599 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
13600 @option{-malign-natural} overrides the ABI-defined alignment of larger
13601 types, such as floating-point doubles, on their natural size-based boundary.
13602 The option @option{-malign-power} instructs GCC to follow the ABI-specified
13603 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
13604
13605 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
13606 is not supported.
13607
13608 @item -msoft-float
13609 @itemx -mhard-float
13610 @opindex msoft-float
13611 @opindex mhard-float
13612 Generate code that does not use (uses) the floating-point register set.
13613 Software floating point emulation is provided if you use the
13614 @option{-msoft-float} option, and pass the option to GCC when linking.
13615
13616 @item -mmultiple
13617 @itemx -mno-multiple
13618 @opindex mmultiple
13619 @opindex mno-multiple
13620 Generate code that uses (does not use) the load multiple word
13621 instructions and the store multiple word instructions.  These
13622 instructions are generated by default on POWER systems, and not
13623 generated on PowerPC systems.  Do not use @option{-mmultiple} on little
13624 endian PowerPC systems, since those instructions do not work when the
13625 processor is in little endian mode.  The exceptions are PPC740 and
13626 PPC750 which permit the instructions usage in little endian mode.
13627
13628 @item -mstring
13629 @itemx -mno-string
13630 @opindex mstring
13631 @opindex mno-string
13632 Generate code that uses (does not use) the load string instructions
13633 and the store string word instructions to save multiple registers and
13634 do small block moves.  These instructions are generated by default on
13635 POWER systems, and not generated on PowerPC systems.  Do not use
13636 @option{-mstring} on little endian PowerPC systems, since those
13637 instructions do not work when the processor is in little endian mode.
13638 The exceptions are PPC740 and PPC750 which permit the instructions
13639 usage in little endian mode.
13640
13641 @item -mupdate
13642 @itemx -mno-update
13643 @opindex mupdate
13644 @opindex mno-update
13645 Generate code that uses (does not use) the load or store instructions
13646 that update the base register to the address of the calculated memory
13647 location.  These instructions are generated by default.  If you use
13648 @option{-mno-update}, there is a small window between the time that the
13649 stack pointer is updated and the address of the previous frame is
13650 stored, which means code that walks the stack frame across interrupts or
13651 signals may get corrupted data.
13652
13653 @item -mfused-madd
13654 @itemx -mno-fused-madd
13655 @opindex mfused-madd
13656 @opindex mno-fused-madd
13657 Generate code that uses (does not use) the floating point multiply and
13658 accumulate instructions.  These instructions are generated by default if
13659 hardware floating is used.
13660
13661 @item -mmulhw
13662 @itemx -mno-mulhw
13663 @opindex mmulhw
13664 @opindex mno-mulhw
13665 Generate code that uses (does not use) the half-word multiply and
13666 multiply-accumulate instructions on the IBM 405, 440 and 464 processors.
13667 These instructions are generated by default when targetting those
13668 processors.
13669
13670 @item -mdlmzb
13671 @itemx -mno-dlmzb
13672 @opindex mdlmzb
13673 @opindex mno-dlmzb
13674 Generate code that uses (does not use) the string-search @samp{dlmzb}
13675 instruction on the IBM 405, 440 and 464 processors.  This instruction is
13676 generated by default when targetting those processors.
13677
13678 @item -mno-bit-align
13679 @itemx -mbit-align
13680 @opindex mno-bit-align
13681 @opindex mbit-align
13682 On System V.4 and embedded PowerPC systems do not (do) force structures
13683 and unions that contain bit-fields to be aligned to the base type of the
13684 bit-field.
13685
13686 For example, by default a structure containing nothing but 8
13687 @code{unsigned} bit-fields of length 1 would be aligned to a 4 byte
13688 boundary and have a size of 4 bytes.  By using @option{-mno-bit-align},
13689 the structure would be aligned to a 1 byte boundary and be one byte in
13690 size.
13691
13692 @item -mno-strict-align
13693 @itemx -mstrict-align
13694 @opindex mno-strict-align
13695 @opindex mstrict-align
13696 On System V.4 and embedded PowerPC systems do not (do) assume that
13697 unaligned memory references will be handled by the system.
13698
13699 @item -mrelocatable
13700 @itemx -mno-relocatable
13701 @opindex mrelocatable
13702 @opindex mno-relocatable
13703 On embedded PowerPC systems generate code that allows (does not allow)
13704 the program to be relocated to a different address at runtime.  If you
13705 use @option{-mrelocatable} on any module, all objects linked together must
13706 be compiled with @option{-mrelocatable} or @option{-mrelocatable-lib}.
13707
13708 @item -mrelocatable-lib
13709 @itemx -mno-relocatable-lib
13710 @opindex mrelocatable-lib
13711 @opindex mno-relocatable-lib
13712 On embedded PowerPC systems generate code that allows (does not allow)
13713 the program to be relocated to a different address at runtime.  Modules
13714 compiled with @option{-mrelocatable-lib} can be linked with either modules
13715 compiled without @option{-mrelocatable} and @option{-mrelocatable-lib} or
13716 with modules compiled with the @option{-mrelocatable} options.
13717
13718 @item -mno-toc
13719 @itemx -mtoc
13720 @opindex mno-toc
13721 @opindex mtoc
13722 On System V.4 and embedded PowerPC systems do not (do) assume that
13723 register 2 contains a pointer to a global area pointing to the addresses
13724 used in the program.
13725
13726 @item -mlittle
13727 @itemx -mlittle-endian
13728 @opindex mlittle
13729 @opindex mlittle-endian
13730 On System V.4 and embedded PowerPC systems compile code for the
13731 processor in little endian mode.  The @option{-mlittle-endian} option is
13732 the same as @option{-mlittle}.
13733
13734 @item -mbig
13735 @itemx -mbig-endian
13736 @opindex mbig
13737 @opindex mbig-endian
13738 On System V.4 and embedded PowerPC systems compile code for the
13739 processor in big endian mode.  The @option{-mbig-endian} option is
13740 the same as @option{-mbig}.
13741
13742 @item -mdynamic-no-pic
13743 @opindex mdynamic-no-pic
13744 On Darwin and Mac OS X systems, compile code so that it is not
13745 relocatable, but that its external references are relocatable.  The
13746 resulting code is suitable for applications, but not shared
13747 libraries.
13748
13749 @item -mprioritize-restricted-insns=@var{priority}
13750 @opindex mprioritize-restricted-insns
13751 This option controls the priority that is assigned to
13752 dispatch-slot restricted instructions during the second scheduling
13753 pass.  The argument @var{priority} takes the value @var{0/1/2} to assign
13754 @var{no/highest/second-highest} priority to dispatch slot restricted
13755 instructions.
13756
13757 @item -msched-costly-dep=@var{dependence_type}
13758 @opindex msched-costly-dep
13759 This option controls which dependences are considered costly
13760 by the target during instruction scheduling.  The argument
13761 @var{dependence_type} takes one of the following values:
13762 @var{no}: no dependence is costly,
13763 @var{all}: all dependences are costly,
13764 @var{true_store_to_load}: a true dependence from store to load is costly,
13765 @var{store_to_load}: any dependence from store to load is costly,
13766 @var{number}: any dependence which latency >= @var{number} is costly.
13767
13768 @item -minsert-sched-nops=@var{scheme}
13769 @opindex minsert-sched-nops
13770 This option controls which nop insertion scheme will be used during
13771 the second scheduling pass.  The argument @var{scheme} takes one of the
13772 following values:
13773 @var{no}: Don't insert nops.
13774 @var{pad}: Pad with nops any dispatch group which has vacant issue slots,
13775 according to the scheduler's grouping.
13776 @var{regroup_exact}: Insert nops to force costly dependent insns into
13777 separate groups.  Insert exactly as many nops as needed to force an insn
13778 to a new group, according to the estimated processor grouping.
13779 @var{number}: Insert nops to force costly dependent insns into
13780 separate groups.  Insert @var{number} nops to force an insn to a new group.
13781
13782 @item -mcall-sysv
13783 @opindex mcall-sysv
13784 On System V.4 and embedded PowerPC systems compile code using calling
13785 conventions that adheres to the March 1995 draft of the System V
13786 Application Binary Interface, PowerPC processor supplement.  This is the
13787 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
13788
13789 @item -mcall-sysv-eabi
13790 @opindex mcall-sysv-eabi
13791 Specify both @option{-mcall-sysv} and @option{-meabi} options.
13792
13793 @item -mcall-sysv-noeabi
13794 @opindex mcall-sysv-noeabi
13795 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
13796
13797 @item -mcall-solaris
13798 @opindex mcall-solaris
13799 On System V.4 and embedded PowerPC systems compile code for the Solaris
13800 operating system.
13801
13802 @item -mcall-linux
13803 @opindex mcall-linux
13804 On System V.4 and embedded PowerPC systems compile code for the
13805 Linux-based GNU system.
13806
13807 @item -mcall-gnu
13808 @opindex mcall-gnu
13809 On System V.4 and embedded PowerPC systems compile code for the
13810 Hurd-based GNU system.
13811
13812 @item -mcall-netbsd
13813 @opindex mcall-netbsd
13814 On System V.4 and embedded PowerPC systems compile code for the
13815 NetBSD operating system.
13816
13817 @item -maix-struct-return
13818 @opindex maix-struct-return
13819 Return all structures in memory (as specified by the AIX ABI)@.
13820
13821 @item -msvr4-struct-return
13822 @opindex msvr4-struct-return
13823 Return structures smaller than 8 bytes in registers (as specified by the
13824 SVR4 ABI)@.
13825
13826 @item -mabi=@var{abi-type}
13827 @opindex mabi
13828 Extend the current ABI with a particular extension, or remove such extension.
13829 Valid values are @var{altivec}, @var{no-altivec}, @var{spe},
13830 @var{no-spe}, @var{ibmlongdouble}, @var{ieeelongdouble}@.
13831
13832 @item -mabi=spe
13833 @opindex mabi=spe
13834 Extend the current ABI with SPE ABI extensions.  This does not change
13835 the default ABI, instead it adds the SPE ABI extensions to the current
13836 ABI@.
13837
13838 @item -mabi=no-spe
13839 @opindex mabi=no-spe
13840 Disable Booke SPE ABI extensions for the current ABI@.
13841
13842 @item -mabi=ibmlongdouble
13843 @opindex mabi=ibmlongdouble
13844 Change the current ABI to use IBM extended precision long double.
13845 This is a PowerPC 32-bit SYSV ABI option.
13846
13847 @item -mabi=ieeelongdouble
13848 @opindex mabi=ieeelongdouble
13849 Change the current ABI to use IEEE extended precision long double.
13850 This is a PowerPC 32-bit Linux ABI option.
13851
13852 @item -mprototype
13853 @itemx -mno-prototype
13854 @opindex mprototype
13855 @opindex mno-prototype
13856 On System V.4 and embedded PowerPC systems assume that all calls to
13857 variable argument functions are properly prototyped.  Otherwise, the
13858 compiler must insert an instruction before every non prototyped call to
13859 set or clear bit 6 of the condition code register (@var{CR}) to
13860 indicate whether floating point values were passed in the floating point
13861 registers in case the function takes a variable arguments.  With
13862 @option{-mprototype}, only calls to prototyped variable argument functions
13863 will set or clear the bit.
13864
13865 @item -msim
13866 @opindex msim
13867 On embedded PowerPC systems, assume that the startup module is called
13868 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
13869 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}
13870 configurations.
13871
13872 @item -mmvme
13873 @opindex mmvme
13874 On embedded PowerPC systems, assume that the startup module is called
13875 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
13876 @file{libc.a}.
13877
13878 @item -mads
13879 @opindex mads
13880 On embedded PowerPC systems, assume that the startup module is called
13881 @file{crt0.o} and the standard C libraries are @file{libads.a} and
13882 @file{libc.a}.
13883
13884 @item -myellowknife
13885 @opindex myellowknife
13886 On embedded PowerPC systems, assume that the startup module is called
13887 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
13888 @file{libc.a}.
13889
13890 @item -mvxworks
13891 @opindex mvxworks
13892 On System V.4 and embedded PowerPC systems, specify that you are
13893 compiling for a VxWorks system.
13894
13895 @item -memb
13896 @opindex memb
13897 On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
13898 header to indicate that @samp{eabi} extended relocations are used.
13899
13900 @item -meabi
13901 @itemx -mno-eabi
13902 @opindex meabi
13903 @opindex mno-eabi
13904 On System V.4 and embedded PowerPC systems do (do not) adhere to the
13905 Embedded Applications Binary Interface (eabi) which is a set of
13906 modifications to the System V.4 specifications.  Selecting @option{-meabi}
13907 means that the stack is aligned to an 8 byte boundary, a function
13908 @code{__eabi} is called to from @code{main} to set up the eabi
13909 environment, and the @option{-msdata} option can use both @code{r2} and
13910 @code{r13} to point to two separate small data areas.  Selecting
13911 @option{-mno-eabi} means that the stack is aligned to a 16 byte boundary,
13912 do not call an initialization function from @code{main}, and the
13913 @option{-msdata} option will only use @code{r13} to point to a single
13914 small data area.  The @option{-meabi} option is on by default if you
13915 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
13916
13917 @item -msdata=eabi
13918 @opindex msdata=eabi
13919 On System V.4 and embedded PowerPC systems, put small initialized
13920 @code{const} global and static data in the @samp{.sdata2} section, which
13921 is pointed to by register @code{r2}.  Put small initialized
13922 non-@code{const} global and static data in the @samp{.sdata} section,
13923 which is pointed to by register @code{r13}.  Put small uninitialized
13924 global and static data in the @samp{.sbss} section, which is adjacent to
13925 the @samp{.sdata} section.  The @option{-msdata=eabi} option is
13926 incompatible with the @option{-mrelocatable} option.  The
13927 @option{-msdata=eabi} option also sets the @option{-memb} option.
13928
13929 @item -msdata=sysv
13930 @opindex msdata=sysv
13931 On System V.4 and embedded PowerPC systems, put small global and static
13932 data in the @samp{.sdata} section, which is pointed to by register
13933 @code{r13}.  Put small uninitialized global and static data in the
13934 @samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
13935 The @option{-msdata=sysv} option is incompatible with the
13936 @option{-mrelocatable} option.
13937
13938 @item -msdata=default
13939 @itemx -msdata
13940 @opindex msdata=default
13941 @opindex msdata
13942 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
13943 compile code the same as @option{-msdata=eabi}, otherwise compile code the
13944 same as @option{-msdata=sysv}.
13945
13946 @item -msdata-data
13947 @opindex msdata-data
13948 On System V.4 and embedded PowerPC systems, put small global
13949 data in the @samp{.sdata} section.  Put small uninitialized global
13950 data in the @samp{.sbss} section.  Do not use register @code{r13}
13951 to address small data however.  This is the default behavior unless
13952 other @option{-msdata} options are used.
13953
13954 @item -msdata=none
13955 @itemx -mno-sdata
13956 @opindex msdata=none
13957 @opindex mno-sdata
13958 On embedded PowerPC systems, put all initialized global and static data
13959 in the @samp{.data} section, and all uninitialized data in the
13960 @samp{.bss} section.
13961
13962 @item -G @var{num}
13963 @opindex G
13964 @cindex smaller data references (PowerPC)
13965 @cindex .sdata/.sdata2 references (PowerPC)
13966 On embedded PowerPC systems, put global and static items less than or
13967 equal to @var{num} bytes into the small data or bss sections instead of
13968 the normal data or bss section.  By default, @var{num} is 8.  The
13969 @option{-G @var{num}} switch is also passed to the linker.
13970 All modules should be compiled with the same @option{-G @var{num}} value.
13971
13972 @item -mregnames
13973 @itemx -mno-regnames
13974 @opindex mregnames
13975 @opindex mno-regnames
13976 On System V.4 and embedded PowerPC systems do (do not) emit register
13977 names in the assembly language output using symbolic forms.
13978
13979 @item -mlongcall
13980 @itemx -mno-longcall
13981 @opindex mlongcall
13982 @opindex mno-longcall
13983 By default assume that all calls are far away so that a longer more
13984 expensive calling sequence is required.  This is required for calls
13985 further than 32 megabytes (33,554,432 bytes) from the current location.
13986 A short call will be generated if the compiler knows
13987 the call cannot be that far away.  This setting can be overridden by
13988 the @code{shortcall} function attribute, or by @code{#pragma
13989 longcall(0)}.
13990
13991 Some linkers are capable of detecting out-of-range calls and generating
13992 glue code on the fly.  On these systems, long calls are unnecessary and
13993 generate slower code.  As of this writing, the AIX linker can do this,
13994 as can the GNU linker for PowerPC/64.  It is planned to add this feature
13995 to the GNU linker for 32-bit PowerPC systems as well.
13996
13997 On Darwin/PPC systems, @code{#pragma longcall} will generate ``jbsr
13998 callee, L42'', plus a ``branch island'' (glue code).  The two target
13999 addresses represent the callee and the ``branch island''.  The
14000 Darwin/PPC linker will prefer the first address and generate a ``bl
14001 callee'' if the PPC ``bl'' instruction will reach the callee directly;
14002 otherwise, the linker will generate ``bl L42'' to call the ``branch
14003 island''.  The ``branch island'' is appended to the body of the
14004 calling function; it computes the full 32-bit address of the callee
14005 and jumps to it.
14006
14007 On Mach-O (Darwin) systems, this option directs the compiler emit to
14008 the glue for every direct call, and the Darwin linker decides whether
14009 to use or discard it.
14010
14011 In the future, we may cause GCC to ignore all longcall specifications
14012 when the linker is known to generate glue.
14013
14014 @item -pthread
14015 @opindex pthread
14016 Adds support for multithreading with the @dfn{pthreads} library.
14017 This option sets flags for both the preprocessor and linker.
14018
14019 @end table
14020
14021 @node S/390 and zSeries Options
14022 @subsection S/390 and zSeries Options
14023 @cindex S/390 and zSeries Options
14024
14025 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
14026
14027 @table @gcctabopt
14028 @item -mhard-float
14029 @itemx -msoft-float
14030 @opindex mhard-float
14031 @opindex msoft-float
14032 Use (do not use) the hardware floating-point instructions and registers
14033 for floating-point operations.  When @option{-msoft-float} is specified,
14034 functions in @file{libgcc.a} will be used to perform floating-point
14035 operations.  When @option{-mhard-float} is specified, the compiler
14036 generates IEEE floating-point instructions.  This is the default.
14037
14038 @item -mlong-double-64
14039 @itemx -mlong-double-128
14040 @opindex mlong-double-64
14041 @opindex mlong-double-128
14042 These switches control the size of @code{long double} type. A size
14043 of 64bit makes the @code{long double} type equivalent to the @code{double}
14044 type. This is the default.
14045
14046 @item -mbackchain
14047 @itemx -mno-backchain
14048 @opindex mbackchain
14049 @opindex mno-backchain
14050 Store (do not store) the address of the caller's frame as backchain pointer
14051 into the callee's stack frame.
14052 A backchain may be needed to allow debugging using tools that do not understand
14053 DWARF-2 call frame information.
14054 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
14055 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
14056 the backchain is placed into the topmost word of the 96/160 byte register
14057 save area.
14058
14059 In general, code compiled with @option{-mbackchain} is call-compatible with
14060 code compiled with @option{-mmo-backchain}; however, use of the backchain
14061 for debugging purposes usually requires that the whole binary is built with
14062 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
14063 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
14064 to build a linux kernel use @option{-msoft-float}.
14065
14066 The default is to not maintain the backchain.
14067
14068 @item -mpacked-stack
14069 @itemx -mno-packed-stack
14070 @opindex mpacked-stack
14071 @opindex mno-packed-stack
14072 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
14073 specified, the compiler uses the all fields of the 96/160 byte register save
14074 area only for their default purpose; unused fields still take up stack space.
14075 When @option{-mpacked-stack} is specified, register save slots are densely
14076 packed at the top of the register save area; unused space is reused for other
14077 purposes, allowing for more efficient use of the available stack space.
14078 However, when @option{-mbackchain} is also in effect, the topmost word of
14079 the save area is always used to store the backchain, and the return address
14080 register is always saved two words below the backchain.
14081
14082 As long as the stack frame backchain is not used, code generated with
14083 @option{-mpacked-stack} is call-compatible with code generated with
14084 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
14085 S/390 or zSeries generated code that uses the stack frame backchain at run
14086 time, not just for debugging purposes.  Such code is not call-compatible
14087 with code compiled with @option{-mpacked-stack}.  Also, note that the
14088 combination of @option{-mbackchain},
14089 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
14090 to build a linux kernel use @option{-msoft-float}.
14091
14092 The default is to not use the packed stack layout.
14093
14094 @item -msmall-exec
14095 @itemx -mno-small-exec
14096 @opindex msmall-exec
14097 @opindex mno-small-exec
14098 Generate (or do not generate) code using the @code{bras} instruction
14099 to do subroutine calls.
14100 This only works reliably if the total executable size does not
14101 exceed 64k.  The default is to use the @code{basr} instruction instead,
14102 which does not have this limitation.
14103
14104 @item -m64
14105 @itemx -m31
14106 @opindex m64
14107 @opindex m31
14108 When @option{-m31} is specified, generate code compliant to the
14109 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
14110 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
14111 particular to generate 64-bit instructions.  For the @samp{s390}
14112 targets, the default is @option{-m31}, while the @samp{s390x}
14113 targets default to @option{-m64}.
14114
14115 @item -mzarch
14116 @itemx -mesa
14117 @opindex mzarch
14118 @opindex mesa
14119 When @option{-mzarch} is specified, generate code using the
14120 instructions available on z/Architecture.
14121 When @option{-mesa} is specified, generate code using the
14122 instructions available on ESA/390.  Note that @option{-mesa} is
14123 not possible with @option{-m64}.
14124 When generating code compliant to the GNU/Linux for S/390 ABI,
14125 the default is @option{-mesa}.  When generating code compliant
14126 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
14127
14128 @item -mmvcle
14129 @itemx -mno-mvcle
14130 @opindex mmvcle
14131 @opindex mno-mvcle
14132 Generate (or do not generate) code using the @code{mvcle} instruction
14133 to perform block moves.  When @option{-mno-mvcle} is specified,
14134 use a @code{mvc} loop instead.  This is the default unless optimizing for
14135 size.
14136
14137 @item -mdebug
14138 @itemx -mno-debug
14139 @opindex mdebug
14140 @opindex mno-debug
14141 Print (or do not print) additional debug information when compiling.
14142 The default is to not print debug information.
14143
14144 @item -march=@var{cpu-type}
14145 @opindex march
14146 Generate code that will run on @var{cpu-type}, which is the name of a system
14147 representing a certain processor type.  Possible values for
14148 @var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, and @samp{z990}.
14149 When generating code using the instructions available on z/Architecture,
14150 the default is @option{-march=z900}.  Otherwise, the default is
14151 @option{-march=g5}.
14152
14153 @item -mtune=@var{cpu-type}
14154 @opindex mtune
14155 Tune to @var{cpu-type} everything applicable about the generated code,
14156 except for the ABI and the set of available instructions.
14157 The list of @var{cpu-type} values is the same as for @option{-march}.
14158 The default is the value used for @option{-march}.
14159
14160 @item -mtpf-trace
14161 @itemx -mno-tpf-trace
14162 @opindex mtpf-trace
14163 @opindex mno-tpf-trace
14164 Generate code that adds (does not add) in TPF OS specific branches to trace
14165 routines in the operating system.  This option is off by default, even
14166 when compiling for the TPF OS@.
14167
14168 @item -mfused-madd
14169 @itemx -mno-fused-madd
14170 @opindex mfused-madd
14171 @opindex mno-fused-madd
14172 Generate code that uses (does not use) the floating point multiply and
14173 accumulate instructions.  These instructions are generated by default if
14174 hardware floating point is used.
14175
14176 @item -mwarn-framesize=@var{framesize}
14177 @opindex mwarn-framesize
14178 Emit a warning if the current function exceeds the given frame size.  Because
14179 this is a compile time check it doesn't need to be a real problem when the program
14180 runs.  It is intended to identify functions which most probably cause
14181 a stack overflow.  It is useful to be used in an environment with limited stack
14182 size e.g.@: the linux kernel.
14183
14184 @item -mwarn-dynamicstack
14185 @opindex mwarn-dynamicstack
14186 Emit a warning if the function calls alloca or uses dynamically
14187 sized arrays.  This is generally a bad idea with a limited stack size.
14188
14189 @item -mstack-guard=@var{stack-guard}
14190 @itemx -mstack-size=@var{stack-size}
14191 @opindex mstack-guard
14192 @opindex mstack-size
14193 If these options are provided the s390 back end emits additional instructions in
14194 the function prologue which trigger a trap if the stack size is @var{stack-guard}
14195 bytes above the @var{stack-size} (remember that the stack on s390 grows downward).
14196 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
14197 the frame size of the compiled function is chosen.
14198 These options are intended to be used to help debugging stack overflow problems.
14199 The additionally emitted code causes only little overhead and hence can also be
14200 used in production like systems without greater performance degradation.  The given
14201 values have to be exact powers of 2 and @var{stack-size} has to be greater than
14202 @var{stack-guard} without exceeding 64k.
14203 In order to be efficient the extra code makes the assumption that the stack starts
14204 at an address aligned to the value given by @var{stack-size}.
14205 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
14206 @end table
14207
14208 @node Score Options
14209 @subsection Score Options
14210 @cindex Score Options
14211
14212 These options are defined for Score implementations:
14213
14214 @table @gcctabopt
14215 @item -meb
14216 @opindex meb
14217 Compile code for big endian mode.  This is the default.
14218
14219 @item -mel
14220 @opindex mel
14221 Compile code for little endian mode. 
14222
14223 @item -mnhwloop
14224 @opindex mnhwloop
14225 Disable generate bcnz instruction.
14226
14227 @item -muls
14228 @opindex muls
14229 Enable generate unaligned load and store instruction.
14230
14231 @item -mmac
14232 @opindex mmac
14233 Enable the use of multiply-accumulate instructions. Disabled by default. 
14234
14235 @item -mscore5
14236 @opindex mscore5
14237 Specify the SCORE5 as the target architecture.
14238
14239 @item -mscore5u
14240 @opindex mscore5u
14241 Specify the SCORE5U of the target architecture.
14242
14243 @item -mscore7
14244 @opindex mscore7
14245 Specify the SCORE7 as the target architecture. This is the default.
14246
14247 @item -mscore7d
14248 @opindex mscore7d
14249 Specify the SCORE7D as the target architecture.
14250 @end table
14251
14252 @node SH Options
14253 @subsection SH Options
14254
14255 These @samp{-m} options are defined for the SH implementations:
14256
14257 @table @gcctabopt
14258 @item -m1
14259 @opindex m1
14260 Generate code for the SH1.
14261
14262 @item -m2
14263 @opindex m2
14264 Generate code for the SH2.
14265
14266 @item -m2e
14267 Generate code for the SH2e.
14268
14269 @item -m3
14270 @opindex m3
14271 Generate code for the SH3.
14272
14273 @item -m3e
14274 @opindex m3e
14275 Generate code for the SH3e.
14276
14277 @item -m4-nofpu
14278 @opindex m4-nofpu
14279 Generate code for the SH4 without a floating-point unit.
14280
14281 @item -m4-single-only
14282 @opindex m4-single-only
14283 Generate code for the SH4 with a floating-point unit that only
14284 supports single-precision arithmetic.
14285
14286 @item -m4-single
14287 @opindex m4-single
14288 Generate code for the SH4 assuming the floating-point unit is in
14289 single-precision mode by default.
14290
14291 @item -m4
14292 @opindex m4
14293 Generate code for the SH4.
14294
14295 @item -m4a-nofpu
14296 @opindex m4a-nofpu
14297 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
14298 floating-point unit is not used.
14299
14300 @item -m4a-single-only
14301 @opindex m4a-single-only
14302 Generate code for the SH4a, in such a way that no double-precision
14303 floating point operations are used.
14304
14305 @item -m4a-single
14306 @opindex m4a-single
14307 Generate code for the SH4a assuming the floating-point unit is in
14308 single-precision mode by default.
14309
14310 @item -m4a
14311 @opindex m4a
14312 Generate code for the SH4a.
14313
14314 @item -m4al
14315 @opindex m4al
14316 Same as @option{-m4a-nofpu}, except that it implicitly passes
14317 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
14318 instructions at the moment.
14319
14320 @item -mb
14321 @opindex mb
14322 Compile code for the processor in big endian mode.
14323
14324 @item -ml
14325 @opindex ml
14326 Compile code for the processor in little endian mode.
14327
14328 @item -mdalign
14329 @opindex mdalign
14330 Align doubles at 64-bit boundaries.  Note that this changes the calling
14331 conventions, and thus some functions from the standard C library will
14332 not work unless you recompile it first with @option{-mdalign}.
14333
14334 @item -mrelax
14335 @opindex mrelax
14336 Shorten some address references at link time, when possible; uses the
14337 linker option @option{-relax}.
14338
14339 @item -mbigtable
14340 @opindex mbigtable
14341 Use 32-bit offsets in @code{switch} tables.  The default is to use
14342 16-bit offsets.
14343
14344 @item -mbitops
14345 @opindex mbitops
14346 Enable the use of bit manipulation instructions on SH2A.
14347
14348 @item -mfmovd
14349 @opindex mfmovd
14350 Enable the use of the instruction @code{fmovd}.
14351
14352 @item -mhitachi
14353 @opindex mhitachi
14354 Comply with the calling conventions defined by Renesas.
14355
14356 @item -mrenesas
14357 @opindex mhitachi
14358 Comply with the calling conventions defined by Renesas.
14359
14360 @item -mno-renesas
14361 @opindex mhitachi
14362 Comply with the calling conventions defined for GCC before the Renesas
14363 conventions were available.  This option is the default for all
14364 targets of the SH toolchain except for @samp{sh-symbianelf}.
14365
14366 @item -mnomacsave
14367 @opindex mnomacsave
14368 Mark the @code{MAC} register as call-clobbered, even if
14369 @option{-mhitachi} is given.
14370
14371 @item -mieee
14372 @opindex mieee
14373 Increase IEEE-compliance of floating-point code.
14374 At the moment, this is equivalent to @option{-fno-finite-math-only}.
14375 When generating 16 bit SH opcodes, getting IEEE-conforming results for
14376 comparisons of NANs / infinities incurs extra overhead in every
14377 floating point comparison, therefore the default is set to
14378 @option{-ffinite-math-only}.
14379
14380 @item -minline-ic_invalidate
14381 @opindex minline-ic_invalidate
14382 Inline code to invalidate instruction cache entries after setting up
14383 nested function trampolines.
14384 This option has no effect if -musermode is in effect and the selected
14385 code generation option (e.g. -m4) does not allow the use of the icbi
14386 instruction.
14387 If the selected code generation option does not allow the use of the icbi
14388 instruction, and -musermode is not in effect, the inlined code will
14389 manipulate the instruction cache address array directly with an associative
14390 write.  This not only requires privileged mode, but it will also
14391 fail if the cache line had been mapped via the TLB and has become unmapped.
14392
14393 @item -misize
14394 @opindex misize
14395 Dump instruction size and location in the assembly code.
14396
14397 @item -mpadstruct
14398 @opindex mpadstruct
14399 This option is deprecated.  It pads structures to multiple of 4 bytes,
14400 which is incompatible with the SH ABI@.
14401
14402 @item -mspace
14403 @opindex mspace
14404 Optimize for space instead of speed.  Implied by @option{-Os}.
14405
14406 @item -mprefergot
14407 @opindex mprefergot
14408 When generating position-independent code, emit function calls using
14409 the Global Offset Table instead of the Procedure Linkage Table.
14410
14411 @item -musermode
14412 @opindex musermode
14413 Don't generate privileged mode only code; implies -mno-inline-ic_invalidate
14414 if the inlined code would not work in user mode.
14415 This is the default when the target is @code{sh-*-linux*}.
14416
14417 @item -multcost=@var{number}
14418 @opindex multcost=@var{number}
14419 Set the cost to assume for a multiply insn.
14420
14421 @item -mdiv=@var{strategy}
14422 @opindex mdiv=@var{strategy}
14423 Set the division strategy to use for SHmedia code.  @var{strategy} must be
14424 one of: call, call2, fp, inv, inv:minlat, inv20u, inv20l, inv:call,
14425 inv:call2, inv:fp .
14426 "fp" performs the operation in floating point.  This has a very high latency,
14427 but needs only a few instructions, so it might be a good choice if
14428 your code has enough easily exploitable ILP to allow the compiler to
14429 schedule the floating point instructions together with other instructions.
14430 Division by zero causes a floating point exception.
14431 "inv" uses integer operations to calculate the inverse of the divisor,
14432 and then multiplies the dividend with the inverse.  This strategy allows
14433 cse and hoisting of the inverse calculation.  Division by zero calculates
14434 an unspecified result, but does not trap.
14435 "inv:minlat" is a variant of "inv" where if no cse / hoisting opportunities
14436 have been found, or if the entire operation has been hoisted to the same
14437 place, the last stages of the inverse calculation are intertwined with the
14438 final multiply to reduce the overall latency, at the expense of using a few
14439 more instructions, and thus offering fewer scheduling opportunities with
14440 other code.
14441 "call" calls a library function that usually implements the inv:minlat
14442 strategy.
14443 This gives high code density for m5-*media-nofpu compilations.
14444 "call2" uses a different entry point of the same library function, where it
14445 assumes that a pointer to a lookup table has already been set up, which
14446 exposes the pointer load to cse / code hoisting optimizations.
14447 "inv:call", "inv:call2" and "inv:fp" all use the "inv" algorithm for initial
14448 code generation, but if the code stays unoptimized, revert to the "call",
14449 "call2", or "fp" strategies, respectively.  Note that the
14450 potentially-trapping side effect of division by zero is carried by a
14451 separate instruction, so it is possible that all the integer instructions
14452 are hoisted out, but the marker for the side effect stays where it is.
14453 A recombination to fp operations or a call is not possible in that case.
14454 "inv20u" and "inv20l" are variants of the "inv:minlat" strategy.  In the case
14455 that the inverse calculation was nor separated from the multiply, they speed
14456 up division where the dividend fits into 20 bits (plus sign where applicable),
14457 by inserting a test to skip a number of operations in this case; this test
14458 slows down the case of larger dividends.  inv20u assumes the case of a such
14459 a small dividend to be unlikely, and inv20l assumes it to be likely.
14460
14461 @item -mdivsi3_libfunc=@var{name}
14462 @opindex mdivsi3_libfunc=@var{name}
14463 Set the name of the library function used for 32 bit signed division to
14464 @var{name}.  This only affect the name used in the call and inv:call
14465 division strategies, and the compiler will still expect the same
14466 sets of input/output/clobbered registers as if this option was not present.
14467
14468 @item -mfixed-range=@var{register-range}
14469 @opindex mfixed-range
14470 Generate code treating the given register range as fixed registers.
14471 A fixed register is one that the register allocator can not use.  This is
14472 useful when compiling kernel code.  A register range is specified as
14473 two registers separated by a dash.  Multiple register ranges can be
14474 specified separated by a comma.
14475
14476 @item -madjust-unroll
14477 @opindex madjust-unroll
14478 Throttle unrolling to avoid thrashing target registers.
14479 This option only has an effect if the gcc code base supports the
14480 TARGET_ADJUST_UNROLL_MAX target hook.
14481
14482 @item -mindexed-addressing
14483 @opindex mindexed-addressing
14484 Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
14485 This is only safe if the hardware and/or OS implement 32 bit wrap-around
14486 semantics for the indexed addressing mode.  The architecture allows the
14487 implementation of processors with 64 bit MMU, which the OS could use to
14488 get 32 bit addressing, but since no current hardware implementation supports
14489 this or any other way to make the indexed addressing mode safe to use in
14490 the 32 bit ABI, the default is -mno-indexed-addressing.
14491
14492 @item -mgettrcost=@var{number}
14493 @opindex mgettrcost=@var{number}
14494 Set the cost assumed for the gettr instruction to @var{number}.
14495 The default is 2 if @option{-mpt-fixed} is in effect, 100 otherwise.
14496
14497 @item -mpt-fixed
14498 @opindex mpt-fixed
14499 Assume pt* instructions won't trap.  This will generally generate better
14500 scheduled code, but is unsafe on current hardware.  The current architecture
14501 definition says that ptabs and ptrel trap when the target anded with 3 is 3.
14502 This has the unintentional effect of making it unsafe to schedule ptabs /
14503 ptrel before a branch, or hoist it out of a loop.  For example,
14504 __do_global_ctors, a part of libgcc that runs constructors at program
14505 startup, calls functions in a list which is delimited by @minus{}1.  With the
14506 -mpt-fixed option, the ptabs will be done before testing against @minus{}1.
14507 That means that all the constructors will be run a bit quicker, but when
14508 the loop comes to the end of the list, the program crashes because ptabs
14509 loads @minus{}1 into a target register.  Since this option is unsafe for any
14510 hardware implementing the current architecture specification, the default
14511 is -mno-pt-fixed.  Unless the user specifies a specific cost with
14512 @option{-mgettrcost}, -mno-pt-fixed also implies @option{-mgettrcost=100};
14513 this deters register allocation using target registers for storing
14514 ordinary integers.
14515
14516 @item -minvalid-symbols
14517 @opindex minvalid-symbols
14518 Assume symbols might be invalid.  Ordinary function symbols generated by
14519 the compiler will always be valid to load with movi/shori/ptabs or
14520 movi/shori/ptrel, but with assembler and/or linker tricks it is possible
14521 to generate symbols that will cause ptabs / ptrel to trap.
14522 This option is only meaningful when @option{-mno-pt-fixed} is in effect.
14523 It will then prevent cross-basic-block cse, hoisting and most scheduling
14524 of symbol loads.  The default is @option{-mno-invalid-symbols}.
14525 @end table
14526
14527 @node SPARC Options
14528 @subsection SPARC Options
14529 @cindex SPARC options
14530
14531 These @samp{-m} options are supported on the SPARC:
14532
14533 @table @gcctabopt
14534 @item -mno-app-regs
14535 @itemx -mapp-regs
14536 @opindex mno-app-regs
14537 @opindex mapp-regs
14538 Specify @option{-mapp-regs} to generate output using the global registers
14539 2 through 4, which the SPARC SVR4 ABI reserves for applications.  This
14540 is the default.
14541
14542 To be fully SVR4 ABI compliant at the cost of some performance loss,
14543 specify @option{-mno-app-regs}.  You should compile libraries and system
14544 software with this option.
14545
14546 @item -mfpu
14547 @itemx -mhard-float
14548 @opindex mfpu
14549 @opindex mhard-float
14550 Generate output containing floating point instructions.  This is the
14551 default.
14552
14553 @item -mno-fpu
14554 @itemx -msoft-float
14555 @opindex mno-fpu
14556 @opindex msoft-float
14557 Generate output containing library calls for floating point.
14558 @strong{Warning:} the requisite libraries are not available for all SPARC
14559 targets.  Normally the facilities of the machine's usual C compiler are
14560 used, but this cannot be done directly in cross-compilation.  You must make
14561 your own arrangements to provide suitable library functions for
14562 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
14563 @samp{sparclite-*-*} do provide software floating point support.
14564
14565 @option{-msoft-float} changes the calling convention in the output file;
14566 therefore, it is only useful if you compile @emph{all} of a program with
14567 this option.  In particular, you need to compile @file{libgcc.a}, the
14568 library that comes with GCC, with @option{-msoft-float} in order for
14569 this to work.
14570
14571 @item -mhard-quad-float
14572 @opindex mhard-quad-float
14573 Generate output containing quad-word (long double) floating point
14574 instructions.
14575
14576 @item -msoft-quad-float
14577 @opindex msoft-quad-float
14578 Generate output containing library calls for quad-word (long double)
14579 floating point instructions.  The functions called are those specified
14580 in the SPARC ABI@.  This is the default.
14581
14582 As of this writing, there are no SPARC implementations that have hardware
14583 support for the quad-word floating point instructions.  They all invoke
14584 a trap handler for one of these instructions, and then the trap handler
14585 emulates the effect of the instruction.  Because of the trap handler overhead,
14586 this is much slower than calling the ABI library routines.  Thus the
14587 @option{-msoft-quad-float} option is the default.
14588
14589 @item -mno-unaligned-doubles
14590 @itemx -munaligned-doubles
14591 @opindex mno-unaligned-doubles
14592 @opindex munaligned-doubles
14593 Assume that doubles have 8 byte alignment.  This is the default.
14594
14595 With @option{-munaligned-doubles}, GCC assumes that doubles have 8 byte
14596 alignment only if they are contained in another type, or if they have an
14597 absolute address.  Otherwise, it assumes they have 4 byte alignment.
14598 Specifying this option avoids some rare compatibility problems with code
14599 generated by other compilers.  It is not the default because it results
14600 in a performance loss, especially for floating point code.
14601
14602 @item -mno-faster-structs
14603 @itemx -mfaster-structs
14604 @opindex mno-faster-structs
14605 @opindex mfaster-structs
14606 With @option{-mfaster-structs}, the compiler assumes that structures
14607 should have 8 byte alignment.  This enables the use of pairs of
14608 @code{ldd} and @code{std} instructions for copies in structure
14609 assignment, in place of twice as many @code{ld} and @code{st} pairs.
14610 However, the use of this changed alignment directly violates the SPARC
14611 ABI@.  Thus, it's intended only for use on targets where the developer
14612 acknowledges that their resulting code will not be directly in line with
14613 the rules of the ABI@.
14614
14615 @item -mimpure-text
14616 @opindex mimpure-text
14617 @option{-mimpure-text}, used in addition to @option{-shared}, tells
14618 the compiler to not pass @option{-z text} to the linker when linking a
14619 shared object.  Using this option, you can link position-dependent
14620 code into a shared object.
14621
14622 @option{-mimpure-text} suppresses the ``relocations remain against
14623 allocatable but non-writable sections'' linker error message.
14624 However, the necessary relocations will trigger copy-on-write, and the
14625 shared object is not actually shared across processes.  Instead of
14626 using @option{-mimpure-text}, you should compile all source code with
14627 @option{-fpic} or @option{-fPIC}.
14628
14629 This option is only available on SunOS and Solaris.
14630
14631 @item -mcpu=@var{cpu_type}
14632 @opindex mcpu
14633 Set the instruction set, register set, and instruction scheduling parameters
14634 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
14635 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{sparclite},
14636 @samp{f930}, @samp{f934}, @samp{hypersparc}, @samp{sparclite86x},
14637 @samp{sparclet}, @samp{tsc701}, @samp{v9}, @samp{ultrasparc},
14638 @samp{ultrasparc3}, @samp{niagara} and @samp{niagara2}.
14639
14640 Default instruction scheduling parameters are used for values that select
14641 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
14642 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
14643
14644 Here is a list of each supported architecture and their supported
14645 implementations.
14646
14647 @smallexample
14648     v7:             cypress
14649     v8:             supersparc, hypersparc
14650     sparclite:      f930, f934, sparclite86x
14651     sparclet:       tsc701
14652     v9:             ultrasparc, ultrasparc3, niagara, niagara2
14653 @end smallexample
14654
14655 By default (unless configured otherwise), GCC generates code for the V7
14656 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
14657 additionally optimizes it for the Cypress CY7C602 chip, as used in the
14658 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
14659 SPARCStation 1, 2, IPX etc.
14660
14661 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
14662 architecture.  The only difference from V7 code is that the compiler emits
14663 the integer multiply and integer divide instructions which exist in SPARC-V8
14664 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
14665 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
14666 2000 series.
14667
14668 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
14669 the SPARC architecture.  This adds the integer multiply, integer divide step
14670 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
14671 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
14672 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
14673 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
14674 MB86934 chip, which is the more recent SPARClite with FPU@.
14675
14676 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
14677 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
14678 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
14679 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
14680 optimizes it for the TEMIC SPARClet chip.
14681
14682 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
14683 architecture.  This adds 64-bit integer and floating-point move instructions,
14684 3 additional floating-point condition code registers and conditional move
14685 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
14686 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
14687 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
14688 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
14689 @option{-mcpu=niagara}, the compiler additionally optimizes it for
14690 Sun UltraSPARC T1 chips.  With @option{-mcpu=niagara2}, the compiler
14691 additionally optimizes it for Sun UltraSPARC T2 chips.
14692
14693 @item -mtune=@var{cpu_type}
14694 @opindex mtune
14695 Set the instruction scheduling parameters for machine type
14696 @var{cpu_type}, but do not set the instruction set or register set that the
14697 option @option{-mcpu=@var{cpu_type}} would.
14698
14699 The same values for @option{-mcpu=@var{cpu_type}} can be used for
14700 @option{-mtune=@var{cpu_type}}, but the only useful values are those
14701 that select a particular cpu implementation.  Those are @samp{cypress},
14702 @samp{supersparc}, @samp{hypersparc}, @samp{f930}, @samp{f934},
14703 @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc},
14704 @samp{ultrasparc3}, @samp{niagara}, and @samp{niagara2}.
14705
14706 @item -mv8plus
14707 @itemx -mno-v8plus
14708 @opindex mv8plus
14709 @opindex mno-v8plus
14710 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
14711 difference from the V8 ABI is that the global and out registers are
14712 considered 64-bit wide.  This is enabled by default on Solaris in 32-bit
14713 mode for all SPARC-V9 processors.
14714
14715 @item -mvis
14716 @itemx -mno-vis
14717 @opindex mvis
14718 @opindex mno-vis
14719 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
14720 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
14721 @end table
14722
14723 These @samp{-m} options are supported in addition to the above
14724 on SPARC-V9 processors in 64-bit environments:
14725
14726 @table @gcctabopt
14727 @item -mlittle-endian
14728 @opindex mlittle-endian
14729 Generate code for a processor running in little-endian mode.  It is only
14730 available for a few configurations and most notably not on Solaris and Linux.
14731
14732 @item -m32
14733 @itemx -m64
14734 @opindex m32
14735 @opindex m64
14736 Generate code for a 32-bit or 64-bit environment.
14737 The 32-bit environment sets int, long and pointer to 32 bits.
14738 The 64-bit environment sets int to 32 bits and long and pointer
14739 to 64 bits.
14740
14741 @item -mcmodel=medlow
14742 @opindex mcmodel=medlow
14743 Generate code for the Medium/Low code model: 64-bit addresses, programs
14744 must be linked in the low 32 bits of memory.  Programs can be statically
14745 or dynamically linked.
14746
14747 @item -mcmodel=medmid
14748 @opindex mcmodel=medmid
14749 Generate code for the Medium/Middle code model: 64-bit addresses, programs
14750 must be linked in the low 44 bits of memory, the text and data segments must
14751 be less than 2GB in size and the data segment must be located within 2GB of
14752 the text segment.
14753
14754 @item -mcmodel=medany
14755 @opindex mcmodel=medany
14756 Generate code for the Medium/Anywhere code model: 64-bit addresses, programs
14757 may be linked anywhere in memory, the text and data segments must be less
14758 than 2GB in size and the data segment must be located within 2GB of the
14759 text segment.
14760
14761 @item -mcmodel=embmedany
14762 @opindex mcmodel=embmedany
14763 Generate code for the Medium/Anywhere code model for embedded systems:
14764 64-bit addresses, the text and data segments must be less than 2GB in
14765 size, both starting anywhere in memory (determined at link time).  The
14766 global register %g4 points to the base of the data segment.  Programs
14767 are statically linked and PIC is not supported.
14768
14769 @item -mstack-bias
14770 @itemx -mno-stack-bias
14771 @opindex mstack-bias
14772 @opindex mno-stack-bias
14773 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
14774 frame pointer if present, are offset by @minus{}2047 which must be added back
14775 when making stack frame references.  This is the default in 64-bit mode.
14776 Otherwise, assume no such offset is present.
14777 @end table
14778
14779 These switches are supported in addition to the above on Solaris:
14780
14781 @table @gcctabopt
14782 @item -threads
14783 @opindex threads
14784 Add support for multithreading using the Solaris threads library.  This
14785 option sets flags for both the preprocessor and linker.  This option does
14786 not affect the thread safety of object code produced by the compiler or
14787 that of libraries supplied with it.
14788
14789 @item -pthreads
14790 @opindex pthreads
14791 Add support for multithreading using the POSIX threads library.  This
14792 option sets flags for both the preprocessor and linker.  This option does
14793 not affect the thread safety of object code produced  by the compiler or
14794 that of libraries supplied with it.
14795
14796 @item -pthread
14797 @opindex pthread
14798 This is a synonym for @option{-pthreads}.
14799 @end table
14800
14801 @node SPU Options
14802 @subsection SPU Options
14803 @cindex SPU options
14804
14805 These @samp{-m} options are supported on the SPU:
14806
14807 @table @gcctabopt
14808 @item -mwarn-reloc
14809 @itemx -merror-reloc
14810 @opindex mwarn-reloc
14811 @opindex merror-reloc
14812
14813 The loader for SPU does not handle dynamic relocations.  By default, GCC
14814 will give an error when it generates code that requires a dynamic
14815 relocation.  @option{-mno-error-reloc} disables the error,
14816 @option{-mwarn-reloc} will generate a warning instead.
14817
14818 @item -msafe-dma
14819 @itemx -munsafe-dma
14820 @opindex msafe-dma
14821 @opindex munsafe-dma
14822
14823 Instructions which initiate or test completion of DMA must not be
14824 reordered with respect to loads and stores of the memory which is being
14825 accessed.  Users typically address this problem using the volatile
14826 keyword, but that can lead to inefficient code in places where the
14827 memory is known to not change.  Rather than mark the memory as volatile
14828 we treat the DMA instructions as potentially effecting all memory.  With
14829 @option{-munsafe-dma} users must use the volatile keyword to protect
14830 memory accesses.
14831
14832 @item -mbranch-hints
14833 @opindex mbranch-hints
14834
14835 By default, GCC will generate a branch hint instruction to avoid
14836 pipeline stalls for always taken or probably taken branches.  A hint
14837 will not be generated closer than 8 instructions away from its branch.
14838 There is little reason to disable them, except for debugging purposes,
14839 or to make an object a little bit smaller.
14840
14841 @item -msmall-mem
14842 @itemx -mlarge-mem
14843 @opindex msmall-mem
14844 @opindex mlarge-mem
14845
14846 By default, GCC generates code assuming that addresses are never larger
14847 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
14848 a full 32 bit address.
14849
14850 @item -mstdmain
14851 @opindex mstdmain
14852
14853 By default, GCC links against startup code that assumes the SPU-style
14854 main function interface (which has an unconventional parameter list).
14855 With @option{-mstdmain}, GCC will link your program against startup
14856 code that assumes a C99-style interface to @code{main}, including a
14857 local copy of @code{argv} strings.
14858
14859 @item -mfixed-range=@var{register-range}
14860 @opindex mfixed-range
14861 Generate code treating the given register range as fixed registers.
14862 A fixed register is one that the register allocator can not use.  This is
14863 useful when compiling kernel code.  A register range is specified as
14864 two registers separated by a dash.  Multiple register ranges can be
14865 specified separated by a comma.
14866
14867 @item -mdual-nops
14868 @itemx -mdual-nops=@var{n}
14869 @opindex mdual-nops
14870 By default, GCC will insert nops to increase dual issue when it expects
14871 it to increase performance.  @var{n} can be a value from 0 to 10.  A
14872 smaller @var{n} will insert fewer nops.  10 is the default, 0 is the
14873 same as @option{-mno-dual-nops}.  Disabled with @option{-Os}.
14874
14875 @item -mhint-max-nops=@var{n}
14876 @opindex mhint-max-nops
14877 Maximum number of nops to insert for a branch hint.  A branch hint must
14878 be at least 8 instructions away from the branch it is effecting.  GCC
14879 will insert up to @var{n} nops to enforce this, otherwise it will not
14880 generate the branch hint.
14881
14882 @item -mhint-max-distance=@var{n}
14883 @opindex mhint-max-distance
14884 The encoding of the branch hint instruction limits the hint to be within
14885 256 instructions of the branch it is effecting.  By default, GCC makes
14886 sure it is within 125. 
14887
14888 @item -msafe-hints
14889 @opindex msafe-hints
14890 Work around a hardware bug which causes the SPU to stall indefinitely.
14891 By default, GCC will insert the @code{hbrp} instruction to make sure
14892 this stall won't happen.
14893
14894 @end table
14895
14896 @node System V Options
14897 @subsection Options for System V
14898
14899 These additional options are available on System V Release 4 for
14900 compatibility with other compilers on those systems:
14901
14902 @table @gcctabopt
14903 @item -G
14904 @opindex G
14905 Create a shared object.
14906 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
14907
14908 @item -Qy
14909 @opindex Qy
14910 Identify the versions of each tool used by the compiler, in a
14911 @code{.ident} assembler directive in the output.
14912
14913 @item -Qn
14914 @opindex Qn
14915 Refrain from adding @code{.ident} directives to the output file (this is
14916 the default).
14917
14918 @item -YP,@var{dirs}
14919 @opindex YP
14920 Search the directories @var{dirs}, and no others, for libraries
14921 specified with @option{-l}.
14922
14923 @item -Ym,@var{dir}
14924 @opindex Ym
14925 Look in the directory @var{dir} to find the M4 preprocessor.
14926 The assembler uses this option.
14927 @c This is supposed to go with a -Yd for predefined M4 macro files, but
14928 @c the generic assembler that comes with Solaris takes just -Ym.
14929 @end table
14930
14931 @node V850 Options
14932 @subsection V850 Options
14933 @cindex V850 Options
14934
14935 These @samp{-m} options are defined for V850 implementations:
14936
14937 @table @gcctabopt
14938 @item -mlong-calls
14939 @itemx -mno-long-calls
14940 @opindex mlong-calls
14941 @opindex mno-long-calls
14942 Treat all calls as being far away (near).  If calls are assumed to be
14943 far away, the compiler will always load the functions address up into a
14944 register, and call indirect through the pointer.
14945
14946 @item -mno-ep
14947 @itemx -mep
14948 @opindex mno-ep
14949 @opindex mep
14950 Do not optimize (do optimize) basic blocks that use the same index
14951 pointer 4 or more times to copy pointer into the @code{ep} register, and
14952 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
14953 option is on by default if you optimize.
14954
14955 @item -mno-prolog-function
14956 @itemx -mprolog-function
14957 @opindex mno-prolog-function
14958 @opindex mprolog-function
14959 Do not use (do use) external functions to save and restore registers
14960 at the prologue and epilogue of a function.  The external functions
14961 are slower, but use less code space if more than one function saves
14962 the same number of registers.  The @option{-mprolog-function} option
14963 is on by default if you optimize.
14964
14965 @item -mspace
14966 @opindex mspace
14967 Try to make the code as small as possible.  At present, this just turns
14968 on the @option{-mep} and @option{-mprolog-function} options.
14969
14970 @item -mtda=@var{n}
14971 @opindex mtda
14972 Put static or global variables whose size is @var{n} bytes or less into
14973 the tiny data area that register @code{ep} points to.  The tiny data
14974 area can hold up to 256 bytes in total (128 bytes for byte references).
14975
14976 @item -msda=@var{n}
14977 @opindex msda
14978 Put static or global variables whose size is @var{n} bytes or less into
14979 the small data area that register @code{gp} points to.  The small data
14980 area can hold up to 64 kilobytes.
14981
14982 @item -mzda=@var{n}
14983 @opindex mzda
14984 Put static or global variables whose size is @var{n} bytes or less into
14985 the first 32 kilobytes of memory.
14986
14987 @item -mv850
14988 @opindex mv850
14989 Specify that the target processor is the V850.
14990
14991 @item -mbig-switch
14992 @opindex mbig-switch
14993 Generate code suitable for big switch tables.  Use this option only if
14994 the assembler/linker complain about out of range branches within a switch
14995 table.
14996
14997 @item -mapp-regs
14998 @opindex mapp-regs
14999 This option will cause r2 and r5 to be used in the code generated by
15000 the compiler.  This setting is the default.
15001
15002 @item -mno-app-regs
15003 @opindex mno-app-regs
15004 This option will cause r2 and r5 to be treated as fixed registers.
15005
15006 @item -mv850e1
15007 @opindex mv850e1
15008 Specify that the target processor is the V850E1.  The preprocessor
15009 constants @samp{__v850e1__} and @samp{__v850e__} will be defined if
15010 this option is used.
15011
15012 @item -mv850e
15013 @opindex mv850e
15014 Specify that the target processor is the V850E@.  The preprocessor
15015 constant @samp{__v850e__} will be defined if this option is used.
15016
15017 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
15018 are defined then a default target processor will be chosen and the
15019 relevant @samp{__v850*__} preprocessor constant will be defined.
15020
15021 The preprocessor constants @samp{__v850} and @samp{__v851__} are always
15022 defined, regardless of which processor variant is the target.
15023
15024 @item -mdisable-callt
15025 @opindex mdisable-callt
15026 This option will suppress generation of the CALLT instruction for the
15027 v850e and v850e1 flavors of the v850 architecture.  The default is
15028 @option{-mno-disable-callt} which allows the CALLT instruction to be used.
15029
15030 @end table
15031
15032 @node VAX Options
15033 @subsection VAX Options
15034 @cindex VAX options
15035
15036 These @samp{-m} options are defined for the VAX:
15037
15038 @table @gcctabopt
15039 @item -munix
15040 @opindex munix
15041 Do not output certain jump instructions (@code{aobleq} and so on)
15042 that the Unix assembler for the VAX cannot handle across long
15043 ranges.
15044
15045 @item -mgnu
15046 @opindex mgnu
15047 Do output those jump instructions, on the assumption that you
15048 will assemble with the GNU assembler.
15049
15050 @item -mg
15051 @opindex mg
15052 Output code for g-format floating point numbers instead of d-format.
15053 @end table
15054
15055 @node VxWorks Options
15056 @subsection VxWorks Options
15057 @cindex VxWorks Options
15058
15059 The options in this section are defined for all VxWorks targets.
15060 Options specific to the target hardware are listed with the other
15061 options for that target.
15062
15063 @table @gcctabopt
15064 @item -mrtp
15065 @opindex mrtp
15066 GCC can generate code for both VxWorks kernels and real time processes
15067 (RTPs).  This option switches from the former to the latter.  It also
15068 defines the preprocessor macro @code{__RTP__}.
15069
15070 @item -non-static
15071 @opindex non-static
15072 Link an RTP executable against shared libraries rather than static
15073 libraries.  The options @option{-static} and @option{-shared} can
15074 also be used for RTPs (@pxref{Link Options}); @option{-static}
15075 is the default.
15076
15077 @item -Bstatic
15078 @itemx -Bdynamic
15079 @opindex Bstatic
15080 @opindex Bdynamic
15081 These options are passed down to the linker.  They are defined for
15082 compatibility with Diab.
15083
15084 @item -Xbind-lazy
15085 @opindex Xbind-lazy
15086 Enable lazy binding of function calls.  This option is equivalent to
15087 @option{-Wl,-z,now} and is defined for compatibility with Diab.
15088
15089 @item -Xbind-now
15090 @opindex Xbind-now
15091 Disable lazy binding of function calls.  This option is the default and
15092 is defined for compatibility with Diab.
15093 @end table
15094
15095 @node x86-64 Options
15096 @subsection x86-64 Options
15097 @cindex x86-64 options
15098
15099 These are listed under @xref{i386 and x86-64 Options}.
15100
15101 @node Xstormy16 Options
15102 @subsection Xstormy16 Options
15103 @cindex Xstormy16 Options
15104
15105 These options are defined for Xstormy16:
15106
15107 @table @gcctabopt
15108 @item -msim
15109 @opindex msim
15110 Choose startup files and linker script suitable for the simulator.
15111 @end table
15112
15113 @node Xtensa Options
15114 @subsection Xtensa Options
15115 @cindex Xtensa Options
15116
15117 These options are supported for Xtensa targets:
15118
15119 @table @gcctabopt
15120 @item -mconst16
15121 @itemx -mno-const16
15122 @opindex mconst16
15123 @opindex mno-const16
15124 Enable or disable use of @code{CONST16} instructions for loading
15125 constant values.  The @code{CONST16} instruction is currently not a
15126 standard option from Tensilica.  When enabled, @code{CONST16}
15127 instructions are always used in place of the standard @code{L32R}
15128 instructions.  The use of @code{CONST16} is enabled by default only if
15129 the @code{L32R} instruction is not available.
15130
15131 @item -mfused-madd
15132 @itemx -mno-fused-madd
15133 @opindex mfused-madd
15134 @opindex mno-fused-madd
15135 Enable or disable use of fused multiply/add and multiply/subtract
15136 instructions in the floating-point option.  This has no effect if the
15137 floating-point option is not also enabled.  Disabling fused multiply/add
15138 and multiply/subtract instructions forces the compiler to use separate
15139 instructions for the multiply and add/subtract operations.  This may be
15140 desirable in some cases where strict IEEE 754-compliant results are
15141 required: the fused multiply add/subtract instructions do not round the
15142 intermediate result, thereby producing results with @emph{more} bits of
15143 precision than specified by the IEEE standard.  Disabling fused multiply
15144 add/subtract instructions also ensures that the program output is not
15145 sensitive to the compiler's ability to combine multiply and add/subtract
15146 operations.
15147
15148 @item -mserialize-volatile
15149 @itemx -mno-serialize-volatile
15150 @opindex mserialize-volatile
15151 @opindex mno-serialize-volatile
15152 When this option is enabled, GCC inserts @code{MEMW} instructions before
15153 @code{volatile} memory references to guarantee sequential consistency.
15154 The default is @option{-mserialize-volatile}.  Use
15155 @option{-mno-serialize-volatile} to omit the @code{MEMW} instructions.
15156
15157 @item -mtext-section-literals
15158 @itemx -mno-text-section-literals
15159 @opindex mtext-section-literals
15160 @opindex mno-text-section-literals
15161 Control the treatment of literal pools.  The default is
15162 @option{-mno-text-section-literals}, which places literals in a separate
15163 section in the output file.  This allows the literal pool to be placed
15164 in a data RAM/ROM, and it also allows the linker to combine literal
15165 pools from separate object files to remove redundant literals and
15166 improve code size.  With @option{-mtext-section-literals}, the literals
15167 are interspersed in the text section in order to keep them as close as
15168 possible to their references.  This may be necessary for large assembly
15169 files.
15170
15171 @item -mtarget-align
15172 @itemx -mno-target-align
15173 @opindex mtarget-align
15174 @opindex mno-target-align
15175 When this option is enabled, GCC instructs the assembler to
15176 automatically align instructions to reduce branch penalties at the
15177 expense of some code density.  The assembler attempts to widen density
15178 instructions to align branch targets and the instructions following call
15179 instructions.  If there are not enough preceding safe density
15180 instructions to align a target, no widening will be performed.  The
15181 default is @option{-mtarget-align}.  These options do not affect the
15182 treatment of auto-aligned instructions like @code{LOOP}, which the
15183 assembler will always align, either by widening density instructions or
15184 by inserting no-op instructions.
15185
15186 @item -mlongcalls
15187 @itemx -mno-longcalls
15188 @opindex mlongcalls
15189 @opindex mno-longcalls
15190 When this option is enabled, GCC instructs the assembler to translate
15191 direct calls to indirect calls unless it can determine that the target
15192 of a direct call is in the range allowed by the call instruction.  This
15193 translation typically occurs for calls to functions in other source
15194 files.  Specifically, the assembler translates a direct @code{CALL}
15195 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
15196 The default is @option{-mno-longcalls}.  This option should be used in
15197 programs where the call target can potentially be out of range.  This
15198 option is implemented in the assembler, not the compiler, so the
15199 assembly code generated by GCC will still show direct call
15200 instructions---look at the disassembled object code to see the actual
15201 instructions.  Note that the assembler will use an indirect call for
15202 every cross-file call, not just those that really will be out of range.
15203 @end table
15204
15205 @node zSeries Options
15206 @subsection zSeries Options
15207 @cindex zSeries options
15208
15209 These are listed under @xref{S/390 and zSeries Options}.
15210
15211 @node Code Gen Options
15212 @section Options for Code Generation Conventions
15213 @cindex code generation conventions
15214 @cindex options, code generation
15215 @cindex run-time options
15216
15217 These machine-independent options control the interface conventions
15218 used in code generation.
15219
15220 Most of them have both positive and negative forms; the negative form
15221 of @option{-ffoo} would be @option{-fno-foo}.  In the table below, only
15222 one of the forms is listed---the one which is not the default.  You
15223 can figure out the other form by either removing @samp{no-} or adding
15224 it.
15225
15226 @table @gcctabopt
15227 @item -fbounds-check
15228 @opindex fbounds-check
15229 For front-ends that support it, generate additional code to check that
15230 indices used to access arrays are within the declared range.  This is
15231 currently only supported by the Java and Fortran front-ends, where
15232 this option defaults to true and false respectively.
15233
15234 @item -ftrapv
15235 @opindex ftrapv
15236 This option generates traps for signed overflow on addition, subtraction,
15237 multiplication operations.
15238
15239 @item -fwrapv
15240 @opindex fwrapv
15241 This option instructs the compiler to assume that signed arithmetic
15242 overflow of addition, subtraction and multiplication wraps around
15243 using twos-complement representation.  This flag enables some optimizations
15244 and disables others.  This option is enabled by default for the Java
15245 front-end, as required by the Java language specification.
15246
15247 @item -fexceptions
15248 @opindex fexceptions
15249 Enable exception handling.  Generates extra code needed to propagate
15250 exceptions.  For some targets, this implies GCC will generate frame
15251 unwind information for all functions, which can produce significant data
15252 size overhead, although it does not affect execution.  If you do not
15253 specify this option, GCC will enable it by default for languages like
15254 C++ which normally require exception handling, and disable it for
15255 languages like C that do not normally require it.  However, you may need
15256 to enable this option when compiling C code that needs to interoperate
15257 properly with exception handlers written in C++.  You may also wish to
15258 disable this option if you are compiling older C++ programs that don't
15259 use exception handling.
15260
15261 @item -fnon-call-exceptions
15262 @opindex fnon-call-exceptions
15263 Generate code that allows trapping instructions to throw exceptions.
15264 Note that this requires platform-specific runtime support that does
15265 not exist everywhere.  Moreover, it only allows @emph{trapping}
15266 instructions to throw exceptions, i.e.@: memory references or floating
15267 point instructions.  It does not allow exceptions to be thrown from
15268 arbitrary signal handlers such as @code{SIGALRM}.
15269
15270 @item -funwind-tables
15271 @opindex funwind-tables
15272 Similar to @option{-fexceptions}, except that it will just generate any needed
15273 static data, but will not affect the generated code in any other way.
15274 You will normally not enable this option; instead, a language processor
15275 that needs this handling would enable it on your behalf.
15276
15277 @item -fasynchronous-unwind-tables
15278 @opindex fasynchronous-unwind-tables
15279 Generate unwind table in dwarf2 format, if supported by target machine.  The
15280 table is exact at each instruction boundary, so it can be used for stack
15281 unwinding from asynchronous events (such as debugger or garbage collector).
15282
15283 @item -fpcc-struct-return
15284 @opindex fpcc-struct-return
15285 Return ``short'' @code{struct} and @code{union} values in memory like
15286 longer ones, rather than in registers.  This convention is less
15287 efficient, but it has the advantage of allowing intercallability between
15288 GCC-compiled files and files compiled with other compilers, particularly
15289 the Portable C Compiler (pcc).
15290
15291 The precise convention for returning structures in memory depends
15292 on the target configuration macros.
15293
15294 Short structures and unions are those whose size and alignment match
15295 that of some integer type.
15296
15297 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
15298 switch is not binary compatible with code compiled with the
15299 @option{-freg-struct-return} switch.
15300 Use it to conform to a non-default application binary interface.
15301
15302 @item -freg-struct-return
15303 @opindex freg-struct-return
15304 Return @code{struct} and @code{union} values in registers when possible.
15305 This is more efficient for small structures than
15306 @option{-fpcc-struct-return}.
15307
15308 If you specify neither @option{-fpcc-struct-return} nor
15309 @option{-freg-struct-return}, GCC defaults to whichever convention is
15310 standard for the target.  If there is no standard convention, GCC
15311 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
15312 the principal compiler.  In those cases, we can choose the standard, and
15313 we chose the more efficient register return alternative.
15314
15315 @strong{Warning:} code compiled with the @option{-freg-struct-return}
15316 switch is not binary compatible with code compiled with the
15317 @option{-fpcc-struct-return} switch.
15318 Use it to conform to a non-default application binary interface.
15319
15320 @item -fshort-enums
15321 @opindex fshort-enums
15322 Allocate to an @code{enum} type only as many bytes as it needs for the
15323 declared range of possible values.  Specifically, the @code{enum} type
15324 will be equivalent to the smallest integer type which has enough room.
15325
15326 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
15327 code that is not binary compatible with code generated without that switch.
15328 Use it to conform to a non-default application binary interface.
15329
15330 @item -fshort-double
15331 @opindex fshort-double
15332 Use the same size for @code{double} as for @code{float}.
15333
15334 @strong{Warning:} the @option{-fshort-double} switch causes GCC to generate
15335 code that is not binary compatible with code generated without that switch.
15336 Use it to conform to a non-default application binary interface.
15337
15338 @item -fshort-wchar
15339 @opindex fshort-wchar
15340 Override the underlying type for @samp{wchar_t} to be @samp{short
15341 unsigned int} instead of the default for the target.  This option is
15342 useful for building programs to run under WINE@.
15343
15344 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
15345 code that is not binary compatible with code generated without that switch.
15346 Use it to conform to a non-default application binary interface.
15347
15348 @item -fno-common
15349 @opindex fno-common
15350 In C, allocate even uninitialized global variables in the data section of the
15351 object file, rather than generating them as common blocks.  This has the
15352 effect that if the same variable is declared (without @code{extern}) in
15353 two different compilations, you will get an error when you link them.
15354 The only reason this might be useful is if you wish to verify that the
15355 program will work on other systems which always work this way.
15356
15357 @item -fno-ident
15358 @opindex fno-ident
15359 Ignore the @samp{#ident} directive.
15360
15361 @item -finhibit-size-directive
15362 @opindex finhibit-size-directive
15363 Don't output a @code{.size} assembler directive, or anything else that
15364 would cause trouble if the function is split in the middle, and the
15365 two halves are placed at locations far apart in memory.  This option is
15366 used when compiling @file{crtstuff.c}; you should not need to use it
15367 for anything else.
15368
15369 @item -fverbose-asm
15370 @opindex fverbose-asm
15371 Put extra commentary information in the generated assembly code to
15372 make it more readable.  This option is generally only of use to those
15373 who actually need to read the generated assembly code (perhaps while
15374 debugging the compiler itself).
15375
15376 @option{-fno-verbose-asm}, the default, causes the
15377 extra information to be omitted and is useful when comparing two assembler
15378 files.
15379
15380 @item -frecord-gcc-switches
15381 @opindex frecord-gcc-switches
15382 This switch causes the command line that was used to invoke the
15383 compiler to be recorded into the object file that is being created.
15384 This switch is only implemented on some targets and the exact format
15385 of the recording is target and binary file format dependent, but it
15386 usually takes the form of a section containing ASCII text.  This
15387 switch is related to the @option{-fverbose-asm} switch, but that
15388 switch only records information in the assembler output file as
15389 comments, so it never reaches the object file.
15390
15391 @item -fpic
15392 @opindex fpic
15393 @cindex global offset table
15394 @cindex PIC
15395 Generate position-independent code (PIC) suitable for use in a shared
15396 library, if supported for the target machine.  Such code accesses all
15397 constant addresses through a global offset table (GOT)@.  The dynamic
15398 loader resolves the GOT entries when the program starts (the dynamic
15399 loader is not part of GCC; it is part of the operating system).  If
15400 the GOT size for the linked executable exceeds a machine-specific
15401 maximum size, you get an error message from the linker indicating that
15402 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
15403 instead.  (These maximums are 8k on the SPARC and 32k
15404 on the m68k and RS/6000.  The 386 has no such limit.)
15405
15406 Position-independent code requires special support, and therefore works
15407 only on certain machines.  For the 386, GCC supports PIC for System V
15408 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
15409 position-independent.
15410
15411 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
15412 are defined to 1.
15413
15414 @item -fPIC
15415 @opindex fPIC
15416 If supported for the target machine, emit position-independent code,
15417 suitable for dynamic linking and avoiding any limit on the size of the
15418 global offset table.  This option makes a difference on the m68k,
15419 PowerPC and SPARC@.
15420
15421 Position-independent code requires special support, and therefore works
15422 only on certain machines.
15423
15424 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
15425 are defined to 2.
15426
15427 @item -fpie
15428 @itemx -fPIE
15429 @opindex fpie
15430 @opindex fPIE
15431 These options are similar to @option{-fpic} and @option{-fPIC}, but
15432 generated position independent code can be only linked into executables.
15433 Usually these options are used when @option{-pie} GCC option will be
15434 used during linking.
15435
15436 @option{-fpie} and @option{-fPIE} both define the macros
15437 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
15438 for @option{-fpie} and 2 for @option{-fPIE}.
15439
15440 @item -fno-jump-tables
15441 @opindex fno-jump-tables
15442 Do not use jump tables for switch statements even where it would be
15443 more efficient than other code generation strategies.  This option is
15444 of use in conjunction with @option{-fpic} or @option{-fPIC} for
15445 building code which forms part of a dynamic linker and cannot
15446 reference the address of a jump table.  On some targets, jump tables
15447 do not require a GOT and this option is not needed.
15448
15449 @item -ffixed-@var{reg}
15450 @opindex ffixed
15451 Treat the register named @var{reg} as a fixed register; generated code
15452 should never refer to it (except perhaps as a stack pointer, frame
15453 pointer or in some other fixed role).
15454
15455 @var{reg} must be the name of a register.  The register names accepted
15456 are machine-specific and are defined in the @code{REGISTER_NAMES}
15457 macro in the machine description macro file.
15458
15459 This flag does not have a negative form, because it specifies a
15460 three-way choice.
15461
15462 @item -fcall-used-@var{reg}
15463 @opindex fcall-used
15464 Treat the register named @var{reg} as an allocable register that is
15465 clobbered by function calls.  It may be allocated for temporaries or
15466 variables that do not live across a call.  Functions compiled this way
15467 will not save and restore the register @var{reg}.
15468
15469 It is an error to used this flag with the frame pointer or stack pointer.
15470 Use of this flag for other registers that have fixed pervasive roles in
15471 the machine's execution model will produce disastrous results.
15472
15473 This flag does not have a negative form, because it specifies a
15474 three-way choice.
15475
15476 @item -fcall-saved-@var{reg}
15477 @opindex fcall-saved
15478 Treat the register named @var{reg} as an allocable register saved by
15479 functions.  It may be allocated even for temporaries or variables that
15480 live across a call.  Functions compiled this way will save and restore
15481 the register @var{reg} if they use it.
15482
15483 It is an error to used this flag with the frame pointer or stack pointer.
15484 Use of this flag for other registers that have fixed pervasive roles in
15485 the machine's execution model will produce disastrous results.
15486
15487 A different sort of disaster will result from the use of this flag for
15488 a register in which function values may be returned.
15489
15490 This flag does not have a negative form, because it specifies a
15491 three-way choice.
15492
15493 @item -fpack-struct[=@var{n}]
15494 @opindex fpack-struct
15495 Without a value specified, pack all structure members together without
15496 holes.  When a value is specified (which must be a small power of two), pack
15497 structure members according to this value, representing the maximum
15498 alignment (that is, objects with default alignment requirements larger than
15499 this will be output potentially unaligned at the next fitting location.
15500
15501 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
15502 code that is not binary compatible with code generated without that switch.
15503 Additionally, it makes the code suboptimal.
15504 Use it to conform to a non-default application binary interface.
15505
15506 @item -finstrument-functions
15507 @opindex finstrument-functions
15508 Generate instrumentation calls for entry and exit to functions.  Just
15509 after function entry and just before function exit, the following
15510 profiling functions will be called with the address of the current
15511 function and its call site.  (On some platforms,
15512 @code{__builtin_return_address} does not work beyond the current
15513 function, so the call site information may not be available to the
15514 profiling functions otherwise.)
15515
15516 @smallexample
15517 void __cyg_profile_func_enter (void *this_fn,
15518                                void *call_site);
15519 void __cyg_profile_func_exit  (void *this_fn,
15520                                void *call_site);
15521 @end smallexample
15522
15523 The first argument is the address of the start of the current function,
15524 which may be looked up exactly in the symbol table.
15525
15526 This instrumentation is also done for functions expanded inline in other
15527 functions.  The profiling calls will indicate where, conceptually, the
15528 inline function is entered and exited.  This means that addressable
15529 versions of such functions must be available.  If all your uses of a
15530 function are expanded inline, this may mean an additional expansion of
15531 code size.  If you use @samp{extern inline} in your C code, an
15532 addressable version of such functions must be provided.  (This is
15533 normally the case anyways, but if you get lucky and the optimizer always
15534 expands the functions inline, you might have gotten away without
15535 providing static copies.)
15536
15537 A function may be given the attribute @code{no_instrument_function}, in
15538 which case this instrumentation will not be done.  This can be used, for
15539 example, for the profiling functions listed above, high-priority
15540 interrupt routines, and any functions from which the profiling functions
15541 cannot safely be called (perhaps signal handlers, if the profiling
15542 routines generate output or allocate memory).
15543
15544 @item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
15545 @opindex finstrument-functions-exclude-file-list
15546
15547 Set the list of functions that are excluded from instrumentation (see
15548 the description of @code{-finstrument-functions}).  If the file that
15549 contains a function definition matches with one of @var{file}, then
15550 that function is not instrumented.  The match is done on substrings:
15551 if the @var{file} parameter is a substring of the file name, it is
15552 considered to be a match.
15553
15554 For example,
15555 @code{-finstrument-functions-exclude-file-list=/bits/stl,include/sys}
15556 will exclude any inline function defined in files whose pathnames
15557 contain @code{/bits/stl} or @code{include/sys}.
15558
15559 If, for some reason, you want to include letter @code{','} in one of
15560 @var{sym}, write @code{'\,'}. For example,
15561 @code{-finstrument-functions-exclude-file-list='\,\,tmp'}
15562 (note the single quote surrounding the option).
15563
15564 @item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{}
15565 @opindex finstrument-functions-exclude-function-list
15566
15567 This is similar to @code{-finstrument-functions-exclude-file-list},
15568 but this option sets the list of function names to be excluded from
15569 instrumentation.  The function name to be matched is its user-visible
15570 name, such as @code{vector<int> blah(const vector<int> &)}, not the
15571 internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}).  The
15572 match is done on substrings: if the @var{sym} parameter is a substring
15573 of the function name, it is considered to be a match.
15574
15575 @item -fstack-check
15576 @opindex fstack-check
15577 Generate code to verify that you do not go beyond the boundary of the
15578 stack.  You should specify this flag if you are running in an
15579 environment with multiple threads, but only rarely need to specify it in
15580 a single-threaded environment since stack overflow is automatically
15581 detected on nearly all systems if there is only one stack.
15582
15583 Note that this switch does not actually cause checking to be done; the
15584 operating system or the language runtime must do that.  The switch causes
15585 generation of code to ensure that they see the stack being extended.
15586
15587 You can additionally specify a string parameter: @code{no} means no
15588 checking, @code{generic} means force the use of old-style checking,
15589 @code{specific} means use the best checking method and is equivalent
15590 to bare @option{-fstack-check}.
15591
15592 Old-style checking is a generic mechanism that requires no specific
15593 target support in the compiler but comes with the following drawbacks:
15594
15595 @enumerate
15596 @item
15597 Modified allocation strategy for large objects: they will always be
15598 allocated dynamically if their size exceeds a fixed threshold.
15599
15600 @item
15601 Fixed limit on the size of the static frame of functions: when it is
15602 topped by a particular function, stack checking is not reliable and
15603 a warning is issued by the compiler.
15604
15605 @item
15606 Inefficiency: because of both the modified allocation strategy and the
15607 generic implementation, the performances of the code are hampered.
15608 @end enumerate
15609
15610 Note that old-style stack checking is also the fallback method for
15611 @code{specific} if no target support has been added in the compiler.
15612
15613 @item -fstack-limit-register=@var{reg}
15614 @itemx -fstack-limit-symbol=@var{sym}
15615 @itemx -fno-stack-limit
15616 @opindex fstack-limit-register
15617 @opindex fstack-limit-symbol
15618 @opindex fno-stack-limit
15619 Generate code to ensure that the stack does not grow beyond a certain value,
15620 either the value of a register or the address of a symbol.  If the stack
15621 would grow beyond the value, a signal is raised.  For most targets,
15622 the signal is raised before the stack overruns the boundary, so
15623 it is possible to catch the signal without taking special precautions.
15624
15625 For instance, if the stack starts at absolute address @samp{0x80000000}
15626 and grows downwards, you can use the flags
15627 @option{-fstack-limit-symbol=__stack_limit} and
15628 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
15629 of 128KB@.  Note that this may only work with the GNU linker.
15630
15631 @cindex aliasing of parameters
15632 @cindex parameters, aliased
15633 @item -fargument-alias
15634 @itemx -fargument-noalias
15635 @itemx -fargument-noalias-global
15636 @itemx -fargument-noalias-anything
15637 @opindex fargument-alias
15638 @opindex fargument-noalias
15639 @opindex fargument-noalias-global
15640 @opindex fargument-noalias-anything
15641 Specify the possible relationships among parameters and between
15642 parameters and global data.
15643
15644 @option{-fargument-alias} specifies that arguments (parameters) may
15645 alias each other and may alias global storage.@*
15646 @option{-fargument-noalias} specifies that arguments do not alias
15647 each other, but may alias global storage.@*
15648 @option{-fargument-noalias-global} specifies that arguments do not
15649 alias each other and do not alias global storage.
15650 @option{-fargument-noalias-anything} specifies that arguments do not
15651 alias any other storage.
15652
15653 Each language will automatically use whatever option is required by
15654 the language standard.  You should not need to use these options yourself.
15655
15656 @item -fleading-underscore
15657 @opindex fleading-underscore
15658 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
15659 change the way C symbols are represented in the object file.  One use
15660 is to help link with legacy assembly code.
15661
15662 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
15663 generate code that is not binary compatible with code generated without that
15664 switch.  Use it to conform to a non-default application binary interface.
15665 Not all targets provide complete support for this switch.
15666
15667 @item -ftls-model=@var{model}
15668 @opindex ftls-model
15669 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
15670 The @var{model} argument should be one of @code{global-dynamic},
15671 @code{local-dynamic}, @code{initial-exec} or @code{local-exec}.
15672
15673 The default without @option{-fpic} is @code{initial-exec}; with
15674 @option{-fpic} the default is @code{global-dynamic}.
15675
15676 @item -fvisibility=@var{default|internal|hidden|protected}
15677 @opindex fvisibility
15678 Set the default ELF image symbol visibility to the specified option---all
15679 symbols will be marked with this unless overridden within the code.
15680 Using this feature can very substantially improve linking and
15681 load times of shared object libraries, produce more optimized
15682 code, provide near-perfect API export and prevent symbol clashes.
15683 It is @strong{strongly} recommended that you use this in any shared objects
15684 you distribute.
15685
15686 Despite the nomenclature, @code{default} always means public ie;
15687 available to be linked against from outside the shared object.
15688 @code{protected} and @code{internal} are pretty useless in real-world
15689 usage so the only other commonly used option will be @code{hidden}.
15690 The default if @option{-fvisibility} isn't specified is
15691 @code{default}, i.e., make every
15692 symbol public---this causes the same behavior as previous versions of
15693 GCC@.
15694
15695 A good explanation of the benefits offered by ensuring ELF
15696 symbols have the correct visibility is given by ``How To Write
15697 Shared Libraries'' by Ulrich Drepper (which can be found at
15698 @w{@uref{http://people.redhat.com/~drepper/}})---however a superior
15699 solution made possible by this option to marking things hidden when
15700 the default is public is to make the default hidden and mark things
15701 public.  This is the norm with DLL's on Windows and with @option{-fvisibility=hidden}
15702 and @code{__attribute__ ((visibility("default")))} instead of
15703 @code{__declspec(dllexport)} you get almost identical semantics with
15704 identical syntax.  This is a great boon to those working with
15705 cross-platform projects.
15706
15707 For those adding visibility support to existing code, you may find
15708 @samp{#pragma GCC visibility} of use.  This works by you enclosing
15709 the declarations you wish to set visibility for with (for example)
15710 @samp{#pragma GCC visibility push(hidden)} and
15711 @samp{#pragma GCC visibility pop}.
15712 Bear in mind that symbol visibility should be viewed @strong{as
15713 part of the API interface contract} and thus all new code should
15714 always specify visibility when it is not the default ie; declarations
15715 only for use within the local DSO should @strong{always} be marked explicitly
15716 as hidden as so to avoid PLT indirection overheads---making this
15717 abundantly clear also aids readability and self-documentation of the code.
15718 Note that due to ISO C++ specification requirements, operator new and
15719 operator delete must always be of default visibility.
15720
15721 Be aware that headers from outside your project, in particular system
15722 headers and headers from any other library you use, may not be
15723 expecting to be compiled with visibility other than the default.  You
15724 may need to explicitly say @samp{#pragma GCC visibility push(default)}
15725 before including any such headers.
15726
15727 @samp{extern} declarations are not affected by @samp{-fvisibility}, so
15728 a lot of code can be recompiled with @samp{-fvisibility=hidden} with
15729 no modifications.  However, this means that calls to @samp{extern}
15730 functions with no explicit visibility will use the PLT, so it is more
15731 effective to use @samp{__attribute ((visibility))} and/or
15732 @samp{#pragma GCC visibility} to tell the compiler which @samp{extern}
15733 declarations should be treated as hidden.
15734
15735 Note that @samp{-fvisibility} does affect C++ vague linkage
15736 entities. This means that, for instance, an exception class that will
15737 be thrown between DSOs must be explicitly marked with default
15738 visibility so that the @samp{type_info} nodes will be unified between
15739 the DSOs.
15740
15741 An overview of these techniques, their benefits and how to use them
15742 is at @w{@uref{http://gcc.gnu.org/wiki/Visibility}}.
15743
15744 @end table
15745
15746 @c man end
15747
15748 @node Environment Variables
15749 @section Environment Variables Affecting GCC
15750 @cindex environment variables
15751
15752 @c man begin ENVIRONMENT
15753 This section describes several environment variables that affect how GCC
15754 operates.  Some of them work by specifying directories or prefixes to use
15755 when searching for various kinds of files.  Some are used to specify other
15756 aspects of the compilation environment.
15757
15758 Note that you can also specify places to search using options such as
15759 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
15760 take precedence over places specified using environment variables, which
15761 in turn take precedence over those specified by the configuration of GCC@.
15762 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
15763 GNU Compiler Collection (GCC) Internals}.
15764
15765 @table @env
15766 @item LANG
15767 @itemx LC_CTYPE
15768 @c @itemx LC_COLLATE
15769 @itemx LC_MESSAGES
15770 @c @itemx LC_MONETARY
15771 @c @itemx LC_NUMERIC
15772 @c @itemx LC_TIME
15773 @itemx LC_ALL
15774 @findex LANG
15775 @findex LC_CTYPE
15776 @c @findex LC_COLLATE
15777 @findex LC_MESSAGES
15778 @c @findex LC_MONETARY
15779 @c @findex LC_NUMERIC
15780 @c @findex LC_TIME
15781 @findex LC_ALL
15782 @cindex locale
15783 These environment variables control the way that GCC uses
15784 localization information that allow GCC to work with different
15785 national conventions.  GCC inspects the locale categories
15786 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
15787 so.  These locale categories can be set to any value supported by your
15788 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
15789 Kingdom encoded in UTF-8.
15790
15791 The @env{LC_CTYPE} environment variable specifies character
15792 classification.  GCC uses it to determine the character boundaries in
15793 a string; this is needed for some multibyte encodings that contain quote
15794 and escape characters that would otherwise be interpreted as a string
15795 end or escape.
15796
15797 The @env{LC_MESSAGES} environment variable specifies the language to
15798 use in diagnostic messages.
15799
15800 If the @env{LC_ALL} environment variable is set, it overrides the value
15801 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
15802 and @env{LC_MESSAGES} default to the value of the @env{LANG}
15803 environment variable.  If none of these variables are set, GCC
15804 defaults to traditional C English behavior.
15805
15806 @item TMPDIR
15807 @findex TMPDIR
15808 If @env{TMPDIR} is set, it specifies the directory to use for temporary
15809 files.  GCC uses temporary files to hold the output of one stage of
15810 compilation which is to be used as input to the next stage: for example,
15811 the output of the preprocessor, which is the input to the compiler
15812 proper.
15813
15814 @item GCC_EXEC_PREFIX
15815 @findex GCC_EXEC_PREFIX
15816 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
15817 names of the subprograms executed by the compiler.  No slash is added
15818 when this prefix is combined with the name of a subprogram, but you can
15819 specify a prefix that ends with a slash if you wish.
15820
15821 If @env{GCC_EXEC_PREFIX} is not set, GCC will attempt to figure out
15822 an appropriate prefix to use based on the pathname it was invoked with.
15823
15824 If GCC cannot find the subprogram using the specified prefix, it
15825 tries looking in the usual places for the subprogram.
15826
15827 The default value of @env{GCC_EXEC_PREFIX} is
15828 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
15829 the installed compiler. In many cases @var{prefix} is the value
15830 of @code{prefix} when you ran the @file{configure} script.
15831
15832 Other prefixes specified with @option{-B} take precedence over this prefix.
15833
15834 This prefix is also used for finding files such as @file{crt0.o} that are
15835 used for linking.
15836
15837 In addition, the prefix is used in an unusual way in finding the
15838 directories to search for header files.  For each of the standard
15839 directories whose name normally begins with @samp{/usr/local/lib/gcc}
15840 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
15841 replacing that beginning with the specified prefix to produce an
15842 alternate directory name.  Thus, with @option{-Bfoo/}, GCC will search
15843 @file{foo/bar} where it would normally search @file{/usr/local/lib/bar}.
15844 These alternate directories are searched first; the standard directories
15845 come next. If a standard directory begins with the configured
15846 @var{prefix} then the value of @var{prefix} is replaced by
15847 @env{GCC_EXEC_PREFIX} when looking for header files.
15848
15849 @item COMPILER_PATH
15850 @findex COMPILER_PATH
15851 The value of @env{COMPILER_PATH} is a colon-separated list of
15852 directories, much like @env{PATH}.  GCC tries the directories thus
15853 specified when searching for subprograms, if it can't find the
15854 subprograms using @env{GCC_EXEC_PREFIX}.
15855
15856 @item LIBRARY_PATH
15857 @findex LIBRARY_PATH
15858 The value of @env{LIBRARY_PATH} is a colon-separated list of
15859 directories, much like @env{PATH}.  When configured as a native compiler,
15860 GCC tries the directories thus specified when searching for special
15861 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
15862 using GCC also uses these directories when searching for ordinary
15863 libraries for the @option{-l} option (but directories specified with
15864 @option{-L} come first).
15865
15866 @item LANG
15867 @findex LANG
15868 @cindex locale definition
15869 This variable is used to pass locale information to the compiler.  One way in
15870 which this information is used is to determine the character set to be used
15871 when character literals, string literals and comments are parsed in C and C++.
15872 When the compiler is configured to allow multibyte characters,
15873 the following values for @env{LANG} are recognized:
15874
15875 @table @samp
15876 @item C-JIS
15877 Recognize JIS characters.
15878 @item C-SJIS
15879 Recognize SJIS characters.
15880 @item C-EUCJP
15881 Recognize EUCJP characters.
15882 @end table
15883
15884 If @env{LANG} is not defined, or if it has some other value, then the
15885 compiler will use mblen and mbtowc as defined by the default locale to
15886 recognize and translate multibyte characters.
15887 @end table
15888
15889 @noindent
15890 Some additional environments variables affect the behavior of the
15891 preprocessor.
15892
15893 @include cppenv.texi
15894
15895 @c man end
15896
15897 @node Precompiled Headers
15898 @section Using Precompiled Headers
15899 @cindex precompiled headers
15900 @cindex speed of compilation
15901
15902 Often large projects have many header files that are included in every
15903 source file.  The time the compiler takes to process these header files
15904 over and over again can account for nearly all of the time required to
15905 build the project.  To make builds faster, GCC allows users to
15906 `precompile' a header file; then, if builds can use the precompiled
15907 header file they will be much faster.
15908
15909 To create a precompiled header file, simply compile it as you would any
15910 other file, if necessary using the @option{-x} option to make the driver
15911 treat it as a C or C++ header file.  You will probably want to use a
15912 tool like @command{make} to keep the precompiled header up-to-date when
15913 the headers it contains change.
15914
15915 A precompiled header file will be searched for when @code{#include} is
15916 seen in the compilation.  As it searches for the included file
15917 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
15918 compiler looks for a precompiled header in each directory just before it
15919 looks for the include file in that directory.  The name searched for is
15920 the name specified in the @code{#include} with @samp{.gch} appended.  If
15921 the precompiled header file can't be used, it is ignored.
15922
15923 For instance, if you have @code{#include "all.h"}, and you have
15924 @file{all.h.gch} in the same directory as @file{all.h}, then the
15925 precompiled header file will be used if possible, and the original
15926 header will be used otherwise.
15927
15928 Alternatively, you might decide to put the precompiled header file in a
15929 directory and use @option{-I} to ensure that directory is searched
15930 before (or instead of) the directory containing the original header.
15931 Then, if you want to check that the precompiled header file is always
15932 used, you can put a file of the same name as the original header in this
15933 directory containing an @code{#error} command.
15934
15935 This also works with @option{-include}.  So yet another way to use
15936 precompiled headers, good for projects not designed with precompiled
15937 header files in mind, is to simply take most of the header files used by
15938 a project, include them from another header file, precompile that header
15939 file, and @option{-include} the precompiled header.  If the header files
15940 have guards against multiple inclusion, they will be skipped because
15941 they've already been included (in the precompiled header).
15942
15943 If you need to precompile the same header file for different
15944 languages, targets, or compiler options, you can instead make a
15945 @emph{directory} named like @file{all.h.gch}, and put each precompiled
15946 header in the directory, perhaps using @option{-o}.  It doesn't matter
15947 what you call the files in the directory, every precompiled header in
15948 the directory will be considered.  The first precompiled header
15949 encountered in the directory that is valid for this compilation will
15950 be used; they're searched in no particular order.
15951
15952 There are many other possibilities, limited only by your imagination,
15953 good sense, and the constraints of your build system.
15954
15955 A precompiled header file can be used only when these conditions apply:
15956
15957 @itemize
15958 @item
15959 Only one precompiled header can be used in a particular compilation.
15960
15961 @item
15962 A precompiled header can't be used once the first C token is seen.  You
15963 can have preprocessor directives before a precompiled header; you can
15964 even include a precompiled header from inside another header, so long as
15965 there are no C tokens before the @code{#include}.
15966
15967 @item
15968 The precompiled header file must be produced for the same language as
15969 the current compilation.  You can't use a C precompiled header for a C++
15970 compilation.
15971
15972 @item
15973 The precompiled header file must have been produced by the same compiler
15974 binary as the current compilation is using.
15975
15976 @item
15977 Any macros defined before the precompiled header is included must
15978 either be defined in the same way as when the precompiled header was
15979 generated, or must not affect the precompiled header, which usually
15980 means that they don't appear in the precompiled header at all.
15981
15982 The @option{-D} option is one way to define a macro before a
15983 precompiled header is included; using a @code{#define} can also do it.
15984 There are also some options that define macros implicitly, like
15985 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
15986 defined this way.
15987
15988 @item If debugging information is output when using the precompiled
15989 header, using @option{-g} or similar, the same kind of debugging information
15990 must have been output when building the precompiled header.  However,
15991 a precompiled header built using @option{-g} can be used in a compilation
15992 when no debugging information is being output.
15993
15994 @item The same @option{-m} options must generally be used when building
15995 and using the precompiled header.  @xref{Submodel Options},
15996 for any cases where this rule is relaxed.
15997
15998 @item Each of the following options must be the same when building and using
15999 the precompiled header:
16000
16001 @gccoptlist{-fexceptions}
16002
16003 @item
16004 Some other command-line options starting with @option{-f},
16005 @option{-p}, or @option{-O} must be defined in the same way as when
16006 the precompiled header was generated.  At present, it's not clear
16007 which options are safe to change and which are not; the safest choice
16008 is to use exactly the same options when generating and using the
16009 precompiled header.  The following are known to be safe:
16010
16011 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
16012 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
16013 -fsched-verbose=<number>  -fschedule-insns  -fvisibility= @gol
16014 -pedantic-errors}
16015
16016 @end itemize
16017
16018 For all of these except the last, the compiler will automatically
16019 ignore the precompiled header if the conditions aren't met.  If you
16020 find an option combination that doesn't work and doesn't cause the
16021 precompiled header to be ignored, please consider filing a bug report,
16022 see @ref{Bugs}.
16023
16024 If you do use differing options when generating and using the
16025 precompiled header, the actual behavior will be a mixture of the
16026 behavior for the options.  For instance, if you use @option{-g} to
16027 generate the precompiled header but not when using it, you may or may
16028 not get debugging information for routines in the precompiled header.
16029
16030 @node Running Protoize
16031 @section Running Protoize
16032
16033 The program @code{protoize} is an optional part of GCC@.  You can use
16034 it to add prototypes to a program, thus converting the program to ISO
16035 C in one respect.  The companion program @code{unprotoize} does the
16036 reverse: it removes argument types from any prototypes that are found.
16037
16038 When you run these programs, you must specify a set of source files as
16039 command line arguments.  The conversion programs start out by compiling
16040 these files to see what functions they define.  The information gathered
16041 about a file @var{foo} is saved in a file named @file{@var{foo}.X}.
16042
16043 After scanning comes actual conversion.  The specified files are all
16044 eligible to be converted; any files they include (whether sources or
16045 just headers) are eligible as well.
16046
16047 But not all the eligible files are converted.  By default,
16048 @code{protoize} and @code{unprotoize} convert only source and header
16049 files in the current directory.  You can specify additional directories
16050 whose files should be converted with the @option{-d @var{directory}}
16051 option.  You can also specify particular files to exclude with the
16052 @option{-x @var{file}} option.  A file is converted if it is eligible, its
16053 directory name matches one of the specified directory names, and its
16054 name within the directory has not been excluded.
16055
16056 Basic conversion with @code{protoize} consists of rewriting most
16057 function definitions and function declarations to specify the types of
16058 the arguments.  The only ones not rewritten are those for varargs
16059 functions.
16060
16061 @code{protoize} optionally inserts prototype declarations at the
16062 beginning of the source file, to make them available for any calls that
16063 precede the function's definition.  Or it can insert prototype
16064 declarations with block scope in the blocks where undeclared functions
16065 are called.
16066
16067 Basic conversion with @code{unprotoize} consists of rewriting most
16068 function declarations to remove any argument types, and rewriting
16069 function definitions to the old-style pre-ISO form.
16070
16071 Both conversion programs print a warning for any function declaration or
16072 definition that they can't convert.  You can suppress these warnings
16073 with @option{-q}.
16074
16075 The output from @code{protoize} or @code{unprotoize} replaces the
16076 original source file.  The original file is renamed to a name ending
16077 with @samp{.save} (for DOS, the saved filename ends in @samp{.sav}
16078 without the original @samp{.c} suffix).  If the @samp{.save} (@samp{.sav}
16079 for DOS) file already exists, then the source file is simply discarded.
16080
16081 @code{protoize} and @code{unprotoize} both depend on GCC itself to
16082 scan the program and collect information about the functions it uses.
16083 So neither of these programs will work until GCC is installed.
16084
16085 Here is a table of the options you can use with @code{protoize} and
16086 @code{unprotoize}.  Each option works with both programs unless
16087 otherwise stated.
16088
16089 @table @code
16090 @item -B @var{directory}
16091 Look for the file @file{SYSCALLS.c.X} in @var{directory}, instead of the
16092 usual directory (normally @file{/usr/local/lib}).  This file contains
16093 prototype information about standard system functions.  This option
16094 applies only to @code{protoize}.
16095
16096 @item -c @var{compilation-options}
16097 Use @var{compilation-options} as the options when running @command{gcc} to
16098 produce the @samp{.X} files.  The special option @option{-aux-info} is
16099 always passed in addition, to tell @command{gcc} to write a @samp{.X} file.
16100
16101 Note that the compilation options must be given as a single argument to
16102 @code{protoize} or @code{unprotoize}.  If you want to specify several
16103 @command{gcc} options, you must quote the entire set of compilation options
16104 to make them a single word in the shell.
16105
16106 There are certain @command{gcc} arguments that you cannot use, because they
16107 would produce the wrong kind of output.  These include @option{-g},
16108 @option{-O}, @option{-c}, @option{-S}, and @option{-o} If you include these in
16109 the @var{compilation-options}, they are ignored.
16110
16111 @item -C
16112 Rename files to end in @samp{.C} (@samp{.cc} for DOS-based file
16113 systems) instead of @samp{.c}.  This is convenient if you are converting
16114 a C program to C++.  This option applies only to @code{protoize}.
16115
16116 @item -g
16117 Add explicit global declarations.  This means inserting explicit
16118 declarations at the beginning of each source file for each function
16119 that is called in the file and was not declared.  These declarations
16120 precede the first function definition that contains a call to an
16121 undeclared function.  This option applies only to @code{protoize}.
16122
16123 @item -i @var{string}
16124 Indent old-style parameter declarations with the string @var{string}.
16125 This option applies only to @code{protoize}.
16126
16127 @code{unprotoize} converts prototyped function definitions to old-style
16128 function definitions, where the arguments are declared between the
16129 argument list and the initial @samp{@{}.  By default, @code{unprotoize}
16130 uses five spaces as the indentation.  If you want to indent with just
16131 one space instead, use @option{-i " "}.
16132
16133 @item -k
16134 Keep the @samp{.X} files.  Normally, they are deleted after conversion
16135 is finished.
16136
16137 @item -l
16138 Add explicit local declarations.  @code{protoize} with @option{-l} inserts
16139 a prototype declaration for each function in each block which calls the
16140 function without any declaration.  This option applies only to
16141 @code{protoize}.
16142
16143 @item -n
16144 Make no real changes.  This mode just prints information about the conversions
16145 that would have been done without @option{-n}.
16146
16147 @item -N
16148 Make no @samp{.save} files.  The original files are simply deleted.
16149 Use this option with caution.
16150
16151 @item -p @var{program}
16152 Use the program @var{program} as the compiler.  Normally, the name
16153 @file{gcc} is used.
16154
16155 @item -q
16156 Work quietly.  Most warnings are suppressed.
16157
16158 @item -v
16159 Print the version number, just like @option{-v} for @command{gcc}.
16160 @end table
16161
16162 If you need special compiler options to compile one of your program's
16163 source files, then you should generate that file's @samp{.X} file
16164 specially, by running @command{gcc} on that source file with the
16165 appropriate options and the option @option{-aux-info}.  Then run
16166 @code{protoize} on the entire set of files.  @code{protoize} will use
16167 the existing @samp{.X} file because it is newer than the source file.
16168 For example:
16169
16170 @smallexample
16171 gcc -Dfoo=bar file1.c -aux-info file1.X
16172 protoize *.c
16173 @end smallexample
16174
16175 @noindent
16176 You need to include the special files along with the rest in the
16177 @code{protoize} command, even though their @samp{.X} files already
16178 exist, because otherwise they won't get converted.
16179
16180 @xref{Protoize Caveats}, for more information on how to use
16181 @code{protoize} successfully.