OSDN Git Service

c4467e90c65abf82a76c95fe35fed25c2acd239e
[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 -fno-dwarf2-cfi-asm @gol
311 -fdebug-prefix-map=@var{old}=@var{new} @gol
312 -femit-struct-debug-baseonly -femit-struct-debug-reduced @gol
313 -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol
314 -p  -pg  -print-file-name=@var{library}  -print-libgcc-file-name @gol
315 -print-multi-directory  -print-multi-lib @gol
316 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
317 -print-sysroot -print-sysroot-headers-suffix @gol
318 -save-temps  -time}
319
320 @item Optimization Options
321 @xref{Optimize Options,,Options that Control Optimization}.
322 @gccoptlist{
323 -falign-functions[=@var{n}] -falign-jumps[=@var{n}] @gol
324 -falign-labels[=@var{n}] -falign-loops[=@var{n}] -fassociative-math @gol
325 -fauto-inc-dec -fbranch-probabilities -fbranch-target-load-optimize @gol
326 -fbranch-target-load-optimize2 -fbtr-bb-exclusive -fcaller-saves @gol
327 -fcheck-data-deps -fconserve-stack -fcprop-registers -fcrossjumping @gol
328 -fcse-follow-jumps -fcse-skip-blocks -fcx-fortran-rules -fcx-limited-range @gol
329 -fdata-sections -fdce -fdce @gol
330 -fdelayed-branch -fdelete-null-pointer-checks -fdse -fdse @gol
331 -fearly-inlining -fexpensive-optimizations -ffast-math @gol
332 -ffinite-math-only -ffloat-store -fforward-propagate @gol
333 -ffunction-sections -fgcse -fgcse-after-reload -fgcse-las -fgcse-lm @gol
334 -fgcse-sm -fif-conversion -fif-conversion2 -findirect-inlining @gol
335 -finline-functions -finline-functions-called-once -finline-limit=@var{n} @gol
336 -finline-small-functions -fipa-cp -fipa-cp-clone -fipa-marix-reorg -fipa-pta @gol 
337 -fipa-pure-const -fipa-reference -fipa-struct-reorg @gol
338 -fipa-type-escape -fira -fira-algorithm=@var{algorithm} @gol
339 -fira-coalesce -fno-ira-share-save-slots @gol
340 -fno-ira-share-spill-slots -fira-verbose=@var{n} @gol
341 -fivopts -fkeep-inline-functions -fkeep-static-consts @gol
342 -floop-block -floop-interchange -floop-strip-mine @gol
343 -fmerge-all-constants -fmerge-constants -fmodulo-sched @gol
344 -fmodulo-sched-allow-regmoves -fmove-loop-invariants -fmudflap @gol
345 -fmudflapir -fmudflapth -fno-branch-count-reg -fno-default-inline @gol
346 -fno-defer-pop -fno-function-cse -fno-guess-branch-probability @gol
347 -fno-inline -fno-math-errno -fno-peephole -fno-peephole2 @gol
348 -fno-sched-interblock -fno-sched-spec -fno-signed-zeros @gol
349 -fno-toplevel-reorder -fno-trapping-math -fno-zero-initialized-in-bss @gol
350 -fomit-frame-pointer -foptimize-register-move -foptimize-sibling-calls @gol
351 -fpeel-loops -fpredictive-commoning -fprefetch-loop-arrays @gol
352 -fprofile-correction -fprofile-dir=@var{path} -fprofile-generate @gol
353 -fprofile-generate=@var{path} @gol
354 -fprofile-use -fprofile-use=@var{path} -fprofile-values @gol
355 -freciprocal-math -fregmove -frename-registers -freorder-blocks @gol
356 -freorder-blocks-and-partition -freorder-functions @gol
357 -frerun-cse-after-loop -freschedule-modulo-scheduled-loops @gol
358 -frounding-math -frtl-abstract-sequences -fsched2-use-superblocks @gol
359 -fsched2-use-traces -fsched-spec-load -fsched-spec-load-dangerous @gol
360 -fsched-stalled-insns-dep[=@var{n}] -fsched-stalled-insns[=@var{n}] @gol
361 -fschedule-insns -fschedule-insns2 -fsection-anchors -fsee @gol
362 -fselective-scheduling -fselective-scheduling2 @gol
363 -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops @gol
364 -fsignaling-nans -fsingle-precision-constant -fsplit-ivs-in-unroller @gol
365 -fsplit-wide-types -fstack-protector -fstack-protector-all @gol
366 -fstrict-aliasing -fstrict-overflow -fthread-jumps -ftracer @gol
367 -ftree-builtin-call-dce -ftree-ccp -ftree-ch -ftree-copy-prop @gol
368 -ftree-copyrename -ftree-dce @gol
369 -ftree-dominator-opts -ftree-dse -ftree-fre -ftree-loop-im @gol
370 -ftree-loop-distribution @gol
371 -ftree-loop-ivcanon -ftree-loop-linear -ftree-loop-optimize @gol
372 -ftree-parallelize-loops=@var{n} -ftree-pre -ftree-reassoc @gol
373 -ftree-sink -ftree-sra -ftree-switch-conversion @gol
374 -ftree-ter -ftree-vect-loop-version -ftree-vectorize -ftree-vrp @gol
375 -funit-at-a-time -funroll-all-loops -funroll-loops @gol
376 -funsafe-loop-optimizations -funsafe-math-optimizations -funswitch-loops @gol
377 -fvariable-expansion-in-unroller -fvect-cost-model -fvpt -fweb @gol
378 -fwhole-program @gol
379 --param @var{name}=@var{value}
380 -O  -O0  -O1  -O2  -O3  -Os}
381
382 @item Preprocessor Options
383 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
384 @gccoptlist{-A@var{question}=@var{answer} @gol
385 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
386 -C  -dD  -dI  -dM  -dN @gol
387 -D@var{macro}@r{[}=@var{defn}@r{]}  -E  -H @gol
388 -idirafter @var{dir} @gol
389 -include @var{file}  -imacros @var{file} @gol
390 -iprefix @var{file}  -iwithprefix @var{dir} @gol
391 -iwithprefixbefore @var{dir}  -isystem @var{dir} @gol
392 -imultilib @var{dir} -isysroot @var{dir} @gol
393 -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  @gol
394 -P  -fworking-directory  -remap @gol
395 -trigraphs  -undef  -U@var{macro}  -Wp,@var{option} @gol
396 -Xpreprocessor @var{option}}
397
398 @item Assembler Option
399 @xref{Assembler Options,,Passing Options to the Assembler}.
400 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
401
402 @item Linker Options
403 @xref{Link Options,,Options for Linking}.
404 @gccoptlist{@var{object-file-name}  -l@var{library} @gol
405 -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic @gol
406 -s  -static  -static-libgcc  -shared  -shared-libgcc  -symbolic @gol
407 -Wl,@var{option}  -Xlinker @var{option} @gol
408 -u @var{symbol}}
409
410 @item Directory Options
411 @xref{Directory Options,,Options for Directory Search}.
412 @gccoptlist{-B@var{prefix}  -I@var{dir}  -iquote@var{dir}  -L@var{dir}
413 -specs=@var{file}  -I- --sysroot=@var{dir}}
414
415 @item Target Options
416 @c I wrote this xref this way to avoid overfull hbox. -- rms
417 @xref{Target Options}.
418 @gccoptlist{-V @var{version}  -b @var{machine}}
419
420 @item Machine Dependent Options
421 @xref{Submodel Options,,Hardware Models and Configurations}.
422 @c This list is ordered alphanumerically by subsection name.
423 @c Try and put the significant identifier (CPU or system) first,
424 @c so users have a clue at guessing where the ones they want will be.
425
426 @emph{ARC Options}
427 @gccoptlist{-EB  -EL @gol
428 -mmangle-cpu  -mcpu=@var{cpu}  -mtext=@var{text-section} @gol
429 -mdata=@var{data-section}  -mrodata=@var{readonly-data-section}}
430
431 @emph{ARM Options}
432 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
433 -mabi=@var{name} @gol
434 -mapcs-stack-check  -mno-apcs-stack-check @gol
435 -mapcs-float  -mno-apcs-float @gol
436 -mapcs-reentrant  -mno-apcs-reentrant @gol
437 -msched-prolog  -mno-sched-prolog @gol
438 -mlittle-endian  -mbig-endian  -mwords-little-endian @gol
439 -mfloat-abi=@var{name}  -msoft-float  -mhard-float  -mfpe @gol
440 -mthumb-interwork  -mno-thumb-interwork @gol
441 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
442 -mstructure-size-boundary=@var{n} @gol
443 -mabort-on-noreturn @gol
444 -mlong-calls  -mno-long-calls @gol
445 -msingle-pic-base  -mno-single-pic-base @gol
446 -mpic-register=@var{reg} @gol
447 -mnop-fun-dllimport @gol
448 -mcirrus-fix-invalid-insns -mno-cirrus-fix-invalid-insns @gol
449 -mpoke-function-name @gol
450 -mthumb  -marm @gol
451 -mtpcs-frame  -mtpcs-leaf-frame @gol
452 -mcaller-super-interworking  -mcallee-super-interworking @gol
453 -mtp=@var{name}
454 -mword-relocations}
455
456 @emph{AVR Options}
457 @gccoptlist{-mmcu=@var{mcu}  -msize  -minit-stack=@var{n}  -mno-interrupts @gol
458 -mcall-prologues  -mno-tablejump  -mtiny-stack  -mint8}
459
460 @emph{Blackfin Options}
461 @gccoptlist{-mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]} @gol
462 -msim -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
463 -mspecld-anomaly  -mno-specld-anomaly  -mcsync-anomaly  -mno-csync-anomaly @gol
464 -mlow-64k -mno-low64k  -mstack-check-l1  -mid-shared-library @gol
465 -mno-id-shared-library  -mshared-library-id=@var{n} @gol
466 -mleaf-id-shared-library  -mno-leaf-id-shared-library @gol
467 -msep-data  -mno-sep-data  -mlong-calls  -mno-long-calls @gol
468 -mfast-fp -minline-plt -mmulticore  -mcorea  -mcoreb  -msdram}
469
470 @emph{CRIS Options}
471 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
472 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
473 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
474 -mstack-align  -mdata-align  -mconst-align @gol
475 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
476 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
477 -mmul-bug-workaround  -mno-mul-bug-workaround}
478
479 @emph{CRX Options}
480 @gccoptlist{-mmac -mpush-args}
481
482 @emph{Darwin Options}
483 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
484 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
485 -client_name  -compatibility_version  -current_version @gol
486 -dead_strip @gol
487 -dependency-file  -dylib_file  -dylinker_install_name @gol
488 -dynamic  -dynamiclib  -exported_symbols_list @gol
489 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
490 -force_flat_namespace  -headerpad_max_install_names @gol
491 -iframework @gol
492 -image_base  -init  -install_name  -keep_private_externs @gol
493 -multi_module  -multiply_defined  -multiply_defined_unused @gol
494 -noall_load   -no_dead_strip_inits_and_terms @gol
495 -nofixprebinding -nomultidefs  -noprebind  -noseglinkedit @gol
496 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
497 -private_bundle  -read_only_relocs  -sectalign @gol
498 -sectobjectsymbols  -whyload  -seg1addr @gol
499 -sectcreate  -sectobjectsymbols  -sectorder @gol
500 -segaddr -segs_read_only_addr -segs_read_write_addr @gol
501 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
502 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
503 -single_module  -static  -sub_library  -sub_umbrella @gol
504 -twolevel_namespace  -umbrella  -undefined @gol
505 -unexported_symbols_list  -weak_reference_mismatches @gol
506 -whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} @gol
507 -mkernel -mone-byte-bool}
508
509 @emph{DEC Alpha Options}
510 @gccoptlist{-mno-fp-regs  -msoft-float  -malpha-as  -mgas @gol
511 -mieee  -mieee-with-inexact  -mieee-conformant @gol
512 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
513 -mtrap-precision=@var{mode}  -mbuild-constants @gol
514 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
515 -mbwx  -mmax  -mfix  -mcix @gol
516 -mfloat-vax  -mfloat-ieee @gol
517 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
518 -msmall-text  -mlarge-text @gol
519 -mmemory-latency=@var{time}}
520
521 @emph{DEC Alpha/VMS Options}
522 @gccoptlist{-mvms-return-codes}
523
524 @emph{FRV Options}
525 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
526 -mhard-float  -msoft-float @gol
527 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
528 -mdouble  -mno-double @gol
529 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
530 -mfdpic  -minline-plt -mgprel-ro  -multilib-library-pic @gol
531 -mlinked-fp  -mlong-calls  -malign-labels @gol
532 -mlibrary-pic  -macc-4  -macc-8 @gol
533 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
534 -moptimize-membar -mno-optimize-membar @gol
535 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
536 -mvliw-branch  -mno-vliw-branch @gol
537 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
538 -mno-nested-cond-exec  -mtomcat-stats @gol
539 -mTLS -mtls @gol
540 -mcpu=@var{cpu}}
541
542 @emph{GNU/Linux Options}
543 @gccoptlist{-muclibc}
544
545 @emph{H8/300 Options}
546 @gccoptlist{-mrelax  -mh  -ms  -mn  -mint32  -malign-300}
547
548 @emph{HPPA Options}
549 @gccoptlist{-march=@var{architecture-type} @gol
550 -mbig-switch  -mdisable-fpregs  -mdisable-indexing @gol
551 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
552 -mfixed-range=@var{register-range} @gol
553 -mjump-in-delay -mlinker-opt -mlong-calls @gol
554 -mlong-load-store  -mno-big-switch  -mno-disable-fpregs @gol
555 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
556 -mno-jump-in-delay  -mno-long-load-store @gol
557 -mno-portable-runtime  -mno-soft-float @gol
558 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
559 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
560 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
561 -munix=@var{unix-std}  -nolibdld  -static  -threads}
562
563 @emph{i386 and x86-64 Options}
564 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
565 -mfpmath=@var{unit} @gol
566 -masm=@var{dialect}  -mno-fancy-math-387 @gol
567 -mno-fp-ret-in-387  -msoft-float @gol
568 -mno-wide-multiply  -mrtd  -malign-double @gol
569 -mpreferred-stack-boundary=@var{num}
570 -mincoming-stack-boundary=@var{num}
571 -mcld -mcx16 -msahf -mrecip @gol
572 -mmmx  -msse  -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -msse4 -mavx @gol
573 -maes -mpclmul @gol
574 -msse4a -m3dnow -mpopcnt -mabm -msse5 @gol
575 -mthreads  -mno-align-stringops  -minline-all-stringops @gol
576 -minline-stringops-dynamically -mstringop-strategy=@var{alg} @gol
577 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
578 -m96bit-long-double  -mregparm=@var{num}  -msseregparm @gol
579 -mveclibabi=@var{type} -mpc32 -mpc64 -mpc80 -mstackrealign @gol
580 -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs @gol
581 -mcmodel=@var{code-model} @gol
582 -m32  -m64 -mlarge-data-threshold=@var{num} @gol
583 -mfused-madd -mno-fused-madd}
584
585 @emph{IA-64 Options}
586 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
587 -mvolatile-asm-stop  -mregister-names  -mno-sdata @gol
588 -mconstant-gp  -mauto-pic  -minline-float-divide-min-latency @gol
589 -minline-float-divide-max-throughput @gol
590 -minline-int-divide-min-latency @gol
591 -minline-int-divide-max-throughput  @gol
592 -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
593 -mno-dwarf2-asm -mearly-stop-bits @gol
594 -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
595 -mtune=@var{cpu-type} -mt -pthread -milp32 -mlp64 @gol
596 -mno-sched-br-data-spec -msched-ar-data-spec -mno-sched-control-spec @gol
597 -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec @gol
598 -msched-ldc -mno-sched-control-ldc -mno-sched-spec-verbose @gol
599 -mno-sched-prefer-non-data-spec-insns @gol
600 -mno-sched-prefer-non-control-spec-insns @gol
601 -mno-sched-count-spec-in-critical-path}
602
603 @emph{M32R/D Options}
604 @gccoptlist{-m32r2 -m32rx -m32r @gol
605 -mdebug @gol
606 -malign-loops -mno-align-loops @gol
607 -missue-rate=@var{number} @gol
608 -mbranch-cost=@var{number} @gol
609 -mmodel=@var{code-size-model-type} @gol
610 -msdata=@var{sdata-type} @gol
611 -mno-flush-func -mflush-func=@var{name} @gol
612 -mno-flush-trap -mflush-trap=@var{number} @gol
613 -G @var{num}}
614
615 @emph{M32C Options}
616 @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
617
618 @emph{M680x0 Options}
619 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu}  -mtune=@var{tune}
620 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
621 -m68060  -mcpu32  -m5200  -m5206e  -m528x  -m5307  -m5407 @gol
622 -mcfv4e  -mbitfield  -mno-bitfield  -mc68000  -mc68020 @gol
623 -mnobitfield  -mrtd  -mno-rtd  -mdiv  -mno-div  -mshort @gol
624 -mno-short  -mhard-float  -m68881  -msoft-float  -mpcrel @gol
625 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
626 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library @gol
627 -mxgot -mno-xgot}
628
629 @emph{M68hc1x Options}
630 @gccoptlist{-m6811  -m6812  -m68hc11  -m68hc12   -m68hcs12 @gol
631 -mauto-incdec  -minmax  -mlong-calls  -mshort @gol
632 -msoft-reg-count=@var{count}}
633
634 @emph{MCore Options}
635 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
636 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
637 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
638 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
639 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
640
641 @emph{MIPS Options}
642 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
643 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2 @gol
644 -mips64  -mips64r2 @gol
645 -mips16  -mno-mips16  -mflip-mips16 @gol
646 -minterlink-mips16  -mno-interlink-mips16 @gol
647 -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
648 -mshared  -mno-shared  -mplt  -mno-plt  -mxgot  -mno-xgot @gol
649 -mgp32  -mgp64  -mfp32  -mfp64  -mhard-float  -msoft-float @gol
650 -msingle-float  -mdouble-float  -mdsp  -mno-dsp  -mdspr2  -mno-dspr2 @gol
651 -msmartmips  -mno-smartmips @gol
652 -mpaired-single  -mno-paired-single  -mdmx  -mno-mdmx @gol
653 -mips3d  -mno-mips3d  -mmt  -mno-mt  -mllsc  -mno-llsc @gol
654 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
655 -G@var{num}  -mlocal-sdata  -mno-local-sdata @gol
656 -mextern-sdata  -mno-extern-sdata  -mgpopt  -mno-gopt @gol
657 -membedded-data  -mno-embedded-data @gol
658 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
659 -mcode-readable=@var{setting} @gol
660 -msplit-addresses  -mno-split-addresses @gol
661 -mexplicit-relocs  -mno-explicit-relocs @gol
662 -mcheck-zero-division  -mno-check-zero-division @gol
663 -mdivide-traps  -mdivide-breaks @gol
664 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
665 -mmad  -mno-mad  -mfused-madd  -mno-fused-madd  -nocpp @gol
666 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
667 -mfix-vr4120  -mno-fix-vr4120  -mfix-vr4130  -mno-fix-vr4130 @gol
668 -mfix-sb1  -mno-fix-sb1 @gol
669 -mflush-func=@var{func}  -mno-flush-func @gol
670 -mbranch-cost=@var{num}  -mbranch-likely  -mno-branch-likely @gol
671 -mfp-exceptions -mno-fp-exceptions @gol
672 -mvr4130-align -mno-vr4130-align}
673
674 @emph{MMIX Options}
675 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
676 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
677 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
678 -mno-base-addresses  -msingle-exit  -mno-single-exit}
679
680 @emph{MN10300 Options}
681 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
682 -mam33  -mno-am33 @gol
683 -mam33-2  -mno-am33-2 @gol
684 -mreturn-pointer-on-d0 @gol
685 -mno-crt0  -mrelax}
686
687 @emph{PDP-11 Options}
688 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
689 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
690 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
691 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
692 -mbranch-expensive  -mbranch-cheap @gol
693 -msplit  -mno-split  -munix-asm  -mdec-asm}
694
695 @emph{picoChip Options}
696 @gccoptlist{-mae=@var{ae_type} -mvliw-lookahead=@var{N}
697 -msymbol-as-address -mno-inefficient-warnings}
698
699 @emph{PowerPC Options}
700 See RS/6000 and PowerPC Options.
701
702 @emph{RS/6000 and PowerPC Options}
703 @gccoptlist{-mcpu=@var{cpu-type} @gol
704 -mtune=@var{cpu-type} @gol
705 -mpower  -mno-power  -mpower2  -mno-power2 @gol
706 -mpowerpc  -mpowerpc64  -mno-powerpc @gol
707 -maltivec  -mno-altivec @gol
708 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
709 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
710 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb  -mfprnd  -mno-fprnd @gol
711 -mcmpb -mno-cmpb -mmfpgpr -mno-mfpgpr -mhard-dfp -mno-hard-dfp @gol
712 -mnew-mnemonics  -mold-mnemonics @gol
713 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
714 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
715 -malign-power  -malign-natural @gol
716 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
717 -mstring  -mno-string  -mupdate  -mno-update @gol
718 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
719 -mstrict-align  -mno-strict-align  -mrelocatable @gol
720 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
721 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
722 -mdynamic-no-pic  -maltivec  -mswdiv @gol
723 -mprioritize-restricted-insns=@var{priority} @gol
724 -msched-costly-dep=@var{dependence_type} @gol
725 -minsert-sched-nops=@var{scheme} @gol
726 -mcall-sysv  -mcall-netbsd @gol
727 -maix-struct-return  -msvr4-struct-return @gol
728 -mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
729 -misel -mno-isel @gol
730 -misel=yes  -misel=no @gol
731 -mspe -mno-spe @gol
732 -mspe=yes  -mspe=no @gol
733 -mpaired @gol
734 -mvrsave -mno-vrsave @gol
735 -mmulhw -mno-mulhw @gol
736 -mdlmzb -mno-dlmzb @gol
737 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
738 -mprototype  -mno-prototype @gol
739 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
740 -msdata=@var{opt}  -mvxworks  -G @var{num}  -pthread}
741
742 @emph{S/390 and zSeries Options}
743 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
744 -mhard-float  -msoft-float -mlong-double-64 -mlong-double-128 @gol
745 -mbackchain  -mno-backchain -mpacked-stack  -mno-packed-stack @gol
746 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
747 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
748 -mtpf-trace -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
749 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size -mstack-guard}
750
751 @emph{Score Options}
752 @gccoptlist{-meb -mel @gol
753 -mnhwloop @gol
754 -muls @gol
755 -mmac @gol
756 -mscore5 -mscore5u -mscore7 -mscore7d}
757
758 @emph{SH Options}
759 @gccoptlist{-m1  -m2  -m2e  -m3  -m3e @gol
760 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
761 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol
762 -m5-64media  -m5-64media-nofpu @gol
763 -m5-32media  -m5-32media-nofpu @gol
764 -m5-compact  -m5-compact-nofpu @gol
765 -mb  -ml  -mdalign  -mrelax @gol
766 -mbigtable  -mfmovd  -mhitachi -mrenesas -mno-renesas -mnomacsave @gol
767 -mieee  -mbitops  -misize  -minline-ic_invalidate -mpadstruct  -mspace @gol
768 -mprefergot  -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
769 -mdivsi3_libfunc=@var{name} -mfixed-range=@var{register-range} @gol
770 -madjust-unroll -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol
771 -minvalid-symbols}
772
773 @emph{SPARC Options}
774 @gccoptlist{-mcpu=@var{cpu-type} @gol
775 -mtune=@var{cpu-type} @gol
776 -mcmodel=@var{code-model} @gol
777 -m32  -m64  -mapp-regs  -mno-app-regs @gol
778 -mfaster-structs  -mno-faster-structs @gol
779 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
780 -mhard-quad-float  -msoft-quad-float @gol
781 -mimpure-text  -mno-impure-text  -mlittle-endian @gol
782 -mstack-bias  -mno-stack-bias @gol
783 -munaligned-doubles  -mno-unaligned-doubles @gol
784 -mv8plus  -mno-v8plus  -mvis  -mno-vis
785 -threads -pthreads -pthread}
786
787 @emph{SPU Options}
788 @gccoptlist{-mwarn-reloc -merror-reloc @gol
789 -msafe-dma -munsafe-dma @gol
790 -mbranch-hints @gol
791 -msmall-mem -mlarge-mem -mstdmain @gol
792 -mfixed-range=@var{register-range}}
793
794 @emph{System V Options}
795 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
796
797 @emph{V850 Options}
798 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
799 -mprolog-function  -mno-prolog-function  -mspace @gol
800 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
801 -mapp-regs  -mno-app-regs @gol
802 -mdisable-callt  -mno-disable-callt @gol
803 -mv850e1 @gol
804 -mv850e @gol
805 -mv850  -mbig-switch}
806
807 @emph{VAX Options}
808 @gccoptlist{-mg  -mgnu  -munix}
809
810 @emph{VxWorks Options}
811 @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
812 -Xbind-lazy  -Xbind-now}
813
814 @emph{x86-64 Options}
815 See i386 and x86-64 Options.
816
817 @emph{Xstormy16 Options}
818 @gccoptlist{-msim}
819
820 @emph{Xtensa Options}
821 @gccoptlist{-mconst16 -mno-const16 @gol
822 -mfused-madd  -mno-fused-madd @gol
823 -mserialize-volatile  -mno-serialize-volatile @gol
824 -mtext-section-literals  -mno-text-section-literals @gol
825 -mtarget-align  -mno-target-align @gol
826 -mlongcalls  -mno-longcalls}
827
828 @emph{zSeries Options}
829 See S/390 and zSeries Options.
830
831 @item Code Generation Options
832 @xref{Code Gen Options,,Options for Code Generation Conventions}.
833 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
834 -ffixed-@var{reg}  -fexceptions @gol
835 -fnon-call-exceptions  -funwind-tables @gol
836 -fasynchronous-unwind-tables @gol
837 -finhibit-size-directive  -finstrument-functions @gol
838 -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol
839 -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{} @gol
840 -fno-common  -fno-ident @gol
841 -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE @gol
842 -fno-jump-tables @gol
843 -frecord-gcc-switches @gol
844 -freg-struct-return  -fshort-enums @gol
845 -fshort-double  -fshort-wchar @gol
846 -fverbose-asm  -fpack-struct[=@var{n}]  -fstack-check @gol
847 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
848 -fno-stack-limit  -fargument-alias  -fargument-noalias @gol
849 -fargument-noalias-global  -fargument-noalias-anything @gol
850 -fleading-underscore  -ftls-model=@var{model} @gol
851 -ftrapv  -fwrapv  -fbounds-check @gol
852 -fvisibility}
853 @end table
854
855 @menu
856 * Overall Options::     Controlling the kind of output:
857                         an executable, object files, assembler files,
858                         or preprocessed source.
859 * C Dialect Options::   Controlling the variant of C language compiled.
860 * C++ Dialect Options:: Variations on C++.
861 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
862                         and Objective-C++.
863 * Language Independent Options:: Controlling how diagnostics should be
864                         formatted.
865 * Warning Options::     How picky should the compiler be?
866 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
867 * Optimize Options::    How much optimization?
868 * Preprocessor Options:: Controlling header files and macro definitions.
869                          Also, getting dependency information for Make.
870 * Assembler Options::   Passing options to the assembler.
871 * Link Options::        Specifying libraries and so on.
872 * Directory Options::   Where to find header files and libraries.
873                         Where to find the compiler executable files.
874 * Spec Files::          How to pass switches to sub-processes.
875 * Target Options::      Running a cross-compiler, or an old version of GCC.
876 @end menu
877
878 @node Overall Options
879 @section Options Controlling the Kind of Output
880
881 Compilation can involve up to four stages: preprocessing, compilation
882 proper, assembly and linking, always in that order.  GCC is capable of
883 preprocessing and compiling several files either into several
884 assembler input files, or into one assembler input file; then each
885 assembler input file produces an object file, and linking combines all
886 the object files (those newly compiled, and those specified as input)
887 into an executable file.
888
889 @cindex file name suffix
890 For any given input file, the file name suffix determines what kind of
891 compilation is done:
892
893 @table @gcctabopt
894 @item @var{file}.c
895 C source code which must be preprocessed.
896
897 @item @var{file}.i
898 C source code which should not be preprocessed.
899
900 @item @var{file}.ii
901 C++ source code which should not be preprocessed.
902
903 @item @var{file}.m
904 Objective-C source code.  Note that you must link with the @file{libobjc}
905 library to make an Objective-C program work.
906
907 @item @var{file}.mi
908 Objective-C source code which should not be preprocessed.
909
910 @item @var{file}.mm
911 @itemx @var{file}.M
912 Objective-C++ source code.  Note that you must link with the @file{libobjc}
913 library to make an Objective-C++ program work.  Note that @samp{.M} refers
914 to a literal capital M@.
915
916 @item @var{file}.mii
917 Objective-C++ source code which should not be preprocessed.
918
919 @item @var{file}.h
920 C, C++, Objective-C or Objective-C++ header file to be turned into a
921 precompiled header.
922
923 @item @var{file}.cc
924 @itemx @var{file}.cp
925 @itemx @var{file}.cxx
926 @itemx @var{file}.cpp
927 @itemx @var{file}.CPP
928 @itemx @var{file}.c++
929 @itemx @var{file}.C
930 C++ source code which must be preprocessed.  Note that in @samp{.cxx},
931 the last two letters must both be literally @samp{x}.  Likewise,
932 @samp{.C} refers to a literal capital C@.
933
934 @item @var{file}.mm
935 @itemx @var{file}.M
936 Objective-C++ source code which must be preprocessed.
937
938 @item @var{file}.mii
939 Objective-C++ source code which should not be preprocessed.
940
941 @item @var{file}.hh
942 @itemx @var{file}.H
943 @itemx @var{file}.hp
944 @itemx @var{file}.hxx
945 @itemx @var{file}.hpp
946 @itemx @var{file}.HPP
947 @itemx @var{file}.h++
948 @itemx @var{file}.tcc
949 C++ header file to be turned into a precompiled header.
950
951 @item @var{file}.f
952 @itemx @var{file}.for
953 @itemx @var{file}.ftn
954 Fixed form Fortran source code which should not be preprocessed.
955
956 @item @var{file}.F
957 @itemx @var{file}.FOR
958 @itemx @var{file}.fpp
959 @itemx @var{file}.FPP
960 @itemx @var{file}.FTN
961 Fixed form Fortran source code which must be preprocessed (with the traditional
962 preprocessor).
963
964 @item @var{file}.f90
965 @itemx @var{file}.f95
966 @itemx @var{file}.f03
967 @itemx @var{file}.f08
968 Free form Fortran source code which should not be preprocessed.
969
970 @item @var{file}.F90
971 @itemx @var{file}.F95
972 @itemx @var{file}.F03
973 @itemx @var{file}.F08
974 Free form Fortran source code which must be preprocessed (with the
975 traditional preprocessor).
976
977 @c FIXME: Descriptions of Java file types.
978 @c @var{file}.java
979 @c @var{file}.class
980 @c @var{file}.zip
981 @c @var{file}.jar
982
983 @item @var{file}.ads
984 Ada source code file which contains a library unit declaration (a
985 declaration of a package, subprogram, or generic, or a generic
986 instantiation), or a library unit renaming declaration (a package,
987 generic, or subprogram renaming declaration).  Such files are also
988 called @dfn{specs}.
989
990 @item @var{file}.adb
991 Ada source code file containing a library unit body (a subprogram or
992 package body).  Such files are also called @dfn{bodies}.
993
994 @c GCC also knows about some suffixes for languages not yet included:
995 @c Pascal:
996 @c @var{file}.p
997 @c @var{file}.pas
998 @c Ratfor:
999 @c @var{file}.r
1000
1001 @item @var{file}.s
1002 Assembler code.
1003
1004 @item @var{file}.S
1005 @itemx @var{file}.sx
1006 Assembler code which must be preprocessed.
1007
1008 @item @var{other}
1009 An object file to be fed straight into linking.
1010 Any file name with no recognized suffix is treated this way.
1011 @end table
1012
1013 @opindex x
1014 You can specify the input language explicitly with the @option{-x} option:
1015
1016 @table @gcctabopt
1017 @item -x @var{language}
1018 Specify explicitly the @var{language} for the following input files
1019 (rather than letting the compiler choose a default based on the file
1020 name suffix).  This option applies to all following input files until
1021 the next @option{-x} option.  Possible values for @var{language} are:
1022 @smallexample
1023 c  c-header  c-cpp-output
1024 c++  c++-header  c++-cpp-output
1025 objective-c  objective-c-header  objective-c-cpp-output
1026 objective-c++ objective-c++-header objective-c++-cpp-output
1027 assembler  assembler-with-cpp
1028 ada
1029 f77  f77-cpp-input f95  f95-cpp-input
1030 java
1031 @end smallexample
1032
1033 @item -x none
1034 Turn off any specification of a language, so that subsequent files are
1035 handled according to their file name suffixes (as they are if @option{-x}
1036 has not been used at all).
1037
1038 @item -pass-exit-codes
1039 @opindex pass-exit-codes
1040 Normally the @command{gcc} program will exit with the code of 1 if any
1041 phase of the compiler returns a non-success return code.  If you specify
1042 @option{-pass-exit-codes}, the @command{gcc} program will instead return with
1043 numerically highest error produced by any phase that returned an error
1044 indication.  The C, C++, and Fortran frontends return 4, if an internal
1045 compiler error is encountered.
1046 @end table
1047
1048 If you only want some of the stages of compilation, you can use
1049 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
1050 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
1051 @command{gcc} is to stop.  Note that some combinations (for example,
1052 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
1053
1054 @table @gcctabopt
1055 @item -c
1056 @opindex c
1057 Compile or assemble the source files, but do not link.  The linking
1058 stage simply is not done.  The ultimate output is in the form of an
1059 object file for each source file.
1060
1061 By default, the object file name for a source file is made by replacing
1062 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1063
1064 Unrecognized input files, not requiring compilation or assembly, are
1065 ignored.
1066
1067 @item -S
1068 @opindex S
1069 Stop after the stage of compilation proper; do not assemble.  The output
1070 is in the form of an assembler code file for each non-assembler input
1071 file specified.
1072
1073 By default, the assembler file name for a source file is made by
1074 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1075
1076 Input files that don't require compilation are ignored.
1077
1078 @item -E
1079 @opindex E
1080 Stop after the preprocessing stage; do not run the compiler proper.  The
1081 output is in the form of preprocessed source code, which is sent to the
1082 standard output.
1083
1084 Input files which don't require preprocessing are ignored.
1085
1086 @cindex output file option
1087 @item -o @var{file}
1088 @opindex o
1089 Place output in file @var{file}.  This applies regardless to whatever
1090 sort of output is being produced, whether it be an executable file,
1091 an object file, an assembler file or preprocessed C code.
1092
1093 If @option{-o} is not specified, the default is to put an executable
1094 file in @file{a.out}, the object file for
1095 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1096 assembler file in @file{@var{source}.s}, a precompiled header file in
1097 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1098 standard output.
1099
1100 @item -v
1101 @opindex v
1102 Print (on standard error output) the commands executed to run the stages
1103 of compilation.  Also print the version number of the compiler driver
1104 program and of the preprocessor and the compiler proper.
1105
1106 @item -###
1107 @opindex ###
1108 Like @option{-v} except the commands are not executed and all command
1109 arguments are quoted.  This is useful for shell scripts to capture the
1110 driver-generated command lines.
1111
1112 @item -pipe
1113 @opindex pipe
1114 Use pipes rather than temporary files for communication between the
1115 various stages of compilation.  This fails to work on some systems where
1116 the assembler is unable to read from a pipe; but the GNU assembler has
1117 no trouble.
1118
1119 @item -combine
1120 @opindex combine
1121 If you are compiling multiple source files, this option tells the driver
1122 to pass all the source files to the compiler at once (for those
1123 languages for which the compiler can handle this).  This will allow
1124 intermodule analysis (IMA) to be performed by the compiler.  Currently the only
1125 language for which this is supported is C@.  If you pass source files for
1126 multiple languages to the driver, using this option, the driver will invoke
1127 the compiler(s) that support IMA once each, passing each compiler all the
1128 source files appropriate for it.  For those languages that do not support
1129 IMA this option will be ignored, and the compiler will be invoked once for
1130 each source file in that language.  If you use this option in conjunction
1131 with @option{-save-temps}, the compiler will generate multiple
1132 pre-processed files
1133 (one for each source file), but only one (combined) @file{.o} or
1134 @file{.s} file.
1135
1136 @item --help
1137 @opindex help
1138 Print (on the standard output) a description of the command line options
1139 understood by @command{gcc}.  If the @option{-v} option is also specified
1140 then @option{--help} will also be passed on to the various processes
1141 invoked by @command{gcc}, so that they can display the command line options
1142 they accept.  If the @option{-Wextra} option has also been specified
1143 (prior to the @option{--help} option), then command line options which
1144 have no documentation associated with them will also be displayed.
1145
1146 @item --target-help
1147 @opindex target-help
1148 Print (on the standard output) a description of target-specific command
1149 line options for each tool.  For some targets extra target-specific
1150 information may also be printed.
1151
1152 @item --help=@var{class}@r{[},@var{qualifier}@r{]}
1153 Print (on the standard output) a description of the command line
1154 options understood by the compiler that fit into a specific class.
1155 The class can be one of @samp{optimizers}, @samp{warnings}, @samp{target},
1156 @samp{params}, or @var{language}:
1157
1158 @table @asis
1159 @item @samp{optimizers}
1160 This will display all of the optimization options supported by the
1161 compiler.
1162
1163 @item @samp{warnings}
1164 This will display all of the options controlling warning messages
1165 produced by the compiler.
1166
1167 @item @samp{target}
1168 This will display target-specific options.  Unlike the
1169 @option{--target-help} option however, target-specific options of the
1170 linker and assembler will not be displayed.  This is because those
1171 tools do not currently support the extended @option{--help=} syntax.
1172
1173 @item @samp{params}
1174 This will display the values recognized by the @option{--param}
1175 option.
1176
1177 @item @var{language}
1178 This will display the options supported for @var{language}, where 
1179 @var{language} is the name of one of the languages supported in this 
1180 version of GCC.
1181
1182 @item @samp{common}
1183 This will display the options that are common to all languages.
1184 @end table
1185
1186 It is possible to further refine the output of the @option{--help=}
1187 option by adding a comma separated list of qualifiers after the
1188 class.  These can be any from the following list:
1189
1190 @table @asis
1191 @item @samp{undocumented}
1192 Display only those options which are undocumented.
1193
1194 @item @samp{joined}
1195 Display options which take an argument that appears after an equal
1196 sign in the same continuous piece of text, such as:
1197 @samp{--help=target}.
1198
1199 @item @samp{separate}
1200 Display options which take an argument that appears as a separate word
1201 following the original option, such as: @samp{-o output-file}.
1202 @end table
1203
1204 Thus for example to display all the undocumented target-specific
1205 switches supported by the compiler the following can be used:
1206
1207 @smallexample
1208 --help=target,undocumented
1209 @end smallexample
1210
1211 The sense of a qualifier can be inverted by prefixing it with the
1212 @var{^} character, so for example to display all binary warning
1213 options (i.e., ones that are either on or off and that do not take an
1214 argument), which have a description the following can be used:
1215
1216 @smallexample
1217 --help=warnings,^joined,^undocumented
1218 @end smallexample
1219
1220 A class can also be used as a qualifier, although this usually
1221 restricts the output by so much that there is nothing to display.  One
1222 case where it does work however is when one of the classes is
1223 @var{target}.  So for example to display all the target-specific
1224 optimization options the following can be used:
1225
1226 @smallexample
1227 --help=target,optimizers
1228 @end smallexample
1229
1230 The @option{--help=} option can be repeated on the command line.  Each
1231 successive use will display its requested class of options, skipping
1232 those that have already been displayed.
1233
1234 If the @option{-Q} option appears on the command line before the
1235 @option{--help=} option, then the descriptive text displayed by
1236 @option{--help=} is changed.  Instead of describing the displayed
1237 options, an indication is given as to whether the option is enabled,
1238 disabled or set to a specific value (assuming that the compiler
1239 knows this at the point where the @option{--help=} option is used).
1240
1241 Here is a truncated example from the ARM port of @command{gcc}:
1242
1243 @smallexample
1244   % gcc -Q -mabi=2 --help=target -c
1245   The following options are target specific:
1246   -mabi=                                2
1247   -mabort-on-noreturn                   [disabled]
1248   -mapcs                                [disabled]
1249 @end smallexample
1250
1251 The output is sensitive to the effects of previous command line
1252 options, so for example it is possible to find out which optimizations
1253 are enabled at @option{-O2} by using:
1254
1255 @smallexample
1256 -O2 --help=optimizers
1257 @end smallexample
1258
1259 Alternatively you can discover which binary optimizations are enabled
1260 by @option{-O3} by using:
1261
1262 @smallexample
1263 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1264 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1265 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1266 @end smallexample
1267
1268 @item --version
1269 @opindex version
1270 Display the version number and copyrights of the invoked GCC@.
1271
1272 @item -wrapper
1273 @opindex wrapper
1274 Invoke all subcommands under a wrapper program. It takes a single
1275 comma separated list as an argument, which will be used to invoke
1276 the wrapper:
1277
1278 @smallexample
1279 gcc -c t.c -wrapper gdb,--args
1280 @end smallexample
1281
1282 This will invoke all subprograms of gcc under "gdb --args",
1283 thus cc1 invocation will be "gdb --args cc1 ...".
1284
1285 @include @value{srcdir}/../libiberty/at-file.texi
1286 @end table
1287
1288 @node Invoking G++
1289 @section Compiling C++ Programs
1290
1291 @cindex suffixes for C++ source
1292 @cindex C++ source file suffixes
1293 C++ source files conventionally use one of the suffixes @samp{.C},
1294 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1295 @samp{.cxx}; C++ header files often use @samp{.hh}, @samp{.hpp},
1296 @samp{.H}, or (for shared template code) @samp{.tcc}; and
1297 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1298 files with these names and compiles them as C++ programs even if you
1299 call the compiler the same way as for compiling C programs (usually
1300 with the name @command{gcc}).
1301
1302 @findex g++
1303 @findex c++
1304 However, the use of @command{gcc} does not add the C++ library.
1305 @command{g++} is a program that calls GCC and treats @samp{.c},
1306 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1307 files unless @option{-x} is used, and automatically specifies linking
1308 against the C++ library.  This program is also useful when
1309 precompiling a C header file with a @samp{.h} extension for use in C++
1310 compilations.  On many systems, @command{g++} is also installed with
1311 the name @command{c++}.
1312
1313 @cindex invoking @command{g++}
1314 When you compile C++ programs, you may specify many of the same
1315 command-line options that you use for compiling programs in any
1316 language; or command-line options meaningful for C and related
1317 languages; or options that are meaningful only for C++ programs.
1318 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1319 explanations of options for languages related to C@.
1320 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1321 explanations of options that are meaningful only for C++ programs.
1322
1323 @node C Dialect Options
1324 @section Options Controlling C Dialect
1325 @cindex dialect options
1326 @cindex language dialect options
1327 @cindex options, dialect
1328
1329 The following options control the dialect of C (or languages derived
1330 from C, such as C++, Objective-C and Objective-C++) that the compiler
1331 accepts:
1332
1333 @table @gcctabopt
1334 @cindex ANSI support
1335 @cindex ISO support
1336 @item -ansi
1337 @opindex ansi
1338 In C mode, this is equivalent to @samp{-std=c89}. In C++ mode, it is
1339 equivalent to @samp{-std=c++98}.
1340
1341 This turns off certain features of GCC that are incompatible with ISO
1342 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1343 such as the @code{asm} and @code{typeof} keywords, and
1344 predefined macros such as @code{unix} and @code{vax} that identify the
1345 type of system you are using.  It also enables the undesirable and
1346 rarely used ISO trigraph feature.  For the C compiler,
1347 it disables recognition of C++ style @samp{//} comments as well as
1348 the @code{inline} keyword.
1349
1350 The alternate keywords @code{__asm__}, @code{__extension__},
1351 @code{__inline__} and @code{__typeof__} continue to work despite
1352 @option{-ansi}.  You would not want to use them in an ISO C program, of
1353 course, but it is useful to put them in header files that might be included
1354 in compilations done with @option{-ansi}.  Alternate predefined macros
1355 such as @code{__unix__} and @code{__vax__} are also available, with or
1356 without @option{-ansi}.
1357
1358 The @option{-ansi} option does not cause non-ISO programs to be
1359 rejected gratuitously.  For that, @option{-pedantic} is required in
1360 addition to @option{-ansi}.  @xref{Warning Options}.
1361
1362 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1363 option is used.  Some header files may notice this macro and refrain
1364 from declaring certain functions or defining certain macros that the
1365 ISO standard doesn't call for; this is to avoid interfering with any
1366 programs that might use these names for other things.
1367
1368 Functions that would normally be built in but do not have semantics
1369 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1370 functions when @option{-ansi} is used.  @xref{Other Builtins,,Other
1371 built-in functions provided by GCC}, for details of the functions
1372 affected.
1373
1374 @item -std=
1375 @opindex std
1376 Determine the language standard. @xref{Standards,,Language Standards
1377 Supported by GCC}, for details of these standard versions.  This option
1378 is currently only supported when compiling C or C++. 
1379
1380 The compiler can accept several base standards, such as @samp{c89} or
1381 @samp{c++98}, and GNU dialects of those standards, such as
1382 @samp{gnu89} or @samp{gnu++98}.  By specifing a base standard, the
1383 compiler will accept all programs following that standard and those
1384 using GNU extensions that do not contradict it.  For example,
1385 @samp{-std=c89} turns off certain features of GCC that are
1386 incompatible with ISO C90, such as the @code{asm} and @code{typeof}
1387 keywords, but not other GNU extensions that do not have a meaning in
1388 ISO C90, such as omitting the middle term of a @code{?:}
1389 expression. On the other hand, by specifing a GNU dialect of a
1390 standard, all features the compiler support are enabled, even when
1391 those features change the meaning of the base standard and some
1392 strict-conforming programs may be rejected.  The particular standard
1393 is used by @option{-pedantic} to identify which features are GNU
1394 extensions given that version of the standard. For example
1395 @samp{-std=gnu89 -pedantic} would warn about C++ style @samp{//}
1396 comments, while @samp{-std=gnu99 -pedantic} would not.
1397
1398 A value for this option must be provided; possible values are
1399
1400 @table @samp
1401 @item c89
1402 @itemx iso9899:1990
1403 Support all ISO C90 programs (certain GNU extensions that conflict
1404 with ISO C90 are disabled). Same as @option{-ansi} for C code.
1405
1406 @item iso9899:199409
1407 ISO C90 as modified in amendment 1.
1408
1409 @item c99
1410 @itemx c9x
1411 @itemx iso9899:1999
1412 @itemx iso9899:199x
1413 ISO C99.  Note that this standard is not yet fully supported; see
1414 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1415 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1416
1417 @item gnu89
1418 GNU dialect of ISO C90 (including some C99 features). This
1419 is the default for C code.
1420
1421 @item gnu99
1422 @itemx gnu9x
1423 GNU dialect of ISO C99.  When ISO C99 is fully implemented in GCC,
1424 this will become the default.  The name @samp{gnu9x} is deprecated.
1425
1426 @item c++98
1427 The 1998 ISO C++ standard plus amendments. Same as @option{-ansi} for
1428 C++ code.
1429
1430 @item gnu++98
1431 GNU dialect of @option{-std=c++98}.  This is the default for
1432 C++ code.
1433
1434 @item c++0x
1435 The working draft of the upcoming ISO C++0x standard. This option
1436 enables experimental features that are likely to be included in
1437 C++0x. The working draft is constantly changing, and any feature that is
1438 enabled by this flag may be removed from future versions of GCC if it is
1439 not part of the C++0x standard.
1440
1441 @item gnu++0x
1442 GNU dialect of @option{-std=c++0x}. This option enables
1443 experimental features that may be removed in future versions of GCC.
1444 @end table
1445
1446 @item -fgnu89-inline
1447 @opindex fgnu89-inline
1448 The option @option{-fgnu89-inline} tells GCC to use the traditional
1449 GNU semantics for @code{inline} functions when in C99 mode.
1450 @xref{Inline,,An Inline Function is As Fast As a Macro}.  This option
1451 is accepted and ignored by GCC versions 4.1.3 up to but not including
1452 4.3.  In GCC versions 4.3 and later it changes the behavior of GCC in
1453 C99 mode.  Using this option is roughly equivalent to adding the
1454 @code{gnu_inline} function attribute to all inline functions
1455 (@pxref{Function Attributes}).
1456
1457 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
1458 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
1459 specifies the default behavior).  This option was first supported in
1460 GCC 4.3.  This option is not supported in C89 or gnu89 mode.
1461
1462 The preprocessor macros @code{__GNUC_GNU_INLINE__} and
1463 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
1464 in effect for @code{inline} functions.  @xref{Common Predefined
1465 Macros,,,cpp,The C Preprocessor}.
1466
1467 @item -aux-info @var{filename}
1468 @opindex aux-info
1469 Output to the given filename prototyped declarations for all functions
1470 declared and/or defined in a translation unit, including those in header
1471 files.  This option is silently ignored in any language other than C@.
1472
1473 Besides declarations, the file indicates, in comments, the origin of
1474 each declaration (source file and line), whether the declaration was
1475 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1476 @samp{O} for old, respectively, in the first character after the line
1477 number and the colon), and whether it came from a declaration or a
1478 definition (@samp{C} or @samp{F}, respectively, in the following
1479 character).  In the case of function definitions, a K&R-style list of
1480 arguments followed by their declarations is also provided, inside
1481 comments, after the declaration.
1482
1483 @item -fno-asm
1484 @opindex fno-asm
1485 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1486 keyword, so that code can use these words as identifiers.  You can use
1487 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1488 instead.  @option{-ansi} implies @option{-fno-asm}.
1489
1490 In C++, this switch only affects the @code{typeof} keyword, since
1491 @code{asm} and @code{inline} are standard keywords.  You may want to
1492 use the @option{-fno-gnu-keywords} flag instead, which has the same
1493 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1494 switch only affects the @code{asm} and @code{typeof} keywords, since
1495 @code{inline} is a standard keyword in ISO C99.
1496
1497 @item -fno-builtin
1498 @itemx -fno-builtin-@var{function}
1499 @opindex fno-builtin
1500 @cindex built-in functions
1501 Don't recognize built-in functions that do not begin with
1502 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1503 functions provided by GCC}, for details of the functions affected,
1504 including those which are not built-in functions when @option{-ansi} or
1505 @option{-std} options for strict ISO C conformance are used because they
1506 do not have an ISO standard meaning.
1507
1508 GCC normally generates special code to handle certain built-in functions
1509 more efficiently; for instance, calls to @code{alloca} may become single
1510 instructions that adjust the stack directly, and calls to @code{memcpy}
1511 may become inline copy loops.  The resulting code is often both smaller
1512 and faster, but since the function calls no longer appear as such, you
1513 cannot set a breakpoint on those calls, nor can you change the behavior
1514 of the functions by linking with a different library.  In addition,
1515 when a function is recognized as a built-in function, GCC may use
1516 information about that function to warn about problems with calls to
1517 that function, or to generate more efficient code, even if the
1518 resulting code still contains calls to that function.  For example,
1519 warnings are given with @option{-Wformat} for bad calls to
1520 @code{printf}, when @code{printf} is built in, and @code{strlen} is
1521 known not to modify global memory.
1522
1523 With the @option{-fno-builtin-@var{function}} option
1524 only the built-in function @var{function} is
1525 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1526 function is named that is not built-in in this version of GCC, this
1527 option is ignored.  There is no corresponding
1528 @option{-fbuiltin-@var{function}} option; if you wish to enable
1529 built-in functions selectively when using @option{-fno-builtin} or
1530 @option{-ffreestanding}, you may define macros such as:
1531
1532 @smallexample
1533 #define abs(n)          __builtin_abs ((n))
1534 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1535 @end smallexample
1536
1537 @item -fhosted
1538 @opindex fhosted
1539 @cindex hosted environment
1540
1541 Assert that compilation takes place in a hosted environment.  This implies
1542 @option{-fbuiltin}.  A hosted environment is one in which the
1543 entire standard library is available, and in which @code{main} has a return
1544 type of @code{int}.  Examples are nearly everything except a kernel.
1545 This is equivalent to @option{-fno-freestanding}.
1546
1547 @item -ffreestanding
1548 @opindex ffreestanding
1549 @cindex hosted environment
1550
1551 Assert that compilation takes place in a freestanding environment.  This
1552 implies @option{-fno-builtin}.  A freestanding environment
1553 is one in which the standard library may not exist, and program startup may
1554 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1555 This is equivalent to @option{-fno-hosted}.
1556
1557 @xref{Standards,,Language Standards Supported by GCC}, for details of
1558 freestanding and hosted environments.
1559
1560 @item -fopenmp
1561 @opindex fopenmp
1562 @cindex openmp parallel
1563 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
1564 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
1565 compiler generates parallel code according to the OpenMP Application
1566 Program Interface v2.5 @w{@uref{http://www.openmp.org/}}.  This option
1567 implies @option{-pthread}, and thus is only supported on targets that
1568 have support for @option{-pthread}.
1569
1570 @item -fms-extensions
1571 @opindex fms-extensions
1572 Accept some non-standard constructs used in Microsoft header files.
1573
1574 Some cases of unnamed fields in structures and unions are only
1575 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
1576 fields within structs/unions}, for details.
1577
1578 @item -trigraphs
1579 @opindex trigraphs
1580 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
1581 options for strict ISO C conformance) implies @option{-trigraphs}.
1582
1583 @item -no-integrated-cpp
1584 @opindex no-integrated-cpp
1585 Performs a compilation in two passes: preprocessing and compiling.  This
1586 option allows a user supplied "cc1", "cc1plus", or "cc1obj" via the
1587 @option{-B} option.  The user supplied compilation step can then add in
1588 an additional preprocessing step after normal preprocessing but before
1589 compiling.  The default is to use the integrated cpp (internal cpp)
1590
1591 The semantics of this option will change if "cc1", "cc1plus", and
1592 "cc1obj" are merged.
1593
1594 @cindex traditional C language
1595 @cindex C language, traditional
1596 @item -traditional
1597 @itemx -traditional-cpp
1598 @opindex traditional-cpp
1599 @opindex traditional
1600 Formerly, these options caused GCC to attempt to emulate a pre-standard
1601 C compiler.  They are now only supported with the @option{-E} switch.
1602 The preprocessor continues to support a pre-standard mode.  See the GNU
1603 CPP manual for details.
1604
1605 @item -fcond-mismatch
1606 @opindex fcond-mismatch
1607 Allow conditional expressions with mismatched types in the second and
1608 third arguments.  The value of such an expression is void.  This option
1609 is not supported for C++.
1610
1611 @item -flax-vector-conversions
1612 @opindex flax-vector-conversions
1613 Allow implicit conversions between vectors with differing numbers of
1614 elements and/or incompatible element types.  This option should not be
1615 used for new code.
1616
1617 @item -funsigned-char
1618 @opindex funsigned-char
1619 Let the type @code{char} be unsigned, like @code{unsigned char}.
1620
1621 Each kind of machine has a default for what @code{char} should
1622 be.  It is either like @code{unsigned char} by default or like
1623 @code{signed char} by default.
1624
1625 Ideally, a portable program should always use @code{signed char} or
1626 @code{unsigned char} when it depends on the signedness of an object.
1627 But many programs have been written to use plain @code{char} and
1628 expect it to be signed, or expect it to be unsigned, depending on the
1629 machines they were written for.  This option, and its inverse, let you
1630 make such a program work with the opposite default.
1631
1632 The type @code{char} is always a distinct type from each of
1633 @code{signed char} or @code{unsigned char}, even though its behavior
1634 is always just like one of those two.
1635
1636 @item -fsigned-char
1637 @opindex fsigned-char
1638 Let the type @code{char} be signed, like @code{signed char}.
1639
1640 Note that this is equivalent to @option{-fno-unsigned-char}, which is
1641 the negative form of @option{-funsigned-char}.  Likewise, the option
1642 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
1643
1644 @item -fsigned-bitfields
1645 @itemx -funsigned-bitfields
1646 @itemx -fno-signed-bitfields
1647 @itemx -fno-unsigned-bitfields
1648 @opindex fsigned-bitfields
1649 @opindex funsigned-bitfields
1650 @opindex fno-signed-bitfields
1651 @opindex fno-unsigned-bitfields
1652 These options control whether a bit-field is signed or unsigned, when the
1653 declaration does not use either @code{signed} or @code{unsigned}.  By
1654 default, such a bit-field is signed, because this is consistent: the
1655 basic integer types such as @code{int} are signed types.
1656 @end table
1657
1658 @node C++ Dialect Options
1659 @section Options Controlling C++ Dialect
1660
1661 @cindex compiler options, C++
1662 @cindex C++ options, command line
1663 @cindex options, C++
1664 This section describes the command-line options that are only meaningful
1665 for C++ programs; but you can also use most of the GNU compiler options
1666 regardless of what language your program is in.  For example, you
1667 might compile a file @code{firstClass.C} like this:
1668
1669 @smallexample
1670 g++ -g -frepo -O -c firstClass.C
1671 @end smallexample
1672
1673 @noindent
1674 In this example, only @option{-frepo} is an option meant
1675 only for C++ programs; you can use the other options with any
1676 language supported by GCC@.
1677
1678 Here is a list of options that are @emph{only} for compiling C++ programs:
1679
1680 @table @gcctabopt
1681
1682 @item -fabi-version=@var{n}
1683 @opindex fabi-version
1684 Use version @var{n} of the C++ ABI@.  Version 2 is the version of the
1685 C++ ABI that first appeared in G++ 3.4.  Version 1 is the version of
1686 the C++ ABI that first appeared in G++ 3.2.  Version 0 will always be
1687 the version that conforms most closely to the C++ ABI specification.
1688 Therefore, the ABI obtained using version 0 will change as ABI bugs
1689 are fixed.
1690
1691 The default is version 2.
1692
1693 @item -fno-access-control
1694 @opindex fno-access-control
1695 Turn off all access checking.  This switch is mainly useful for working
1696 around bugs in the access control code.
1697
1698 @item -fcheck-new
1699 @opindex fcheck-new
1700 Check that the pointer returned by @code{operator new} is non-null
1701 before attempting to modify the storage allocated.  This check is
1702 normally unnecessary because the C++ standard specifies that
1703 @code{operator new} will only return @code{0} if it is declared
1704 @samp{throw()}, in which case the compiler will always check the
1705 return value even without this option.  In all other cases, when
1706 @code{operator new} has a non-empty exception specification, memory
1707 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
1708 @samp{new (nothrow)}.
1709
1710 @item -fconserve-space
1711 @opindex fconserve-space
1712 Put uninitialized or runtime-initialized global variables into the
1713 common segment, as C does.  This saves space in the executable at the
1714 cost of not diagnosing duplicate definitions.  If you compile with this
1715 flag and your program mysteriously crashes after @code{main()} has
1716 completed, you may have an object that is being destroyed twice because
1717 two definitions were merged.
1718
1719 This option is no longer useful on most targets, now that support has
1720 been added for putting variables into BSS without making them common.
1721
1722 @item -ffriend-injection
1723 @opindex ffriend-injection
1724 Inject friend functions into the enclosing namespace, so that they are
1725 visible outside the scope of the class in which they are declared.
1726 Friend functions were documented to work this way in the old Annotated
1727 C++ Reference Manual, and versions of G++ before 4.1 always worked
1728 that way.  However, in ISO C++ a friend function which is not declared
1729 in an enclosing scope can only be found using argument dependent
1730 lookup.  This option causes friends to be injected as they were in
1731 earlier releases.
1732
1733 This option is for compatibility, and may be removed in a future
1734 release of G++.
1735
1736 @item -fno-elide-constructors
1737 @opindex fno-elide-constructors
1738 The C++ standard allows an implementation to omit creating a temporary
1739 which is only used to initialize another object of the same type.
1740 Specifying this option disables that optimization, and forces G++ to
1741 call the copy constructor in all cases.
1742
1743 @item -fno-enforce-eh-specs
1744 @opindex fno-enforce-eh-specs
1745 Don't generate code to check for violation of exception specifications
1746 at runtime.  This option violates the C++ standard, but may be useful
1747 for reducing code size in production builds, much like defining
1748 @samp{NDEBUG}.  This does not give user code permission to throw
1749 exceptions in violation of the exception specifications; the compiler
1750 will still optimize based on the specifications, so throwing an
1751 unexpected exception will result in undefined behavior.
1752
1753 @item -ffor-scope
1754 @itemx -fno-for-scope
1755 @opindex ffor-scope
1756 @opindex fno-for-scope
1757 If @option{-ffor-scope} is specified, the scope of variables declared in
1758 a @i{for-init-statement} is limited to the @samp{for} loop itself,
1759 as specified by the C++ standard.
1760 If @option{-fno-for-scope} is specified, the scope of variables declared in
1761 a @i{for-init-statement} extends to the end of the enclosing scope,
1762 as was the case in old versions of G++, and other (traditional)
1763 implementations of C++.
1764
1765 The default if neither flag is given to follow the standard,
1766 but to allow and give a warning for old-style code that would
1767 otherwise be invalid, or have different behavior.
1768
1769 @item -fno-gnu-keywords
1770 @opindex fno-gnu-keywords
1771 Do not recognize @code{typeof} as a keyword, so that code can use this
1772 word as an identifier.  You can use the keyword @code{__typeof__} instead.
1773 @option{-ansi} implies @option{-fno-gnu-keywords}.
1774
1775 @item -fno-implicit-templates
1776 @opindex fno-implicit-templates
1777 Never emit code for non-inline templates which are instantiated
1778 implicitly (i.e.@: by use); only emit code for explicit instantiations.
1779 @xref{Template Instantiation}, for more information.
1780
1781 @item -fno-implicit-inline-templates
1782 @opindex fno-implicit-inline-templates
1783 Don't emit code for implicit instantiations of inline templates, either.
1784 The default is to handle inlines differently so that compiles with and
1785 without optimization will need the same set of explicit instantiations.
1786
1787 @item -fno-implement-inlines
1788 @opindex fno-implement-inlines
1789 To save space, do not emit out-of-line copies of inline functions
1790 controlled by @samp{#pragma implementation}.  This will cause linker
1791 errors if these functions are not inlined everywhere they are called.
1792
1793 @item -fms-extensions
1794 @opindex fms-extensions
1795 Disable pedantic warnings about constructs used in MFC, such as implicit
1796 int and getting a pointer to member function via non-standard syntax.
1797
1798 @item -fno-nonansi-builtins
1799 @opindex fno-nonansi-builtins
1800 Disable built-in declarations of functions that are not mandated by
1801 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
1802 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
1803
1804 @item -fno-operator-names
1805 @opindex fno-operator-names
1806 Do not treat the operator name keywords @code{and}, @code{bitand},
1807 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
1808 synonyms as keywords.
1809
1810 @item -fno-optional-diags
1811 @opindex fno-optional-diags
1812 Disable diagnostics that the standard says a compiler does not need to
1813 issue.  Currently, the only such diagnostic issued by G++ is the one for
1814 a name having multiple meanings within a class.
1815
1816 @item -fpermissive
1817 @opindex fpermissive
1818 Downgrade some diagnostics about nonconformant code from errors to
1819 warnings.  Thus, using @option{-fpermissive} will allow some
1820 nonconforming code to compile.
1821
1822 @item -frepo
1823 @opindex frepo
1824 Enable automatic template instantiation at link time.  This option also
1825 implies @option{-fno-implicit-templates}.  @xref{Template
1826 Instantiation}, for more information.
1827
1828 @item -fno-rtti
1829 @opindex fno-rtti
1830 Disable generation of information about every class with virtual
1831 functions for use by the C++ runtime type identification features
1832 (@samp{dynamic_cast} and @samp{typeid}).  If you don't use those parts
1833 of the language, you can save some space by using this flag.  Note that
1834 exception handling uses the same information, but it will generate it as
1835 needed. The @samp{dynamic_cast} operator can still be used for casts that
1836 do not require runtime type information, i.e.@: casts to @code{void *} or to
1837 unambiguous base classes.
1838
1839 @item -fstats
1840 @opindex fstats
1841 Emit statistics about front-end processing at the end of the compilation.
1842 This information is generally only useful to the G++ development team.
1843
1844 @item -ftemplate-depth-@var{n}
1845 @opindex ftemplate-depth
1846 Set the maximum instantiation depth for template classes to @var{n}.
1847 A limit on the template instantiation depth is needed to detect
1848 endless recursions during template class instantiation.  ANSI/ISO C++
1849 conforming programs must not rely on a maximum depth greater than 17.
1850
1851 @item -fno-threadsafe-statics
1852 @opindex fno-threadsafe-statics
1853 Do not emit the extra code to use the routines specified in the C++
1854 ABI for thread-safe initialization of local statics.  You can use this
1855 option to reduce code size slightly in code that doesn't need to be
1856 thread-safe.
1857
1858 @item -fuse-cxa-atexit
1859 @opindex fuse-cxa-atexit
1860 Register destructors for objects with static storage duration with the
1861 @code{__cxa_atexit} function rather than the @code{atexit} function.
1862 This option is required for fully standards-compliant handling of static
1863 destructors, but will only work if your C library supports
1864 @code{__cxa_atexit}.
1865
1866 @item -fno-use-cxa-get-exception-ptr
1867 @opindex fno-use-cxa-get-exception-ptr
1868 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
1869 will cause @code{std::uncaught_exception} to be incorrect, but is necessary
1870 if the runtime routine is not available.
1871
1872 @item -fvisibility-inlines-hidden
1873 @opindex fvisibility-inlines-hidden
1874 This switch declares that the user does not attempt to compare
1875 pointers to inline methods where the addresses of the two functions
1876 were taken in different shared objects.
1877
1878 The effect of this is that GCC may, effectively, mark inline methods with
1879 @code{__attribute__ ((visibility ("hidden")))} so that they do not
1880 appear in the export table of a DSO and do not require a PLT indirection
1881 when used within the DSO@.  Enabling this option can have a dramatic effect
1882 on load and link times of a DSO as it massively reduces the size of the
1883 dynamic export table when the library makes heavy use of templates.
1884
1885 The behavior of this switch is not quite the same as marking the
1886 methods as hidden directly, because it does not affect static variables
1887 local to the function or cause the compiler to deduce that
1888 the function is defined in only one shared object.
1889
1890 You may mark a method as having a visibility explicitly to negate the
1891 effect of the switch for that method.  For example, if you do want to
1892 compare pointers to a particular inline method, you might mark it as
1893 having default visibility.  Marking the enclosing class with explicit
1894 visibility will have no effect.
1895
1896 Explicitly instantiated inline methods are unaffected by this option
1897 as their linkage might otherwise cross a shared library boundary.
1898 @xref{Template Instantiation}.
1899
1900 @item -fvisibility-ms-compat
1901 @opindex fvisibility-ms-compat
1902 This flag attempts to use visibility settings to make GCC's C++
1903 linkage model compatible with that of Microsoft Visual Studio.
1904
1905 The flag makes these changes to GCC's linkage model:
1906
1907 @enumerate
1908 @item
1909 It sets the default visibility to @code{hidden}, like
1910 @option{-fvisibility=hidden}.
1911
1912 @item
1913 Types, but not their members, are not hidden by default.
1914
1915 @item
1916 The One Definition Rule is relaxed for types without explicit
1917 visibility specifications which are defined in more than one different
1918 shared object: those declarations are permitted if they would have
1919 been permitted when this option was not used.
1920 @end enumerate
1921
1922 In new code it is better to use @option{-fvisibility=hidden} and
1923 export those classes which are intended to be externally visible.
1924 Unfortunately it is possible for code to rely, perhaps accidentally,
1925 on the Visual Studio behavior.
1926
1927 Among the consequences of these changes are that static data members
1928 of the same type with the same name but defined in different shared
1929 objects will be different, so changing one will not change the other;
1930 and that pointers to function members defined in different shared
1931 objects may not compare equal.  When this flag is given, it is a
1932 violation of the ODR to define types with the same name differently.
1933
1934 @item -fno-weak
1935 @opindex fno-weak
1936 Do not use weak symbol support, even if it is provided by the linker.
1937 By default, G++ will use weak symbols if they are available.  This
1938 option exists only for testing, and should not be used by end-users;
1939 it will result in inferior code and has no benefits.  This option may
1940 be removed in a future release of G++.
1941
1942 @item -nostdinc++
1943 @opindex nostdinc++
1944 Do not search for header files in the standard directories specific to
1945 C++, but do still search the other standard directories.  (This option
1946 is used when building the C++ library.)
1947 @end table
1948
1949 In addition, these optimization, warning, and code generation options
1950 have meanings only for C++ programs:
1951
1952 @table @gcctabopt
1953 @item -fno-default-inline
1954 @opindex fno-default-inline
1955 Do not assume @samp{inline} for functions defined inside a class scope.
1956 @xref{Optimize Options,,Options That Control Optimization}.  Note that these
1957 functions will have linkage like inline functions; they just won't be
1958 inlined by default.
1959
1960 @item -Wabi @r{(C++ and Objective-C++ only)}
1961 @opindex Wabi
1962 @opindex Wno-abi
1963 Warn when G++ generates code that is probably not compatible with the
1964 vendor-neutral C++ ABI@.  Although an effort has been made to warn about
1965 all such cases, there are probably some cases that are not warned about,
1966 even though G++ is generating incompatible code.  There may also be
1967 cases where warnings are emitted even though the code that is generated
1968 will be compatible.
1969
1970 You should rewrite your code to avoid these warnings if you are
1971 concerned about the fact that code generated by G++ may not be binary
1972 compatible with code generated by other compilers.
1973
1974 The known incompatibilities at this point include:
1975
1976 @itemize @bullet
1977
1978 @item
1979 Incorrect handling of tail-padding for bit-fields.  G++ may attempt to
1980 pack data into the same byte as a base class.  For example:
1981
1982 @smallexample
1983 struct A @{ virtual void f(); int f1 : 1; @};
1984 struct B : public A @{ int f2 : 1; @};
1985 @end smallexample
1986
1987 @noindent
1988 In this case, G++ will place @code{B::f2} into the same byte
1989 as@code{A::f1}; other compilers will not.  You can avoid this problem
1990 by explicitly padding @code{A} so that its size is a multiple of the
1991 byte size on your platform; that will cause G++ and other compilers to
1992 layout @code{B} identically.
1993
1994 @item
1995 Incorrect handling of tail-padding for virtual bases.  G++ does not use
1996 tail padding when laying out virtual bases.  For example:
1997
1998 @smallexample
1999 struct A @{ virtual void f(); char c1; @};
2000 struct B @{ B(); char c2; @};
2001 struct C : public A, public virtual B @{@};
2002 @end smallexample
2003
2004 @noindent
2005 In this case, G++ will not place @code{B} into the tail-padding for
2006 @code{A}; other compilers will.  You can avoid this problem by
2007 explicitly padding @code{A} so that its size is a multiple of its
2008 alignment (ignoring virtual base classes); that will cause G++ and other
2009 compilers to layout @code{C} identically.
2010
2011 @item
2012 Incorrect handling of bit-fields with declared widths greater than that
2013 of their underlying types, when the bit-fields appear in a union.  For
2014 example:
2015
2016 @smallexample
2017 union U @{ int i : 4096; @};
2018 @end smallexample
2019
2020 @noindent
2021 Assuming that an @code{int} does not have 4096 bits, G++ will make the
2022 union too small by the number of bits in an @code{int}.
2023
2024 @item
2025 Empty classes can be placed at incorrect offsets.  For example:
2026
2027 @smallexample
2028 struct A @{@};
2029
2030 struct B @{
2031   A a;
2032   virtual void f ();
2033 @};
2034
2035 struct C : public B, public A @{@};
2036 @end smallexample
2037
2038 @noindent
2039 G++ will place the @code{A} base class of @code{C} at a nonzero offset;
2040 it should be placed at offset zero.  G++ mistakenly believes that the
2041 @code{A} data member of @code{B} is already at offset zero.
2042
2043 @item
2044 Names of template functions whose types involve @code{typename} or
2045 template template parameters can be mangled incorrectly.
2046
2047 @smallexample
2048 template <typename Q>
2049 void f(typename Q::X) @{@}
2050
2051 template <template <typename> class Q>
2052 void f(typename Q<int>::X) @{@}
2053 @end smallexample
2054
2055 @noindent
2056 Instantiations of these templates may be mangled incorrectly.
2057
2058 @end itemize
2059
2060 @item -Wctor-dtor-privacy @r{(C++ and Objective-C++ only)}
2061 @opindex Wctor-dtor-privacy
2062 @opindex Wno-ctor-dtor-privacy
2063 Warn when a class seems unusable because all the constructors or
2064 destructors in that class are private, and it has neither friends nor
2065 public static member functions.
2066
2067 @item -Wnon-virtual-dtor @r{(C++ and Objective-C++ only)}
2068 @opindex Wnon-virtual-dtor
2069 @opindex Wno-non-virtual-dtor
2070 Warn when a class has virtual functions and accessible non-virtual
2071 destructor, in which case it would be possible but unsafe to delete
2072 an instance of a derived class through a pointer to the base class.
2073 This warning is also enabled if -Weffc++ is specified.
2074
2075 @item -Wreorder @r{(C++ and Objective-C++ only)}
2076 @opindex Wreorder
2077 @opindex Wno-reorder
2078 @cindex reordering, warning
2079 @cindex warning for reordering of member initializers
2080 Warn when the order of member initializers given in the code does not
2081 match the order in which they must be executed.  For instance:
2082
2083 @smallexample
2084 struct A @{
2085   int i;
2086   int j;
2087   A(): j (0), i (1) @{ @}
2088 @};
2089 @end smallexample
2090
2091 The compiler will rearrange the member initializers for @samp{i}
2092 and @samp{j} to match the declaration order of the members, emitting
2093 a warning to that effect.  This warning is enabled by @option{-Wall}.
2094 @end table
2095
2096 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
2097
2098 @table @gcctabopt
2099 @item -Weffc++ @r{(C++ and Objective-C++ only)}
2100 @opindex Weffc++
2101 @opindex Wno-effc++
2102 Warn about violations of the following style guidelines from Scott Meyers'
2103 @cite{Effective C++} book:
2104
2105 @itemize @bullet
2106 @item
2107 Item 11:  Define a copy constructor and an assignment operator for classes
2108 with dynamically allocated memory.
2109
2110 @item
2111 Item 12:  Prefer initialization to assignment in constructors.
2112
2113 @item
2114 Item 14:  Make destructors virtual in base classes.
2115
2116 @item
2117 Item 15:  Have @code{operator=} return a reference to @code{*this}.
2118
2119 @item
2120 Item 23:  Don't try to return a reference when you must return an object.
2121
2122 @end itemize
2123
2124 Also warn about violations of the following style guidelines from
2125 Scott Meyers' @cite{More Effective C++} book:
2126
2127 @itemize @bullet
2128 @item
2129 Item 6:  Distinguish between prefix and postfix forms of increment and
2130 decrement operators.
2131
2132 @item
2133 Item 7:  Never overload @code{&&}, @code{||}, or @code{,}.
2134
2135 @end itemize
2136
2137 When selecting this option, be aware that the standard library
2138 headers do not obey all of these guidelines; use @samp{grep -v}
2139 to filter out those warnings.
2140
2141 @item -Wstrict-null-sentinel @r{(C++ and Objective-C++ only)}
2142 @opindex Wstrict-null-sentinel
2143 @opindex Wno-strict-null-sentinel
2144 Warn also about the use of an uncasted @code{NULL} as sentinel.  When
2145 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
2146 to @code{__null}.  Although it is a null pointer constant not a null pointer,
2147 it is guaranteed to of the same size as a pointer.  But this use is
2148 not portable across different compilers.
2149
2150 @item -Wno-non-template-friend @r{(C++ and Objective-C++ only)}
2151 @opindex Wno-non-template-friend
2152 @opindex Wnon-template-friend
2153 Disable warnings when non-templatized friend functions are declared
2154 within a template.  Since the advent of explicit template specification
2155 support in G++, if the name of the friend is an unqualified-id (i.e.,
2156 @samp{friend foo(int)}), the C++ language specification demands that the
2157 friend declare or define an ordinary, nontemplate function.  (Section
2158 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
2159 could be interpreted as a particular specialization of a templatized
2160 function.  Because this non-conforming behavior is no longer the default
2161 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
2162 check existing code for potential trouble spots and is on by default.
2163 This new compiler behavior can be turned off with
2164 @option{-Wno-non-template-friend} which keeps the conformant compiler code
2165 but disables the helpful warning.
2166
2167 @item -Wold-style-cast @r{(C++ and Objective-C++ only)}
2168 @opindex Wold-style-cast
2169 @opindex Wno-old-style-cast
2170 Warn if an old-style (C-style) cast to a non-void type is used within
2171 a C++ program.  The new-style casts (@samp{dynamic_cast},
2172 @samp{static_cast}, @samp{reinterpret_cast}, and @samp{const_cast}) are
2173 less vulnerable to unintended effects and much easier to search for.
2174
2175 @item -Woverloaded-virtual @r{(C++ and Objective-C++ only)}
2176 @opindex Woverloaded-virtual
2177 @opindex Wno-overloaded-virtual
2178 @cindex overloaded virtual fn, warning
2179 @cindex warning for overloaded virtual fn
2180 Warn when a function declaration hides virtual functions from a
2181 base class.  For example, in:
2182
2183 @smallexample
2184 struct A @{
2185   virtual void f();
2186 @};
2187
2188 struct B: public A @{
2189   void f(int);
2190 @};
2191 @end smallexample
2192
2193 the @code{A} class version of @code{f} is hidden in @code{B}, and code
2194 like:
2195
2196 @smallexample
2197 B* b;
2198 b->f();
2199 @end smallexample
2200
2201 will fail to compile.
2202
2203 @item -Wno-pmf-conversions @r{(C++ and Objective-C++ only)}
2204 @opindex Wno-pmf-conversions
2205 @opindex Wpmf-conversions
2206 Disable the diagnostic for converting a bound pointer to member function
2207 to a plain pointer.
2208
2209 @item -Wsign-promo @r{(C++ and Objective-C++ only)}
2210 @opindex Wsign-promo
2211 @opindex Wno-sign-promo
2212 Warn when overload resolution chooses a promotion from unsigned or
2213 enumerated type to a signed type, over a conversion to an unsigned type of
2214 the same size.  Previous versions of G++ would try to preserve
2215 unsignedness, but the standard mandates the current behavior.
2216
2217 @smallexample
2218 struct A @{
2219   operator int ();
2220   A& operator = (int);
2221 @};
2222
2223 main ()
2224 @{
2225   A a,b;
2226   a = b;
2227 @}
2228 @end smallexample
2229
2230 In this example, G++ will synthesize a default @samp{A& operator =
2231 (const A&);}, while cfront will use the user-defined @samp{operator =}.
2232 @end table
2233
2234 @node Objective-C and Objective-C++ Dialect Options
2235 @section Options Controlling Objective-C and Objective-C++ Dialects
2236
2237 @cindex compiler options, Objective-C and Objective-C++
2238 @cindex Objective-C and Objective-C++ options, command line
2239 @cindex options, Objective-C and Objective-C++
2240 (NOTE: This manual does not describe the Objective-C and Objective-C++
2241 languages themselves.  See @xref{Standards,,Language Standards
2242 Supported by GCC}, for references.)
2243
2244 This section describes the command-line options that are only meaningful
2245 for Objective-C and Objective-C++ programs, but you can also use most of
2246 the language-independent GNU compiler options.
2247 For example, you might compile a file @code{some_class.m} like this:
2248
2249 @smallexample
2250 gcc -g -fgnu-runtime -O -c some_class.m
2251 @end smallexample
2252
2253 @noindent
2254 In this example, @option{-fgnu-runtime} is an option meant only for
2255 Objective-C and Objective-C++ programs; you can use the other options with
2256 any language supported by GCC@.
2257
2258 Note that since Objective-C is an extension of the C language, Objective-C
2259 compilations may also use options specific to the C front-end (e.g.,
2260 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
2261 C++-specific options (e.g., @option{-Wabi}).
2262
2263 Here is a list of options that are @emph{only} for compiling Objective-C
2264 and Objective-C++ programs:
2265
2266 @table @gcctabopt
2267 @item -fconstant-string-class=@var{class-name}
2268 @opindex fconstant-string-class
2269 Use @var{class-name} as the name of the class to instantiate for each
2270 literal string specified with the syntax @code{@@"@dots{}"}.  The default
2271 class name is @code{NXConstantString} if the GNU runtime is being used, and
2272 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
2273 @option{-fconstant-cfstrings} option, if also present, will override the
2274 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
2275 to be laid out as constant CoreFoundation strings.
2276
2277 @item -fgnu-runtime
2278 @opindex fgnu-runtime
2279 Generate object code compatible with the standard GNU Objective-C
2280 runtime.  This is the default for most types of systems.
2281
2282 @item -fnext-runtime
2283 @opindex fnext-runtime
2284 Generate output compatible with the NeXT runtime.  This is the default
2285 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
2286 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
2287 used.
2288
2289 @item -fno-nil-receivers
2290 @opindex fno-nil-receivers
2291 Assume that all Objective-C message dispatches (e.g.,
2292 @code{[receiver message:arg]}) in this translation unit ensure that the receiver
2293 is not @code{nil}.  This allows for more efficient entry points in the runtime
2294 to be used.  Currently, this option is only available in conjunction with
2295 the NeXT runtime on Mac OS X 10.3 and later.
2296
2297 @item -fobjc-call-cxx-cdtors
2298 @opindex fobjc-call-cxx-cdtors
2299 For each Objective-C class, check if any of its instance variables is a
2300 C++ object with a non-trivial default constructor.  If so, synthesize a
2301 special @code{- (id) .cxx_construct} instance method that will run
2302 non-trivial default constructors on any such instance variables, in order,
2303 and then return @code{self}.  Similarly, check if any instance variable
2304 is a C++ object with a non-trivial destructor, and if so, synthesize a
2305 special @code{- (void) .cxx_destruct} method that will run
2306 all such default destructors, in reverse order.
2307
2308 The @code{- (id) .cxx_construct} and/or @code{- (void) .cxx_destruct} methods
2309 thusly generated will only operate on instance variables declared in the
2310 current Objective-C class, and not those inherited from superclasses.  It
2311 is the responsibility of the Objective-C runtime to invoke all such methods
2312 in an object's inheritance hierarchy.  The @code{- (id) .cxx_construct} methods
2313 will be invoked by the runtime immediately after a new object
2314 instance is allocated; the @code{- (void) .cxx_destruct} methods will
2315 be invoked immediately before the runtime deallocates an object instance.
2316
2317 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
2318 support for invoking the @code{- (id) .cxx_construct} and
2319 @code{- (void) .cxx_destruct} methods.
2320
2321 @item -fobjc-direct-dispatch
2322 @opindex fobjc-direct-dispatch
2323 Allow fast jumps to the message dispatcher.  On Darwin this is
2324 accomplished via the comm page.
2325
2326 @item -fobjc-exceptions
2327 @opindex fobjc-exceptions
2328 Enable syntactic support for structured exception handling in Objective-C,
2329 similar to what is offered by C++ and Java.  This option is
2330 unavailable in conjunction with the NeXT runtime on Mac OS X 10.2 and
2331 earlier.
2332
2333 @smallexample
2334   @@try @{
2335     @dots{}
2336        @@throw expr;
2337     @dots{}
2338   @}
2339   @@catch (AnObjCClass *exc) @{
2340     @dots{}
2341       @@throw expr;
2342     @dots{}
2343       @@throw;
2344     @dots{}
2345   @}
2346   @@catch (AnotherClass *exc) @{
2347     @dots{}
2348   @}
2349   @@catch (id allOthers) @{
2350     @dots{}
2351   @}
2352   @@finally @{
2353     @dots{}
2354       @@throw expr;
2355     @dots{}
2356   @}
2357 @end smallexample
2358
2359 The @code{@@throw} statement may appear anywhere in an Objective-C or
2360 Objective-C++ program; when used inside of a @code{@@catch} block, the
2361 @code{@@throw} may appear without an argument (as shown above), in which case
2362 the object caught by the @code{@@catch} will be rethrown.
2363
2364 Note that only (pointers to) Objective-C objects may be thrown and
2365 caught using this scheme.  When an object is thrown, it will be caught
2366 by the nearest @code{@@catch} clause capable of handling objects of that type,
2367 analogously to how @code{catch} blocks work in C++ and Java.  A
2368 @code{@@catch(id @dots{})} clause (as shown above) may also be provided to catch
2369 any and all Objective-C exceptions not caught by previous @code{@@catch}
2370 clauses (if any).
2371
2372 The @code{@@finally} clause, if present, will be executed upon exit from the
2373 immediately preceding @code{@@try @dots{} @@catch} section.  This will happen
2374 regardless of whether any exceptions are thrown, caught or rethrown
2375 inside the @code{@@try @dots{} @@catch} section, analogously to the behavior
2376 of the @code{finally} clause in Java.
2377
2378 There are several caveats to using the new exception mechanism:
2379
2380 @itemize @bullet
2381 @item
2382 Although currently designed to be binary compatible with @code{NS_HANDLER}-style
2383 idioms provided by the @code{NSException} class, the new
2384 exceptions can only be used on Mac OS X 10.3 (Panther) and later
2385 systems, due to additional functionality needed in the (NeXT) Objective-C
2386 runtime.
2387
2388 @item
2389 As mentioned above, the new exceptions do not support handling
2390 types other than Objective-C objects.   Furthermore, when used from
2391 Objective-C++, the Objective-C exception model does not interoperate with C++
2392 exceptions at this time.  This means you cannot @code{@@throw} an exception
2393 from Objective-C and @code{catch} it in C++, or vice versa
2394 (i.e., @code{throw @dots{} @@catch}).
2395 @end itemize
2396
2397 The @option{-fobjc-exceptions} switch also enables the use of synchronization
2398 blocks for thread-safe execution:
2399
2400 @smallexample
2401   @@synchronized (ObjCClass *guard) @{
2402     @dots{}
2403   @}
2404 @end smallexample
2405
2406 Upon entering the @code{@@synchronized} block, a thread of execution shall
2407 first check whether a lock has been placed on the corresponding @code{guard}
2408 object by another thread.  If it has, the current thread shall wait until
2409 the other thread relinquishes its lock.  Once @code{guard} becomes available,
2410 the current thread will place its own lock on it, execute the code contained in
2411 the @code{@@synchronized} block, and finally relinquish the lock (thereby
2412 making @code{guard} available to other threads).
2413
2414 Unlike Java, Objective-C does not allow for entire methods to be marked
2415 @code{@@synchronized}.  Note that throwing exceptions out of
2416 @code{@@synchronized} blocks is allowed, and will cause the guarding object
2417 to be unlocked properly.
2418
2419 @item -fobjc-gc
2420 @opindex fobjc-gc
2421 Enable garbage collection (GC) in Objective-C and Objective-C++ programs.
2422
2423 @item -freplace-objc-classes
2424 @opindex freplace-objc-classes
2425 Emit a special marker instructing @command{ld(1)} not to statically link in
2426 the resulting object file, and allow @command{dyld(1)} to load it in at
2427 run time instead.  This is used in conjunction with the Fix-and-Continue
2428 debugging mode, where the object file in question may be recompiled and
2429 dynamically reloaded in the course of program execution, without the need
2430 to restart the program itself.  Currently, Fix-and-Continue functionality
2431 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
2432 and later.
2433
2434 @item -fzero-link
2435 @opindex fzero-link
2436 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
2437 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
2438 compile time) with static class references that get initialized at load time,
2439 which improves run-time performance.  Specifying the @option{-fzero-link} flag
2440 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
2441 to be retained.  This is useful in Zero-Link debugging mode, since it allows
2442 for individual class implementations to be modified during program execution.
2443
2444 @item -gen-decls
2445 @opindex gen-decls
2446 Dump interface declarations for all classes seen in the source file to a
2447 file named @file{@var{sourcename}.decl}.
2448
2449 @item -Wassign-intercept @r{(Objective-C and Objective-C++ only)}
2450 @opindex Wassign-intercept
2451 @opindex Wno-assign-intercept
2452 Warn whenever an Objective-C assignment is being intercepted by the
2453 garbage collector.
2454
2455 @item -Wno-protocol @r{(Objective-C and Objective-C++ only)}
2456 @opindex Wno-protocol
2457 @opindex Wprotocol
2458 If a class is declared to implement a protocol, a warning is issued for
2459 every method in the protocol that is not implemented by the class.  The
2460 default behavior is to issue a warning for every method not explicitly
2461 implemented in the class, even if a method implementation is inherited
2462 from the superclass.  If you use the @option{-Wno-protocol} option, then
2463 methods inherited from the superclass are considered to be implemented,
2464 and no warning is issued for them.
2465
2466 @item -Wselector @r{(Objective-C and Objective-C++ only)}
2467 @opindex Wselector
2468 @opindex Wno-selector
2469 Warn if multiple methods of different types for the same selector are
2470 found during compilation.  The check is performed on the list of methods
2471 in the final stage of compilation.  Additionally, a check is performed
2472 for each selector appearing in a @code{@@selector(@dots{})}
2473 expression, and a corresponding method for that selector has been found
2474 during compilation.  Because these checks scan the method table only at
2475 the end of compilation, these warnings are not produced if the final
2476 stage of compilation is not reached, for example because an error is
2477 found during compilation, or because the @option{-fsyntax-only} option is
2478 being used.
2479
2480 @item -Wstrict-selector-match @r{(Objective-C and Objective-C++ only)}
2481 @opindex Wstrict-selector-match
2482 @opindex Wno-strict-selector-match
2483 Warn if multiple methods with differing argument and/or return types are
2484 found for a given selector when attempting to send a message using this
2485 selector to a receiver of type @code{id} or @code{Class}.  When this flag
2486 is off (which is the default behavior), the compiler will omit such warnings
2487 if any differences found are confined to types which share the same size
2488 and alignment.
2489
2490 @item -Wundeclared-selector @r{(Objective-C and Objective-C++ only)}
2491 @opindex Wundeclared-selector
2492 @opindex Wno-undeclared-selector
2493 Warn if a @code{@@selector(@dots{})} expression referring to an
2494 undeclared selector is found.  A selector is considered undeclared if no
2495 method with that name has been declared before the
2496 @code{@@selector(@dots{})} expression, either explicitly in an
2497 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
2498 an @code{@@implementation} section.  This option always performs its
2499 checks as soon as a @code{@@selector(@dots{})} expression is found,
2500 while @option{-Wselector} only performs its checks in the final stage of
2501 compilation.  This also enforces the coding style convention
2502 that methods and selectors must be declared before being used.
2503
2504 @item -print-objc-runtime-info
2505 @opindex print-objc-runtime-info
2506 Generate C header describing the largest structure that is passed by
2507 value, if any.
2508
2509 @end table
2510
2511 @node Language Independent Options
2512 @section Options to Control Diagnostic Messages Formatting
2513 @cindex options to control diagnostics formatting
2514 @cindex diagnostic messages
2515 @cindex message formatting
2516
2517 Traditionally, diagnostic messages have been formatted irrespective of
2518 the output device's aspect (e.g.@: its width, @dots{}).  The options described
2519 below can be used to control the diagnostic messages formatting
2520 algorithm, e.g.@: how many characters per line, how often source location
2521 information should be reported.  Right now, only the C++ front end can
2522 honor these options.  However it is expected, in the near future, that
2523 the remaining front ends would be able to digest them correctly.
2524
2525 @table @gcctabopt
2526 @item -fmessage-length=@var{n}
2527 @opindex fmessage-length
2528 Try to format error messages so that they fit on lines of about @var{n}
2529 characters.  The default is 72 characters for @command{g++} and 0 for the rest of
2530 the front ends supported by GCC@.  If @var{n} is zero, then no
2531 line-wrapping will be done; each error message will appear on a single
2532 line.
2533
2534 @opindex fdiagnostics-show-location
2535 @item -fdiagnostics-show-location=once
2536 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
2537 reporter to emit @emph{once} source location information; that is, in
2538 case the message is too long to fit on a single physical line and has to
2539 be wrapped, the source location won't be emitted (as prefix) again,
2540 over and over, in subsequent continuation lines.  This is the default
2541 behavior.
2542
2543 @item -fdiagnostics-show-location=every-line
2544 Only meaningful in line-wrapping mode.  Instructs the diagnostic
2545 messages reporter to emit the same source location information (as
2546 prefix) for physical lines that result from the process of breaking
2547 a message which is too long to fit on a single line.
2548
2549 @item -fdiagnostics-show-option
2550 @opindex fdiagnostics-show-option
2551 This option instructs the diagnostic machinery to add text to each
2552 diagnostic emitted, which indicates which command line option directly
2553 controls that diagnostic, when such an option is known to the
2554 diagnostic machinery.
2555
2556 @item -Wcoverage-mismatch
2557 @opindex Wcoverage-mismatch
2558 Warn if feedback profiles do not match when using the
2559 @option{-fprofile-use} option.
2560 If a source file was changed between @option{-fprofile-gen} and
2561 @option{-fprofile-use}, the files with the profile feedback can fail
2562 to match the source file and GCC can not use the profile feedback
2563 information.  By default, GCC emits an error message in this case.
2564 The option @option{-Wcoverage-mismatch} emits a warning instead of an
2565 error.  GCC does not use appropriate feedback profiles, so using this
2566 option can result in poorly optimized code.  This option is useful
2567 only in the case of very minor changes such as bug fixes to an
2568 existing code-base.
2569
2570 @end table
2571
2572 @node Warning Options
2573 @section Options to Request or Suppress Warnings
2574 @cindex options to control warnings
2575 @cindex warning messages
2576 @cindex messages, warning
2577 @cindex suppressing warnings
2578
2579 Warnings are diagnostic messages that report constructions which
2580 are not inherently erroneous but which are risky or suggest there
2581 may have been an error.
2582
2583 The following language-independent options do not enable specific
2584 warnings but control the kinds of diagnostics produced by GCC.
2585
2586 @table @gcctabopt
2587 @cindex syntax checking
2588 @item -fsyntax-only
2589 @opindex fsyntax-only
2590 Check the code for syntax errors, but don't do anything beyond that.
2591
2592 @item -w
2593 @opindex w
2594 Inhibit all warning messages.
2595
2596 @item -Werror
2597 @opindex Werror
2598 @opindex Wno-error
2599 Make all warnings into errors.
2600
2601 @item -Werror=
2602 @opindex Werror=
2603 @opindex Wno-error=
2604 Make the specified warning into an error.  The specifier for a warning
2605 is appended, for example @option{-Werror=switch} turns the warnings
2606 controlled by @option{-Wswitch} into errors.  This switch takes a
2607 negative form, to be used to negate @option{-Werror} for specific
2608 warnings, for example @option{-Wno-error=switch} makes
2609 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
2610 is in effect.  You can use the @option{-fdiagnostics-show-option}
2611 option to have each controllable warning amended with the option which
2612 controls it, to determine what to use with this option.
2613
2614 Note that specifying @option{-Werror=}@var{foo} automatically implies
2615 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
2616 imply anything.
2617
2618 @item -Wfatal-errors
2619 @opindex Wfatal-errors
2620 @opindex Wno-fatal-errors
2621 This option causes the compiler to abort compilation on the first error
2622 occurred rather than trying to keep going and printing further error
2623 messages.
2624
2625 @end table
2626
2627 You can request many specific warnings with options beginning
2628 @samp{-W}, for example @option{-Wimplicit} to request warnings on
2629 implicit declarations.  Each of these specific warning options also
2630 has a negative form beginning @samp{-Wno-} to turn off warnings; for
2631 example, @option{-Wno-implicit}.  This manual lists only one of the
2632 two forms, whichever is not the default.  For further,
2633 language-specific options also refer to @ref{C++ Dialect Options} and
2634 @ref{Objective-C and Objective-C++ Dialect Options}.
2635
2636 @table @gcctabopt
2637 @item -pedantic
2638 @opindex pedantic
2639 Issue all the warnings demanded by strict ISO C and ISO C++;
2640 reject all programs that use forbidden extensions, and some other
2641 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
2642 version of the ISO C standard specified by any @option{-std} option used.
2643
2644 Valid ISO C and ISO C++ programs should compile properly with or without
2645 this option (though a rare few will require @option{-ansi} or a
2646 @option{-std} option specifying the required version of ISO C)@.  However,
2647 without this option, certain GNU extensions and traditional C and C++
2648 features are supported as well.  With this option, they are rejected.
2649
2650 @option{-pedantic} does not cause warning messages for use of the
2651 alternate keywords whose names begin and end with @samp{__}.  Pedantic
2652 warnings are also disabled in the expression that follows
2653 @code{__extension__}.  However, only system header files should use
2654 these escape routes; application programs should avoid them.
2655 @xref{Alternate Keywords}.
2656
2657 Some users try to use @option{-pedantic} to check programs for strict ISO
2658 C conformance.  They soon find that it does not do quite what they want:
2659 it finds some non-ISO practices, but not all---only those for which
2660 ISO C @emph{requires} a diagnostic, and some others for which
2661 diagnostics have been added.
2662
2663 A feature to report any failure to conform to ISO C might be useful in
2664 some instances, but would require considerable additional work and would
2665 be quite different from @option{-pedantic}.  We don't have plans to
2666 support such a feature in the near future.
2667
2668 Where the standard specified with @option{-std} represents a GNU
2669 extended dialect of C, such as @samp{gnu89} or @samp{gnu99}, there is a
2670 corresponding @dfn{base standard}, the version of ISO C on which the GNU
2671 extended dialect is based.  Warnings from @option{-pedantic} are given
2672 where they are required by the base standard.  (It would not make sense
2673 for such warnings to be given only for features not in the specified GNU
2674 C dialect, since by definition the GNU dialects of C include all
2675 features the compiler supports with the given option, and there would be
2676 nothing to warn about.)
2677
2678 @item -pedantic-errors
2679 @opindex pedantic-errors
2680 Like @option{-pedantic}, except that errors are produced rather than
2681 warnings.
2682
2683 @item -Wall
2684 @opindex Wall
2685 @opindex Wno-all
2686 This enables all the warnings about constructions that some users
2687 consider questionable, and that are easy to avoid (or modify to
2688 prevent the warning), even in conjunction with macros.  This also
2689 enables some language-specific warnings described in @ref{C++ Dialect
2690 Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
2691
2692 @option{-Wall} turns on the following warning flags:
2693
2694 @gccoptlist{-Waddress   @gol
2695 -Warray-bounds @r{(only with} @option{-O2}@r{)}  @gol
2696 -Wc++0x-compat  @gol
2697 -Wchar-subscripts  @gol
2698 -Wimplicit-int  @gol
2699 -Wimplicit-function-declaration  @gol
2700 -Wcomment  @gol
2701 -Wformat   @gol
2702 -Wmain @r{(only for C/ObjC and unless} @option{-ffreestanding}@r{)}  @gol
2703 -Wmissing-braces  @gol
2704 -Wnonnull  @gol
2705 -Wparentheses  @gol
2706 -Wpointer-sign  @gol
2707 -Wreorder   @gol
2708 -Wreturn-type  @gol
2709 -Wsequence-point  @gol
2710 -Wsign-compare @r{(only in C++)}  @gol
2711 -Wstrict-aliasing  @gol
2712 -Wstrict-overflow=1  @gol
2713 -Wswitch  @gol
2714 -Wtrigraphs  @gol
2715 -Wuninitialized  @gol
2716 -Wunknown-pragmas  @gol
2717 -Wunused-function  @gol
2718 -Wunused-label     @gol
2719 -Wunused-value     @gol
2720 -Wunused-variable  @gol
2721 -Wvolatile-register-var @gol
2722 }
2723
2724 Note that some warning flags are not implied by @option{-Wall}.  Some of
2725 them warn about constructions that users generally do not consider
2726 questionable, but which occasionally you might wish to check for;
2727 others warn about constructions that are necessary or hard to avoid in
2728 some cases, and there is no simple way to modify the code to suppress
2729 the warning. Some of them are enabled by @option{-Wextra} but many of
2730 them must be enabled individually.
2731
2732 @item -Wextra
2733 @opindex W
2734 @opindex Wextra
2735 @opindex Wno-extra
2736 This enables some extra warning flags that are not enabled by
2737 @option{-Wall}. (This option used to be called @option{-W}.  The older
2738 name is still supported, but the newer name is more descriptive.)
2739
2740 @gccoptlist{-Wclobbered  @gol
2741 -Wempty-body  @gol
2742 -Wignored-qualifiers @gol
2743 -Wmissing-field-initializers  @gol
2744 -Wmissing-parameter-type @r{(C only)}  @gol
2745 -Wold-style-declaration @r{(C only)}  @gol
2746 -Woverride-init  @gol
2747 -Wsign-compare  @gol
2748 -Wtype-limits  @gol
2749 -Wuninitialized  @gol
2750 -Wunused-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)}  @gol
2751 }
2752
2753 The option @option{-Wextra} also prints warning messages for the
2754 following cases:
2755
2756 @itemize @bullet
2757
2758 @item
2759 A pointer is compared against integer zero with @samp{<}, @samp{<=},
2760 @samp{>}, or @samp{>=}.
2761
2762 @item 
2763 (C++ only) An enumerator and a non-enumerator both appear in a
2764 conditional expression.
2765
2766 @item 
2767 (C++ only) Ambiguous virtual bases.
2768
2769 @item 
2770 (C++ only) Subscripting an array which has been declared @samp{register}.
2771
2772 @item 
2773 (C++ only) Taking the address of a variable which has been declared
2774 @samp{register}.
2775
2776 @item 
2777 (C++ only) A base class is not initialized in a derived class' copy
2778 constructor.
2779
2780 @end itemize
2781
2782 @item -Wchar-subscripts
2783 @opindex Wchar-subscripts
2784 @opindex Wno-char-subscripts
2785 Warn if an array subscript has type @code{char}.  This is a common cause
2786 of error, as programmers often forget that this type is signed on some
2787 machines.
2788 This warning is enabled by @option{-Wall}.
2789
2790 @item -Wcomment
2791 @opindex Wcomment
2792 @opindex Wno-comment
2793 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
2794 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
2795 This warning is enabled by @option{-Wall}.
2796
2797 @item -Wformat
2798 @opindex Wformat
2799 @opindex Wno-format
2800 @opindex ffreestanding
2801 @opindex fno-builtin
2802 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
2803 the arguments supplied have types appropriate to the format string
2804 specified, and that the conversions specified in the format string make
2805 sense.  This includes standard functions, and others specified by format
2806 attributes (@pxref{Function Attributes}), in the @code{printf},
2807 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
2808 not in the C standard) families (or other target-specific families).
2809 Which functions are checked without format attributes having been
2810 specified depends on the standard version selected, and such checks of
2811 functions without the attribute specified are disabled by
2812 @option{-ffreestanding} or @option{-fno-builtin}.
2813
2814 The formats are checked against the format features supported by GNU
2815 libc version 2.2.  These include all ISO C90 and C99 features, as well
2816 as features from the Single Unix Specification and some BSD and GNU
2817 extensions.  Other library implementations may not support all these
2818 features; GCC does not support warning about features that go beyond a
2819 particular library's limitations.  However, if @option{-pedantic} is used
2820 with @option{-Wformat}, warnings will be given about format features not
2821 in the selected standard version (but not for @code{strfmon} formats,
2822 since those are not in any version of the C standard).  @xref{C Dialect
2823 Options,,Options Controlling C Dialect}.
2824
2825 Since @option{-Wformat} also checks for null format arguments for
2826 several functions, @option{-Wformat} also implies @option{-Wnonnull}.
2827
2828 @option{-Wformat} is included in @option{-Wall}.  For more control over some
2829 aspects of format checking, the options @option{-Wformat-y2k},
2830 @option{-Wno-format-extra-args}, @option{-Wno-format-zero-length},
2831 @option{-Wformat-nonliteral}, @option{-Wformat-security}, and
2832 @option{-Wformat=2} are available, but are not included in @option{-Wall}.
2833
2834 @item -Wformat-y2k
2835 @opindex Wformat-y2k
2836 @opindex Wno-format-y2k
2837 If @option{-Wformat} is specified, also warn about @code{strftime}
2838 formats which may yield only a two-digit year.
2839
2840 @item -Wno-format-contains-nul
2841 @opindex Wno-format-contains-nul
2842 @opindex Wformat-contains-nul
2843 If @option{-Wformat} is specified, do not warn about format strings that
2844 contain NUL bytes.
2845
2846 @item -Wno-format-extra-args
2847 @opindex Wno-format-extra-args
2848 @opindex Wformat-extra-args
2849 If @option{-Wformat} is specified, do not warn about excess arguments to a
2850 @code{printf} or @code{scanf} format function.  The C standard specifies
2851 that such arguments are ignored.
2852
2853 Where the unused arguments lie between used arguments that are
2854 specified with @samp{$} operand number specifications, normally
2855 warnings are still given, since the implementation could not know what
2856 type to pass to @code{va_arg} to skip the unused arguments.  However,
2857 in the case of @code{scanf} formats, this option will suppress the
2858 warning if the unused arguments are all pointers, since the Single
2859 Unix Specification says that such unused arguments are allowed.
2860
2861 @item -Wno-format-zero-length @r{(C and Objective-C only)}
2862 @opindex Wno-format-zero-length
2863 @opindex Wformat-zero-length
2864 If @option{-Wformat} is specified, do not warn about zero-length formats.
2865 The C standard specifies that zero-length formats are allowed.
2866
2867 @item -Wformat-nonliteral
2868 @opindex Wformat-nonliteral
2869 @opindex Wno-format-nonliteral
2870 If @option{-Wformat} is specified, also warn if the format string is not a
2871 string literal and so cannot be checked, unless the format function
2872 takes its format arguments as a @code{va_list}.
2873
2874 @item -Wformat-security
2875 @opindex Wformat-security
2876 @opindex Wno-format-security
2877 If @option{-Wformat} is specified, also warn about uses of format
2878 functions that represent possible security problems.  At present, this
2879 warns about calls to @code{printf} and @code{scanf} functions where the
2880 format string is not a string literal and there are no format arguments,
2881 as in @code{printf (foo);}.  This may be a security hole if the format
2882 string came from untrusted input and contains @samp{%n}.  (This is
2883 currently a subset of what @option{-Wformat-nonliteral} warns about, but
2884 in future warnings may be added to @option{-Wformat-security} that are not
2885 included in @option{-Wformat-nonliteral}.)
2886
2887 @item -Wformat=2
2888 @opindex Wformat=2
2889 @opindex Wno-format=2
2890 Enable @option{-Wformat} plus format checks not included in
2891 @option{-Wformat}.  Currently equivalent to @samp{-Wformat
2892 -Wformat-nonliteral -Wformat-security -Wformat-y2k}.
2893
2894 @item -Wnonnull @r{(C and Objective-C only)}
2895 @opindex Wnonnull
2896 @opindex Wno-nonnull
2897 Warn about passing a null pointer for arguments marked as
2898 requiring a non-null value by the @code{nonnull} function attribute.
2899
2900 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
2901 can be disabled with the @option{-Wno-nonnull} option.
2902
2903 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
2904 @opindex Winit-self
2905 @opindex Wno-init-self
2906 Warn about uninitialized variables which are initialized with themselves.
2907 Note this option can only be used with the @option{-Wuninitialized} option.
2908
2909 For example, GCC will warn about @code{i} being uninitialized in the
2910 following snippet only when @option{-Winit-self} has been specified:
2911 @smallexample
2912 @group
2913 int f()
2914 @{
2915   int i = i;
2916   return i;
2917 @}
2918 @end group
2919 @end smallexample
2920
2921 @item -Wimplicit-int @r{(C and Objective-C only)}
2922 @opindex Wimplicit-int
2923 @opindex Wno-implicit-int
2924 Warn when a declaration does not specify a type.
2925 This warning is enabled by @option{-Wall}.
2926
2927 @item -Wimplicit-function-declaration @r{(C and Objective-C only)}
2928 @opindex Wimplicit-function-declaration
2929 @opindex Wno-implicit-function-declaration
2930 Give a warning whenever a function is used before being declared. In
2931 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
2932 enabled by default and it is made into an error by
2933 @option{-pedantic-errors}. This warning is also enabled by
2934 @option{-Wall}.
2935
2936 @item -Wimplicit
2937 @opindex Wimplicit
2938 @opindex Wno-implicit
2939 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
2940 This warning is enabled by @option{-Wall}.
2941
2942 @item -Wignored-qualifiers @r{(C and C++ only)}
2943 @opindex Wignored-qualifiers
2944 @opindex Wno-ignored-qualifiers
2945 Warn if the return type of a function has a type qualifier
2946 such as @code{const}.  For ISO C such a type qualifier has no effect,
2947 since the value returned by a function is not an lvalue.
2948 For C++, the warning is only emitted for scalar types or @code{void}.
2949 ISO C prohibits qualified @code{void} return types on function
2950 definitions, so such return types always receive a warning
2951 even without this option.
2952
2953 This warning is also enabled by @option{-Wextra}.
2954
2955 @item -Wmain
2956 @opindex Wmain
2957 @opindex Wno-main
2958 Warn if the type of @samp{main} is suspicious.  @samp{main} should be
2959 a function with external linkage, returning int, taking either zero
2960 arguments, two, or three arguments of appropriate types.  This warning
2961 is enabled by default in C++ and is enabled by either @option{-Wall}
2962 or @option{-pedantic}.
2963
2964 @item -Wmissing-braces
2965 @opindex Wmissing-braces
2966 @opindex Wno-missing-braces
2967 Warn if an aggregate or union initializer is not fully bracketed.  In
2968 the following example, the initializer for @samp{a} is not fully
2969 bracketed, but that for @samp{b} is fully bracketed.
2970
2971 @smallexample
2972 int a[2][2] = @{ 0, 1, 2, 3 @};
2973 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
2974 @end smallexample
2975
2976 This warning is enabled by @option{-Wall}.
2977
2978 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
2979 @opindex Wmissing-include-dirs
2980 @opindex Wno-missing-include-dirs
2981 Warn if a user-supplied include directory does not exist.
2982
2983 @item -Wparentheses
2984 @opindex Wparentheses
2985 @opindex Wno-parentheses
2986 Warn if parentheses are omitted in certain contexts, such
2987 as when there is an assignment in a context where a truth value
2988 is expected, or when operators are nested whose precedence people
2989 often get confused about.
2990
2991 Also warn if a comparison like @samp{x<=y<=z} appears; this is
2992 equivalent to @samp{(x<=y ? 1 : 0) <= z}, which is a different
2993 interpretation from that of ordinary mathematical notation.
2994
2995 Also warn about constructions where there may be confusion to which
2996 @code{if} statement an @code{else} branch belongs.  Here is an example of
2997 such a case:
2998
2999 @smallexample
3000 @group
3001 @{
3002   if (a)
3003     if (b)
3004       foo ();
3005   else
3006     bar ();
3007 @}
3008 @end group
3009 @end smallexample
3010
3011 In C/C++, every @code{else} branch belongs to the innermost possible
3012 @code{if} statement, which in this example is @code{if (b)}.  This is
3013 often not what the programmer expected, as illustrated in the above
3014 example by indentation the programmer chose.  When there is the
3015 potential for this confusion, GCC will issue a warning when this flag
3016 is specified.  To eliminate the warning, add explicit braces around
3017 the innermost @code{if} statement so there is no way the @code{else}
3018 could belong to the enclosing @code{if}.  The resulting code would
3019 look like this:
3020
3021 @smallexample
3022 @group
3023 @{
3024   if (a)
3025     @{
3026       if (b)
3027         foo ();
3028       else
3029         bar ();
3030     @}
3031 @}
3032 @end group
3033 @end smallexample
3034
3035 This warning is enabled by @option{-Wall}.
3036
3037 @item -Wsequence-point
3038 @opindex Wsequence-point
3039 @opindex Wno-sequence-point
3040 Warn about code that may have undefined semantics because of violations
3041 of sequence point rules in the C and C++ standards.
3042
3043 The C and C++ standards defines the order in which expressions in a C/C++
3044 program are evaluated in terms of @dfn{sequence points}, which represent
3045 a partial ordering between the execution of parts of the program: those
3046 executed before the sequence point, and those executed after it.  These
3047 occur after the evaluation of a full expression (one which is not part
3048 of a larger expression), after the evaluation of the first operand of a
3049 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
3050 function is called (but after the evaluation of its arguments and the
3051 expression denoting the called function), and in certain other places.
3052 Other than as expressed by the sequence point rules, the order of
3053 evaluation of subexpressions of an expression is not specified.  All
3054 these rules describe only a partial order rather than a total order,
3055 since, for example, if two functions are called within one expression
3056 with no sequence point between them, the order in which the functions
3057 are called is not specified.  However, the standards committee have
3058 ruled that function calls do not overlap.
3059
3060 It is not specified when between sequence points modifications to the
3061 values of objects take effect.  Programs whose behavior depends on this
3062 have undefined behavior; the C and C++ standards specify that ``Between
3063 the previous and next sequence point an object shall have its stored
3064 value modified at most once by the evaluation of an expression.
3065 Furthermore, the prior value shall be read only to determine the value
3066 to be stored.''.  If a program breaks these rules, the results on any
3067 particular implementation are entirely unpredictable.
3068
3069 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
3070 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
3071 diagnosed by this option, and it may give an occasional false positive
3072 result, but in general it has been found fairly effective at detecting
3073 this sort of problem in programs.
3074
3075 The standard is worded confusingly, therefore there is some debate
3076 over the precise meaning of the sequence point rules in subtle cases.
3077 Links to discussions of the problem, including proposed formal
3078 definitions, may be found on the GCC readings page, at
3079 @w{@uref{http://gcc.gnu.org/readings.html}}.
3080
3081 This warning is enabled by @option{-Wall} for C and C++.
3082
3083 @item -Wreturn-type
3084 @opindex Wreturn-type
3085 @opindex Wno-return-type
3086 Warn whenever a function is defined with a return-type that defaults
3087 to @code{int}.  Also warn about any @code{return} statement with no
3088 return-value in a function whose return-type is not @code{void}
3089 (falling off the end of the function body is considered returning
3090 without a value), and about a @code{return} statement with a
3091 expression in a function whose return-type is @code{void}.
3092
3093 For C++, a function without return type always produces a diagnostic
3094 message, even when @option{-Wno-return-type} is specified.  The only
3095 exceptions are @samp{main} and functions defined in system headers.
3096
3097 This warning is enabled by @option{-Wall}.
3098
3099 @item -Wswitch
3100 @opindex Wswitch
3101 @opindex Wno-switch
3102 Warn whenever a @code{switch} statement has an index of enumerated type
3103 and lacks a @code{case} for one or more of the named codes of that
3104 enumeration.  (The presence of a @code{default} label prevents this
3105 warning.)  @code{case} labels outside the enumeration range also
3106 provoke warnings when this option is used.
3107 This warning is enabled by @option{-Wall}.
3108
3109 @item -Wswitch-default
3110 @opindex Wswitch-default
3111 @opindex Wno-switch-default
3112 Warn whenever a @code{switch} statement does not have a @code{default}
3113 case.
3114
3115 @item -Wswitch-enum
3116 @opindex Wswitch-enum
3117 @opindex Wno-switch-enum
3118 Warn whenever a @code{switch} statement has an index of enumerated type
3119 and lacks a @code{case} for one or more of the named codes of that
3120 enumeration.  @code{case} labels outside the enumeration range also
3121 provoke warnings when this option is used.
3122
3123 @item -Wtrigraphs
3124 @opindex Wtrigraphs
3125 @opindex Wno-trigraphs
3126 Warn if any trigraphs are encountered that might change the meaning of
3127 the program (trigraphs within comments are not warned about).
3128 This warning is enabled by @option{-Wall}.
3129
3130 @item -Wunused-function
3131 @opindex Wunused-function
3132 @opindex Wno-unused-function
3133 Warn whenever a static function is declared but not defined or a
3134 non-inline static function is unused.
3135 This warning is enabled by @option{-Wall}.
3136
3137 @item -Wunused-label
3138 @opindex Wunused-label
3139 @opindex Wno-unused-label
3140 Warn whenever a label is declared but not used.
3141 This warning is enabled by @option{-Wall}.
3142
3143 To suppress this warning use the @samp{unused} attribute
3144 (@pxref{Variable Attributes}).
3145
3146 @item -Wunused-parameter
3147 @opindex Wunused-parameter
3148 @opindex Wno-unused-parameter
3149 Warn whenever a function parameter is unused aside from its declaration.
3150
3151 To suppress this warning use the @samp{unused} attribute
3152 (@pxref{Variable Attributes}).
3153
3154 @item -Wunused-variable
3155 @opindex Wunused-variable
3156 @opindex Wno-unused-variable
3157 Warn whenever a local variable or non-constant static variable is unused
3158 aside from its declaration.
3159 This warning is enabled by @option{-Wall}.
3160
3161 To suppress this warning use the @samp{unused} attribute
3162 (@pxref{Variable Attributes}).
3163
3164 @item -Wunused-value
3165 @opindex Wunused-value
3166 @opindex Wno-unused-value
3167 Warn whenever a statement computes a result that is explicitly not
3168 used. To suppress this warning cast the unused expression to
3169 @samp{void}. This includes an expression-statement or the left-hand
3170 side of a comma expression that contains no side effects. For example,
3171 an expression such as @samp{x[i,j]} will cause a warning, while
3172 @samp{x[(void)i,j]} will not.
3173
3174 This warning is enabled by @option{-Wall}.
3175
3176 @item -Wunused
3177 @opindex Wunused
3178 @opindex Wno-unused
3179 All the above @option{-Wunused} options combined.
3180
3181 In order to get a warning about an unused function parameter, you must
3182 either specify @samp{-Wextra -Wunused} (note that @samp{-Wall} implies
3183 @samp{-Wunused}), or separately specify @option{-Wunused-parameter}.
3184
3185 @item -Wuninitialized
3186 @opindex Wuninitialized
3187 @opindex Wno-uninitialized
3188 Warn if an automatic variable is used without first being initialized
3189 or if a variable may be clobbered by a @code{setjmp} call. In C++,
3190 warn if a non-static reference or non-static @samp{const} member
3191 appears in a class without constructors.
3192
3193 If you want to warn about code which uses the uninitialized value of the
3194 variable in its own initializer, use the @option{-Winit-self} option.
3195
3196 These warnings occur for individual uninitialized or clobbered
3197 elements of structure, union or array variables as well as for
3198 variables which are uninitialized or clobbered as a whole.  They do
3199 not occur for variables or elements declared @code{volatile}.  Because
3200 these warnings depend on optimization, the exact variables or elements
3201 for which there are warnings will depend on the precise optimization
3202 options and version of GCC used.
3203
3204 Note that there may be no warning about a variable that is used only
3205 to compute a value that itself is never used, because such
3206 computations may be deleted by data flow analysis before the warnings
3207 are printed.
3208
3209 These warnings are made optional because GCC is not smart
3210 enough to see all the reasons why the code might be correct
3211 despite appearing to have an error.  Here is one example of how
3212 this can happen:
3213
3214 @smallexample
3215 @group
3216 @{
3217   int x;
3218   switch (y)
3219     @{
3220     case 1: x = 1;
3221       break;
3222     case 2: x = 4;
3223       break;
3224     case 3: x = 5;
3225     @}
3226   foo (x);
3227 @}
3228 @end group
3229 @end smallexample
3230
3231 @noindent
3232 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
3233 always initialized, but GCC doesn't know this.  Here is
3234 another common case:
3235
3236 @smallexample
3237 @{
3238   int save_y;
3239   if (change_y) save_y = y, y = new_y;
3240   @dots{}
3241   if (change_y) y = save_y;
3242 @}
3243 @end smallexample
3244
3245 @noindent
3246 This has no bug because @code{save_y} is used only if it is set.
3247
3248 @cindex @code{longjmp} warnings
3249 This option also warns when a non-volatile automatic variable might be
3250 changed by a call to @code{longjmp}.  These warnings as well are possible
3251 only in optimizing compilation.
3252
3253 The compiler sees only the calls to @code{setjmp}.  It cannot know
3254 where @code{longjmp} will be called; in fact, a signal handler could
3255 call it at any point in the code.  As a result, you may get a warning
3256 even when there is in fact no problem because @code{longjmp} cannot
3257 in fact be called at the place which would cause a problem.
3258
3259 Some spurious warnings can be avoided if you declare all the functions
3260 you use that never return as @code{noreturn}.  @xref{Function
3261 Attributes}.
3262
3263 This warning is enabled by @option{-Wall} or @option{-Wextra}.
3264
3265 @item -Wunknown-pragmas
3266 @opindex Wunknown-pragmas
3267 @opindex Wno-unknown-pragmas
3268 @cindex warning for unknown pragmas
3269 @cindex unknown pragmas, warning
3270 @cindex pragmas, warning of unknown
3271 Warn when a #pragma directive is encountered which is not understood by
3272 GCC@.  If this command line option is used, warnings will even be issued
3273 for unknown pragmas in system header files.  This is not the case if
3274 the warnings were only enabled by the @option{-Wall} command line option.
3275
3276 @item -Wno-pragmas
3277 @opindex Wno-pragmas
3278 @opindex Wpragmas
3279 Do not warn about misuses of pragmas, such as incorrect parameters,
3280 invalid syntax, or conflicts between pragmas.  See also
3281 @samp{-Wunknown-pragmas}.
3282
3283 @item -Wstrict-aliasing
3284 @opindex Wstrict-aliasing
3285 @opindex Wno-strict-aliasing
3286 This option is only active when @option{-fstrict-aliasing} is active.
3287 It warns about code which might break the strict aliasing rules that the
3288 compiler is using for optimization.  The warning does not catch all
3289 cases, but does attempt to catch the more common pitfalls.  It is
3290 included in @option{-Wall}.
3291 It is equivalent to @option{-Wstrict-aliasing=3}
3292
3293 @item -Wstrict-aliasing=n
3294 @opindex Wstrict-aliasing=n
3295 @opindex Wno-strict-aliasing=n
3296 This option is only active when @option{-fstrict-aliasing} is active.
3297 It warns about code which might break the strict aliasing rules that the
3298 compiler is using for optimization.
3299 Higher levels correspond to higher accuracy (fewer false positives).
3300 Higher levels also correspond to more effort, similar to the way -O works.
3301 @option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=n},
3302 with n=3.
3303
3304 Level 1: Most aggressive, quick, least accurate.
3305 Possibly useful when higher levels
3306 do not warn but -fstrict-aliasing still breaks the code, as it has very few 
3307 false negatives.  However, it has many false positives.
3308 Warns for all pointer conversions between possibly incompatible types, 
3309 even if never dereferenced.  Runs in the frontend only.
3310
3311 Level 2: Aggressive, quick, not too precise.
3312 May still have many false positives (not as many as level 1 though),
3313 and few false negatives (but possibly more than level 1).
3314 Unlike level 1, it only warns when an address is taken.  Warns about
3315 incomplete types.  Runs in the frontend only.
3316
3317 Level 3 (default for @option{-Wstrict-aliasing}): 
3318 Should have very few false positives and few false 
3319 negatives.  Slightly slower than levels 1 or 2 when optimization is enabled.
3320 Takes care of the common punn+dereference pattern in the frontend:
3321 @code{*(int*)&some_float}.
3322 If optimization is enabled, it also runs in the backend, where it deals 
3323 with multiple statement cases using flow-sensitive points-to information.
3324 Only warns when the converted pointer is dereferenced.
3325 Does not warn about incomplete types.
3326
3327 @item -Wstrict-overflow
3328 @itemx -Wstrict-overflow=@var{n}
3329 @opindex Wstrict-overflow
3330 @opindex Wno-strict-overflow
3331 This option is only active when @option{-fstrict-overflow} is active.
3332 It warns about cases where the compiler optimizes based on the
3333 assumption that signed overflow does not occur.  Note that it does not
3334 warn about all cases where the code might overflow: it only warns
3335 about cases where the compiler implements some optimization.  Thus
3336 this warning depends on the optimization level.
3337
3338 An optimization which assumes that signed overflow does not occur is
3339 perfectly safe if the values of the variables involved are such that
3340 overflow never does, in fact, occur.  Therefore this warning can
3341 easily give a false positive: a warning about code which is not
3342 actually a problem.  To help focus on important issues, several
3343 warning levels are defined.  No warnings are issued for the use of
3344 undefined signed overflow when estimating how many iterations a loop
3345 will require, in particular when determining whether a loop will be
3346 executed at all.
3347
3348 @table @gcctabopt
3349 @item -Wstrict-overflow=1
3350 Warn about cases which are both questionable and easy to avoid.  For
3351 example: @code{x + 1 > x}; with @option{-fstrict-overflow}, the
3352 compiler will simplify this to @code{1}.  This level of
3353 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
3354 are not, and must be explicitly requested.
3355
3356 @item -Wstrict-overflow=2
3357 Also warn about other cases where a comparison is simplified to a
3358 constant.  For example: @code{abs (x) >= 0}.  This can only be
3359 simplified when @option{-fstrict-overflow} is in effect, because
3360 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
3361 zero.  @option{-Wstrict-overflow} (with no level) is the same as
3362 @option{-Wstrict-overflow=2}.
3363
3364 @item -Wstrict-overflow=3
3365 Also warn about other cases where a comparison is simplified.  For
3366 example: @code{x + 1 > 1} will be simplified to @code{x > 0}.
3367
3368 @item -Wstrict-overflow=4
3369 Also warn about other simplifications not covered by the above cases.
3370 For example: @code{(x * 10) / 5} will be simplified to @code{x * 2}.
3371
3372 @item -Wstrict-overflow=5
3373 Also warn about cases where the compiler reduces the magnitude of a
3374 constant involved in a comparison.  For example: @code{x + 2 > y} will
3375 be simplified to @code{x + 1 >= y}.  This is reported only at the
3376 highest warning level because this simplification applies to many
3377 comparisons, so this warning level will give a very large number of
3378 false positives.
3379 @end table
3380
3381 @item -Warray-bounds
3382 @opindex Wno-array-bounds
3383 @opindex Warray-bounds
3384 This option is only active when @option{-ftree-vrp} is active
3385 (default for -O2 and above). It warns about subscripts to arrays
3386 that are always out of bounds. This warning is enabled by @option{-Wall}.
3387
3388 @item -Wno-div-by-zero
3389 @opindex Wno-div-by-zero
3390 @opindex Wdiv-by-zero
3391 Do not warn about compile-time integer division by zero.  Floating point
3392 division by zero is not warned about, as it can be a legitimate way of
3393 obtaining infinities and NaNs.
3394
3395 @item -Wsystem-headers
3396 @opindex Wsystem-headers
3397 @opindex Wno-system-headers
3398 @cindex warnings from system headers
3399 @cindex system headers, warnings from
3400 Print warning messages for constructs found in system header files.
3401 Warnings from system headers are normally suppressed, on the assumption
3402 that they usually do not indicate real problems and would only make the
3403 compiler output harder to read.  Using this command line option tells
3404 GCC to emit warnings from system headers as if they occurred in user
3405 code.  However, note that using @option{-Wall} in conjunction with this
3406 option will @emph{not} warn about unknown pragmas in system
3407 headers---for that, @option{-Wunknown-pragmas} must also be used.
3408
3409 @item -Wfloat-equal
3410 @opindex Wfloat-equal
3411 @opindex Wno-float-equal
3412 Warn if floating point values are used in equality comparisons.
3413
3414 The idea behind this is that sometimes it is convenient (for the
3415 programmer) to consider floating-point values as approximations to
3416 infinitely precise real numbers.  If you are doing this, then you need
3417 to compute (by analyzing the code, or in some other way) the maximum or
3418 likely maximum error that the computation introduces, and allow for it
3419 when performing comparisons (and when producing output, but that's a
3420 different problem).  In particular, instead of testing for equality, you
3421 would check to see whether the two values have ranges that overlap; and
3422 this is done with the relational operators, so equality comparisons are
3423 probably mistaken.
3424
3425 @item -Wtraditional @r{(C and Objective-C only)}
3426 @opindex Wtraditional
3427 @opindex Wno-traditional
3428 Warn about certain constructs that behave differently in traditional and
3429 ISO C@.  Also warn about ISO C constructs that have no traditional C
3430 equivalent, and/or problematic constructs which should be avoided.
3431
3432 @itemize @bullet
3433 @item
3434 Macro parameters that appear within string literals in the macro body.
3435 In traditional C macro replacement takes place within string literals,
3436 but does not in ISO C@.
3437
3438 @item
3439 In traditional C, some preprocessor directives did not exist.
3440 Traditional preprocessors would only consider a line to be a directive
3441 if the @samp{#} appeared in column 1 on the line.  Therefore
3442 @option{-Wtraditional} warns about directives that traditional C
3443 understands but would ignore because the @samp{#} does not appear as the
3444 first character on the line.  It also suggests you hide directives like
3445 @samp{#pragma} not understood by traditional C by indenting them.  Some
3446 traditional implementations would not recognize @samp{#elif}, so it
3447 suggests avoiding it altogether.
3448
3449 @item
3450 A function-like macro that appears without arguments.
3451
3452 @item
3453 The unary plus operator.
3454
3455 @item
3456 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating point
3457 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
3458 constants.)  Note, these suffixes appear in macros defined in the system
3459 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
3460 Use of these macros in user code might normally lead to spurious
3461 warnings, however GCC's integrated preprocessor has enough context to
3462 avoid warning in these cases.
3463
3464 @item
3465 A function declared external in one block and then used after the end of
3466 the block.
3467
3468 @item
3469 A @code{switch} statement has an operand of type @code{long}.
3470
3471 @item
3472 A non-@code{static} function declaration follows a @code{static} one.
3473 This construct is not accepted by some traditional C compilers.
3474
3475 @item
3476 The ISO type of an integer constant has a different width or
3477 signedness from its traditional type.  This warning is only issued if
3478 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
3479 typically represent bit patterns, are not warned about.
3480
3481 @item
3482 Usage of ISO string concatenation is detected.
3483
3484 @item
3485 Initialization of automatic aggregates.
3486
3487 @item
3488 Identifier conflicts with labels.  Traditional C lacks a separate
3489 namespace for labels.
3490
3491 @item
3492 Initialization of unions.  If the initializer is zero, the warning is
3493 omitted.  This is done under the assumption that the zero initializer in
3494 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
3495 initializer warnings and relies on default initialization to zero in the
3496 traditional C case.
3497
3498 @item
3499 Conversions by prototypes between fixed/floating point values and vice
3500 versa.  The absence of these prototypes when compiling with traditional
3501 C would cause serious problems.  This is a subset of the possible
3502 conversion warnings, for the full set use @option{-Wtraditional-conversion}.
3503
3504 @item
3505 Use of ISO C style function definitions.  This warning intentionally is
3506 @emph{not} issued for prototype declarations or variadic functions
3507 because these ISO C features will appear in your code when using
3508 libiberty's traditional C compatibility macros, @code{PARAMS} and
3509 @code{VPARAMS}.  This warning is also bypassed for nested functions
3510 because that feature is already a GCC extension and thus not relevant to
3511 traditional C compatibility.
3512 @end itemize
3513
3514 @item -Wtraditional-conversion @r{(C and Objective-C only)}
3515 @opindex Wtraditional-conversion
3516 @opindex Wno-traditional-conversion
3517 Warn if a prototype causes a type conversion that is different from what
3518 would happen to the same argument in the absence of a prototype.  This
3519 includes conversions of fixed point to floating and vice versa, and
3520 conversions changing the width or signedness of a fixed point argument
3521 except when the same as the default promotion.
3522
3523 @item -Wdeclaration-after-statement @r{(C and Objective-C only)}
3524 @opindex Wdeclaration-after-statement
3525 @opindex Wno-declaration-after-statement
3526 Warn when a declaration is found after a statement in a block.  This
3527 construct, known from C++, was introduced with ISO C99 and is by default
3528 allowed in GCC@.  It is not supported by ISO C90 and was not supported by
3529 GCC versions before GCC 3.0.  @xref{Mixed Declarations}.
3530
3531 @item -Wundef
3532 @opindex Wundef
3533 @opindex Wno-undef
3534 Warn if an undefined identifier is evaluated in an @samp{#if} directive.
3535
3536 @item -Wno-endif-labels
3537 @opindex Wno-endif-labels
3538 @opindex Wendif-labels
3539 Do not warn whenever an @samp{#else} or an @samp{#endif} are followed by text.
3540
3541 @item -Wshadow
3542 @opindex Wshadow
3543 @opindex Wno-shadow
3544 Warn whenever a local variable shadows another local variable, parameter or
3545 global variable or whenever a built-in function is shadowed.
3546
3547 @item -Wlarger-than=@var{len}
3548 @opindex Wlarger-than=@var{len}
3549 @opindex Wlarger-than-@var{len}
3550 Warn whenever an object of larger than @var{len} bytes is defined.
3551
3552 @item -Wframe-larger-than=@var{len}
3553 @opindex Wframe-larger-than
3554 Warn if the size of a function frame is larger than @var{len} bytes.
3555 The computation done to determine the stack frame size is approximate
3556 and not conservative.
3557 The actual requirements may be somewhat greater than @var{len}
3558 even if you do not get a warning.  In addition, any space allocated
3559 via @code{alloca}, variable-length arrays, or related constructs
3560 is not included by the compiler when determining
3561 whether or not to issue a warning.
3562
3563 @item -Wunsafe-loop-optimizations
3564 @opindex Wunsafe-loop-optimizations
3565 @opindex Wno-unsafe-loop-optimizations
3566 Warn if the loop cannot be optimized because the compiler could not
3567 assume anything on the bounds of the loop indices.  With
3568 @option{-funsafe-loop-optimizations} warn if the compiler made
3569 such assumptions.
3570
3571 @item -Wpointer-arith
3572 @opindex Wpointer-arith
3573 @opindex Wno-pointer-arith
3574 Warn about anything that depends on the ``size of'' a function type or
3575 of @code{void}.  GNU C assigns these types a size of 1, for
3576 convenience in calculations with @code{void *} pointers and pointers
3577 to functions.  In C++, warn also when an arithmetic operation involves
3578 @code{NULL}.  This warning is also enabled by @option{-pedantic}.
3579
3580 @item -Wtype-limits
3581 @opindex Wtype-limits
3582 @opindex Wno-type-limits
3583 Warn if a comparison is always true or always false due to the limited
3584 range of the data type, but do not warn for constant expressions.  For
3585 example, warn if an unsigned variable is compared against zero with
3586 @samp{<} or @samp{>=}.  This warning is also enabled by
3587 @option{-Wextra}.
3588
3589 @item -Wbad-function-cast @r{(C and Objective-C only)}
3590 @opindex Wbad-function-cast
3591 @opindex Wno-bad-function-cast
3592 Warn whenever a function call is cast to a non-matching type.
3593 For example, warn if @code{int malloc()} is cast to @code{anything *}.
3594
3595 @item -Wc++-compat @r{(C and Objective-C only)}
3596 Warn about ISO C constructs that are outside of the common subset of
3597 ISO C and ISO C++, e.g.@: request for implicit conversion from
3598 @code{void *} to a pointer to non-@code{void} type.
3599
3600 @item -Wc++0x-compat @r{(C++ and Objective-C++ only)}
3601 Warn about C++ constructs whose meaning differs between ISO C++ 1998 and
3602 ISO C++ 200x, e.g., identifiers in ISO C++ 1998 that will become keywords
3603 in ISO C++ 200x.  This warning is enabled by @option{-Wall}.
3604
3605 @item -Wcast-qual
3606 @opindex Wcast-qual
3607 @opindex Wno-cast-qual
3608 Warn whenever a pointer is cast so as to remove a type qualifier from
3609 the target type.  For example, warn if a @code{const char *} is cast
3610 to an ordinary @code{char *}.
3611
3612 @item -Wcast-align
3613 @opindex Wcast-align
3614 @opindex Wno-cast-align
3615 Warn whenever a pointer is cast such that the required alignment of the
3616 target is increased.  For example, warn if a @code{char *} is cast to
3617 an @code{int *} on machines where integers can only be accessed at
3618 two- or four-byte boundaries.
3619
3620 @item -Wwrite-strings
3621 @opindex Wwrite-strings
3622 @opindex Wno-write-strings
3623 When compiling C, give string constants the type @code{const
3624 char[@var{length}]} so that copying the address of one into a
3625 non-@code{const} @code{char *} pointer will get a warning.  These
3626 warnings will help you find at compile time code that can try to write
3627 into a string constant, but only if you have been very careful about
3628 using @code{const} in declarations and prototypes.  Otherwise, it will
3629 just be a nuisance. This is why we did not make @option{-Wall} request
3630 these warnings.
3631
3632 When compiling C++, warn about the deprecated conversion from string
3633 literals to @code{char *}.  This warning is enabled by default for C++
3634 programs.
3635
3636 @item -Wclobbered
3637 @opindex Wclobbered
3638 @opindex Wno-clobbered
3639 Warn for variables that might be changed by @samp{longjmp} or
3640 @samp{vfork}.  This warning is also enabled by @option{-Wextra}.
3641
3642 @item -Wconversion
3643 @opindex Wconversion
3644 @opindex Wno-conversion
3645 Warn for implicit conversions that may alter a value. This includes
3646 conversions between real and integer, like @code{abs (x)} when
3647 @code{x} is @code{double}; conversions between signed and unsigned,
3648 like @code{unsigned ui = -1}; and conversions to smaller types, like
3649 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
3650 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
3651 changed by the conversion like in @code{abs (2.0)}.  Warnings about
3652 conversions between signed and unsigned integers can be disabled by
3653 using @option{-Wno-sign-conversion}.
3654
3655 For C++, also warn for conversions between @code{NULL} and non-pointer
3656 types; confusing overload resolution for user-defined conversions; and
3657 conversions that will never use a type conversion operator:
3658 conversions to @code{void}, the same type, a base class or a reference
3659 to them. Warnings about conversions between signed and unsigned
3660 integers are disabled by default in C++ unless
3661 @option{-Wsign-conversion} is explicitly enabled.
3662
3663 @item -Wempty-body
3664 @opindex Wempty-body
3665 @opindex Wno-empty-body
3666 Warn if an empty body occurs in an @samp{if}, @samp{else} or @samp{do
3667 while} statement.  Additionally, in C++, warn when an empty body occurs
3668 in a @samp{while} or @samp{for} statement with no whitespacing before
3669 the semicolon.  This warning is also enabled by @option{-Wextra}.
3670
3671 @item -Wenum-compare @r{(C++ and Objective-C++ only)}
3672 @opindex Wenum-compare
3673 @opindex Wno-enum-compare
3674 Warn about a comparison between values of different enum types. This
3675 warning is enabled by default.
3676
3677 @item -Wsign-compare
3678 @opindex Wsign-compare
3679 @opindex Wno-sign-compare
3680 @cindex warning for comparison of signed and unsigned values
3681 @cindex comparison of signed and unsigned values, warning
3682 @cindex signed and unsigned values, comparison warning
3683 Warn when a comparison between signed and unsigned values could produce
3684 an incorrect result when the signed value is converted to unsigned.
3685 This warning is also enabled by @option{-Wextra}; to get the other warnings
3686 of @option{-Wextra} without this warning, use @samp{-Wextra -Wno-sign-compare}.
3687
3688 @item -Wsign-conversion
3689 @opindex Wsign-conversion
3690 @opindex Wno-sign-conversion
3691 Warn for implicit conversions that may change the sign of an integer
3692 value, like assigning a signed integer expression to an unsigned
3693 integer variable. An explicit cast silences the warning. In C, this
3694 option is enabled also by @option{-Wconversion}.
3695
3696 @item -Waddress
3697 @opindex Waddress
3698 @opindex Wno-address
3699 Warn about suspicious uses of memory addresses. These include using
3700 the address of a function in a conditional expression, such as
3701 @code{void func(void); if (func)}, and comparisons against the memory
3702 address of a string literal, such as @code{if (x == "abc")}.  Such
3703 uses typically indicate a programmer error: the address of a function
3704 always evaluates to true, so their use in a conditional usually
3705 indicate that the programmer forgot the parentheses in a function
3706 call; and comparisons against string literals result in unspecified
3707 behavior and are not portable in C, so they usually indicate that the
3708 programmer intended to use @code{strcmp}.  This warning is enabled by
3709 @option{-Wall}.
3710
3711 @item -Wlogical-op
3712 @opindex Wlogical-op
3713 @opindex Wno-logical-op
3714 Warn about suspicious uses of logical operators in expressions.
3715 This includes using logical operators in contexts where a
3716 bit-wise operator is likely to be expected.
3717
3718 @item -Waggregate-return
3719 @opindex Waggregate-return
3720 @opindex Wno-aggregate-return
3721 Warn if any functions that return structures or unions are defined or
3722 called.  (In languages where you can return an array, this also elicits
3723 a warning.)
3724
3725 @item -Wno-attributes
3726 @opindex Wno-attributes
3727 @opindex Wattributes
3728 Do not warn if an unexpected @code{__attribute__} is used, such as
3729 unrecognized attributes, function attributes applied to variables,
3730 etc.  This will not stop errors for incorrect use of supported
3731 attributes.
3732
3733 @item -Wstrict-prototypes @r{(C and Objective-C only)}
3734 @opindex Wstrict-prototypes
3735 @opindex Wno-strict-prototypes
3736 Warn if a function is declared or defined without specifying the
3737 argument types.  (An old-style function definition is permitted without
3738 a warning if preceded by a declaration which specifies the argument
3739 types.)
3740
3741 @item -Wold-style-declaration @r{(C and Objective-C only)}
3742 @opindex Wold-style-declaration
3743 @opindex Wno-old-style-declaration
3744 Warn for obsolescent usages, according to the C Standard, in a
3745 declaration. For example, warn if storage-class specifiers like
3746 @code{static} are not the first things in a declaration.  This warning
3747 is also enabled by @option{-Wextra}.
3748
3749 @item -Wold-style-definition @r{(C and Objective-C only)}
3750 @opindex Wold-style-definition
3751 @opindex Wno-old-style-definition
3752 Warn if an old-style function definition is used.  A warning is given
3753 even if there is a previous prototype.
3754
3755 @item -Wmissing-parameter-type @r{(C and Objective-C only)}
3756 @opindex Wmissing-parameter-type
3757 @opindex Wno-missing-parameter-type
3758 A function parameter is declared without a type specifier in K&R-style
3759 functions:
3760
3761 @smallexample
3762 void foo(bar) @{ @}
3763 @end smallexample
3764
3765 This warning is also enabled by @option{-Wextra}.
3766
3767 @item -Wmissing-prototypes @r{(C and Objective-C only)}
3768 @opindex Wmissing-prototypes
3769 @opindex Wno-missing-prototypes
3770 Warn if a global function is defined without a previous prototype
3771 declaration.  This warning is issued even if the definition itself
3772 provides a prototype.  The aim is to detect global functions that fail
3773 to be declared in header files.
3774
3775 @item -Wmissing-declarations
3776 @opindex Wmissing-declarations
3777 @opindex Wno-missing-declarations
3778 Warn if a global function is defined without a previous declaration.
3779 Do so even if the definition itself provides a prototype.
3780 Use this option to detect global functions that are not declared in
3781 header files.  In C++, no warnings are issued for function templates,
3782 or for inline functions, or for functions in anonymous namespaces.
3783
3784 @item -Wmissing-field-initializers
3785 @opindex Wmissing-field-initializers
3786 @opindex Wno-missing-field-initializers
3787 @opindex W
3788 @opindex Wextra
3789 @opindex Wno-extra
3790 Warn if a structure's initializer has some fields missing.  For
3791 example, the following code would cause such a warning, because
3792 @code{x.h} is implicitly zero:
3793
3794 @smallexample
3795 struct s @{ int f, g, h; @};
3796 struct s x = @{ 3, 4 @};
3797 @end smallexample
3798
3799 This option does not warn about designated initializers, so the following
3800 modification would not trigger a warning:
3801
3802 @smallexample
3803 struct s @{ int f, g, h; @};
3804 struct s x = @{ .f = 3, .g = 4 @};
3805 @end smallexample
3806
3807 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
3808 warnings without this one, use @samp{-Wextra -Wno-missing-field-initializers}.
3809
3810 @item -Wmissing-noreturn
3811 @opindex Wmissing-noreturn
3812 @opindex Wno-missing-noreturn
3813 Warn about functions which might be candidates for attribute @code{noreturn}.
3814 Note these are only possible candidates, not absolute ones.  Care should
3815 be taken to manually verify functions actually do not ever return before
3816 adding the @code{noreturn} attribute, otherwise subtle code generation
3817 bugs could be introduced.  You will not get a warning for @code{main} in
3818 hosted C environments.
3819
3820 @item -Wmissing-format-attribute
3821 @opindex Wmissing-format-attribute
3822 @opindex Wno-missing-format-attribute
3823 @opindex Wformat
3824 @opindex Wno-format
3825 Warn about function pointers which might be candidates for @code{format}
3826 attributes.  Note these are only possible candidates, not absolute ones.
3827 GCC will guess that function pointers with @code{format} attributes that
3828 are used in assignment, initialization, parameter passing or return
3829 statements should have a corresponding @code{format} attribute in the
3830 resulting type.  I.e.@: the left-hand side of the assignment or
3831 initialization, the type of the parameter variable, or the return type
3832 of the containing function respectively should also have a @code{format}
3833 attribute to avoid the warning.
3834
3835 GCC will also warn about function definitions which might be
3836 candidates for @code{format} attributes.  Again, these are only
3837 possible candidates.  GCC will guess that @code{format} attributes
3838 might be appropriate for any function that calls a function like
3839 @code{vprintf} or @code{vscanf}, but this might not always be the
3840 case, and some functions for which @code{format} attributes are
3841 appropriate may not be detected.
3842
3843 @item -Wno-multichar
3844 @opindex Wno-multichar
3845 @opindex Wmultichar
3846 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
3847 Usually they indicate a typo in the user's code, as they have
3848 implementation-defined values, and should not be used in portable code.
3849
3850 @item -Wnormalized=<none|id|nfc|nfkc>
3851 @opindex Wnormalized=
3852 @cindex NFC
3853 @cindex NFKC
3854 @cindex character set, input normalization
3855 In ISO C and ISO C++, two identifiers are different if they are
3856 different sequences of characters.  However, sometimes when characters
3857 outside the basic ASCII character set are used, you can have two
3858 different character sequences that look the same.  To avoid confusion,
3859 the ISO 10646 standard sets out some @dfn{normalization rules} which
3860 when applied ensure that two sequences that look the same are turned into
3861 the same sequence.  GCC can warn you if you are using identifiers which
3862 have not been normalized; this option controls that warning.
3863
3864 There are four levels of warning that GCC supports.  The default is
3865 @option{-Wnormalized=nfc}, which warns about any identifier which is
3866 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
3867 recommended form for most uses.
3868
3869 Unfortunately, there are some characters which ISO C and ISO C++ allow
3870 in identifiers that when turned into NFC aren't allowable as
3871 identifiers.  That is, there's no way to use these symbols in portable
3872 ISO C or C++ and have all your identifiers in NFC@.
3873 @option{-Wnormalized=id} suppresses the warning for these characters.
3874 It is hoped that future versions of the standards involved will correct
3875 this, which is why this option is not the default.
3876
3877 You can switch the warning off for all characters by writing
3878 @option{-Wnormalized=none}.  You would only want to do this if you
3879 were using some other normalization scheme (like ``D''), because
3880 otherwise you can easily create bugs that are literally impossible to see.
3881
3882 Some characters in ISO 10646 have distinct meanings but look identical
3883 in some fonts or display methodologies, especially once formatting has
3884 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
3885 LETTER N'', will display just like a regular @code{n} which has been
3886 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
3887 normalization scheme to convert all these into a standard form as
3888 well, and GCC will warn if your code is not in NFKC if you use
3889 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
3890 about every identifier that contains the letter O because it might be
3891 confused with the digit 0, and so is not the default, but may be
3892 useful as a local coding convention if the programming environment is
3893 unable to be fixed to display these characters distinctly.
3894
3895 @item -Wno-deprecated
3896 @opindex Wno-deprecated
3897 @opindex Wdeprecated
3898 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
3899
3900 @item -Wno-deprecated-declarations
3901 @opindex Wno-deprecated-declarations
3902 @opindex Wdeprecated-declarations
3903 Do not warn about uses of functions (@pxref{Function Attributes}),
3904 variables (@pxref{Variable Attributes}), and types (@pxref{Type
3905 Attributes}) marked as deprecated by using the @code{deprecated}
3906 attribute.
3907
3908 @item -Wno-overflow
3909 @opindex Wno-overflow
3910 @opindex Woverflow
3911 Do not warn about compile-time overflow in constant expressions.
3912
3913 @item -Woverride-init @r{(C and Objective-C only)}
3914 @opindex Woverride-init
3915 @opindex Wno-override-init
3916 @opindex W
3917 @opindex Wextra
3918 @opindex Wno-extra
3919 Warn if an initialized field without side effects is overridden when
3920 using designated initializers (@pxref{Designated Inits, , Designated
3921 Initializers}).
3922
3923 This warning is included in @option{-Wextra}.  To get other
3924 @option{-Wextra} warnings without this one, use @samp{-Wextra
3925 -Wno-override-init}.
3926
3927 @item -Wpacked
3928 @opindex Wpacked
3929 @opindex Wno-packed
3930 Warn if a structure is given the packed attribute, but the packed
3931 attribute has no effect on the layout or size of the structure.
3932 Such structures may be mis-aligned for little benefit.  For
3933 instance, in this code, the variable @code{f.x} in @code{struct bar}
3934 will be misaligned even though @code{struct bar} does not itself
3935 have the packed attribute:
3936
3937 @smallexample
3938 @group
3939 struct foo @{
3940   int x;
3941   char a, b, c, d;
3942 @} __attribute__((packed));
3943 struct bar @{
3944   char z;
3945   struct foo f;
3946 @};
3947 @end group
3948 @end smallexample
3949
3950 @item -Wpadded
3951 @opindex Wpadded
3952 @opindex Wno-padded
3953 Warn if padding is included in a structure, either to align an element
3954 of the structure or to align the whole structure.  Sometimes when this
3955 happens it is possible to rearrange the fields of the structure to
3956 reduce the padding and so make the structure smaller.
3957
3958 @item -Wredundant-decls
3959 @opindex Wredundant-decls
3960 @opindex Wno-redundant-decls
3961 Warn if anything is declared more than once in the same scope, even in
3962 cases where multiple declaration is valid and changes nothing.
3963
3964 @item -Wnested-externs @r{(C and Objective-C only)}
3965 @opindex Wnested-externs
3966 @opindex Wno-nested-externs
3967 Warn if an @code{extern} declaration is encountered within a function.
3968
3969 @item -Wunreachable-code
3970 @opindex Wunreachable-code
3971 @opindex Wno-unreachable-code
3972 Warn if the compiler detects that code will never be executed.
3973
3974 This option is intended to warn when the compiler detects that at
3975 least a whole line of source code will never be executed, because
3976 some condition is never satisfied or because it is after a
3977 procedure that never returns.
3978
3979 It is possible for this option to produce a warning even though there
3980 are circumstances under which part of the affected line can be executed,
3981 so care should be taken when removing apparently-unreachable code.
3982
3983 For instance, when a function is inlined, a warning may mean that the
3984 line is unreachable in only one inlined copy of the function.
3985
3986 This option is not made part of @option{-Wall} because in a debugging
3987 version of a program there is often substantial code which checks
3988 correct functioning of the program and is, hopefully, unreachable
3989 because the program does work.  Another common use of unreachable
3990 code is to provide behavior which is selectable at compile-time.
3991
3992 @item -Winline
3993 @opindex Winline
3994 @opindex Wno-inline
3995 Warn if a function can not be inlined and it was declared as inline.
3996 Even with this option, the compiler will not warn about failures to
3997 inline functions declared in system headers.
3998
3999 The compiler uses a variety of heuristics to determine whether or not
4000 to inline a function.  For example, the compiler takes into account
4001 the size of the function being inlined and the amount of inlining
4002 that has already been done in the current function.  Therefore,
4003 seemingly insignificant changes in the source program can cause the
4004 warnings produced by @option{-Winline} to appear or disappear.
4005
4006 @item -Wno-invalid-offsetof @r{(C++ and Objective-C++ only)}
4007 @opindex Wno-invalid-offsetof
4008 @opindex Winvalid-offsetof
4009 Suppress warnings from applying the @samp{offsetof} macro to a non-POD
4010 type.  According to the 1998 ISO C++ standard, applying @samp{offsetof}
4011 to a non-POD type is undefined.  In existing C++ implementations,
4012 however, @samp{offsetof} typically gives meaningful results even when
4013 applied to certain kinds of non-POD types. (Such as a simple
4014 @samp{struct} that fails to be a POD type only by virtue of having a
4015 constructor.)  This flag is for users who are aware that they are
4016 writing nonportable code and who have deliberately chosen to ignore the
4017 warning about it.
4018
4019 The restrictions on @samp{offsetof} may be relaxed in a future version
4020 of the C++ standard.
4021
4022 @item -Wno-int-to-pointer-cast @r{(C and Objective-C only)}
4023 @opindex Wno-int-to-pointer-cast
4024 @opindex Wint-to-pointer-cast
4025 Suppress warnings from casts to pointer type of an integer of a
4026 different size.
4027
4028 @item -Wno-pointer-to-int-cast @r{(C and Objective-C only)}
4029 @opindex Wno-pointer-to-int-cast
4030 @opindex Wpointer-to-int-cast
4031 Suppress warnings from casts from a pointer to an integer type of a
4032 different size.
4033
4034 @item -Winvalid-pch
4035 @opindex Winvalid-pch
4036 @opindex Wno-invalid-pch
4037 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
4038 the search path but can't be used.
4039
4040 @item -Wlong-long
4041 @opindex Wlong-long
4042 @opindex Wno-long-long
4043 Warn if @samp{long long} type is used.  This is default.  To inhibit
4044 the warning messages, use @option{-Wno-long-long}.  Flags
4045 @option{-Wlong-long} and @option{-Wno-long-long} are taken into account
4046 only when @option{-pedantic} flag is used.
4047
4048 @item -Wvariadic-macros
4049 @opindex Wvariadic-macros
4050 @opindex Wno-variadic-macros
4051 Warn if variadic macros are used in pedantic ISO C90 mode, or the GNU
4052 alternate syntax when in pedantic ISO C99 mode.  This is default.
4053 To inhibit the warning messages, use @option{-Wno-variadic-macros}.
4054
4055 @item -Wvla
4056 @opindex Wvla
4057 @opindex Wno-vla
4058 Warn if variable length array is used in the code.
4059 @option{-Wno-vla} will prevent the @option{-pedantic} warning of
4060 the variable length array.
4061
4062 @item -Wvolatile-register-var
4063 @opindex Wvolatile-register-var
4064 @opindex Wno-volatile-register-var
4065 Warn if a register variable is declared volatile.  The volatile
4066 modifier does not inhibit all optimizations that may eliminate reads
4067 and/or writes to register variables.  This warning is enabled by
4068 @option{-Wall}.
4069
4070 @item -Wdisabled-optimization
4071 @opindex Wdisabled-optimization
4072 @opindex Wno-disabled-optimization
4073 Warn if a requested optimization pass is disabled.  This warning does
4074 not generally indicate that there is anything wrong with your code; it
4075 merely indicates that GCC's optimizers were unable to handle the code
4076 effectively.  Often, the problem is that your code is too big or too
4077 complex; GCC will refuse to optimize programs when the optimization
4078 itself is likely to take inordinate amounts of time.
4079
4080 @item -Wpointer-sign @r{(C and Objective-C only)}
4081 @opindex Wpointer-sign
4082 @opindex Wno-pointer-sign
4083 Warn for pointer argument passing or assignment with different signedness.
4084 This option is only supported for C and Objective-C@.  It is implied by
4085 @option{-Wall} and by @option{-pedantic}, which can be disabled with
4086 @option{-Wno-pointer-sign}.
4087
4088 @item -Wstack-protector
4089 @opindex Wstack-protector
4090 @opindex Wno-stack-protector
4091 This option is only active when @option{-fstack-protector} is active.  It
4092 warns about functions that will not be protected against stack smashing.
4093
4094 @item -Wno-mudflap
4095 @opindex Wno-mudflap
4096 Suppress warnings about constructs that cannot be instrumented by
4097 @option{-fmudflap}.
4098
4099 @item -Woverlength-strings
4100 @opindex Woverlength-strings
4101 @opindex Wno-overlength-strings
4102 Warn about string constants which are longer than the ``minimum
4103 maximum'' length specified in the C standard.  Modern compilers
4104 generally allow string constants which are much longer than the
4105 standard's minimum limit, but very portable programs should avoid
4106 using longer strings.
4107
4108 The limit applies @emph{after} string constant concatenation, and does
4109 not count the trailing NUL@.  In C89, the limit was 509 characters; in
4110 C99, it was raised to 4095.  C++98 does not specify a normative
4111 minimum maximum, so we do not diagnose overlength strings in C++@.
4112
4113 This option is implied by @option{-pedantic}, and can be disabled with
4114 @option{-Wno-overlength-strings}.
4115
4116 @item -Wdisallowed-function-list=@var{sym},@var{sym},@dots{}
4117 @opindex Wdisallowed-function-list
4118
4119 If any of @var{sym} is called, GCC will issue a warning. This can be useful
4120 in enforcing coding conventions that ban calls to certain functions, for
4121 example, @code{alloca}, @code{malloc}, etc.
4122 @end table
4123
4124 @node Debugging Options
4125 @section Options for Debugging Your Program or GCC
4126 @cindex options, debugging
4127 @cindex debugging information options
4128
4129 GCC has various special options that are used for debugging
4130 either your program or GCC:
4131
4132 @table @gcctabopt
4133 @item -g
4134 @opindex g
4135 Produce debugging information in the operating system's native format
4136 (stabs, COFF, XCOFF, or DWARF 2)@.  GDB can work with this debugging
4137 information.
4138
4139 On most systems that use stabs format, @option{-g} enables use of extra
4140 debugging information that only GDB can use; this extra information
4141 makes debugging work better in GDB but will probably make other debuggers
4142 crash or
4143 refuse to read the program.  If you want to control for certain whether
4144 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
4145 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
4146
4147 GCC allows you to use @option{-g} with
4148 @option{-O}.  The shortcuts taken by optimized code may occasionally
4149 produce surprising results: some variables you declared may not exist
4150 at all; flow of control may briefly move where you did not expect it;
4151 some statements may not be executed because they compute constant
4152 results or their values were already at hand; some statements may
4153 execute in different places because they were moved out of loops.
4154
4155 Nevertheless it proves possible to debug optimized output.  This makes
4156 it reasonable to use the optimizer for programs that might have bugs.
4157
4158 The following options are useful when GCC is generated with the
4159 capability for more than one debugging format.
4160
4161 @item -ggdb
4162 @opindex ggdb
4163 Produce debugging information for use by GDB@.  This means to use the
4164 most expressive format available (DWARF 2, stabs, or the native format
4165 if neither of those are supported), including GDB extensions if at all
4166 possible.
4167
4168 @item -gstabs
4169 @opindex gstabs
4170 Produce debugging information in stabs format (if that is supported),
4171 without GDB extensions.  This is the format used by DBX on most BSD
4172 systems.  On MIPS, Alpha and System V Release 4 systems this option
4173 produces stabs debugging output which is not understood by DBX or SDB@.
4174 On System V Release 4 systems this option requires the GNU assembler.
4175
4176 @item -feliminate-unused-debug-symbols
4177 @opindex feliminate-unused-debug-symbols
4178 Produce debugging information in stabs format (if that is supported),
4179 for only symbols that are actually used.
4180
4181 @item -femit-class-debug-always
4182 Instead of emitting debugging information for a C++ class in only one
4183 object file, emit it in all object files using the class.  This option
4184 should be used only with debuggers that are unable to handle the way GCC
4185 normally emits debugging information for classes because using this
4186 option will increase the size of debugging information by as much as a
4187 factor of two.
4188
4189 @item -gstabs+
4190 @opindex gstabs+
4191 Produce debugging information in stabs format (if that is supported),
4192 using GNU extensions understood only by the GNU debugger (GDB)@.  The
4193 use of these extensions is likely to make other debuggers crash or
4194 refuse to read the program.
4195
4196 @item -gcoff
4197 @opindex gcoff
4198 Produce debugging information in COFF format (if that is supported).
4199 This is the format used by SDB on most System V systems prior to
4200 System V Release 4.
4201
4202 @item -gxcoff
4203 @opindex gxcoff
4204 Produce debugging information in XCOFF format (if that is supported).
4205 This is the format used by the DBX debugger on IBM RS/6000 systems.
4206
4207 @item -gxcoff+
4208 @opindex gxcoff+
4209 Produce debugging information in XCOFF format (if that is supported),
4210 using GNU extensions understood only by the GNU debugger (GDB)@.  The
4211 use of these extensions is likely to make other debuggers crash or
4212 refuse to read the program, and may cause assemblers other than the GNU
4213 assembler (GAS) to fail with an error.
4214
4215 @item -gdwarf-2
4216 @opindex gdwarf-2
4217 Produce debugging information in DWARF version 2 format (if that is
4218 supported).  This is the format used by DBX on IRIX 6.  With this
4219 option, GCC uses features of DWARF version 3 when they are useful;
4220 version 3 is upward compatible with version 2, but may still cause
4221 problems for older debuggers.
4222
4223 @item -gvms
4224 @opindex gvms
4225 Produce debugging information in VMS debug format (if that is
4226 supported).  This is the format used by DEBUG on VMS systems.
4227
4228 @item -g@var{level}
4229 @itemx -ggdb@var{level}
4230 @itemx -gstabs@var{level}
4231 @itemx -gcoff@var{level}
4232 @itemx -gxcoff@var{level}
4233 @itemx -gvms@var{level}
4234 Request debugging information and also use @var{level} to specify how
4235 much information.  The default level is 2.
4236
4237 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
4238 @option{-g}.
4239
4240 Level 1 produces minimal information, enough for making backtraces in
4241 parts of the program that you don't plan to debug.  This includes
4242 descriptions of functions and external variables, but no information
4243 about local variables and no line numbers.
4244
4245 Level 3 includes extra information, such as all the macro definitions
4246 present in the program.  Some debuggers support macro expansion when
4247 you use @option{-g3}.
4248
4249 @option{-gdwarf-2} does not accept a concatenated debug level, because
4250 GCC used to support an option @option{-gdwarf} that meant to generate
4251 debug information in version 1 of the DWARF format (which is very
4252 different from version 2), and it would have been too confusing.  That
4253 debug format is long obsolete, but the option cannot be changed now.
4254 Instead use an additional @option{-g@var{level}} option to change the
4255 debug level for DWARF2.
4256
4257 @item -feliminate-dwarf2-dups
4258 @opindex feliminate-dwarf2-dups
4259 Compress DWARF2 debugging information by eliminating duplicated
4260 information about each symbol.  This option only makes sense when
4261 generating DWARF2 debugging information with @option{-gdwarf-2}.
4262
4263 @item -femit-struct-debug-baseonly
4264 Emit debug information for struct-like types
4265 only when the base name of the compilation source file
4266 matches the base name of file in which the struct was defined.
4267
4268 This option substantially reduces the size of debugging information,
4269 but at significant potential loss in type information to the debugger.
4270 See @option{-femit-struct-debug-reduced} for a less aggressive option.
4271 See @option{-femit-struct-debug-detailed} for more detailed control.
4272
4273 This option works only with DWARF 2.
4274
4275 @item -femit-struct-debug-reduced
4276 Emit debug information for struct-like types
4277 only when the base name of the compilation source file
4278 matches the base name of file in which the type was defined,
4279 unless the struct is a template or defined in a system header.
4280
4281 This option significantly reduces the size of debugging information,
4282 with some potential loss in type information to the debugger.
4283 See @option{-femit-struct-debug-baseonly} for a more aggressive option.
4284 See @option{-femit-struct-debug-detailed} for more detailed control.
4285
4286 This option works only with DWARF 2.
4287
4288 @item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
4289 Specify the struct-like types
4290 for which the compiler will generate debug information.
4291 The intent is to reduce duplicate struct debug information
4292 between different object files within the same program.
4293
4294 This option is a detailed version of
4295 @option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
4296 which will serve for most needs.
4297
4298 A specification has the syntax
4299 [@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
4300
4301 The optional first word limits the specification to
4302 structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
4303 A struct type is used directly when it is the type of a variable, member.
4304 Indirect uses arise through pointers to structs.
4305 That is, when use of an incomplete struct would be legal, the use is indirect.
4306 An example is
4307 @samp{struct one direct; struct two * indirect;}.
4308
4309 The optional second word limits the specification to
4310 ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
4311 Generic structs are a bit complicated to explain.
4312 For C++, these are non-explicit specializations of template classes,
4313 or non-template classes within the above.
4314 Other programming languages have generics,
4315 but @samp{-femit-struct-debug-detailed} does not yet implement them.
4316
4317 The third word specifies the source files for those
4318 structs for which the compiler will emit debug information.
4319 The values @samp{none} and @samp{any} have the normal meaning.
4320 The value @samp{base} means that
4321 the base of name of the file in which the type declaration appears
4322 must match the base of the name of the main compilation file.
4323 In practice, this means that
4324 types declared in @file{foo.c} and @file{foo.h} will have debug information,
4325 but types declared in other header will not.
4326 The value @samp{sys} means those types satisfying @samp{base}
4327 or declared in system or compiler headers.
4328
4329 You may need to experiment to determine the best settings for your application.
4330
4331 The default is @samp{-femit-struct-debug-detailed=all}.
4332
4333 This option works only with DWARF 2.
4334
4335 @item -fno-merge-debug-strings
4336 @opindex fmerge-debug-strings
4337 @opindex fno-merge-debug-strings
4338 Direct the linker to merge together strings which are identical in
4339 different object files.  This is not supported by all assemblers or
4340 linker.  This decreases the size of the debug information in the
4341 output file at the cost of increasing link processing time.  This is
4342 on by default.
4343
4344 @item -fdebug-prefix-map=@var{old}=@var{new}
4345 @opindex fdebug-prefix-map
4346 When compiling files in directory @file{@var{old}}, record debugging
4347 information describing them as in @file{@var{new}} instead.
4348
4349 @item -fno-dwarf2-cfi-asm
4350 @opindex fdwarf2-cfi-asm
4351 @opindex fno-dwarf2-cfi-asm
4352 Emit DWARF 2 unwind info as compiler generated @code{.eh_frame} section
4353 instead of using GAS @code{.cfi_*} directives.
4354
4355 @cindex @command{prof}
4356 @item -p
4357 @opindex p
4358 Generate extra code to write profile information suitable for the
4359 analysis program @command{prof}.  You must use this option when compiling
4360 the source files you want data about, and you must also use it when
4361 linking.
4362
4363 @cindex @command{gprof}
4364 @item -pg
4365 @opindex pg
4366 Generate extra code to write profile information suitable for the
4367 analysis program @command{gprof}.  You must use this option when compiling
4368 the source files you want data about, and you must also use it when
4369 linking.
4370
4371 @item -Q
4372 @opindex Q
4373 Makes the compiler print out each function name as it is compiled, and
4374 print some statistics about each pass when it finishes.
4375
4376 @item -ftime-report
4377 @opindex ftime-report
4378 Makes the compiler print some statistics about the time consumed by each
4379 pass when it finishes.
4380
4381 @item -fmem-report
4382 @opindex fmem-report
4383 Makes the compiler print some statistics about permanent memory
4384 allocation when it finishes.
4385
4386 @item -fpre-ipa-mem-report
4387 @opindex fpre-ipa-mem-report
4388 @item -fpost-ipa-mem-report
4389 @opindex fpost-ipa-mem-report
4390 Makes the compiler print some statistics about permanent memory
4391 allocation before or after interprocedural optimization.
4392
4393 @item -fprofile-arcs
4394 @opindex fprofile-arcs
4395 Add code so that program flow @dfn{arcs} are instrumented.  During
4396 execution the program records how many times each branch and call is
4397 executed and how many times it is taken or returns.  When the compiled
4398 program exits it saves this data to a file called
4399 @file{@var{auxname}.gcda} for each source file.  The data may be used for
4400 profile-directed optimizations (@option{-fbranch-probabilities}), or for
4401 test coverage analysis (@option{-ftest-coverage}).  Each object file's
4402 @var{auxname} is generated from the name of the output file, if
4403 explicitly specified and it is not the final executable, otherwise it is
4404 the basename of the source file.  In both cases any suffix is removed
4405 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
4406 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
4407 @xref{Cross-profiling}.
4408
4409 @cindex @command{gcov}
4410 @item --coverage
4411 @opindex coverage
4412
4413 This option is used to compile and link code instrumented for coverage
4414 analysis.  The option is a synonym for @option{-fprofile-arcs}
4415 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
4416 linking).  See the documentation for those options for more details.
4417
4418 @itemize
4419
4420 @item
4421 Compile the source files with @option{-fprofile-arcs} plus optimization
4422 and code generation options.  For test coverage analysis, use the
4423 additional @option{-ftest-coverage} option.  You do not need to profile
4424 every source file in a program.
4425
4426 @item
4427 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
4428 (the latter implies the former).
4429
4430 @item
4431 Run the program on a representative workload to generate the arc profile
4432 information.  This may be repeated any number of times.  You can run
4433 concurrent instances of your program, and provided that the file system
4434 supports locking, the data files will be correctly updated.  Also
4435 @code{fork} calls are detected and correctly handled (double counting
4436 will not happen).
4437
4438 @item
4439 For profile-directed optimizations, compile the source files again with
4440 the same optimization and code generation options plus
4441 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
4442 Control Optimization}).
4443
4444 @item
4445 For test coverage analysis, use @command{gcov} to produce human readable
4446 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
4447 @command{gcov} documentation for further information.
4448
4449 @end itemize
4450
4451 With @option{-fprofile-arcs}, for each function of your program GCC
4452 creates a program flow graph, then finds a spanning tree for the graph.
4453 Only arcs that are not on the spanning tree have to be instrumented: the
4454 compiler adds code to count the number of times that these arcs are
4455 executed.  When an arc is the only exit or only entrance to a block, the
4456 instrumentation code can be added to the block; otherwise, a new basic
4457 block must be created to hold the instrumentation code.
4458
4459 @need 2000
4460 @item -ftest-coverage
4461 @opindex ftest-coverage
4462 Produce a notes file that the @command{gcov} code-coverage utility
4463 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
4464 show program coverage.  Each source file's note file is called
4465 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
4466 above for a description of @var{auxname} and instructions on how to
4467 generate test coverage data.  Coverage data will match the source files
4468 more closely, if you do not optimize.
4469
4470 @item -fdbg-cnt-list
4471 @opindex fdbg-cnt-list
4472 Print the name and the counter upperbound for all debug counters.
4473
4474 @item -fdbg-cnt=@var{counter-value-list}
4475 @opindex fdbg-cnt
4476 Set the internal debug counter upperbound. @var{counter-value-list} 
4477 is a comma-separated list of @var{name}:@var{value} pairs
4478 which sets the upperbound of each debug counter @var{name} to @var{value}.
4479 All debug counters have the initial upperbound of @var{UINT_MAX},
4480 thus dbg_cnt() returns true always unless the upperbound is set by this option.
4481 e.g. With -fdbg-cnt=dce:10,tail_call:0
4482 dbg_cnt(dce) will return true only for first 10 invocations
4483 and dbg_cnt(tail_call) will return false always.
4484
4485 @item -d@var{letters}
4486 @itemx -fdump-rtl-@var{pass}
4487 @opindex d
4488 Says to make debugging dumps during compilation at times specified by
4489 @var{letters}.    This is used for debugging the RTL-based passes of the
4490 compiler.  The file names for most of the dumps are made by appending a
4491 pass number and a word to the @var{dumpname}.  @var{dumpname} is generated
4492 from the name of the output file, if explicitly specified and it is not
4493 an executable, otherwise it is the basename of the source file. These
4494 switches may have different effects when @option{-E} is used for
4495 preprocessing.
4496
4497 Most debug dumps can be enabled either passing a letter to the @option{-d}
4498 option, or with a long @option{-fdump-rtl} switch; here are the possible
4499 letters for use in @var{letters} and @var{pass}, and their meanings:
4500
4501 @table @gcctabopt
4502 @item -dA
4503 @opindex dA
4504 Annotate the assembler output with miscellaneous debugging information.
4505
4506 @item -fdump-rtl-bbro
4507 @opindex fdump-rtl-bbro
4508 Dump after block reordering, to @file{@var{file}.148r.bbro}.
4509
4510 @item -fdump-rtl-combine
4511 @opindex fdump-rtl-combine
4512 Dump after the RTL instruction combination pass, to the file
4513 @file{@var{file}.129r.combine}.
4514
4515 @item -fdump-rtl-ce1
4516 @itemx -fdump-rtl-ce2
4517 @opindex fdump-rtl-ce1
4518 @opindex fdump-rtl-ce2
4519 @option{-fdump-rtl-ce1} enable dumping after the
4520 first if conversion, to the file @file{@var{file}.117r.ce1}. 
4521 @option{-fdump-rtl-ce2} enable dumping after the second if
4522 conversion, to the file @file{@var{file}.130r.ce2}.
4523
4524 @item -fdump-rtl-btl
4525 @itemx -fdump-rtl-dbr
4526 @opindex fdump-rtl-btl
4527 @opindex fdump-rtl-dbr
4528 @option{-fdump-rtl-btl} enable dumping after branch
4529 target load optimization, to @file{@var{file}.31.btl}.  
4530 @option{-fdump-rtl-dbr} enable dumping after delayed branch
4531 scheduling, to @file{@var{file}.36.dbr}.
4532
4533 @item -dD
4534 @opindex dD
4535 Dump all macro definitions, at the end of preprocessing, in addition to
4536 normal output.
4537
4538 @item -fdump-rtl-ce3
4539 @opindex fdump-rtl-ce3
4540 Dump after the third if conversion, to @file{@var{file}.146r.ce3}.
4541
4542 @item -fdump-rtl-cfg
4543 @itemx -fdump-rtl-life
4544 @opindex fdump-rtl-cfg
4545 @opindex fdump-rtl-life
4546 @option{-fdump-rtl-cfg} enable dumping after control
4547 and data flow analysis, to @file{@var{file}.116r.cfg}.  
4548 @option{-fdump-rtl-cfg} enable dumping dump after life analysis,
4549 to @file{@var{file}.128r.life1} and @file{@var{file}.135r.life2}.
4550
4551 @item -fdump-rtl-greg
4552 @opindex fdump-rtl-greg
4553 Dump after global register allocation, to @file{@var{file}.139r.greg}.
4554
4555 @item -fdump-rtl-gcse
4556 @itemx -fdump-rtl-bypass
4557 @opindex fdump-rtl-gcse
4558 @opindex fdump-rtl-bypass
4559 @option{-fdump-rtl-gcse} enable dumping after GCSE, to
4560 @file{@var{file}.114r.gcse}.  @option{-fdump-rtl-bypass}
4561 enable dumping after jump bypassing and control flow optimizations, to
4562 @file{@var{file}.115r.bypass}.
4563
4564 @item -fdump-rtl-eh
4565 @opindex fdump-rtl-eh
4566 Dump after finalization of EH handling code, to @file{@var{file}.02.eh}.
4567
4568 @item -fdump-rtl-sibling
4569 @opindex fdump-rtl-sibling
4570 Dump after sibling call optimizations, to @file{@var{file}.106r.sibling}.
4571
4572 @item -fdump-rtl-jump
4573 @opindex fdump-rtl-jump
4574 Dump after the first jump optimization, to @file{@var{file}.112r.jump}.
4575
4576 @item -fdump-rtl-stack
4577 @opindex fdump-rtl-stack
4578 Dump after conversion from GCC's "flat register file" registers to the
4579 x87's stack-like registers, to @file{@var{file}.152r.stack}.
4580
4581 @item -fdump-rtl-lreg
4582 @opindex fdump-rtl-lreg
4583 Dump after local register allocation, to @file{@var{file}.138r.lreg}.
4584
4585 @item -fdump-rtl-loop2
4586 @opindex fdump-rtl-loop2
4587 @option{-dL} and @option{-fdump-rtl-loop2} enable dumping after the
4588 loop optimization pass, to @file{@var{file}.119r.loop2},
4589 @file{@var{file}.120r.loop2_init},
4590 @file{@var{file}.121r.loop2_invariant}, and
4591 @file{@var{file}.125r.loop2_done}.
4592
4593 @item -fdump-rtl-sms
4594 @opindex fdump-rtl-sms
4595 Dump after modulo scheduling, to @file{@var{file}.136r.sms}.
4596
4597 @item -fdump-rtl-mach
4598 @opindex fdump-rtl-mach
4599 Dump after performing the machine dependent reorganization pass, to
4600 @file{@var{file}.155r.mach} if that pass exists.
4601
4602 @item -fdump-rtl-rnreg
4603 @opindex fdump-rtl-rnreg
4604 Dump after register renumbering, to @file{@var{file}.147r.rnreg}.
4605
4606 @item -fdump-rtl-regmove
4607 @opindex fdump-rtl-regmove
4608 Dump after the register move pass, to @file{@var{file}.132r.regmove}.
4609
4610 @item -fdump-rtl-postreload
4611 @opindex fdump-rtl-postreload
4612 Dump after post-reload optimizations, to @file{@var{file}.24.postreload}.
4613
4614 @item -fdump-rtl-expand
4615 @opindex fdump-rtl-expand
4616 Dump after RTL generation, to @file{@var{file}.104r.expand}.
4617
4618 @item -fdump-rtl-sched2
4619 @opindex fdump-rtl-sched2
4620 Dump after the second scheduling pass, to @file{@var{file}.149r.sched2}.
4621
4622 @item -fdump-rtl-cse
4623 @opindex fdump-rtl-cse
4624 Dump after CSE (including the jump optimization that sometimes follows
4625 CSE), to @file{@var{file}.113r.cse}.
4626
4627 @item -fdump-rtl-sched1
4628 @opindex fdump-rtl-sched1
4629 Dump after the first scheduling pass, to @file{@var{file}.136r.sched1}.
4630
4631 @item -fdump-rtl-cse2
4632 @opindex fdump-rtl-cse2
4633 Dump after the second CSE pass (including the jump optimization that
4634 sometimes follows CSE), to @file{@var{file}.127r.cse2}.
4635
4636 @item -fdump-rtl-tracer
4637 @opindex fdump-rtl-tracer
4638 Dump after running tracer, to @file{@var{file}.118r.tracer}.
4639
4640 @item -fdump-rtl-vpt
4641 @itemx -fdump-rtl-vartrack
4642 @opindex fdump-rtl-vpt
4643 @opindex fdump-rtl-vartrack
4644 @option{-fdump-rtl-vpt} enable dumping after the value
4645 profile transformations, to @file{@var{file}.10.vpt}.
4646 @option{-fdump-rtl-vartrack} enable dumping after variable tracking,
4647 to @file{@var{file}.154r.vartrack}.
4648
4649 @item -fdump-rtl-flow2
4650 @opindex fdump-rtl-flow2
4651 Dump after the second flow pass, to @file{@var{file}.142r.flow2}.
4652
4653 @item -fdump-rtl-peephole2
4654 @opindex fdump-rtl-peephole2
4655 Dump after the peephole pass, to @file{@var{file}.145r.peephole2}.
4656
4657 @item -fdump-rtl-web
4658 @opindex fdump-rtl-web
4659 Dump after live range splitting, to @file{@var{file}.126r.web}.
4660
4661 @item -fdump-rtl-all
4662 @opindex fdump-rtl-all
4663 Produce all the dumps listed above.
4664
4665 @item -dH
4666 @opindex dH
4667 Produce a core dump whenever an error occurs.
4668
4669 @item -dm
4670 @opindex dm
4671 Print statistics on memory usage, at the end of the run, to
4672 standard error.
4673
4674 @item -dp
4675 @opindex dp
4676 Annotate the assembler output with a comment indicating which
4677 pattern and alternative was used.  The length of each instruction is
4678 also printed.
4679
4680 @item -dP
4681 @opindex dP
4682 Dump the RTL in the assembler output as a comment before each instruction.
4683 Also turns on @option{-dp} annotation.
4684
4685 @item -dv
4686 @opindex dv
4687 For each of the other indicated dump files (either with @option{-d} or
4688 @option{-fdump-rtl-@var{pass}}), dump a representation of the control flow
4689 graph suitable for viewing with VCG to @file{@var{file}.@var{pass}.vcg}.
4690
4691 @item -dx
4692 @opindex dx
4693 Just generate RTL for a function instead of compiling it.  Usually used
4694 with @samp{r} (@option{-fdump-rtl-expand}).
4695
4696 @item -dy
4697 @opindex dy
4698 Dump debugging information during parsing, to standard error.
4699 @end table
4700
4701 @item -fdump-noaddr
4702 @opindex fdump-noaddr
4703 When doing debugging dumps (see @option{-d} option above), suppress
4704 address output.  This makes it more feasible to use diff on debugging
4705 dumps for compiler invocations with different compiler binaries and/or
4706 different text / bss / data / heap / stack / dso start locations.
4707
4708 @item -fdump-unnumbered
4709 @opindex fdump-unnumbered
4710 When doing debugging dumps (see @option{-d} option above), suppress instruction
4711 numbers and address output.  This makes it more feasible to
4712 use diff on debugging dumps for compiler invocations with different
4713 options, in particular with and without @option{-g}.
4714
4715 @item -fdump-translation-unit @r{(C++ only)}
4716 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
4717 @opindex fdump-translation-unit
4718 Dump a representation of the tree structure for the entire translation
4719 unit to a file.  The file name is made by appending @file{.tu} to the
4720 source file name.  If the @samp{-@var{options}} form is used, @var{options}
4721 controls the details of the dump as described for the
4722 @option{-fdump-tree} options.
4723
4724 @item -fdump-class-hierarchy @r{(C++ only)}
4725 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
4726 @opindex fdump-class-hierarchy
4727 Dump a representation of each class's hierarchy and virtual function
4728 table layout to a file.  The file name is made by appending @file{.class}
4729 to the source file name.  If the @samp{-@var{options}} form is used,
4730 @var{options} controls the details of the dump as described for the
4731 @option{-fdump-tree} options.
4732
4733 @item -fdump-ipa-@var{switch}
4734 @opindex fdump-ipa
4735 Control the dumping at various stages of inter-procedural analysis
4736 language tree to a file.  The file name is generated by appending a switch
4737 specific suffix to the source file name.  The following dumps are possible:
4738
4739 @table @samp
4740 @item all
4741 Enables all inter-procedural analysis dumps.
4742
4743 @item cgraph
4744 Dumps information about call-graph optimization, unused function removal,
4745 and inlining decisions.
4746
4747 @item inline
4748 Dump after function inlining.
4749
4750 @end table
4751
4752 @item -fdump-statistics-@var{option}
4753 @opindex -fdump-statistics
4754 Enable and control dumping of pass statistics in a separate file.  The
4755 file name is generated by appending a suffix ending in @samp{.statistics}
4756 to the source file name.  If the @samp{-@var{option}} form is used,
4757 @samp{-stats} will cause counters to be summed over the whole compilation unit
4758 while @samp{-details} will dump every event as the passes generate them.
4759 The default with no option is to sum counters for each function compiled.
4760
4761 @item -fdump-tree-@var{switch}
4762 @itemx -fdump-tree-@var{switch}-@var{options}
4763 @opindex fdump-tree
4764 Control the dumping at various stages of processing the intermediate
4765 language tree to a file.  The file name is generated by appending a switch
4766 specific suffix to the source file name.  If the @samp{-@var{options}}
4767 form is used, @var{options} is a list of @samp{-} separated options that
4768 control the details of the dump.  Not all options are applicable to all
4769 dumps, those which are not meaningful will be ignored.  The following
4770 options are available
4771
4772 @table @samp
4773 @item address
4774 Print the address of each node.  Usually this is not meaningful as it
4775 changes according to the environment and source file.  Its primary use
4776 is for tying up a dump file with a debug environment.
4777 @item slim
4778 Inhibit dumping of members of a scope or body of a function merely
4779 because that scope has been reached.  Only dump such items when they
4780 are directly reachable by some other path.  When dumping pretty-printed
4781 trees, this option inhibits dumping the bodies of control structures.
4782 @item raw
4783 Print a raw representation of the tree.  By default, trees are
4784 pretty-printed into a C-like representation.
4785 @item details
4786 Enable more detailed dumps (not honored by every dump option).
4787 @item stats
4788 Enable dumping various statistics about the pass (not honored by every dump
4789 option).
4790 @item blocks
4791 Enable showing basic block boundaries (disabled in raw dumps).
4792 @item vops
4793 Enable showing virtual operands for every statement.
4794 @item lineno
4795 Enable showing line numbers for statements.
4796 @item uid
4797 Enable showing the unique ID (@code{DECL_UID}) for each variable.
4798 @item verbose
4799 Enable showing the tree dump for each statement.
4800 @item all
4801 Turn on all options, except @option{raw}, @option{slim}, @option{verbose}
4802 and @option{lineno}.
4803 @end table
4804
4805 The following tree dumps are possible:
4806 @table @samp
4807
4808 @item original
4809 Dump before any tree based optimization, to @file{@var{file}.original}.
4810
4811 @item optimized
4812 Dump after all tree based optimization, to @file{@var{file}.optimized}.
4813
4814 @item gimple
4815 @opindex fdump-tree-gimple
4816 Dump each function before and after the gimplification pass to a file.  The
4817 file name is made by appending @file{.gimple} to the source file name.
4818
4819 @item cfg
4820 @opindex fdump-tree-cfg
4821 Dump the control flow graph of each function to a file.  The file name is
4822 made by appending @file{.cfg} to the source file name.
4823
4824 @item vcg
4825 @opindex fdump-tree-vcg
4826 Dump the control flow graph of each function to a file in VCG format.  The
4827 file name is made by appending @file{.vcg} to the source file name.  Note
4828 that if the file contains more than one function, the generated file cannot
4829 be used directly by VCG@.  You will need to cut and paste each function's
4830 graph into its own separate file first.
4831
4832 @item ch
4833 @opindex fdump-tree-ch
4834 Dump each function after copying loop headers.  The file name is made by
4835 appending @file{.ch} to the source file name.
4836
4837 @item ssa
4838 @opindex fdump-tree-ssa
4839 Dump SSA related information to a file.  The file name is made by appending
4840 @file{.ssa} to the source file name.
4841
4842 @item alias
4843 @opindex fdump-tree-alias
4844 Dump aliasing information for each function.  The file name is made by
4845 appending @file{.alias} to the source file name.
4846
4847 @item ccp
4848 @opindex fdump-tree-ccp
4849 Dump each function after CCP@.  The file name is made by appending
4850 @file{.ccp} to the source file name.
4851
4852 @item storeccp
4853 @opindex fdump-tree-storeccp
4854 Dump each function after STORE-CCP@.  The file name is made by appending
4855 @file{.storeccp} to the source file name.
4856
4857 @item pre
4858 @opindex fdump-tree-pre
4859 Dump trees after partial redundancy elimination.  The file name is made
4860 by appending @file{.pre} to the source file name.
4861
4862 @item fre
4863 @opindex fdump-tree-fre
4864 Dump trees after full redundancy elimination.  The file name is made
4865 by appending @file{.fre} to the source file name.
4866
4867 @item copyprop
4868 @opindex fdump-tree-copyprop
4869 Dump trees after copy propagation.  The file name is made
4870 by appending @file{.copyprop} to the source file name.
4871
4872 @item store_copyprop
4873 @opindex fdump-tree-store_copyprop
4874 Dump trees after store copy-propagation.  The file name is made
4875 by appending @file{.store_copyprop} to the source file name.
4876
4877 @item dce
4878 @opindex fdump-tree-dce
4879 Dump each function after dead code elimination.  The file name is made by
4880 appending @file{.dce} to the source file name.
4881
4882 @item mudflap
4883 @opindex fdump-tree-mudflap
4884 Dump each function after adding mudflap instrumentation.  The file name is
4885 made by appending @file{.mudflap} to the source file name.
4886
4887 @item sra
4888 @opindex fdump-tree-sra
4889 Dump each function after performing scalar replacement of aggregates.  The
4890 file name is made by appending @file{.sra} to the source file name.
4891
4892 @item sink
4893 @opindex fdump-tree-sink
4894 Dump each function after performing code sinking.  The file name is made
4895 by appending @file{.sink} to the source file name.
4896
4897 @item dom
4898 @opindex fdump-tree-dom
4899 Dump each function after applying dominator tree optimizations.  The file
4900 name is made by appending @file{.dom} to the source file name.
4901
4902 @item dse
4903 @opindex fdump-tree-dse
4904 Dump each function after applying dead store elimination.  The file
4905 name is made by appending @file{.dse} to the source file name.
4906
4907 @item phiopt
4908 @opindex fdump-tree-phiopt
4909 Dump each function after optimizing PHI nodes into straightline code.  The file
4910 name is made by appending @file{.phiopt} to the source file name.
4911
4912 @item forwprop
4913 @opindex fdump-tree-forwprop
4914 Dump each function after forward propagating single use variables.  The file
4915 name is made by appending @file{.forwprop} to the source file name.
4916
4917 @item copyrename
4918 @opindex fdump-tree-copyrename
4919 Dump each function after applying the copy rename optimization.  The file
4920 name is made by appending @file{.copyrename} to the source file name.
4921
4922 @item nrv
4923 @opindex fdump-tree-nrv
4924 Dump each function after applying the named return value optimization on
4925 generic trees.  The file name is made by appending @file{.nrv} to the source
4926 file name.
4927
4928 @item vect
4929 @opindex fdump-tree-vect
4930 Dump each function after applying vectorization of loops.  The file name is
4931 made by appending @file{.vect} to the source file name.
4932
4933 @item vrp
4934 @opindex fdump-tree-vrp
4935 Dump each function after Value Range Propagation (VRP).  The file name
4936 is made by appending @file{.vrp} to the source file name.
4937
4938 @item all
4939 @opindex fdump-tree-all
4940 Enable all the available tree dumps with the flags provided in this option.
4941 @end table
4942
4943 @item -ftree-vectorizer-verbose=@var{n}
4944 @opindex ftree-vectorizer-verbose
4945 This option controls the amount of debugging output the vectorizer prints.
4946 This information is written to standard error, unless
4947 @option{-fdump-tree-all} or @option{-fdump-tree-vect} is specified,
4948 in which case it is output to the usual dump listing file, @file{.vect}.
4949 For @var{n}=0 no diagnostic information is reported.
4950 If @var{n}=1 the vectorizer reports each loop that got vectorized,
4951 and the total number of loops that got vectorized.
4952 If @var{n}=2 the vectorizer also reports non-vectorized loops that passed
4953 the first analysis phase (vect_analyze_loop_form) - i.e.@: countable,
4954 inner-most, single-bb, single-entry/exit loops.  This is the same verbosity
4955 level that @option{-fdump-tree-vect-stats} uses.
4956 Higher verbosity levels mean either more information dumped for each
4957 reported loop, or same amount of information reported for more loops:
4958 If @var{n}=3, alignment related information is added to the reports.
4959 If @var{n}=4, data-references related information (e.g.@: memory dependences,
4960 memory access-patterns) is added to the reports.
4961 If @var{n}=5, the vectorizer reports also non-vectorized inner-most loops
4962 that did not pass the first analysis phase (i.e., may not be countable, or
4963 may have complicated control-flow).
4964 If @var{n}=6, the vectorizer reports also non-vectorized nested loops.
4965 For @var{n}=7, all the information the vectorizer generates during its
4966 analysis and transformation is reported.  This is the same verbosity level
4967 that @option{-fdump-tree-vect-details} uses.
4968
4969 @item -frandom-seed=@var{string}
4970 @opindex frandom-string
4971 This option provides a seed that GCC uses when it would otherwise use
4972 random numbers.  It is used to generate certain symbol names
4973 that have to be different in every compiled file.  It is also used to
4974 place unique stamps in coverage data files and the object files that
4975 produce them.  You can use the @option{-frandom-seed} option to produce
4976 reproducibly identical object files.
4977
4978 The @var{string} should be different for every file you compile.
4979
4980 @item -fsched-verbose=@var{n}
4981 @opindex fsched-verbose
4982 On targets that use instruction scheduling, this option controls the
4983 amount of debugging output the scheduler prints.  This information is
4984 written to standard error, unless @option{-dS} or @option{-dR} is
4985 specified, in which case it is output to the usual dump
4986 listing file, @file{.sched} or @file{.sched2} respectively.  However
4987 for @var{n} greater than nine, the output is always printed to standard
4988 error.
4989
4990 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
4991 same information as @option{-dRS}.  For @var{n} greater than one, it
4992 also output basic block probabilities, detailed ready list information
4993 and unit/insn info.  For @var{n} greater than two, it includes RTL
4994 at abort point, control-flow and regions info.  And for @var{n} over
4995 four, @option{-fsched-verbose} also includes dependence info.
4996
4997 @item -save-temps
4998 @opindex save-temps
4999 Store the usual ``temporary'' intermediate files permanently; place them
5000 in the current directory and name them based on the source file.  Thus,
5001 compiling @file{foo.c} with @samp{-c -save-temps} would produce files
5002 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
5003 preprocessed @file{foo.i} output file even though the compiler now
5004 normally uses an integrated preprocessor.
5005
5006 When used in combination with the @option{-x} command line option,
5007 @option{-save-temps} is sensible enough to avoid over writing an
5008 input source file with the same extension as an intermediate file.
5009 The corresponding intermediate file may be obtained by renaming the
5010 source file before using @option{-save-temps}.
5011
5012 @item -time
5013 @opindex time
5014 Report the CPU time taken by each subprocess in the compilation
5015 sequence.  For C source files, this is the compiler proper and assembler
5016 (plus the linker if linking is done).  The output looks like this:
5017
5018 @smallexample
5019 # cc1 0.12 0.01
5020 # as 0.00 0.01
5021 @end smallexample
5022
5023 The first number on each line is the ``user time'', that is time spent
5024 executing the program itself.  The second number is ``system time'',
5025 time spent executing operating system routines on behalf of the program.
5026 Both numbers are in seconds.
5027
5028 @item -fvar-tracking
5029 @opindex fvar-tracking
5030 Run variable tracking pass.  It computes where variables are stored at each
5031 position in code.  Better debugging information is then generated
5032 (if the debugging information format supports this information).
5033
5034 It is enabled by default when compiling with optimization (@option{-Os},
5035 @option{-O}, @option{-O2}, @dots{}), debugging information (@option{-g}) and
5036 the debug info format supports it.
5037
5038 @item -print-file-name=@var{library}
5039 @opindex print-file-name
5040 Print the full absolute name of the library file @var{library} that
5041 would be used when linking---and don't do anything else.  With this
5042 option, GCC does not compile or link anything; it just prints the
5043 file name.
5044
5045 @item -print-multi-directory
5046 @opindex print-multi-directory
5047 Print the directory name corresponding to the multilib selected by any
5048 other switches present in the command line.  This directory is supposed
5049 to exist in @env{GCC_EXEC_PREFIX}.
5050
5051 @item -print-multi-lib
5052 @opindex print-multi-lib
5053 Print the mapping from multilib directory names to compiler switches
5054 that enable them.  The directory name is separated from the switches by
5055 @samp{;}, and each switch starts with an @samp{@@} instead of the
5056 @samp{-}, without spaces between multiple switches.  This is supposed to
5057 ease shell-processing.
5058
5059 @item -print-prog-name=@var{program}
5060 @opindex print-prog-name
5061 Like @option{-print-file-name}, but searches for a program such as @samp{cpp}.
5062
5063 @item -print-libgcc-file-name
5064 @opindex print-libgcc-file-name
5065 Same as @option{-print-file-name=libgcc.a}.
5066
5067 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
5068 but you do want to link with @file{libgcc.a}.  You can do
5069
5070 @smallexample
5071 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
5072 @end smallexample
5073
5074 @item -print-search-dirs
5075 @opindex print-search-dirs
5076 Print the name of the configured installation directory and a list of
5077 program and library directories @command{gcc} will search---and don't do anything else.
5078
5079 This is useful when @command{gcc} prints the error message
5080 @samp{installation problem, cannot exec cpp0: No such file or directory}.
5081 To resolve this you either need to put @file{cpp0} and the other compiler
5082 components where @command{gcc} expects to find them, or you can set the environment
5083 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
5084 Don't forget the trailing @samp{/}.
5085 @xref{Environment Variables}.
5086
5087 @item -print-sysroot
5088 @opindex print-sysroot
5089 Print the target sysroot directory that will be used during
5090 compilation.  This is the target sysroot specified either at configure
5091 time or using the @option{--sysroot} option, possibly with an extra
5092 suffix that depends on compilation options.  If no target sysroot is
5093 specified, the option prints nothing.
5094
5095 @item -print-sysroot-headers-suffix
5096 @opindex print-sysroot-headers-suffix
5097 Print the suffix added to the target sysroot when searching for
5098 headers, or give an error if the compiler is not configured with such
5099 a suffix---and don't do anything else.
5100
5101 @item -dumpmachine
5102 @opindex dumpmachine
5103 Print the compiler's target machine (for example,
5104 @samp{i686-pc-linux-gnu})---and don't do anything else.
5105
5106 @item -dumpversion
5107 @opindex dumpversion
5108 Print the compiler version (for example, @samp{3.0})---and don't do
5109 anything else.
5110
5111 @item -dumpspecs
5112 @opindex dumpspecs
5113 Print the compiler's built-in specs---and don't do anything else.  (This
5114 is used when GCC itself is being built.)  @xref{Spec Files}.
5115
5116 @item -feliminate-unused-debug-types
5117 @opindex feliminate-unused-debug-types
5118 Normally, when producing DWARF2 output, GCC will emit debugging
5119 information for all types declared in a compilation
5120 unit, regardless of whether or not they are actually used
5121 in that compilation unit.  Sometimes this is useful, such as
5122 if, in the debugger, you want to cast a value to a type that is
5123 not actually used in your program (but is declared).  More often,
5124 however, this results in a significant amount of wasted space.
5125 With this option, GCC will avoid producing debug symbol output
5126 for types that are nowhere used in the source file being compiled.
5127 @end table
5128
5129 @node Optimize Options
5130 @section Options That Control Optimization
5131 @cindex optimize options
5132 @cindex options, optimization
5133
5134 These options control various sorts of optimizations.
5135
5136 Without any optimization option, the compiler's goal is to reduce the
5137 cost of compilation and to make debugging produce the expected
5138 results.  Statements are independent: if you stop the program with a
5139 breakpoint between statements, you can then assign a new value to any
5140 variable or change the program counter to any other statement in the
5141 function and get exactly the results you would expect from the source
5142 code.
5143
5144 Turning on optimization flags makes the compiler attempt to improve
5145 the performance and/or code size at the expense of compilation time
5146 and possibly the ability to debug the program.
5147
5148 The compiler performs optimization based on the knowledge it has of the
5149 program.  Compiling multiple files at once to a single output file mode allows
5150 the compiler to use information gained from all of the files when compiling
5151 each of them.
5152
5153 Not all optimizations are controlled directly by a flag.  Only
5154 optimizations that have a flag are listed.
5155
5156 @table @gcctabopt
5157 @item -O
5158 @itemx -O1
5159 @opindex O
5160 @opindex O1
5161 Optimize.  Optimizing compilation takes somewhat more time, and a lot
5162 more memory for a large function.
5163
5164 With @option{-O}, the compiler tries to reduce code size and execution
5165 time, without performing any optimizations that take a great deal of
5166 compilation time.
5167
5168 @option{-O} turns on the following optimization flags:
5169 @gccoptlist{
5170 -fauto-inc-dec @gol
5171 -fcprop-registers @gol
5172 -fdce @gol
5173 -fdefer-pop @gol
5174 -fdelayed-branch @gol
5175 -fdse @gol
5176 -fguess-branch-probability @gol
5177 -fif-conversion2 @gol
5178 -fif-conversion @gol
5179 -finline-small-functions @gol
5180 -fipa-pure-const @gol
5181 -fipa-reference @gol
5182 -fmerge-constants
5183 -fsplit-wide-types @gol
5184 -ftree-builtin-call-dce @gol
5185 -ftree-ccp @gol
5186 -ftree-ch @gol
5187 -ftree-copyrename @gol
5188 -ftree-dce @gol
5189 -ftree-dominator-opts @gol
5190 -ftree-dse @gol
5191 -ftree-fre @gol
5192 -ftree-sra @gol
5193 -ftree-ter @gol
5194 -funit-at-a-time}
5195
5196 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
5197 where doing so does not interfere with debugging.
5198
5199 @item -O2
5200 @opindex O2
5201 Optimize even more.  GCC performs nearly all supported optimizations
5202 that do not involve a space-speed tradeoff.  The compiler does not
5203 perform loop unrolling or function inlining when you specify @option{-O2}.
5204 As compared to @option{-O}, this option increases both compilation time
5205 and the performance of the generated code.
5206
5207 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
5208 also turns on the following optimization flags:
5209 @gccoptlist{-fthread-jumps @gol
5210 -falign-functions  -falign-jumps @gol
5211 -falign-loops  -falign-labels @gol
5212 -fcaller-saves @gol
5213 -fcrossjumping @gol
5214 -fcse-follow-jumps  -fcse-skip-blocks @gol
5215 -fdelete-null-pointer-checks @gol
5216 -fexpensive-optimizations @gol
5217 -fgcse  -fgcse-lm  @gol
5218 -findirect-inlining @gol
5219 -foptimize-sibling-calls @gol
5220 -fpeephole2 @gol
5221 -fregmove @gol
5222 -freorder-blocks  -freorder-functions @gol
5223 -frerun-cse-after-loop  @gol
5224 -fsched-interblock  -fsched-spec @gol
5225 -fschedule-insns  -fschedule-insns2 @gol
5226 -fstrict-aliasing -fstrict-overflow @gol
5227 -ftree-switch-conversion @gol
5228 -ftree-pre @gol
5229 -ftree-vrp}
5230
5231 Please note the warning under @option{-fgcse} about
5232 invoking @option{-O2} on programs that use computed gotos.
5233
5234 @item -O3
5235 @opindex O3
5236 Optimize yet more.  @option{-O3} turns on all optimizations specified
5237 by @option{-O2} and also turns on the @option{-finline-functions},
5238 @option{-funswitch-loops}, @option{-fpredictive-commoning},
5239 @option{-fgcse-after-reload} and @option{-ftree-vectorize} options.
5240
5241 @item -O0
5242 @opindex O0
5243 Reduce compilation time and make debugging produce the expected
5244 results.  This is the default.
5245
5246 @item -Os
5247 @opindex Os
5248 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
5249 do not typically increase code size.  It also performs further
5250 optimizations designed to reduce code size.
5251
5252 @option{-Os} disables the following optimization flags:
5253 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
5254 -falign-labels  -freorder-blocks  -freorder-blocks-and-partition @gol
5255 -fprefetch-loop-arrays  -ftree-vect-loop-version}
5256
5257 If you use multiple @option{-O} options, with or without level numbers,
5258 the last such option is the one that is effective.
5259 @end table
5260
5261 Options of the form @option{-f@var{flag}} specify machine-independent
5262 flags.  Most flags have both positive and negative forms; the negative
5263 form of @option{-ffoo} would be @option{-fno-foo}.  In the table
5264 below, only one of the forms is listed---the one you typically will
5265 use.  You can figure out the other form by either removing @samp{no-}
5266 or adding it.
5267
5268 The following options control specific optimizations.  They are either
5269 activated by @option{-O} options or are related to ones that are.  You
5270 can use the following flags in the rare cases when ``fine-tuning'' of
5271 optimizations to be performed is desired.
5272
5273 @table @gcctabopt
5274 @item -fno-default-inline
5275 @opindex fno-default-inline
5276 Do not make member functions inline by default merely because they are
5277 defined inside the class scope (C++ only).  Otherwise, when you specify
5278 @w{@option{-O}}, member functions defined inside class scope are compiled
5279 inline by default; i.e., you don't need to add @samp{inline} in front of
5280 the member function name.
5281
5282 @item -fno-defer-pop
5283 @opindex fno-defer-pop
5284 Always pop the arguments to each function call as soon as that function
5285 returns.  For machines which must pop arguments after a function call,
5286 the compiler normally lets arguments accumulate on the stack for several
5287 function calls and pops them all at once.
5288
5289 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5290
5291 @item -fforward-propagate
5292 @opindex fforward-propagate
5293 Perform a forward propagation pass on RTL@.  The pass tries to combine two
5294 instructions and checks if the result can be simplified.  If loop unrolling
5295 is active, two passes are performed and the second is scheduled after
5296 loop unrolling.
5297
5298 This option is enabled by default at optimization levels @option{-O2},
5299 @option{-O3}, @option{-Os}.
5300
5301 @item -fomit-frame-pointer
5302 @opindex fomit-frame-pointer
5303 Don't keep the frame pointer in a register for functions that
5304 don't need one.  This avoids the instructions to save, set up and
5305 restore frame pointers; it also makes an extra register available
5306 in many functions.  @strong{It also makes debugging impossible on
5307 some machines.}
5308
5309 On some machines, such as the VAX, this flag has no effect, because
5310 the standard calling sequence automatically handles the frame pointer
5311 and nothing is saved by pretending it doesn't exist.  The
5312 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
5313 whether a target machine supports this flag.  @xref{Registers,,Register
5314 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
5315
5316 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5317
5318 @item -foptimize-sibling-calls
5319 @opindex foptimize-sibling-calls
5320 Optimize sibling and tail recursive calls.
5321
5322 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5323
5324 @item -fno-inline
5325 @opindex fno-inline
5326 Don't pay attention to the @code{inline} keyword.  Normally this option
5327 is used to keep the compiler from expanding any functions inline.
5328 Note that if you are not optimizing, no functions can be expanded inline.
5329
5330 @item -finline-small-functions
5331 @opindex finline-small-functions
5332 Integrate functions into their callers when their body is smaller than expected
5333 function call code (so overall size of program gets smaller).  The compiler
5334 heuristically decides which functions are simple enough to be worth integrating
5335 in this way.
5336
5337 Enabled at level @option{-O2}.
5338
5339 @item -findirect-inlining
5340 @opindex findirect-inlining
5341 Inline also indirect calls that are discovered to be known at compile
5342 time thanks to previous inlining.  This option has any effect only
5343 when inlining itself is turned on by the @option{-finline-functions}
5344 or @option{-finline-small-functions} options.
5345
5346 Enabled at level @option{-O2}.
5347
5348 @item -finline-functions
5349 @opindex finline-functions
5350 Integrate all simple functions into their callers.  The compiler
5351 heuristically decides which functions are simple enough to be worth
5352 integrating in this way.
5353
5354 If all calls to a given function are integrated, and the function is
5355 declared @code{static}, then the function is normally not output as
5356 assembler code in its own right.
5357
5358 Enabled at level @option{-O3}.
5359
5360 @item -finline-functions-called-once
5361 @opindex finline-functions-called-once
5362 Consider all @code{static} functions called once for inlining into their
5363 caller even if they are not marked @code{inline}.  If a call to a given
5364 function is integrated, then the function is not output as assembler code
5365 in its own right.
5366
5367 Enabled at levels @option{-O1}, @option{-O2}, @option{-O3} and @option{-Os}.
5368
5369 @item -fearly-inlining
5370 @opindex fearly-inlining
5371 Inline functions marked by @code{always_inline} and functions whose body seems
5372 smaller than the function call overhead early before doing
5373 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
5374 makes profiling significantly cheaper and usually inlining faster on programs
5375 having large chains of nested wrapper functions.
5376
5377 Enabled by default.
5378
5379 @item -finline-limit=@var{n}
5380 @opindex finline-limit
5381 By default, GCC limits the size of functions that can be inlined.  This flag
5382 allows coarse control of this limit.  @var{n} is the size of functions that
5383 can be inlined in number of pseudo instructions.
5384
5385 Inlining is actually controlled by a number of parameters, which may be
5386 specified individually by using @option{--param @var{name}=@var{value}}.
5387 The @option{-finline-limit=@var{n}} option sets some of these parameters
5388 as follows:
5389
5390 @table @gcctabopt
5391 @item max-inline-insns-single
5392 is set to @var{n}/2.
5393 @item max-inline-insns-auto
5394 is set to @var{n}/2.
5395 @end table
5396
5397 See below for a documentation of the individual
5398 parameters controlling inlining and for the defaults of these parameters.
5399
5400 @emph{Note:} there may be no value to @option{-finline-limit} that results
5401 in default behavior.
5402
5403 @emph{Note:} pseudo instruction represents, in this particular context, an
5404 abstract measurement of function's size.  In no way does it represent a count
5405 of assembly instructions and as such its exact meaning might change from one
5406 release to an another.
5407
5408 @item -fkeep-inline-functions
5409 @opindex fkeep-inline-functions
5410 In C, emit @code{static} functions that are declared @code{inline}
5411 into the object file, even if the function has been inlined into all
5412 of its callers.  This switch does not affect functions using the
5413 @code{extern inline} extension in GNU C89@.  In C++, emit any and all
5414 inline functions into the object file.
5415
5416 @item -fkeep-static-consts
5417 @opindex fkeep-static-consts
5418 Emit variables declared @code{static const} when optimization isn't turned
5419 on, even if the variables aren't referenced.
5420
5421 GCC enables this option by default.  If you want to force the compiler to
5422 check if the variable was referenced, regardless of whether or not
5423 optimization is turned on, use the @option{-fno-keep-static-consts} option.
5424
5425 @item -fmerge-constants
5426 @opindex fmerge-constants
5427 Attempt to merge identical constants (string constants and floating point
5428 constants) across compilation units.
5429
5430 This option is the default for optimized compilation if the assembler and
5431 linker support it.  Use @option{-fno-merge-constants} to inhibit this
5432 behavior.
5433
5434 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5435
5436 @item -fmerge-all-constants
5437 @opindex fmerge-all-constants
5438 Attempt to merge identical constants and identical variables.
5439
5440 This option implies @option{-fmerge-constants}.  In addition to
5441 @option{-fmerge-constants} this considers e.g.@: even constant initialized
5442 arrays or initialized constant variables with integral or floating point
5443 types.  Languages like C or C++ require each non-automatic variable to
5444 have distinct location, so using this option will result in non-conforming
5445 behavior.
5446
5447 @item -fmodulo-sched
5448 @opindex fmodulo-sched
5449 Perform swing modulo scheduling immediately before the first scheduling
5450 pass.  This pass looks at innermost loops and reorders their
5451 instructions by overlapping different iterations.
5452
5453 @item -fmodulo-sched-allow-regmoves
5454 @opindex fmodulo-sched-allow-regmoves
5455 Perform more aggressive SMS based modulo scheduling with register moves
5456 allowed.  By setting this flag certain anti-dependences edges will be
5457 deleted which will trigger the generation of reg-moves based on the
5458 life-range analysis.  This option is effective only with
5459 @option{-fmodulo-sched} enabled.
5460
5461 @item -fno-branch-count-reg
5462 @opindex fno-branch-count-reg
5463 Do not use ``decrement and branch'' instructions on a count register,
5464 but instead generate a sequence of instructions that decrement a
5465 register, compare it against zero, then branch based upon the result.
5466 This option is only meaningful on architectures that support such
5467 instructions, which include x86, PowerPC, IA-64 and S/390.
5468
5469 The default is @option{-fbranch-count-reg}.
5470
5471 @item -fno-function-cse
5472 @opindex fno-function-cse
5473 Do not put function addresses in registers; make each instruction that
5474 calls a constant function contain the function's address explicitly.
5475
5476 This option results in less efficient code, but some strange hacks
5477 that alter the assembler output may be confused by the optimizations
5478 performed when this option is not used.
5479
5480 The default is @option{-ffunction-cse}
5481
5482 @item -fno-zero-initialized-in-bss
5483 @opindex fno-zero-initialized-in-bss
5484 If the target supports a BSS section, GCC by default puts variables that
5485 are initialized to zero into BSS@.  This can save space in the resulting
5486 code.
5487
5488 This option turns off this behavior because some programs explicitly
5489 rely on variables going to the data section.  E.g., so that the
5490 resulting executable can find the beginning of that section and/or make
5491 assumptions based on that.
5492
5493 The default is @option{-fzero-initialized-in-bss}.
5494
5495 @item -fmudflap -fmudflapth -fmudflapir
5496 @opindex fmudflap
5497 @opindex fmudflapth
5498 @opindex fmudflapir
5499 @cindex bounds checking
5500 @cindex mudflap
5501 For front-ends that support it (C and C++), instrument all risky
5502 pointer/array dereferencing operations, some standard library
5503 string/heap functions, and some other associated constructs with
5504 range/validity tests.  Modules so instrumented should be immune to
5505 buffer overflows, invalid heap use, and some other classes of C/C++
5506 programming errors.  The instrumentation relies on a separate runtime
5507 library (@file{libmudflap}), which will be linked into a program if
5508 @option{-fmudflap} is given at link time.  Run-time behavior of the
5509 instrumented program is controlled by the @env{MUDFLAP_OPTIONS}
5510 environment variable.  See @code{env MUDFLAP_OPTIONS=-help a.out}
5511 for its options.
5512
5513 Use @option{-fmudflapth} instead of @option{-fmudflap} to compile and to
5514 link if your program is multi-threaded.  Use @option{-fmudflapir}, in
5515 addition to @option{-fmudflap} or @option{-fmudflapth}, if
5516 instrumentation should ignore pointer reads.  This produces less
5517 instrumentation (and therefore faster execution) and still provides
5518 some protection against outright memory corrupting writes, but allows
5519 erroneously read data to propagate within a program.
5520
5521 @item -fthread-jumps
5522 @opindex fthread-jumps
5523 Perform optimizations where we check to see if a jump branches to a
5524 location where another comparison subsumed by the first is found.  If
5525 so, the first branch is redirected to either the destination of the
5526 second branch or a point immediately following it, depending on whether
5527 the condition is known to be true or false.
5528
5529 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5530
5531 @item -fsplit-wide-types
5532 @opindex fsplit-wide-types
5533 When using a type that occupies multiple registers, such as @code{long
5534 long} on a 32-bit system, split the registers apart and allocate them
5535 independently.  This normally generates better code for those types,
5536 but may make debugging more difficult.
5537
5538 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
5539 @option{-Os}.
5540
5541 @item -fcse-follow-jumps
5542 @opindex fcse-follow-jumps
5543 In common subexpression elimination (CSE), scan through jump instructions
5544 when the target of the jump is not reached by any other path.  For
5545 example, when CSE encounters an @code{if} statement with an
5546 @code{else} clause, CSE will follow the jump when the condition
5547 tested is false.
5548
5549 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5550
5551 @item -fcse-skip-blocks
5552 @opindex fcse-skip-blocks
5553 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
5554 follow jumps which conditionally skip over blocks.  When CSE
5555 encounters a simple @code{if} statement with no else clause,
5556 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
5557 body of the @code{if}.
5558
5559 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5560
5561 @item -frerun-cse-after-loop
5562 @opindex frerun-cse-after-loop
5563 Re-run common subexpression elimination after loop optimizations has been
5564 performed.
5565
5566 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5567
5568 @item -fgcse
5569 @opindex fgcse
5570 Perform a global common subexpression elimination pass.
5571 This pass also performs global constant and copy propagation.
5572
5573 @emph{Note:} When compiling a program using computed gotos, a GCC
5574 extension, you may get better runtime performance if you disable
5575 the global common subexpression elimination pass by adding
5576 @option{-fno-gcse} to the command line.
5577
5578 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5579
5580 @item -fgcse-lm
5581 @opindex fgcse-lm
5582 When @option{-fgcse-lm} is enabled, global common subexpression elimination will
5583 attempt to move loads which are only killed by stores into themselves.  This
5584 allows a loop containing a load/store sequence to be changed to a load outside
5585 the loop, and a copy/store within the loop.
5586
5587 Enabled by default when gcse is enabled.
5588
5589 @item -fgcse-sm
5590 @opindex fgcse-sm
5591 When @option{-fgcse-sm} is enabled, a store motion pass is run after
5592 global common subexpression elimination.  This pass will attempt to move
5593 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
5594 loops containing a load/store sequence can be changed to a load before
5595 the loop and a store after the loop.
5596
5597 Not enabled at any optimization level.
5598
5599 @item -fgcse-las
5600 @opindex fgcse-las
5601 When @option{-fgcse-las} is enabled, the global common subexpression
5602 elimination pass eliminates redundant loads that come after stores to the
5603 same memory location (both partial and full redundancies).
5604
5605 Not enabled at any optimization level.
5606
5607 @item -fgcse-after-reload
5608 @opindex fgcse-after-reload
5609 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
5610 pass is performed after reload.  The purpose of this pass is to cleanup
5611 redundant spilling.
5612
5613 @item -funsafe-loop-optimizations
5614 @opindex funsafe-loop-optimizations
5615 If given, the loop optimizer will assume that loop indices do not
5616 overflow, and that the loops with nontrivial exit condition are not
5617 infinite.  This enables a wider range of loop optimizations even if
5618 the loop optimizer itself cannot prove that these assumptions are valid.
5619 Using @option{-Wunsafe-loop-optimizations}, the compiler will warn you
5620 if it finds this kind of loop.
5621
5622 @item -fcrossjumping
5623 @opindex fcrossjumping
5624 Perform cross-jumping transformation.  This transformation unifies equivalent code and save code size.  The
5625 resulting code may or may not perform better than without cross-jumping.
5626
5627 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5628
5629 @item -fauto-inc-dec
5630 @opindex fauto-inc-dec
5631 Combine increments or decrements of addresses with memory accesses.
5632 This pass is always skipped on architectures that do not have
5633 instructions to support this.  Enabled by default at @option{-O} and
5634 higher on architectures that support this.
5635
5636 @item -fdce
5637 @opindex fdce
5638 Perform dead code elimination (DCE) on RTL@.
5639 Enabled by default at @option{-O} and higher.
5640
5641 @item -fdse
5642 @opindex fdse
5643 Perform dead store elimination (DSE) on RTL@.
5644 Enabled by default at @option{-O} and higher.
5645
5646 @item -fif-conversion
5647 @opindex fif-conversion
5648 Attempt to transform conditional jumps into branch-less equivalents.  This
5649 include use of conditional moves, min, max, set flags and abs instructions, and
5650 some tricks doable by standard arithmetics.  The use of conditional execution
5651 on chips where it is available is controlled by @code{if-conversion2}.
5652
5653 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5654
5655 @item -fif-conversion2
5656 @opindex fif-conversion2
5657 Use conditional execution (where available) to transform conditional jumps into
5658 branch-less equivalents.
5659
5660 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5661
5662 @item -fdelete-null-pointer-checks
5663 @opindex fdelete-null-pointer-checks
5664 Use global dataflow analysis to identify and eliminate useless checks
5665 for null pointers.  The compiler assumes that dereferencing a null
5666 pointer would have halted the program.  If a pointer is checked after
5667 it has already been dereferenced, it cannot be null.
5668
5669 In some environments, this assumption is not true, and programs can
5670 safely dereference null pointers.  Use
5671 @option{-fno-delete-null-pointer-checks} to disable this optimization
5672 for programs which depend on that behavior.
5673
5674 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5675
5676 @item -fexpensive-optimizations
5677 @opindex fexpensive-optimizations
5678 Perform a number of minor optimizations that are relatively expensive.
5679
5680 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5681
5682 @item -foptimize-register-move
5683 @itemx -fregmove
5684 @opindex foptimize-register-move
5685 @opindex fregmove
5686 Attempt to reassign register numbers in move instructions and as
5687 operands of other simple instructions in order to maximize the amount of
5688 register tying.  This is especially helpful on machines with two-operand
5689 instructions.
5690
5691 Note @option{-fregmove} and @option{-foptimize-register-move} are the same
5692 optimization.
5693
5694 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5695
5696 @item -fira
5697 @opindex fira
5698 Use the integrated register allocator (@acronym{IRA}) for register
5699 allocation.  It is a default if @acronym{IRA} has been ported for the
5700 target.
5701
5702 @item -fira-algorithm=@var{algorithm}
5703 Use specified algorithm for the integrated register allocator.  The
5704 @var{algorithm} argument should be one of @code{regional}, @code{CB},
5705 or @code{mixed}.  The second algorithm specifies Chaitin-Briggs
5706 coloring, the first one specifies regional coloring based on
5707 Chaitin-Briggs coloring, and the third one which is the default
5708 specifies a mix of Chaitin-Briggs and regional algorithms where loops
5709 with small register pressure are ignored.  The first algorithm can
5710 give best result for machines with small size and irregular register
5711 set, the second one is faster and generates decent code and the
5712 smallest size code, and the mixed algorithm usually give the best
5713 results in most cases and for most architectures.
5714
5715 @item -fira-coalesce
5716 @opindex fira-coalesce
5717 Do optimistic register coalescing.  This option might be profitable for
5718 architectures with big regular register files.
5719
5720 @item -fno-ira-share-save-slots
5721 @opindex fno-ira-share-save-slots
5722 Switch off sharing stack slots used for saving call used hard
5723 registers living through a call.  Each hard register will get a
5724 separate stack slot and as a result function stack frame will be
5725 bigger.
5726
5727 @item -fno-ira-share-spill-slots
5728 @opindex fno-ira-share-spill-slots
5729 Switch off sharing stack slots allocated for pseudo-registers.  Each
5730 pseudo-register which did not get a hard register will get a separate
5731 stack slot and as a result function stack frame will be bigger.
5732
5733 @item -fira-verbose=@var{n}
5734 @opindex fira-verbose
5735 Set up how verbose dump file for the integrated register allocator
5736 will be.  Default value is 5.  If the value is greater or equal to 10,
5737 the dump file will be stderr as if the value were @var{n} minus 10.
5738
5739 @item -fdelayed-branch
5740 @opindex fdelayed-branch
5741 If supported for the target machine, attempt to reorder instructions
5742 to exploit instruction slots available after delayed branch
5743 instructions.
5744
5745 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5746
5747 @item -fschedule-insns
5748 @opindex fschedule-insns
5749 If supported for the target machine, attempt to reorder instructions to
5750 eliminate execution stalls due to required data being unavailable.  This
5751 helps machines that have slow floating point or memory load instructions
5752 by allowing other instructions to be issued until the result of the load
5753 or floating point instruction is required.
5754
5755 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5756
5757 @item -fschedule-insns2
5758 @opindex fschedule-insns2
5759 Similar to @option{-fschedule-insns}, but requests an additional pass of
5760 instruction scheduling after register allocation has been done.  This is
5761 especially useful on machines with a relatively small number of
5762 registers and where memory load instructions take more than one cycle.
5763
5764 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5765
5766 @item -fno-sched-interblock
5767 @opindex fno-sched-interblock
5768 Don't schedule instructions across basic blocks.  This is normally
5769 enabled by default when scheduling before register allocation, i.e.@:
5770 with @option{-fschedule-insns} or at @option{-O2} or higher.
5771
5772 @item -fno-sched-spec
5773 @opindex fno-sched-spec
5774 Don't allow speculative motion of non-load instructions.  This is normally
5775 enabled by default when scheduling before register allocation, i.e.@:
5776 with @option{-fschedule-insns} or at @option{-O2} or higher.
5777
5778 @item -fsched-spec-load
5779 @opindex fsched-spec-load
5780 Allow speculative motion of some load instructions.  This only makes
5781 sense when scheduling before register allocation, i.e.@: with
5782 @option{-fschedule-insns} or at @option{-O2} or higher.
5783
5784 @item -fsched-spec-load-dangerous
5785 @opindex fsched-spec-load-dangerous
5786 Allow speculative motion of more load instructions.  This only makes
5787 sense when scheduling before register allocation, i.e.@: with
5788 @option{-fschedule-insns} or at @option{-O2} or higher.
5789
5790 @item -fsched-stalled-insns
5791 @itemx -fsched-stalled-insns=@var{n}
5792 @opindex fsched-stalled-insns
5793 Define how many insns (if any) can be moved prematurely from the queue
5794 of stalled insns into the ready list, during the second scheduling pass.
5795 @option{-fno-sched-stalled-insns} means that no insns will be moved
5796 prematurely, @option{-fsched-stalled-insns=0} means there is no limit
5797 on how many queued insns can be moved prematurely.
5798 @option{-fsched-stalled-insns} without a value is equivalent to
5799 @option{-fsched-stalled-insns=1}.
5800
5801 @item -fsched-stalled-insns-dep
5802 @itemx -fsched-stalled-insns-dep=@var{n}
5803 @opindex fsched-stalled-insns-dep
5804 Define how many insn groups (cycles) will be examined for a dependency
5805 on a stalled insn that is candidate for premature removal from the queue
5806 of stalled insns.  This has an effect only during the second scheduling pass,
5807 and only if @option{-fsched-stalled-insns} is used.
5808 @option{-fno-sched-stalled-insns-dep} is equivalent to
5809 @option{-fsched-stalled-insns-dep=0}.
5810 @option{-fsched-stalled-insns-dep} without a value is equivalent to
5811 @option{-fsched-stalled-insns-dep=1}.
5812
5813 @item -fsched2-use-superblocks
5814 @opindex fsched2-use-superblocks
5815 When scheduling after register allocation, do use superblock scheduling
5816 algorithm.  Superblock scheduling allows motion across basic block boundaries
5817 resulting on faster schedules.  This option is experimental, as not all machine
5818 descriptions used by GCC model the CPU closely enough to avoid unreliable
5819 results from the algorithm.
5820
5821 This only makes sense when scheduling after register allocation, i.e.@: with
5822 @option{-fschedule-insns2} or at @option{-O2} or higher.
5823
5824 @item -fsched2-use-traces
5825 @opindex fsched2-use-traces
5826 Use @option{-fsched2-use-superblocks} algorithm when scheduling after register
5827 allocation and additionally perform code duplication in order to increase the
5828 size of superblocks using tracer pass.  See @option{-ftracer} for details on
5829 trace formation.
5830
5831 This mode should produce faster but significantly longer programs.  Also
5832 without @option{-fbranch-probabilities} the traces constructed may not
5833 match the reality and hurt the performance.  This only makes
5834 sense when scheduling after register allocation, i.e.@: with
5835 @option{-fschedule-insns2} or at @option{-O2} or higher.
5836
5837 @item -fsee
5838 @opindex fsee
5839 Eliminate redundant sign extension instructions and move the non-redundant
5840 ones to optimal placement using lazy code motion (LCM).
5841
5842 @item -freschedule-modulo-scheduled-loops
5843 @opindex freschedule-modulo-scheduled-loops
5844 The modulo scheduling comes before the traditional scheduling, if a loop
5845 was modulo scheduled we may want to prevent the later scheduling passes
5846 from changing its schedule, we use this option to control that.
5847
5848 @item -fselective-scheduling
5849 @opindex fselective-scheduling
5850 Schedule instructions using selective scheduling algorithm.  Selective
5851 scheduling runs instead of the first scheduler pass.
5852
5853 @item -fselective-scheduling2
5854 @opindex fselective-scheduling2
5855 Schedule instructions using selective scheduling algorithm.  Selective
5856 scheduling runs instead of the second scheduler pass.
5857
5858 @item -fsel-sched-pipelining
5859 @opindex fsel-sched-pipelining
5860 Enable software pipelining of innermost loops during selective scheduling.  
5861 This option has no effect until one of @option{-fselective-scheduling} or 
5862 @option{-fselective-scheduling2} is turned on.
5863
5864 @item -fsel-sched-pipelining-outer-loops
5865 @opindex fsel-sched-pipelining-outer-loops
5866 When pipelining loops during selective scheduling, also pipeline outer loops.
5867 This option has no effect until @option{-fsel-sched-pipelining} is turned on.
5868
5869 @item -fcaller-saves
5870 @opindex fcaller-saves
5871 Enable values to be allocated in registers that will be clobbered by
5872 function calls, by emitting extra instructions to save and restore the
5873 registers around such calls.  Such allocation is done only when it
5874 seems to result in better code than would otherwise be produced.
5875
5876 This option is always enabled by default on certain machines, usually
5877 those which have no call-preserved registers to use instead.
5878
5879 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5880
5881 @item -fconserve-stack
5882 @opindex fconserve-stack
5883 Attempt to minimize stack usage.  The compiler will attempt to use less
5884 stack space, even if that makes the program slower.  This option
5885 implies setting the @option{large-stack-frame} parameter to 100
5886 and the @option{large-stack-frame-growth} parameter to 400.
5887
5888 @item -ftree-reassoc
5889 @opindex ftree-reassoc
5890 Perform reassociation on trees.  This flag is enabled by default
5891 at @option{-O} and higher.
5892
5893 @item -ftree-pre
5894 @opindex ftree-pre
5895 Perform partial redundancy elimination (PRE) on trees.  This flag is
5896 enabled by default at @option{-O2} and @option{-O3}.
5897
5898 @item -ftree-fre
5899 @opindex ftree-fre
5900 Perform full redundancy elimination (FRE) on trees.  The difference
5901 between FRE and PRE is that FRE only considers expressions
5902 that are computed on all paths leading to the redundant computation.
5903 This analysis is faster than PRE, though it exposes fewer redundancies.
5904 This flag is enabled by default at @option{-O} and higher.
5905
5906 @item -ftree-copy-prop
5907 @opindex ftree-copy-prop
5908 Perform copy propagation on trees.  This pass eliminates unnecessary
5909 copy operations.  This flag is enabled by default at @option{-O} and
5910 higher.
5911
5912 @item -fipa-pure-const
5913 @opindex fipa-pure-const
5914 Discover which functions are pure or constant.
5915 Enabled by default at @option{-O} and higher.
5916
5917 @item -fipa-reference
5918 @opindex fipa-reference
5919 Discover which static variables do not escape cannot escape the
5920 compilation unit.
5921 Enabled by default at @option{-O} and higher.
5922
5923 @item -fipa-struct-reorg
5924 @opindex fipa-struct-reorg
5925 Perform structure reorganization optimization, that change C-like structures 
5926 layout in order to better utilize spatial locality.  This transformation is 
5927 affective for programs containing arrays of structures.  Available in two 
5928 compilation modes: profile-based (enabled with @option{-fprofile-generate})
5929 or static (which uses built-in heuristics).  Require @option{-fipa-type-escape}
5930 to provide the safety of this transformation.  It works only in whole program
5931 mode, so it requires @option{-fwhole-program} and @option{-combine} to be
5932 enabled.  Structures considered @samp{cold} by this transformation are not
5933 affected (see @option{--param struct-reorg-cold-struct-ratio=@var{value}}).
5934
5935 With this flag, the program debug info reflects a new structure layout.
5936
5937 @item -fipa-pta
5938 @opindex fipa-pta
5939 Perform interprocedural pointer analysis.  This option is experimental
5940 and does not affect generated code.
5941
5942 @item -fipa-cp
5943 @opindex fipa-cp
5944 Perform interprocedural constant propagation.
5945 This optimization analyzes the program to determine when values passed
5946 to functions are constants and then optimizes accordingly.  
5947 This optimization can substantially increase performance
5948 if the application has constants passed to functions.
5949 This flag is enabled by default at @option{-O2}, @option{-Os} and @option{-O3}.
5950
5951 @item -fipa-cp-clone
5952 @opindex fipa-cp-clone
5953 Perform function cloning to make interprocedural constant propagation stronger.
5954 When enabled, interprocedural constant propagation will perform function cloning
5955 when externally visible function can be called with constant arguments.
5956 Because this optimization can create multiple copies of functions,
5957 it may significantly increase code size
5958 (see @option{--param ipcp-unit-growth=@var{value}}).
5959 This flag is enabled by default at @option{-O3}.
5960
5961 @item -fipa-matrix-reorg
5962 @opindex fipa-matrix-reorg
5963 Perform matrix flattening and transposing.
5964 Matrix flattening tries to replace a m-dimensional matrix 
5965 with its equivalent n-dimensional matrix, where n < m.
5966 This reduces the level of indirection needed for accessing the elements
5967 of the matrix. The second optimization is matrix transposing that
5968 attemps to change the order of the matrix's dimensions in order to 
5969 improve cache locality.
5970 Both optimizations need fwhole-program flag. 
5971 Transposing is enabled only if profiling information is avaliable.
5972
5973
5974 @item -ftree-sink
5975 @opindex ftree-sink
5976 Perform forward store motion  on trees.  This flag is
5977 enabled by default at @option{-O} and higher.
5978
5979 @item -ftree-ccp
5980 @opindex ftree-ccp
5981 Perform sparse conditional constant propagation (CCP) on trees.  This
5982 pass only operates on local scalar variables and is enabled by default
5983 at @option{-O} and higher.
5984
5985 @item -ftree-switch-conversion
5986 Perform conversion of simple initializations in a switch to
5987 initializations from a scalar array.  This flag is enabled by default
5988 at @option{-O2} and higher.
5989
5990 @item -ftree-dce
5991 @opindex ftree-dce
5992 Perform dead code elimination (DCE) on trees.  This flag is enabled by
5993 default at @option{-O} and higher.
5994
5995 @item -ftree-builtin-call-dce
5996 @opindex ftree-builtin-call-dce
5997 Perform conditional dead code elimination (DCE) for calls to builtin functions 
5998 that may set @code{errno} but are otherwise side-effect free.  This flag is 
5999 enabled by default at @option{-O2} and higher if @option{-Os} is not also 
6000 specified.
6001
6002 @item -ftree-dominator-opts
6003 @opindex ftree-dominator-opts
6004 Perform a variety of simple scalar cleanups (constant/copy
6005 propagation, redundancy elimination, range propagation and expression
6006 simplification) based on a dominator tree traversal.  This also
6007 performs jump threading (to reduce jumps to jumps). This flag is
6008 enabled by default at @option{-O} and higher.
6009
6010 @item -ftree-dse
6011 @opindex ftree-dse
6012 Perform dead store elimination (DSE) on trees.  A dead store is a store into
6013 a memory location which will later be overwritten by another store without
6014 any intervening loads.  In this case the earlier store can be deleted.  This
6015 flag is enabled by default at @option{-O} and higher.
6016
6017 @item -ftree-ch
6018 @opindex ftree-ch
6019 Perform loop header copying on trees.  This is beneficial since it increases
6020 effectiveness of code motion optimizations.  It also saves one jump.  This flag
6021 is enabled by default at @option{-O} and higher.  It is not enabled
6022 for @option{-Os}, since it usually increases code size.
6023
6024 @item -ftree-loop-optimize
6025 @opindex ftree-loop-optimize
6026 Perform loop optimizations on trees.  This flag is enabled by default
6027 at @option{-O} and higher.
6028
6029 @item -ftree-loop-linear
6030 @opindex ftree-loop-linear
6031 Perform linear loop transformations on tree.  This flag can improve cache
6032 performance and allow further loop optimizations to take place.
6033
6034 @item -floop-interchange
6035 Perform loop interchange transformations on loops.  Interchanging two
6036 nested loops switches the inner and outer loops.  For example, given a
6037 loop like:
6038 @smallexample
6039 DO J = 1, M
6040   DO I = 1, N
6041     A(J, I) = A(J, I) * C
6042   ENDDO
6043 ENDDO
6044 @end smallexample
6045 loop interchange will transform the loop as if the user had written:
6046 @smallexample
6047 DO I = 1, N
6048   DO J = 1, M
6049     A(J, I) = A(J, I) * C
6050   ENDDO
6051 ENDDO
6052 @end smallexample
6053 which can be beneficial when @code{N} is larger than the caches,
6054 because in Fortran, the elements of an array are stored in memory
6055 contiguously by column, and the original loop iterates over rows,
6056 potentially creating at each access a cache miss.  This optimization
6057 applies to all the languages supported by GCC and is not limited to
6058 Fortran.
6059
6060 @item -floop-strip-mine
6061 Perform loop strip mining transformations on loops.  Strip mining
6062 splits a loop into two nested loops.  The outer loop has strides 
6063 equal to the strip size and the inner loop has strides of the 
6064 original loop within a strip.  For example, given a loop like:
6065 @smallexample
6066 DO I = 1, N
6067   A(I) = A(I) + C
6068 ENDDO
6069 @end smallexample
6070 loop strip mining will transform the loop as if the user had written:
6071 @smallexample
6072 DO II = 1, N, 4
6073   DO I = II, min (II + 4, N)
6074     A(I) = A(I) + C
6075   ENDDO
6076 ENDDO
6077 @end smallexample
6078 This optimization applies to all the languages supported by GCC and is
6079 not limited to Fortran.
6080
6081 @item -floop-block
6082 Perform loop blocking transformations on loops.  Blocking strip mines
6083 each loop in the loop nest such that the memory accesses of the
6084 element loops fit inside caches.  For example, given a loop like:
6085 @smallexample
6086 DO I = 1, N
6087   DO J = 1, M
6088     A(J, I) = B(I) + C(J)
6089   ENDDO
6090 ENDDO
6091 @end smallexample
6092 loop blocking will transform the loop as if the user had written:
6093 @smallexample
6094 DO II = 1, N, 64
6095   DO JJ = 1, M, 64
6096     DO I = II, min (II + 64, N)
6097       DO J = JJ, min (JJ + 64, M)
6098         A(J, I) = B(I) + C(J)
6099       ENDDO
6100     ENDDO
6101   ENDDO
6102 ENDDO
6103 @end smallexample
6104 which can be beneficial when @code{M} is larger than the caches,
6105 because the innermost loop will iterate over a smaller amount of data
6106 that can be kept in the caches.  This optimization applies to all the
6107 languages supported by GCC and is not limited to Fortran.
6108
6109 @item -fcheck-data-deps
6110 @opindex fcheck-data-deps
6111 Compare the results of several data dependence analyzers.  This option
6112 is used for debugging the data dependence analyzers.
6113
6114 @item -ftree-loop-distribution
6115 Perform loop distribution.  This flag can improve cache performance on
6116 big loop bodies and allow further loop optimizations, like
6117 parallelization or vectorization, to take place.  For example, the loop
6118 @smallexample
6119 DO I = 1, N
6120   A(I) = B(I) + C
6121   D(I) = E(I) * F
6122 ENDDO
6123 @end smallexample
6124 is transformed to
6125 @smallexample
6126 DO I = 1, N
6127    A(I) = B(I) + C
6128 ENDDO
6129 DO I = 1, N
6130    D(I) = E(I) * F
6131 ENDDO
6132 @end smallexample
6133
6134 @item -ftree-loop-im
6135 @opindex ftree-loop-im
6136 Perform loop invariant motion on trees.  This pass moves only invariants that
6137 would be hard to handle at RTL level (function calls, operations that expand to
6138 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
6139 operands of conditions that are invariant out of the loop, so that we can use
6140 just trivial invariantness analysis in loop unswitching.  The pass also includes
6141 store motion.
6142
6143 @item -ftree-loop-ivcanon
6144 @opindex ftree-loop-ivcanon
6145 Create a canonical counter for number of iterations in the loop for that
6146 determining number of iterations requires complicated analysis.  Later
6147 optimizations then may determine the number easily.  Useful especially
6148 in connection with unrolling.
6149
6150 @item -fivopts
6151 @opindex fivopts
6152 Perform induction variable optimizations (strength reduction, induction
6153 variable merging and induction variable elimination) on trees.
6154
6155 @item -ftree-parallelize-loops=n
6156 @opindex ftree-parallelize-loops
6157 Parallelize loops, i.e., split their iteration space to run in n threads.
6158 This is only possible for loops whose iterations are independent
6159 and can be arbitrarily reordered.  The optimization is only
6160 profitable on multiprocessor machines, for loops that are CPU-intensive,
6161 rather than constrained e.g.@: by memory bandwidth.  This option
6162 implies @option{-pthread}, and thus is only supported on targets
6163 that have support for @option{-pthread}.
6164
6165 @item -ftree-sra
6166 @opindex ftree-sra
6167 Perform scalar replacement of aggregates.  This pass replaces structure
6168 references with scalars to prevent committing structures to memory too
6169 early.  This flag is enabled by default at @option{-O} and higher.
6170
6171 @item -ftree-copyrename
6172 @opindex ftree-copyrename
6173 Perform copy renaming on trees.  This pass attempts to rename compiler
6174 temporaries to other variables at copy locations, usually resulting in
6175 variable names which more closely resemble the original variables.  This flag
6176 is enabled by default at @option{-O} and higher.
6177
6178 @item -ftree-ter
6179 @opindex ftree-ter
6180 Perform temporary expression replacement during the SSA->normal phase.  Single
6181 use/single def temporaries are replaced at their use location with their
6182 defining expression.  This results in non-GIMPLE code, but gives the expanders
6183 much more complex trees to work on resulting in better RTL generation.  This is
6184 enabled by default at @option{-O} and higher.
6185
6186 @item -ftree-vectorize
6187 @opindex ftree-vectorize
6188 Perform loop vectorization on trees. This flag is enabled by default at
6189 @option{-O3}.
6190
6191 @item -ftree-vect-loop-version
6192 @opindex ftree-vect-loop-version
6193 Perform loop versioning when doing loop vectorization on trees.  When a loop
6194 appears to be vectorizable except that data alignment or data dependence cannot
6195 be determined at compile time then vectorized and non-vectorized versions of
6196 the loop are generated along with runtime checks for alignment or dependence
6197 to control which version is executed.  This option is enabled by default
6198 except at level @option{-Os} where it is disabled.
6199
6200 @item -fvect-cost-model
6201 @opindex fvect-cost-model
6202 Enable cost model for vectorization.
6203
6204 @item -ftree-vrp
6205 @opindex ftree-vrp
6206 Perform Value Range Propagation on trees.  This is similar to the
6207 constant propagation pass, but instead of values, ranges of values are
6208 propagated.  This allows the optimizers to remove unnecessary range
6209 checks like array bound checks and null pointer checks.  This is
6210 enabled by default at @option{-O2} and higher.  Null pointer check
6211 elimination is only done if @option{-fdelete-null-pointer-checks} is
6212 enabled.
6213
6214 @item -ftracer
6215 @opindex ftracer
6216 Perform tail duplication to enlarge superblock size.  This transformation
6217 simplifies the control flow of the function allowing other optimizations to do
6218 better job.
6219
6220 @item -funroll-loops
6221 @opindex funroll-loops
6222 Unroll loops whose number of iterations can be determined at compile
6223 time or upon entry to the loop.  @option{-funroll-loops} implies
6224 @option{-frerun-cse-after-loop}.  This option makes code larger,
6225 and may or may not make it run faster.
6226
6227 @item -funroll-all-loops
6228 @opindex funroll-all-loops
6229 Unroll all loops, even if their number of iterations is uncertain when
6230 the loop is entered.  This usually makes programs run more slowly.
6231 @option{-funroll-all-loops} implies the same options as
6232 @option{-funroll-loops},
6233
6234 @item -fsplit-ivs-in-unroller
6235 @opindex fsplit-ivs-in-unroller
6236 Enables expressing of values of induction variables in later iterations
6237 of the unrolled loop using the value in the first iteration.  This breaks
6238 long dependency chains, thus improving efficiency of the scheduling passes.
6239
6240 Combination of @option{-fweb} and CSE is often sufficient to obtain the
6241 same effect.  However in cases the loop body is more complicated than
6242 a single basic block, this is not reliable.  It also does not work at all
6243 on some of the architectures due to restrictions in the CSE pass.
6244
6245 This optimization is enabled by default.
6246
6247 @item -fvariable-expansion-in-unroller
6248 @opindex fvariable-expansion-in-unroller
6249 With this option, the compiler will create multiple copies of some
6250 local variables when unrolling a loop which can result in superior code.
6251
6252 @item -fpredictive-commoning
6253 @opindex fpredictive-commoning
6254 Perform predictive commoning optimization, i.e., reusing computations
6255 (especially memory loads and stores) performed in previous
6256 iterations of loops.
6257
6258 This option is enabled at level @option{-O3}.
6259
6260 @item -fprefetch-loop-arrays
6261 @opindex fprefetch-loop-arrays
6262 If supported by the target machine, generate instructions to prefetch
6263 memory to improve the performance of loops that access large arrays.
6264
6265 This option may generate better or worse code; results are highly
6266 dependent on the structure of loops within the source code.
6267
6268 Disabled at level @option{-Os}.
6269
6270 @item -fno-peephole
6271 @itemx -fno-peephole2
6272 @opindex fno-peephole
6273 @opindex fno-peephole2
6274 Disable any machine-specific peephole optimizations.  The difference
6275 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
6276 are implemented in the compiler; some targets use one, some use the
6277 other, a few use both.
6278
6279 @option{-fpeephole} is enabled by default.
6280 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6281
6282 @item -fno-guess-branch-probability
6283 @opindex fno-guess-branch-probability
6284 Do not guess branch probabilities using heuristics.
6285
6286 GCC will use heuristics to guess branch probabilities if they are
6287 not provided by profiling feedback (@option{-fprofile-arcs}).  These
6288 heuristics are based on the control flow graph.  If some branch probabilities
6289 are specified by @samp{__builtin_expect}, then the heuristics will be
6290 used to guess branch probabilities for the rest of the control flow graph,
6291 taking the @samp{__builtin_expect} info into account.  The interactions
6292 between the heuristics and @samp{__builtin_expect} can be complex, and in
6293 some cases, it may be useful to disable the heuristics so that the effects
6294 of @samp{__builtin_expect} are easier to understand.
6295
6296 The default is @option{-fguess-branch-probability} at levels
6297 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6298
6299 @item -freorder-blocks
6300 @opindex freorder-blocks
6301 Reorder basic blocks in the compiled function in order to reduce number of
6302 taken branches and improve code locality.
6303
6304 Enabled at levels @option{-O2}, @option{-O3}.
6305
6306 @item -freorder-blocks-and-partition
6307 @opindex freorder-blocks-and-partition
6308 In addition to reordering basic blocks in the compiled function, in order
6309 to reduce number of taken branches, partitions hot and cold basic blocks
6310 into separate sections of the assembly and .o files, to improve
6311 paging and cache locality performance.
6312
6313 This optimization is automatically turned off in the presence of
6314 exception handling, for linkonce sections, for functions with a user-defined
6315 section attribute and on any architecture that does not support named
6316 sections.
6317
6318 @item -freorder-functions
6319 @opindex freorder-functions
6320 Reorder functions in the object file in order to
6321 improve code locality.  This is implemented by using special
6322 subsections @code{.text.hot} for most frequently executed functions and
6323 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
6324 the linker so object file format must support named sections and linker must
6325 place them in a reasonable way.
6326
6327 Also profile feedback must be available in to make this option effective.  See
6328 @option{-fprofile-arcs} for details.
6329
6330 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6331
6332 @item -fstrict-aliasing
6333 @opindex fstrict-aliasing
6334 Allows the compiler to assume the strictest aliasing rules applicable to
6335 the language being compiled.  For C (and C++), this activates
6336 optimizations based on the type of expressions.  In particular, an
6337 object of one type is assumed never to reside at the same address as an
6338 object of a different type, unless the types are almost the same.  For
6339 example, an @code{unsigned int} can alias an @code{int}, but not a
6340 @code{void*} or a @code{double}.  A character type may alias any other
6341 type.
6342
6343 @anchor{Type-punning}Pay special attention to code like this:
6344 @smallexample
6345 union a_union @{
6346   int i;
6347   double d;
6348 @};
6349
6350 int f() @{
6351   a_union t;
6352   t.d = 3.0;
6353   return t.i;
6354 @}
6355 @end smallexample
6356 The practice of reading from a different union member than the one most
6357 recently written to (called ``type-punning'') is common.  Even with
6358 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
6359 is accessed through the union type.  So, the code above will work as
6360 expected.  @xref{Structures unions enumerations and bit-fields
6361 implementation}.  However, this code might not:
6362 @smallexample
6363 int f() @{
6364   a_union t;
6365   int* ip;
6366   t.d = 3.0;
6367   ip = &t.i;
6368   return *ip;
6369 @}
6370 @end smallexample
6371
6372 Similarly, access by taking the address, casting the resulting pointer
6373 and dereferencing the result has undefined behavior, even if the cast
6374 uses a union type, e.g.:
6375 @smallexample
6376 int f() @{
6377   double d = 3.0;
6378   return ((union a_union *) &d)->i;
6379 @}
6380 @end smallexample
6381
6382 The @option{-fstrict-aliasing} option is enabled at levels
6383 @option{-O2}, @option{-O3}, @option{-Os}.
6384
6385 @item -fstrict-overflow
6386 @opindex fstrict-overflow
6387 Allow the compiler to assume strict signed overflow rules, depending
6388 on the language being compiled.  For C (and C++) this means that
6389 overflow when doing arithmetic with signed numbers is undefined, which
6390 means that the compiler may assume that it will not happen.  This
6391 permits various optimizations.  For example, the compiler will assume
6392 that an expression like @code{i + 10 > i} will always be true for
6393 signed @code{i}.  This assumption is only valid if signed overflow is
6394 undefined, as the expression is false if @code{i + 10} overflows when
6395 using twos complement arithmetic.  When this option is in effect any
6396 attempt to determine whether an operation on signed numbers will
6397 overflow must be written carefully to not actually involve overflow.
6398
6399 This option also allows the compiler to assume strict pointer
6400 semantics: given a pointer to an object, if adding an offset to that
6401 pointer does not produce a pointer to the same object, the addition is
6402 undefined.  This permits the compiler to conclude that @code{p + u >
6403 p} is always true for a pointer @code{p} and unsigned integer
6404 @code{u}.  This assumption is only valid because pointer wraparound is
6405 undefined, as the expression is false if @code{p + u} overflows using
6406 twos complement arithmetic.
6407
6408 See also the @option{-fwrapv} option.  Using @option{-fwrapv} means
6409 that integer signed overflow is fully defined: it wraps.  When
6410 @option{-fwrapv} is used, there is no difference between
6411 @option{-fstrict-overflow} and @option{-fno-strict-overflow} for
6412 integers.  With @option{-fwrapv} certain types of overflow are
6413 permitted.  For example, if the compiler gets an overflow when doing
6414 arithmetic on constants, the overflowed value can still be used with
6415 @option{-fwrapv}, but not otherwise.
6416
6417 The @option{-fstrict-overflow} option is enabled at levels
6418 @option{-O2}, @option{-O3}, @option{-Os}.
6419
6420 @item -falign-functions
6421 @itemx -falign-functions=@var{n}
6422 @opindex falign-functions
6423 Align the start of functions to the next power-of-two greater than
6424 @var{n}, skipping up to @var{n} bytes.  For instance,
6425 @option{-falign-functions=32} aligns functions to the next 32-byte
6426 boundary, but @option{-falign-functions=24} would align to the next
6427 32-byte boundary only if this can be done by skipping 23 bytes or less.
6428
6429 @option{-fno-align-functions} and @option{-falign-functions=1} are
6430 equivalent and mean that functions will not be aligned.
6431
6432 Some assemblers only support this flag when @var{n} is a power of two;
6433 in that case, it is rounded up.
6434
6435 If @var{n} is not specified or is zero, use a machine-dependent default.
6436
6437 Enabled at levels @option{-O2}, @option{-O3}.
6438
6439 @item -falign-labels
6440 @itemx -falign-labels=@var{n}
6441 @opindex falign-labels
6442 Align all branch targets to a power-of-two boundary, skipping up to
6443 @var{n} bytes like @option{-falign-functions}.  This option can easily
6444 make code slower, because it must insert dummy operations for when the
6445 branch target is reached in the usual flow of the code.
6446
6447 @option{-fno-align-labels} and @option{-falign-labels=1} are
6448 equivalent and mean that labels will not be aligned.
6449
6450 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
6451 are greater than this value, then their values are used instead.
6452
6453 If @var{n} is not specified or is zero, use a machine-dependent default
6454 which is very likely to be @samp{1}, meaning no alignment.
6455
6456 Enabled at levels @option{-O2}, @option{-O3}.
6457
6458 @item -falign-loops
6459 @itemx -falign-loops=@var{n}
6460 @opindex falign-loops
6461 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
6462 like @option{-falign-functions}.  The hope is that the loop will be
6463 executed many times, which will make up for any execution of the dummy
6464 operations.
6465
6466 @option{-fno-align-loops} and @option{-falign-loops=1} are
6467 equivalent and mean that loops will not be aligned.
6468
6469 If @var{n} is not specified or is zero, use a machine-dependent default.
6470
6471 Enabled at levels @option{-O2}, @option{-O3}.
6472
6473 @item -falign-jumps
6474 @itemx -falign-jumps=@var{n}
6475 @opindex falign-jumps
6476 Align branch targets to a power-of-two boundary, for branch targets
6477 where the targets can only be reached by jumping, skipping up to @var{n}
6478 bytes like @option{-falign-functions}.  In this case, no dummy operations
6479 need be executed.
6480
6481 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
6482 equivalent and mean that loops will not be aligned.
6483
6484 If @var{n} is not specified or is zero, use a machine-dependent default.
6485
6486 Enabled at levels @option{-O2}, @option{-O3}.
6487
6488 @item -funit-at-a-time
6489 @opindex funit-at-a-time
6490 This option is left for compatibility reasons. @option{-funit-at-a-time}
6491 has no effect, while @option{-fno-unit-at-a-time} implies
6492 @option{-fno-toplevel-reorder} and @option{-fno-section-anchors}.
6493
6494 Enabled by default.
6495
6496 @item -fno-toplevel-reorder
6497 @opindex fno-toplevel-reorder
6498 Do not reorder top-level functions, variables, and @code{asm}
6499 statements.  Output them in the same order that they appear in the
6500 input file.  When this option is used, unreferenced static variables
6501 will not be removed.  This option is intended to support existing code
6502 which relies on a particular ordering.  For new code, it is better to
6503 use attributes.
6504
6505 Enabled at level @option{-O0}.  When disabled explicitly, it also imply
6506 @option{-fno-section-anchors} that is otherwise enabled at @option{-O0} on some
6507 targets.
6508
6509 @item -fweb
6510 @opindex fweb
6511 Constructs webs as commonly used for register allocation purposes and assign
6512 each web individual pseudo register.  This allows the register allocation pass
6513 to operate on pseudos directly, but also strengthens several other optimization
6514 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
6515 however, make debugging impossible, since variables will no longer stay in a
6516 ``home register''.
6517
6518 Enabled by default with @option{-funroll-loops}.
6519
6520 @item -fwhole-program
6521 @opindex fwhole-program
6522 Assume that the current compilation unit represents whole program being
6523 compiled.  All public functions and variables with the exception of @code{main}
6524 and those merged by attribute @code{externally_visible} become static functions
6525 and in a affect gets more aggressively optimized by interprocedural optimizers.
6526 While this option is equivalent to proper use of @code{static} keyword for
6527 programs consisting of single file, in combination with option
6528 @option{--combine} this flag can be used to compile most of smaller scale C
6529 programs since the functions and variables become local for the whole combined
6530 compilation unit, not for the single source file itself.
6531
6532 This option is not supported for Fortran programs.
6533
6534 @item -fcprop-registers
6535 @opindex fcprop-registers
6536 After register allocation and post-register allocation instruction splitting,
6537 we perform a copy-propagation pass to try to reduce scheduling dependencies
6538 and occasionally eliminate the copy.
6539
6540 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6541
6542 @item -fprofile-correction
6543 @opindex fprofile-correction
6544 Profiles collected using an instrumented binary for multi-threaded programs may
6545 be inconsistent due to missed counter updates. When this option is specified,
6546 GCC will use heuristics to correct or smooth out such inconsistencies. By
6547 default, GCC will emit an error message when an inconsistent profile is detected.
6548
6549 @item -fprofile-dir=@var{path}
6550 @opindex fprofile-dir
6551
6552 Set the directory to search the profile data files in to @var{path}.
6553 This option affects only the profile data generated by
6554 @option{-fprofile-generate}, @option{-ftest-coverage}, @option{-fprofile-arcs}
6555 and used by @option{-fprofile-use} and @option{-fbranch-probabilities} 
6556 and its related options.
6557 By default, GCC will use the current directory as @var{path}
6558 thus the profile data file will appear in the same directory as the object file.
6559
6560 @item -fprofile-generate
6561 @itemx -fprofile-generate=@var{path}
6562 @opindex fprofile-generate
6563
6564 Enable options usually used for instrumenting application to produce
6565 profile useful for later recompilation with profile feedback based
6566 optimization.  You must use @option{-fprofile-generate} both when
6567 compiling and when linking your program.
6568
6569 The following options are enabled: @code{-fprofile-arcs}, @code{-fprofile-values}, @code{-fvpt}.
6570
6571 If @var{path} is specified, GCC will look at the @var{path} to find
6572 the profile feeedback data files. See @option{-fprofile-dir}.
6573
6574 @item -fprofile-use
6575 @itemx -fprofile-use=@var{path}
6576 @opindex fprofile-use
6577 Enable profile feedback directed optimizations, and optimizations
6578 generally profitable only with profile feedback available.
6579
6580 The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt},
6581 @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}
6582
6583 By default, GCC emits an error message if the feedback profiles do not
6584 match the source code.  This error can be turned into a warning by using
6585 @option{-Wcoverage-mismatch}.  Note this may result in poorly optimized
6586 code.
6587
6588 If @var{path} is specified, GCC will look at the @var{path} to find
6589 the profile feedback data files. See @option{-fprofile-dir}.
6590 @end table
6591
6592 The following options control compiler behavior regarding floating
6593 point arithmetic.  These options trade off between speed and
6594 correctness.  All must be specifically enabled.
6595
6596 @table @gcctabopt
6597 @item -ffloat-store
6598 @opindex ffloat-store
6599 Do not store floating point variables in registers, and inhibit other
6600 options that might change whether a floating point value is taken from a
6601 register or memory.
6602
6603 @cindex floating point precision
6604 This option prevents undesirable excess precision on machines such as
6605 the 68000 where the floating registers (of the 68881) keep more
6606 precision than a @code{double} is supposed to have.  Similarly for the
6607 x86 architecture.  For most programs, the excess precision does only
6608 good, but a few programs rely on the precise definition of IEEE floating
6609 point.  Use @option{-ffloat-store} for such programs, after modifying
6610 them to store all pertinent intermediate computations into variables.
6611
6612 @item -ffast-math
6613 @opindex ffast-math
6614 Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations},
6615 @option{-ffinite-math-only}, @option{-fno-rounding-math},
6616 @option{-fno-signaling-nans} and @option{-fcx-limited-range}.
6617
6618 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
6619
6620 This option is not turned on by any @option{-O} option since
6621 it can result in incorrect output for programs which depend on
6622 an exact implementation of IEEE or ISO rules/specifications for
6623 math functions. It may, however, yield faster code for programs
6624 that do not require the guarantees of these specifications.
6625
6626 @item -fno-math-errno
6627 @opindex fno-math-errno
6628 Do not set ERRNO after calling math functions that are executed
6629 with a single instruction, e.g., sqrt.  A program that relies on
6630 IEEE exceptions for math error handling may want to use this flag
6631 for speed while maintaining IEEE arithmetic compatibility.
6632
6633 This option is not turned on by any @option{-O} option since
6634 it can result in incorrect output for programs which depend on
6635 an exact implementation of IEEE or ISO rules/specifications for
6636 math functions. It may, however, yield faster code for programs
6637 that do not require the guarantees of these specifications.
6638
6639 The default is @option{-fmath-errno}.
6640
6641 On Darwin systems, the math library never sets @code{errno}.  There is
6642 therefore no reason for the compiler to consider the possibility that
6643 it might, and @option{-fno-math-errno} is the default.
6644
6645 @item -funsafe-math-optimizations
6646 @opindex funsafe-math-optimizations
6647
6648 Allow optimizations for floating-point arithmetic that (a) assume
6649 that arguments and results are valid and (b) may violate IEEE or
6650 ANSI standards.  When used at link-time, it may include libraries
6651 or startup files that change the default FPU control word or other
6652 similar optimizations.
6653
6654 This option is not turned on by any @option{-O} option since
6655 it can result in incorrect output for programs which depend on
6656 an exact implementation of IEEE or ISO rules/specifications for
6657 math functions. It may, however, yield faster code for programs
6658 that do not require the guarantees of these specifications.
6659 Enables @option{-fno-signed-zeros}, @option{-fno-trapping-math},
6660 @option{-fassociative-math} and @option{-freciprocal-math}.
6661
6662 The default is @option{-fno-unsafe-math-optimizations}.
6663
6664 @item -fassociative-math
6665 @opindex fassociative-math
6666
6667 Allow re-association of operands in series of floating-point operations.
6668 This violates the ISO C and C++ language standard by possibly changing
6669 computation result.  NOTE: re-ordering may change the sign of zero as
6670 well as ignore NaNs and inhibit or create underflow or overflow (and
6671 thus cannot be used on a code which relies on rounding behavior like
6672 @code{(x + 2**52) - 2**52)}.  May also reorder floating-point comparisons
6673 and thus may not be used when ordered comparisons are required.
6674 This option requires that both @option{-fno-signed-zeros} and
6675 @option{-fno-trapping-math} be in effect.  Moreover, it doesn't make
6676 much sense with @option{-frounding-math}.
6677
6678 The default is @option{-fno-associative-math}.
6679
6680 @item -freciprocal-math
6681 @opindex freciprocal-math
6682
6683 Allow the reciprocal of a value to be used instead of dividing by
6684 the value if this enables optimizations.  For example @code{x / y}
6685 can be replaced with @code{x * (1/y)} which is useful if @code{(1/y)}
6686 is subject to common subexpression elimination.  Note that this loses
6687 precision and increases the number of flops operating on the value.
6688
6689 The default is @option{-fno-reciprocal-math}.
6690
6691 @item -ffinite-math-only
6692 @opindex ffinite-math-only
6693 Allow optimizations for floating-point arithmetic that assume
6694 that arguments and results are not NaNs or +-Infs.
6695
6696 This option is not turned on by any @option{-O} option since
6697 it can result in incorrect output for programs which depend on
6698 an exact implementation of IEEE or ISO rules/specifications for
6699 math functions. It may, however, yield faster code for programs
6700 that do not require the guarantees of these specifications.
6701
6702 The default is @option{-fno-finite-math-only}.
6703
6704 @item -fno-signed-zeros
6705 @opindex fno-signed-zeros
6706 Allow optimizations for floating point arithmetic that ignore the
6707 signedness of zero.  IEEE arithmetic specifies the behavior of
6708 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
6709 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
6710 This option implies that the sign of a zero result isn't significant.
6711
6712 The default is @option{-fsigned-zeros}.
6713
6714 @item -fno-trapping-math
6715 @opindex fno-trapping-math
6716 Compile code assuming that floating-point operations cannot generate
6717 user-visible traps.  These traps include division by zero, overflow,
6718 underflow, inexact result and invalid operation.  This option requires
6719 that @option{-fno-signaling-nans} be in effect.  Setting this option may
6720 allow faster code if one relies on ``non-stop'' IEEE arithmetic, for example.
6721
6722 This option should never be turned on by any @option{-O} option since
6723 it can result in incorrect output for programs which depend on
6724 an exact implementation of IEEE or ISO rules/specifications for
6725 math functions.
6726
6727 The default is @option{-ftrapping-math}.
6728
6729 @item -frounding-math
6730 @opindex frounding-math
6731 Disable transformations and optimizations that assume default floating
6732 point rounding behavior.  This is round-to-zero for all floating point
6733 to integer conversions, and round-to-nearest for all other arithmetic
6734 truncations.  This option should be specified for programs that change
6735 the FP rounding mode dynamically, or that may be executed with a
6736 non-default rounding mode.  This option disables constant folding of
6737 floating point expressions at compile-time (which may be affected by
6738 rounding mode) and arithmetic transformations that are unsafe in the
6739 presence of sign-dependent rounding modes.
6740
6741 The default is @option{-fno-rounding-math}.
6742
6743 This option is experimental and does not currently guarantee to
6744 disable all GCC optimizations that are affected by rounding mode.
6745 Future versions of GCC may provide finer control of this setting
6746 using C99's @code{FENV_ACCESS} pragma.  This command line option
6747 will be used to specify the default state for @code{FENV_ACCESS}.
6748
6749 @item -frtl-abstract-sequences
6750 @opindex frtl-abstract-sequences
6751 It is a size optimization method. This option is to find identical
6752 sequences of code, which can be turned into pseudo-procedures  and
6753 then  replace  all  occurrences with  calls to  the  newly created
6754 subroutine. It is kind of an opposite of @option{-finline-functions}.
6755 This optimization runs at RTL level.
6756
6757 @item -fsignaling-nans
6758 @opindex fsignaling-nans
6759 Compile code assuming that IEEE signaling NaNs may generate user-visible
6760 traps during floating-point operations.  Setting this option disables
6761 optimizations that may change the number of exceptions visible with
6762 signaling NaNs.  This option implies @option{-ftrapping-math}.
6763
6764 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
6765 be defined.
6766
6767 The default is @option{-fno-signaling-nans}.
6768
6769 This option is experimental and does not currently guarantee to
6770 disable all GCC optimizations that affect signaling NaN behavior.
6771
6772 @item -fsingle-precision-constant
6773 @opindex fsingle-precision-constant
6774 Treat floating point constant as single precision constant instead of
6775 implicitly converting it to double precision constant.
6776
6777 @item -fcx-limited-range
6778 @opindex fcx-limited-range
6779 When enabled, this option states that a range reduction step is not
6780 needed when performing complex division.  Also, there is no checking
6781 whether the result of a complex multiplication or division is @code{NaN
6782 + I*NaN}, with an attempt to rescue the situation in that case.  The
6783 default is @option{-fno-cx-limited-range}, but is enabled by
6784 @option{-ffast-math}.
6785
6786 This option controls the default setting of the ISO C99
6787 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
6788 all languages.
6789
6790 @item -fcx-fortran-rules
6791 @opindex fcx-fortran-rules
6792 Complex multiplication and division follow Fortran rules.  Range
6793 reduction is done as part of complex division, but there is no checking
6794 whether the result of a complex multiplication or division is @code{NaN
6795 + I*NaN}, with an attempt to rescue the situation in that case.
6796
6797 The default is @option{-fno-cx-fortran-rules}.
6798
6799 @end table
6800
6801 The following options control optimizations that may improve
6802 performance, but are not enabled by any @option{-O} options.  This
6803 section includes experimental options that may produce broken code.
6804
6805 @table @gcctabopt
6806 @item -fbranch-probabilities
6807 @opindex fbranch-probabilities
6808 After running a program compiled with @option{-fprofile-arcs}
6809 (@pxref{Debugging Options,, Options for Debugging Your Program or
6810 @command{gcc}}), you can compile it a second time using
6811 @option{-fbranch-probabilities}, to improve optimizations based on
6812 the number of times each branch was taken.  When the program
6813 compiled with @option{-fprofile-arcs} exits it saves arc execution
6814 counts to a file called @file{@var{sourcename}.gcda} for each source
6815 file.  The information in this data file is very dependent on the
6816 structure of the generated code, so you must use the same source code
6817 and the same optimization options for both compilations.
6818
6819 With @option{-fbranch-probabilities}, GCC puts a
6820 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
6821 These can be used to improve optimization.  Currently, they are only
6822 used in one place: in @file{reorg.c}, instead of guessing which path a
6823 branch is mostly to take, the @samp{REG_BR_PROB} values are used to
6824 exactly determine which path is taken more often.
6825
6826 @item -fprofile-values
6827 @opindex fprofile-values
6828 If combined with @option{-fprofile-arcs}, it adds code so that some
6829 data about values of expressions in the program is gathered.
6830
6831 With @option{-fbranch-probabilities}, it reads back the data gathered
6832 from profiling values of expressions and adds @samp{REG_VALUE_PROFILE}
6833 notes to instructions for their later usage in optimizations.
6834
6835 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
6836
6837 @item -fvpt
6838 @opindex fvpt
6839 If combined with @option{-fprofile-arcs}, it instructs the compiler to add
6840 a code to gather information about values of expressions.
6841
6842 With @option{-fbranch-probabilities}, it reads back the data gathered
6843 and actually performs the optimizations based on them.
6844 Currently the optimizations include specialization of division operation
6845 using the knowledge about the value of the denominator.
6846
6847 @item -frename-registers
6848 @opindex frename-registers
6849 Attempt to avoid false dependencies in scheduled code by making use
6850 of registers left over after register allocation.  This optimization
6851 will most benefit processors with lots of registers.  Depending on the
6852 debug information format adopted by the target, however, it can
6853 make debugging impossible, since variables will no longer stay in
6854 a ``home register''.
6855
6856 Enabled by default with @option{-funroll-loops}.
6857
6858 @item -ftracer
6859 @opindex ftracer
6860 Perform tail duplication to enlarge superblock size.  This transformation
6861 simplifies the control flow of the function allowing other optimizations to do
6862 better job.
6863
6864 Enabled with @option{-fprofile-use}.
6865
6866 @item -funroll-loops
6867 @opindex funroll-loops
6868 Unroll loops whose number of iterations can be determined at compile time or
6869 upon entry to the loop.  @option{-funroll-loops} implies
6870 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
6871 It also turns on complete loop peeling (i.e.@: complete removal of loops with
6872 small constant number of iterations).  This option makes code larger, and may
6873 or may not make it run faster.
6874
6875 Enabled with @option{-fprofile-use}.
6876
6877 @item -funroll-all-loops
6878 @opindex funroll-all-loops
6879 Unroll all loops, even if their number of iterations is uncertain when
6880 the loop is entered.  This usually makes programs run more slowly.
6881 @option{-funroll-all-loops} implies the same options as
6882 @option{-funroll-loops}.
6883
6884 @item -fpeel-loops
6885 @opindex fpeel-loops
6886 Peels the loops for that there is enough information that they do not
6887 roll much (from profile feedback).  It also turns on complete loop peeling
6888 (i.e.@: complete removal of loops with small constant number of iterations).
6889
6890 Enabled with @option{-fprofile-use}.
6891
6892 @item -fmove-loop-invariants
6893 @opindex fmove-loop-invariants
6894 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
6895 at level @option{-O1}
6896
6897 @item -funswitch-loops
6898 @opindex funswitch-loops
6899 Move branches with loop invariant conditions out of the loop, with duplicates
6900 of the loop on both branches (modified according to result of the condition).
6901
6902 @item -ffunction-sections
6903 @itemx -fdata-sections
6904 @opindex ffunction-sections
6905 @opindex fdata-sections
6906 Place each function or data item into its own section in the output
6907 file if the target supports arbitrary sections.  The name of the
6908 function or the name of the data item determines the section's name
6909 in the output file.
6910
6911 Use these options on systems where the linker can perform optimizations
6912 to improve locality of reference in the instruction space.  Most systems
6913 using the ELF object format and SPARC processors running Solaris 2 have
6914 linkers with such optimizations.  AIX may have these optimizations in
6915 the future.
6916
6917 Only use these options when there are significant benefits from doing
6918 so.  When you specify these options, the assembler and linker will
6919 create larger object and executable files and will also be slower.
6920 You will not be able to use @code{gprof} on all systems if you
6921 specify this option and you may have problems with debugging if
6922 you specify both this option and @option{-g}.
6923
6924 @item -fbranch-target-load-optimize
6925 @opindex fbranch-target-load-optimize
6926 Perform branch target register load optimization before prologue / epilogue
6927 threading.
6928 The use of target registers can typically be exposed only during reload,
6929 thus hoisting loads out of loops and doing inter-block scheduling needs
6930 a separate optimization pass.
6931
6932 @item -fbranch-target-load-optimize2
6933 @opindex fbranch-target-load-optimize2
6934 Perform branch target register load optimization after prologue / epilogue
6935 threading.
6936
6937 @item -fbtr-bb-exclusive
6938 @opindex fbtr-bb-exclusive
6939 When performing branch target register load optimization, don't reuse
6940 branch target registers in within any basic block.
6941
6942 @item -fstack-protector
6943 @opindex fstack-protector
6944 Emit extra code to check for buffer overflows, such as stack smashing
6945 attacks.  This is done by adding a guard variable to functions with
6946 vulnerable objects.  This includes functions that call alloca, and
6947 functions with buffers larger than 8 bytes.  The guards are initialized
6948 when a function is entered and then checked when the function exits.
6949 If a guard check fails, an error message is printed and the program exits.
6950
6951 @item -fstack-protector-all
6952 @opindex fstack-protector-all
6953 Like @option{-fstack-protector} except that all functions are protected.
6954
6955 @item -fsection-anchors
6956 @opindex fsection-anchors
6957 Try to reduce the number of symbolic address calculations by using
6958 shared ``anchor'' symbols to address nearby objects.  This transformation
6959 can help to reduce the number of GOT entries and GOT accesses on some
6960 targets.
6961
6962 For example, the implementation of the following function @code{foo}:
6963
6964 @smallexample
6965 static int a, b, c;
6966 int foo (void) @{ return a + b + c; @}
6967 @end smallexample
6968
6969 would usually calculate the addresses of all three variables, but if you
6970 compile it with @option{-fsection-anchors}, it will access the variables
6971 from a common anchor point instead.  The effect is similar to the
6972 following pseudocode (which isn't valid C):
6973
6974 @smallexample
6975 int foo (void)
6976 @{
6977   register int *xr = &x;
6978   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
6979 @}
6980 @end smallexample
6981
6982 Not all targets support this option.
6983
6984 @item --param @var{name}=@var{value}
6985 @opindex param
6986 In some places, GCC uses various constants to control the amount of
6987 optimization that is done.  For example, GCC will not inline functions
6988 that contain more that a certain number of instructions.  You can
6989 control some of these constants on the command-line using the
6990 @option{--param} option.
6991
6992 The names of specific parameters, and the meaning of the values, are
6993 tied to the internals of the compiler, and are subject to change
6994 without notice in future releases.
6995
6996 In each case, the @var{value} is an integer.  The allowable choices for
6997 @var{name} are given in the following table:
6998
6999 @table @gcctabopt
7000 @item sra-max-structure-size
7001 The maximum structure size, in bytes, at which the scalar replacement
7002 of aggregates (SRA) optimization will perform block copies.  The
7003 default value, 0, implies that GCC will select the most appropriate
7004 size itself.
7005
7006 @item sra-field-structure-ratio
7007 The threshold ratio (as a percentage) between instantiated fields and
7008 the complete structure size.  We say that if the ratio of the number
7009 of bytes in instantiated fields to the number of bytes in the complete
7010 structure exceeds this parameter, then block copies are not used.  The
7011 default is 75.
7012
7013 @item struct-reorg-cold-struct-ratio
7014 The threshold ratio (as a percentage) between a structure frequency
7015 and the frequency of the hottest structure in the program.  This parameter
7016 is used by struct-reorg optimization enabled by @option{-fipa-struct-reorg}.
7017 We say that if the ratio of a structure frequency, calculated by profiling, 
7018 to the hottest structure frequency in the program is less than this 
7019 parameter, then structure reorganization is not applied to this structure.
7020 The default is 10.
7021
7022 @item predictable-branch-cost-outcome
7023 When branch is predicted to be taken with probability lower than this threshold
7024 (in percent), then it is considered well predictable. The default is 10.
7025
7026 @item max-crossjump-edges
7027 The maximum number of incoming edges to consider for crossjumping.
7028 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
7029 the number of edges incoming to each block.  Increasing values mean
7030 more aggressive optimization, making the compile time increase with
7031 probably small improvement in executable size.
7032
7033 @item min-crossjump-insns
7034 The minimum number of instructions which must be matched at the end
7035 of two blocks before crossjumping will be performed on them.  This
7036 value is ignored in the case where all instructions in the block being
7037 crossjumped from are matched.  The default value is 5.
7038
7039 @item max-grow-copy-bb-insns
7040 The maximum code size expansion factor when copying basic blocks
7041 instead of jumping.  The expansion is relative to a jump instruction.
7042 The default value is 8.
7043
7044 @item max-goto-duplication-insns
7045 The maximum number of instructions to duplicate to a block that jumps
7046 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
7047 passes, GCC factors computed gotos early in the compilation process,
7048 and unfactors them as late as possible.  Only computed jumps at the
7049 end of a basic blocks with no more than max-goto-duplication-insns are
7050 unfactored.  The default value is 8.
7051
7052 @item max-delay-slot-insn-search
7053 The maximum number of instructions to consider when looking for an
7054 instruction to fill a delay slot.  If more than this arbitrary number of
7055 instructions is searched, the time savings from filling the delay slot
7056 will be minimal so stop searching.  Increasing values mean more
7057 aggressive optimization, making the compile time increase with probably
7058 small improvement in executable run time.
7059
7060 @item max-delay-slot-live-search
7061 When trying to fill delay slots, the maximum number of instructions to
7062 consider when searching for a block with valid live register
7063 information.  Increasing this arbitrarily chosen value means more
7064 aggressive optimization, increasing the compile time.  This parameter
7065 should be removed when the delay slot code is rewritten to maintain the
7066 control-flow graph.
7067
7068 @item max-gcse-memory
7069 The approximate maximum amount of memory that will be allocated in
7070 order to perform the global common subexpression elimination
7071 optimization.  If more memory than specified is required, the
7072 optimization will not be done.
7073
7074 @item max-gcse-passes
7075 The maximum number of passes of GCSE to run.  The default is 1.
7076
7077 @item max-pending-list-length
7078 The maximum number of pending dependencies scheduling will allow
7079 before flushing the current state and starting over.  Large functions
7080 with few branches or calls can create excessively large lists which
7081 needlessly consume memory and resources.
7082
7083 @item max-inline-insns-single
7084 Several parameters control the tree inliner used in gcc.
7085 This number sets the maximum number of instructions (counted in GCC's
7086 internal representation) in a single function that the tree inliner
7087 will consider for inlining.  This only affects functions declared
7088 inline and methods implemented in a class declaration (C++).
7089 The default value is 450.
7090
7091 @item max-inline-insns-auto
7092 When you use @option{-finline-functions} (included in @option{-O3}),
7093 a lot of functions that would otherwise not be considered for inlining
7094 by the compiler will be investigated.  To those functions, a different
7095 (more restrictive) limit compared to functions declared inline can
7096 be applied.
7097 The default value is 90.
7098
7099 @item large-function-insns
7100 The limit specifying really large functions.  For functions larger than this
7101 limit after inlining, inlining is constrained by
7102 @option{--param large-function-growth}.  This parameter is useful primarily
7103 to avoid extreme compilation time caused by non-linear algorithms used by the
7104 backend.
7105 The default value is 2700.
7106
7107 @item large-function-growth
7108 Specifies maximal growth of large function caused by inlining in percents.
7109 The default value is 100 which limits large function growth to 2.0 times
7110 the original size.
7111
7112 @item large-unit-insns
7113 The limit specifying large translation unit.  Growth caused by inlining of
7114 units larger than this limit is limited by @option{--param inline-unit-growth}.
7115 For small units this might be too tight (consider unit consisting of function A
7116 that is inline and B that just calls A three time.  If B is small relative to
7117 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
7118 large units consisting of small inlineable functions however the overall unit
7119 growth limit is needed to avoid exponential explosion of code size.  Thus for
7120 smaller units, the size is increased to @option{--param large-unit-insns}
7121 before applying @option{--param inline-unit-growth}.  The default is 10000
7122
7123 @item inline-unit-growth
7124 Specifies maximal overall growth of the compilation unit caused by inlining.
7125 The default value is 30 which limits unit growth to 1.3 times the original
7126 size.
7127
7128 @item ipcp-unit-growth
7129 Specifies maximal overall growth of the compilation unit caused by
7130 interprocedural constant propagation.  The default value is 10 which limits
7131 unit growth to 1.1 times the original size.
7132
7133 @item large-stack-frame
7134 The limit specifying large stack frames.  While inlining the algorithm is trying
7135 to not grow past this limit too much.  Default value is 256 bytes.
7136
7137 @item large-stack-frame-growth
7138 Specifies maximal growth of large stack frames caused by inlining in percents.
7139 The default value is 1000 which limits large stack frame growth to 11 times
7140 the original size.
7141
7142 @item max-inline-insns-recursive
7143 @itemx max-inline-insns-recursive-auto
7144 Specifies maximum number of instructions out-of-line copy of self recursive inline
7145 function can grow into by performing recursive inlining.
7146
7147 For functions declared inline @option{--param max-inline-insns-recursive} is
7148 taken into account.  For function not declared inline, recursive inlining
7149 happens only when @option{-finline-functions} (included in @option{-O3}) is
7150 enabled and @option{--param max-inline-insns-recursive-auto} is used.  The
7151 default value is 450.
7152
7153 @item max-inline-recursive-depth
7154 @itemx max-inline-recursive-depth-auto
7155 Specifies maximum recursion depth used by the recursive inlining.
7156
7157 For functions declared inline @option{--param max-inline-recursive-depth} is
7158 taken into account.  For function not declared inline, recursive inlining
7159 happens only when @option{-finline-functions} (included in @option{-O3}) is
7160 enabled and @option{--param max-inline-recursive-depth-auto} is used.  The
7161 default value is 8.
7162
7163 @item min-inline-recursive-probability
7164 Recursive inlining is profitable only for function having deep recursion
7165 in average and can hurt for function having little recursion depth by
7166 increasing the prologue size or complexity of function body to other
7167 optimizers.
7168
7169 When profile feedback is available (see @option{-fprofile-generate}) the actual
7170 recursion depth can be guessed from probability that function will recurse via
7171 given call expression.  This parameter limits inlining only to call expression
7172 whose probability exceeds given threshold (in percents).  The default value is
7173 10.
7174
7175 @item inline-call-cost
7176 Specify cost of call instruction relative to simple arithmetics operations
7177 (having cost of 1).  Increasing this cost disqualifies inlining of non-leaf
7178 functions and at the same time increases size of leaf function that is believed to
7179 reduce function size by being inlined.  In effect it increases amount of
7180 inlining for code having large abstraction penalty (many functions that just
7181 pass the arguments to other functions) and decrease inlining for code with low
7182 abstraction penalty.  The default value is 12.
7183
7184 @item min-vect-loop-bound
7185 The minimum number of iterations under which a loop will not get vectorized
7186 when @option{-ftree-vectorize} is used.  The number of iterations after
7187 vectorization needs to be greater than the value specified by this option
7188 to allow vectorization.  The default value is 0.
7189
7190 @item max-unrolled-insns
7191 The maximum number of instructions that a loop should have if that loop
7192 is unrolled, and if the loop is unrolled, it determines how many times
7193 the loop code is unrolled.
7194
7195 @item max-average-unrolled-insns
7196 The maximum number of instructions biased by probabilities of their execution
7197 that a loop should have if that loop is unrolled, and if the loop is unrolled,
7198 it determines how many times the loop code is unrolled.
7199
7200 @item max-unroll-times
7201 The maximum number of unrollings of a single loop.
7202
7203 @item max-peeled-insns
7204 The maximum number of instructions that a loop should have if that loop
7205 is peeled, and if the loop is peeled, it determines how many times
7206 the loop code is peeled.
7207
7208 @item max-peel-times
7209 The maximum number of peelings of a single loop.
7210
7211 @item max-completely-peeled-insns
7212 The maximum number of insns of a completely peeled loop.
7213
7214 @item max-completely-peel-times
7215 The maximum number of iterations of a loop to be suitable for complete peeling.
7216
7217 @item max-unswitch-insns
7218 The maximum number of insns of an unswitched loop.
7219
7220 @item max-unswitch-level
7221 The maximum number of branches unswitched in a single loop.
7222
7223 @item lim-expensive
7224 The minimum cost of an expensive expression in the loop invariant motion.
7225
7226 @item iv-consider-all-candidates-bound
7227 Bound on number of candidates for induction variables below that
7228 all candidates are considered for each use in induction variable
7229 optimizations.  Only the most relevant candidates are considered
7230 if there are more candidates, to avoid quadratic time complexity.
7231
7232 @item iv-max-considered-uses
7233 The induction variable optimizations give up on loops that contain more
7234 induction variable uses.
7235
7236 @item iv-always-prune-cand-set-bound
7237 If number of candidates in the set is smaller than this value,
7238 we always try to remove unnecessary ivs from the set during its
7239 optimization when a new iv is added to the set.
7240
7241 @item scev-max-expr-size
7242 Bound on size of expressions used in the scalar evolutions analyzer.
7243 Large expressions slow the analyzer.
7244
7245 @item omega-max-vars
7246 The maximum number of variables in an Omega constraint system.
7247 The default value is 128.
7248
7249 @item omega-max-geqs
7250 The maximum number of inequalities in an Omega constraint system.
7251 The default value is 256.
7252
7253 @item omega-max-eqs
7254 The maximum number of equalities in an Omega constraint system.
7255 The default value is 128.
7256
7257 @item omega-max-wild-cards
7258 The maximum number of wildcard variables that the Omega solver will
7259 be able to insert.  The default value is 18.
7260
7261 @item omega-hash-table-size
7262 The size of the hash table in the Omega solver.  The default value is
7263 550.
7264
7265 @item omega-max-keys
7266 The maximal number of keys used by the Omega solver.  The default
7267 value is 500.
7268
7269 @item omega-eliminate-redundant-constraints
7270 When set to 1, use expensive methods to eliminate all redundant
7271 constraints.  The default value is 0.
7272
7273 @item vect-max-version-for-alignment-checks
7274 The maximum number of runtime checks that can be performed when
7275 doing loop versioning for alignment in the vectorizer.  See option
7276 ftree-vect-loop-version for more information.
7277
7278 @item vect-max-version-for-alias-checks
7279 The maximum number of runtime checks that can be performed when
7280 doing loop versioning for alias in the vectorizer.  See option
7281 ftree-vect-loop-version for more information.
7282
7283 @item max-iterations-to-track
7284
7285 The maximum number of iterations of a loop the brute force algorithm
7286 for analysis of # of iterations of the loop tries to evaluate.
7287
7288 @item hot-bb-count-fraction
7289 Select fraction of the maximal count of repetitions of basic block in program
7290 given basic block needs to have to be considered hot.
7291
7292 @item hot-bb-frequency-fraction
7293 Select fraction of the maximal frequency of executions of basic block in
7294 function given basic block needs to have to be considered hot
7295
7296 @item max-predicted-iterations
7297 The maximum number of loop iterations we predict statically.  This is useful
7298 in cases where function contain single loop with known bound and other loop
7299 with unknown.  We predict the known number of iterations correctly, while
7300 the unknown number of iterations average to roughly 10.  This means that the
7301 loop without bounds would appear artificially cold relative to the other one.
7302
7303 @item align-threshold
7304
7305 Select fraction of the maximal frequency of executions of basic block in
7306 function given basic block will get aligned.
7307
7308 @item align-loop-iterations
7309
7310 A loop expected to iterate at lest the selected number of iterations will get
7311 aligned.
7312
7313 @item tracer-dynamic-coverage
7314 @itemx tracer-dynamic-coverage-feedback
7315
7316 This value is used to limit superblock formation once the given percentage of
7317 executed instructions is covered.  This limits unnecessary code size
7318 expansion.
7319
7320 The @option{tracer-dynamic-coverage-feedback} is used only when profile
7321 feedback is available.  The real profiles (as opposed to statically estimated
7322 ones) are much less balanced allowing the threshold to be larger value.
7323
7324 @item tracer-max-code-growth
7325 Stop tail duplication once code growth has reached given percentage.  This is
7326 rather hokey argument, as most of the duplicates will be eliminated later in
7327 cross jumping, so it may be set to much higher values than is the desired code
7328 growth.
7329
7330 @item tracer-min-branch-ratio
7331
7332 Stop reverse growth when the reverse probability of best edge is less than this
7333 threshold (in percent).
7334
7335 @item tracer-min-branch-ratio
7336 @itemx tracer-min-branch-ratio-feedback
7337
7338 Stop forward growth if the best edge do have probability lower than this
7339 threshold.
7340
7341 Similarly to @option{tracer-dynamic-coverage} two values are present, one for
7342 compilation for profile feedback and one for compilation without.  The value
7343 for compilation with profile feedback needs to be more conservative (higher) in
7344 order to make tracer effective.
7345
7346 @item max-cse-path-length
7347
7348 Maximum number of basic blocks on path that cse considers.  The default is 10.
7349
7350 @item max-cse-insns
7351 The maximum instructions CSE process before flushing. The default is 1000.
7352
7353 @item max-aliased-vops
7354
7355 Maximum number of virtual operands per function allowed to represent
7356 aliases before triggering the alias partitioning heuristic.  Alias
7357 partitioning reduces compile times and memory consumption needed for
7358 aliasing at the expense of precision loss in alias information.  The
7359 default value for this parameter is 100 for -O1, 500 for -O2 and 1000
7360 for -O3.
7361
7362 Notice that if a function contains more memory statements than the
7363 value of this parameter, it is not really possible to achieve this
7364 reduction.  In this case, the compiler will use the number of memory
7365 statements as the value for @option{max-aliased-vops}.
7366
7367 @item avg-aliased-vops
7368
7369 Average number of virtual operands per statement allowed to represent
7370 aliases before triggering the alias partitioning heuristic.  This
7371 works in conjunction with @option{max-aliased-vops}.  If a function
7372 contains more than @option{max-aliased-vops} virtual operators, then
7373 memory symbols will be grouped into memory partitions until either the
7374 total number of virtual operators is below @option{max-aliased-vops}
7375 or the average number of virtual operators per memory statement is
7376 below @option{avg-aliased-vops}.  The default value for this parameter
7377 is 1 for -O1 and -O2, and 3 for -O3.
7378
7379 @item ggc-min-expand
7380
7381 GCC uses a garbage collector to manage its own memory allocation.  This
7382 parameter specifies the minimum percentage by which the garbage
7383 collector's heap should be allowed to expand between collections.
7384 Tuning this may improve compilation speed; it has no effect on code
7385 generation.
7386
7387 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
7388 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of "RAM" is
7389 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
7390 GCC is not able to calculate RAM on a particular platform, the lower
7391 bound of 30% is used.  Setting this parameter and
7392 @option{ggc-min-heapsize} to zero causes a full collection to occur at
7393 every opportunity.  This is extremely slow, but can be useful for
7394 debugging.
7395
7396 @item ggc-min-heapsize
7397
7398 Minimum size of the garbage collector's heap before it begins bothering
7399 to collect garbage.  The first collection occurs after the heap expands
7400 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
7401 tuning this may improve compilation speed, and has no effect on code
7402 generation.
7403
7404 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit which
7405 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
7406 with a lower bound of 4096 (four megabytes) and an upper bound of
7407 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
7408 particular platform, the lower bound is used.  Setting this parameter
7409 very large effectively disables garbage collection.  Setting this
7410 parameter and @option{ggc-min-expand} to zero causes a full collection
7411 to occur at every opportunity.
7412
7413 @item max-reload-search-insns
7414 The maximum number of instruction reload should look backward for equivalent
7415 register.  Increasing values mean more aggressive optimization, making the
7416 compile time increase with probably slightly better performance.  The default
7417 value is 100.
7418
7419 @item max-cselib-memory-locations
7420 The maximum number of memory locations cselib should take into account.
7421 Increasing values mean more aggressive optimization, making the compile time
7422 increase with probably slightly better performance.  The default value is 500.
7423
7424 @item reorder-blocks-duplicate
7425 @itemx reorder-blocks-duplicate-feedback
7426
7427 Used by basic block reordering pass to decide whether to use unconditional
7428 branch or duplicate the code on its destination.  Code is duplicated when its
7429 estimated size is smaller than this value multiplied by the estimated size of
7430 unconditional jump in the hot spots of the program.
7431
7432 The @option{reorder-block-duplicate-feedback} is used only when profile
7433 feedback is available and may be set to higher values than
7434 @option{reorder-block-duplicate} since information about the hot spots is more
7435 accurate.
7436
7437 @item max-sched-ready-insns
7438 The maximum number of instructions ready to be issued the scheduler should
7439 consider at any given time during the first scheduling pass.  Increasing
7440 values mean more thorough searches, making the compilation time increase
7441 with probably little benefit.  The default value is 100.
7442
7443 @item max-sched-region-blocks
7444 The maximum number of blocks in a region to be considered for
7445 interblock scheduling.  The default value is 10.
7446
7447 @item max-pipeline-region-blocks
7448 The maximum number of blocks in a region to be considered for
7449 pipelining in the selective scheduler.  The default value is 15.
7450
7451 @item max-sched-region-insns
7452 The maximum number of insns in a region to be considered for
7453 interblock scheduling.  The default value is 100.
7454
7455 @item max-pipeline-region-insns
7456 The maximum number of insns in a region to be considered for
7457 pipelining in the selective scheduler.  The default value is 200.
7458
7459 @item min-spec-prob
7460 The minimum probability (in percents) of reaching a source block
7461 for interblock speculative scheduling.  The default value is 40.
7462
7463 @item max-sched-extend-regions-iters
7464 The maximum number of iterations through CFG to extend regions.
7465 0 - disable region extension,
7466 N - do at most N iterations.
7467 The default value is 0.
7468
7469 @item max-sched-insn-conflict-delay
7470 The maximum conflict delay for an insn to be considered for speculative motion.
7471 The default value is 3.
7472
7473 @item sched-spec-prob-cutoff
7474 The minimal probability of speculation success (in percents), so that
7475 speculative insn will be scheduled.
7476 The default value is 40.
7477
7478 @item sched-mem-true-dep-cost
7479 Minimal distance (in CPU cycles) between store and load targeting same
7480 memory locations.  The default value is 1.
7481
7482 @item selsched-max-lookahead
7483 The maximum size of the lookahead window of selective scheduling.  It is a
7484 depth of search for available instructions.
7485 The default value is 50.
7486
7487 @item selsched-max-sched-times
7488 The maximum number of times that an instruction will be scheduled during 
7489 selective scheduling.  This is the limit on the number of iterations 
7490 through which the instruction may be pipelined.  The default value is 2.
7491
7492 @item selsched-max-insns-to-rename
7493 The maximum number of best instructions in the ready list that are considered
7494 for renaming in the selective scheduler.  The default value is 2.
7495
7496 @item max-last-value-rtl
7497 The maximum size measured as number of RTLs that can be recorded in an expression
7498 in combiner for a pseudo register as last known value of that register.  The default
7499 is 10000.
7500
7501 @item integer-share-limit
7502 Small integer constants can use a shared data structure, reducing the
7503 compiler's memory usage and increasing its speed.  This sets the maximum
7504 value of a shared integer constant.  The default value is 256.
7505
7506 @item min-virtual-mappings
7507 Specifies the minimum number of virtual mappings in the incremental
7508 SSA updater that should be registered to trigger the virtual mappings
7509 heuristic defined by virtual-mappings-ratio.  The default value is
7510 100.
7511
7512 @item virtual-mappings-ratio
7513 If the number of virtual mappings is virtual-mappings-ratio bigger
7514 than the number of virtual symbols to be updated, then the incremental
7515 SSA updater switches to a full update for those symbols.  The default
7516 ratio is 3.
7517
7518 @item ssp-buffer-size
7519 The minimum size of buffers (i.e.@: arrays) that will receive stack smashing
7520 protection when @option{-fstack-protection} is used.
7521
7522 @item max-jump-thread-duplication-stmts
7523 Maximum number of statements allowed in a block that needs to be
7524 duplicated when threading jumps.
7525
7526 @item max-fields-for-field-sensitive
7527 Maximum number of fields in a structure we will treat in
7528 a field sensitive manner during pointer analysis.  The default is zero
7529 for -O0, and -O1 and 100 for -Os, -O2, and -O3.
7530
7531 @item prefetch-latency
7532 Estimate on average number of instructions that are executed before
7533 prefetch finishes.  The distance we prefetch ahead is proportional
7534 to this constant.  Increasing this number may also lead to less
7535 streams being prefetched (see @option{simultaneous-prefetches}).
7536
7537 @item simultaneous-prefetches
7538 Maximum number of prefetches that can run at the same time.
7539
7540 @item l1-cache-line-size
7541 The size of cache line in L1 cache, in bytes.
7542
7543 @item l1-cache-size
7544 The size of L1 cache, in kilobytes.
7545
7546 @item l2-cache-size
7547 The size of L2 cache, in kilobytes.
7548
7549 @item use-canonical-types
7550 Whether the compiler should use the ``canonical'' type system.  By
7551 default, this should always be 1, which uses a more efficient internal
7552 mechanism for comparing types in C++ and Objective-C++.  However, if
7553 bugs in the canonical type system are causing compilation failures,
7554 set this value to 0 to disable canonical types.
7555
7556 @item switch-conversion-max-branch-ratio
7557 Switch initialization conversion will refuse to create arrays that are
7558 bigger than @option{switch-conversion-max-branch-ratio} times the number of
7559 branches in the switch.
7560
7561 @item max-partial-antic-length
7562 Maximum length of the partial antic set computed during the tree
7563 partial redundancy elimination optimization (@option{-ftree-pre}) when
7564 optimizing at @option{-O3} and above.  For some sorts of source code
7565 the enhanced partial redundancy elimination optimization can run away,
7566 consuming all of the memory available on the host machine.  This
7567 parameter sets a limit on the length of the sets that are computed,
7568 which prevents the runaway behaviour.  Setting a value of 0 for
7569 this paramter will allow an unlimited set length.
7570
7571 @item sccvn-max-scc-size
7572 Maximum size of a strongly connected component (SCC) during SCCVN
7573 processing.  If this limit is hit, SCCVN processing for the whole
7574 function will not be done and optimizations depending on it will
7575 be disabled.  The default maximum SCC size is 10000.
7576
7577 @item ira-max-loops-num
7578 IRA uses a regional register allocation by default.  If a function
7579 contains loops more than number given by the parameter, non-regional
7580 register allocator will be used even when option
7581 @option{-fira-algorithm} is given.  The default value of the parameter
7582 is 20.
7583
7584 @end table
7585 @end table
7586
7587 @node Preprocessor Options
7588 @section Options Controlling the Preprocessor
7589 @cindex preprocessor options
7590 @cindex options, preprocessor
7591
7592 These options control the C preprocessor, which is run on each C source
7593 file before actual compilation.
7594
7595 If you use the @option{-E} option, nothing is done except preprocessing.
7596 Some of these options make sense only together with @option{-E} because
7597 they cause the preprocessor output to be unsuitable for actual
7598 compilation.
7599
7600 @table @gcctabopt
7601 @opindex Wp
7602 You can use @option{-Wp,@var{option}} to bypass the compiler driver
7603 and pass @var{option} directly through to the preprocessor.  If
7604 @var{option} contains commas, it is split into multiple options at the
7605 commas.  However, many options are modified, translated or interpreted
7606 by the compiler driver before being passed to the preprocessor, and
7607 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
7608 interface is undocumented and subject to change, so whenever possible
7609 you should avoid using @option{-Wp} and let the driver handle the
7610 options instead.
7611
7612 @item -Xpreprocessor @var{option}
7613 @opindex preprocessor
7614 Pass @var{option} as an option to the preprocessor.  You can use this to
7615 supply system-specific preprocessor options which GCC does not know how to
7616 recognize.
7617
7618 If you want to pass an option that takes an argument, you must use
7619 @option{-Xpreprocessor} twice, once for the option and once for the argument.
7620 @end table
7621
7622 @include cppopts.texi
7623
7624 @node Assembler Options
7625 @section Passing Options to the Assembler
7626
7627 @c prevent bad page break with this line
7628 You can pass options to the assembler.
7629
7630 @table @gcctabopt
7631 @item -Wa,@var{option}
7632 @opindex Wa
7633 Pass @var{option} as an option to the assembler.  If @var{option}
7634 contains commas, it is split into multiple options at the commas.
7635
7636 @item -Xassembler @var{option}
7637 @opindex Xassembler
7638 Pass @var{option} as an option to the assembler.  You can use this to
7639 supply system-specific assembler options which GCC does not know how to
7640 recognize.
7641
7642 If you want to pass an option that takes an argument, you must use
7643 @option{-Xassembler} twice, once for the option and once for the argument.
7644
7645 @end table
7646
7647 @node Link Options
7648 @section Options for Linking
7649 @cindex link options
7650 @cindex options, linking
7651
7652 These options come into play when the compiler links object files into
7653 an executable output file.  They are meaningless if the compiler is
7654 not doing a link step.
7655
7656 @table @gcctabopt
7657 @cindex file names
7658 @item @var{object-file-name}
7659 A file name that does not end in a special recognized suffix is
7660 considered to name an object file or library.  (Object files are
7661 distinguished from libraries by the linker according to the file
7662 contents.)  If linking is done, these object files are used as input
7663 to the linker.
7664
7665 @item -c
7666 @itemx -S
7667 @itemx -E
7668 @opindex c
7669 @opindex S
7670 @opindex E
7671 If any of these options is used, then the linker is not run, and
7672 object file names should not be used as arguments.  @xref{Overall
7673 Options}.
7674
7675 @cindex Libraries
7676 @item -l@var{library}
7677 @itemx -l @var{library}
7678 @opindex l
7679 Search the library named @var{library} when linking.  (The second
7680 alternative with the library as a separate argument is only for
7681 POSIX compliance and is not recommended.)
7682
7683 It makes a difference where in the command you write this option; the
7684 linker searches and processes libraries and object files in the order they
7685 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
7686 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
7687 to functions in @samp{z}, those functions may not be loaded.
7688
7689 The linker searches a standard list of directories for the library,
7690 which is actually a file named @file{lib@var{library}.a}.  The linker
7691 then uses this file as if it had been specified precisely by name.
7692
7693 The directories searched include several standard system directories
7694 plus any that you specify with @option{-L}.
7695
7696 Normally the files found this way are library files---archive files
7697 whose members are object files.  The linker handles an archive file by
7698 scanning through it for members which define symbols that have so far
7699 been referenced but not defined.  But if the file that is found is an
7700 ordinary object file, it is linked in the usual fashion.  The only
7701 difference between using an @option{-l} option and specifying a file name
7702 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
7703 and searches several directories.
7704
7705 @item -lobjc
7706 @opindex lobjc
7707 You need this special case of the @option{-l} option in order to
7708 link an Objective-C or Objective-C++ program.
7709
7710 @item -nostartfiles
7711 @opindex nostartfiles
7712 Do not use the standard system startup files when linking.
7713 The standard system libraries are used normally, unless @option{-nostdlib}
7714 or @option{-nodefaultlibs} is used.
7715
7716 @item -nodefaultlibs
7717 @opindex nodefaultlibs
7718 Do not use the standard system libraries when linking.
7719 Only the libraries you specify will be passed to the linker.
7720 The standard startup files are used normally, unless @option{-nostartfiles}
7721 is used.  The compiler may generate calls to @code{memcmp},
7722 @code{memset}, @code{memcpy} and @code{memmove}.
7723 These entries are usually resolved by entries in
7724 libc.  These entry points should be supplied through some other
7725 mechanism when this option is specified.
7726
7727 @item -nostdlib
7728 @opindex nostdlib
7729 Do not use the standard system startup files or libraries when linking.
7730 No startup files and only the libraries you specify will be passed to
7731 the linker.  The compiler may generate calls to @code{memcmp}, @code{memset},
7732 @code{memcpy} and @code{memmove}.
7733 These entries are usually resolved by entries in
7734 libc.  These entry points should be supplied through some other
7735 mechanism when this option is specified.
7736
7737 @cindex @option{-lgcc}, use with @option{-nostdlib}
7738 @cindex @option{-nostdlib} and unresolved references
7739 @cindex unresolved references and @option{-nostdlib}
7740 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
7741 @cindex @option{-nodefaultlibs} and unresolved references
7742 @cindex unresolved references and @option{-nodefaultlibs}
7743 One of the standard libraries bypassed by @option{-nostdlib} and
7744 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
7745 that GCC uses to overcome shortcomings of particular machines, or special
7746 needs for some languages.
7747 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
7748 Collection (GCC) Internals},
7749 for more discussion of @file{libgcc.a}.)
7750 In most cases, you need @file{libgcc.a} even when you want to avoid
7751 other standard libraries.  In other words, when you specify @option{-nostdlib}
7752 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
7753 This ensures that you have no unresolved references to internal GCC
7754 library subroutines.  (For example, @samp{__main}, used to ensure C++
7755 constructors will be called; @pxref{Collect2,,@code{collect2}, gccint,
7756 GNU Compiler Collection (GCC) Internals}.)
7757
7758 @item -pie
7759 @opindex pie
7760 Produce a position independent executable on targets which support it.
7761 For predictable results, you must also specify the same set of options
7762 that were used to generate code (@option{-fpie}, @option{-fPIE},
7763 or model suboptions) when you specify this option.
7764
7765 @item -rdynamic
7766 @opindex rdynamic
7767 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
7768 that support it. This instructs the linker to add all symbols, not
7769 only used ones, to the dynamic symbol table. This option is needed
7770 for some uses of @code{dlopen} or to allow obtaining backtraces
7771 from within a program.
7772
7773 @item -s
7774 @opindex s
7775 Remove all symbol table and relocation information from the executable.
7776
7777 @item -static
7778 @opindex static
7779 On systems that support dynamic linking, this prevents linking with the shared
7780 libraries.  On other systems, this option has no effect.
7781
7782 @item -shared
7783 @opindex shared
7784 Produce a shared object which can then be linked with other objects to
7785 form an executable.  Not all systems support this option.  For predictable
7786 results, you must also specify the same set of options that were used to
7787 generate code (@option{-fpic}, @option{-fPIC}, or model suboptions)
7788 when you specify this option.@footnote{On some systems, @samp{gcc -shared}
7789 needs to build supplementary stub code for constructors to work.  On
7790 multi-libbed systems, @samp{gcc -shared} must select the correct support
7791 libraries to link against.  Failing to supply the correct flags may lead
7792 to subtle defects.  Supplying them in cases where they are not necessary
7793 is innocuous.}
7794
7795 @item -shared-libgcc
7796 @itemx -static-libgcc
7797 @opindex shared-libgcc
7798 @opindex static-libgcc
7799 On systems that provide @file{libgcc} as a shared library, these options
7800 force the use of either the shared or static version respectively.
7801 If no shared version of @file{libgcc} was built when the compiler was
7802 configured, these options have no effect.
7803
7804 There are several situations in which an application should use the
7805 shared @file{libgcc} instead of the static version.  The most common
7806 of these is when the application wishes to throw and catch exceptions
7807 across different shared libraries.  In that case, each of the libraries
7808 as well as the application itself should use the shared @file{libgcc}.
7809
7810 Therefore, the G++ and GCJ drivers automatically add
7811 @option{-shared-libgcc} whenever you build a shared library or a main
7812 executable, because C++ and Java programs typically use exceptions, so
7813 this is the right thing to do.
7814
7815 If, instead, you use the GCC driver to create shared libraries, you may
7816 find that they will not always be linked with the shared @file{libgcc}.
7817 If GCC finds, at its configuration time, that you have a non-GNU linker
7818 or a GNU linker that does not support option @option{--eh-frame-hdr},
7819 it will link the shared version of @file{libgcc} into shared libraries
7820 by default.  Otherwise, it will take advantage of the linker and optimize
7821 away the linking with the shared version of @file{libgcc}, linking with
7822 the static version of libgcc by default.  This allows exceptions to
7823 propagate through such shared libraries, without incurring relocation
7824 costs at library load time.
7825
7826 However, if a library or main executable is supposed to throw or catch
7827 exceptions, you must link it using the G++ or GCJ driver, as appropriate
7828 for the languages used in the program, or using the option
7829 @option{-shared-libgcc}, such that it is linked with the shared
7830 @file{libgcc}.
7831
7832 @item -symbolic
7833 @opindex symbolic
7834 Bind references to global symbols when building a shared object.  Warn
7835 about any unresolved references (unless overridden by the link editor
7836 option @samp{-Xlinker -z -Xlinker defs}).  Only a few systems support
7837 this option.
7838
7839 @item -Xlinker @var{option}
7840 @opindex Xlinker
7841 Pass @var{option} as an option to the linker.  You can use this to
7842 supply system-specific linker options which GCC does not know how to
7843 recognize.
7844
7845 If you want to pass an option that takes an argument, you must use
7846 @option{-Xlinker} twice, once for the option and once for the argument.
7847 For example, to pass @option{-assert definitions}, you must write
7848 @samp{-Xlinker -assert -Xlinker definitions}.  It does not work to write
7849 @option{-Xlinker "-assert definitions"}, because this passes the entire
7850 string as a single argument, which is not what the linker expects.
7851
7852 @item -Wl,@var{option}
7853 @opindex Wl
7854 Pass @var{option} as an option to the linker.  If @var{option} contains
7855 commas, it is split into multiple options at the commas.
7856
7857 @item -u @var{symbol}
7858 @opindex u
7859 Pretend the symbol @var{symbol} is undefined, to force linking of
7860 library modules to define it.  You can use @option{-u} multiple times with
7861 different symbols to force loading of additional library modules.
7862 @end table
7863
7864 @node Directory Options
7865 @section Options for Directory Search
7866 @cindex directory options
7867 @cindex options, directory search
7868 @cindex search path
7869
7870 These options specify directories to search for header files, for
7871 libraries and for parts of the compiler:
7872
7873 @table @gcctabopt
7874 @item -I@var{dir}
7875 @opindex I
7876 Add the directory @var{dir} to the head of the list of directories to be
7877 searched for header files.  This can be used to override a system header
7878 file, substituting your own version, since these directories are
7879 searched before the system header file directories.  However, you should
7880 not use this option to add directories that contain vendor-supplied
7881 system header files (use @option{-isystem} for that).  If you use more than
7882 one @option{-I} option, the directories are scanned in left-to-right
7883 order; the standard system directories come after.
7884
7885 If a standard system include directory, or a directory specified with
7886 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
7887 option will be ignored.  The directory will still be searched but as a
7888 system directory at its normal position in the system include chain.
7889 This is to ensure that GCC's procedure to fix buggy system headers and
7890 the ordering for the include_next directive are not inadvertently changed.
7891 If you really need to change the search order for system directories,
7892 use the @option{-nostdinc} and/or @option{-isystem} options.
7893
7894 @item -iquote@var{dir}
7895 @opindex iquote
7896 Add the directory @var{dir} to the head of the list of directories to
7897 be searched for header files only for the case of @samp{#include
7898 "@var{file}"}; they are not searched for @samp{#include <@var{file}>},
7899 otherwise just like @option{-I}.
7900
7901 @item -L@var{dir}
7902 @opindex L
7903 Add directory @var{dir} to the list of directories to be searched
7904 for @option{-l}.
7905
7906 @item -B@var{prefix}
7907 @opindex B
7908 This option specifies where to find the executables, libraries,
7909 include files, and data files of the compiler itself.
7910
7911 The compiler driver program runs one or more of the subprograms
7912 @file{cpp}, @file{cc1}, @file{as} and @file{ld}.  It tries
7913 @var{prefix} as a prefix for each program it tries to run, both with and
7914 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
7915
7916 For each subprogram to be run, the compiler driver first tries the
7917 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
7918 was not specified, the driver tries two standard prefixes, which are
7919 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
7920 those results in a file name that is found, the unmodified program
7921 name is searched for using the directories specified in your
7922 @env{PATH} environment variable.
7923
7924 The compiler will check to see if the path provided by the @option{-B}
7925 refers to a directory, and if necessary it will add a directory
7926 separator character at the end of the path.
7927
7928 @option{-B} prefixes that effectively specify directory names also apply
7929 to libraries in the linker, because the compiler translates these
7930 options into @option{-L} options for the linker.  They also apply to
7931 includes files in the preprocessor, because the compiler translates these
7932 options into @option{-isystem} options for the preprocessor.  In this case,
7933 the compiler appends @samp{include} to the prefix.
7934
7935 The run-time support file @file{libgcc.a} can also be searched for using
7936 the @option{-B} prefix, if needed.  If it is not found there, the two
7937 standard prefixes above are tried, and that is all.  The file is left
7938 out of the link if it is not found by those means.
7939
7940 Another way to specify a prefix much like the @option{-B} prefix is to use
7941 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
7942 Variables}.
7943
7944 As a special kludge, if the path provided by @option{-B} is
7945 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
7946 9, then it will be replaced by @file{[dir/]include}.  This is to help
7947 with boot-strapping the compiler.
7948
7949 @item -specs=@var{file}
7950 @opindex specs
7951 Process @var{file} after the compiler reads in the standard @file{specs}
7952 file, in order to override the defaults that the @file{gcc} driver
7953 program uses when determining what switches to pass to @file{cc1},
7954 @file{cc1plus}, @file{as}, @file{ld}, etc.  More than one
7955 @option{-specs=@var{file}} can be specified on the command line, and they
7956 are processed in order, from left to right.
7957
7958 @item --sysroot=@var{dir}
7959 @opindex sysroot
7960 Use @var{dir} as the logical root directory for headers and libraries.
7961 For example, if the compiler would normally search for headers in
7962 @file{/usr/include} and libraries in @file{/usr/lib}, it will instead
7963 search @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
7964
7965 If you use both this option and the @option{-isysroot} option, then
7966 the @option{--sysroot} option will apply to libraries, but the
7967 @option{-isysroot} option will apply to header files.
7968
7969 The GNU linker (beginning with version 2.16) has the necessary support
7970 for this option.  If your linker does not support this option, the
7971 header file aspect of @option{--sysroot} will still work, but the
7972 library aspect will not.
7973
7974 @item -I-
7975 @opindex I-
7976 This option has been deprecated.  Please use @option{-iquote} instead for
7977 @option{-I} directories before the @option{-I-} and remove the @option{-I-}.
7978 Any directories you specify with @option{-I} options before the @option{-I-}
7979 option are searched only for the case of @samp{#include "@var{file}"};
7980 they are not searched for @samp{#include <@var{file}>}.
7981
7982 If additional directories are specified with @option{-I} options after
7983 the @option{-I-}, these directories are searched for all @samp{#include}
7984 directives.  (Ordinarily @emph{all} @option{-I} directories are used
7985 this way.)
7986
7987 In addition, the @option{-I-} option inhibits the use of the current
7988 directory (where the current input file came from) as the first search
7989 directory for @samp{#include "@var{file}"}.  There is no way to
7990 override this effect of @option{-I-}.  With @option{-I.} you can specify
7991 searching the directory which was current when the compiler was
7992 invoked.  That is not exactly the same as what the preprocessor does
7993 by default, but it is often satisfactory.
7994
7995 @option{-I-} does not inhibit the use of the standard system directories
7996 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
7997 independent.
7998 @end table
7999
8000 @c man end
8001
8002 @node Spec Files
8003 @section Specifying subprocesses and the switches to pass to them
8004 @cindex Spec Files
8005
8006 @command{gcc} is a driver program.  It performs its job by invoking a
8007 sequence of other programs to do the work of compiling, assembling and
8008 linking.  GCC interprets its command-line parameters and uses these to
8009 deduce which programs it should invoke, and which command-line options
8010 it ought to place on their command lines.  This behavior is controlled
8011 by @dfn{spec strings}.  In most cases there is one spec string for each
8012 program that GCC can invoke, but a few programs have multiple spec
8013 strings to control their behavior.  The spec strings built into GCC can
8014 be overridden by using the @option{-specs=} command-line switch to specify
8015 a spec file.
8016
8017 @dfn{Spec files} are plaintext files that are used to construct spec
8018 strings.  They consist of a sequence of directives separated by blank
8019 lines.  The type of directive is determined by the first non-whitespace
8020 character on the line and it can be one of the following:
8021
8022 @table @code
8023 @item %@var{command}
8024 Issues a @var{command} to the spec file processor.  The commands that can
8025 appear here are:
8026
8027 @table @code
8028 @item %include <@var{file}>
8029 @cindex %include
8030 Search for @var{file} and insert its text at the current point in the
8031 specs file.
8032
8033 @item %include_noerr <@var{file}>
8034 @cindex %include_noerr
8035 Just like @samp{%include}, but do not generate an error message if the include
8036 file cannot be found.
8037
8038 @item %rename @var{old_name} @var{new_name}
8039 @cindex %rename
8040 Rename the spec string @var{old_name} to @var{new_name}.
8041
8042 @end table
8043
8044 @item *[@var{spec_name}]:
8045 This tells the compiler to create, override or delete the named spec
8046 string.  All lines after this directive up to the next directive or
8047 blank line are considered to be the text for the spec string.  If this
8048 results in an empty string then the spec will be deleted.  (Or, if the
8049 spec did not exist, then nothing will happened.)  Otherwise, if the spec
8050 does not currently exist a new spec will be created.  If the spec does
8051 exist then its contents will be overridden by the text of this
8052 directive, unless the first character of that text is the @samp{+}
8053 character, in which case the text will be appended to the spec.
8054
8055 @item [@var{suffix}]:
8056 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
8057 and up to the next directive or blank line are considered to make up the
8058 spec string for the indicated suffix.  When the compiler encounters an
8059 input file with the named suffix, it will processes the spec string in
8060 order to work out how to compile that file.  For example:
8061
8062 @smallexample
8063 .ZZ:
8064 z-compile -input %i
8065 @end smallexample
8066
8067 This says that any input file whose name ends in @samp{.ZZ} should be
8068 passed to the program @samp{z-compile}, which should be invoked with the
8069 command-line switch @option{-input} and with the result of performing the
8070 @samp{%i} substitution.  (See below.)
8071
8072 As an alternative to providing a spec string, the text that follows a
8073 suffix directive can be one of the following:
8074
8075 @table @code
8076 @item @@@var{language}
8077 This says that the suffix is an alias for a known @var{language}.  This is
8078 similar to using the @option{-x} command-line switch to GCC to specify a
8079 language explicitly.  For example:
8080
8081 @smallexample
8082 .ZZ:
8083 @@c++
8084 @end smallexample
8085
8086 Says that .ZZ files are, in fact, C++ source files.
8087
8088 @item #@var{name}
8089 This causes an error messages saying:
8090
8091 @smallexample
8092 @var{name} compiler not installed on this system.
8093 @end smallexample
8094 @end table
8095
8096 GCC already has an extensive list of suffixes built into it.
8097 This directive will add an entry to the end of the list of suffixes, but
8098 since the list is searched from the end backwards, it is effectively
8099 possible to override earlier entries using this technique.
8100
8101 @end table
8102
8103 GCC has the following spec strings built into it.  Spec files can
8104 override these strings or create their own.  Note that individual
8105 targets can also add their own spec strings to this list.
8106
8107 @smallexample
8108 asm          Options to pass to the assembler
8109 asm_final    Options to pass to the assembler post-processor
8110 cpp          Options to pass to the C preprocessor
8111 cc1          Options to pass to the C compiler
8112 cc1plus      Options to pass to the C++ compiler
8113 endfile      Object files to include at the end of the link
8114 link         Options to pass to the linker
8115 lib          Libraries to include on the command line to the linker
8116 libgcc       Decides which GCC support library to pass to the linker
8117 linker       Sets the name of the linker
8118 predefines   Defines to be passed to the C preprocessor
8119 signed_char  Defines to pass to CPP to say whether @code{char} is signed
8120              by default
8121 startfile    Object files to include at the start of the link
8122 @end smallexample
8123
8124 Here is a small example of a spec file:
8125
8126 @smallexample
8127 %rename lib                 old_lib
8128
8129 *lib:
8130 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
8131 @end smallexample
8132
8133 This example renames the spec called @samp{lib} to @samp{old_lib} and
8134 then overrides the previous definition of @samp{lib} with a new one.
8135 The new definition adds in some extra command-line options before
8136 including the text of the old definition.
8137
8138 @dfn{Spec strings} are a list of command-line options to be passed to their
8139 corresponding program.  In addition, the spec strings can contain
8140 @samp{%}-prefixed sequences to substitute variable text or to
8141 conditionally insert text into the command line.  Using these constructs
8142 it is possible to generate quite complex command lines.
8143
8144 Here is a table of all defined @samp{%}-sequences for spec
8145 strings.  Note that spaces are not generated automatically around the
8146 results of expanding these sequences.  Therefore you can concatenate them
8147 together or combine them with constant text in a single argument.
8148
8149 @table @code
8150 @item %%
8151 Substitute one @samp{%} into the program name or argument.
8152
8153 @item %i
8154 Substitute the name of the input file being processed.
8155
8156 @item %b
8157 Substitute the basename of the input file being processed.
8158 This is the substring up to (and not including) the last period
8159 and not including the directory.
8160
8161 @item %B
8162 This is the same as @samp{%b}, but include the file suffix (text after
8163 the last period).
8164
8165 @item %d
8166 Marks the argument containing or following the @samp{%d} as a
8167 temporary file name, so that that file will be deleted if GCC exits
8168 successfully.  Unlike @samp{%g}, this contributes no text to the
8169 argument.
8170
8171 @item %g@var{suffix}
8172 Substitute a file name that has suffix @var{suffix} and is chosen
8173 once per compilation, and mark the argument in the same way as
8174 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
8175 name is now chosen in a way that is hard to predict even when previously
8176 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
8177 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
8178 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
8179 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
8180 was simply substituted with a file name chosen once per compilation,
8181 without regard to any appended suffix (which was therefore treated
8182 just like ordinary text), making such attacks more likely to succeed.
8183
8184 @item %u@var{suffix}
8185 Like @samp{%g}, but generates a new temporary file name even if
8186 @samp{%u@var{suffix}} was already seen.
8187
8188 @item %U@var{suffix}
8189 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
8190 new one if there is no such last file name.  In the absence of any
8191 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
8192 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
8193 would involve the generation of two distinct file names, one
8194 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
8195 simply substituted with a file name chosen for the previous @samp{%u},
8196 without regard to any appended suffix.
8197
8198 @item %j@var{suffix}
8199 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
8200 writable, and if save-temps is off; otherwise, substitute the name
8201 of a temporary file, just like @samp{%u}.  This temporary file is not
8202 meant for communication between processes, but rather as a junk
8203 disposal mechanism.
8204
8205 @item %|@var{suffix}
8206 @itemx %m@var{suffix}
8207 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
8208 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
8209 all.  These are the two most common ways to instruct a program that it
8210 should read from standard input or write to standard output.  If you
8211 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
8212 construct: see for example @file{f/lang-specs.h}.
8213
8214 @item %.@var{SUFFIX}
8215 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
8216 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
8217 terminated by the next space or %.
8218
8219 @item %w
8220 Marks the argument containing or following the @samp{%w} as the
8221 designated output file of this compilation.  This puts the argument
8222 into the sequence of arguments that @samp{%o} will substitute later.
8223
8224 @item %o
8225 Substitutes the names of all the output files, with spaces
8226 automatically placed around them.  You should write spaces
8227 around the @samp{%o} as well or the results are undefined.
8228 @samp{%o} is for use in the specs for running the linker.
8229 Input files whose names have no recognized suffix are not compiled
8230 at all, but they are included among the output files, so they will
8231 be linked.
8232
8233 @item %O
8234 Substitutes the suffix for object files.  Note that this is
8235 handled specially when it immediately follows @samp{%g, %u, or %U},
8236 because of the need for those to form complete file names.  The
8237 handling is such that @samp{%O} is treated exactly as if it had already
8238 been substituted, except that @samp{%g, %u, and %U} do not currently
8239 support additional @var{suffix} characters following @samp{%O} as they would
8240 following, for example, @samp{.o}.
8241
8242 @item %p
8243 Substitutes the standard macro predefinitions for the
8244 current target machine.  Use this when running @code{cpp}.
8245
8246 @item %P
8247 Like @samp{%p}, but puts @samp{__} before and after the name of each
8248 predefined macro, except for macros that start with @samp{__} or with
8249 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
8250 C@.
8251
8252 @item %I
8253 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
8254 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
8255 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
8256 and @option{-imultilib} as necessary.
8257
8258 @item %s
8259 Current argument is the name of a library or startup file of some sort.
8260 Search for that file in a standard list of directories and substitute
8261 the full name found.
8262
8263 @item %e@var{str}
8264 Print @var{str} as an error message.  @var{str} is terminated by a newline.
8265 Use this when inconsistent options are detected.
8266
8267 @item %(@var{name})
8268 Substitute the contents of spec string @var{name} at this point.
8269
8270 @item %[@var{name}]
8271 Like @samp{%(@dots{})} but put @samp{__} around @option{-D} arguments.
8272
8273 @item %x@{@var{option}@}
8274 Accumulate an option for @samp{%X}.
8275
8276 @item %X
8277 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
8278 spec string.
8279
8280 @item %Y
8281 Output the accumulated assembler options specified by @option{-Wa}.
8282
8283 @item %Z
8284 Output the accumulated preprocessor options specified by @option{-Wp}.
8285
8286 @item %a
8287 Process the @code{asm} spec.  This is used to compute the
8288 switches to be passed to the assembler.
8289
8290 @item %A
8291 Process the @code{asm_final} spec.  This is a spec string for
8292 passing switches to an assembler post-processor, if such a program is
8293 needed.
8294
8295 @item %l
8296 Process the @code{link} spec.  This is the spec for computing the
8297 command line passed to the linker.  Typically it will make use of the
8298 @samp{%L %G %S %D and %E} sequences.
8299
8300 @item %D
8301 Dump out a @option{-L} option for each directory that GCC believes might
8302 contain startup files.  If the target supports multilibs then the
8303 current multilib directory will be prepended to each of these paths.
8304
8305 @item %L
8306 Process the @code{lib} spec.  This is a spec string for deciding which
8307 libraries should be included on the command line to the linker.
8308
8309 @item %G
8310 Process the @code{libgcc} spec.  This is a spec string for deciding
8311 which GCC support library should be included on the command line to the linker.
8312
8313 @item %S
8314 Process the @code{startfile} spec.  This is a spec for deciding which
8315 object files should be the first ones passed to the linker.  Typically
8316 this might be a file named @file{crt0.o}.
8317
8318 @item %E
8319 Process the @code{endfile} spec.  This is a spec string that specifies
8320 the last object files that will be passed to the linker.
8321
8322 @item %C
8323 Process the @code{cpp} spec.  This is used to construct the arguments
8324 to be passed to the C preprocessor.
8325
8326 @item %1
8327 Process the @code{cc1} spec.  This is used to construct the options to be
8328 passed to the actual C compiler (@samp{cc1}).
8329
8330 @item %2
8331 Process the @code{cc1plus} spec.  This is used to construct the options to be
8332 passed to the actual C++ compiler (@samp{cc1plus}).
8333
8334 @item %*
8335 Substitute the variable part of a matched option.  See below.
8336 Note that each comma in the substituted string is replaced by
8337 a single space.
8338
8339 @item %<@code{S}
8340 Remove all occurrences of @code{-S} from the command line.  Note---this
8341 command is position dependent.  @samp{%} commands in the spec string
8342 before this one will see @code{-S}, @samp{%} commands in the spec string
8343 after this one will not.
8344
8345 @item %:@var{function}(@var{args})
8346 Call the named function @var{function}, passing it @var{args}.
8347 @var{args} is first processed as a nested spec string, then split
8348 into an argument vector in the usual fashion.  The function returns
8349 a string which is processed as if it had appeared literally as part
8350 of the current spec.
8351
8352 The following built-in spec functions are provided:
8353
8354 @table @code
8355 @item @code{getenv}
8356 The @code{getenv} spec function takes two arguments: an environment
8357 variable name and a string.  If the environment variable is not
8358 defined, a fatal error is issued.  Otherwise, the return value is the
8359 value of the environment variable concatenated with the string.  For
8360 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
8361
8362 @smallexample
8363 %:getenv(TOPDIR /include)
8364 @end smallexample
8365
8366 expands to @file{/path/to/top/include}.
8367
8368 @item @code{if-exists}
8369 The @code{if-exists} spec function takes one argument, an absolute
8370 pathname to a file.  If the file exists, @code{if-exists} returns the
8371 pathname.  Here is a small example of its usage:
8372
8373 @smallexample
8374 *startfile:
8375 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
8376 @end smallexample
8377
8378 @item @code{if-exists-else}
8379 The @code{if-exists-else} spec function is similar to the @code{if-exists}
8380 spec function, except that it takes two arguments.  The first argument is
8381 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
8382 returns the pathname.  If it does not exist, it returns the second argument.
8383 This way, @code{if-exists-else} can be used to select one file or another,
8384 based on the existence of the first.  Here is a small example of its usage:
8385
8386 @smallexample
8387 *startfile:
8388 crt0%O%s %:if-exists(crti%O%s) \
8389 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
8390 @end smallexample
8391
8392 @item @code{replace-outfile}
8393 The @code{replace-outfile} spec function takes two arguments.  It looks for the
8394 first argument in the outfiles array and replaces it with the second argument.  Here
8395 is a small example of its usage:
8396
8397 @smallexample
8398 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
8399 @end smallexample
8400
8401 @item @code{print-asm-header}
8402 The @code{print-asm-header} function takes no arguments and simply
8403 prints a banner like:
8404
8405 @smallexample
8406 Assembler options
8407 =================
8408
8409 Use "-Wa,OPTION" to pass "OPTION" to the assembler.
8410 @end smallexample
8411
8412 It is used to separate compiler options from assembler options
8413 in the @option{--target-help} output.
8414 @end table
8415
8416 @item %@{@code{S}@}
8417 Substitutes the @code{-S} switch, if that switch was given to GCC@.
8418 If that switch was not specified, this substitutes nothing.  Note that
8419 the leading dash is omitted when specifying this option, and it is
8420 automatically inserted if the substitution is performed.  Thus the spec
8421 string @samp{%@{foo@}} would match the command-line option @option{-foo}
8422 and would output the command line option @option{-foo}.
8423
8424 @item %W@{@code{S}@}
8425 Like %@{@code{S}@} but mark last argument supplied within as a file to be
8426 deleted on failure.
8427
8428 @item %@{@code{S}*@}
8429 Substitutes all the switches specified to GCC whose names start
8430 with @code{-S}, but which also take an argument.  This is used for
8431 switches like @option{-o}, @option{-D}, @option{-I}, etc.
8432 GCC considers @option{-o foo} as being
8433 one switch whose names starts with @samp{o}.  %@{o*@} would substitute this
8434 text, including the space.  Thus two arguments would be generated.
8435
8436 @item %@{@code{S}*&@code{T}*@}
8437 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
8438 (the order of @code{S} and @code{T} in the spec is not significant).
8439 There can be any number of ampersand-separated variables; for each the
8440 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
8441
8442 @item %@{@code{S}:@code{X}@}
8443 Substitutes @code{X}, if the @samp{-S} switch was given to GCC@.
8444
8445 @item %@{!@code{S}:@code{X}@}
8446 Substitutes @code{X}, if the @samp{-S} switch was @emph{not} given to GCC@.
8447
8448 @item %@{@code{S}*:@code{X}@}
8449 Substitutes @code{X} if one or more switches whose names start with
8450 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
8451 once, no matter how many such switches appeared.  However, if @code{%*}
8452 appears somewhere in @code{X}, then @code{X} will be substituted once
8453 for each matching switch, with the @code{%*} replaced by the part of
8454 that switch that matched the @code{*}.
8455
8456 @item %@{.@code{S}:@code{X}@}
8457 Substitutes @code{X}, if processing a file with suffix @code{S}.
8458
8459 @item %@{!.@code{S}:@code{X}@}
8460 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
8461
8462 @item %@{,@code{S}:@code{X}@}
8463 Substitutes @code{X}, if processing a file for language @code{S}.
8464
8465 @item %@{!,@code{S}:@code{X}@}
8466 Substitutes @code{X}, if not processing a file for language @code{S}.
8467
8468 @item %@{@code{S}|@code{P}:@code{X}@}
8469 Substitutes @code{X} if either @code{-S} or @code{-P} was given to
8470 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
8471 @code{*} sequences as well, although they have a stronger binding than
8472 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
8473 alternatives must be starred, and only the first matching alternative
8474 is substituted.
8475
8476 For example, a spec string like this:
8477
8478 @smallexample
8479 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
8480 @end smallexample
8481
8482 will output the following command-line options from the following input
8483 command-line options:
8484
8485 @smallexample
8486 fred.c        -foo -baz
8487 jim.d         -bar -boggle
8488 -d fred.c     -foo -baz -boggle
8489 -d jim.d      -bar -baz -boggle
8490 @end smallexample
8491
8492 @item %@{S:X; T:Y; :D@}
8493
8494 If @code{S} was given to GCC, substitutes @code{X}; else if @code{T} was
8495 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
8496 be as many clauses as you need.  This may be combined with @code{.},
8497 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
8498
8499
8500 @end table
8501
8502 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
8503 construct may contain other nested @samp{%} constructs or spaces, or
8504 even newlines.  They are processed as usual, as described above.
8505 Trailing white space in @code{X} is ignored.  White space may also
8506 appear anywhere on the left side of the colon in these constructs,
8507 except between @code{.} or @code{*} and the corresponding word.
8508
8509 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
8510 handled specifically in these constructs.  If another value of
8511 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
8512 @option{-W} switch is found later in the command line, the earlier
8513 switch value is ignored, except with @{@code{S}*@} where @code{S} is
8514 just one letter, which passes all matching options.
8515
8516 The character @samp{|} at the beginning of the predicate text is used to
8517 indicate that a command should be piped to the following command, but
8518 only if @option{-pipe} is specified.
8519
8520 It is built into GCC which switches take arguments and which do not.
8521 (You might think it would be useful to generalize this to allow each
8522 compiler's spec to say which switches take arguments.  But this cannot
8523 be done in a consistent fashion.  GCC cannot even decide which input
8524 files have been specified without knowing which switches take arguments,
8525 and it must know which input files to compile in order to tell which
8526 compilers to run).
8527
8528 GCC also knows implicitly that arguments starting in @option{-l} are to be
8529 treated as compiler output files, and passed to the linker in their
8530 proper position among the other output files.
8531
8532 @c man begin OPTIONS
8533
8534 @node Target Options
8535 @section Specifying Target Machine and Compiler Version
8536 @cindex target options
8537 @cindex cross compiling
8538 @cindex specifying machine version
8539 @cindex specifying compiler version and target machine
8540 @cindex compiler version, specifying
8541 @cindex target machine, specifying
8542
8543 The usual way to run GCC is to run the executable called @file{gcc}, or
8544 @file{<machine>-gcc} when cross-compiling, or
8545 @file{<machine>-gcc-<version>} to run a version other than the one that
8546 was installed last.  Sometimes this is inconvenient, so GCC provides
8547 options that will switch to another cross-compiler or version.
8548
8549 @table @gcctabopt
8550 @item -b @var{machine}
8551 @opindex b
8552 The argument @var{machine} specifies the target machine for compilation.
8553
8554 The value to use for @var{machine} is the same as was specified as the
8555 machine type when configuring GCC as a cross-compiler.  For
8556 example, if a cross-compiler was configured with @samp{configure
8557 arm-elf}, meaning to compile for an arm processor with elf binaries,
8558 then you would specify @option{-b arm-elf} to run that cross compiler.
8559 Because there are other options beginning with @option{-b}, the
8560 configuration must contain a hyphen.
8561
8562 @item -V @var{version}
8563 @opindex V
8564 The argument @var{version} specifies which version of GCC to run.
8565 This is useful when multiple versions are installed.  For example,
8566 @var{version} might be @samp{4.0}, meaning to run GCC version 4.0.
8567 @end table
8568
8569 The @option{-V} and @option{-b} options work by running the
8570 @file{<machine>-gcc-<version>} executable, so there's no real reason to
8571 use them if you can just run that directly.
8572
8573 @node Submodel Options
8574 @section Hardware Models and Configurations
8575 @cindex submodel options
8576 @cindex specifying hardware config
8577 @cindex hardware models and configurations, specifying
8578 @cindex machine dependent options
8579
8580 Earlier we discussed the standard option @option{-b} which chooses among
8581 different installed compilers for completely different target
8582 machines, such as VAX vs.@: 68000 vs.@: 80386.
8583
8584 In addition, each of these target machine types can have its own
8585 special options, starting with @samp{-m}, to choose among various
8586 hardware models or configurations---for example, 68010 vs 68020,
8587 floating coprocessor or none.  A single installed version of the
8588 compiler can compile for any model or configuration, according to the
8589 options specified.
8590
8591 Some configurations of the compiler also support additional special
8592 options, usually for compatibility with other compilers on the same
8593 platform.
8594
8595 @c This list is ordered alphanumerically by subsection name.
8596 @c It should be the same order and spelling as these options are listed
8597 @c in Machine Dependent Options
8598
8599 @menu
8600 * ARC Options::
8601 * ARM Options::
8602 * AVR Options::
8603 * Blackfin Options::
8604 * CRIS Options::
8605 * CRX Options::
8606 * Darwin Options::
8607 * DEC Alpha Options::
8608 * DEC Alpha/VMS Options::
8609 * FRV Options::
8610 * GNU/Linux Options::
8611 * H8/300 Options::
8612 * HPPA Options::
8613 * i386 and x86-64 Options::
8614 * IA-64 Options::
8615 * M32C Options::
8616 * M32R/D Options::
8617 * M680x0 Options::
8618 * M68hc1x Options::
8619 * MCore Options::
8620 * MIPS Options::
8621 * MMIX Options::
8622 * MN10300 Options::
8623 * PDP-11 Options::
8624 * picoChip Options::
8625 * PowerPC Options::
8626 * RS/6000 and PowerPC Options::
8627 * S/390 and zSeries Options::
8628 * Score Options::
8629 * SH Options::
8630 * SPARC Options::
8631 * SPU Options::
8632 * System V Options::
8633 * V850 Options::
8634 * VAX Options::
8635 * VxWorks Options::
8636 * x86-64 Options::
8637 * Xstormy16 Options::
8638 * Xtensa Options::
8639 * zSeries Options::
8640 @end menu
8641
8642 @node ARC Options
8643 @subsection ARC Options
8644 @cindex ARC Options
8645
8646 These options are defined for ARC implementations:
8647
8648 @table @gcctabopt
8649 @item -EL
8650 @opindex EL
8651 Compile code for little endian mode.  This is the default.
8652
8653 @item -EB
8654 @opindex EB
8655 Compile code for big endian mode.
8656
8657 @item -mmangle-cpu
8658 @opindex mmangle-cpu
8659 Prepend the name of the cpu to all public symbol names.
8660 In multiple-processor systems, there are many ARC variants with different
8661 instruction and register set characteristics.  This flag prevents code
8662 compiled for one cpu to be linked with code compiled for another.
8663 No facility exists for handling variants that are ``almost identical''.
8664 This is an all or nothing option.
8665
8666 @item -mcpu=@var{cpu}
8667 @opindex mcpu
8668 Compile code for ARC variant @var{cpu}.
8669 Which variants are supported depend on the configuration.
8670 All variants support @option{-mcpu=base}, this is the default.
8671
8672 @item -mtext=@var{text-section}
8673 @itemx -mdata=@var{data-section}
8674 @itemx -mrodata=@var{readonly-data-section}
8675 @opindex mtext
8676 @opindex mdata
8677 @opindex mrodata
8678 Put functions, data, and readonly data in @var{text-section},
8679 @var{data-section}, and @var{readonly-data-section} respectively
8680 by default.  This can be overridden with the @code{section} attribute.
8681 @xref{Variable Attributes}.
8682
8683 @end table
8684
8685 @node ARM Options
8686 @subsection ARM Options
8687 @cindex ARM options
8688
8689 These @samp{-m} options are defined for Advanced RISC Machines (ARM)
8690 architectures:
8691
8692 @table @gcctabopt
8693 @item -mabi=@var{name}
8694 @opindex mabi
8695 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
8696 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
8697
8698 @item -mapcs-frame
8699 @opindex mapcs-frame
8700 Generate a stack frame that is compliant with the ARM Procedure Call
8701 Standard for all functions, even if this is not strictly necessary for
8702 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
8703 with this option will cause the stack frames not to be generated for
8704 leaf functions.  The default is @option{-mno-apcs-frame}.
8705
8706 @item -mapcs
8707 @opindex mapcs
8708 This is a synonym for @option{-mapcs-frame}.
8709
8710 @ignore
8711 @c not currently implemented
8712 @item -mapcs-stack-check
8713 @opindex mapcs-stack-check
8714 Generate code to check the amount of stack space available upon entry to
8715 every function (that actually uses some stack space).  If there is
8716 insufficient space available then either the function
8717 @samp{__rt_stkovf_split_small} or @samp{__rt_stkovf_split_big} will be
8718 called, depending upon the amount of stack space required.  The run time
8719 system is required to provide these functions.  The default is
8720 @option{-mno-apcs-stack-check}, since this produces smaller code.
8721
8722 @c not currently implemented
8723 @item -mapcs-float
8724 @opindex mapcs-float
8725 Pass floating point arguments using the float point registers.  This is
8726 one of the variants of the APCS@.  This option is recommended if the
8727 target hardware has a floating point unit or if a lot of floating point
8728 arithmetic is going to be performed by the code.  The default is
8729 @option{-mno-apcs-float}, since integer only code is slightly increased in
8730 size if @option{-mapcs-float} is used.
8731
8732 @c not currently implemented
8733 @item -mapcs-reentrant
8734 @opindex mapcs-reentrant
8735 Generate reentrant, position independent code.  The default is
8736 @option{-mno-apcs-reentrant}.
8737 @end ignore
8738
8739 @item -mthumb-interwork
8740 @opindex mthumb-interwork
8741 Generate code which supports calling between the ARM and Thumb
8742 instruction sets.  Without this option the two instruction sets cannot
8743 be reliably used inside one program.  The default is
8744 @option{-mno-thumb-interwork}, since slightly larger code is generated
8745 when @option{-mthumb-interwork} is specified.
8746
8747 @item -mno-sched-prolog
8748 @opindex mno-sched-prolog
8749 Prevent the reordering of instructions in the function prolog, or the
8750 merging of those instruction with the instructions in the function's
8751 body.  This means that all functions will start with a recognizable set
8752 of instructions (or in fact one of a choice from a small set of
8753 different function prologues), and this information can be used to
8754 locate the start if functions inside an executable piece of code.  The
8755 default is @option{-msched-prolog}.
8756
8757 @item -mfloat-abi=@var{name}
8758 @opindex mfloat-abi
8759 Specifies which floating-point ABI to use.  Permissible values
8760 are: @samp{soft}, @samp{softfp} and @samp{hard}.
8761
8762 Specifying @samp{soft} causes GCC to generate output containing 
8763 library calls for floating-point operations.
8764 @samp{softfp} allows the generation of code using hardware floating-point 
8765 instructions, but still uses the soft-float calling conventions.  
8766 @samp{hard} allows generation of floating-point instructions 
8767 and uses FPU-specific calling conventions.
8768
8769 Using @option{-mfloat-abi=hard} with VFP coprocessors is not supported.
8770 Use @option{-mfloat-abi=softfp} with the appropriate @option{-mfpu} option
8771 to allow the compiler to generate code that makes use of the hardware
8772 floating-point capabilities for these CPUs.
8773
8774 The default depends on the specific target configuration.  Note that
8775 the hard-float and soft-float ABIs are not link-compatible; you must
8776 compile your entire program with the same ABI, and link with a
8777 compatible set of libraries.
8778
8779 @item -mhard-float
8780 @opindex mhard-float
8781 Equivalent to @option{-mfloat-abi=hard}.
8782
8783 @item -msoft-float
8784 @opindex msoft-float
8785 Equivalent to @option{-mfloat-abi=soft}.
8786
8787 @item -mlittle-endian
8788 @opindex mlittle-endian
8789 Generate code for a processor running in little-endian mode.  This is
8790 the default for all standard configurations.
8791
8792 @item -mbig-endian
8793 @opindex mbig-endian
8794 Generate code for a processor running in big-endian mode; the default is
8795 to compile code for a little-endian processor.
8796
8797 @item -mwords-little-endian
8798 @opindex mwords-little-endian
8799 This option only applies when generating code for big-endian processors.
8800 Generate code for a little-endian word order but a big-endian byte
8801 order.  That is, a byte order of the form @samp{32107654}.  Note: this
8802 option should only be used if you require compatibility with code for
8803 big-endian ARM processors generated by versions of the compiler prior to
8804 2.8.
8805
8806 @item -mcpu=@var{name}
8807 @opindex mcpu
8808 This specifies the name of the target ARM processor.  GCC uses this name
8809 to determine what kind of instructions it can emit when generating
8810 assembly code.  Permissible names are: @samp{arm2}, @samp{arm250},
8811 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
8812 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
8813 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
8814 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
8815 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
8816 @samp{arm8}, @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
8817 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
8818 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
8819 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
8820 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
8821 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
8822 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
8823 @samp{arm1156t2-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
8824 @samp{cortex-a8}, @samp{cortex-r4}, @samp{cortex-r4f}, @samp{cortex-m3},
8825 @samp{cortex-m1},
8826 @samp{xscale}, @samp{iwmmxt}, @samp{ep9312}.
8827
8828 @item -mtune=@var{name}
8829 @opindex mtune
8830 This option is very similar to the @option{-mcpu=} option, except that
8831 instead of specifying the actual target processor type, and hence
8832 restricting which instructions can be used, it specifies that GCC should
8833 tune the performance of the code as if the target were of the type
8834 specified in this option, but still choosing the instructions that it
8835 will generate based on the cpu specified by a @option{-mcpu=} option.
8836 For some ARM implementations better performance can be obtained by using
8837 this option.
8838
8839 @item -march=@var{name}
8840 @opindex march
8841 This specifies the name of the target ARM architecture.  GCC uses this
8842 name to determine what kind of instructions it can emit when generating
8843 assembly code.  This option can be used in conjunction with or instead
8844 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
8845 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
8846 @samp{armv5}, @samp{armv5t}, @samp{armv5te}, @samp{armv6}, @samp{armv6j},
8847 @samp{armv6t2}, @samp{armv6z}, @samp{armv6zk}, @samp{armv6-m},
8848 @samp{armv7}, @samp{armv7-a}, @samp{armv7-r}, @samp{armv7-m},
8849 @samp{iwmmxt}, @samp{ep9312}.
8850
8851 @item -mfpu=@var{name}
8852 @itemx -mfpe=@var{number}
8853 @itemx -mfp=@var{number}
8854 @opindex mfpu
8855 @opindex mfpe
8856 @opindex mfp
8857 This specifies what floating point hardware (or hardware emulation) is
8858 available on the target.  Permissible names are: @samp{fpa}, @samp{fpe2},
8859 @samp{fpe3}, @samp{maverick}, @samp{vfp}, @samp{vfpv3}, @samp{vfpv3-d16} and
8860 @samp{neon}.  @option{-mfp} and @option{-mfpe}
8861 are synonyms for @option{-mfpu}=@samp{fpe}@var{number}, for compatibility
8862 with older versions of GCC@.
8863
8864 If @option{-msoft-float} is specified this specifies the format of
8865 floating point values.
8866
8867 @item -mstructure-size-boundary=@var{n}
8868 @opindex mstructure-size-boundary
8869 The size of all structures and unions will be rounded up to a multiple
8870 of the number of bits set by this option.  Permissible values are 8, 32
8871 and 64.  The default value varies for different toolchains.  For the COFF
8872 targeted toolchain the default value is 8.  A value of 64 is only allowed
8873 if the underlying ABI supports it.
8874
8875 Specifying the larger number can produce faster, more efficient code, but
8876 can also increase the size of the program.  Different values are potentially
8877 incompatible.  Code compiled with one value cannot necessarily expect to
8878 work with code or libraries compiled with another value, if they exchange
8879 information using structures or unions.
8880
8881 @item -mabort-on-noreturn
8882 @opindex mabort-on-noreturn
8883 Generate a call to the function @code{abort} at the end of a
8884 @code{noreturn} function.  It will be executed if the function tries to
8885 return.
8886
8887 @item -mlong-calls
8888 @itemx -mno-long-calls
8889 @opindex mlong-calls
8890 @opindex mno-long-calls
8891 Tells the compiler to perform function calls by first loading the
8892 address of the function into a register and then performing a subroutine
8893 call on this register.  This switch is needed if the target function
8894 will lie outside of the 64 megabyte addressing range of the offset based
8895 version of subroutine call instruction.
8896
8897 Even if this switch is enabled, not all function calls will be turned
8898 into long calls.  The heuristic is that static functions, functions
8899 which have the @samp{short-call} attribute, functions that are inside
8900 the scope of a @samp{#pragma no_long_calls} directive and functions whose
8901 definitions have already been compiled within the current compilation
8902 unit, will not be turned into long calls.  The exception to this rule is
8903 that weak function definitions, functions with the @samp{long-call}
8904 attribute or the @samp{section} attribute, and functions that are within
8905 the scope of a @samp{#pragma long_calls} directive, will always be
8906 turned into long calls.
8907
8908 This feature is not enabled by default.  Specifying
8909 @option{-mno-long-calls} will restore the default behavior, as will
8910 placing the function calls within the scope of a @samp{#pragma
8911 long_calls_off} directive.  Note these switches have no effect on how
8912 the compiler generates code to handle function calls via function
8913 pointers.
8914
8915 @item -mnop-fun-dllimport
8916 @opindex mnop-fun-dllimport
8917 Disable support for the @code{dllimport} attribute.
8918
8919 @item -msingle-pic-base
8920 @opindex msingle-pic-base
8921 Treat the register used for PIC addressing as read-only, rather than
8922 loading it in the prologue for each function.  The run-time system is
8923 responsible for initializing this register with an appropriate value
8924 before execution begins.
8925
8926 @item -mpic-register=@var{reg}
8927 @opindex mpic-register
8928 Specify the register to be used for PIC addressing.  The default is R10
8929 unless stack-checking is enabled, when R9 is used.
8930
8931 @item -mcirrus-fix-invalid-insns
8932 @opindex mcirrus-fix-invalid-insns
8933 @opindex mno-cirrus-fix-invalid-insns
8934 Insert NOPs into the instruction stream to in order to work around
8935 problems with invalid Maverick instruction combinations.  This option
8936 is only valid if the @option{-mcpu=ep9312} option has been used to
8937 enable generation of instructions for the Cirrus Maverick floating
8938 point co-processor.  This option is not enabled by default, since the
8939 problem is only present in older Maverick implementations.  The default
8940 can be re-enabled by use of the @option{-mno-cirrus-fix-invalid-insns}
8941 switch.
8942
8943 @item -mpoke-function-name
8944 @opindex mpoke-function-name
8945 Write the name of each function into the text section, directly
8946 preceding the function prologue.  The generated code is similar to this:
8947
8948 @smallexample
8949      t0
8950          .ascii "arm_poke_function_name", 0
8951          .align
8952      t1
8953          .word 0xff000000 + (t1 - t0)
8954      arm_poke_function_name
8955          mov     ip, sp
8956          stmfd   sp!, @{fp, ip, lr, pc@}
8957          sub     fp, ip, #4
8958 @end smallexample
8959
8960 When performing a stack backtrace, code can inspect the value of
8961 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
8962 location @code{pc - 12} and the top 8 bits are set, then we know that
8963 there is a function name embedded immediately preceding this location
8964 and has length @code{((pc[-3]) & 0xff000000)}.
8965
8966 @item -mthumb
8967 @opindex mthumb
8968 Generate code for the Thumb instruction set.  The default is to
8969 use the 32-bit ARM instruction set.
8970 This option automatically enables either 16-bit Thumb-1 or
8971 mixed 16/32-bit Thumb-2 instructions based on the @option{-mcpu=@var{name}}
8972 and @option{-march=@var{name}} options.
8973
8974 @item -mtpcs-frame
8975 @opindex mtpcs-frame
8976 Generate a stack frame that is compliant with the Thumb Procedure Call
8977 Standard for all non-leaf functions.  (A leaf function is one that does
8978 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
8979
8980 @item -mtpcs-leaf-frame
8981 @opindex mtpcs-leaf-frame
8982 Generate a stack frame that is compliant with the Thumb Procedure Call
8983 Standard for all leaf functions.  (A leaf function is one that does
8984 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
8985
8986 @item -mcallee-super-interworking
8987 @opindex mcallee-super-interworking
8988 Gives all externally visible functions in the file being compiled an ARM
8989 instruction set header which switches to Thumb mode before executing the
8990 rest of the function.  This allows these functions to be called from
8991 non-interworking code.
8992
8993 @item -mcaller-super-interworking
8994 @opindex mcaller-super-interworking
8995 Allows calls via function pointers (including virtual functions) to
8996 execute correctly regardless of whether the target code has been
8997 compiled for interworking or not.  There is a small overhead in the cost
8998 of executing a function pointer if this option is enabled.
8999
9000 @item -mtp=@var{name}
9001 @opindex mtp
9002 Specify the access model for the thread local storage pointer.  The valid
9003 models are @option{soft}, which generates calls to @code{__aeabi_read_tp},
9004 @option{cp15}, which fetches the thread pointer from @code{cp15} directly
9005 (supported in the arm6k architecture), and @option{auto}, which uses the
9006 best available method for the selected processor.  The default setting is
9007 @option{auto}.
9008
9009 @item -mword-relocations
9010 @opindex mword-relocations
9011 Only generate absolute relocations on word sized values (i.e. R_ARM_ABS32).
9012 This is enabled by default on targets (uClinux, SymbianOS) where the runtime
9013 loader imposes this restriction, and when @option{-fpic} or @option{-fPIC}
9014 is speficied.
9015
9016 @end table
9017
9018 @node AVR Options
9019 @subsection AVR Options
9020 @cindex AVR Options
9021
9022 These options are defined for AVR implementations:
9023
9024 @table @gcctabopt
9025 @item -mmcu=@var{mcu}
9026 @opindex mmcu
9027 Specify ATMEL AVR instruction set or MCU type.
9028
9029 Instruction set avr1 is for the minimal AVR core, not supported by the C
9030 compiler, only for assembler programs (MCU types: at90s1200, attiny10,
9031 attiny11, attiny12, attiny15, attiny28).
9032
9033 Instruction set avr2 (default) is for the classic AVR core with up to
9034 8K program memory space (MCU types: at90s2313, at90s2323, attiny22,
9035 at90s2333, at90s2343, at90s4414, at90s4433, at90s4434, at90s8515,
9036 at90c8534, at90s8535).
9037
9038 Instruction set avr3 is for the classic AVR core with up to 128K program
9039 memory space (MCU types: atmega103, atmega603, at43usb320, at76c711).
9040
9041 Instruction set avr4 is for the enhanced AVR core with up to 8K program
9042 memory space (MCU types: atmega8, atmega83, atmega85).
9043
9044 Instruction set avr5 is for the enhanced AVR core with up to 128K program
9045 memory space (MCU types: atmega16, atmega161, atmega163, atmega32, atmega323,
9046 atmega64, atmega128, at43usb355, at94k).
9047
9048 @item -msize
9049 @opindex msize
9050 Output instruction sizes to the asm file.
9051
9052 @item -minit-stack=@var{N}
9053 @opindex minit-stack
9054 Specify the initial stack address, which may be a symbol or numeric value,
9055 @samp{__stack} is the default.
9056
9057 @item -mno-interrupts
9058 @opindex mno-interrupts
9059 Generated code is not compatible with hardware interrupts.
9060 Code size will be smaller.
9061
9062 @item -mcall-prologues
9063 @opindex mcall-prologues
9064 Functions prologues/epilogues expanded as call to appropriate
9065 subroutines.  Code size will be smaller.
9066
9067 @item -mno-tablejump
9068 @opindex mno-tablejump
9069 Do not generate tablejump insns which sometimes increase code size.
9070
9071 @item -mtiny-stack
9072 @opindex mtiny-stack
9073 Change only the low 8 bits of the stack pointer.
9074
9075 @item -mint8
9076 @opindex mint8
9077 Assume int to be 8 bit integer.  This affects the sizes of all types: A
9078 char will be 1 byte, an int will be 1 byte, an long will be 2 bytes
9079 and long long will be 4 bytes.  Please note that this option does not
9080 comply to the C standards, but it will provide you with smaller code
9081 size.
9082 @end table
9083
9084 @node Blackfin Options
9085 @subsection Blackfin Options
9086 @cindex Blackfin Options
9087
9088 @table @gcctabopt
9089 @item -mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]}
9090 @opindex mcpu=
9091 Specifies the name of the target Blackfin processor.  Currently, @var{cpu}
9092 can be one of @samp{bf522}, @samp{bf523}, @samp{bf524},
9093 @samp{bf525}, @samp{bf526}, @samp{bf527},
9094 @samp{bf531}, @samp{bf532}, @samp{bf533}, @samp{bf534},
9095 @samp{bf536}, @samp{bf537}, @samp{bf538}, @samp{bf539},
9096 @samp{bf542}, @samp{bf544}, @samp{bf547}, @samp{bf548}, @samp{bf549},
9097 @samp{bf561}.
9098 The optional @var{sirevision} specifies the silicon revision of the target
9099 Blackfin processor.  Any workarounds available for the targeted silicon revision
9100 will be enabled.  If @var{sirevision} is @samp{none}, no workarounds are enabled.
9101 If @var{sirevision} is @samp{any}, all workarounds for the targeted processor
9102 will be enabled.  The @code{__SILICON_REVISION__} macro is defined to two
9103 hexadecimal digits representing the major and minor numbers in the silicon
9104 revision.  If @var{sirevision} is @samp{none}, the @code{__SILICON_REVISION__}
9105 is not defined.  If @var{sirevision} is @samp{any}, the
9106 @code{__SILICON_REVISION__} is defined to be @code{0xffff}.
9107 If this optional @var{sirevision} is not used, GCC assumes the latest known
9108 silicon revision of the targeted Blackfin processor.
9109
9110 Support for @samp{bf561} is incomplete.  For @samp{bf561},
9111 Only the processor macro is defined.
9112 Without this option, @samp{bf532} is used as the processor by default.
9113 The corresponding predefined processor macros for @var{cpu} is to
9114 be defined.  And for @samp{bfin-elf} toolchain, this causes the hardware BSP
9115 provided by libgloss to be linked in if @option{-msim} is not given.
9116
9117 @item -msim
9118 @opindex msim
9119 Specifies that the program will be run on the simulator.  This causes
9120 the simulator BSP provided by libgloss to be linked in.  This option
9121 has effect only for @samp{bfin-elf} toolchain.
9122 Certain other options, such as @option{-mid-shared-library} and
9123 @option{-mfdpic}, imply @option{-msim}.
9124
9125 @item -momit-leaf-frame-pointer
9126 @opindex momit-leaf-frame-pointer
9127 Don't keep the frame pointer in a register for leaf functions.  This
9128 avoids the instructions to save, set up and restore frame pointers and
9129 makes an extra register available in leaf functions.  The option
9130 @option{-fomit-frame-pointer} removes the frame pointer for all functions
9131 which might make debugging harder.
9132
9133 @item -mspecld-anomaly
9134 @opindex mspecld-anomaly
9135 When enabled, the compiler will ensure that the generated code does not
9136 contain speculative loads after jump instructions. If this option is used,
9137 @code{__WORKAROUND_SPECULATIVE_LOADS} is defined.
9138
9139 @item -mno-specld-anomaly
9140 @opindex mno-specld-anomaly
9141 Don't generate extra code to prevent speculative loads from occurring.
9142
9143 @item -mcsync-anomaly
9144 @opindex mcsync-anomaly
9145 When enabled, the compiler will ensure that the generated code does not
9146 contain CSYNC or SSYNC instructions too soon after conditional branches.
9147 If this option is used, @code{__WORKAROUND_SPECULATIVE_SYNCS} is defined.
9148
9149 @item -mno-csync-anomaly
9150 @opindex mno-csync-anomaly
9151 Don't generate extra code to prevent CSYNC or SSYNC instructions from
9152 occurring too soon after a conditional branch.
9153
9154 @item -mlow-64k
9155 @opindex mlow-64k
9156 When enabled, the compiler is free to take advantage of the knowledge that
9157 the entire program fits into the low 64k of memory.
9158
9159 @item -mno-low-64k
9160 @opindex mno-low-64k
9161 Assume that the program is arbitrarily large.  This is the default.
9162
9163 @item -mstack-check-l1
9164 @opindex mstack-check-l1
9165 Do stack checking using information placed into L1 scratchpad memory by the
9166 uClinux kernel.
9167
9168 @item -mid-shared-library
9169 @opindex mid-shared-library
9170 Generate code that supports shared libraries via the library ID method.
9171 This allows for execute in place and shared libraries in an environment
9172 without virtual memory management.  This option implies @option{-fPIC}.
9173 With a @samp{bfin-elf} target, this option implies @option{-msim}.
9174
9175 @item -mno-id-shared-library
9176 @opindex mno-id-shared-library
9177 Generate code that doesn't assume ID based shared libraries are being used.
9178 This is the default.
9179
9180 @item -mleaf-id-shared-library
9181 @opindex mleaf-id-shared-library
9182 Generate code that supports shared libraries via the library ID method,
9183 but assumes that this library or executable won't link against any other
9184 ID shared libraries.  That allows the compiler to use faster code for jumps
9185 and calls.
9186
9187 @item -mno-leaf-id-shared-library
9188 @opindex mno-leaf-id-shared-library
9189 Do not assume that the code being compiled won't link against any ID shared
9190 libraries.  Slower code will be generated for jump and call insns.
9191
9192 @item -mshared-library-id=n
9193 @opindex mshared-library-id
9194 Specified the identification number of the ID based shared library being
9195 compiled.  Specifying a value of 0 will generate more compact code, specifying
9196 other values will force the allocation of that number to the current
9197 library but is no more space or time efficient than omitting this option.
9198
9199 @item -msep-data
9200 @opindex msep-data
9201 Generate code that allows the data segment to be located in a different
9202 area of memory from the text segment.  This allows for execute in place in
9203 an environment without virtual memory management by eliminating relocations
9204 against the text section.
9205
9206 @item -mno-sep-data
9207 @opindex mno-sep-data
9208 Generate code that assumes that the data segment follows the text segment.
9209 This is the default.
9210
9211 @item -mlong-calls
9212 @itemx -mno-long-calls
9213 @opindex mlong-calls
9214 @opindex mno-long-calls
9215 Tells the compiler to perform function calls by first loading the
9216 address of the function into a register and then performing a subroutine
9217 call on this register.  This switch is needed if the target function
9218 will lie outside of the 24 bit addressing range of the offset based
9219 version of subroutine call instruction.
9220
9221 This feature is not enabled by default.  Specifying
9222 @option{-mno-long-calls} will restore the default behavior.  Note these
9223 switches have no effect on how the compiler generates code to handle
9224 function calls via function pointers.
9225
9226 @item -mfast-fp
9227 @opindex mfast-fp
9228 Link with the fast floating-point library. This library relaxes some of
9229 the IEEE floating-point standard's rules for checking inputs against
9230 Not-a-Number (NAN), in the interest of performance.
9231
9232 @item -minline-plt
9233 @opindex minline-plt
9234 Enable inlining of PLT entries in function calls to functions that are
9235 not known to bind locally.  It has no effect without @option{-mfdpic}.
9236
9237 @item -mmulticore
9238 @opindex mmulticore
9239 Build standalone application for multicore Blackfin processor. Proper
9240 start files and link scripts will be used to support multicore.
9241 This option defines @code{__BFIN_MULTICORE}. It can only be used with
9242 @option{-mcpu=bf561@r{[}-@var{sirevision}@r{]}}. It can be used with
9243 @option{-mcorea} or @option{-mcoreb}. If it's used without
9244 @option{-mcorea} or @option{-mcoreb}, single application/dual core
9245 programming model is used. In this model, the main function of Core B
9246 should be named as coreb_main. If it's used with @option{-mcorea} or
9247 @option{-mcoreb}, one application per core programming model is used.
9248 If this option is not used, single core application programming
9249 model is used.
9250
9251 @item -mcorea
9252 @opindex mcorea
9253 Build standalone application for Core A of BF561 when using
9254 one application per core programming model. Proper start files
9255 and link scripts will be used to support Core A. This option
9256 defines @code{__BFIN_COREA}. It must be used with @option{-mmulticore}.
9257
9258 @item -mcoreb
9259 @opindex mcoreb
9260 Build standalone application for Core B of BF561 when using
9261 one application per core programming model. Proper start files
9262 and link scripts will be used to support Core B. This option
9263 defines @code{__BFIN_COREB}. When this option is used, coreb_main
9264 should be used instead of main. It must be used with
9265 @option{-mmulticore}. 
9266
9267 @item -msdram
9268 @opindex msdram
9269 Build standalone application for SDRAM. Proper start files and
9270 link scripts will be used to put the application into SDRAM.
9271 Loader should initialize SDRAM before loading the application
9272 into SDRAM. This option defines @code{__BFIN_SDRAM}.
9273 @end table
9274
9275 @node CRIS Options
9276 @subsection CRIS Options
9277 @cindex CRIS Options
9278
9279 These options are defined specifically for the CRIS ports.
9280
9281 @table @gcctabopt
9282 @item -march=@var{architecture-type}
9283 @itemx -mcpu=@var{architecture-type}
9284 @opindex march
9285 @opindex mcpu
9286 Generate code for the specified architecture.  The choices for
9287 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
9288 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
9289 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
9290 @samp{v10}.
9291
9292 @item -mtune=@var{architecture-type}
9293 @opindex mtune
9294 Tune to @var{architecture-type} everything applicable about the generated
9295 code, except for the ABI and the set of available instructions.  The
9296 choices for @var{architecture-type} are the same as for
9297 @option{-march=@var{architecture-type}}.
9298
9299 @item -mmax-stack-frame=@var{n}
9300 @opindex mmax-stack-frame
9301 Warn when the stack frame of a function exceeds @var{n} bytes.
9302
9303 @item -metrax4
9304 @itemx -metrax100
9305 @opindex metrax4
9306 @opindex metrax100
9307 The options @option{-metrax4} and @option{-metrax100} are synonyms for
9308 @option{-march=v3} and @option{-march=v8} respectively.
9309
9310 @item -mmul-bug-workaround
9311 @itemx -mno-mul-bug-workaround
9312 @opindex mmul-bug-workaround
9313 @opindex mno-mul-bug-workaround
9314 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
9315 models where it applies.  This option is active by default.
9316
9317 @item -mpdebug
9318 @opindex mpdebug
9319 Enable CRIS-specific verbose debug-related information in the assembly
9320 code.  This option also has the effect to turn off the @samp{#NO_APP}
9321 formatted-code indicator to the assembler at the beginning of the
9322 assembly file.
9323
9324 @item -mcc-init
9325 @opindex mcc-init
9326 Do not use condition-code results from previous instruction; always emit
9327 compare and test instructions before use of condition codes.
9328
9329 @item -mno-side-effects
9330 @opindex mno-side-effects
9331 Do not emit instructions with side-effects in addressing modes other than
9332 post-increment.
9333
9334 @item -mstack-align
9335 @itemx -mno-stack-align
9336 @itemx -mdata-align
9337 @itemx -mno-data-align
9338 @itemx -mconst-align
9339 @itemx -mno-const-align
9340 @opindex mstack-align
9341 @opindex mno-stack-align
9342 @opindex mdata-align
9343 @opindex mno-data-align
9344 @opindex mconst-align
9345 @opindex mno-const-align
9346 These options (no-options) arranges (eliminate arrangements) for the
9347 stack-frame, individual data and constants to be aligned for the maximum
9348 single data access size for the chosen CPU model.  The default is to
9349 arrange for 32-bit alignment.  ABI details such as structure layout are
9350 not affected by these options.
9351
9352 @item -m32-bit
9353 @itemx -m16-bit
9354 @itemx -m8-bit
9355 @opindex m32-bit
9356 @opindex m16-bit
9357 @opindex m8-bit
9358 Similar to the stack- data- and const-align options above, these options
9359 arrange for stack-frame, writable data and constants to all be 32-bit,
9360 16-bit or 8-bit aligned.  The default is 32-bit alignment.
9361
9362 @item -mno-prologue-epilogue
9363 @itemx -mprologue-epilogue
9364 @opindex mno-prologue-epilogue
9365 @opindex mprologue-epilogue
9366 With @option{-mno-prologue-epilogue}, the normal function prologue and
9367 epilogue that sets up the stack-frame are omitted and no return
9368 instructions or return sequences are generated in the code.  Use this
9369 option only together with visual inspection of the compiled code: no
9370 warnings or errors are generated when call-saved registers must be saved,
9371 or storage for local variable needs to be allocated.
9372
9373 @item -mno-gotplt
9374 @itemx -mgotplt
9375 @opindex mno-gotplt
9376 @opindex mgotplt
9377 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
9378 instruction sequences that load addresses for functions from the PLT part
9379 of the GOT rather than (traditional on other architectures) calls to the
9380 PLT@.  The default is @option{-mgotplt}.
9381
9382 @item -melf
9383 @opindex melf
9384 Legacy no-op option only recognized with the cris-axis-elf and
9385 cris-axis-linux-gnu targets.
9386
9387 @item -mlinux
9388 @opindex mlinux
9389 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
9390
9391 @item -sim
9392 @opindex sim
9393 This option, recognized for the cris-axis-elf arranges
9394 to link with input-output functions from a simulator library.  Code,
9395 initialized data and zero-initialized data are allocated consecutively.
9396
9397 @item -sim2
9398 @opindex sim2
9399 Like @option{-sim}, but pass linker options to locate initialized data at
9400 0x40000000 and zero-initialized data at 0x80000000.
9401 @end table
9402
9403 @node CRX Options
9404 @subsection CRX Options
9405 @cindex CRX Options
9406
9407 These options are defined specifically for the CRX ports.
9408
9409 @table @gcctabopt
9410
9411 @item -mmac
9412 @opindex mmac
9413 Enable the use of multiply-accumulate instructions. Disabled by default.
9414
9415 @item -mpush-args
9416 @opindex mpush-args
9417 Push instructions will be used to pass outgoing arguments when functions
9418 are called. Enabled by default.
9419 @end table
9420
9421 @node Darwin Options
9422 @subsection Darwin Options
9423 @cindex Darwin options
9424
9425 These options are defined for all architectures running the Darwin operating
9426 system.
9427
9428 FSF GCC on Darwin does not create ``fat'' object files; it will create
9429 an object file for the single architecture that it was built to
9430 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
9431 @option{-arch} options are used; it does so by running the compiler or
9432 linker multiple times and joining the results together with
9433 @file{lipo}.
9434
9435 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
9436 @samp{i686}) is determined by the flags that specify the ISA
9437 that GCC is targetting, like @option{-mcpu} or @option{-march}.  The
9438 @option{-force_cpusubtype_ALL} option can be used to override this.
9439
9440 The Darwin tools vary in their behavior when presented with an ISA
9441 mismatch.  The assembler, @file{as}, will only permit instructions to
9442 be used that are valid for the subtype of the file it is generating,
9443 so you cannot put 64-bit instructions in an @samp{ppc750} object file.
9444 The linker for shared libraries, @file{/usr/bin/libtool}, will fail
9445 and print an error if asked to create a shared library with a less
9446 restrictive subtype than its input files (for instance, trying to put
9447 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
9448 for executables, @file{ld}, will quietly give the executable the most
9449 restrictive subtype of any of its input files.
9450
9451 @table @gcctabopt
9452 @item -F@var{dir}
9453 @opindex F
9454 Add the framework directory @var{dir} to the head of the list of
9455 directories to be searched for header files.  These directories are
9456 interleaved with those specified by @option{-I} options and are
9457 scanned in a left-to-right order.
9458
9459 A framework directory is a directory with frameworks in it.  A
9460 framework is a directory with a @samp{"Headers"} and/or
9461 @samp{"PrivateHeaders"} directory contained directly in it that ends
9462 in @samp{".framework"}.  The name of a framework is the name of this
9463 directory excluding the @samp{".framework"}.  Headers associated with
9464 the framework are found in one of those two directories, with
9465 @samp{"Headers"} being searched first.  A subframework is a framework
9466 directory that is in a framework's @samp{"Frameworks"} directory.
9467 Includes of subframework headers can only appear in a header of a
9468 framework that contains the subframework, or in a sibling subframework
9469 header.  Two subframeworks are siblings if they occur in the same
9470 framework.  A subframework should not have the same name as a
9471 framework, a warning will be issued if this is violated.  Currently a
9472 subframework cannot have subframeworks, in the future, the mechanism
9473 may be extended to support this.  The standard frameworks can be found
9474 in @samp{"/System/Library/Frameworks"} and
9475 @samp{"/Library/Frameworks"}.  An example include looks like
9476 @code{#include <Framework/header.h>}, where @samp{Framework} denotes
9477 the name of the framework and header.h is found in the
9478 @samp{"PrivateHeaders"} or @samp{"Headers"} directory.
9479
9480 @item -iframework@var{dir}
9481 @opindex iframework
9482 Like @option{-F} except the directory is a treated as a system
9483 directory.  The main difference between this @option{-iframework} and
9484 @option{-F} is that with @option{-iframework} the compiler does not
9485 warn about constructs contained within header files found via
9486 @var{dir}.  This option is valid only for the C family of languages.
9487
9488 @item -gused
9489 @opindex gused
9490 Emit debugging information for symbols that are used.  For STABS
9491 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
9492 This is by default ON@.
9493
9494 @item -gfull
9495 @opindex gfull
9496 Emit debugging information for all symbols and types.
9497
9498 @item -mmacosx-version-min=@var{version}
9499 The earliest version of MacOS X that this executable will run on
9500 is @var{version}.  Typical values of @var{version} include @code{10.1},
9501 @code{10.2}, and @code{10.3.9}.
9502
9503 If the compiler was built to use the system's headers by default,
9504 then the default for this option is the system version on which the
9505 compiler is running, otherwise the default is to make choices which
9506 are compatible with as many systems and code bases as possible.
9507
9508 @item -mkernel
9509 @opindex mkernel
9510 Enable kernel development mode.  The @option{-mkernel} option sets
9511 @option{-static}, @option{-fno-common}, @option{-fno-cxa-atexit},
9512 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
9513 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
9514 applicable.  This mode also sets @option{-mno-altivec},
9515 @option{-msoft-float}, @option{-fno-builtin} and
9516 @option{-mlong-branch} for PowerPC targets.
9517
9518 @item -mone-byte-bool
9519 @opindex mone-byte-bool
9520 Override the defaults for @samp{bool} so that @samp{sizeof(bool)==1}.
9521 By default @samp{sizeof(bool)} is @samp{4} when compiling for
9522 Darwin/PowerPC and @samp{1} when compiling for Darwin/x86, so this
9523 option has no effect on x86.
9524
9525 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
9526 to generate code that is not binary compatible with code generated
9527 without that switch.  Using this switch may require recompiling all
9528 other modules in a program, including system libraries.  Use this
9529 switch to conform to a non-default data model.
9530
9531 @item -mfix-and-continue
9532 @itemx -ffix-and-continue
9533 @itemx -findirect-data
9534 @opindex mfix-and-continue
9535 @opindex ffix-and-continue
9536 @opindex findirect-data
9537 Generate code suitable for fast turn around development.  Needed to
9538 enable gdb to dynamically load @code{.o} files into already running
9539 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
9540 are provided for backwards compatibility.
9541
9542 @item -all_load
9543 @opindex all_load
9544 Loads all members of static archive libraries.
9545 See man ld(1) for more information.
9546
9547 @item -arch_errors_fatal
9548 @opindex arch_errors_fatal
9549 Cause the errors having to do with files that have the wrong architecture
9550 to be fatal.
9551
9552 @item -bind_at_load
9553 @opindex bind_at_load
9554 Causes the output file to be marked such that the dynamic linker will
9555 bind all undefined references when the file is loaded or launched.
9556
9557 @item -bundle
9558 @opindex bundle
9559 Produce a Mach-o bundle format file.
9560 See man ld(1) for more information.
9561
9562 @item -bundle_loader @var{executable}
9563 @opindex bundle_loader
9564 This option specifies the @var{executable} that will be loading the build
9565 output file being linked.  See man ld(1) for more information.
9566
9567 @item -dynamiclib
9568 @opindex dynamiclib
9569 When passed this option, GCC will produce a dynamic library instead of
9570 an executable when linking, using the Darwin @file{libtool} command.
9571
9572 @item -force_cpusubtype_ALL
9573 @opindex force_cpusubtype_ALL
9574 This causes GCC's output file to have the @var{ALL} subtype, instead of
9575 one controlled by the @option{-mcpu} or @option{-march} option.
9576
9577 @item -allowable_client  @var{client_name}
9578 @itemx -client_name
9579 @itemx -compatibility_version
9580 @itemx -current_version
9581 @itemx -dead_strip
9582 @itemx -dependency-file
9583 @itemx -dylib_file
9584 @itemx -dylinker_install_name
9585 @itemx -dynamic
9586 @itemx -exported_symbols_list
9587 @itemx -filelist
9588 @itemx -flat_namespace
9589 @itemx -force_flat_namespace
9590 @itemx -headerpad_max_install_names
9591 @itemx -image_base
9592 @itemx -init
9593 @itemx -install_name
9594 @itemx -keep_private_externs
9595 @itemx -multi_module
9596 @itemx -multiply_defined
9597 @itemx -multiply_defined_unused
9598 @itemx -noall_load
9599 @itemx -no_dead_strip_inits_and_terms
9600 @itemx -nofixprebinding
9601 @itemx -nomultidefs
9602 @itemx -noprebind
9603 @itemx -noseglinkedit
9604 @itemx -pagezero_size
9605 @itemx -prebind
9606 @itemx -prebind_all_twolevel_modules
9607 @itemx -private_bundle
9608 @itemx -read_only_relocs
9609 @itemx -sectalign
9610 @itemx -sectobjectsymbols
9611 @itemx -whyload
9612 @itemx -seg1addr
9613 @itemx -sectcreate
9614 @itemx -sectobjectsymbols
9615 @itemx -sectorder
9616 @itemx -segaddr
9617 @itemx -segs_read_only_addr
9618 @itemx -segs_read_write_addr
9619 @itemx -seg_addr_table
9620 @itemx -seg_addr_table_filename
9621 @itemx -seglinkedit
9622 @itemx -segprot
9623 @itemx -segs_read_only_addr
9624 @itemx -segs_read_write_addr
9625 @itemx -single_module
9626 @itemx -static
9627 @itemx -sub_library
9628 @itemx -sub_umbrella
9629 @itemx -twolevel_namespace
9630 @itemx -umbrella
9631 @itemx -undefined
9632 @itemx -unexported_symbols_list
9633 @itemx -weak_reference_mismatches
9634 @itemx -whatsloaded
9635 @opindex allowable_client
9636 @opindex client_name
9637 @opindex compatibility_version
9638 @opindex current_version
9639 @opindex dead_strip
9640 @opindex dependency-file
9641 @opindex dylib_file
9642 @opindex dylinker_install_name
9643 @opindex dynamic
9644 @opindex exported_symbols_list
9645 @opindex filelist
9646 @opindex flat_namespace
9647 @opindex force_flat_namespace
9648 @opindex headerpad_max_install_names
9649 @opindex image_base
9650 @opindex init
9651 @opindex install_name
9652 @opindex keep_private_externs
9653 @opindex multi_module
9654 @opindex multiply_defined
9655 @opindex multiply_defined_unused
9656 @opindex noall_load
9657 @opindex no_dead_strip_inits_and_terms
9658 @opindex nofixprebinding
9659 @opindex nomultidefs
9660 @opindex noprebind
9661 @opindex noseglinkedit
9662 @opindex pagezero_size
9663 @opindex prebind
9664 @opindex prebind_all_twolevel_modules
9665 @opindex private_bundle
9666 @opindex read_only_relocs
9667 @opindex sectalign
9668 @opindex sectobjectsymbols
9669 @opindex whyload
9670 @opindex seg1addr
9671 @opindex sectcreate
9672 @opindex sectobjectsymbols
9673 @opindex sectorder
9674 @opindex segaddr
9675 @opindex segs_read_only_addr
9676 @opindex segs_read_write_addr
9677 @opindex seg_addr_table
9678 @opindex seg_addr_table_filename
9679 @opindex seglinkedit
9680 @opindex segprot
9681 @opindex segs_read_only_addr
9682 @opindex segs_read_write_addr
9683 @opindex single_module
9684 @opindex static
9685 @opindex sub_library
9686 @opindex sub_umbrella
9687 @opindex twolevel_namespace
9688 @opindex umbrella
9689 @opindex undefined
9690 @opindex unexported_symbols_list
9691 @opindex weak_reference_mismatches
9692 @opindex whatsloaded
9693 These options are passed to the Darwin linker.  The Darwin linker man page
9694 describes them in detail.
9695 @end table
9696
9697 @node DEC Alpha Options
9698 @subsection DEC Alpha Options
9699
9700 These @samp{-m} options are defined for the DEC Alpha implementations:
9701
9702 @table @gcctabopt
9703 @item -mno-soft-float
9704 @itemx -msoft-float
9705 @opindex mno-soft-float
9706 @opindex msoft-float
9707 Use (do not use) the hardware floating-point instructions for
9708 floating-point operations.  When @option{-msoft-float} is specified,
9709 functions in @file{libgcc.a} will be used to perform floating-point
9710 operations.  Unless they are replaced by routines that emulate the
9711 floating-point operations, or compiled in such a way as to call such
9712 emulations routines, these routines will issue floating-point
9713 operations.   If you are compiling for an Alpha without floating-point
9714 operations, you must ensure that the library is built so as not to call
9715 them.
9716
9717 Note that Alpha implementations without floating-point operations are
9718 required to have floating-point registers.
9719
9720 @item -mfp-reg
9721 @itemx -mno-fp-regs
9722 @opindex mfp-reg
9723 @opindex mno-fp-regs
9724 Generate code that uses (does not use) the floating-point register set.
9725 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
9726 register set is not used, floating point operands are passed in integer
9727 registers as if they were integers and floating-point results are passed
9728 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
9729 so any function with a floating-point argument or return value called by code
9730 compiled with @option{-mno-fp-regs} must also be compiled with that
9731 option.
9732
9733 A typical use of this option is building a kernel that does not use,
9734 and hence need not save and restore, any floating-point registers.
9735
9736 @item -mieee
9737 @opindex mieee
9738 The Alpha architecture implements floating-point hardware optimized for
9739 maximum performance.  It is mostly compliant with the IEEE floating
9740 point standard.  However, for full compliance, software assistance is
9741 required.  This option generates code fully IEEE compliant code
9742 @emph{except} that the @var{inexact-flag} is not maintained (see below).
9743 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
9744 defined during compilation.  The resulting code is less efficient but is
9745 able to correctly support denormalized numbers and exceptional IEEE
9746 values such as not-a-number and plus/minus infinity.  Other Alpha
9747 compilers call this option @option{-ieee_with_no_inexact}.
9748
9749 @item -mieee-with-inexact
9750 @opindex mieee-with-inexact
9751 This is like @option{-mieee} except the generated code also maintains
9752 the IEEE @var{inexact-flag}.  Turning on this option causes the
9753 generated code to implement fully-compliant IEEE math.  In addition to
9754 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
9755 macro.  On some Alpha implementations the resulting code may execute
9756 significantly slower than the code generated by default.  Since there is
9757 very little code that depends on the @var{inexact-flag}, you should
9758 normally not specify this option.  Other Alpha compilers call this
9759 option @option{-ieee_with_inexact}.
9760
9761 @item -mfp-trap-mode=@var{trap-mode}
9762 @opindex mfp-trap-mode
9763 This option controls what floating-point related traps are enabled.
9764 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
9765 The trap mode can be set to one of four values:
9766
9767 @table @samp
9768 @item n
9769 This is the default (normal) setting.  The only traps that are enabled
9770 are the ones that cannot be disabled in software (e.g., division by zero
9771 trap).
9772
9773 @item u
9774 In addition to the traps enabled by @samp{n}, underflow traps are enabled
9775 as well.
9776
9777 @item su
9778 Like @samp{u}, but the instructions are marked to be safe for software
9779 completion (see Alpha architecture manual for details).
9780
9781 @item sui
9782 Like @samp{su}, but inexact traps are enabled as well.
9783 @end table
9784
9785 @item -mfp-rounding-mode=@var{rounding-mode}
9786 @opindex mfp-rounding-mode
9787 Selects the IEEE rounding mode.  Other Alpha compilers call this option
9788 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
9789 of:
9790
9791 @table @samp
9792 @item n
9793 Normal IEEE rounding mode.  Floating point numbers are rounded towards
9794 the nearest machine number or towards the even machine number in case
9795 of a tie.
9796
9797 @item m
9798 Round towards minus infinity.
9799
9800 @item c
9801 Chopped rounding mode.  Floating point numbers are rounded towards zero.
9802
9803 @item d
9804 Dynamic rounding mode.  A field in the floating point control register
9805 (@var{fpcr}, see Alpha architecture reference manual) controls the
9806 rounding mode in effect.  The C library initializes this register for
9807 rounding towards plus infinity.  Thus, unless your program modifies the
9808 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
9809 @end table
9810
9811 @item -mtrap-precision=@var{trap-precision}
9812 @opindex mtrap-precision
9813 In the Alpha architecture, floating point traps are imprecise.  This
9814 means without software assistance it is impossible to recover from a
9815 floating trap and program execution normally needs to be terminated.
9816 GCC can generate code that can assist operating system trap handlers
9817 in determining the exact location that caused a floating point trap.
9818 Depending on the requirements of an application, different levels of
9819 precisions can be selected:
9820
9821 @table @samp
9822 @item p
9823 Program precision.  This option is the default and means a trap handler
9824 can only identify which program caused a floating point exception.
9825
9826 @item f
9827 Function precision.  The trap handler can determine the function that
9828 caused a floating point exception.
9829
9830 @item i
9831 Instruction precision.  The trap handler can determine the exact
9832 instruction that caused a floating point exception.
9833 @end table
9834
9835 Other Alpha compilers provide the equivalent options called
9836 @option{-scope_safe} and @option{-resumption_safe}.
9837
9838 @item -mieee-conformant
9839 @opindex mieee-conformant
9840 This option marks the generated code as IEEE conformant.  You must not
9841 use this option unless you also specify @option{-mtrap-precision=i} and either
9842 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
9843 is to emit the line @samp{.eflag 48} in the function prologue of the
9844 generated assembly file.  Under DEC Unix, this has the effect that
9845 IEEE-conformant math library routines will be linked in.
9846
9847 @item -mbuild-constants
9848 @opindex mbuild-constants
9849 Normally GCC examines a 32- or 64-bit integer constant to
9850 see if it can construct it from smaller constants in two or three
9851 instructions.  If it cannot, it will output the constant as a literal and
9852 generate code to load it from the data segment at runtime.
9853
9854 Use this option to require GCC to construct @emph{all} integer constants
9855 using code, even if it takes more instructions (the maximum is six).
9856
9857 You would typically use this option to build a shared library dynamic
9858 loader.  Itself a shared library, it must relocate itself in memory
9859 before it can find the variables and constants in its own data segment.
9860
9861 @item -malpha-as
9862 @itemx -mgas
9863 @opindex malpha-as
9864 @opindex mgas
9865 Select whether to generate code to be assembled by the vendor-supplied
9866 assembler (@option{-malpha-as}) or by the GNU assembler @option{-mgas}.
9867
9868 @item -mbwx
9869 @itemx -mno-bwx
9870 @itemx -mcix
9871 @itemx -mno-cix
9872 @itemx -mfix
9873 @itemx -mno-fix
9874 @itemx -mmax
9875 @itemx -mno-max
9876 @opindex mbwx
9877 @opindex mno-bwx
9878 @opindex mcix
9879 @opindex mno-cix
9880 @opindex mfix
9881 @opindex mno-fix
9882 @opindex mmax
9883 @opindex mno-max
9884 Indicate whether GCC should generate code to use the optional BWX,
9885 CIX, FIX and MAX instruction sets.  The default is to use the instruction
9886 sets supported by the CPU type specified via @option{-mcpu=} option or that
9887 of the CPU on which GCC was built if none was specified.
9888
9889 @item -mfloat-vax
9890 @itemx -mfloat-ieee
9891 @opindex mfloat-vax
9892 @opindex mfloat-ieee
9893 Generate code that uses (does not use) VAX F and G floating point
9894 arithmetic instead of IEEE single and double precision.
9895
9896 @item -mexplicit-relocs
9897 @itemx -mno-explicit-relocs
9898 @opindex mexplicit-relocs
9899 @opindex mno-explicit-relocs
9900 Older Alpha assemblers provided no way to generate symbol relocations
9901 except via assembler macros.  Use of these macros does not allow
9902 optimal instruction scheduling.  GNU binutils as of version 2.12
9903 supports a new syntax that allows the compiler to explicitly mark
9904 which relocations should apply to which instructions.  This option
9905 is mostly useful for debugging, as GCC detects the capabilities of
9906 the assembler when it is built and sets the default accordingly.
9907
9908 @item -msmall-data
9909 @itemx -mlarge-data
9910 @opindex msmall-data
9911 @opindex mlarge-data
9912 When @option{-mexplicit-relocs} is in effect, static data is
9913 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
9914 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
9915 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
9916 16-bit relocations off of the @code{$gp} register.  This limits the
9917 size of the small data area to 64KB, but allows the variables to be
9918 directly accessed via a single instruction.
9919
9920 The default is @option{-mlarge-data}.  With this option the data area
9921 is limited to just below 2GB@.  Programs that require more than 2GB of
9922 data must use @code{malloc} or @code{mmap} to allocate the data in the
9923 heap instead of in the program's data segment.
9924
9925 When generating code for shared libraries, @option{-fpic} implies
9926 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
9927
9928 @item -msmall-text
9929 @itemx -mlarge-text
9930 @opindex msmall-text
9931 @opindex mlarge-text
9932 When @option{-msmall-text} is used, the compiler assumes that the
9933 code of the entire program (or shared library) fits in 4MB, and is
9934 thus reachable with a branch instruction.  When @option{-msmall-data}
9935 is used, the compiler can assume that all local symbols share the
9936 same @code{$gp} value, and thus reduce the number of instructions
9937 required for a function call from 4 to 1.
9938
9939 The default is @option{-mlarge-text}.
9940
9941 @item -mcpu=@var{cpu_type}
9942 @opindex mcpu
9943 Set the instruction set and instruction scheduling parameters for
9944 machine type @var{cpu_type}.  You can specify either the @samp{EV}
9945 style name or the corresponding chip number.  GCC supports scheduling
9946 parameters for the EV4, EV5 and EV6 family of processors and will
9947 choose the default values for the instruction set from the processor
9948 you specify.  If you do not specify a processor type, GCC will default
9949 to the processor on which the compiler was built.
9950
9951 Supported values for @var{cpu_type} are
9952
9953 @table @samp
9954 @item ev4
9955 @itemx ev45
9956 @itemx 21064
9957 Schedules as an EV4 and has no instruction set extensions.
9958
9959 @item ev5
9960 @itemx 21164
9961 Schedules as an EV5 and has no instruction set extensions.
9962
9963 @item ev56
9964 @itemx 21164a
9965 Schedules as an EV5 and supports the BWX extension.
9966
9967 @item pca56
9968 @itemx 21164pc
9969 @itemx 21164PC
9970 Schedules as an EV5 and supports the BWX and MAX extensions.
9971
9972 @item ev6
9973 @itemx 21264
9974 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
9975
9976 @item ev67
9977 @itemx 21264a
9978 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
9979 @end table
9980
9981 @item -mtune=@var{cpu_type}
9982 @opindex mtune
9983 Set only the instruction scheduling parameters for machine type
9984 @var{cpu_type}.  The instruction set is not changed.
9985
9986 @item -mmemory-latency=@var{time}
9987 @opindex mmemory-latency
9988 Sets the latency the scheduler should assume for typical memory
9989 references as seen by the application.  This number is highly
9990 dependent on the memory access patterns used by the application
9991 and the size of the external cache on the machine.
9992
9993 Valid options for @var{time} are
9994
9995 @table @samp
9996 @item @var{number}
9997 A decimal number representing clock cycles.
9998
9999 @item L1
10000 @itemx L2
10001 @itemx L3
10002 @itemx main
10003 The compiler contains estimates of the number of clock cycles for
10004 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
10005 (also called Dcache, Scache, and Bcache), as well as to main memory.
10006 Note that L3 is only valid for EV5.
10007
10008 @end table
10009 @end table
10010
10011 @node DEC Alpha/VMS Options
10012 @subsection DEC Alpha/VMS Options
10013
10014 These @samp{-m} options are defined for the DEC Alpha/VMS implementations:
10015
10016 @table @gcctabopt
10017 @item -mvms-return-codes
10018 @opindex mvms-return-codes
10019 Return VMS condition codes from main.  The default is to return POSIX
10020 style condition (e.g.@: error) codes.
10021 @end table
10022
10023 @node FRV Options
10024 @subsection FRV Options
10025 @cindex FRV Options
10026
10027 @table @gcctabopt
10028 @item -mgpr-32
10029 @opindex mgpr-32
10030
10031 Only use the first 32 general purpose registers.
10032
10033 @item -mgpr-64
10034 @opindex mgpr-64
10035
10036 Use all 64 general purpose registers.
10037
10038 @item -mfpr-32
10039 @opindex mfpr-32
10040
10041 Use only the first 32 floating point registers.
10042
10043 @item -mfpr-64
10044 @opindex mfpr-64
10045
10046 Use all 64 floating point registers
10047
10048 @item -mhard-float
10049 @opindex mhard-float
10050
10051 Use hardware instructions for floating point operations.
10052
10053 @item -msoft-float
10054 @opindex msoft-float
10055
10056 Use library routines for floating point operations.
10057
10058 @item -malloc-cc
10059 @opindex malloc-cc
10060
10061 Dynamically allocate condition code registers.
10062
10063 @item -mfixed-cc
10064 @opindex mfixed-cc
10065
10066 Do not try to dynamically allocate condition code registers, only
10067 use @code{icc0} and @code{fcc0}.
10068
10069 @item -mdword
10070 @opindex mdword
10071
10072 Change ABI to use double word insns.
10073
10074 @item -mno-dword
10075 @opindex mno-dword
10076
10077 Do not use double word instructions.
10078
10079 @item -mdouble
10080 @opindex mdouble
10081
10082 Use floating point double instructions.
10083
10084 @item -mno-double
10085 @opindex mno-double
10086
10087 Do not use floating point double instructions.
10088
10089 @item -mmedia
10090 @opindex mmedia
10091
10092 Use media instructions.
10093
10094 @item -mno-media
10095 @opindex mno-media
10096
10097 Do not use media instructions.
10098
10099 @item -mmuladd
10100 @opindex mmuladd
10101
10102 Use multiply and add/subtract instructions.
10103
10104 @item -mno-muladd
10105 @opindex mno-muladd
10106
10107 Do not use multiply and add/subtract instructions.
10108
10109 @item -mfdpic
10110 @opindex mfdpic
10111
10112 Select the FDPIC ABI, that uses function descriptors to represent
10113 pointers to functions.  Without any PIC/PIE-related options, it
10114 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
10115 assumes GOT entries and small data are within a 12-bit range from the
10116 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
10117 are computed with 32 bits.
10118 With a @samp{bfin-elf} target, this option implies @option{-msim}.
10119
10120 @item -minline-plt
10121 @opindex minline-plt
10122
10123 Enable inlining of PLT entries in function calls to functions that are
10124 not known to bind locally.  It has no effect without @option{-mfdpic}.
10125 It's enabled by default if optimizing for speed and compiling for
10126 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
10127 optimization option such as @option{-O3} or above is present in the
10128 command line.
10129
10130 @item -mTLS
10131 @opindex TLS
10132
10133 Assume a large TLS segment when generating thread-local code.
10134
10135 @item -mtls
10136 @opindex tls
10137
10138 Do not assume a large TLS segment when generating thread-local code.
10139
10140 @item -mgprel-ro
10141 @opindex mgprel-ro
10142
10143 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
10144 that is known to be in read-only sections.  It's enabled by default,
10145 except for @option{-fpic} or @option{-fpie}: even though it may help
10146 make the global offset table smaller, it trades 1 instruction for 4.
10147 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
10148 one of which may be shared by multiple symbols, and it avoids the need
10149 for a GOT entry for the referenced symbol, so it's more likely to be a
10150 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
10151
10152 @item -multilib-library-pic
10153 @opindex multilib-library-pic
10154
10155 Link with the (library, not FD) pic libraries.  It's implied by
10156 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
10157 @option{-fpic} without @option{-mfdpic}.  You should never have to use
10158 it explicitly.
10159
10160 @item -mlinked-fp
10161 @opindex mlinked-fp
10162
10163 Follow the EABI requirement of always creating a frame pointer whenever
10164 a stack frame is allocated.  This option is enabled by default and can
10165 be disabled with @option{-mno-linked-fp}.
10166
10167 @item -mlong-calls
10168 @opindex mlong-calls
10169
10170 Use indirect addressing to call functions outside the current
10171 compilation unit.  This allows the functions to be placed anywhere
10172 within the 32-bit address space.
10173
10174 @item -malign-labels
10175 @opindex malign-labels
10176
10177 Try to align labels to an 8-byte boundary by inserting nops into the
10178 previous packet.  This option only has an effect when VLIW packing
10179 is enabled.  It doesn't create new packets; it merely adds nops to
10180 existing ones.
10181
10182 @item -mlibrary-pic
10183 @opindex mlibrary-pic
10184
10185 Generate position-independent EABI code.
10186
10187 @item -macc-4
10188 @opindex macc-4
10189
10190 Use only the first four media accumulator registers.
10191
10192 @item -macc-8
10193 @opindex macc-8
10194
10195 Use all eight media accumulator registers.
10196
10197 @item -mpack
10198 @opindex mpack
10199
10200 Pack VLIW instructions.
10201
10202 @item -mno-pack
10203 @opindex mno-pack
10204
10205 Do not pack VLIW instructions.
10206
10207 @item -mno-eflags
10208 @opindex mno-eflags
10209
10210 Do not mark ABI switches in e_flags.
10211
10212 @item -mcond-move
10213 @opindex mcond-move
10214
10215 Enable the use of conditional-move instructions (default).
10216
10217 This switch is mainly for debugging the compiler and will likely be removed
10218 in a future version.
10219
10220 @item -mno-cond-move
10221 @opindex mno-cond-move
10222
10223 Disable the use of conditional-move instructions.
10224
10225 This switch is mainly for debugging the compiler and will likely be removed
10226 in a future version.
10227
10228 @item -mscc
10229 @opindex mscc
10230
10231 Enable the use of conditional set instructions (default).
10232
10233 This switch is mainly for debugging the compiler and will likely be removed
10234 in a future version.
10235
10236 @item -mno-scc
10237 @opindex mno-scc
10238
10239 Disable the use of conditional set instructions.
10240
10241 This switch is mainly for debugging the compiler and will likely be removed
10242 in a future version.
10243
10244 @item -mcond-exec
10245 @opindex mcond-exec
10246
10247 Enable the use of conditional execution (default).
10248
10249 This switch is mainly for debugging the compiler and will likely be removed
10250 in a future version.
10251
10252 @item -mno-cond-exec
10253 @opindex mno-cond-exec
10254
10255 Disable the use of conditional execution.
10256
10257 This switch is mainly for debugging the compiler and will likely be removed
10258 in a future version.
10259
10260 @item -mvliw-branch
10261 @opindex mvliw-branch
10262
10263 Run a pass to pack branches into VLIW instructions (default).
10264
10265 This switch is mainly for debugging the compiler and will likely be removed
10266 in a future version.
10267
10268 @item -mno-vliw-branch
10269 @opindex mno-vliw-branch
10270
10271 Do not run a pass to pack branches into VLIW instructions.
10272
10273 This switch is mainly for debugging the compiler and will likely be removed
10274 in a future version.
10275
10276 @item -mmulti-cond-exec
10277 @opindex mmulti-cond-exec
10278
10279 Enable optimization of @code{&&} and @code{||} in conditional execution
10280 (default).
10281
10282 This switch is mainly for debugging the compiler and will likely be removed
10283 in a future version.
10284
10285 @item -mno-multi-cond-exec
10286 @opindex mno-multi-cond-exec
10287
10288 Disable optimization of @code{&&} and @code{||} in conditional execution.
10289
10290 This switch is mainly for debugging the compiler and will likely be removed
10291 in a future version.
10292
10293 @item -mnested-cond-exec
10294 @opindex mnested-cond-exec
10295
10296 Enable nested conditional execution optimizations (default).
10297
10298 This switch is mainly for debugging the compiler and will likely be removed
10299 in a future version.
10300
10301 @item -mno-nested-cond-exec
10302 @opindex mno-nested-cond-exec
10303
10304 Disable nested conditional execution optimizations.
10305
10306 This switch is mainly for debugging the compiler and will likely be removed
10307 in a future version.
10308
10309 @item -moptimize-membar
10310 @opindex moptimize-membar
10311
10312 This switch removes redundant @code{membar} instructions from the
10313 compiler generated code.  It is enabled by default.
10314
10315 @item -mno-optimize-membar
10316 @opindex mno-optimize-membar
10317
10318 This switch disables the automatic removal of redundant @code{membar}
10319 instructions from the generated code.
10320
10321 @item -mtomcat-stats
10322 @opindex mtomcat-stats
10323
10324 Cause gas to print out tomcat statistics.
10325
10326 @item -mcpu=@var{cpu}
10327 @opindex mcpu
10328
10329 Select the processor type for which to generate code.  Possible values are
10330 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
10331 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
10332
10333 @end table
10334
10335 @node GNU/Linux Options
10336 @subsection GNU/Linux Options
10337
10338 These @samp{-m} options are defined for GNU/Linux targets:
10339
10340 @table @gcctabopt
10341 @item -mglibc
10342 @opindex mglibc
10343 Use the GNU C library instead of uClibc.  This is the default except
10344 on @samp{*-*-linux-*uclibc*} targets.
10345
10346 @item -muclibc
10347 @opindex muclibc
10348 Use uClibc instead of the GNU C library.  This is the default on
10349 @samp{*-*-linux-*uclibc*} targets.
10350 @end table
10351
10352 @node H8/300 Options
10353 @subsection H8/300 Options
10354
10355 These @samp{-m} options are defined for the H8/300 implementations:
10356
10357 @table @gcctabopt
10358 @item -mrelax
10359 @opindex mrelax
10360 Shorten some address references at link time, when possible; uses the
10361 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
10362 ld, Using ld}, for a fuller description.
10363
10364 @item -mh
10365 @opindex mh
10366 Generate code for the H8/300H@.
10367
10368 @item -ms
10369 @opindex ms
10370 Generate code for the H8S@.
10371
10372 @item -mn
10373 @opindex mn
10374 Generate code for the H8S and H8/300H in the normal mode.  This switch
10375 must be used either with @option{-mh} or @option{-ms}.
10376
10377 @item -ms2600
10378 @opindex ms2600
10379 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
10380
10381 @item -mint32
10382 @opindex mint32
10383 Make @code{int} data 32 bits by default.
10384
10385 @item -malign-300
10386 @opindex malign-300
10387 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
10388 The default for the H8/300H and H8S is to align longs and floats on 4
10389 byte boundaries.
10390 @option{-malign-300} causes them to be aligned on 2 byte boundaries.
10391 This option has no effect on the H8/300.
10392 @end table
10393
10394 @node HPPA Options
10395 @subsection HPPA Options
10396 @cindex HPPA Options
10397
10398 These @samp{-m} options are defined for the HPPA family of computers:
10399
10400 @table @gcctabopt
10401 @item -march=@var{architecture-type}
10402 @opindex march
10403 Generate code for the specified architecture.  The choices for
10404 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
10405 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
10406 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
10407 architecture option for your machine.  Code compiled for lower numbered
10408 architectures will run on higher numbered architectures, but not the
10409 other way around.
10410
10411 @item -mpa-risc-1-0
10412 @itemx -mpa-risc-1-1
10413 @itemx -mpa-risc-2-0
10414 @opindex mpa-risc-1-0
10415 @opindex mpa-risc-1-1
10416 @opindex mpa-risc-2-0
10417 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
10418
10419 @item -mbig-switch
10420 @opindex mbig-switch
10421 Generate code suitable for big switch tables.  Use this option only if
10422 the assembler/linker complain about out of range branches within a switch
10423 table.
10424
10425 @item -mjump-in-delay
10426 @opindex mjump-in-delay
10427 Fill delay slots of function calls with unconditional jump instructions
10428 by modifying the return pointer for the function call to be the target
10429 of the conditional jump.
10430
10431 @item -mdisable-fpregs
10432 @opindex mdisable-fpregs
10433 Prevent floating point registers from being used in any manner.  This is
10434 necessary for compiling kernels which perform lazy context switching of
10435 floating point registers.  If you use this option and attempt to perform
10436 floating point operations, the compiler will abort.
10437
10438 @item -mdisable-indexing
10439 @opindex mdisable-indexing
10440 Prevent the compiler from using indexing address modes.  This avoids some
10441 rather obscure problems when compiling MIG generated code under MACH@.
10442
10443 @item -mno-space-regs
10444 @opindex mno-space-regs
10445 Generate code that assumes the target has no space registers.  This allows
10446 GCC to generate faster indirect calls and use unscaled index address modes.
10447
10448 Such code is suitable for level 0 PA systems and kernels.
10449
10450 @item -mfast-indirect-calls
10451 @opindex mfast-indirect-calls
10452 Generate code that assumes calls never cross space boundaries.  This
10453 allows GCC to emit code which performs faster indirect calls.
10454
10455 This option will not work in the presence of shared libraries or nested
10456 functions.
10457
10458 @item -mfixed-range=@var{register-range}
10459 @opindex mfixed-range
10460 Generate code treating the given register range as fixed registers.
10461 A fixed register is one that the register allocator can not use.  This is
10462 useful when compiling kernel code.  A register range is specified as
10463 two registers separated by a dash.  Multiple register ranges can be
10464 specified separated by a comma.
10465
10466 @item -mlong-load-store
10467 @opindex mlong-load-store
10468 Generate 3-instruction load and store sequences as sometimes required by
10469 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
10470 the HP compilers.
10471
10472 @item -mportable-runtime
10473 @opindex mportable-runtime
10474 Use the portable calling conventions proposed by HP for ELF systems.
10475
10476 @item -mgas
10477 @opindex mgas
10478 Enable the use of assembler directives only GAS understands.
10479
10480 @item -mschedule=@var{cpu-type}
10481 @opindex mschedule
10482 Schedule code according to the constraints for the machine type
10483 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
10484 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
10485 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
10486 proper scheduling option for your machine.  The default scheduling is
10487 @samp{8000}.
10488
10489 @item -mlinker-opt
10490 @opindex mlinker-opt
10491 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
10492 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
10493 linkers in which they give bogus error messages when linking some programs.
10494
10495 @item -msoft-float
10496 @opindex msoft-float
10497 Generate output containing library calls for floating point.
10498 @strong{Warning:} the requisite libraries are not available for all HPPA
10499 targets.  Normally the facilities of the machine's usual C compiler are
10500 used, but this cannot be done directly in cross-compilation.  You must make
10501 your own arrangements to provide suitable library functions for
10502 cross-compilation.
10503
10504 @option{-msoft-float} changes the calling convention in the output file;
10505 therefore, it is only useful if you compile @emph{all} of a program with
10506 this option.  In particular, you need to compile @file{libgcc.a}, the
10507 library that comes with GCC, with @option{-msoft-float} in order for
10508 this to work.
10509
10510 @item -msio
10511 @opindex msio
10512 Generate the predefine, @code{_SIO}, for server IO@.  The default is
10513 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
10514 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
10515 options are available under HP-UX and HI-UX@.
10516
10517 @item -mgnu-ld
10518 @opindex gnu-ld
10519 Use GNU ld specific options.  This passes @option{-shared} to ld when
10520 building a shared library.  It is the default when GCC is configured,
10521 explicitly or implicitly, with the GNU linker.  This option does not
10522 have any affect on which ld is called, it only changes what parameters
10523 are passed to that ld.  The ld that is called is determined by the
10524 @option{--with-ld} configure option, GCC's program search path, and
10525 finally by the user's @env{PATH}.  The linker used by GCC can be printed
10526 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
10527 on the 64 bit HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
10528
10529 @item -mhp-ld
10530 @opindex hp-ld
10531 Use HP ld specific options.  This passes @option{-b} to ld when building
10532 a shared library and passes @option{+Accept TypeMismatch} to ld on all
10533 links.  It is the default when GCC is configured, explicitly or
10534 implicitly, with the HP linker.  This option does not have any affect on
10535 which ld is called, it only changes what parameters are passed to that
10536 ld.  The ld that is called is determined by the @option{--with-ld}
10537 configure option, GCC's program search path, and finally by the user's
10538 @env{PATH}.  The linker used by GCC can be printed using @samp{which
10539 `gcc -print-prog-name=ld`}.  This option is only available on the 64 bit
10540 HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
10541
10542 @item -mlong-calls
10543 @opindex mno-long-calls
10544 Generate code that uses long call sequences.  This ensures that a call
10545 is always able to reach linker generated stubs.  The default is to generate
10546 long calls only when the distance from the call site to the beginning
10547 of the function or translation unit, as the case may be, exceeds a
10548 predefined limit set by the branch type being used.  The limits for
10549 normal calls are 7,600,000 and 240,000 bytes, respectively for the
10550 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
10551 240,000 bytes.
10552
10553 Distances are measured from the beginning of functions when using the
10554 @option{-ffunction-sections} option, or when using the @option{-mgas}
10555 and @option{-mno-portable-runtime} options together under HP-UX with
10556 the SOM linker.
10557
10558 It is normally not desirable to use this option as it will degrade
10559 performance.  However, it may be useful in large applications,
10560 particularly when partial linking is used to build the application.
10561
10562 The types of long calls used depends on the capabilities of the
10563 assembler and linker, and the type of code being generated.  The
10564 impact on systems that support long absolute calls, and long pic
10565 symbol-difference or pc-relative calls should be relatively small.
10566 However, an indirect call is used on 32-bit ELF systems in pic code
10567 and it is quite long.
10568
10569 @item -munix=@var{unix-std}
10570 @opindex march
10571 Generate compiler predefines and select a startfile for the specified
10572 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
10573 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
10574 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
10575 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
10576 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
10577 and later.
10578
10579 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
10580 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
10581 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
10582 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
10583 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
10584 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
10585
10586 It is @emph{important} to note that this option changes the interfaces
10587 for various library routines.  It also affects the operational behavior
10588 of the C library.  Thus, @emph{extreme} care is needed in using this
10589 option.
10590
10591 Library code that is intended to operate with more than one UNIX
10592 standard must test, set and restore the variable @var{__xpg4_extended_mask}
10593 as appropriate.  Most GNU software doesn't provide this capability.
10594
10595 @item -nolibdld
10596 @opindex nolibdld
10597 Suppress the generation of link options to search libdld.sl when the
10598 @option{-static} option is specified on HP-UX 10 and later.
10599
10600 @item -static
10601 @opindex static
10602 The HP-UX implementation of setlocale in libc has a dependency on
10603 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
10604 when the @option{-static} option is specified, special link options
10605 are needed to resolve this dependency.
10606
10607 On HP-UX 10 and later, the GCC driver adds the necessary options to
10608 link with libdld.sl when the @option{-static} option is specified.
10609 This causes the resulting binary to be dynamic.  On the 64-bit port,
10610 the linkers generate dynamic binaries by default in any case.  The
10611 @option{-nolibdld} option can be used to prevent the GCC driver from
10612 adding these link options.
10613
10614 @item -threads
10615 @opindex threads
10616 Add support for multithreading with the @dfn{dce thread} library
10617 under HP-UX@.  This option sets flags for both the preprocessor and
10618 linker.
10619 @end table
10620
10621 @node i386 and x86-64 Options
10622 @subsection Intel 386 and AMD x86-64 Options
10623 @cindex i386 Options
10624 @cindex x86-64 Options
10625 @cindex Intel 386 Options
10626 @cindex AMD x86-64 Options
10627
10628 These @samp{-m} options are defined for the i386 and x86-64 family of
10629 computers:
10630
10631 @table @gcctabopt
10632 @item -mtune=@var{cpu-type}
10633 @opindex mtune
10634 Tune to @var{cpu-type} everything applicable about the generated code, except
10635 for the ABI and the set of available instructions.  The choices for
10636 @var{cpu-type} are:
10637 @table @emph
10638 @item generic
10639 Produce code optimized for the most common IA32/AMD64/EM64T processors.
10640 If you know the CPU on which your code will run, then you should use
10641 the corresponding @option{-mtune} option instead of
10642 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
10643 of your application will have, then you should use this option.
10644
10645 As new processors are deployed in the marketplace, the behavior of this
10646 option will change.  Therefore, if you upgrade to a newer version of
10647 GCC, the code generated option will change to reflect the processors
10648 that were most common when that version of GCC was released.
10649
10650 There is no @option{-march=generic} option because @option{-march}
10651 indicates the instruction set the compiler can use, and there is no
10652 generic instruction set applicable to all processors.  In contrast,
10653 @option{-mtune} indicates the processor (or, in this case, collection of
10654 processors) for which the code is optimized.
10655 @item native
10656 This selects the CPU to tune for at compilation time by determining
10657 the processor type of the compiling machine.  Using @option{-mtune=native}
10658 will produce code optimized for the local machine under the constraints
10659 of the selected instruction set.  Using @option{-march=native} will
10660 enable all instruction subsets supported by the local machine (hence
10661 the result might not run on different machines).
10662 @item i386
10663 Original Intel's i386 CPU@.
10664 @item i486
10665 Intel's i486 CPU@.  (No scheduling is implemented for this chip.)
10666 @item i586, pentium
10667 Intel Pentium CPU with no MMX support.
10668 @item pentium-mmx
10669 Intel PentiumMMX CPU based on Pentium core with MMX instruction set support.
10670 @item pentiumpro
10671 Intel PentiumPro CPU@.
10672 @item i686
10673 Same as @code{generic}, but when used as @code{march} option, PentiumPro
10674 instruction set will be used, so the code will run on all i686 family chips.
10675 @item pentium2
10676 Intel Pentium2 CPU based on PentiumPro core with MMX instruction set support.
10677 @item pentium3, pentium3m
10678 Intel Pentium3 CPU based on PentiumPro core with MMX and SSE instruction set
10679 support.
10680 @item pentium-m
10681 Low power version of Intel Pentium3 CPU with MMX, SSE and SSE2 instruction set
10682 support.  Used by Centrino notebooks.
10683 @item pentium4, pentium4m
10684 Intel Pentium4 CPU with MMX, SSE and SSE2 instruction set support.
10685 @item prescott
10686 Improved version of Intel Pentium4 CPU with MMX, SSE, SSE2 and SSE3 instruction
10687 set support.
10688 @item nocona
10689 Improved version of Intel Pentium4 CPU with 64-bit extensions, MMX, SSE,
10690 SSE2 and SSE3 instruction set support.
10691 @item core2
10692 Intel Core2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
10693 instruction set support.
10694 @item k6
10695 AMD K6 CPU with MMX instruction set support.
10696 @item k6-2, k6-3
10697 Improved versions of AMD K6 CPU with MMX and 3dNOW!@: instruction set support.
10698 @item athlon, athlon-tbird
10699 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW!@: and SSE prefetch instructions
10700 support.
10701 @item athlon-4, athlon-xp, athlon-mp
10702 Improved AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW!@: and full SSE
10703 instruction set support.
10704 @item k8, opteron, athlon64, athlon-fx
10705 AMD K8 core based CPUs with x86-64 instruction set support.  (This supersets
10706 MMX, SSE, SSE2, 3dNOW!, enhanced 3dNOW!@: and 64-bit instruction set extensions.)
10707 @item k8-sse3, opteron-sse3, athlon64-sse3
10708 Improved versions of k8, opteron and athlon64 with SSE3 instruction set support.
10709 @item amdfam10, barcelona
10710 AMD Family 10h core based CPUs with x86-64 instruction set support.  (This
10711 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3dNOW!, enhanced 3dNOW!, ABM and 64-bit
10712 instruction set extensions.)
10713 @item winchip-c6
10714 IDT Winchip C6 CPU, dealt in same way as i486 with additional MMX instruction
10715 set support.
10716 @item winchip2
10717 IDT Winchip2 CPU, dealt in same way as i486 with additional MMX and 3dNOW!@:
10718 instruction set support.
10719 @item c3
10720 Via C3 CPU with MMX and 3dNOW!@: instruction set support.  (No scheduling is
10721 implemented for this chip.)
10722 @item c3-2
10723 Via C3-2 CPU with MMX and SSE instruction set support.  (No scheduling is
10724 implemented for this chip.)
10725 @item geode
10726 Embedded AMD CPU with MMX and 3dNOW! instruction set support.
10727 @end table
10728
10729 While picking a specific @var{cpu-type} will schedule things appropriately
10730 for that particular chip, the compiler will not generate any code that
10731 does not run on the i386 without the @option{-march=@var{cpu-type}} option
10732 being used.
10733
10734 @item -march=@var{cpu-type}
10735 @opindex march
10736 Generate instructions for the machine type @var{cpu-type}.  The choices
10737 for @var{cpu-type} are the same as for @option{-mtune}.  Moreover,
10738 specifying @option{-march=@var{cpu-type}} implies @option{-mtune=@var{cpu-type}}.
10739
10740 @item -mcpu=@var{cpu-type}
10741 @opindex mcpu
10742 A deprecated synonym for @option{-mtune}.
10743
10744 @item -mfpmath=@var{unit}
10745 @opindex march
10746 Generate floating point arithmetics for selected unit @var{unit}.  The choices
10747 for @var{unit} are:
10748
10749 @table @samp
10750 @item 387
10751 Use the standard 387 floating point coprocessor present majority of chips and
10752 emulated otherwise.  Code compiled with this option will run almost everywhere.
10753 The temporary results are computed in 80bit precision instead of precision
10754 specified by the type resulting in slightly different results compared to most
10755 of other chips.  See @option{-ffloat-store} for more detailed description.
10756
10757 This is the default choice for i386 compiler.
10758
10759 @item sse
10760 Use scalar floating point instructions present in the SSE instruction set.
10761 This instruction set is supported by Pentium3 and newer chips, in the AMD line
10762 by Athlon-4, Athlon-xp and Athlon-mp chips.  The earlier version of SSE
10763 instruction set supports only single precision arithmetics, thus the double and
10764 extended precision arithmetics is still done using 387.  Later version, present
10765 only in Pentium4 and the future AMD x86-64 chips supports double precision
10766 arithmetics too.
10767
10768 For the i386 compiler, you need to use @option{-march=@var{cpu-type}}, @option{-msse}
10769 or @option{-msse2} switches to enable SSE extensions and make this option
10770 effective.  For the x86-64 compiler, these extensions are enabled by default.
10771
10772 The resulting code should be considerably faster in the majority of cases and avoid
10773 the numerical instability problems of 387 code, but may break some existing
10774 code that expects temporaries to be 80bit.
10775
10776 This is the default choice for the x86-64 compiler.
10777
10778 @item sse,387
10779 @itemx sse+387
10780 @itemx both
10781 Attempt to utilize both instruction sets at once.  This effectively double the
10782 amount of available registers and on chips with separate execution units for
10783 387 and SSE the execution resources too.  Use this option with care, as it is
10784 still experimental, because the GCC register allocator does not model separate
10785 functional units well resulting in instable performance.
10786 @end table
10787
10788 @item -masm=@var{dialect}
10789 @opindex masm=@var{dialect}
10790 Output asm instructions using selected @var{dialect}.  Supported
10791 choices are @samp{intel} or @samp{att} (the default one).  Darwin does
10792 not support @samp{intel}.
10793
10794 @item -mieee-fp
10795 @itemx -mno-ieee-fp
10796 @opindex mieee-fp
10797 @opindex mno-ieee-fp
10798 Control whether or not the compiler uses IEEE floating point
10799 comparisons.  These handle correctly the case where the result of a
10800 comparison is unordered.
10801
10802 @item -msoft-float
10803 @opindex msoft-float
10804 Generate output containing library calls for floating point.
10805 @strong{Warning:} the requisite libraries are not part of GCC@.
10806 Normally the facilities of the machine's usual C compiler are used, but
10807 this can't be done directly in cross-compilation.  You must make your
10808 own arrangements to provide suitable library functions for
10809 cross-compilation.
10810
10811 On machines where a function returns floating point results in the 80387
10812 register stack, some floating point opcodes may be emitted even if
10813 @option{-msoft-float} is used.
10814
10815 @item -mno-fp-ret-in-387
10816 @opindex mno-fp-ret-in-387
10817 Do not use the FPU registers for return values of functions.
10818
10819 The usual calling convention has functions return values of types
10820 @code{float} and @code{double} in an FPU register, even if there
10821 is no FPU@.  The idea is that the operating system should emulate
10822 an FPU@.
10823
10824 The option @option{-mno-fp-ret-in-387} causes such values to be returned
10825 in ordinary CPU registers instead.
10826
10827 @item -mno-fancy-math-387
10828 @opindex mno-fancy-math-387
10829 Some 387 emulators do not support the @code{sin}, @code{cos} and
10830 @code{sqrt} instructions for the 387.  Specify this option to avoid
10831 generating those instructions.  This option is the default on FreeBSD,
10832 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
10833 indicates that the target cpu will always have an FPU and so the
10834 instruction will not need emulation.  As of revision 2.6.1, these
10835 instructions are not generated unless you also use the
10836 @option{-funsafe-math-optimizations} switch.
10837
10838 @item -malign-double
10839 @itemx -mno-align-double
10840 @opindex malign-double
10841 @opindex mno-align-double
10842 Control whether GCC aligns @code{double}, @code{long double}, and
10843 @code{long long} variables on a two word boundary or a one word
10844 boundary.  Aligning @code{double} variables on a two word boundary will
10845 produce code that runs somewhat faster on a @samp{Pentium} at the
10846 expense of more memory.
10847
10848 On x86-64, @option{-malign-double} is enabled by default.
10849
10850 @strong{Warning:} if you use the @option{-malign-double} switch,
10851 structures containing the above types will be aligned differently than
10852 the published application binary interface specifications for the 386
10853 and will not be binary compatible with structures in code compiled
10854 without that switch.
10855
10856 @item -m96bit-long-double
10857 @itemx -m128bit-long-double
10858 @opindex m96bit-long-double
10859 @opindex m128bit-long-double
10860 These switches control the size of @code{long double} type.  The i386
10861 application binary interface specifies the size to be 96 bits,
10862 so @option{-m96bit-long-double} is the default in 32 bit mode.
10863
10864 Modern architectures (Pentium and newer) would prefer @code{long double}
10865 to be aligned to an 8 or 16 byte boundary.  In arrays or structures
10866 conforming to the ABI, this would not be possible.  So specifying a
10867 @option{-m128bit-long-double} will align @code{long double}
10868 to a 16 byte boundary by padding the @code{long double} with an additional
10869 32 bit zero.
10870
10871 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
10872 its ABI specifies that @code{long double} is to be aligned on 16 byte boundary.
10873
10874 Notice that neither of these options enable any extra precision over the x87
10875 standard of 80 bits for a @code{long double}.
10876
10877 @strong{Warning:} if you override the default value for your target ABI, the
10878 structures and arrays containing @code{long double} variables will change
10879 their size as well as function calling convention for function taking
10880 @code{long double} will be modified.  Hence they will not be binary
10881 compatible with arrays or structures in code compiled without that switch.
10882
10883 @item -mmlarge-data-threshold=@var{number}
10884 @opindex mlarge-data-threshold=@var{number}
10885 When @option{-mcmodel=medium} is specified, the data greater than
10886 @var{threshold} are placed in large data section.  This value must be the
10887 same across all object linked into the binary and defaults to 65535.
10888
10889 @item -mrtd
10890 @opindex mrtd
10891 Use a different function-calling convention, in which functions that
10892 take a fixed number of arguments return with the @code{ret} @var{num}
10893 instruction, which pops their arguments while returning.  This saves one
10894 instruction in the caller since there is no need to pop the arguments
10895 there.
10896
10897 You can specify that an individual function is called with this calling
10898 sequence with the function attribute @samp{stdcall}.  You can also
10899 override the @option{-mrtd} option by using the function attribute
10900 @samp{cdecl}.  @xref{Function Attributes}.
10901
10902 @strong{Warning:} this calling convention is incompatible with the one
10903 normally used on Unix, so you cannot use it if you need to call
10904 libraries compiled with the Unix compiler.
10905
10906 Also, you must provide function prototypes for all functions that
10907 take variable numbers of arguments (including @code{printf});
10908 otherwise incorrect code will be generated for calls to those
10909 functions.
10910
10911 In addition, seriously incorrect code will result if you call a
10912 function with too many arguments.  (Normally, extra arguments are
10913 harmlessly ignored.)
10914
10915 @item -mregparm=@var{num}
10916 @opindex mregparm
10917 Control how many registers are used to pass integer arguments.  By
10918 default, no registers are used to pass arguments, and at most 3
10919 registers can be used.  You can control this behavior for a specific
10920 function by using the function attribute @samp{regparm}.
10921 @xref{Function Attributes}.
10922
10923 @strong{Warning:} if you use this switch, and
10924 @var{num} is nonzero, then you must build all modules with the same
10925 value, including any libraries.  This includes the system libraries and
10926 startup modules.
10927
10928 @item -msseregparm
10929 @opindex msseregparm
10930 Use SSE register passing conventions for float and double arguments
10931 and return values.  You can control this behavior for a specific
10932 function by using the function attribute @samp{sseregparm}.
10933 @xref{Function Attributes}.
10934
10935 @strong{Warning:} if you use this switch then you must build all
10936 modules with the same value, including any libraries.  This includes
10937 the system libraries and startup modules.
10938
10939 @item -mpc32
10940 @itemx -mpc64
10941 @itemx -mpc80
10942 @opindex mpc32
10943 @opindex mpc64
10944 @opindex mpc80
10945
10946 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
10947 is specified, the significands of results of floating-point operations are
10948 rounded to 24 bits (single precision); @option{-mpc64} rounds the
10949 significands of results of floating-point operations to 53 bits (double
10950 precision) and @option{-mpc80} rounds the significands of results of
10951 floating-point operations to 64 bits (extended double precision), which is
10952 the default.  When this option is used, floating-point operations in higher
10953 precisions are not available to the programmer without setting the FPU
10954 control word explicitly.
10955
10956 Setting the rounding of floating-point operations to less than the default
10957 80 bits can speed some programs by 2% or more.  Note that some mathematical
10958 libraries assume that extended precision (80 bit) floating-point operations
10959 are enabled by default; routines in such libraries could suffer significant
10960 loss of accuracy, typically through so-called "catastrophic cancellation",
10961 when this option is used to set the precision to less than extended precision. 
10962
10963 @item -mstackrealign
10964 @opindex mstackrealign
10965 Realign the stack at entry.  On the Intel x86, the @option{-mstackrealign}
10966 option will generate an alternate prologue and epilogue that realigns the
10967 runtime stack if necessary.  This supports mixing legacy codes that keep
10968 a 4-byte aligned stack with modern codes that keep a 16-byte stack for
10969 SSE compatibility.  See also the attribute @code{force_align_arg_pointer},
10970 applicable to individual functions.
10971
10972 @item -mpreferred-stack-boundary=@var{num}
10973 @opindex mpreferred-stack-boundary
10974 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
10975 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
10976 the default is 4 (16 bytes or 128 bits).
10977
10978 @item -mincoming-stack-boundary=@var{num}
10979 @opindex mincoming-stack-boundary
10980 Assume the incoming stack is aligned to a 2 raised to @var{num} byte
10981 boundary.  If @option{-mincoming-stack-boundary} is not specified,
10982 the one specified by @option{-mpreferred-stack-boundary} will be used.
10983
10984 On Pentium and PentiumPro, @code{double} and @code{long double} values
10985 should be aligned to an 8 byte boundary (see @option{-malign-double}) or
10986 suffer significant run time performance penalties.  On Pentium III, the
10987 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
10988 properly if it is not 16 byte aligned.
10989
10990 To ensure proper alignment of this values on the stack, the stack boundary
10991 must be as aligned as that required by any value stored on the stack.
10992 Further, every function must be generated such that it keeps the stack
10993 aligned.  Thus calling a function compiled with a higher preferred
10994 stack boundary from a function compiled with a lower preferred stack
10995 boundary will most likely misalign the stack.  It is recommended that
10996 libraries that use callbacks always use the default setting.
10997
10998 This extra alignment does consume extra stack space, and generally
10999 increases code size.  Code that is sensitive to stack space usage, such
11000 as embedded systems and operating system kernels, may want to reduce the
11001 preferred alignment to @option{-mpreferred-stack-boundary=2}.
11002
11003 @item -mmmx
11004 @itemx -mno-mmx
11005 @itemx -msse
11006 @itemx -mno-sse
11007 @itemx -msse2
11008 @itemx -mno-sse2
11009 @itemx -msse3
11010 @itemx -mno-sse3
11011 @itemx -mssse3
11012 @itemx -mno-ssse3
11013 @itemx -msse4.1
11014 @itemx -mno-sse4.1
11015 @itemx -msse4.2
11016 @itemx -mno-sse4.2
11017 @itemx -msse4
11018 @itemx -mno-sse4
11019 @itemx -mavx
11020 @itemx -mno-avx
11021 @itemx -maes
11022 @itemx -mno-aes
11023 @itemx -mpclmul
11024 @itemx -mno-pclmul
11025 @itemx -msse4a
11026 @itemx -mno-sse4a
11027 @itemx -msse5
11028 @itemx -mno-sse5
11029 @itemx -m3dnow
11030 @itemx -mno-3dnow
11031 @itemx -mpopcnt
11032 @itemx -mno-popcnt
11033 @itemx -mabm
11034 @itemx -mno-abm
11035 @opindex mmmx
11036 @opindex mno-mmx
11037 @opindex msse
11038 @opindex mno-sse
11039 @opindex m3dnow
11040 @opindex mno-3dnow
11041 These switches enable or disable the use of instructions in the MMX,
11042 SSE, SSE2, SSE3, SSSE3, SSE4.1, AVX, AES, PCLMUL, SSE4A, SSE5, ABM or
11043 3DNow!@: extended instruction sets.
11044 These extensions are also available as built-in functions: see
11045 @ref{X86 Built-in Functions}, for details of the functions enabled and
11046 disabled by these switches.
11047
11048 To have SSE/SSE2 instructions generated automatically from floating-point
11049 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
11050
11051 GCC depresses SSEx instructions when @option{-mavx} is used. Instead, it
11052 generates new AVX instructions or AVX equivalence for all SSEx instructions
11053 when needed.
11054
11055 These options will enable GCC to use these extended instructions in
11056 generated code, even without @option{-mfpmath=sse}.  Applications which
11057 perform runtime CPU detection must compile separate files for each
11058 supported architecture, using the appropriate flags.  In particular,
11059 the file containing the CPU detection code should be compiled without
11060 these options.
11061
11062 @item -mcld
11063 @opindex mcld
11064 This option instructs GCC to emit a @code{cld} instruction in the prologue
11065 of functions that use string instructions.  String instructions depend on
11066 the DF flag to select between autoincrement or autodecrement mode.  While the
11067 ABI specifies the DF flag to be cleared on function entry, some operating
11068 systems violate this specification by not clearing the DF flag in their
11069 exception dispatchers.  The exception handler can be invoked with the DF flag
11070 set which leads to wrong direction mode, when string instructions are used.
11071 This option can be enabled by default on 32-bit x86 targets by configuring
11072 GCC with the @option{--enable-cld} configure option.  Generation of @code{cld}
11073 instructions can be suppressed with the @option{-mno-cld} compiler option
11074 in this case.
11075
11076 @item -mcx16
11077 @opindex mcx16
11078 This option will enable GCC to use CMPXCHG16B instruction in generated code.
11079 CMPXCHG16B allows for atomic operations on 128-bit double quadword (or oword)
11080 data types.  This is useful for high resolution counters that could be updated
11081 by multiple processors (or cores).  This instruction is generated as part of
11082 atomic built-in functions: see @ref{Atomic Builtins} for details.
11083
11084 @item -msahf
11085 @opindex msahf
11086 This option will enable GCC to use SAHF instruction in generated 64-bit code.
11087 Early Intel CPUs with Intel 64 lacked LAHF and SAHF instructions supported
11088 by AMD64 until introduction of Pentium 4 G1 step in December 2005.  LAHF and
11089 SAHF are load and store instructions, respectively, for certain status flags.
11090 In 64-bit mode, SAHF instruction is used to optimize @code{fmod}, @code{drem}
11091 or @code{remainder} built-in functions: see @ref{Other Builtins} for details.
11092
11093 @item -mrecip
11094 @opindex mrecip
11095 This option will enable GCC to use RCPSS and RSQRTSS instructions (and their
11096 vectorized variants RCPPS and RSQRTPS) with an additional Newton-Rhapson step
11097 to increase precision instead of DIVSS and SQRTSS (and their vectorized
11098 variants) for single precision floating point arguments.  These instructions
11099 are generated only when @option{-funsafe-math-optimizations} is enabled
11100 together with @option{-finite-math-only} and @option{-fno-trapping-math}.
11101 Note that while the throughput of the sequence is higher than the throughput
11102 of the non-reciprocal instruction, the precision of the sequence can be
11103 decreased by up to 2 ulp (i.e. the inverse of 1.0 equals 0.99999994).
11104
11105 @item -mveclibabi=@var{type}
11106 @opindex mveclibabi
11107 Specifies the ABI type to use for vectorizing intrinsics using an
11108 external library.  Supported types are @code{svml} for the Intel short
11109 vector math library and @code{acml} for the AMD math core library style
11110 of interfacing.  GCC will currently emit calls to @code{vmldExp2},
11111 @code{vmldLn2}, @code{vmldLog102}, @code{vmldLog102}, @code{vmldPow2},
11112 @code{vmldTanh2}, @code{vmldTan2}, @code{vmldAtan2}, @code{vmldAtanh2},
11113 @code{vmldCbrt2}, @code{vmldSinh2}, @code{vmldSin2}, @code{vmldAsinh2},
11114 @code{vmldAsin2}, @code{vmldCosh2}, @code{vmldCos2}, @code{vmldAcosh2},
11115 @code{vmldAcos2}, @code{vmlsExp4}, @code{vmlsLn4}, @code{vmlsLog104},
11116 @code{vmlsLog104}, @code{vmlsPow4}, @code{vmlsTanh4}, @code{vmlsTan4},
11117 @code{vmlsAtan4}, @code{vmlsAtanh4}, @code{vmlsCbrt4}, @code{vmlsSinh4},
11118 @code{vmlsSin4}, @code{vmlsAsinh4}, @code{vmlsAsin4}, @code{vmlsCosh4},
11119 @code{vmlsCos4}, @code{vmlsAcosh4} and @code{vmlsAcos4} for corresponding
11120 function type when @option{-mveclibabi=svml} is used and @code{__vrd2_sin},
11121 @code{__vrd2_cos}, @code{__vrd2_exp}, @code{__vrd2_log}, @code{__vrd2_log2},
11122 @code{__vrd2_log10}, @code{__vrs4_sinf}, @code{__vrs4_cosf},
11123 @code{__vrs4_expf}, @code{__vrs4_logf}, @code{__vrs4_log2f},
11124 @code{__vrs4_log10f} and @code{__vrs4_powf} for corresponding function type
11125 when @option{-mveclibabi=acml} is used. Both @option{-ftree-vectorize} and
11126 @option{-funsafe-math-optimizations} have to be enabled. A SVML or ACML ABI
11127 compatible library will have to be specified at link time.
11128
11129 @item -mpush-args
11130 @itemx -mno-push-args
11131 @opindex mpush-args
11132 @opindex mno-push-args
11133 Use PUSH operations to store outgoing parameters.  This method is shorter
11134 and usually equally fast as method using SUB/MOV operations and is enabled
11135 by default.  In some cases disabling it may improve performance because of
11136 improved scheduling and reduced dependencies.
11137
11138 @item -maccumulate-outgoing-args
11139 @opindex maccumulate-outgoing-args
11140 If enabled, the maximum amount of space required for outgoing arguments will be
11141 computed in the function prologue.  This is faster on most modern CPUs
11142 because of reduced dependencies, improved scheduling and reduced stack usage
11143 when preferred stack boundary is not equal to 2.  The drawback is a notable
11144 increase in code size.  This switch implies @option{-mno-push-args}.
11145
11146 @item -mthreads
11147 @opindex mthreads
11148 Support thread-safe exception handling on @samp{Mingw32}.  Code that relies
11149 on thread-safe exception handling must compile and link all code with the
11150 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
11151 @option{-D_MT}; when linking, it links in a special thread helper library
11152 @option{-lmingwthrd} which cleans up per thread exception handling data.
11153
11154 @item -mno-align-stringops
11155 @opindex mno-align-stringops
11156 Do not align destination of inlined string operations.  This switch reduces
11157 code size and improves performance in case the destination is already aligned,
11158 but GCC doesn't know about it.
11159
11160 @item -minline-all-stringops
11161 @opindex minline-all-stringops
11162 By default GCC inlines string operations only when destination is known to be
11163 aligned at least to 4 byte boundary.  This enables more inlining, increase code
11164 size, but may improve performance of code that depends on fast memcpy, strlen
11165 and memset for short lengths.
11166
11167 @item -minline-stringops-dynamically
11168 @opindex minline-stringops-dynamically
11169 For string operation of unknown size, inline runtime checks so for small
11170 blocks inline code is used, while for large blocks library call is used.
11171
11172 @item -mstringop-strategy=@var{alg}
11173 @opindex mstringop-strategy=@var{alg}
11174 Overwrite internal decision heuristic about particular algorithm to inline
11175 string operation with.  The allowed values are @code{rep_byte},
11176 @code{rep_4byte}, @code{rep_8byte} for expanding using i386 @code{rep} prefix
11177 of specified size, @code{byte_loop}, @code{loop}, @code{unrolled_loop} for
11178 expanding inline loop, @code{libcall} for always expanding library call.
11179
11180 @item -momit-leaf-frame-pointer
11181 @opindex momit-leaf-frame-pointer
11182 Don't keep the frame pointer in a register for leaf functions.  This
11183 avoids the instructions to save, set up and restore frame pointers and
11184 makes an extra register available in leaf functions.  The option
11185 @option{-fomit-frame-pointer} removes the frame pointer for all functions
11186 which might make debugging harder.
11187
11188 @item -mtls-direct-seg-refs
11189 @itemx -mno-tls-direct-seg-refs
11190 @opindex mtls-direct-seg-refs
11191 Controls whether TLS variables may be accessed with offsets from the
11192 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
11193 or whether the thread base pointer must be added.  Whether or not this
11194 is legal depends on the operating system, and whether it maps the
11195 segment to cover the entire TLS area.
11196
11197 For systems that use GNU libc, the default is on.
11198
11199 @item -mfused-madd
11200 @itemx -mno-fused-madd
11201 @opindex mfused-madd
11202 Enable automatic generation of fused floating point multiply-add instructions
11203 if the ISA supports such instructions.  The -mfused-madd option is on by
11204 default.  The fused multiply-add instructions have a different
11205 rounding behavior compared to executing a multiply followed by an add.
11206 @end table
11207
11208 These @samp{-m} switches are supported in addition to the above
11209 on AMD x86-64 processors in 64-bit environments.
11210
11211 @table @gcctabopt
11212 @item -m32
11213 @itemx -m64
11214 @opindex m32
11215 @opindex m64
11216 Generate code for a 32-bit or 64-bit environment.
11217 The 32-bit environment sets int, long and pointer to 32 bits and
11218 generates code that runs on any i386 system.
11219 The 64-bit environment sets int to 32 bits and long and pointer
11220 to 64 bits and generates code for AMD's x86-64 architecture. For
11221 darwin only the -m64 option turns off the @option{-fno-pic} and
11222 @option{-mdynamic-no-pic} options.
11223
11224 @item -mno-red-zone
11225 @opindex no-red-zone
11226 Do not use a so called red zone for x86-64 code.  The red zone is mandated
11227 by the x86-64 ABI, it is a 128-byte area beyond the location of the
11228 stack pointer that will not be modified by signal or interrupt handlers
11229 and therefore can be used for temporary data without adjusting the stack
11230 pointer.  The flag @option{-mno-red-zone} disables this red zone.
11231
11232 @item -mcmodel=small
11233 @opindex mcmodel=small
11234 Generate code for the small code model: the program and its symbols must
11235 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
11236 Programs can be statically or dynamically linked.  This is the default
11237 code model.
11238
11239 @item -mcmodel=kernel
11240 @opindex mcmodel=kernel
11241 Generate code for the kernel code model.  The kernel runs in the
11242 negative 2 GB of the address space.
11243 This model has to be used for Linux kernel code.
11244
11245 @item -mcmodel=medium
11246 @opindex mcmodel=medium
11247 Generate code for the medium model: The program is linked in the lower 2
11248 GB of the address space but symbols can be located anywhere in the
11249 address space.  Programs can be statically or dynamically linked, but
11250 building of shared libraries are not supported with the medium model.
11251
11252 @item -mcmodel=large
11253 @opindex mcmodel=large
11254 Generate code for the large model: This model makes no assumptions
11255 about addresses and sizes of sections.
11256 @end table
11257
11258 @node IA-64 Options
11259 @subsection IA-64 Options
11260 @cindex IA-64 Options
11261
11262 These are the @samp{-m} options defined for the Intel IA-64 architecture.
11263
11264 @table @gcctabopt
11265 @item -mbig-endian
11266 @opindex mbig-endian
11267 Generate code for a big endian target.  This is the default for HP-UX@.
11268
11269 @item -mlittle-endian
11270 @opindex mlittle-endian
11271 Generate code for a little endian target.  This is the default for AIX5
11272 and GNU/Linux.
11273
11274 @item -mgnu-as
11275 @itemx -mno-gnu-as
11276 @opindex mgnu-as
11277 @opindex mno-gnu-as
11278 Generate (or don't) code for the GNU assembler.  This is the default.
11279 @c Also, this is the default if the configure option @option{--with-gnu-as}
11280 @c is used.
11281
11282 @item -mgnu-ld
11283 @itemx -mno-gnu-ld
11284 @opindex mgnu-ld
11285 @opindex mno-gnu-ld
11286 Generate (or don't) code for the GNU linker.  This is the default.
11287 @c Also, this is the default if the configure option @option{--with-gnu-ld}
11288 @c is used.
11289
11290 @item -mno-pic
11291 @opindex mno-pic
11292 Generate code that does not use a global pointer register.  The result
11293 is not position independent code, and violates the IA-64 ABI@.
11294
11295 @item -mvolatile-asm-stop
11296 @itemx -mno-volatile-asm-stop
11297 @opindex mvolatile-asm-stop
11298 @opindex mno-volatile-asm-stop
11299 Generate (or don't) a stop bit immediately before and after volatile asm
11300 statements.
11301
11302 @item -mregister-names
11303 @itemx -mno-register-names
11304 @opindex mregister-names
11305 @opindex mno-register-names
11306 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
11307 the stacked registers.  This may make assembler output more readable.
11308
11309 @item -mno-sdata
11310 @itemx -msdata
11311 @opindex mno-sdata
11312 @opindex msdata
11313 Disable (or enable) optimizations that use the small data section.  This may
11314 be useful for working around optimizer bugs.
11315
11316 @item -mconstant-gp
11317 @opindex mconstant-gp
11318 Generate code that uses a single constant global pointer value.  This is
11319 useful when compiling kernel code.
11320
11321 @item -mauto-pic
11322 @opindex mauto-pic
11323 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
11324 This is useful when compiling firmware code.
11325
11326 @item -minline-float-divide-min-latency
11327 @opindex minline-float-divide-min-latency
11328 Generate code for inline divides of floating point values
11329 using the minimum latency algorithm.
11330
11331 @item -minline-float-divide-max-throughput
11332 @opindex minline-float-divide-max-throughput
11333 Generate code for inline divides of floating point values
11334 using the maximum throughput algorithm.
11335
11336 @item -minline-int-divide-min-latency
11337 @opindex minline-int-divide-min-latency
11338 Generate code for inline divides of integer values
11339 using the minimum latency algorithm.
11340
11341 @item -minline-int-divide-max-throughput
11342 @opindex minline-int-divide-max-throughput
11343 Generate code for inline divides of integer values
11344 using the maximum throughput algorithm.
11345
11346 @item -minline-sqrt-min-latency
11347 @opindex minline-sqrt-min-latency
11348 Generate code for inline square roots
11349 using the minimum latency algorithm.
11350
11351 @item -minline-sqrt-max-throughput
11352 @opindex minline-sqrt-max-throughput
11353 Generate code for inline square roots
11354 using the maximum throughput algorithm.
11355
11356 @item -mno-dwarf2-asm
11357 @itemx -mdwarf2-asm
11358 @opindex mno-dwarf2-asm
11359 @opindex mdwarf2-asm
11360 Don't (or do) generate assembler code for the DWARF2 line number debugging
11361 info.  This may be useful when not using the GNU assembler.
11362
11363 @item -mearly-stop-bits
11364 @itemx -mno-early-stop-bits
11365 @opindex mearly-stop-bits
11366 @opindex mno-early-stop-bits
11367 Allow stop bits to be placed earlier than immediately preceding the
11368 instruction that triggered the stop bit.  This can improve instruction
11369 scheduling, but does not always do so.
11370
11371 @item -mfixed-range=@var{register-range}
11372 @opindex mfixed-range
11373 Generate code treating the given register range as fixed registers.
11374 A fixed register is one that the register allocator can not use.  This is
11375 useful when compiling kernel code.  A register range is specified as
11376 two registers separated by a dash.  Multiple register ranges can be
11377 specified separated by a comma.
11378
11379 @item -mtls-size=@var{tls-size}
11380 @opindex mtls-size
11381 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
11382 64.
11383
11384 @item -mtune=@var{cpu-type}
11385 @opindex mtune
11386 Tune the instruction scheduling for a particular CPU, Valid values are
11387 itanium, itanium1, merced, itanium2, and mckinley.
11388
11389 @item -mt
11390 @itemx -pthread
11391 @opindex mt
11392 @opindex pthread
11393 Add support for multithreading using the POSIX threads library.  This
11394 option sets flags for both the preprocessor and linker.  It does
11395 not affect the thread safety of object code produced by the compiler or
11396 that of libraries supplied with it.  These are HP-UX specific flags.
11397
11398 @item -milp32
11399 @itemx -mlp64
11400 @opindex milp32
11401 @opindex mlp64
11402 Generate code for a 32-bit or 64-bit environment.
11403 The 32-bit environment sets int, long and pointer to 32 bits.
11404 The 64-bit environment sets int to 32 bits and long and pointer
11405 to 64 bits.  These are HP-UX specific flags.
11406
11407 @item -mno-sched-br-data-spec
11408 @itemx -msched-br-data-spec
11409 @opindex mno-sched-br-data-spec
11410 @opindex msched-br-data-spec
11411 (Dis/En)able data speculative scheduling before reload.
11412 This will result in generation of the ld.a instructions and
11413 the corresponding check instructions (ld.c / chk.a).
11414 The default is 'disable'.
11415
11416 @item -msched-ar-data-spec
11417 @itemx -mno-sched-ar-data-spec
11418 @opindex msched-ar-data-spec
11419 @opindex mno-sched-ar-data-spec
11420 (En/Dis)able data speculative scheduling after reload.
11421 This will result in generation of the ld.a instructions and
11422 the corresponding check instructions (ld.c / chk.a).
11423 The default is 'enable'.
11424
11425 @item -mno-sched-control-spec
11426 @itemx -msched-control-spec
11427 @opindex mno-sched-control-spec
11428 @opindex msched-control-spec
11429 (Dis/En)able control speculative scheduling.  This feature is
11430 available only during region scheduling (i.e.@: before reload).
11431 This will result in generation of the ld.s instructions and
11432 the corresponding check instructions chk.s .
11433 The default is 'disable'.
11434
11435 @item -msched-br-in-data-spec
11436 @itemx -mno-sched-br-in-data-spec
11437 @opindex msched-br-in-data-spec
11438 @opindex mno-sched-br-in-data-spec
11439 (En/Dis)able speculative scheduling of the instructions that
11440 are dependent on the data speculative loads before reload.
11441 This is effective only with @option{-msched-br-data-spec} enabled.
11442 The default is 'enable'.
11443
11444 @item -msched-ar-in-data-spec
11445 @itemx -mno-sched-ar-in-data-spec
11446 @opindex msched-ar-in-data-spec
11447 @opindex mno-sched-ar-in-data-spec
11448 (En/Dis)able speculative scheduling of the instructions that
11449 are dependent on the data speculative loads after reload.
11450 This is effective only with @option{-msched-ar-data-spec} enabled.
11451 The default is 'enable'.
11452
11453 @item -msched-in-control-spec
11454 @itemx -mno-sched-in-control-spec
11455 @opindex msched-in-control-spec
11456 @opindex mno-sched-in-control-spec
11457 (En/Dis)able speculative scheduling of the instructions that
11458 are dependent on the control speculative loads.
11459 This is effective only with @option{-msched-control-spec} enabled.
11460 The default is 'enable'.
11461
11462 @item -msched-ldc
11463 @itemx -mno-sched-ldc
11464 @opindex msched-ldc
11465 @opindex mno-sched-ldc
11466 (En/Dis)able use of simple data speculation checks ld.c .
11467 If disabled, only chk.a instructions will be emitted to check
11468 data speculative loads.
11469 The default is 'enable'.
11470
11471 @item -mno-sched-control-ldc
11472 @itemx -msched-control-ldc
11473 @opindex mno-sched-control-ldc
11474 @opindex msched-control-ldc
11475 (Dis/En)able use of ld.c instructions to check control speculative loads.
11476 If enabled, in case of control speculative load with no speculatively
11477 scheduled dependent instructions this load will be emitted as ld.sa and
11478 ld.c will be used to check it.
11479 The default is 'disable'.
11480
11481 @item -mno-sched-spec-verbose
11482 @itemx -msched-spec-verbose
11483 @opindex mno-sched-spec-verbose
11484 @opindex msched-spec-verbose
11485 (Dis/En)able printing of the information about speculative motions.
11486
11487 @item -mno-sched-prefer-non-data-spec-insns
11488 @itemx -msched-prefer-non-data-spec-insns
11489 @opindex mno-sched-prefer-non-data-spec-insns
11490 @opindex msched-prefer-non-data-spec-insns
11491 If enabled, data speculative instructions will be chosen for schedule
11492 only if there are no other choices at the moment.  This will make
11493 the use of the data speculation much more conservative.
11494 The default is 'disable'.
11495
11496 @item -mno-sched-prefer-non-control-spec-insns
11497 @itemx -msched-prefer-non-control-spec-insns
11498 @opindex mno-sched-prefer-non-control-spec-insns
11499 @opindex msched-prefer-non-control-spec-insns
11500 If enabled, control speculative instructions will be chosen for schedule
11501 only if there are no other choices at the moment.  This will make
11502 the use of the control speculation much more conservative.
11503 The default is 'disable'.
11504
11505 @item -mno-sched-count-spec-in-critical-path
11506 @itemx -msched-count-spec-in-critical-path
11507 @opindex mno-sched-count-spec-in-critical-path
11508 @opindex msched-count-spec-in-critical-path
11509 If enabled, speculative dependencies will be considered during
11510 computation of the instructions priorities.  This will make the use of the
11511 speculation a bit more conservative.
11512 The default is 'disable'.
11513
11514 @end table
11515
11516 @node M32C Options
11517 @subsection M32C Options
11518 @cindex M32C options
11519
11520 @table @gcctabopt
11521 @item -mcpu=@var{name}
11522 @opindex mcpu=
11523 Select the CPU for which code is generated.  @var{name} may be one of
11524 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
11525 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
11526 the M32C/80 series.
11527
11528 @item -msim
11529 @opindex msim
11530 Specifies that the program will be run on the simulator.  This causes
11531 an alternate runtime library to be linked in which supports, for
11532 example, file I/O@.  You must not use this option when generating
11533 programs that will run on real hardware; you must provide your own
11534 runtime library for whatever I/O functions are needed.
11535
11536 @item -memregs=@var{number}
11537 @opindex memregs=
11538 Specifies the number of memory-based pseudo-registers GCC will use
11539 during code generation.  These pseudo-registers will be used like real
11540 registers, so there is a tradeoff between GCC's ability to fit the
11541 code into available registers, and the performance penalty of using
11542 memory instead of registers.  Note that all modules in a program must
11543 be compiled with the same value for this option.  Because of that, you
11544 must not use this option with the default runtime libraries gcc
11545 builds.
11546
11547 @end table
11548
11549 @node M32R/D Options
11550 @subsection M32R/D Options
11551 @cindex M32R/D options
11552
11553 These @option{-m} options are defined for Renesas M32R/D architectures:
11554
11555 @table @gcctabopt
11556 @item -m32r2
11557 @opindex m32r2
11558 Generate code for the M32R/2@.
11559
11560 @item -m32rx
11561 @opindex m32rx
11562 Generate code for the M32R/X@.
11563
11564 @item -m32r
11565 @opindex m32r
11566 Generate code for the M32R@.  This is the default.
11567
11568 @item -mmodel=small
11569 @opindex mmodel=small
11570 Assume all objects live in the lower 16MB of memory (so that their addresses
11571 can be loaded with the @code{ld24} instruction), and assume all subroutines
11572 are reachable with the @code{bl} instruction.
11573 This is the default.
11574
11575 The addressability of a particular object can be set with the
11576 @code{model} attribute.
11577
11578 @item -mmodel=medium
11579 @opindex mmodel=medium
11580 Assume objects may be anywhere in the 32-bit address space (the compiler
11581 will generate @code{seth/add3} instructions to load their addresses), and
11582 assume all subroutines are reachable with the @code{bl} instruction.
11583
11584 @item -mmodel=large
11585 @opindex mmodel=large
11586 Assume objects may be anywhere in the 32-bit address space (the compiler
11587 will generate @code{seth/add3} instructions to load their addresses), and
11588 assume subroutines may not be reachable with the @code{bl} instruction
11589 (the compiler will generate the much slower @code{seth/add3/jl}
11590 instruction sequence).
11591
11592 @item -msdata=none
11593 @opindex msdata=none
11594 Disable use of the small data area.  Variables will be put into
11595 one of @samp{.data}, @samp{bss}, or @samp{.rodata} (unless the
11596 @code{section} attribute has been specified).
11597 This is the default.
11598
11599 The small data area consists of sections @samp{.sdata} and @samp{.sbss}.
11600 Objects may be explicitly put in the small data area with the
11601 @code{section} attribute using one of these sections.
11602
11603 @item -msdata=sdata
11604 @opindex msdata=sdata
11605 Put small global and static data in the small data area, but do not
11606 generate special code to reference them.
11607
11608 @item -msdata=use
11609 @opindex msdata=use
11610 Put small global and static data in the small data area, and generate
11611 special instructions to reference them.
11612
11613 @item -G @var{num}
11614 @opindex G
11615 @cindex smaller data references
11616 Put global and static objects less than or equal to @var{num} bytes
11617 into the small data or bss sections instead of the normal data or bss
11618 sections.  The default value of @var{num} is 8.
11619 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
11620 for this option to have any effect.
11621
11622 All modules should be compiled with the same @option{-G @var{num}} value.
11623 Compiling with different values of @var{num} may or may not work; if it
11624 doesn't the linker will give an error message---incorrect code will not be
11625 generated.
11626
11627 @item -mdebug
11628 @opindex mdebug
11629 Makes the M32R specific code in the compiler display some statistics
11630 that might help in debugging programs.
11631
11632 @item -malign-loops
11633 @opindex malign-loops
11634 Align all loops to a 32-byte boundary.
11635
11636 @item -mno-align-loops
11637 @opindex mno-align-loops
11638 Do not enforce a 32-byte alignment for loops.  This is the default.
11639
11640 @item -missue-rate=@var{number}
11641 @opindex missue-rate=@var{number}
11642 Issue @var{number} instructions per cycle.  @var{number} can only be 1
11643 or 2.
11644
11645 @item -mbranch-cost=@var{number}
11646 @opindex mbranch-cost=@var{number}
11647 @var{number} can only be 1 or 2.  If it is 1 then branches will be
11648 preferred over conditional code, if it is 2, then the opposite will
11649 apply.
11650
11651 @item -mflush-trap=@var{number}
11652 @opindex mflush-trap=@var{number}
11653 Specifies the trap number to use to flush the cache.  The default is
11654 12.  Valid numbers are between 0 and 15 inclusive.
11655
11656 @item -mno-flush-trap
11657 @opindex mno-flush-trap
11658 Specifies that the cache cannot be flushed by using a trap.
11659
11660 @item -mflush-func=@var{name}
11661 @opindex mflush-func=@var{name}
11662 Specifies the name of the operating system function to call to flush
11663 the cache.  The default is @emph{_flush_cache}, but a function call
11664 will only be used if a trap is not available.
11665
11666 @item -mno-flush-func
11667 @opindex mno-flush-func
11668 Indicates that there is no OS function for flushing the cache.
11669
11670 @end table
11671
11672 @node M680x0 Options
11673 @subsection M680x0 Options
11674 @cindex M680x0 options
11675
11676 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
11677 The default settings depend on which architecture was selected when
11678 the compiler was configured; the defaults for the most common choices
11679 are given below.
11680
11681 @table @gcctabopt
11682 @item -march=@var{arch}
11683 @opindex march
11684 Generate code for a specific M680x0 or ColdFire instruction set
11685 architecture.  Permissible values of @var{arch} for M680x0
11686 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
11687 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
11688 architectures are selected according to Freescale's ISA classification
11689 and the permissible values are: @samp{isaa}, @samp{isaaplus},
11690 @samp{isab} and @samp{isac}.
11691
11692 gcc defines a macro @samp{__mcf@var{arch}__} whenever it is generating
11693 code for a ColdFire target.  The @var{arch} in this macro is one of the
11694 @option{-march} arguments given above.
11695
11696 When used together, @option{-march} and @option{-mtune} select code
11697 that runs on a family of similar processors but that is optimized
11698 for a particular microarchitecture.
11699
11700 @item -mcpu=@var{cpu}
11701 @opindex mcpu
11702 Generate code for a specific M680x0 or ColdFire processor.
11703 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
11704 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
11705 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
11706 below, which also classifies the CPUs into families:
11707
11708 @multitable @columnfractions 0.20 0.80
11709 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
11710 @item @samp{51qe} @tab @samp{51qe}
11711 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
11712 @item @samp{5206e} @tab @samp{5206e}
11713 @item @samp{5208} @tab @samp{5207} @samp{5208}
11714 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
11715 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
11716 @item @samp{5216} @tab @samp{5214} @samp{5216}
11717 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
11718 @item @samp{5225} @tab @samp{5224} @samp{5225}
11719 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
11720 @item @samp{5249} @tab @samp{5249}
11721 @item @samp{5250} @tab @samp{5250}
11722 @item @samp{5271} @tab @samp{5270} @samp{5271}
11723 @item @samp{5272} @tab @samp{5272}
11724 @item @samp{5275} @tab @samp{5274} @samp{5275}
11725 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
11726 @item @samp{5307} @tab @samp{5307}
11727 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
11728 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
11729 @item @samp{5407} @tab @samp{5407}
11730 @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}
11731 @end multitable
11732
11733 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
11734 @var{arch} is compatible with @var{cpu}.  Other combinations of
11735 @option{-mcpu} and @option{-march} are rejected.
11736
11737 gcc defines the macro @samp{__mcf_cpu_@var{cpu}} when ColdFire target
11738 @var{cpu} is selected.  It also defines @samp{__mcf_family_@var{family}},
11739 where the value of @var{family} is given by the table above.
11740
11741 @item -mtune=@var{tune}
11742 @opindex mtune
11743 Tune the code for a particular microarchitecture, within the
11744 constraints set by @option{-march} and @option{-mcpu}.
11745 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
11746 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
11747 and @samp{cpu32}.  The ColdFire microarchitectures
11748 are: @samp{cfv1}, @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
11749
11750 You can also use @option{-mtune=68020-40} for code that needs
11751 to run relatively well on 68020, 68030 and 68040 targets.
11752 @option{-mtune=68020-60} is similar but includes 68060 targets
11753 as well.  These two options select the same tuning decisions as
11754 @option{-m68020-40} and @option{-m68020-60} respectively.
11755
11756 gcc defines the macros @samp{__mc@var{arch}} and @samp{__mc@var{arch}__}
11757 when tuning for 680x0 architecture @var{arch}.  It also defines
11758 @samp{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
11759 option is used.  If gcc is tuning for a range of architectures,
11760 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
11761 it defines the macros for every architecture in the range.
11762
11763 gcc also defines the macro @samp{__m@var{uarch}__} when tuning for
11764 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
11765 of the arguments given above.
11766
11767 @item -m68000
11768 @itemx -mc68000
11769 @opindex m68000
11770 @opindex mc68000
11771 Generate output for a 68000.  This is the default
11772 when the compiler is configured for 68000-based systems.
11773 It is equivalent to @option{-march=68000}.
11774
11775 Use this option for microcontrollers with a 68000 or EC000 core,
11776 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
11777
11778 @item -m68010
11779 @opindex m68010
11780 Generate output for a 68010.  This is the default
11781 when the compiler is configured for 68010-based systems.
11782 It is equivalent to @option{-march=68010}.
11783
11784 @item -m68020
11785 @itemx -mc68020
11786 @opindex m68020
11787 @opindex mc68020
11788 Generate output for a 68020.  This is the default
11789 when the compiler is configured for 68020-based systems.
11790 It is equivalent to @option{-march=68020}.
11791
11792 @item -m68030
11793 @opindex m68030
11794 Generate output for a 68030.  This is the default when the compiler is
11795 configured for 68030-based systems.  It is equivalent to
11796 @option{-march=68030}.
11797
11798 @item -m68040
11799 @opindex m68040
11800 Generate output for a 68040.  This is the default when the compiler is
11801 configured for 68040-based systems.  It is equivalent to
11802 @option{-march=68040}.
11803
11804 This option inhibits the use of 68881/68882 instructions that have to be
11805 emulated by software on the 68040.  Use this option if your 68040 does not
11806 have code to emulate those instructions.
11807
11808 @item -m68060
11809 @opindex m68060
11810 Generate output for a 68060.  This is the default when the compiler is
11811 configured for 68060-based systems.  It is equivalent to
11812 @option{-march=68060}.
11813
11814 This option inhibits the use of 68020 and 68881/68882 instructions that
11815 have to be emulated by software on the 68060.  Use this option if your 68060
11816 does not have code to emulate those instructions.
11817
11818 @item -mcpu32
11819 @opindex mcpu32
11820 Generate output for a CPU32.  This is the default
11821 when the compiler is configured for CPU32-based systems.
11822 It is equivalent to @option{-march=cpu32}.
11823
11824 Use this option for microcontrollers with a
11825 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
11826 68336, 68340, 68341, 68349 and 68360.
11827
11828 @item -m5200
11829 @opindex m5200
11830 Generate output for a 520X ColdFire CPU@.  This is the default
11831 when the compiler is configured for 520X-based systems.
11832 It is equivalent to @option{-mcpu=5206}, and is now deprecated
11833 in favor of that option.
11834
11835 Use this option for microcontroller with a 5200 core, including
11836 the MCF5202, MCF5203, MCF5204 and MCF5206.
11837
11838 @item -m5206e
11839 @opindex m5206e
11840 Generate output for a 5206e ColdFire CPU@.  The option is now
11841 deprecated in favor of the equivalent @option{-mcpu=5206e}.
11842
11843 @item -m528x
11844 @opindex m528x
11845 Generate output for a member of the ColdFire 528X family.
11846 The option is now deprecated in favor of the equivalent
11847 @option{-mcpu=528x}.
11848
11849 @item -m5307
11850 @opindex m5307
11851 Generate output for a ColdFire 5307 CPU@.  The option is now deprecated
11852 in favor of the equivalent @option{-mcpu=5307}.
11853
11854 @item -m5407
11855 @opindex m5407
11856 Generate output for a ColdFire 5407 CPU@.  The option is now deprecated
11857 in favor of the equivalent @option{-mcpu=5407}.
11858
11859 @item -mcfv4e
11860 @opindex mcfv4e
11861 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
11862 This includes use of hardware floating point instructions.
11863 The option is equivalent to @option{-mcpu=547x}, and is now
11864 deprecated in favor of that option.
11865
11866 @item -m68020-40
11867 @opindex m68020-40
11868 Generate output for a 68040, without using any of the new instructions.
11869 This results in code which can run relatively efficiently on either a
11870 68020/68881 or a 68030 or a 68040.  The generated code does use the
11871 68881 instructions that are emulated on the 68040.
11872
11873 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
11874
11875 @item -m68020-60
11876 @opindex m68020-60
11877 Generate output for a 68060, without using any of the new instructions.
11878 This results in code which can run relatively efficiently on either a
11879 68020/68881 or a 68030 or a 68040.  The generated code does use the
11880 68881 instructions that are emulated on the 68060.
11881
11882 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
11883
11884 @item -mhard-float
11885 @itemx -m68881
11886 @opindex mhard-float
11887 @opindex m68881
11888 Generate floating-point instructions.  This is the default for 68020
11889 and above, and for ColdFire devices that have an FPU@.  It defines the
11890 macro @samp{__HAVE_68881__} on M680x0 targets and @samp{__mcffpu__}
11891 on ColdFire targets.
11892
11893 @item -msoft-float
11894 @opindex msoft-float
11895 Do not generate floating-point instructions; use library calls instead.
11896 This is the default for 68000, 68010, and 68832 targets.  It is also
11897 the default for ColdFire devices that have no FPU.
11898
11899 @item -mdiv
11900 @itemx -mno-div
11901 @opindex mdiv
11902 @opindex mno-div
11903 Generate (do not generate) ColdFire hardware divide and remainder
11904 instructions.  If @option{-march} is used without @option{-mcpu},
11905 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
11906 architectures.  Otherwise, the default is taken from the target CPU
11907 (either the default CPU, or the one specified by @option{-mcpu}).  For
11908 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
11909 @option{-mcpu=5206e}.
11910
11911 gcc defines the macro @samp{__mcfhwdiv__} when this option is enabled.
11912
11913 @item -mshort
11914 @opindex mshort
11915 Consider type @code{int} to be 16 bits wide, like @code{short int}.
11916 Additionally, parameters passed on the stack are also aligned to a
11917 16-bit boundary even on targets whose API mandates promotion to 32-bit.
11918
11919 @item -mno-short
11920 @opindex mno-short
11921 Do not consider type @code{int} to be 16 bits wide.  This is the default.
11922
11923 @item -mnobitfield
11924 @itemx -mno-bitfield
11925 @opindex mnobitfield
11926 @opindex mno-bitfield
11927 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
11928 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
11929
11930 @item -mbitfield
11931 @opindex mbitfield
11932 Do use the bit-field instructions.  The @option{-m68020} option implies
11933 @option{-mbitfield}.  This is the default if you use a configuration
11934 designed for a 68020.
11935
11936 @item -mrtd
11937 @opindex mrtd
11938 Use a different function-calling convention, in which functions
11939 that take a fixed number of arguments return with the @code{rtd}
11940 instruction, which pops their arguments while returning.  This
11941 saves one instruction in the caller since there is no need to pop
11942 the arguments there.
11943
11944 This calling convention is incompatible with the one normally
11945 used on Unix, so you cannot use it if you need to call libraries
11946 compiled with the Unix compiler.
11947
11948 Also, you must provide function prototypes for all functions that
11949 take variable numbers of arguments (including @code{printf});
11950 otherwise incorrect code will be generated for calls to those
11951 functions.
11952
11953 In addition, seriously incorrect code will result if you call a
11954 function with too many arguments.  (Normally, extra arguments are
11955 harmlessly ignored.)
11956
11957 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
11958 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
11959
11960 @item -mno-rtd
11961 @opindex mno-rtd
11962 Do not use the calling conventions selected by @option{-mrtd}.
11963 This is the default.
11964
11965 @item -malign-int
11966 @itemx -mno-align-int
11967 @opindex malign-int
11968 @opindex mno-align-int
11969 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
11970 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
11971 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
11972 Aligning variables on 32-bit boundaries produces code that runs somewhat
11973 faster on processors with 32-bit busses at the expense of more memory.
11974
11975 @strong{Warning:} if you use the @option{-malign-int} switch, GCC will
11976 align structures containing the above types  differently than
11977 most published application binary interface specifications for the m68k.
11978
11979 @item -mpcrel
11980 @opindex mpcrel
11981 Use the pc-relative addressing mode of the 68000 directly, instead of
11982 using a global offset table.  At present, this option implies @option{-fpic},
11983 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
11984 not presently supported with @option{-mpcrel}, though this could be supported for
11985 68020 and higher processors.
11986
11987 @item -mno-strict-align
11988 @itemx -mstrict-align
11989 @opindex mno-strict-align
11990 @opindex mstrict-align
11991 Do not (do) assume that unaligned memory references will be handled by
11992 the system.
11993
11994 @item -msep-data
11995 Generate code that allows the data segment to be located in a different
11996 area of memory from the text segment.  This allows for execute in place in
11997 an environment without virtual memory management.  This option implies
11998 @option{-fPIC}.
11999
12000 @item -mno-sep-data
12001 Generate code that assumes that the data segment follows the text segment.
12002 This is the default.
12003
12004 @item -mid-shared-library
12005 Generate code that supports shared libraries via the library ID method.
12006 This allows for execute in place and shared libraries in an environment
12007 without virtual memory management.  This option implies @option{-fPIC}.
12008
12009 @item -mno-id-shared-library
12010 Generate code that doesn't assume ID based shared libraries are being used.
12011 This is the default.
12012
12013 @item -mshared-library-id=n
12014 Specified the identification number of the ID based shared library being
12015 compiled.  Specifying a value of 0 will generate more compact code, specifying
12016 other values will force the allocation of that number to the current
12017 library but is no more space or time efficient than omitting this option.
12018
12019 @item -mxgot
12020 @itemx -mno-xgot
12021 @opindex mxgot
12022 @opindex mno-xgot
12023 When generating position-independent code for ColdFire, generate code
12024 that works if the GOT has more than 8192 entries.  This code is
12025 larger and slower than code generated without this option.  On M680x0
12026 processors, this option is not needed; @option{-fPIC} suffices.
12027
12028 GCC normally uses a single instruction to load values from the GOT@.
12029 While this is relatively efficient, it only works if the GOT
12030 is smaller than about 64k.  Anything larger causes the linker
12031 to report an error such as:
12032
12033 @cindex relocation truncated to fit (ColdFire)
12034 @smallexample
12035 relocation truncated to fit: R_68K_GOT16O foobar
12036 @end smallexample
12037
12038 If this happens, you should recompile your code with @option{-mxgot}.
12039 It should then work with very large GOTs.  However, code generated with
12040 @option{-mxgot} is less efficient, since it takes 4 instructions to fetch
12041 the value of a global symbol.
12042
12043 Note that some linkers, including newer versions of the GNU linker,
12044 can create multiple GOTs and sort GOT entries.  If you have such a linker,
12045 you should only need to use @option{-mxgot} when compiling a single
12046 object file that accesses more than 8192 GOT entries.  Very few do.
12047
12048 These options have no effect unless GCC is generating
12049 position-independent code.
12050
12051 @end table
12052
12053 @node M68hc1x Options
12054 @subsection M68hc1x Options
12055 @cindex M68hc1x options
12056
12057 These are the @samp{-m} options defined for the 68hc11 and 68hc12
12058 microcontrollers.  The default values for these options depends on
12059 which style of microcontroller was selected when the compiler was configured;
12060 the defaults for the most common choices are given below.
12061
12062 @table @gcctabopt
12063 @item -m6811
12064 @itemx -m68hc11
12065 @opindex m6811
12066 @opindex m68hc11
12067 Generate output for a 68HC11.  This is the default
12068 when the compiler is configured for 68HC11-based systems.
12069
12070 @item -m6812
12071 @itemx -m68hc12
12072 @opindex m6812
12073 @opindex m68hc12
12074 Generate output for a 68HC12.  This is the default
12075 when the compiler is configured for 68HC12-based systems.
12076
12077 @item -m68S12
12078 @itemx -m68hcs12
12079 @opindex m68S12
12080 @opindex m68hcs12
12081 Generate output for a 68HCS12.
12082
12083 @item -mauto-incdec
12084 @opindex mauto-incdec
12085 Enable the use of 68HC12 pre and post auto-increment and auto-decrement
12086 addressing modes.
12087
12088 @item -minmax
12089 @itemx -nominmax
12090 @opindex minmax
12091 @opindex mnominmax
12092 Enable the use of 68HC12 min and max instructions.
12093
12094 @item -mlong-calls
12095 @itemx -mno-long-calls
12096 @opindex mlong-calls
12097 @opindex mno-long-calls
12098 Treat all calls as being far away (near).  If calls are assumed to be
12099 far away, the compiler will use the @code{call} instruction to
12100 call a function and the @code{rtc} instruction for returning.
12101
12102 @item -mshort
12103 @opindex mshort
12104 Consider type @code{int} to be 16 bits wide, like @code{short int}.
12105
12106 @item -msoft-reg-count=@var{count}
12107 @opindex msoft-reg-count
12108 Specify the number of pseudo-soft registers which are used for the
12109 code generation.  The maximum number is 32.  Using more pseudo-soft
12110 register may or may not result in better code depending on the program.
12111 The default is 4 for 68HC11 and 2 for 68HC12.
12112
12113 @end table
12114
12115 @node MCore Options
12116 @subsection MCore Options
12117 @cindex MCore options
12118
12119 These are the @samp{-m} options defined for the Motorola M*Core
12120 processors.
12121
12122 @table @gcctabopt
12123
12124 @item -mhardlit
12125 @itemx -mno-hardlit
12126 @opindex mhardlit
12127 @opindex mno-hardlit
12128 Inline constants into the code stream if it can be done in two
12129 instructions or less.
12130
12131 @item -mdiv
12132 @itemx -mno-div
12133 @opindex mdiv
12134 @opindex mno-div
12135 Use the divide instruction.  (Enabled by default).
12136
12137 @item -mrelax-immediate
12138 @itemx -mno-relax-immediate
12139 @opindex mrelax-immediate
12140 @opindex mno-relax-immediate
12141 Allow arbitrary sized immediates in bit operations.
12142
12143 @item -mwide-bitfields
12144 @itemx -mno-wide-bitfields
12145 @opindex mwide-bitfields
12146 @opindex mno-wide-bitfields
12147 Always treat bit-fields as int-sized.
12148
12149 @item -m4byte-functions
12150 @itemx -mno-4byte-functions
12151 @opindex m4byte-functions
12152 @opindex mno-4byte-functions
12153 Force all functions to be aligned to a four byte boundary.
12154
12155 @item -mcallgraph-data
12156 @itemx -mno-callgraph-data
12157 @opindex mcallgraph-data
12158 @opindex mno-callgraph-data
12159 Emit callgraph information.
12160
12161 @item -mslow-bytes
12162 @itemx -mno-slow-bytes
12163 @opindex mslow-bytes
12164 @opindex mno-slow-bytes
12165 Prefer word access when reading byte quantities.
12166
12167 @item -mlittle-endian
12168 @itemx -mbig-endian
12169 @opindex mlittle-endian
12170 @opindex mbig-endian
12171 Generate code for a little endian target.
12172
12173 @item -m210
12174 @itemx -m340
12175 @opindex m210
12176 @opindex m340
12177 Generate code for the 210 processor.
12178 @end table
12179
12180 @node MIPS Options
12181 @subsection MIPS Options
12182 @cindex MIPS options
12183
12184 @table @gcctabopt
12185
12186 @item -EB
12187 @opindex EB
12188 Generate big-endian code.
12189
12190 @item -EL
12191 @opindex EL
12192 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
12193 configurations.
12194
12195 @item -march=@var{arch}
12196 @opindex march
12197 Generate code that will run on @var{arch}, which can be the name of a
12198 generic MIPS ISA, or the name of a particular processor.
12199 The ISA names are:
12200 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
12201 @samp{mips32}, @samp{mips32r2}, @samp{mips64} and @samp{mips64r2}.
12202 The processor names are:
12203 @samp{4kc}, @samp{4km}, @samp{4kp}, @samp{4ksc},
12204 @samp{4kec}, @samp{4kem}, @samp{4kep}, @samp{4ksd},
12205 @samp{5kc}, @samp{5kf},
12206 @samp{20kc},
12207 @samp{24kc}, @samp{24kf2_1}, @samp{24kf1_1},
12208 @samp{24kec}, @samp{24kef2_1}, @samp{24kef1_1},
12209 @samp{34kc}, @samp{34kf2_1}, @samp{34kf1_1},
12210 @samp{74kc}, @samp{74kf2_1}, @samp{74kf1_1}, @samp{74kf3_2},
12211 @samp{loongson2e}, @samp{loongson2f},
12212 @samp{m4k},
12213 @samp{octeon},
12214 @samp{orion},
12215 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
12216 @samp{r4600}, @samp{r4650}, @samp{r6000}, @samp{r8000},
12217 @samp{rm7000}, @samp{rm9000},
12218 @samp{sb1},
12219 @samp{sr71000},
12220 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
12221 @samp{vr5000}, @samp{vr5400}, @samp{vr5500}
12222 and @samp{xlr}.
12223 The special value @samp{from-abi} selects the
12224 most compatible architecture for the selected ABI (that is,
12225 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
12226
12227 Native Linux/GNU toolchains also support the value @samp{native},
12228 which selects the best architecture option for the host processor.
12229 @option{-march=native} has no effect if GCC does not recognize
12230 the processor.
12231
12232 In processor names, a final @samp{000} can be abbreviated as @samp{k}
12233 (for example, @samp{-march=r2k}).  Prefixes are optional, and
12234 @samp{vr} may be written @samp{r}.
12235
12236 Names of the form @samp{@var{n}f2_1} refer to processors with
12237 FPUs clocked at half the rate of the core, names of the form
12238 @samp{@var{n}f1_1} refer to processors with FPUs clocked at the same
12239 rate as the core, and names of the form @samp{@var{n}f3_2} refer to
12240 processors with FPUs clocked a ratio of 3:2 with respect to the core.
12241 For compatibility reasons, @samp{@var{n}f} is accepted as a synonym
12242 for @samp{@var{n}f2_1} while @samp{@var{n}x} and @samp{@var{b}fx} are
12243 accepted as synonyms for @samp{@var{n}f1_1}.
12244
12245 GCC defines two macros based on the value of this option.  The first
12246 is @samp{_MIPS_ARCH}, which gives the name of target architecture, as
12247 a string.  The second has the form @samp{_MIPS_ARCH_@var{foo}},
12248 where @var{foo} is the capitalized value of @samp{_MIPS_ARCH}@.
12249 For example, @samp{-march=r2000} will set @samp{_MIPS_ARCH}
12250 to @samp{"r2000"} and define the macro @samp{_MIPS_ARCH_R2000}.
12251
12252 Note that the @samp{_MIPS_ARCH} macro uses the processor names given
12253 above.  In other words, it will have the full prefix and will not
12254 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
12255 the macro names the resolved architecture (either @samp{"mips1"} or
12256 @samp{"mips3"}).  It names the default architecture when no
12257 @option{-march} option is given.
12258
12259 @item -mtune=@var{arch}
12260 @opindex mtune
12261 Optimize for @var{arch}.  Among other things, this option controls
12262 the way instructions are scheduled, and the perceived cost of arithmetic
12263 operations.  The list of @var{arch} values is the same as for
12264 @option{-march}.
12265
12266 When this option is not used, GCC will optimize for the processor
12267 specified by @option{-march}.  By using @option{-march} and
12268 @option{-mtune} together, it is possible to generate code that will
12269 run on a family of processors, but optimize the code for one
12270 particular member of that family.
12271
12272 @samp{-mtune} defines the macros @samp{_MIPS_TUNE} and
12273 @samp{_MIPS_TUNE_@var{foo}}, which work in the same way as the
12274 @samp{-march} ones described above.
12275
12276 @item -mips1
12277 @opindex mips1
12278 Equivalent to @samp{-march=mips1}.
12279
12280 @item -mips2
12281 @opindex mips2
12282 Equivalent to @samp{-march=mips2}.
12283
12284 @item -mips3
12285 @opindex mips3
12286 Equivalent to @samp{-march=mips3}.
12287
12288 @item -mips4
12289 @opindex mips4
12290 Equivalent to @samp{-march=mips4}.
12291
12292 @item -mips32
12293 @opindex mips32
12294 Equivalent to @samp{-march=mips32}.
12295
12296 @item -mips32r2
12297 @opindex mips32r2
12298 Equivalent to @samp{-march=mips32r2}.
12299
12300 @item -mips64
12301 @opindex mips64
12302 Equivalent to @samp{-march=mips64}.
12303
12304 @item -mips64r2
12305 @opindex mips64r2
12306 Equivalent to @samp{-march=mips64r2}.
12307
12308 @item -mips16
12309 @itemx -mno-mips16
12310 @opindex mips16
12311 @opindex mno-mips16
12312 Generate (do not generate) MIPS16 code.  If GCC is targetting a
12313 MIPS32 or MIPS64 architecture, it will make use of the MIPS16e ASE@.
12314
12315 MIPS16 code generation can also be controlled on a per-function basis
12316 by means of @code{mips16} and @code{nomips16} attributes.  
12317 @xref{Function Attributes}, for more information.
12318
12319 @item -mflip-mips16
12320 @opindex mflip-mips16
12321 Generate MIPS16 code on alternating functions.  This option is provided
12322 for regression testing of mixed MIPS16/non-MIPS16 code generation, and is
12323 not intended for ordinary use in compiling user code.
12324
12325 @item -minterlink-mips16
12326 @itemx -mno-interlink-mips16
12327 @opindex minterlink-mips16
12328 @opindex mno-interlink-mips16
12329 Require (do not require) that non-MIPS16 code be link-compatible with
12330 MIPS16 code.
12331
12332 For example, non-MIPS16 code cannot jump directly to MIPS16 code;
12333 it must either use a call or an indirect jump.  @option{-minterlink-mips16}
12334 therefore disables direct jumps unless GCC knows that the target of the
12335 jump is not MIPS16.
12336
12337 @item -mabi=32
12338 @itemx -mabi=o64
12339 @itemx -mabi=n32
12340 @itemx -mabi=64
12341 @itemx -mabi=eabi
12342 @opindex mabi=32
12343 @opindex mabi=o64
12344 @opindex mabi=n32
12345 @opindex mabi=64
12346 @opindex mabi=eabi
12347 Generate code for the given ABI@.
12348
12349 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
12350 generates 64-bit code when you select a 64-bit architecture, but you
12351 can use @option{-mgp32} to get 32-bit code instead.
12352
12353 For information about the O64 ABI, see
12354 @w{@uref{http://gcc.gnu.org/projects/mipso64-abi.html}}.
12355
12356 GCC supports a variant of the o32 ABI in which floating-point registers
12357 are 64 rather than 32 bits wide.  You can select this combination with
12358 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @samp{mthc1}
12359 and @samp{mfhc1} instructions and is therefore only supported for
12360 MIPS32R2 processors.
12361
12362 The register assignments for arguments and return values remain the
12363 same, but each scalar value is passed in a single 64-bit register
12364 rather than a pair of 32-bit registers.  For example, scalar
12365 floating-point values are returned in @samp{$f0} only, not a
12366 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
12367 remains the same, but all 64 bits are saved.
12368
12369 @item -mabicalls
12370 @itemx -mno-abicalls
12371 @opindex mabicalls
12372 @opindex mno-abicalls
12373 Generate (do not generate) code that is suitable for SVR4-style
12374 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
12375 systems.
12376
12377 @item -mshared
12378 @itemx -mno-shared
12379 Generate (do not generate) code that is fully position-independent,
12380 and that can therefore be linked into shared libraries.  This option
12381 only affects @option{-mabicalls}.
12382
12383 All @option{-mabicalls} code has traditionally been position-independent,
12384 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
12385 as an extension, the GNU toolchain allows executables to use absolute
12386 accesses for locally-binding symbols.  It can also use shorter GP
12387 initialization sequences and generate direct calls to locally-defined
12388 functions.  This mode is selected by @option{-mno-shared}.
12389
12390 @option{-mno-shared} depends on binutils 2.16 or higher and generates
12391 objects that can only be linked by the GNU linker.  However, the option
12392 does not affect the ABI of the final executable; it only affects the ABI
12393 of relocatable objects.  Using @option{-mno-shared} will generally make
12394 executables both smaller and quicker.
12395
12396 @option{-mshared} is the default.
12397
12398 @item -mplt
12399 @itemx -mno-plt
12400 @opindex mplt
12401 @opindex mno-plt
12402 Assume (do not assume) that the static and dynamic linkers
12403 support PLTs and copy relocations.  This option only affects
12404 @samp{-mno-shared -mabicalls}.  For the n64 ABI, this option
12405 has no effect without @samp{-msym32}.
12406
12407 You can make @option{-mplt} the default by configuring
12408 GCC with @option{--with-mips-plt}.  The default is
12409 @option{-mno-plt} otherwise.
12410
12411 @item -mxgot
12412 @itemx -mno-xgot
12413 @opindex mxgot
12414 @opindex mno-xgot
12415 Lift (do not lift) the usual restrictions on the size of the global
12416 offset table.
12417
12418 GCC normally uses a single instruction to load values from the GOT@.
12419 While this is relatively efficient, it will only work if the GOT
12420 is smaller than about 64k.  Anything larger will cause the linker
12421 to report an error such as:
12422
12423 @cindex relocation truncated to fit (MIPS)
12424 @smallexample
12425 relocation truncated to fit: R_MIPS_GOT16 foobar
12426 @end smallexample
12427
12428 If this happens, you should recompile your code with @option{-mxgot}.
12429 It should then work with very large GOTs, although it will also be
12430 less efficient, since it will take three instructions to fetch the
12431 value of a global symbol.
12432
12433 Note that some linkers can create multiple GOTs.  If you have such a
12434 linker, you should only need to use @option{-mxgot} when a single object
12435 file accesses more than 64k's worth of GOT entries.  Very few do.
12436
12437 These options have no effect unless GCC is generating position
12438 independent code.
12439
12440 @item -mgp32
12441 @opindex mgp32
12442 Assume that general-purpose registers are 32 bits wide.
12443
12444 @item -mgp64
12445 @opindex mgp64
12446 Assume that general-purpose registers are 64 bits wide.
12447
12448 @item -mfp32
12449 @opindex mfp32
12450 Assume that floating-point registers are 32 bits wide.
12451
12452 @item -mfp64
12453 @opindex mfp64
12454 Assume that floating-point registers are 64 bits wide.
12455
12456 @item -mhard-float
12457 @opindex mhard-float
12458 Use floating-point coprocessor instructions.
12459
12460 @item -msoft-float
12461 @opindex msoft-float
12462 Do not use floating-point coprocessor instructions.  Implement
12463 floating-point calculations using library calls instead.
12464
12465 @item -msingle-float
12466 @opindex msingle-float
12467 Assume that the floating-point coprocessor only supports single-precision
12468 operations.
12469
12470 @item -mdouble-float
12471 @opindex mdouble-float
12472 Assume that the floating-point coprocessor supports double-precision
12473 operations.  This is the default.
12474
12475 @item -mllsc
12476 @itemx -mno-llsc
12477 @opindex mllsc
12478 @opindex mno-llsc
12479 Use (do not use) @samp{ll}, @samp{sc}, and @samp{sync} instructions to
12480 implement atomic memory built-in functions.  When neither option is
12481 specified, GCC will use the instructions if the target architecture
12482 supports them.
12483
12484 @option{-mllsc} is useful if the runtime environment can emulate the
12485 instructions and @option{-mno-llsc} can be useful when compiling for
12486 nonstandard ISAs.  You can make either option the default by
12487 configuring GCC with @option{--with-llsc} and @option{--without-llsc}
12488 respectively.  @option{--with-llsc} is the default for some
12489 configurations; see the installation documentation for details.
12490
12491 @item -mdsp
12492 @itemx -mno-dsp
12493 @opindex mdsp
12494 @opindex mno-dsp
12495 Use (do not use) revision 1 of the MIPS DSP ASE@.
12496 @xref{MIPS DSP Built-in Functions}.  This option defines the
12497 preprocessor macro @samp{__mips_dsp}.  It also defines
12498 @samp{__mips_dsp_rev} to 1.
12499
12500 @item -mdspr2
12501 @itemx -mno-dspr2
12502 @opindex mdspr2
12503 @opindex mno-dspr2
12504 Use (do not use) revision 2 of the MIPS DSP ASE@.
12505 @xref{MIPS DSP Built-in Functions}.  This option defines the
12506 preprocessor macros @samp{__mips_dsp} and @samp{__mips_dspr2}.
12507 It also defines @samp{__mips_dsp_rev} to 2.
12508
12509 @item -msmartmips
12510 @itemx -mno-smartmips
12511 @opindex msmartmips
12512 @opindex mno-smartmips
12513 Use (do not use) the MIPS SmartMIPS ASE.
12514
12515 @item -mpaired-single
12516 @itemx -mno-paired-single
12517 @opindex mpaired-single
12518 @opindex mno-paired-single
12519 Use (do not use) paired-single floating-point instructions.
12520 @xref{MIPS Paired-Single Support}.  This option requires
12521 hardware floating-point support to be enabled.
12522
12523 @item -mdmx
12524 @itemx -mno-mdmx
12525 @opindex mdmx
12526 @opindex mno-mdmx
12527 Use (do not use) MIPS Digital Media Extension instructions.
12528 This option can only be used when generating 64-bit code and requires
12529 hardware floating-point support to be enabled.
12530
12531 @item -mips3d
12532 @itemx -mno-mips3d
12533 @opindex mips3d
12534 @opindex mno-mips3d
12535 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
12536 The option @option{-mips3d} implies @option{-mpaired-single}.
12537
12538 @item -mmt
12539 @itemx -mno-mt
12540 @opindex mmt
12541 @opindex mno-mt
12542 Use (do not use) MT Multithreading instructions.
12543
12544 @item -mlong64
12545 @opindex mlong64
12546 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
12547 an explanation of the default and the way that the pointer size is
12548 determined.
12549
12550 @item -mlong32
12551 @opindex mlong32
12552 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
12553
12554 The default size of @code{int}s, @code{long}s and pointers depends on
12555 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
12556 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
12557 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
12558 or the same size as integer registers, whichever is smaller.
12559
12560 @item -msym32
12561 @itemx -mno-sym32
12562 @opindex msym32
12563 @opindex mno-sym32
12564 Assume (do not assume) that all symbols have 32-bit values, regardless
12565 of the selected ABI@.  This option is useful in combination with
12566 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
12567 to generate shorter and faster references to symbolic addresses.
12568
12569 @item -G @var{num}
12570 @opindex G
12571 Put definitions of externally-visible data in a small data section
12572 if that data is no bigger than @var{num} bytes.  GCC can then access
12573 the data more efficiently; see @option{-mgpopt} for details.
12574
12575 The default @option{-G} option depends on the configuration.
12576
12577 @item -mlocal-sdata
12578 @itemx -mno-local-sdata
12579 @opindex mlocal-sdata
12580 @opindex mno-local-sdata
12581 Extend (do not extend) the @option{-G} behavior to local data too,
12582 such as to static variables in C@.  @option{-mlocal-sdata} is the
12583 default for all configurations.
12584
12585 If the linker complains that an application is using too much small data,
12586 you might want to try rebuilding the less performance-critical parts with
12587 @option{-mno-local-sdata}.  You might also want to build large
12588 libraries with @option{-mno-local-sdata}, so that the libraries leave
12589 more room for the main program.
12590
12591 @item -mextern-sdata
12592 @itemx -mno-extern-sdata
12593 @opindex mextern-sdata
12594 @opindex mno-extern-sdata
12595 Assume (do not assume) that externally-defined data will be in
12596 a small data section if that data is within the @option{-G} limit.
12597 @option{-mextern-sdata} is the default for all configurations.
12598
12599 If you compile a module @var{Mod} with @option{-mextern-sdata} @option{-G
12600 @var{num}} @option{-mgpopt}, and @var{Mod} references a variable @var{Var}
12601 that is no bigger than @var{num} bytes, you must make sure that @var{Var}
12602 is placed in a small data section.  If @var{Var} is defined by another
12603 module, you must either compile that module with a high-enough
12604 @option{-G} setting or attach a @code{section} attribute to @var{Var}'s
12605 definition.  If @var{Var} is common, you must link the application
12606 with a high-enough @option{-G} setting.
12607
12608 The easiest way of satisfying these restrictions is to compile
12609 and link every module with the same @option{-G} option.  However,
12610 you may wish to build a library that supports several different
12611 small data limits.  You can do this by compiling the library with
12612 the highest supported @option{-G} setting and additionally using
12613 @option{-mno-extern-sdata} to stop the library from making assumptions
12614 about externally-defined data.
12615
12616 @item -mgpopt
12617 @itemx -mno-gpopt
12618 @opindex mgpopt
12619 @opindex mno-gpopt
12620 Use (do not use) GP-relative accesses for symbols that are known to be
12621 in a small data section; see @option{-G}, @option{-mlocal-sdata} and
12622 @option{-mextern-sdata}.  @option{-mgpopt} is the default for all
12623 configurations.
12624
12625 @option{-mno-gpopt} is useful for cases where the @code{$gp} register
12626 might not hold the value of @code{_gp}.  For example, if the code is
12627 part of a library that might be used in a boot monitor, programs that
12628 call boot monitor routines will pass an unknown value in @code{$gp}.
12629 (In such situations, the boot monitor itself would usually be compiled
12630 with @option{-G0}.)
12631
12632 @option{-mno-gpopt} implies @option{-mno-local-sdata} and
12633 @option{-mno-extern-sdata}.
12634
12635 @item -membedded-data
12636 @itemx -mno-embedded-data
12637 @opindex membedded-data
12638 @opindex mno-embedded-data
12639 Allocate variables to the read-only data section first if possible, then
12640 next in the small data section if possible, otherwise in data.  This gives
12641 slightly slower code than the default, but reduces the amount of RAM required
12642 when executing, and thus may be preferred for some embedded systems.
12643
12644 @item -muninit-const-in-rodata
12645 @itemx -mno-uninit-const-in-rodata
12646 @opindex muninit-const-in-rodata
12647 @opindex mno-uninit-const-in-rodata
12648 Put uninitialized @code{const} variables in the read-only data section.
12649 This option is only meaningful in conjunction with @option{-membedded-data}.
12650
12651 @item -mcode-readable=@var{setting}
12652 @opindex mcode-readable
12653 Specify whether GCC may generate code that reads from executable sections.
12654 There are three possible settings:
12655
12656 @table @gcctabopt
12657 @item -mcode-readable=yes
12658 Instructions may freely access executable sections.  This is the
12659 default setting.
12660
12661 @item -mcode-readable=pcrel
12662 MIPS16 PC-relative load instructions can access executable sections,
12663 but other instructions must not do so.  This option is useful on 4KSc
12664 and 4KSd processors when the code TLBs have the Read Inhibit bit set.
12665 It is also useful on processors that can be configured to have a dual
12666 instruction/data SRAM interface and that, like the M4K, automatically
12667 redirect PC-relative loads to the instruction RAM.
12668
12669 @item -mcode-readable=no
12670 Instructions must not access executable sections.  This option can be
12671 useful on targets that are configured to have a dual instruction/data
12672 SRAM interface but that (unlike the M4K) do not automatically redirect
12673 PC-relative loads to the instruction RAM.
12674 @end table
12675
12676 @item -msplit-addresses
12677 @itemx -mno-split-addresses
12678 @opindex msplit-addresses
12679 @opindex mno-split-addresses
12680 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
12681 relocation operators.  This option has been superseded by
12682 @option{-mexplicit-relocs} but is retained for backwards compatibility.
12683
12684 @item -mexplicit-relocs
12685 @itemx -mno-explicit-relocs
12686 @opindex mexplicit-relocs
12687 @opindex mno-explicit-relocs
12688 Use (do not use) assembler relocation operators when dealing with symbolic
12689 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
12690 is to use assembler macros instead.
12691
12692 @option{-mexplicit-relocs} is the default if GCC was configured
12693 to use an assembler that supports relocation operators.
12694
12695 @item -mcheck-zero-division
12696 @itemx -mno-check-zero-division
12697 @opindex mcheck-zero-division
12698 @opindex mno-check-zero-division
12699 Trap (do not trap) on integer division by zero.
12700
12701 The default is @option{-mcheck-zero-division}.
12702
12703 @item -mdivide-traps
12704 @itemx -mdivide-breaks
12705 @opindex mdivide-traps
12706 @opindex mdivide-breaks
12707 MIPS systems check for division by zero by generating either a
12708 conditional trap or a break instruction.  Using traps results in
12709 smaller code, but is only supported on MIPS II and later.  Also, some
12710 versions of the Linux kernel have a bug that prevents trap from
12711 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
12712 allow conditional traps on architectures that support them and
12713 @option{-mdivide-breaks} to force the use of breaks.
12714
12715 The default is usually @option{-mdivide-traps}, but this can be
12716 overridden at configure time using @option{--with-divide=breaks}.
12717 Divide-by-zero checks can be completely disabled using
12718 @option{-mno-check-zero-division}.
12719
12720 @item -mmemcpy
12721 @itemx -mno-memcpy
12722 @opindex mmemcpy
12723 @opindex mno-memcpy
12724 Force (do not force) the use of @code{memcpy()} for non-trivial block
12725 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
12726 most constant-sized copies.
12727
12728 @item -mlong-calls
12729 @itemx -mno-long-calls
12730 @opindex mlong-calls
12731 @opindex mno-long-calls
12732 Disable (do not disable) use of the @code{jal} instruction.  Calling
12733 functions using @code{jal} is more efficient but requires the caller
12734 and callee to be in the same 256 megabyte segment.
12735
12736 This option has no effect on abicalls code.  The default is
12737 @option{-mno-long-calls}.
12738
12739 @item -mmad
12740 @itemx -mno-mad
12741 @opindex mmad
12742 @opindex mno-mad
12743 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
12744 instructions, as provided by the R4650 ISA@.
12745
12746 @item -mfused-madd
12747 @itemx -mno-fused-madd
12748 @opindex mfused-madd
12749 @opindex mno-fused-madd
12750 Enable (disable) use of the floating point multiply-accumulate
12751 instructions, when they are available.  The default is
12752 @option{-mfused-madd}.
12753
12754 When multiply-accumulate instructions are used, the intermediate
12755 product is calculated to infinite precision and is not subject to
12756 the FCSR Flush to Zero bit.  This may be undesirable in some
12757 circumstances.
12758
12759 @item -nocpp
12760 @opindex nocpp
12761 Tell the MIPS assembler to not run its preprocessor over user
12762 assembler files (with a @samp{.s} suffix) when assembling them.
12763
12764 @item -mfix-r4000
12765 @itemx -mno-fix-r4000
12766 @opindex mfix-r4000
12767 @opindex mno-fix-r4000
12768 Work around certain R4000 CPU errata:
12769 @itemize @minus
12770 @item
12771 A double-word or a variable shift may give an incorrect result if executed
12772 immediately after starting an integer division.
12773 @item
12774 A double-word or a variable shift may give an incorrect result if executed
12775 while an integer multiplication is in progress.
12776 @item
12777 An integer division may give an incorrect result if started in a delay slot
12778 of a taken branch or a jump.
12779 @end itemize
12780
12781 @item -mfix-r4400
12782 @itemx -mno-fix-r4400
12783 @opindex mfix-r4400
12784 @opindex mno-fix-r4400
12785 Work around certain R4400 CPU errata:
12786 @itemize @minus
12787 @item
12788 A double-word or a variable shift may give an incorrect result if executed
12789 immediately after starting an integer division.
12790 @end itemize
12791
12792 @item -mfix-vr4120
12793 @itemx -mno-fix-vr4120
12794 @opindex mfix-vr4120
12795 Work around certain VR4120 errata:
12796 @itemize @minus
12797 @item
12798 @code{dmultu} does not always produce the correct result.
12799 @item
12800 @code{div} and @code{ddiv} do not always produce the correct result if one
12801 of the operands is negative.
12802 @end itemize
12803 The workarounds for the division errata rely on special functions in
12804 @file{libgcc.a}.  At present, these functions are only provided by
12805 the @code{mips64vr*-elf} configurations.
12806
12807 Other VR4120 errata require a nop to be inserted between certain pairs of
12808 instructions.  These errata are handled by the assembler, not by GCC itself.
12809
12810 @item -mfix-vr4130
12811 @opindex mfix-vr4130
12812 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
12813 workarounds are implemented by the assembler rather than by GCC,
12814 although GCC will avoid using @code{mflo} and @code{mfhi} if the
12815 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
12816 instructions are available instead.
12817
12818 @item -mfix-sb1
12819 @itemx -mno-fix-sb1
12820 @opindex mfix-sb1
12821 Work around certain SB-1 CPU core errata.
12822 (This flag currently works around the SB-1 revision 2
12823 ``F1'' and ``F2'' floating point errata.)
12824
12825 @item -mr10k-cache-barrier=@var{setting}
12826 @opindex mr10k-cache-barrier
12827 Specify whether GCC should insert cache barriers to avoid the
12828 side-effects of speculation on R10K processors.
12829
12830 In common with many processors, the R10K tries to predict the outcome
12831 of a conditional branch and speculatively executes instructions from
12832 the ``taken'' branch.  It later aborts these instructions if the
12833 predicted outcome was wrong.  However, on the R10K, even aborted
12834 instructions can have side effects.
12835
12836 This problem only affects kernel stores and, depending on the system,
12837 kernel loads.  As an example, a speculatively-executed store may load
12838 the target memory into cache and mark the cache line as dirty, even if
12839 the store itself is later aborted.  If a DMA operation writes to the
12840 same area of memory before the ``dirty'' line is flushed, the cached
12841 data will overwrite the DMA-ed data.  See the R10K processor manual
12842 for a full description, including other potential problems.
12843
12844 One workaround is to insert cache barrier instructions before every memory
12845 access that might be speculatively executed and that might have side
12846 effects even if aborted.  @option{-mr10k-cache-barrier=@var{setting}}
12847 controls GCC's implementation of this workaround.  It assumes that
12848 aborted accesses to any byte in the following regions will not have
12849 side effects:
12850
12851 @enumerate
12852 @item
12853 the memory occupied by the current function's stack frame;
12854
12855 @item
12856 the memory occupied by an incoming stack argument;
12857
12858 @item
12859 the memory occupied by an object with a link-time-constant address.
12860 @end enumerate
12861
12862 It is the kernel's responsibility to ensure that speculative
12863 accesses to these regions are indeed safe.
12864
12865 If the input program contains a function declaration such as:
12866
12867 @smallexample
12868 void foo (void);
12869 @end smallexample
12870
12871 then the implementation of @code{foo} must allow @code{j foo} and
12872 @code{jal foo} to be executed speculatively.  GCC honors this
12873 restriction for functions it compiles itself.  It expects non-GCC
12874 functions (such as hand-written assembly code) to do the same.
12875
12876 The option has three forms:
12877
12878 @table @gcctabopt
12879 @item -mr10k-cache-barrier=load-store
12880 Insert a cache barrier before a load or store that might be
12881 speculatively executed and that might have side effects even
12882 if aborted.
12883
12884 @item -mr10k-cache-barrier=store
12885 Insert a cache barrier before a store that might be speculatively
12886 executed and that might have side effects even if aborted.
12887
12888 @item -mr10k-cache-barrier=none
12889 Disable the insertion of cache barriers.  This is the default setting.
12890 @end table
12891
12892 @item -mflush-func=@var{func}
12893 @itemx -mno-flush-func
12894 @opindex mflush-func
12895 Specifies the function to call to flush the I and D caches, or to not
12896 call any such function.  If called, the function must take the same
12897 arguments as the common @code{_flush_func()}, that is, the address of the
12898 memory range for which the cache is being flushed, the size of the
12899 memory range, and the number 3 (to flush both caches).  The default
12900 depends on the target GCC was configured for, but commonly is either
12901 @samp{_flush_func} or @samp{__cpu_flush}.
12902
12903 @item mbranch-cost=@var{num}
12904 @opindex mbranch-cost
12905 Set the cost of branches to roughly @var{num} ``simple'' instructions.
12906 This cost is only a heuristic and is not guaranteed to produce
12907 consistent results across releases.  A zero cost redundantly selects
12908 the default, which is based on the @option{-mtune} setting.
12909
12910 @item -mbranch-likely
12911 @itemx -mno-branch-likely
12912 @opindex mbranch-likely
12913 @opindex mno-branch-likely
12914 Enable or disable use of Branch Likely instructions, regardless of the
12915 default for the selected architecture.  By default, Branch Likely
12916 instructions may be generated if they are supported by the selected
12917 architecture.  An exception is for the MIPS32 and MIPS64 architectures
12918 and processors which implement those architectures; for those, Branch
12919 Likely instructions will not be generated by default because the MIPS32
12920 and MIPS64 architectures specifically deprecate their use.
12921
12922 @item -mfp-exceptions
12923 @itemx -mno-fp-exceptions
12924 @opindex mfp-exceptions
12925 Specifies whether FP exceptions are enabled.  This affects how we schedule
12926 FP instructions for some processors.  The default is that FP exceptions are
12927 enabled.
12928
12929 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
12930 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
12931 FP pipe.
12932
12933 @item -mvr4130-align
12934 @itemx -mno-vr4130-align
12935 @opindex mvr4130-align
12936 The VR4130 pipeline is two-way superscalar, but can only issue two
12937 instructions together if the first one is 8-byte aligned.  When this
12938 option is enabled, GCC will align pairs of instructions that it
12939 thinks should execute in parallel.
12940
12941 This option only has an effect when optimizing for the VR4130.
12942 It normally makes code faster, but at the expense of making it bigger.
12943 It is enabled by default at optimization level @option{-O3}.
12944 @end table
12945
12946 @node MMIX Options
12947 @subsection MMIX Options
12948 @cindex MMIX Options
12949
12950 These options are defined for the MMIX:
12951
12952 @table @gcctabopt
12953 @item -mlibfuncs
12954 @itemx -mno-libfuncs
12955 @opindex mlibfuncs
12956 @opindex mno-libfuncs
12957 Specify that intrinsic library functions are being compiled, passing all
12958 values in registers, no matter the size.
12959
12960 @item -mepsilon
12961 @itemx -mno-epsilon
12962 @opindex mepsilon
12963 @opindex mno-epsilon
12964 Generate floating-point comparison instructions that compare with respect
12965 to the @code{rE} epsilon register.
12966
12967 @item -mabi=mmixware
12968 @itemx -mabi=gnu
12969 @opindex mabi-mmixware
12970 @opindex mabi=gnu
12971 Generate code that passes function parameters and return values that (in
12972 the called function) are seen as registers @code{$0} and up, as opposed to
12973 the GNU ABI which uses global registers @code{$231} and up.
12974
12975 @item -mzero-extend
12976 @itemx -mno-zero-extend
12977 @opindex mzero-extend
12978 @opindex mno-zero-extend
12979 When reading data from memory in sizes shorter than 64 bits, use (do not
12980 use) zero-extending load instructions by default, rather than
12981 sign-extending ones.
12982
12983 @item -mknuthdiv
12984 @itemx -mno-knuthdiv
12985 @opindex mknuthdiv
12986 @opindex mno-knuthdiv
12987 Make the result of a division yielding a remainder have the same sign as
12988 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
12989 remainder follows the sign of the dividend.  Both methods are
12990 arithmetically valid, the latter being almost exclusively used.
12991
12992 @item -mtoplevel-symbols
12993 @itemx -mno-toplevel-symbols
12994 @opindex mtoplevel-symbols
12995 @opindex mno-toplevel-symbols
12996 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
12997 code can be used with the @code{PREFIX} assembly directive.
12998
12999 @item -melf
13000 @opindex melf
13001 Generate an executable in the ELF format, rather than the default
13002 @samp{mmo} format used by the @command{mmix} simulator.
13003
13004 @item -mbranch-predict
13005 @itemx -mno-branch-predict
13006 @opindex mbranch-predict
13007 @opindex mno-branch-predict
13008 Use (do not use) the probable-branch instructions, when static branch
13009 prediction indicates a probable branch.
13010
13011 @item -mbase-addresses
13012 @itemx -mno-base-addresses
13013 @opindex mbase-addresses
13014 @opindex mno-base-addresses
13015 Generate (do not generate) code that uses @emph{base addresses}.  Using a
13016 base address automatically generates a request (handled by the assembler
13017 and the linker) for a constant to be set up in a global register.  The
13018 register is used for one or more base address requests within the range 0
13019 to 255 from the value held in the register.  The generally leads to short
13020 and fast code, but the number of different data items that can be
13021 addressed is limited.  This means that a program that uses lots of static
13022 data may require @option{-mno-base-addresses}.
13023
13024 @item -msingle-exit
13025 @itemx -mno-single-exit
13026 @opindex msingle-exit
13027 @opindex mno-single-exit
13028 Force (do not force) generated code to have a single exit point in each
13029 function.
13030 @end table
13031
13032 @node MN10300 Options
13033 @subsection MN10300 Options
13034 @cindex MN10300 options
13035
13036 These @option{-m} options are defined for Matsushita MN10300 architectures:
13037
13038 @table @gcctabopt
13039 @item -mmult-bug
13040 @opindex mmult-bug
13041 Generate code to avoid bugs in the multiply instructions for the MN10300
13042 processors.  This is the default.
13043
13044 @item -mno-mult-bug
13045 @opindex mno-mult-bug
13046 Do not generate code to avoid bugs in the multiply instructions for the
13047 MN10300 processors.
13048
13049 @item -mam33
13050 @opindex mam33
13051 Generate code which uses features specific to the AM33 processor.
13052
13053 @item -mno-am33
13054 @opindex mno-am33
13055 Do not generate code which uses features specific to the AM33 processor.  This
13056 is the default.
13057
13058 @item -mreturn-pointer-on-d0
13059 @opindex mreturn-pointer-on-d0
13060 When generating a function which returns a pointer, return the pointer
13061 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
13062 only in a0, and attempts to call such functions without a prototype
13063 would result in errors.  Note that this option is on by default; use
13064 @option{-mno-return-pointer-on-d0} to disable it.
13065
13066 @item -mno-crt0
13067 @opindex mno-crt0
13068 Do not link in the C run-time initialization object file.
13069
13070 @item -mrelax
13071 @opindex mrelax
13072 Indicate to the linker that it should perform a relaxation optimization pass
13073 to shorten branches, calls and absolute memory addresses.  This option only
13074 has an effect when used on the command line for the final link step.
13075
13076 This option makes symbolic debugging impossible.
13077 @end table
13078
13079 @node PDP-11 Options
13080 @subsection PDP-11 Options
13081 @cindex PDP-11 Options
13082
13083 These options are defined for the PDP-11:
13084
13085 @table @gcctabopt
13086 @item -mfpu
13087 @opindex mfpu
13088 Use hardware FPP floating point.  This is the default.  (FIS floating
13089 point on the PDP-11/40 is not supported.)
13090
13091 @item -msoft-float
13092 @opindex msoft-float
13093 Do not use hardware floating point.
13094
13095 @item -mac0
13096 @opindex mac0
13097 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
13098
13099 @item -mno-ac0
13100 @opindex mno-ac0
13101 Return floating-point results in memory.  This is the default.
13102
13103 @item -m40
13104 @opindex m40
13105 Generate code for a PDP-11/40.
13106
13107 @item -m45
13108 @opindex m45
13109 Generate code for a PDP-11/45.  This is the default.
13110
13111 @item -m10
13112 @opindex m10
13113 Generate code for a PDP-11/10.
13114
13115 @item -mbcopy-builtin
13116 @opindex bcopy-builtin
13117 Use inline @code{movmemhi} patterns for copying memory.  This is the
13118 default.
13119
13120 @item -mbcopy
13121 @opindex mbcopy
13122 Do not use inline @code{movmemhi} patterns for copying memory.
13123
13124 @item -mint16
13125 @itemx -mno-int32
13126 @opindex mint16
13127 @opindex mno-int32
13128 Use 16-bit @code{int}.  This is the default.
13129
13130 @item -mint32
13131 @itemx -mno-int16
13132 @opindex mint32
13133 @opindex mno-int16
13134 Use 32-bit @code{int}.
13135
13136 @item -mfloat64
13137 @itemx -mno-float32
13138 @opindex mfloat64
13139 @opindex mno-float32
13140 Use 64-bit @code{float}.  This is the default.
13141
13142 @item -mfloat32
13143 @itemx -mno-float64
13144 @opindex mfloat32
13145 @opindex mno-float64
13146 Use 32-bit @code{float}.
13147
13148 @item -mabshi
13149 @opindex mabshi
13150 Use @code{abshi2} pattern.  This is the default.
13151
13152 @item -mno-abshi
13153 @opindex mno-abshi
13154 Do not use @code{abshi2} pattern.
13155
13156 @item -mbranch-expensive
13157 @opindex mbranch-expensive
13158 Pretend that branches are expensive.  This is for experimenting with
13159 code generation only.
13160
13161 @item -mbranch-cheap
13162 @opindex mbranch-cheap
13163 Do not pretend that branches are expensive.  This is the default.
13164
13165 @item -msplit
13166 @opindex msplit
13167 Generate code for a system with split I&D@.
13168
13169 @item -mno-split
13170 @opindex mno-split
13171 Generate code for a system without split I&D@.  This is the default.
13172
13173 @item -munix-asm
13174 @opindex munix-asm
13175 Use Unix assembler syntax.  This is the default when configured for
13176 @samp{pdp11-*-bsd}.
13177
13178 @item -mdec-asm
13179 @opindex mdec-asm
13180 Use DEC assembler syntax.  This is the default when configured for any
13181 PDP-11 target other than @samp{pdp11-*-bsd}.
13182 @end table
13183
13184 @node picoChip Options
13185 @subsection picoChip Options
13186 @cindex picoChip options
13187
13188 These @samp{-m} options are defined for picoChip implementations:
13189
13190 @table @gcctabopt
13191
13192 @item -mae=@var{ae_type}
13193 @opindex mcpu
13194 Set the instruction set, register set, and instruction scheduling
13195 parameters for array element type @var{ae_type}.  Supported values
13196 for @var{ae_type} are @samp{ANY}, @samp{MUL}, and @samp{MAC}.
13197
13198 @option{-mae=ANY} selects a completely generic AE type.  Code
13199 generated with this option will run on any of the other AE types.  The
13200 code will not be as efficient as it would be if compiled for a specific
13201 AE type, and some types of operation (e.g., multiplication) will not
13202 work properly on all types of AE.
13203
13204 @option{-mae=MUL} selects a MUL AE type.  This is the most useful AE type
13205 for compiled code, and is the default.
13206
13207 @option{-mae=MAC} selects a DSP-style MAC AE.  Code compiled with this
13208 option may suffer from poor performance of byte (char) manipulation,
13209 since the DSP AE does not provide hardware support for byte load/stores.
13210
13211 @item -msymbol-as-address
13212 Enable the compiler to directly use a symbol name as an address in a
13213 load/store instruction, without first loading it into a
13214 register.  Typically, the use of this option will generate larger
13215 programs, which run faster than when the option isn't used.  However, the
13216 results vary from program to program, so it is left as a user option,
13217 rather than being permanently enabled.
13218
13219 @item -mno-inefficient-warnings
13220 Disables warnings about the generation of inefficient code.  These
13221 warnings can be generated, for example, when compiling code which
13222 performs byte-level memory operations on the MAC AE type.  The MAC AE has
13223 no hardware support for byte-level memory operations, so all byte
13224 load/stores must be synthesised from word load/store operations.  This is
13225 inefficient and a warning will be generated indicating to the programmer
13226 that they should rewrite the code to avoid byte operations, or to target
13227 an AE type which has the necessary hardware support.  This option enables
13228 the warning to be turned off.
13229
13230 @end table
13231
13232 @node PowerPC Options
13233 @subsection PowerPC Options
13234 @cindex PowerPC options
13235
13236 These are listed under @xref{RS/6000 and PowerPC Options}.
13237
13238 @node RS/6000 and PowerPC Options
13239 @subsection IBM RS/6000 and PowerPC Options
13240 @cindex RS/6000 and PowerPC Options
13241 @cindex IBM RS/6000 and PowerPC Options
13242
13243 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
13244 @table @gcctabopt
13245 @item -mpower
13246 @itemx -mno-power
13247 @itemx -mpower2
13248 @itemx -mno-power2
13249 @itemx -mpowerpc
13250 @itemx -mno-powerpc
13251 @itemx -mpowerpc-gpopt
13252 @itemx -mno-powerpc-gpopt
13253 @itemx -mpowerpc-gfxopt
13254 @itemx -mno-powerpc-gfxopt
13255 @itemx -mpowerpc64
13256 @itemx -mno-powerpc64
13257 @itemx -mmfcrf
13258 @itemx -mno-mfcrf
13259 @itemx -mpopcntb
13260 @itemx -mno-popcntb
13261 @itemx -mfprnd
13262 @itemx -mno-fprnd
13263 @itemx -mcmpb
13264 @itemx -mno-cmpb
13265 @itemx -mmfpgpr
13266 @itemx -mno-mfpgpr
13267 @itemx -mhard-dfp
13268 @itemx -mno-hard-dfp
13269 @opindex mpower
13270 @opindex mno-power
13271 @opindex mpower2
13272 @opindex mno-power2
13273 @opindex mpowerpc
13274 @opindex mno-powerpc
13275 @opindex mpowerpc-gpopt
13276 @opindex mno-powerpc-gpopt
13277 @opindex mpowerpc-gfxopt
13278 @opindex mno-powerpc-gfxopt
13279 @opindex mpowerpc64
13280 @opindex mno-powerpc64
13281 @opindex mmfcrf
13282 @opindex mno-mfcrf
13283 @opindex mpopcntb
13284 @opindex mno-popcntb
13285 @opindex mfprnd
13286 @opindex mno-fprnd
13287 @opindex mcmpb
13288 @opindex mno-cmpb
13289 @opindex mmfpgpr
13290 @opindex mno-mfpgpr
13291 @opindex mhard-dfp
13292 @opindex mno-hard-dfp
13293 GCC supports two related instruction set architectures for the
13294 RS/6000 and PowerPC@.  The @dfn{POWER} instruction set are those
13295 instructions supported by the @samp{rios} chip set used in the original
13296 RS/6000 systems and the @dfn{PowerPC} instruction set is the
13297 architecture of the Freescale MPC5xx, MPC6xx, MPC8xx microprocessors, and
13298 the IBM 4xx, 6xx, and follow-on microprocessors.
13299
13300 Neither architecture is a subset of the other.  However there is a
13301 large common subset of instructions supported by both.  An MQ
13302 register is included in processors supporting the POWER architecture.
13303
13304 You use these options to specify which instructions are available on the
13305 processor you are using.  The default value of these options is
13306 determined when configuring GCC@.  Specifying the
13307 @option{-mcpu=@var{cpu_type}} overrides the specification of these
13308 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
13309 rather than the options listed above.
13310
13311 The @option{-mpower} option allows GCC to generate instructions that
13312 are found only in the POWER architecture and to use the MQ register.
13313 Specifying @option{-mpower2} implies @option{-power} and also allows GCC
13314 to generate instructions that are present in the POWER2 architecture but
13315 not the original POWER architecture.
13316
13317 The @option{-mpowerpc} option allows GCC to generate instructions that
13318 are found only in the 32-bit subset of the PowerPC architecture.
13319 Specifying @option{-mpowerpc-gpopt} implies @option{-mpowerpc} and also allows
13320 GCC to use the optional PowerPC architecture instructions in the
13321 General Purpose group, including floating-point square root.  Specifying
13322 @option{-mpowerpc-gfxopt} implies @option{-mpowerpc} and also allows GCC to
13323 use the optional PowerPC architecture instructions in the Graphics
13324 group, including floating-point select.
13325
13326 The @option{-mmfcrf} option allows GCC to generate the move from
13327 condition register field instruction implemented on the POWER4
13328 processor and other processors that support the PowerPC V2.01
13329 architecture.
13330 The @option{-mpopcntb} option allows GCC to generate the popcount and
13331 double precision FP reciprocal estimate instruction implemented on the
13332 POWER5 processor and other processors that support the PowerPC V2.02
13333 architecture.
13334 The @option{-mfprnd} option allows GCC to generate the FP round to
13335 integer instructions implemented on the POWER5+ processor and other
13336 processors that support the PowerPC V2.03 architecture.
13337 The @option{-mcmpb} option allows GCC to generate the compare bytes
13338 instruction implemented on the POWER6 processor and other processors
13339 that support the PowerPC V2.05 architecture.
13340 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
13341 general purpose register instructions implemented on the POWER6X
13342 processor and other processors that support the extended PowerPC V2.05
13343 architecture.
13344 The @option{-mhard-dfp} option allows GCC to generate the decimal floating
13345 point instructions implemented on some POWER processors.
13346
13347 The @option{-mpowerpc64} option allows GCC to generate the additional
13348 64-bit instructions that are found in the full PowerPC64 architecture
13349 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
13350 @option{-mno-powerpc64}.
13351
13352 If you specify both @option{-mno-power} and @option{-mno-powerpc}, GCC
13353 will use only the instructions in the common subset of both
13354 architectures plus some special AIX common-mode calls, and will not use
13355 the MQ register.  Specifying both @option{-mpower} and @option{-mpowerpc}
13356 permits GCC to use any instruction from either architecture and to
13357 allow use of the MQ register; specify this for the Motorola MPC601.
13358
13359 @item -mnew-mnemonics
13360 @itemx -mold-mnemonics
13361 @opindex mnew-mnemonics
13362 @opindex mold-mnemonics
13363 Select which mnemonics to use in the generated assembler code.  With
13364 @option{-mnew-mnemonics}, GCC uses the assembler mnemonics defined for
13365 the PowerPC architecture.  With @option{-mold-mnemonics} it uses the
13366 assembler mnemonics defined for the POWER architecture.  Instructions
13367 defined in only one architecture have only one mnemonic; GCC uses that
13368 mnemonic irrespective of which of these options is specified.
13369
13370 GCC defaults to the mnemonics appropriate for the architecture in
13371 use.  Specifying @option{-mcpu=@var{cpu_type}} sometimes overrides the
13372 value of these option.  Unless you are building a cross-compiler, you
13373 should normally not specify either @option{-mnew-mnemonics} or
13374 @option{-mold-mnemonics}, but should instead accept the default.
13375
13376 @item -mcpu=@var{cpu_type}
13377 @opindex mcpu
13378 Set architecture type, register usage, choice of mnemonics, and
13379 instruction scheduling parameters for machine type @var{cpu_type}.
13380 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
13381 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{464}, @samp{464fp},
13382 @samp{505}, @samp{601}, @samp{602}, @samp{603}, @samp{603e}, @samp{604},
13383 @samp{604e}, @samp{620}, @samp{630}, @samp{740}, @samp{7400},
13384 @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
13385 @samp{860}, @samp{970}, @samp{8540}, @samp{e300c2}, @samp{e300c3},
13386 @samp{e500mc}, @samp{ec603e}, @samp{G3}, @samp{G4}, @samp{G5},
13387 @samp{power}, @samp{power2}, @samp{power3}, @samp{power4},
13388 @samp{power5}, @samp{power5+}, @samp{power6}, @samp{power6x}, @samp{power7}
13389 @samp{common}, @samp{powerpc}, @samp{powerpc64}, @samp{rios},
13390 @samp{rios1}, @samp{rios2}, @samp{rsc}, and @samp{rs64}.
13391
13392 @option{-mcpu=common} selects a completely generic processor.  Code
13393 generated under this option will run on any POWER or PowerPC processor.
13394 GCC will use only the instructions in the common subset of both
13395 architectures, and will not use the MQ register.  GCC assumes a generic
13396 processor model for scheduling purposes.
13397
13398 @option{-mcpu=power}, @option{-mcpu=power2}, @option{-mcpu=powerpc}, and
13399 @option{-mcpu=powerpc64} specify generic POWER, POWER2, pure 32-bit
13400 PowerPC (i.e., not MPC601), and 64-bit PowerPC architecture machine
13401 types, with an appropriate, generic processor model assumed for
13402 scheduling purposes.
13403
13404 The other options specify a specific processor.  Code generated under
13405 those options will run best on that processor, and may not run at all on
13406 others.
13407
13408 The @option{-mcpu} options automatically enable or disable the
13409 following options:
13410
13411 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
13412 -mnew-mnemonics  -mpopcntb  -mpower  -mpower2  -mpowerpc64 @gol
13413 -mpowerpc-gpopt  -mpowerpc-gfxopt  -mstring  -mmulhw  -mdlmzb  -mmfpgpr}
13414
13415 The particular options set for any particular CPU will vary between
13416 compiler versions, depending on what setting seems to produce optimal
13417 code for that CPU; it doesn't necessarily reflect the actual hardware's
13418 capabilities.  If you wish to set an individual option to a particular
13419 value, you may specify it after the @option{-mcpu} option, like
13420 @samp{-mcpu=970 -mno-altivec}.
13421
13422 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
13423 not enabled or disabled by the @option{-mcpu} option at present because
13424 AIX does not have full support for these options.  You may still
13425 enable or disable them individually if you're sure it'll work in your
13426 environment.
13427
13428 @item -mtune=@var{cpu_type}
13429 @opindex mtune
13430 Set the instruction scheduling parameters for machine type
13431 @var{cpu_type}, but do not set the architecture type, register usage, or
13432 choice of mnemonics, as @option{-mcpu=@var{cpu_type}} would.  The same
13433 values for @var{cpu_type} are used for @option{-mtune} as for
13434 @option{-mcpu}.  If both are specified, the code generated will use the
13435 architecture, registers, and mnemonics set by @option{-mcpu}, but the
13436 scheduling parameters set by @option{-mtune}.
13437
13438 @item -mswdiv
13439 @itemx -mno-swdiv
13440 @opindex mswdiv
13441 @opindex mno-swdiv
13442 Generate code to compute division as reciprocal estimate and iterative
13443 refinement, creating opportunities for increased throughput.  This
13444 feature requires: optional PowerPC Graphics instruction set for single
13445 precision and FRE instruction for double precision, assuming divides
13446 cannot generate user-visible traps, and the domain values not include
13447 Infinities, denormals or zero denominator.
13448
13449 @item -maltivec
13450 @itemx -mno-altivec
13451 @opindex maltivec
13452 @opindex mno-altivec
13453 Generate code that uses (does not use) AltiVec instructions, and also
13454 enable the use of built-in functions that allow more direct access to
13455 the AltiVec instruction set.  You may also need to set
13456 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
13457 enhancements.
13458
13459 @item -mvrsave
13460 @itemx -mno-vrsave
13461 @opindex mvrsave
13462 @opindex mno-vrsave
13463 Generate VRSAVE instructions when generating AltiVec code.
13464
13465 @item -msecure-plt
13466 @opindex msecure-plt
13467 Generate code that allows ld and ld.so to build executables and shared
13468 libraries with non-exec .plt and .got sections.  This is a PowerPC
13469 32-bit SYSV ABI option.
13470
13471 @item -mbss-plt
13472 @opindex mbss-plt
13473 Generate code that uses a BSS .plt section that ld.so fills in, and
13474 requires .plt and .got sections that are both writable and executable.
13475 This is a PowerPC 32-bit SYSV ABI option.
13476
13477 @item -misel
13478 @itemx -mno-isel
13479 @opindex misel
13480 @opindex mno-isel
13481 This switch enables or disables the generation of ISEL instructions.
13482
13483 @item -misel=@var{yes/no}
13484 This switch has been deprecated.  Use @option{-misel} and
13485 @option{-mno-isel} instead.
13486
13487 @item -mspe
13488 @itemx -mno-spe
13489 @opindex mspe
13490 @opindex mno-spe
13491 This switch enables or disables the generation of SPE simd
13492 instructions.
13493
13494 @item -mpaired
13495 @itemx -mno-paired
13496 @opindex mpaired
13497 @opindex mno-paired
13498 This switch enables or disables the generation of PAIRED simd
13499 instructions.
13500
13501 @item -mspe=@var{yes/no}
13502 This option has been deprecated.  Use @option{-mspe} and
13503 @option{-mno-spe} instead.
13504
13505 @item -mfloat-gprs=@var{yes/single/double/no}
13506 @itemx -mfloat-gprs
13507 @opindex mfloat-gprs
13508 This switch enables or disables the generation of floating point
13509 operations on the general purpose registers for architectures that
13510 support it.
13511
13512 The argument @var{yes} or @var{single} enables the use of
13513 single-precision floating point operations.
13514
13515 The argument @var{double} enables the use of single and
13516 double-precision floating point operations.
13517
13518 The argument @var{no} disables floating point operations on the
13519 general purpose registers.
13520
13521 This option is currently only available on the MPC854x.
13522
13523 @item -m32
13524 @itemx -m64
13525 @opindex m32
13526 @opindex m64
13527 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
13528 targets (including GNU/Linux).  The 32-bit environment sets int, long
13529 and pointer to 32 bits and generates code that runs on any PowerPC
13530 variant.  The 64-bit environment sets int to 32 bits and long and
13531 pointer to 64 bits, and generates code for PowerPC64, as for
13532 @option{-mpowerpc64}.
13533
13534 @item -mfull-toc
13535 @itemx -mno-fp-in-toc
13536 @itemx -mno-sum-in-toc
13537 @itemx -mminimal-toc
13538 @opindex mfull-toc
13539 @opindex mno-fp-in-toc
13540 @opindex mno-sum-in-toc
13541 @opindex mminimal-toc
13542 Modify generation of the TOC (Table Of Contents), which is created for
13543 every executable file.  The @option{-mfull-toc} option is selected by
13544 default.  In that case, GCC will allocate at least one TOC entry for
13545 each unique non-automatic variable reference in your program.  GCC
13546 will also place floating-point constants in the TOC@.  However, only
13547 16,384 entries are available in the TOC@.
13548
13549 If you receive a linker error message that saying you have overflowed
13550 the available TOC space, you can reduce the amount of TOC space used
13551 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
13552 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
13553 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
13554 generate code to calculate the sum of an address and a constant at
13555 run-time instead of putting that sum into the TOC@.  You may specify one
13556 or both of these options.  Each causes GCC to produce very slightly
13557 slower and larger code at the expense of conserving TOC space.
13558
13559 If you still run out of space in the TOC even when you specify both of
13560 these options, specify @option{-mminimal-toc} instead.  This option causes
13561 GCC to make only one TOC entry for every file.  When you specify this
13562 option, GCC will produce code that is slower and larger but which
13563 uses extremely little TOC space.  You may wish to use this option
13564 only on files that contain less frequently executed code.
13565
13566 @item -maix64
13567 @itemx -maix32
13568 @opindex maix64
13569 @opindex maix32
13570 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
13571 @code{long} type, and the infrastructure needed to support them.
13572 Specifying @option{-maix64} implies @option{-mpowerpc64} and
13573 @option{-mpowerpc}, while @option{-maix32} disables the 64-bit ABI and
13574 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
13575
13576 @item -mxl-compat
13577 @itemx -mno-xl-compat
13578 @opindex mxl-compat
13579 @opindex mno-xl-compat
13580 Produce code that conforms more closely to IBM XL compiler semantics
13581 when using AIX-compatible ABI@.  Pass floating-point arguments to
13582 prototyped functions beyond the register save area (RSA) on the stack
13583 in addition to argument FPRs.  Do not assume that most significant
13584 double in 128-bit long double value is properly rounded when comparing
13585 values and converting to double.  Use XL symbol names for long double
13586 support routines.
13587
13588 The AIX calling convention was extended but not initially documented to
13589 handle an obscure K&R C case of calling a function that takes the
13590 address of its arguments with fewer arguments than declared.  IBM XL
13591 compilers access floating point arguments which do not fit in the
13592 RSA from the stack when a subroutine is compiled without
13593 optimization.  Because always storing floating-point arguments on the
13594 stack is inefficient and rarely needed, this option is not enabled by
13595 default and only is necessary when calling subroutines compiled by IBM
13596 XL compilers without optimization.
13597
13598 @item -mpe
13599 @opindex mpe
13600 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
13601 application written to use message passing with special startup code to
13602 enable the application to run.  The system must have PE installed in the
13603 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
13604 must be overridden with the @option{-specs=} option to specify the
13605 appropriate directory location.  The Parallel Environment does not
13606 support threads, so the @option{-mpe} option and the @option{-pthread}
13607 option are incompatible.
13608
13609 @item -malign-natural
13610 @itemx -malign-power
13611 @opindex malign-natural
13612 @opindex malign-power
13613 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
13614 @option{-malign-natural} overrides the ABI-defined alignment of larger
13615 types, such as floating-point doubles, on their natural size-based boundary.
13616 The option @option{-malign-power} instructs GCC to follow the ABI-specified
13617 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
13618
13619 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
13620 is not supported.
13621
13622 @item -msoft-float
13623 @itemx -mhard-float
13624 @opindex msoft-float
13625 @opindex mhard-float
13626 Generate code that does not use (uses) the floating-point register set.
13627 Software floating point emulation is provided if you use the
13628 @option{-msoft-float} option, and pass the option to GCC when linking.
13629
13630 @item -mmultiple
13631 @itemx -mno-multiple
13632 @opindex mmultiple
13633 @opindex mno-multiple
13634 Generate code that uses (does not use) the load multiple word
13635 instructions and the store multiple word instructions.  These
13636 instructions are generated by default on POWER systems, and not
13637 generated on PowerPC systems.  Do not use @option{-mmultiple} on little
13638 endian PowerPC systems, since those instructions do not work when the
13639 processor is in little endian mode.  The exceptions are PPC740 and
13640 PPC750 which permit the instructions usage in little endian mode.
13641
13642 @item -mstring
13643 @itemx -mno-string
13644 @opindex mstring
13645 @opindex mno-string
13646 Generate code that uses (does not use) the load string instructions
13647 and the store string word instructions to save multiple registers and
13648 do small block moves.  These instructions are generated by default on
13649 POWER systems, and not generated on PowerPC systems.  Do not use
13650 @option{-mstring} on little endian PowerPC systems, since those
13651 instructions do not work when the processor is in little endian mode.
13652 The exceptions are PPC740 and PPC750 which permit the instructions
13653 usage in little endian mode.
13654
13655 @item -mupdate
13656 @itemx -mno-update
13657 @opindex mupdate
13658 @opindex mno-update
13659 Generate code that uses (does not use) the load or store instructions
13660 that update the base register to the address of the calculated memory
13661 location.  These instructions are generated by default.  If you use
13662 @option{-mno-update}, there is a small window between the time that the
13663 stack pointer is updated and the address of the previous frame is
13664 stored, which means code that walks the stack frame across interrupts or
13665 signals may get corrupted data.
13666
13667 @item -mfused-madd
13668 @itemx -mno-fused-madd
13669 @opindex mfused-madd
13670 @opindex mno-fused-madd
13671 Generate code that uses (does not use) the floating point multiply and
13672 accumulate instructions.  These instructions are generated by default if
13673 hardware floating is used.
13674
13675 @item -mmulhw
13676 @itemx -mno-mulhw
13677 @opindex mmulhw
13678 @opindex mno-mulhw
13679 Generate code that uses (does not use) the half-word multiply and
13680 multiply-accumulate instructions on the IBM 405, 440 and 464 processors.
13681 These instructions are generated by default when targetting those
13682 processors.
13683
13684 @item -mdlmzb
13685 @itemx -mno-dlmzb
13686 @opindex mdlmzb
13687 @opindex mno-dlmzb
13688 Generate code that uses (does not use) the string-search @samp{dlmzb}
13689 instruction on the IBM 405, 440 and 464 processors.  This instruction is
13690 generated by default when targetting those processors.
13691
13692 @item -mno-bit-align
13693 @itemx -mbit-align
13694 @opindex mno-bit-align
13695 @opindex mbit-align
13696 On System V.4 and embedded PowerPC systems do not (do) force structures
13697 and unions that contain bit-fields to be aligned to the base type of the
13698 bit-field.
13699
13700 For example, by default a structure containing nothing but 8
13701 @code{unsigned} bit-fields of length 1 would be aligned to a 4 byte
13702 boundary and have a size of 4 bytes.  By using @option{-mno-bit-align},
13703 the structure would be aligned to a 1 byte boundary and be one byte in
13704 size.
13705
13706 @item -mno-strict-align
13707 @itemx -mstrict-align
13708 @opindex mno-strict-align
13709 @opindex mstrict-align
13710 On System V.4 and embedded PowerPC systems do not (do) assume that
13711 unaligned memory references will be handled by the system.
13712
13713 @item -mrelocatable
13714 @itemx -mno-relocatable
13715 @opindex mrelocatable
13716 @opindex mno-relocatable
13717 On embedded PowerPC systems generate code that allows (does not allow)
13718 the program to be relocated to a different address at runtime.  If you
13719 use @option{-mrelocatable} on any module, all objects linked together must
13720 be compiled with @option{-mrelocatable} or @option{-mrelocatable-lib}.
13721
13722 @item -mrelocatable-lib
13723 @itemx -mno-relocatable-lib
13724 @opindex mrelocatable-lib
13725 @opindex mno-relocatable-lib
13726 On embedded PowerPC systems generate code that allows (does not allow)
13727 the program to be relocated to a different address at runtime.  Modules
13728 compiled with @option{-mrelocatable-lib} can be linked with either modules
13729 compiled without @option{-mrelocatable} and @option{-mrelocatable-lib} or
13730 with modules compiled with the @option{-mrelocatable} options.
13731
13732 @item -mno-toc
13733 @itemx -mtoc
13734 @opindex mno-toc
13735 @opindex mtoc
13736 On System V.4 and embedded PowerPC systems do not (do) assume that
13737 register 2 contains a pointer to a global area pointing to the addresses
13738 used in the program.
13739
13740 @item -mlittle
13741 @itemx -mlittle-endian
13742 @opindex mlittle
13743 @opindex mlittle-endian
13744 On System V.4 and embedded PowerPC systems compile code for the
13745 processor in little endian mode.  The @option{-mlittle-endian} option is
13746 the same as @option{-mlittle}.
13747
13748 @item -mbig
13749 @itemx -mbig-endian
13750 @opindex mbig
13751 @opindex mbig-endian
13752 On System V.4 and embedded PowerPC systems compile code for the
13753 processor in big endian mode.  The @option{-mbig-endian} option is
13754 the same as @option{-mbig}.
13755
13756 @item -mdynamic-no-pic
13757 @opindex mdynamic-no-pic
13758 On Darwin and Mac OS X systems, compile code so that it is not
13759 relocatable, but that its external references are relocatable.  The
13760 resulting code is suitable for applications, but not shared
13761 libraries.
13762
13763 @item -mprioritize-restricted-insns=@var{priority}
13764 @opindex mprioritize-restricted-insns
13765 This option controls the priority that is assigned to
13766 dispatch-slot restricted instructions during the second scheduling
13767 pass.  The argument @var{priority} takes the value @var{0/1/2} to assign
13768 @var{no/highest/second-highest} priority to dispatch slot restricted
13769 instructions.
13770
13771 @item -msched-costly-dep=@var{dependence_type}
13772 @opindex msched-costly-dep
13773 This option controls which dependences are considered costly
13774 by the target during instruction scheduling.  The argument
13775 @var{dependence_type} takes one of the following values:
13776 @var{no}: no dependence is costly,
13777 @var{all}: all dependences are costly,
13778 @var{true_store_to_load}: a true dependence from store to load is costly,
13779 @var{store_to_load}: any dependence from store to load is costly,
13780 @var{number}: any dependence which latency >= @var{number} is costly.
13781
13782 @item -minsert-sched-nops=@var{scheme}
13783 @opindex minsert-sched-nops
13784 This option controls which nop insertion scheme will be used during
13785 the second scheduling pass.  The argument @var{scheme} takes one of the
13786 following values:
13787 @var{no}: Don't insert nops.
13788 @var{pad}: Pad with nops any dispatch group which has vacant issue slots,
13789 according to the scheduler's grouping.
13790 @var{regroup_exact}: Insert nops to force costly dependent insns into
13791 separate groups.  Insert exactly as many nops as needed to force an insn
13792 to a new group, according to the estimated processor grouping.
13793 @var{number}: Insert nops to force costly dependent insns into
13794 separate groups.  Insert @var{number} nops to force an insn to a new group.
13795
13796 @item -mcall-sysv
13797 @opindex mcall-sysv
13798 On System V.4 and embedded PowerPC systems compile code using calling
13799 conventions that adheres to the March 1995 draft of the System V
13800 Application Binary Interface, PowerPC processor supplement.  This is the
13801 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
13802
13803 @item -mcall-sysv-eabi
13804 @opindex mcall-sysv-eabi
13805 Specify both @option{-mcall-sysv} and @option{-meabi} options.
13806
13807 @item -mcall-sysv-noeabi
13808 @opindex mcall-sysv-noeabi
13809 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
13810
13811 @item -mcall-solaris
13812 @opindex mcall-solaris
13813 On System V.4 and embedded PowerPC systems compile code for the Solaris
13814 operating system.
13815
13816 @item -mcall-linux
13817 @opindex mcall-linux
13818 On System V.4 and embedded PowerPC systems compile code for the
13819 Linux-based GNU system.
13820
13821 @item -mcall-gnu
13822 @opindex mcall-gnu
13823 On System V.4 and embedded PowerPC systems compile code for the
13824 Hurd-based GNU system.
13825
13826 @item -mcall-netbsd
13827 @opindex mcall-netbsd
13828 On System V.4 and embedded PowerPC systems compile code for the
13829 NetBSD operating system.
13830
13831 @item -maix-struct-return
13832 @opindex maix-struct-return
13833 Return all structures in memory (as specified by the AIX ABI)@.
13834
13835 @item -msvr4-struct-return
13836 @opindex msvr4-struct-return
13837 Return structures smaller than 8 bytes in registers (as specified by the
13838 SVR4 ABI)@.
13839
13840 @item -mabi=@var{abi-type}
13841 @opindex mabi
13842 Extend the current ABI with a particular extension, or remove such extension.
13843 Valid values are @var{altivec}, @var{no-altivec}, @var{spe},
13844 @var{no-spe}, @var{ibmlongdouble}, @var{ieeelongdouble}@.
13845
13846 @item -mabi=spe
13847 @opindex mabi=spe
13848 Extend the current ABI with SPE ABI extensions.  This does not change
13849 the default ABI, instead it adds the SPE ABI extensions to the current
13850 ABI@.
13851
13852 @item -mabi=no-spe
13853 @opindex mabi=no-spe
13854 Disable Booke SPE ABI extensions for the current ABI@.
13855
13856 @item -mabi=ibmlongdouble
13857 @opindex mabi=ibmlongdouble
13858 Change the current ABI to use IBM extended precision long double.
13859 This is a PowerPC 32-bit SYSV ABI option.
13860
13861 @item -mabi=ieeelongdouble
13862 @opindex mabi=ieeelongdouble
13863 Change the current ABI to use IEEE extended precision long double.
13864 This is a PowerPC 32-bit Linux ABI option.
13865
13866 @item -mprototype
13867 @itemx -mno-prototype
13868 @opindex mprototype
13869 @opindex mno-prototype
13870 On System V.4 and embedded PowerPC systems assume that all calls to
13871 variable argument functions are properly prototyped.  Otherwise, the
13872 compiler must insert an instruction before every non prototyped call to
13873 set or clear bit 6 of the condition code register (@var{CR}) to
13874 indicate whether floating point values were passed in the floating point
13875 registers in case the function takes a variable arguments.  With
13876 @option{-mprototype}, only calls to prototyped variable argument functions
13877 will set or clear the bit.
13878
13879 @item -msim
13880 @opindex msim
13881 On embedded PowerPC systems, assume that the startup module is called
13882 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
13883 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}
13884 configurations.
13885
13886 @item -mmvme
13887 @opindex mmvme
13888 On embedded PowerPC systems, assume that the startup module is called
13889 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
13890 @file{libc.a}.
13891
13892 @item -mads
13893 @opindex mads
13894 On embedded PowerPC systems, assume that the startup module is called
13895 @file{crt0.o} and the standard C libraries are @file{libads.a} and
13896 @file{libc.a}.
13897
13898 @item -myellowknife
13899 @opindex myellowknife
13900 On embedded PowerPC systems, assume that the startup module is called
13901 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
13902 @file{libc.a}.
13903
13904 @item -mvxworks
13905 @opindex mvxworks
13906 On System V.4 and embedded PowerPC systems, specify that you are
13907 compiling for a VxWorks system.
13908
13909 @item -memb
13910 @opindex memb
13911 On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
13912 header to indicate that @samp{eabi} extended relocations are used.
13913
13914 @item -meabi
13915 @itemx -mno-eabi
13916 @opindex meabi
13917 @opindex mno-eabi
13918 On System V.4 and embedded PowerPC systems do (do not) adhere to the
13919 Embedded Applications Binary Interface (eabi) which is a set of
13920 modifications to the System V.4 specifications.  Selecting @option{-meabi}
13921 means that the stack is aligned to an 8 byte boundary, a function
13922 @code{__eabi} is called to from @code{main} to set up the eabi
13923 environment, and the @option{-msdata} option can use both @code{r2} and
13924 @code{r13} to point to two separate small data areas.  Selecting
13925 @option{-mno-eabi} means that the stack is aligned to a 16 byte boundary,
13926 do not call an initialization function from @code{main}, and the
13927 @option{-msdata} option will only use @code{r13} to point to a single
13928 small data area.  The @option{-meabi} option is on by default if you
13929 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
13930
13931 @item -msdata=eabi
13932 @opindex msdata=eabi
13933 On System V.4 and embedded PowerPC systems, put small initialized
13934 @code{const} global and static data in the @samp{.sdata2} section, which
13935 is pointed to by register @code{r2}.  Put small initialized
13936 non-@code{const} global and static data in the @samp{.sdata} section,
13937 which is pointed to by register @code{r13}.  Put small uninitialized
13938 global and static data in the @samp{.sbss} section, which is adjacent to
13939 the @samp{.sdata} section.  The @option{-msdata=eabi} option is
13940 incompatible with the @option{-mrelocatable} option.  The
13941 @option{-msdata=eabi} option also sets the @option{-memb} option.
13942
13943 @item -msdata=sysv
13944 @opindex msdata=sysv
13945 On System V.4 and embedded PowerPC systems, put small global and static
13946 data in the @samp{.sdata} section, which is pointed to by register
13947 @code{r13}.  Put small uninitialized global and static data in the
13948 @samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
13949 The @option{-msdata=sysv} option is incompatible with the
13950 @option{-mrelocatable} option.
13951
13952 @item -msdata=default
13953 @itemx -msdata
13954 @opindex msdata=default
13955 @opindex msdata
13956 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
13957 compile code the same as @option{-msdata=eabi}, otherwise compile code the
13958 same as @option{-msdata=sysv}.
13959
13960 @item -msdata-data
13961 @opindex msdata-data
13962 On System V.4 and embedded PowerPC systems, put small global
13963 data in the @samp{.sdata} section.  Put small uninitialized global
13964 data in the @samp{.sbss} section.  Do not use register @code{r13}
13965 to address small data however.  This is the default behavior unless
13966 other @option{-msdata} options are used.
13967
13968 @item -msdata=none
13969 @itemx -mno-sdata
13970 @opindex msdata=none
13971 @opindex mno-sdata
13972 On embedded PowerPC systems, put all initialized global and static data
13973 in the @samp{.data} section, and all uninitialized data in the
13974 @samp{.bss} section.
13975
13976 @item -G @var{num}
13977 @opindex G
13978 @cindex smaller data references (PowerPC)
13979 @cindex .sdata/.sdata2 references (PowerPC)
13980 On embedded PowerPC systems, put global and static items less than or
13981 equal to @var{num} bytes into the small data or bss sections instead of
13982 the normal data or bss section.  By default, @var{num} is 8.  The
13983 @option{-G @var{num}} switch is also passed to the linker.
13984 All modules should be compiled with the same @option{-G @var{num}} value.
13985
13986 @item -mregnames
13987 @itemx -mno-regnames
13988 @opindex mregnames
13989 @opindex mno-regnames
13990 On System V.4 and embedded PowerPC systems do (do not) emit register
13991 names in the assembly language output using symbolic forms.
13992
13993 @item -mlongcall
13994 @itemx -mno-longcall
13995 @opindex mlongcall
13996 @opindex mno-longcall
13997 By default assume that all calls are far away so that a longer more
13998 expensive calling sequence is required.  This is required for calls
13999 further than 32 megabytes (33,554,432 bytes) from the current location.
14000 A short call will be generated if the compiler knows
14001 the call cannot be that far away.  This setting can be overridden by
14002 the @code{shortcall} function attribute, or by @code{#pragma
14003 longcall(0)}.
14004
14005 Some linkers are capable of detecting out-of-range calls and generating
14006 glue code on the fly.  On these systems, long calls are unnecessary and
14007 generate slower code.  As of this writing, the AIX linker can do this,
14008 as can the GNU linker for PowerPC/64.  It is planned to add this feature
14009 to the GNU linker for 32-bit PowerPC systems as well.
14010
14011 On Darwin/PPC systems, @code{#pragma longcall} will generate ``jbsr
14012 callee, L42'', plus a ``branch island'' (glue code).  The two target
14013 addresses represent the callee and the ``branch island''.  The
14014 Darwin/PPC linker will prefer the first address and generate a ``bl
14015 callee'' if the PPC ``bl'' instruction will reach the callee directly;
14016 otherwise, the linker will generate ``bl L42'' to call the ``branch
14017 island''.  The ``branch island'' is appended to the body of the
14018 calling function; it computes the full 32-bit address of the callee
14019 and jumps to it.
14020
14021 On Mach-O (Darwin) systems, this option directs the compiler emit to
14022 the glue for every direct call, and the Darwin linker decides whether
14023 to use or discard it.
14024
14025 In the future, we may cause GCC to ignore all longcall specifications
14026 when the linker is known to generate glue.
14027
14028 @item -pthread
14029 @opindex pthread
14030 Adds support for multithreading with the @dfn{pthreads} library.
14031 This option sets flags for both the preprocessor and linker.
14032
14033 @end table
14034
14035 @node S/390 and zSeries Options
14036 @subsection S/390 and zSeries Options
14037 @cindex S/390 and zSeries Options
14038
14039 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
14040
14041 @table @gcctabopt
14042 @item -mhard-float
14043 @itemx -msoft-float
14044 @opindex mhard-float
14045 @opindex msoft-float
14046 Use (do not use) the hardware floating-point instructions and registers
14047 for floating-point operations.  When @option{-msoft-float} is specified,
14048 functions in @file{libgcc.a} will be used to perform floating-point
14049 operations.  When @option{-mhard-float} is specified, the compiler
14050 generates IEEE floating-point instructions.  This is the default.
14051
14052 @item -mlong-double-64
14053 @itemx -mlong-double-128
14054 @opindex mlong-double-64
14055 @opindex mlong-double-128
14056 These switches control the size of @code{long double} type. A size
14057 of 64bit makes the @code{long double} type equivalent to the @code{double}
14058 type. This is the default.
14059
14060 @item -mbackchain
14061 @itemx -mno-backchain
14062 @opindex mbackchain
14063 @opindex mno-backchain
14064 Store (do not store) the address of the caller's frame as backchain pointer
14065 into the callee's stack frame.
14066 A backchain may be needed to allow debugging using tools that do not understand
14067 DWARF-2 call frame information.
14068 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
14069 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
14070 the backchain is placed into the topmost word of the 96/160 byte register
14071 save area.
14072
14073 In general, code compiled with @option{-mbackchain} is call-compatible with
14074 code compiled with @option{-mmo-backchain}; however, use of the backchain
14075 for debugging purposes usually requires that the whole binary is built with
14076 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
14077 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
14078 to build a linux kernel use @option{-msoft-float}.
14079
14080 The default is to not maintain the backchain.
14081
14082 @item -mpacked-stack
14083 @itemx -mno-packed-stack
14084 @opindex mpacked-stack
14085 @opindex mno-packed-stack
14086 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
14087 specified, the compiler uses the all fields of the 96/160 byte register save
14088 area only for their default purpose; unused fields still take up stack space.
14089 When @option{-mpacked-stack} is specified, register save slots are densely
14090 packed at the top of the register save area; unused space is reused for other
14091 purposes, allowing for more efficient use of the available stack space.
14092 However, when @option{-mbackchain} is also in effect, the topmost word of
14093 the save area is always used to store the backchain, and the return address
14094 register is always saved two words below the backchain.
14095
14096 As long as the stack frame backchain is not used, code generated with
14097 @option{-mpacked-stack} is call-compatible with code generated with
14098 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
14099 S/390 or zSeries generated code that uses the stack frame backchain at run
14100 time, not just for debugging purposes.  Such code is not call-compatible
14101 with code compiled with @option{-mpacked-stack}.  Also, note that the
14102 combination of @option{-mbackchain},
14103 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
14104 to build a linux kernel use @option{-msoft-float}.
14105
14106 The default is to not use the packed stack layout.
14107
14108 @item -msmall-exec
14109 @itemx -mno-small-exec
14110 @opindex msmall-exec
14111 @opindex mno-small-exec
14112 Generate (or do not generate) code using the @code{bras} instruction
14113 to do subroutine calls.
14114 This only works reliably if the total executable size does not
14115 exceed 64k.  The default is to use the @code{basr} instruction instead,
14116 which does not have this limitation.
14117
14118 @item -m64
14119 @itemx -m31
14120 @opindex m64
14121 @opindex m31
14122 When @option{-m31} is specified, generate code compliant to the
14123 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
14124 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
14125 particular to generate 64-bit instructions.  For the @samp{s390}
14126 targets, the default is @option{-m31}, while the @samp{s390x}
14127 targets default to @option{-m64}.
14128
14129 @item -mzarch
14130 @itemx -mesa
14131 @opindex mzarch
14132 @opindex mesa
14133 When @option{-mzarch} is specified, generate code using the
14134 instructions available on z/Architecture.
14135 When @option{-mesa} is specified, generate code using the
14136 instructions available on ESA/390.  Note that @option{-mesa} is
14137 not possible with @option{-m64}.
14138 When generating code compliant to the GNU/Linux for S/390 ABI,
14139 the default is @option{-mesa}.  When generating code compliant
14140 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
14141
14142 @item -mmvcle
14143 @itemx -mno-mvcle
14144 @opindex mmvcle
14145 @opindex mno-mvcle
14146 Generate (or do not generate) code using the @code{mvcle} instruction
14147 to perform block moves.  When @option{-mno-mvcle} is specified,
14148 use a @code{mvc} loop instead.  This is the default unless optimizing for
14149 size.
14150
14151 @item -mdebug
14152 @itemx -mno-debug
14153 @opindex mdebug
14154 @opindex mno-debug
14155 Print (or do not print) additional debug information when compiling.
14156 The default is to not print debug information.
14157
14158 @item -march=@var{cpu-type}
14159 @opindex march
14160 Generate code that will run on @var{cpu-type}, which is the name of a system
14161 representing a certain processor type.  Possible values for
14162 @var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, and @samp{z990}.
14163 When generating code using the instructions available on z/Architecture,
14164 the default is @option{-march=z900}.  Otherwise, the default is
14165 @option{-march=g5}.
14166
14167 @item -mtune=@var{cpu-type}
14168 @opindex mtune
14169 Tune to @var{cpu-type} everything applicable about the generated code,
14170 except for the ABI and the set of available instructions.
14171 The list of @var{cpu-type} values is the same as for @option{-march}.
14172 The default is the value used for @option{-march}.
14173
14174 @item -mtpf-trace
14175 @itemx -mno-tpf-trace
14176 @opindex mtpf-trace
14177 @opindex mno-tpf-trace
14178 Generate code that adds (does not add) in TPF OS specific branches to trace
14179 routines in the operating system.  This option is off by default, even
14180 when compiling for the TPF OS@.
14181
14182 @item -mfused-madd
14183 @itemx -mno-fused-madd
14184 @opindex mfused-madd
14185 @opindex mno-fused-madd
14186 Generate code that uses (does not use) the floating point multiply and
14187 accumulate instructions.  These instructions are generated by default if
14188 hardware floating point is used.
14189
14190 @item -mwarn-framesize=@var{framesize}
14191 @opindex mwarn-framesize
14192 Emit a warning if the current function exceeds the given frame size.  Because
14193 this is a compile time check it doesn't need to be a real problem when the program
14194 runs.  It is intended to identify functions which most probably cause
14195 a stack overflow.  It is useful to be used in an environment with limited stack
14196 size e.g.@: the linux kernel.
14197
14198 @item -mwarn-dynamicstack
14199 @opindex mwarn-dynamicstack
14200 Emit a warning if the function calls alloca or uses dynamically
14201 sized arrays.  This is generally a bad idea with a limited stack size.
14202
14203 @item -mstack-guard=@var{stack-guard}
14204 @itemx -mstack-size=@var{stack-size}
14205 @opindex mstack-guard
14206 @opindex mstack-size
14207 If these options are provided the s390 back end emits additional instructions in
14208 the function prologue which trigger a trap if the stack size is @var{stack-guard}
14209 bytes above the @var{stack-size} (remember that the stack on s390 grows downward).
14210 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
14211 the frame size of the compiled function is chosen.
14212 These options are intended to be used to help debugging stack overflow problems.
14213 The additionally emitted code causes only little overhead and hence can also be
14214 used in production like systems without greater performance degradation.  The given
14215 values have to be exact powers of 2 and @var{stack-size} has to be greater than
14216 @var{stack-guard} without exceeding 64k.
14217 In order to be efficient the extra code makes the assumption that the stack starts
14218 at an address aligned to the value given by @var{stack-size}.
14219 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
14220 @end table
14221
14222 @node Score Options
14223 @subsection Score Options
14224 @cindex Score Options
14225
14226 These options are defined for Score implementations:
14227
14228 @table @gcctabopt
14229 @item -meb
14230 @opindex meb
14231 Compile code for big endian mode.  This is the default.
14232
14233 @item -mel
14234 @opindex mel
14235 Compile code for little endian mode. 
14236
14237 @item -mnhwloop
14238 @opindex mnhwloop
14239 Disable generate bcnz instruction.
14240
14241 @item -muls
14242 @opindex muls
14243 Enable generate unaligned load and store instruction.
14244
14245 @item -mmac
14246 @opindex mmac
14247 Enable the use of multiply-accumulate instructions. Disabled by default. 
14248
14249 @item -mscore5
14250 @opindex mscore5
14251 Specify the SCORE5 as the target architecture.
14252
14253 @item -mscore5u
14254 @opindex mscore5u
14255 Specify the SCORE5U of the target architecture.
14256
14257 @item -mscore7
14258 @opindex mscore7
14259 Specify the SCORE7 as the target architecture. This is the default.
14260
14261 @item -mscore7d
14262 @opindex mscore7d
14263 Specify the SCORE7D as the target architecture.
14264 @end table
14265
14266 @node SH Options
14267 @subsection SH Options
14268
14269 These @samp{-m} options are defined for the SH implementations:
14270
14271 @table @gcctabopt
14272 @item -m1
14273 @opindex m1
14274 Generate code for the SH1.
14275
14276 @item -m2
14277 @opindex m2
14278 Generate code for the SH2.
14279
14280 @item -m2e
14281 Generate code for the SH2e.
14282
14283 @item -m3
14284 @opindex m3
14285 Generate code for the SH3.
14286
14287 @item -m3e
14288 @opindex m3e
14289 Generate code for the SH3e.
14290
14291 @item -m4-nofpu
14292 @opindex m4-nofpu
14293 Generate code for the SH4 without a floating-point unit.
14294
14295 @item -m4-single-only
14296 @opindex m4-single-only
14297 Generate code for the SH4 with a floating-point unit that only
14298 supports single-precision arithmetic.
14299
14300 @item -m4-single
14301 @opindex m4-single
14302 Generate code for the SH4 assuming the floating-point unit is in
14303 single-precision mode by default.
14304
14305 @item -m4
14306 @opindex m4
14307 Generate code for the SH4.
14308
14309 @item -m4a-nofpu
14310 @opindex m4a-nofpu
14311 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
14312 floating-point unit is not used.
14313
14314 @item -m4a-single-only
14315 @opindex m4a-single-only
14316 Generate code for the SH4a, in such a way that no double-precision
14317 floating point operations are used.
14318
14319 @item -m4a-single
14320 @opindex m4a-single
14321 Generate code for the SH4a assuming the floating-point unit is in
14322 single-precision mode by default.
14323
14324 @item -m4a
14325 @opindex m4a
14326 Generate code for the SH4a.
14327
14328 @item -m4al
14329 @opindex m4al
14330 Same as @option{-m4a-nofpu}, except that it implicitly passes
14331 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
14332 instructions at the moment.
14333
14334 @item -mb
14335 @opindex mb
14336 Compile code for the processor in big endian mode.
14337
14338 @item -ml
14339 @opindex ml
14340 Compile code for the processor in little endian mode.
14341
14342 @item -mdalign
14343 @opindex mdalign
14344 Align doubles at 64-bit boundaries.  Note that this changes the calling
14345 conventions, and thus some functions from the standard C library will
14346 not work unless you recompile it first with @option{-mdalign}.
14347
14348 @item -mrelax
14349 @opindex mrelax
14350 Shorten some address references at link time, when possible; uses the
14351 linker option @option{-relax}.
14352
14353 @item -mbigtable
14354 @opindex mbigtable
14355 Use 32-bit offsets in @code{switch} tables.  The default is to use
14356 16-bit offsets.
14357
14358 @item -mbitops
14359 @opindex mbitops
14360 Enable the use of bit manipulation instructions on SH2A.
14361
14362 @item -mfmovd
14363 @opindex mfmovd
14364 Enable the use of the instruction @code{fmovd}.
14365
14366 @item -mhitachi
14367 @opindex mhitachi
14368 Comply with the calling conventions defined by Renesas.
14369
14370 @item -mrenesas
14371 @opindex mhitachi
14372 Comply with the calling conventions defined by Renesas.
14373
14374 @item -mno-renesas
14375 @opindex mhitachi
14376 Comply with the calling conventions defined for GCC before the Renesas
14377 conventions were available.  This option is the default for all
14378 targets of the SH toolchain except for @samp{sh-symbianelf}.
14379
14380 @item -mnomacsave
14381 @opindex mnomacsave
14382 Mark the @code{MAC} register as call-clobbered, even if
14383 @option{-mhitachi} is given.
14384
14385 @item -mieee
14386 @opindex mieee
14387 Increase IEEE-compliance of floating-point code.
14388 At the moment, this is equivalent to @option{-fno-finite-math-only}.
14389 When generating 16 bit SH opcodes, getting IEEE-conforming results for
14390 comparisons of NANs / infinities incurs extra overhead in every
14391 floating point comparison, therefore the default is set to
14392 @option{-ffinite-math-only}.
14393
14394 @item -minline-ic_invalidate
14395 @opindex minline-ic_invalidate
14396 Inline code to invalidate instruction cache entries after setting up
14397 nested function trampolines.
14398 This option has no effect if -musermode is in effect and the selected
14399 code generation option (e.g. -m4) does not allow the use of the icbi
14400 instruction.
14401 If the selected code generation option does not allow the use of the icbi
14402 instruction, and -musermode is not in effect, the inlined code will
14403 manipulate the instruction cache address array directly with an associative
14404 write.  This not only requires privileged mode, but it will also
14405 fail if the cache line had been mapped via the TLB and has become unmapped.
14406
14407 @item -misize
14408 @opindex misize
14409 Dump instruction size and location in the assembly code.
14410
14411 @item -mpadstruct
14412 @opindex mpadstruct
14413 This option is deprecated.  It pads structures to multiple of 4 bytes,
14414 which is incompatible with the SH ABI@.
14415
14416 @item -mspace
14417 @opindex mspace
14418 Optimize for space instead of speed.  Implied by @option{-Os}.
14419
14420 @item -mprefergot
14421 @opindex mprefergot
14422 When generating position-independent code, emit function calls using
14423 the Global Offset Table instead of the Procedure Linkage Table.
14424
14425 @item -musermode
14426 @opindex musermode
14427 Don't generate privileged mode only code; implies -mno-inline-ic_invalidate
14428 if the inlined code would not work in user mode.
14429 This is the default when the target is @code{sh-*-linux*}.
14430
14431 @item -multcost=@var{number}
14432 @opindex multcost=@var{number}
14433 Set the cost to assume for a multiply insn.
14434
14435 @item -mdiv=@var{strategy}
14436 @opindex mdiv=@var{strategy}
14437 Set the division strategy to use for SHmedia code.  @var{strategy} must be
14438 one of: call, call2, fp, inv, inv:minlat, inv20u, inv20l, inv:call,
14439 inv:call2, inv:fp .
14440 "fp" performs the operation in floating point.  This has a very high latency,
14441 but needs only a few instructions, so it might be a good choice if
14442 your code has enough easily exploitable ILP to allow the compiler to
14443 schedule the floating point instructions together with other instructions.
14444 Division by zero causes a floating point exception.
14445 "inv" uses integer operations to calculate the inverse of the divisor,
14446 and then multiplies the dividend with the inverse.  This strategy allows
14447 cse and hoisting of the inverse calculation.  Division by zero calculates
14448 an unspecified result, but does not trap.
14449 "inv:minlat" is a variant of "inv" where if no cse / hoisting opportunities
14450 have been found, or if the entire operation has been hoisted to the same
14451 place, the last stages of the inverse calculation are intertwined with the
14452 final multiply to reduce the overall latency, at the expense of using a few
14453 more instructions, and thus offering fewer scheduling opportunities with
14454 other code.
14455 "call" calls a library function that usually implements the inv:minlat
14456 strategy.
14457 This gives high code density for m5-*media-nofpu compilations.
14458 "call2" uses a different entry point of the same library function, where it
14459 assumes that a pointer to a lookup table has already been set up, which
14460 exposes the pointer load to cse / code hoisting optimizations.
14461 "inv:call", "inv:call2" and "inv:fp" all use the "inv" algorithm for initial
14462 code generation, but if the code stays unoptimized, revert to the "call",
14463 "call2", or "fp" strategies, respectively.  Note that the
14464 potentially-trapping side effect of division by zero is carried by a
14465 separate instruction, so it is possible that all the integer instructions
14466 are hoisted out, but the marker for the side effect stays where it is.
14467 A recombination to fp operations or a call is not possible in that case.
14468 "inv20u" and "inv20l" are variants of the "inv:minlat" strategy.  In the case
14469 that the inverse calculation was nor separated from the multiply, they speed
14470 up division where the dividend fits into 20 bits (plus sign where applicable),
14471 by inserting a test to skip a number of operations in this case; this test
14472 slows down the case of larger dividends.  inv20u assumes the case of a such
14473 a small dividend to be unlikely, and inv20l assumes it to be likely.
14474
14475 @item -mdivsi3_libfunc=@var{name}
14476 @opindex mdivsi3_libfunc=@var{name}
14477 Set the name of the library function used for 32 bit signed division to
14478 @var{name}.  This only affect the name used in the call and inv:call
14479 division strategies, and the compiler will still expect the same
14480 sets of input/output/clobbered registers as if this option was not present.
14481
14482 @item -mfixed-range=@var{register-range}
14483 @opindex mfixed-range
14484 Generate code treating the given register range as fixed registers.
14485 A fixed register is one that the register allocator can not use.  This is
14486 useful when compiling kernel code.  A register range is specified as
14487 two registers separated by a dash.  Multiple register ranges can be
14488 specified separated by a comma.
14489
14490 @item -madjust-unroll
14491 @opindex madjust-unroll
14492 Throttle unrolling to avoid thrashing target registers.
14493 This option only has an effect if the gcc code base supports the
14494 TARGET_ADJUST_UNROLL_MAX target hook.
14495
14496 @item -mindexed-addressing
14497 @opindex mindexed-addressing
14498 Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
14499 This is only safe if the hardware and/or OS implement 32 bit wrap-around
14500 semantics for the indexed addressing mode.  The architecture allows the
14501 implementation of processors with 64 bit MMU, which the OS could use to
14502 get 32 bit addressing, but since no current hardware implementation supports
14503 this or any other way to make the indexed addressing mode safe to use in
14504 the 32 bit ABI, the default is -mno-indexed-addressing.
14505
14506 @item -mgettrcost=@var{number}
14507 @opindex mgettrcost=@var{number}
14508 Set the cost assumed for the gettr instruction to @var{number}.
14509 The default is 2 if @option{-mpt-fixed} is in effect, 100 otherwise.
14510
14511 @item -mpt-fixed
14512 @opindex mpt-fixed
14513 Assume pt* instructions won't trap.  This will generally generate better
14514 scheduled code, but is unsafe on current hardware.  The current architecture
14515 definition says that ptabs and ptrel trap when the target anded with 3 is 3.
14516 This has the unintentional effect of making it unsafe to schedule ptabs /
14517 ptrel before a branch, or hoist it out of a loop.  For example,
14518 __do_global_ctors, a part of libgcc that runs constructors at program
14519 startup, calls functions in a list which is delimited by @minus{}1.  With the
14520 -mpt-fixed option, the ptabs will be done before testing against @minus{}1.
14521 That means that all the constructors will be run a bit quicker, but when
14522 the loop comes to the end of the list, the program crashes because ptabs
14523 loads @minus{}1 into a target register.  Since this option is unsafe for any
14524 hardware implementing the current architecture specification, the default
14525 is -mno-pt-fixed.  Unless the user specifies a specific cost with
14526 @option{-mgettrcost}, -mno-pt-fixed also implies @option{-mgettrcost=100};
14527 this deters register allocation using target registers for storing
14528 ordinary integers.
14529
14530 @item -minvalid-symbols
14531 @opindex minvalid-symbols
14532 Assume symbols might be invalid.  Ordinary function symbols generated by
14533 the compiler will always be valid to load with movi/shori/ptabs or
14534 movi/shori/ptrel, but with assembler and/or linker tricks it is possible
14535 to generate symbols that will cause ptabs / ptrel to trap.
14536 This option is only meaningful when @option{-mno-pt-fixed} is in effect.
14537 It will then prevent cross-basic-block cse, hoisting and most scheduling
14538 of symbol loads.  The default is @option{-mno-invalid-symbols}.
14539 @end table
14540
14541 @node SPARC Options
14542 @subsection SPARC Options
14543 @cindex SPARC options
14544
14545 These @samp{-m} options are supported on the SPARC:
14546
14547 @table @gcctabopt
14548 @item -mno-app-regs
14549 @itemx -mapp-regs
14550 @opindex mno-app-regs
14551 @opindex mapp-regs
14552 Specify @option{-mapp-regs} to generate output using the global registers
14553 2 through 4, which the SPARC SVR4 ABI reserves for applications.  This
14554 is the default.
14555
14556 To be fully SVR4 ABI compliant at the cost of some performance loss,
14557 specify @option{-mno-app-regs}.  You should compile libraries and system
14558 software with this option.
14559
14560 @item -mfpu
14561 @itemx -mhard-float
14562 @opindex mfpu
14563 @opindex mhard-float
14564 Generate output containing floating point instructions.  This is the
14565 default.
14566
14567 @item -mno-fpu
14568 @itemx -msoft-float
14569 @opindex mno-fpu
14570 @opindex msoft-float
14571 Generate output containing library calls for floating point.
14572 @strong{Warning:} the requisite libraries are not available for all SPARC
14573 targets.  Normally the facilities of the machine's usual C compiler are
14574 used, but this cannot be done directly in cross-compilation.  You must make
14575 your own arrangements to provide suitable library functions for
14576 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
14577 @samp{sparclite-*-*} do provide software floating point support.
14578
14579 @option{-msoft-float} changes the calling convention in the output file;
14580 therefore, it is only useful if you compile @emph{all} of a program with
14581 this option.  In particular, you need to compile @file{libgcc.a}, the
14582 library that comes with GCC, with @option{-msoft-float} in order for
14583 this to work.
14584
14585 @item -mhard-quad-float
14586 @opindex mhard-quad-float
14587 Generate output containing quad-word (long double) floating point
14588 instructions.
14589
14590 @item -msoft-quad-float
14591 @opindex msoft-quad-float
14592 Generate output containing library calls for quad-word (long double)
14593 floating point instructions.  The functions called are those specified
14594 in the SPARC ABI@.  This is the default.
14595
14596 As of this writing, there are no SPARC implementations that have hardware
14597 support for the quad-word floating point instructions.  They all invoke
14598 a trap handler for one of these instructions, and then the trap handler
14599 emulates the effect of the instruction.  Because of the trap handler overhead,
14600 this is much slower than calling the ABI library routines.  Thus the
14601 @option{-msoft-quad-float} option is the default.
14602
14603 @item -mno-unaligned-doubles
14604 @itemx -munaligned-doubles
14605 @opindex mno-unaligned-doubles
14606 @opindex munaligned-doubles
14607 Assume that doubles have 8 byte alignment.  This is the default.
14608
14609 With @option{-munaligned-doubles}, GCC assumes that doubles have 8 byte
14610 alignment only if they are contained in another type, or if they have an
14611 absolute address.  Otherwise, it assumes they have 4 byte alignment.
14612 Specifying this option avoids some rare compatibility problems with code
14613 generated by other compilers.  It is not the default because it results
14614 in a performance loss, especially for floating point code.
14615
14616 @item -mno-faster-structs
14617 @itemx -mfaster-structs
14618 @opindex mno-faster-structs
14619 @opindex mfaster-structs
14620 With @option{-mfaster-structs}, the compiler assumes that structures
14621 should have 8 byte alignment.  This enables the use of pairs of
14622 @code{ldd} and @code{std} instructions for copies in structure
14623 assignment, in place of twice as many @code{ld} and @code{st} pairs.
14624 However, the use of this changed alignment directly violates the SPARC
14625 ABI@.  Thus, it's intended only for use on targets where the developer
14626 acknowledges that their resulting code will not be directly in line with
14627 the rules of the ABI@.
14628
14629 @item -mimpure-text
14630 @opindex mimpure-text
14631 @option{-mimpure-text}, used in addition to @option{-shared}, tells
14632 the compiler to not pass @option{-z text} to the linker when linking a
14633 shared object.  Using this option, you can link position-dependent
14634 code into a shared object.
14635
14636 @option{-mimpure-text} suppresses the ``relocations remain against
14637 allocatable but non-writable sections'' linker error message.
14638 However, the necessary relocations will trigger copy-on-write, and the
14639 shared object is not actually shared across processes.  Instead of
14640 using @option{-mimpure-text}, you should compile all source code with
14641 @option{-fpic} or @option{-fPIC}.
14642
14643 This option is only available on SunOS and Solaris.
14644
14645 @item -mcpu=@var{cpu_type}
14646 @opindex mcpu
14647 Set the instruction set, register set, and instruction scheduling parameters
14648 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
14649 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{sparclite},
14650 @samp{f930}, @samp{f934}, @samp{hypersparc}, @samp{sparclite86x},
14651 @samp{sparclet}, @samp{tsc701}, @samp{v9}, @samp{ultrasparc},
14652 @samp{ultrasparc3}, @samp{niagara} and @samp{niagara2}.
14653
14654 Default instruction scheduling parameters are used for values that select
14655 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
14656 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
14657
14658 Here is a list of each supported architecture and their supported
14659 implementations.
14660
14661 @smallexample
14662     v7:             cypress
14663     v8:             supersparc, hypersparc
14664     sparclite:      f930, f934, sparclite86x
14665     sparclet:       tsc701
14666     v9:             ultrasparc, ultrasparc3, niagara, niagara2
14667 @end smallexample
14668
14669 By default (unless configured otherwise), GCC generates code for the V7
14670 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
14671 additionally optimizes it for the Cypress CY7C602 chip, as used in the
14672 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
14673 SPARCStation 1, 2, IPX etc.
14674
14675 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
14676 architecture.  The only difference from V7 code is that the compiler emits
14677 the integer multiply and integer divide instructions which exist in SPARC-V8
14678 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
14679 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
14680 2000 series.
14681
14682 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
14683 the SPARC architecture.  This adds the integer multiply, integer divide step
14684 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
14685 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
14686 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
14687 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
14688 MB86934 chip, which is the more recent SPARClite with FPU@.
14689
14690 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
14691 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
14692 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
14693 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
14694 optimizes it for the TEMIC SPARClet chip.
14695
14696 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
14697 architecture.  This adds 64-bit integer and floating-point move instructions,
14698 3 additional floating-point condition code registers and conditional move
14699 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
14700 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
14701 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
14702 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
14703 @option{-mcpu=niagara}, the compiler additionally optimizes it for
14704 Sun UltraSPARC T1 chips.  With @option{-mcpu=niagara2}, the compiler
14705 additionally optimizes it for Sun UltraSPARC T2 chips.
14706
14707 @item -mtune=@var{cpu_type}
14708 @opindex mtune
14709 Set the instruction scheduling parameters for machine type
14710 @var{cpu_type}, but do not set the instruction set or register set that the
14711 option @option{-mcpu=@var{cpu_type}} would.
14712
14713 The same values for @option{-mcpu=@var{cpu_type}} can be used for
14714 @option{-mtune=@var{cpu_type}}, but the only useful values are those
14715 that select a particular cpu implementation.  Those are @samp{cypress},
14716 @samp{supersparc}, @samp{hypersparc}, @samp{f930}, @samp{f934},
14717 @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc},
14718 @samp{ultrasparc3}, @samp{niagara}, and @samp{niagara2}.
14719
14720 @item -mv8plus
14721 @itemx -mno-v8plus
14722 @opindex mv8plus
14723 @opindex mno-v8plus
14724 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
14725 difference from the V8 ABI is that the global and out registers are
14726 considered 64-bit wide.  This is enabled by default on Solaris in 32-bit
14727 mode for all SPARC-V9 processors.
14728
14729 @item -mvis
14730 @itemx -mno-vis
14731 @opindex mvis
14732 @opindex mno-vis
14733 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
14734 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
14735 @end table
14736
14737 These @samp{-m} options are supported in addition to the above
14738 on SPARC-V9 processors in 64-bit environments:
14739
14740 @table @gcctabopt
14741 @item -mlittle-endian
14742 @opindex mlittle-endian
14743 Generate code for a processor running in little-endian mode.  It is only
14744 available for a few configurations and most notably not on Solaris and Linux.
14745
14746 @item -m32
14747 @itemx -m64
14748 @opindex m32
14749 @opindex m64
14750 Generate code for a 32-bit or 64-bit environment.
14751 The 32-bit environment sets int, long and pointer to 32 bits.
14752 The 64-bit environment sets int to 32 bits and long and pointer
14753 to 64 bits.
14754
14755 @item -mcmodel=medlow
14756 @opindex mcmodel=medlow
14757 Generate code for the Medium/Low code model: 64-bit addresses, programs
14758 must be linked in the low 32 bits of memory.  Programs can be statically
14759 or dynamically linked.
14760
14761 @item -mcmodel=medmid
14762 @opindex mcmodel=medmid
14763 Generate code for the Medium/Middle code model: 64-bit addresses, programs
14764 must be linked in the low 44 bits of memory, the text and data segments must
14765 be less than 2GB in size and the data segment must be located within 2GB of
14766 the text segment.
14767
14768 @item -mcmodel=medany
14769 @opindex mcmodel=medany
14770 Generate code for the Medium/Anywhere code model: 64-bit addresses, programs
14771 may be linked anywhere in memory, the text and data segments must be less
14772 than 2GB in size and the data segment must be located within 2GB of the
14773 text segment.
14774
14775 @item -mcmodel=embmedany
14776 @opindex mcmodel=embmedany
14777 Generate code for the Medium/Anywhere code model for embedded systems:
14778 64-bit addresses, the text and data segments must be less than 2GB in
14779 size, both starting anywhere in memory (determined at link time).  The
14780 global register %g4 points to the base of the data segment.  Programs
14781 are statically linked and PIC is not supported.
14782
14783 @item -mstack-bias
14784 @itemx -mno-stack-bias
14785 @opindex mstack-bias
14786 @opindex mno-stack-bias
14787 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
14788 frame pointer if present, are offset by @minus{}2047 which must be added back
14789 when making stack frame references.  This is the default in 64-bit mode.
14790 Otherwise, assume no such offset is present.
14791 @end table
14792
14793 These switches are supported in addition to the above on Solaris:
14794
14795 @table @gcctabopt
14796 @item -threads
14797 @opindex threads
14798 Add support for multithreading using the Solaris threads library.  This
14799 option sets flags for both the preprocessor and linker.  This option does
14800 not affect the thread safety of object code produced by the compiler or
14801 that of libraries supplied with it.
14802
14803 @item -pthreads
14804 @opindex pthreads
14805 Add support for multithreading using the POSIX threads library.  This
14806 option sets flags for both the preprocessor and linker.  This option does
14807 not affect the thread safety of object code produced  by the compiler or
14808 that of libraries supplied with it.
14809
14810 @item -pthread
14811 @opindex pthread
14812 This is a synonym for @option{-pthreads}.
14813 @end table
14814
14815 @node SPU Options
14816 @subsection SPU Options
14817 @cindex SPU options
14818
14819 These @samp{-m} options are supported on the SPU:
14820
14821 @table @gcctabopt
14822 @item -mwarn-reloc
14823 @itemx -merror-reloc
14824 @opindex mwarn-reloc
14825 @opindex merror-reloc
14826
14827 The loader for SPU does not handle dynamic relocations.  By default, GCC
14828 will give an error when it generates code that requires a dynamic
14829 relocation.  @option{-mno-error-reloc} disables the error,
14830 @option{-mwarn-reloc} will generate a warning instead.
14831
14832 @item -msafe-dma
14833 @itemx -munsafe-dma
14834 @opindex msafe-dma
14835 @opindex munsafe-dma
14836
14837 Instructions which initiate or test completion of DMA must not be
14838 reordered with respect to loads and stores of the memory which is being
14839 accessed.  Users typically address this problem using the volatile
14840 keyword, but that can lead to inefficient code in places where the
14841 memory is known to not change.  Rather than mark the memory as volatile
14842 we treat the DMA instructions as potentially effecting all memory.  With
14843 @option{-munsafe-dma} users must use the volatile keyword to protect
14844 memory accesses.
14845
14846 @item -mbranch-hints
14847 @opindex mbranch-hints
14848
14849 By default, GCC will generate a branch hint instruction to avoid
14850 pipeline stalls for always taken or probably taken branches.  A hint
14851 will not be generated closer than 8 instructions away from its branch.
14852 There is little reason to disable them, except for debugging purposes,
14853 or to make an object a little bit smaller.
14854
14855 @item -msmall-mem
14856 @itemx -mlarge-mem
14857 @opindex msmall-mem
14858 @opindex mlarge-mem
14859
14860 By default, GCC generates code assuming that addresses are never larger
14861 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
14862 a full 32 bit address.
14863
14864 @item -mstdmain
14865 @opindex mstdmain
14866
14867 By default, GCC links against startup code that assumes the SPU-style
14868 main function interface (which has an unconventional parameter list).
14869 With @option{-mstdmain}, GCC will link your program against startup
14870 code that assumes a C99-style interface to @code{main}, including a
14871 local copy of @code{argv} strings.
14872
14873 @item -mfixed-range=@var{register-range}
14874 @opindex mfixed-range
14875 Generate code treating the given register range as fixed registers.
14876 A fixed register is one that the register allocator can not use.  This is
14877 useful when compiling kernel code.  A register range is specified as
14878 two registers separated by a dash.  Multiple register ranges can be
14879 specified separated by a comma.
14880
14881 @item -mdual-nops
14882 @itemx -mdual-nops=@var{n}
14883 @opindex mdual-nops
14884 By default, GCC will insert nops to increase dual issue when it expects
14885 it to increase performance.  @var{n} can be a value from 0 to 10.  A
14886 smaller @var{n} will insert fewer nops.  10 is the default, 0 is the
14887 same as @option{-mno-dual-nops}.  Disabled with @option{-Os}.
14888
14889 @item -mhint-max-nops=@var{n}
14890 @opindex mhint-max-nops
14891 Maximum number of nops to insert for a branch hint.  A branch hint must
14892 be at least 8 instructions away from the branch it is effecting.  GCC
14893 will insert up to @var{n} nops to enforce this, otherwise it will not
14894 generate the branch hint.
14895
14896 @item -mhint-max-distance=@var{n}
14897 @opindex mhint-max-distance
14898 The encoding of the branch hint instruction limits the hint to be within
14899 256 instructions of the branch it is effecting.  By default, GCC makes
14900 sure it is within 125. 
14901
14902 @item -msafe-hints
14903 @opindex msafe-hints
14904 Work around a hardware bug which causes the SPU to stall indefinitely.
14905 By default, GCC will insert the @code{hbrp} instruction to make sure
14906 this stall won't happen.
14907
14908 @end table
14909
14910 @node System V Options
14911 @subsection Options for System V
14912
14913 These additional options are available on System V Release 4 for
14914 compatibility with other compilers on those systems:
14915
14916 @table @gcctabopt
14917 @item -G
14918 @opindex G
14919 Create a shared object.
14920 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
14921
14922 @item -Qy
14923 @opindex Qy
14924 Identify the versions of each tool used by the compiler, in a
14925 @code{.ident} assembler directive in the output.
14926
14927 @item -Qn
14928 @opindex Qn
14929 Refrain from adding @code{.ident} directives to the output file (this is
14930 the default).
14931
14932 @item -YP,@var{dirs}
14933 @opindex YP
14934 Search the directories @var{dirs}, and no others, for libraries
14935 specified with @option{-l}.
14936
14937 @item -Ym,@var{dir}
14938 @opindex Ym
14939 Look in the directory @var{dir} to find the M4 preprocessor.
14940 The assembler uses this option.
14941 @c This is supposed to go with a -Yd for predefined M4 macro files, but
14942 @c the generic assembler that comes with Solaris takes just -Ym.
14943 @end table
14944
14945 @node V850 Options
14946 @subsection V850 Options
14947 @cindex V850 Options
14948
14949 These @samp{-m} options are defined for V850 implementations:
14950
14951 @table @gcctabopt
14952 @item -mlong-calls
14953 @itemx -mno-long-calls
14954 @opindex mlong-calls
14955 @opindex mno-long-calls
14956 Treat all calls as being far away (near).  If calls are assumed to be
14957 far away, the compiler will always load the functions address up into a
14958 register, and call indirect through the pointer.
14959
14960 @item -mno-ep
14961 @itemx -mep
14962 @opindex mno-ep
14963 @opindex mep
14964 Do not optimize (do optimize) basic blocks that use the same index
14965 pointer 4 or more times to copy pointer into the @code{ep} register, and
14966 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
14967 option is on by default if you optimize.
14968
14969 @item -mno-prolog-function
14970 @itemx -mprolog-function
14971 @opindex mno-prolog-function
14972 @opindex mprolog-function
14973 Do not use (do use) external functions to save and restore registers
14974 at the prologue and epilogue of a function.  The external functions
14975 are slower, but use less code space if more than one function saves
14976 the same number of registers.  The @option{-mprolog-function} option
14977 is on by default if you optimize.
14978
14979 @item -mspace
14980 @opindex mspace
14981 Try to make the code as small as possible.  At present, this just turns
14982 on the @option{-mep} and @option{-mprolog-function} options.
14983
14984 @item -mtda=@var{n}
14985 @opindex mtda
14986 Put static or global variables whose size is @var{n} bytes or less into
14987 the tiny data area that register @code{ep} points to.  The tiny data
14988 area can hold up to 256 bytes in total (128 bytes for byte references).
14989
14990 @item -msda=@var{n}
14991 @opindex msda
14992 Put static or global variables whose size is @var{n} bytes or less into
14993 the small data area that register @code{gp} points to.  The small data
14994 area can hold up to 64 kilobytes.
14995
14996 @item -mzda=@var{n}
14997 @opindex mzda
14998 Put static or global variables whose size is @var{n} bytes or less into
14999 the first 32 kilobytes of memory.
15000
15001 @item -mv850
15002 @opindex mv850
15003 Specify that the target processor is the V850.
15004
15005 @item -mbig-switch
15006 @opindex mbig-switch
15007 Generate code suitable for big switch tables.  Use this option only if
15008 the assembler/linker complain about out of range branches within a switch
15009 table.
15010
15011 @item -mapp-regs
15012 @opindex mapp-regs
15013 This option will cause r2 and r5 to be used in the code generated by
15014 the compiler.  This setting is the default.
15015
15016 @item -mno-app-regs
15017 @opindex mno-app-regs
15018 This option will cause r2 and r5 to be treated as fixed registers.
15019
15020 @item -mv850e1
15021 @opindex mv850e1
15022 Specify that the target processor is the V850E1.  The preprocessor
15023 constants @samp{__v850e1__} and @samp{__v850e__} will be defined if
15024 this option is used.
15025
15026 @item -mv850e
15027 @opindex mv850e
15028 Specify that the target processor is the V850E@.  The preprocessor
15029 constant @samp{__v850e__} will be defined if this option is used.
15030
15031 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
15032 are defined then a default target processor will be chosen and the
15033 relevant @samp{__v850*__} preprocessor constant will be defined.
15034
15035 The preprocessor constants @samp{__v850} and @samp{__v851__} are always
15036 defined, regardless of which processor variant is the target.
15037
15038 @item -mdisable-callt
15039 @opindex mdisable-callt
15040 This option will suppress generation of the CALLT instruction for the
15041 v850e and v850e1 flavors of the v850 architecture.  The default is
15042 @option{-mno-disable-callt} which allows the CALLT instruction to be used.
15043
15044 @end table
15045
15046 @node VAX Options
15047 @subsection VAX Options
15048 @cindex VAX options
15049
15050 These @samp{-m} options are defined for the VAX:
15051
15052 @table @gcctabopt
15053 @item -munix
15054 @opindex munix
15055 Do not output certain jump instructions (@code{aobleq} and so on)
15056 that the Unix assembler for the VAX cannot handle across long
15057 ranges.
15058
15059 @item -mgnu
15060 @opindex mgnu
15061 Do output those jump instructions, on the assumption that you
15062 will assemble with the GNU assembler.
15063
15064 @item -mg
15065 @opindex mg
15066 Output code for g-format floating point numbers instead of d-format.
15067 @end table
15068
15069 @node VxWorks Options
15070 @subsection VxWorks Options
15071 @cindex VxWorks Options
15072
15073 The options in this section are defined for all VxWorks targets.
15074 Options specific to the target hardware are listed with the other
15075 options for that target.
15076
15077 @table @gcctabopt
15078 @item -mrtp
15079 @opindex mrtp
15080 GCC can generate code for both VxWorks kernels and real time processes
15081 (RTPs).  This option switches from the former to the latter.  It also
15082 defines the preprocessor macro @code{__RTP__}.
15083
15084 @item -non-static
15085 @opindex non-static
15086 Link an RTP executable against shared libraries rather than static
15087 libraries.  The options @option{-static} and @option{-shared} can
15088 also be used for RTPs (@pxref{Link Options}); @option{-static}
15089 is the default.
15090
15091 @item -Bstatic
15092 @itemx -Bdynamic
15093 @opindex Bstatic
15094 @opindex Bdynamic
15095 These options are passed down to the linker.  They are defined for
15096 compatibility with Diab.
15097
15098 @item -Xbind-lazy
15099 @opindex Xbind-lazy
15100 Enable lazy binding of function calls.  This option is equivalent to
15101 @option{-Wl,-z,now} and is defined for compatibility with Diab.
15102
15103 @item -Xbind-now
15104 @opindex Xbind-now
15105 Disable lazy binding of function calls.  This option is the default and
15106 is defined for compatibility with Diab.
15107 @end table
15108
15109 @node x86-64 Options
15110 @subsection x86-64 Options
15111 @cindex x86-64 options
15112
15113 These are listed under @xref{i386 and x86-64 Options}.
15114
15115 @node Xstormy16 Options
15116 @subsection Xstormy16 Options
15117 @cindex Xstormy16 Options
15118
15119 These options are defined for Xstormy16:
15120
15121 @table @gcctabopt
15122 @item -msim
15123 @opindex msim
15124 Choose startup files and linker script suitable for the simulator.
15125 @end table
15126
15127 @node Xtensa Options
15128 @subsection Xtensa Options
15129 @cindex Xtensa Options
15130
15131 These options are supported for Xtensa targets:
15132
15133 @table @gcctabopt
15134 @item -mconst16
15135 @itemx -mno-const16
15136 @opindex mconst16
15137 @opindex mno-const16
15138 Enable or disable use of @code{CONST16} instructions for loading
15139 constant values.  The @code{CONST16} instruction is currently not a
15140 standard option from Tensilica.  When enabled, @code{CONST16}
15141 instructions are always used in place of the standard @code{L32R}
15142 instructions.  The use of @code{CONST16} is enabled by default only if
15143 the @code{L32R} instruction is not available.
15144
15145 @item -mfused-madd
15146 @itemx -mno-fused-madd
15147 @opindex mfused-madd
15148 @opindex mno-fused-madd
15149 Enable or disable use of fused multiply/add and multiply/subtract
15150 instructions in the floating-point option.  This has no effect if the
15151 floating-point option is not also enabled.  Disabling fused multiply/add
15152 and multiply/subtract instructions forces the compiler to use separate
15153 instructions for the multiply and add/subtract operations.  This may be
15154 desirable in some cases where strict IEEE 754-compliant results are
15155 required: the fused multiply add/subtract instructions do not round the
15156 intermediate result, thereby producing results with @emph{more} bits of
15157 precision than specified by the IEEE standard.  Disabling fused multiply
15158 add/subtract instructions also ensures that the program output is not
15159 sensitive to the compiler's ability to combine multiply and add/subtract
15160 operations.
15161
15162 @item -mserialize-volatile
15163 @itemx -mno-serialize-volatile
15164 @opindex mserialize-volatile
15165 @opindex mno-serialize-volatile
15166 When this option is enabled, GCC inserts @code{MEMW} instructions before
15167 @code{volatile} memory references to guarantee sequential consistency.
15168 The default is @option{-mserialize-volatile}.  Use
15169 @option{-mno-serialize-volatile} to omit the @code{MEMW} instructions.
15170
15171 @item -mtext-section-literals
15172 @itemx -mno-text-section-literals
15173 @opindex mtext-section-literals
15174 @opindex mno-text-section-literals
15175 Control the treatment of literal pools.  The default is
15176 @option{-mno-text-section-literals}, which places literals in a separate
15177 section in the output file.  This allows the literal pool to be placed
15178 in a data RAM/ROM, and it also allows the linker to combine literal
15179 pools from separate object files to remove redundant literals and
15180 improve code size.  With @option{-mtext-section-literals}, the literals
15181 are interspersed in the text section in order to keep them as close as
15182 possible to their references.  This may be necessary for large assembly
15183 files.
15184
15185 @item -mtarget-align
15186 @itemx -mno-target-align
15187 @opindex mtarget-align
15188 @opindex mno-target-align
15189 When this option is enabled, GCC instructs the assembler to
15190 automatically align instructions to reduce branch penalties at the
15191 expense of some code density.  The assembler attempts to widen density
15192 instructions to align branch targets and the instructions following call
15193 instructions.  If there are not enough preceding safe density
15194 instructions to align a target, no widening will be performed.  The
15195 default is @option{-mtarget-align}.  These options do not affect the
15196 treatment of auto-aligned instructions like @code{LOOP}, which the
15197 assembler will always align, either by widening density instructions or
15198 by inserting no-op instructions.
15199
15200 @item -mlongcalls
15201 @itemx -mno-longcalls
15202 @opindex mlongcalls
15203 @opindex mno-longcalls
15204 When this option is enabled, GCC instructs the assembler to translate
15205 direct calls to indirect calls unless it can determine that the target
15206 of a direct call is in the range allowed by the call instruction.  This
15207 translation typically occurs for calls to functions in other source
15208 files.  Specifically, the assembler translates a direct @code{CALL}
15209 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
15210 The default is @option{-mno-longcalls}.  This option should be used in
15211 programs where the call target can potentially be out of range.  This
15212 option is implemented in the assembler, not the compiler, so the
15213 assembly code generated by GCC will still show direct call
15214 instructions---look at the disassembled object code to see the actual
15215 instructions.  Note that the assembler will use an indirect call for
15216 every cross-file call, not just those that really will be out of range.
15217 @end table
15218
15219 @node zSeries Options
15220 @subsection zSeries Options
15221 @cindex zSeries options
15222
15223 These are listed under @xref{S/390 and zSeries Options}.
15224
15225 @node Code Gen Options
15226 @section Options for Code Generation Conventions
15227 @cindex code generation conventions
15228 @cindex options, code generation
15229 @cindex run-time options
15230
15231 These machine-independent options control the interface conventions
15232 used in code generation.
15233
15234 Most of them have both positive and negative forms; the negative form
15235 of @option{-ffoo} would be @option{-fno-foo}.  In the table below, only
15236 one of the forms is listed---the one which is not the default.  You
15237 can figure out the other form by either removing @samp{no-} or adding
15238 it.
15239
15240 @table @gcctabopt
15241 @item -fbounds-check
15242 @opindex fbounds-check
15243 For front-ends that support it, generate additional code to check that
15244 indices used to access arrays are within the declared range.  This is
15245 currently only supported by the Java and Fortran front-ends, where
15246 this option defaults to true and false respectively.
15247
15248 @item -ftrapv
15249 @opindex ftrapv
15250 This option generates traps for signed overflow on addition, subtraction,
15251 multiplication operations.
15252
15253 @item -fwrapv
15254 @opindex fwrapv
15255 This option instructs the compiler to assume that signed arithmetic
15256 overflow of addition, subtraction and multiplication wraps around
15257 using twos-complement representation.  This flag enables some optimizations
15258 and disables others.  This option is enabled by default for the Java
15259 front-end, as required by the Java language specification.
15260
15261 @item -fexceptions
15262 @opindex fexceptions
15263 Enable exception handling.  Generates extra code needed to propagate
15264 exceptions.  For some targets, this implies GCC will generate frame
15265 unwind information for all functions, which can produce significant data
15266 size overhead, although it does not affect execution.  If you do not
15267 specify this option, GCC will enable it by default for languages like
15268 C++ which normally require exception handling, and disable it for
15269 languages like C that do not normally require it.  However, you may need
15270 to enable this option when compiling C code that needs to interoperate
15271 properly with exception handlers written in C++.  You may also wish to
15272 disable this option if you are compiling older C++ programs that don't
15273 use exception handling.
15274
15275 @item -fnon-call-exceptions
15276 @opindex fnon-call-exceptions
15277 Generate code that allows trapping instructions to throw exceptions.
15278 Note that this requires platform-specific runtime support that does
15279 not exist everywhere.  Moreover, it only allows @emph{trapping}
15280 instructions to throw exceptions, i.e.@: memory references or floating
15281 point instructions.  It does not allow exceptions to be thrown from
15282 arbitrary signal handlers such as @code{SIGALRM}.
15283
15284 @item -funwind-tables
15285 @opindex funwind-tables
15286 Similar to @option{-fexceptions}, except that it will just generate any needed
15287 static data, but will not affect the generated code in any other way.
15288 You will normally not enable this option; instead, a language processor
15289 that needs this handling would enable it on your behalf.
15290
15291 @item -fasynchronous-unwind-tables
15292 @opindex fasynchronous-unwind-tables
15293 Generate unwind table in dwarf2 format, if supported by target machine.  The
15294 table is exact at each instruction boundary, so it can be used for stack
15295 unwinding from asynchronous events (such as debugger or garbage collector).
15296
15297 @item -fpcc-struct-return
15298 @opindex fpcc-struct-return
15299 Return ``short'' @code{struct} and @code{union} values in memory like
15300 longer ones, rather than in registers.  This convention is less
15301 efficient, but it has the advantage of allowing intercallability between
15302 GCC-compiled files and files compiled with other compilers, particularly
15303 the Portable C Compiler (pcc).
15304
15305 The precise convention for returning structures in memory depends
15306 on the target configuration macros.
15307
15308 Short structures and unions are those whose size and alignment match
15309 that of some integer type.
15310
15311 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
15312 switch is not binary compatible with code compiled with the
15313 @option{-freg-struct-return} switch.
15314 Use it to conform to a non-default application binary interface.
15315
15316 @item -freg-struct-return
15317 @opindex freg-struct-return
15318 Return @code{struct} and @code{union} values in registers when possible.
15319 This is more efficient for small structures than
15320 @option{-fpcc-struct-return}.
15321
15322 If you specify neither @option{-fpcc-struct-return} nor
15323 @option{-freg-struct-return}, GCC defaults to whichever convention is
15324 standard for the target.  If there is no standard convention, GCC
15325 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
15326 the principal compiler.  In those cases, we can choose the standard, and
15327 we chose the more efficient register return alternative.
15328
15329 @strong{Warning:} code compiled with the @option{-freg-struct-return}
15330 switch is not binary compatible with code compiled with the
15331 @option{-fpcc-struct-return} switch.
15332 Use it to conform to a non-default application binary interface.
15333
15334 @item -fshort-enums
15335 @opindex fshort-enums
15336 Allocate to an @code{enum} type only as many bytes as it needs for the
15337 declared range of possible values.  Specifically, the @code{enum} type
15338 will be equivalent to the smallest integer type which has enough room.
15339
15340 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
15341 code that is not binary compatible with code generated without that switch.
15342 Use it to conform to a non-default application binary interface.
15343
15344 @item -fshort-double
15345 @opindex fshort-double
15346 Use the same size for @code{double} as for @code{float}.
15347
15348 @strong{Warning:} the @option{-fshort-double} switch causes GCC to generate
15349 code that is not binary compatible with code generated without that switch.
15350 Use it to conform to a non-default application binary interface.
15351
15352 @item -fshort-wchar
15353 @opindex fshort-wchar
15354 Override the underlying type for @samp{wchar_t} to be @samp{short
15355 unsigned int} instead of the default for the target.  This option is
15356 useful for building programs to run under WINE@.
15357
15358 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
15359 code that is not binary compatible with code generated without that switch.
15360 Use it to conform to a non-default application binary interface.
15361
15362 @item -fno-common
15363 @opindex fno-common
15364 In C, allocate even uninitialized global variables in the data section of the
15365 object file, rather than generating them as common blocks.  This has the
15366 effect that if the same variable is declared (without @code{extern}) in
15367 two different compilations, you will get an error when you link them.
15368 The only reason this might be useful is if you wish to verify that the
15369 program will work on other systems which always work this way.
15370
15371 @item -fno-ident
15372 @opindex fno-ident
15373 Ignore the @samp{#ident} directive.
15374
15375 @item -finhibit-size-directive
15376 @opindex finhibit-size-directive
15377 Don't output a @code{.size} assembler directive, or anything else that
15378 would cause trouble if the function is split in the middle, and the
15379 two halves are placed at locations far apart in memory.  This option is
15380 used when compiling @file{crtstuff.c}; you should not need to use it
15381 for anything else.
15382
15383 @item -fverbose-asm
15384 @opindex fverbose-asm
15385 Put extra commentary information in the generated assembly code to
15386 make it more readable.  This option is generally only of use to those
15387 who actually need to read the generated assembly code (perhaps while
15388 debugging the compiler itself).
15389
15390 @option{-fno-verbose-asm}, the default, causes the
15391 extra information to be omitted and is useful when comparing two assembler
15392 files.
15393
15394 @item -frecord-gcc-switches
15395 @opindex frecord-gcc-switches
15396 This switch causes the command line that was used to invoke the
15397 compiler to be recorded into the object file that is being created.
15398 This switch is only implemented on some targets and the exact format
15399 of the recording is target and binary file format dependent, but it
15400 usually takes the form of a section containing ASCII text.  This
15401 switch is related to the @option{-fverbose-asm} switch, but that
15402 switch only records information in the assembler output file as
15403 comments, so it never reaches the object file.
15404
15405 @item -fpic
15406 @opindex fpic
15407 @cindex global offset table
15408 @cindex PIC
15409 Generate position-independent code (PIC) suitable for use in a shared
15410 library, if supported for the target machine.  Such code accesses all
15411 constant addresses through a global offset table (GOT)@.  The dynamic
15412 loader resolves the GOT entries when the program starts (the dynamic
15413 loader is not part of GCC; it is part of the operating system).  If
15414 the GOT size for the linked executable exceeds a machine-specific
15415 maximum size, you get an error message from the linker indicating that
15416 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
15417 instead.  (These maximums are 8k on the SPARC and 32k
15418 on the m68k and RS/6000.  The 386 has no such limit.)
15419
15420 Position-independent code requires special support, and therefore works
15421 only on certain machines.  For the 386, GCC supports PIC for System V
15422 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
15423 position-independent.
15424
15425 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
15426 are defined to 1.
15427
15428 @item -fPIC
15429 @opindex fPIC
15430 If supported for the target machine, emit position-independent code,
15431 suitable for dynamic linking and avoiding any limit on the size of the
15432 global offset table.  This option makes a difference on the m68k,
15433 PowerPC and SPARC@.
15434
15435 Position-independent code requires special support, and therefore works
15436 only on certain machines.
15437
15438 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
15439 are defined to 2.
15440
15441 @item -fpie
15442 @itemx -fPIE
15443 @opindex fpie
15444 @opindex fPIE
15445 These options are similar to @option{-fpic} and @option{-fPIC}, but
15446 generated position independent code can be only linked into executables.
15447 Usually these options are used when @option{-pie} GCC option will be
15448 used during linking.
15449
15450 @option{-fpie} and @option{-fPIE} both define the macros
15451 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
15452 for @option{-fpie} and 2 for @option{-fPIE}.
15453
15454 @item -fno-jump-tables
15455 @opindex fno-jump-tables
15456 Do not use jump tables for switch statements even where it would be
15457 more efficient than other code generation strategies.  This option is
15458 of use in conjunction with @option{-fpic} or @option{-fPIC} for
15459 building code which forms part of a dynamic linker and cannot
15460 reference the address of a jump table.  On some targets, jump tables
15461 do not require a GOT and this option is not needed.
15462
15463 @item -ffixed-@var{reg}
15464 @opindex ffixed
15465 Treat the register named @var{reg} as a fixed register; generated code
15466 should never refer to it (except perhaps as a stack pointer, frame
15467 pointer or in some other fixed role).
15468
15469 @var{reg} must be the name of a register.  The register names accepted
15470 are machine-specific and are defined in the @code{REGISTER_NAMES}
15471 macro in the machine description macro file.
15472
15473 This flag does not have a negative form, because it specifies a
15474 three-way choice.
15475
15476 @item -fcall-used-@var{reg}
15477 @opindex fcall-used
15478 Treat the register named @var{reg} as an allocable register that is
15479 clobbered by function calls.  It may be allocated for temporaries or
15480 variables that do not live across a call.  Functions compiled this way
15481 will not save and restore the register @var{reg}.
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 This flag does not have a negative form, because it specifies a
15488 three-way choice.
15489
15490 @item -fcall-saved-@var{reg}
15491 @opindex fcall-saved
15492 Treat the register named @var{reg} as an allocable register saved by
15493 functions.  It may be allocated even for temporaries or variables that
15494 live across a call.  Functions compiled this way will save and restore
15495 the register @var{reg} if they use it.
15496
15497 It is an error to used this flag with the frame pointer or stack pointer.
15498 Use of this flag for other registers that have fixed pervasive roles in
15499 the machine's execution model will produce disastrous results.
15500
15501 A different sort of disaster will result from the use of this flag for
15502 a register in which function values may be returned.
15503
15504 This flag does not have a negative form, because it specifies a
15505 three-way choice.
15506
15507 @item -fpack-struct[=@var{n}]
15508 @opindex fpack-struct
15509 Without a value specified, pack all structure members together without
15510 holes.  When a value is specified (which must be a small power of two), pack
15511 structure members according to this value, representing the maximum
15512 alignment (that is, objects with default alignment requirements larger than
15513 this will be output potentially unaligned at the next fitting location.
15514
15515 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
15516 code that is not binary compatible with code generated without that switch.
15517 Additionally, it makes the code suboptimal.
15518 Use it to conform to a non-default application binary interface.
15519
15520 @item -finstrument-functions
15521 @opindex finstrument-functions
15522 Generate instrumentation calls for entry and exit to functions.  Just
15523 after function entry and just before function exit, the following
15524 profiling functions will be called with the address of the current
15525 function and its call site.  (On some platforms,
15526 @code{__builtin_return_address} does not work beyond the current
15527 function, so the call site information may not be available to the
15528 profiling functions otherwise.)
15529
15530 @smallexample
15531 void __cyg_profile_func_enter (void *this_fn,
15532                                void *call_site);
15533 void __cyg_profile_func_exit  (void *this_fn,
15534                                void *call_site);
15535 @end smallexample
15536
15537 The first argument is the address of the start of the current function,
15538 which may be looked up exactly in the symbol table.
15539
15540 This instrumentation is also done for functions expanded inline in other
15541 functions.  The profiling calls will indicate where, conceptually, the
15542 inline function is entered and exited.  This means that addressable
15543 versions of such functions must be available.  If all your uses of a
15544 function are expanded inline, this may mean an additional expansion of
15545 code size.  If you use @samp{extern inline} in your C code, an
15546 addressable version of such functions must be provided.  (This is
15547 normally the case anyways, but if you get lucky and the optimizer always
15548 expands the functions inline, you might have gotten away without
15549 providing static copies.)
15550
15551 A function may be given the attribute @code{no_instrument_function}, in
15552 which case this instrumentation will not be done.  This can be used, for
15553 example, for the profiling functions listed above, high-priority
15554 interrupt routines, and any functions from which the profiling functions
15555 cannot safely be called (perhaps signal handlers, if the profiling
15556 routines generate output or allocate memory).
15557
15558 @item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
15559 @opindex finstrument-functions-exclude-file-list
15560
15561 Set the list of functions that are excluded from instrumentation (see
15562 the description of @code{-finstrument-functions}).  If the file that
15563 contains a function definition matches with one of @var{file}, then
15564 that function is not instrumented.  The match is done on substrings:
15565 if the @var{file} parameter is a substring of the file name, it is
15566 considered to be a match.
15567
15568 For example,
15569 @code{-finstrument-functions-exclude-file-list=/bits/stl,include/sys}
15570 will exclude any inline function defined in files whose pathnames
15571 contain @code{/bits/stl} or @code{include/sys}.
15572
15573 If, for some reason, you want to include letter @code{','} in one of
15574 @var{sym}, write @code{'\,'}. For example,
15575 @code{-finstrument-functions-exclude-file-list='\,\,tmp'}
15576 (note the single quote surrounding the option).
15577
15578 @item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{}
15579 @opindex finstrument-functions-exclude-function-list
15580
15581 This is similar to @code{-finstrument-functions-exclude-file-list},
15582 but this option sets the list of function names to be excluded from
15583 instrumentation.  The function name to be matched is its user-visible
15584 name, such as @code{vector<int> blah(const vector<int> &)}, not the
15585 internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}).  The
15586 match is done on substrings: if the @var{sym} parameter is a substring
15587 of the function name, it is considered to be a match.
15588
15589 @item -fstack-check
15590 @opindex fstack-check
15591 Generate code to verify that you do not go beyond the boundary of the
15592 stack.  You should specify this flag if you are running in an
15593 environment with multiple threads, but only rarely need to specify it in
15594 a single-threaded environment since stack overflow is automatically
15595 detected on nearly all systems if there is only one stack.
15596
15597 Note that this switch does not actually cause checking to be done; the
15598 operating system or the language runtime must do that.  The switch causes
15599 generation of code to ensure that they see the stack being extended.
15600
15601 You can additionally specify a string parameter: @code{no} means no
15602 checking, @code{generic} means force the use of old-style checking,
15603 @code{specific} means use the best checking method and is equivalent
15604 to bare @option{-fstack-check}.
15605
15606 Old-style checking is a generic mechanism that requires no specific
15607 target support in the compiler but comes with the following drawbacks:
15608
15609 @enumerate
15610 @item
15611 Modified allocation strategy for large objects: they will always be
15612 allocated dynamically if their size exceeds a fixed threshold.
15613
15614 @item
15615 Fixed limit on the size of the static frame of functions: when it is
15616 topped by a particular function, stack checking is not reliable and
15617 a warning is issued by the compiler.
15618
15619 @item
15620 Inefficiency: because of both the modified allocation strategy and the
15621 generic implementation, the performances of the code are hampered.
15622 @end enumerate
15623
15624 Note that old-style stack checking is also the fallback method for
15625 @code{specific} if no target support has been added in the compiler.
15626
15627 @item -fstack-limit-register=@var{reg}
15628 @itemx -fstack-limit-symbol=@var{sym}
15629 @itemx -fno-stack-limit
15630 @opindex fstack-limit-register
15631 @opindex fstack-limit-symbol
15632 @opindex fno-stack-limit
15633 Generate code to ensure that the stack does not grow beyond a certain value,
15634 either the value of a register or the address of a symbol.  If the stack
15635 would grow beyond the value, a signal is raised.  For most targets,
15636 the signal is raised before the stack overruns the boundary, so
15637 it is possible to catch the signal without taking special precautions.
15638
15639 For instance, if the stack starts at absolute address @samp{0x80000000}
15640 and grows downwards, you can use the flags
15641 @option{-fstack-limit-symbol=__stack_limit} and
15642 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
15643 of 128KB@.  Note that this may only work with the GNU linker.
15644
15645 @cindex aliasing of parameters
15646 @cindex parameters, aliased
15647 @item -fargument-alias
15648 @itemx -fargument-noalias
15649 @itemx -fargument-noalias-global
15650 @itemx -fargument-noalias-anything
15651 @opindex fargument-alias
15652 @opindex fargument-noalias
15653 @opindex fargument-noalias-global
15654 @opindex fargument-noalias-anything
15655 Specify the possible relationships among parameters and between
15656 parameters and global data.
15657
15658 @option{-fargument-alias} specifies that arguments (parameters) may
15659 alias each other and may alias global storage.@*
15660 @option{-fargument-noalias} specifies that arguments do not alias
15661 each other, but may alias global storage.@*
15662 @option{-fargument-noalias-global} specifies that arguments do not
15663 alias each other and do not alias global storage.
15664 @option{-fargument-noalias-anything} specifies that arguments do not
15665 alias any other storage.
15666
15667 Each language will automatically use whatever option is required by
15668 the language standard.  You should not need to use these options yourself.
15669
15670 @item -fleading-underscore
15671 @opindex fleading-underscore
15672 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
15673 change the way C symbols are represented in the object file.  One use
15674 is to help link with legacy assembly code.
15675
15676 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
15677 generate code that is not binary compatible with code generated without that
15678 switch.  Use it to conform to a non-default application binary interface.
15679 Not all targets provide complete support for this switch.
15680
15681 @item -ftls-model=@var{model}
15682 @opindex ftls-model
15683 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
15684 The @var{model} argument should be one of @code{global-dynamic},
15685 @code{local-dynamic}, @code{initial-exec} or @code{local-exec}.
15686
15687 The default without @option{-fpic} is @code{initial-exec}; with
15688 @option{-fpic} the default is @code{global-dynamic}.
15689
15690 @item -fvisibility=@var{default|internal|hidden|protected}
15691 @opindex fvisibility
15692 Set the default ELF image symbol visibility to the specified option---all
15693 symbols will be marked with this unless overridden within the code.
15694 Using this feature can very substantially improve linking and
15695 load times of shared object libraries, produce more optimized
15696 code, provide near-perfect API export and prevent symbol clashes.
15697 It is @strong{strongly} recommended that you use this in any shared objects
15698 you distribute.
15699
15700 Despite the nomenclature, @code{default} always means public ie;
15701 available to be linked against from outside the shared object.
15702 @code{protected} and @code{internal} are pretty useless in real-world
15703 usage so the only other commonly used option will be @code{hidden}.
15704 The default if @option{-fvisibility} isn't specified is
15705 @code{default}, i.e., make every
15706 symbol public---this causes the same behavior as previous versions of
15707 GCC@.
15708
15709 A good explanation of the benefits offered by ensuring ELF
15710 symbols have the correct visibility is given by ``How To Write
15711 Shared Libraries'' by Ulrich Drepper (which can be found at
15712 @w{@uref{http://people.redhat.com/~drepper/}})---however a superior
15713 solution made possible by this option to marking things hidden when
15714 the default is public is to make the default hidden and mark things
15715 public.  This is the norm with DLL's on Windows and with @option{-fvisibility=hidden}
15716 and @code{__attribute__ ((visibility("default")))} instead of
15717 @code{__declspec(dllexport)} you get almost identical semantics with
15718 identical syntax.  This is a great boon to those working with
15719 cross-platform projects.
15720
15721 For those adding visibility support to existing code, you may find
15722 @samp{#pragma GCC visibility} of use.  This works by you enclosing
15723 the declarations you wish to set visibility for with (for example)
15724 @samp{#pragma GCC visibility push(hidden)} and
15725 @samp{#pragma GCC visibility pop}.
15726 Bear in mind that symbol visibility should be viewed @strong{as
15727 part of the API interface contract} and thus all new code should
15728 always specify visibility when it is not the default ie; declarations
15729 only for use within the local DSO should @strong{always} be marked explicitly
15730 as hidden as so to avoid PLT indirection overheads---making this
15731 abundantly clear also aids readability and self-documentation of the code.
15732 Note that due to ISO C++ specification requirements, operator new and
15733 operator delete must always be of default visibility.
15734
15735 Be aware that headers from outside your project, in particular system
15736 headers and headers from any other library you use, may not be
15737 expecting to be compiled with visibility other than the default.  You
15738 may need to explicitly say @samp{#pragma GCC visibility push(default)}
15739 before including any such headers.
15740
15741 @samp{extern} declarations are not affected by @samp{-fvisibility}, so
15742 a lot of code can be recompiled with @samp{-fvisibility=hidden} with
15743 no modifications.  However, this means that calls to @samp{extern}
15744 functions with no explicit visibility will use the PLT, so it is more
15745 effective to use @samp{__attribute ((visibility))} and/or
15746 @samp{#pragma GCC visibility} to tell the compiler which @samp{extern}
15747 declarations should be treated as hidden.
15748
15749 Note that @samp{-fvisibility} does affect C++ vague linkage
15750 entities. This means that, for instance, an exception class that will
15751 be thrown between DSOs must be explicitly marked with default
15752 visibility so that the @samp{type_info} nodes will be unified between
15753 the DSOs.
15754
15755 An overview of these techniques, their benefits and how to use them
15756 is at @w{@uref{http://gcc.gnu.org/wiki/Visibility}}.
15757
15758 @end table
15759
15760 @c man end
15761
15762 @node Environment Variables
15763 @section Environment Variables Affecting GCC
15764 @cindex environment variables
15765
15766 @c man begin ENVIRONMENT
15767 This section describes several environment variables that affect how GCC
15768 operates.  Some of them work by specifying directories or prefixes to use
15769 when searching for various kinds of files.  Some are used to specify other
15770 aspects of the compilation environment.
15771
15772 Note that you can also specify places to search using options such as
15773 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
15774 take precedence over places specified using environment variables, which
15775 in turn take precedence over those specified by the configuration of GCC@.
15776 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
15777 GNU Compiler Collection (GCC) Internals}.
15778
15779 @table @env
15780 @item LANG
15781 @itemx LC_CTYPE
15782 @c @itemx LC_COLLATE
15783 @itemx LC_MESSAGES
15784 @c @itemx LC_MONETARY
15785 @c @itemx LC_NUMERIC
15786 @c @itemx LC_TIME
15787 @itemx LC_ALL
15788 @findex LANG
15789 @findex LC_CTYPE
15790 @c @findex LC_COLLATE
15791 @findex LC_MESSAGES
15792 @c @findex LC_MONETARY
15793 @c @findex LC_NUMERIC
15794 @c @findex LC_TIME
15795 @findex LC_ALL
15796 @cindex locale
15797 These environment variables control the way that GCC uses
15798 localization information that allow GCC to work with different
15799 national conventions.  GCC inspects the locale categories
15800 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
15801 so.  These locale categories can be set to any value supported by your
15802 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
15803 Kingdom encoded in UTF-8.
15804
15805 The @env{LC_CTYPE} environment variable specifies character
15806 classification.  GCC uses it to determine the character boundaries in
15807 a string; this is needed for some multibyte encodings that contain quote
15808 and escape characters that would otherwise be interpreted as a string
15809 end or escape.
15810
15811 The @env{LC_MESSAGES} environment variable specifies the language to
15812 use in diagnostic messages.
15813
15814 If the @env{LC_ALL} environment variable is set, it overrides the value
15815 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
15816 and @env{LC_MESSAGES} default to the value of the @env{LANG}
15817 environment variable.  If none of these variables are set, GCC
15818 defaults to traditional C English behavior.
15819
15820 @item TMPDIR
15821 @findex TMPDIR
15822 If @env{TMPDIR} is set, it specifies the directory to use for temporary
15823 files.  GCC uses temporary files to hold the output of one stage of
15824 compilation which is to be used as input to the next stage: for example,
15825 the output of the preprocessor, which is the input to the compiler
15826 proper.
15827
15828 @item GCC_EXEC_PREFIX
15829 @findex GCC_EXEC_PREFIX
15830 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
15831 names of the subprograms executed by the compiler.  No slash is added
15832 when this prefix is combined with the name of a subprogram, but you can
15833 specify a prefix that ends with a slash if you wish.
15834
15835 If @env{GCC_EXEC_PREFIX} is not set, GCC will attempt to figure out
15836 an appropriate prefix to use based on the pathname it was invoked with.
15837
15838 If GCC cannot find the subprogram using the specified prefix, it
15839 tries looking in the usual places for the subprogram.
15840
15841 The default value of @env{GCC_EXEC_PREFIX} is
15842 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
15843 the installed compiler. In many cases @var{prefix} is the value
15844 of @code{prefix} when you ran the @file{configure} script.
15845
15846 Other prefixes specified with @option{-B} take precedence over this prefix.
15847
15848 This prefix is also used for finding files such as @file{crt0.o} that are
15849 used for linking.
15850
15851 In addition, the prefix is used in an unusual way in finding the
15852 directories to search for header files.  For each of the standard
15853 directories whose name normally begins with @samp{/usr/local/lib/gcc}
15854 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
15855 replacing that beginning with the specified prefix to produce an
15856 alternate directory name.  Thus, with @option{-Bfoo/}, GCC will search
15857 @file{foo/bar} where it would normally search @file{/usr/local/lib/bar}.
15858 These alternate directories are searched first; the standard directories
15859 come next. If a standard directory begins with the configured
15860 @var{prefix} then the value of @var{prefix} is replaced by
15861 @env{GCC_EXEC_PREFIX} when looking for header files.
15862
15863 @item COMPILER_PATH
15864 @findex COMPILER_PATH
15865 The value of @env{COMPILER_PATH} is a colon-separated list of
15866 directories, much like @env{PATH}.  GCC tries the directories thus
15867 specified when searching for subprograms, if it can't find the
15868 subprograms using @env{GCC_EXEC_PREFIX}.
15869
15870 @item LIBRARY_PATH
15871 @findex LIBRARY_PATH
15872 The value of @env{LIBRARY_PATH} is a colon-separated list of
15873 directories, much like @env{PATH}.  When configured as a native compiler,
15874 GCC tries the directories thus specified when searching for special
15875 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
15876 using GCC also uses these directories when searching for ordinary
15877 libraries for the @option{-l} option (but directories specified with
15878 @option{-L} come first).
15879
15880 @item LANG
15881 @findex LANG
15882 @cindex locale definition
15883 This variable is used to pass locale information to the compiler.  One way in
15884 which this information is used is to determine the character set to be used
15885 when character literals, string literals and comments are parsed in C and C++.
15886 When the compiler is configured to allow multibyte characters,
15887 the following values for @env{LANG} are recognized:
15888
15889 @table @samp
15890 @item C-JIS
15891 Recognize JIS characters.
15892 @item C-SJIS
15893 Recognize SJIS characters.
15894 @item C-EUCJP
15895 Recognize EUCJP characters.
15896 @end table
15897
15898 If @env{LANG} is not defined, or if it has some other value, then the
15899 compiler will use mblen and mbtowc as defined by the default locale to
15900 recognize and translate multibyte characters.
15901 @end table
15902
15903 @noindent
15904 Some additional environments variables affect the behavior of the
15905 preprocessor.
15906
15907 @include cppenv.texi
15908
15909 @c man end
15910
15911 @node Precompiled Headers
15912 @section Using Precompiled Headers
15913 @cindex precompiled headers
15914 @cindex speed of compilation
15915
15916 Often large projects have many header files that are included in every
15917 source file.  The time the compiler takes to process these header files
15918 over and over again can account for nearly all of the time required to
15919 build the project.  To make builds faster, GCC allows users to
15920 `precompile' a header file; then, if builds can use the precompiled
15921 header file they will be much faster.
15922
15923 To create a precompiled header file, simply compile it as you would any
15924 other file, if necessary using the @option{-x} option to make the driver
15925 treat it as a C or C++ header file.  You will probably want to use a
15926 tool like @command{make} to keep the precompiled header up-to-date when
15927 the headers it contains change.
15928
15929 A precompiled header file will be searched for when @code{#include} is
15930 seen in the compilation.  As it searches for the included file
15931 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
15932 compiler looks for a precompiled header in each directory just before it
15933 looks for the include file in that directory.  The name searched for is
15934 the name specified in the @code{#include} with @samp{.gch} appended.  If
15935 the precompiled header file can't be used, it is ignored.
15936
15937 For instance, if you have @code{#include "all.h"}, and you have
15938 @file{all.h.gch} in the same directory as @file{all.h}, then the
15939 precompiled header file will be used if possible, and the original
15940 header will be used otherwise.
15941
15942 Alternatively, you might decide to put the precompiled header file in a
15943 directory and use @option{-I} to ensure that directory is searched
15944 before (or instead of) the directory containing the original header.
15945 Then, if you want to check that the precompiled header file is always
15946 used, you can put a file of the same name as the original header in this
15947 directory containing an @code{#error} command.
15948
15949 This also works with @option{-include}.  So yet another way to use
15950 precompiled headers, good for projects not designed with precompiled
15951 header files in mind, is to simply take most of the header files used by
15952 a project, include them from another header file, precompile that header
15953 file, and @option{-include} the precompiled header.  If the header files
15954 have guards against multiple inclusion, they will be skipped because
15955 they've already been included (in the precompiled header).
15956
15957 If you need to precompile the same header file for different
15958 languages, targets, or compiler options, you can instead make a
15959 @emph{directory} named like @file{all.h.gch}, and put each precompiled
15960 header in the directory, perhaps using @option{-o}.  It doesn't matter
15961 what you call the files in the directory, every precompiled header in
15962 the directory will be considered.  The first precompiled header
15963 encountered in the directory that is valid for this compilation will
15964 be used; they're searched in no particular order.
15965
15966 There are many other possibilities, limited only by your imagination,
15967 good sense, and the constraints of your build system.
15968
15969 A precompiled header file can be used only when these conditions apply:
15970
15971 @itemize
15972 @item
15973 Only one precompiled header can be used in a particular compilation.
15974
15975 @item
15976 A precompiled header can't be used once the first C token is seen.  You
15977 can have preprocessor directives before a precompiled header; you can
15978 even include a precompiled header from inside another header, so long as
15979 there are no C tokens before the @code{#include}.
15980
15981 @item
15982 The precompiled header file must be produced for the same language as
15983 the current compilation.  You can't use a C precompiled header for a C++
15984 compilation.
15985
15986 @item
15987 The precompiled header file must have been produced by the same compiler
15988 binary as the current compilation is using.
15989
15990 @item
15991 Any macros defined before the precompiled header is included must
15992 either be defined in the same way as when the precompiled header was
15993 generated, or must not affect the precompiled header, which usually
15994 means that they don't appear in the precompiled header at all.
15995
15996 The @option{-D} option is one way to define a macro before a
15997 precompiled header is included; using a @code{#define} can also do it.
15998 There are also some options that define macros implicitly, like
15999 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
16000 defined this way.
16001
16002 @item If debugging information is output when using the precompiled
16003 header, using @option{-g} or similar, the same kind of debugging information
16004 must have been output when building the precompiled header.  However,
16005 a precompiled header built using @option{-g} can be used in a compilation
16006 when no debugging information is being output.
16007
16008 @item The same @option{-m} options must generally be used when building
16009 and using the precompiled header.  @xref{Submodel Options},
16010 for any cases where this rule is relaxed.
16011
16012 @item Each of the following options must be the same when building and using
16013 the precompiled header:
16014
16015 @gccoptlist{-fexceptions}
16016
16017 @item
16018 Some other command-line options starting with @option{-f},
16019 @option{-p}, or @option{-O} must be defined in the same way as when
16020 the precompiled header was generated.  At present, it's not clear
16021 which options are safe to change and which are not; the safest choice
16022 is to use exactly the same options when generating and using the
16023 precompiled header.  The following are known to be safe:
16024
16025 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
16026 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
16027 -fsched-verbose=<number>  -fschedule-insns  -fvisibility= @gol
16028 -pedantic-errors}
16029
16030 @end itemize
16031
16032 For all of these except the last, the compiler will automatically
16033 ignore the precompiled header if the conditions aren't met.  If you
16034 find an option combination that doesn't work and doesn't cause the
16035 precompiled header to be ignored, please consider filing a bug report,
16036 see @ref{Bugs}.
16037
16038 If you do use differing options when generating and using the
16039 precompiled header, the actual behavior will be a mixture of the
16040 behavior for the options.  For instance, if you use @option{-g} to
16041 generate the precompiled header but not when using it, you may or may
16042 not get debugging information for routines in the precompiled header.
16043
16044 @node Running Protoize
16045 @section Running Protoize
16046
16047 The program @code{protoize} is an optional part of GCC@.  You can use
16048 it to add prototypes to a program, thus converting the program to ISO
16049 C in one respect.  The companion program @code{unprotoize} does the
16050 reverse: it removes argument types from any prototypes that are found.
16051
16052 When you run these programs, you must specify a set of source files as
16053 command line arguments.  The conversion programs start out by compiling
16054 these files to see what functions they define.  The information gathered
16055 about a file @var{foo} is saved in a file named @file{@var{foo}.X}.
16056
16057 After scanning comes actual conversion.  The specified files are all
16058 eligible to be converted; any files they include (whether sources or
16059 just headers) are eligible as well.
16060
16061 But not all the eligible files are converted.  By default,
16062 @code{protoize} and @code{unprotoize} convert only source and header
16063 files in the current directory.  You can specify additional directories
16064 whose files should be converted with the @option{-d @var{directory}}
16065 option.  You can also specify particular files to exclude with the
16066 @option{-x @var{file}} option.  A file is converted if it is eligible, its
16067 directory name matches one of the specified directory names, and its
16068 name within the directory has not been excluded.
16069
16070 Basic conversion with @code{protoize} consists of rewriting most
16071 function definitions and function declarations to specify the types of
16072 the arguments.  The only ones not rewritten are those for varargs
16073 functions.
16074
16075 @code{protoize} optionally inserts prototype declarations at the
16076 beginning of the source file, to make them available for any calls that
16077 precede the function's definition.  Or it can insert prototype
16078 declarations with block scope in the blocks where undeclared functions
16079 are called.
16080
16081 Basic conversion with @code{unprotoize} consists of rewriting most
16082 function declarations to remove any argument types, and rewriting
16083 function definitions to the old-style pre-ISO form.
16084
16085 Both conversion programs print a warning for any function declaration or
16086 definition that they can't convert.  You can suppress these warnings
16087 with @option{-q}.
16088
16089 The output from @code{protoize} or @code{unprotoize} replaces the
16090 original source file.  The original file is renamed to a name ending
16091 with @samp{.save} (for DOS, the saved filename ends in @samp{.sav}
16092 without the original @samp{.c} suffix).  If the @samp{.save} (@samp{.sav}
16093 for DOS) file already exists, then the source file is simply discarded.
16094
16095 @code{protoize} and @code{unprotoize} both depend on GCC itself to
16096 scan the program and collect information about the functions it uses.
16097 So neither of these programs will work until GCC is installed.
16098
16099 Here is a table of the options you can use with @code{protoize} and
16100 @code{unprotoize}.  Each option works with both programs unless
16101 otherwise stated.
16102
16103 @table @code
16104 @item -B @var{directory}
16105 Look for the file @file{SYSCALLS.c.X} in @var{directory}, instead of the
16106 usual directory (normally @file{/usr/local/lib}).  This file contains
16107 prototype information about standard system functions.  This option
16108 applies only to @code{protoize}.
16109
16110 @item -c @var{compilation-options}
16111 Use @var{compilation-options} as the options when running @command{gcc} to
16112 produce the @samp{.X} files.  The special option @option{-aux-info} is
16113 always passed in addition, to tell @command{gcc} to write a @samp{.X} file.
16114
16115 Note that the compilation options must be given as a single argument to
16116 @code{protoize} or @code{unprotoize}.  If you want to specify several
16117 @command{gcc} options, you must quote the entire set of compilation options
16118 to make them a single word in the shell.
16119
16120 There are certain @command{gcc} arguments that you cannot use, because they
16121 would produce the wrong kind of output.  These include @option{-g},
16122 @option{-O}, @option{-c}, @option{-S}, and @option{-o} If you include these in
16123 the @var{compilation-options}, they are ignored.
16124
16125 @item -C
16126 Rename files to end in @samp{.C} (@samp{.cc} for DOS-based file
16127 systems) instead of @samp{.c}.  This is convenient if you are converting
16128 a C program to C++.  This option applies only to @code{protoize}.
16129
16130 @item -g
16131 Add explicit global declarations.  This means inserting explicit
16132 declarations at the beginning of each source file for each function
16133 that is called in the file and was not declared.  These declarations
16134 precede the first function definition that contains a call to an
16135 undeclared function.  This option applies only to @code{protoize}.
16136
16137 @item -i @var{string}
16138 Indent old-style parameter declarations with the string @var{string}.
16139 This option applies only to @code{protoize}.
16140
16141 @code{unprotoize} converts prototyped function definitions to old-style
16142 function definitions, where the arguments are declared between the
16143 argument list and the initial @samp{@{}.  By default, @code{unprotoize}
16144 uses five spaces as the indentation.  If you want to indent with just
16145 one space instead, use @option{-i " "}.
16146
16147 @item -k
16148 Keep the @samp{.X} files.  Normally, they are deleted after conversion
16149 is finished.
16150
16151 @item -l
16152 Add explicit local declarations.  @code{protoize} with @option{-l} inserts
16153 a prototype declaration for each function in each block which calls the
16154 function without any declaration.  This option applies only to
16155 @code{protoize}.
16156
16157 @item -n
16158 Make no real changes.  This mode just prints information about the conversions
16159 that would have been done without @option{-n}.
16160
16161 @item -N
16162 Make no @samp{.save} files.  The original files are simply deleted.
16163 Use this option with caution.
16164
16165 @item -p @var{program}
16166 Use the program @var{program} as the compiler.  Normally, the name
16167 @file{gcc} is used.
16168
16169 @item -q
16170 Work quietly.  Most warnings are suppressed.
16171
16172 @item -v
16173 Print the version number, just like @option{-v} for @command{gcc}.
16174 @end table
16175
16176 If you need special compiler options to compile one of your program's
16177 source files, then you should generate that file's @samp{.X} file
16178 specially, by running @command{gcc} on that source file with the
16179 appropriate options and the option @option{-aux-info}.  Then run
16180 @code{protoize} on the entire set of files.  @code{protoize} will use
16181 the existing @samp{.X} file because it is newer than the source file.
16182 For example:
16183
16184 @smallexample
16185 gcc -Dfoo=bar file1.c -aux-info file1.X
16186 protoize *.c
16187 @end smallexample
16188
16189 @noindent
16190 You need to include the special files along with the rest in the
16191 @code{protoize} command, even though their @samp{.X} files already
16192 exist, because otherwise they won't get converted.
16193
16194 @xref{Protoize Caveats}, for more information on how to use
16195 @code{protoize} successfully.