OSDN Git Service

2008-09-29 H.J. Lu <hongjiu.lu@intel.com>
[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 -Wno-builtin-macro-redefined @gol
232 -Wc++-compat -Wc++0x-compat -Wcast-align  -Wcast-qual  @gol
233 -Wchar-subscripts -Wclobbered  -Wcomment @gol
234 -Wconversion  -Wcoverage-mismatch  -Wno-deprecated  @gol
235 -Wno-deprecated-declarations -Wdisabled-optimization  @gol
236 -Wdisallowed-function-list=@var{sym},@var{sym},@dots{} @gol
237 -Wno-div-by-zero -Wempty-body  -Wenum-compare -Wno-endif-labels @gol
238 -Werror  -Werror=* @gol
239 -Wfatal-errors  -Wfloat-equal  -Wformat  -Wformat=2 @gol
240 -Wno-format-contains-nul -Wno-format-extra-args -Wformat-nonliteral @gol
241 -Wformat-security  -Wformat-y2k @gol
242 -Wframe-larger-than=@var{len} -Wignored-qualifiers @gol
243 -Wimplicit  -Wimplicit-function-declaration  -Wimplicit-int @gol
244 -Winit-self  -Winline @gol
245 -Wno-int-to-pointer-cast -Wno-invalid-offsetof @gol
246 -Winvalid-pch -Wlarger-than=@var{len}  -Wunsafe-loop-optimizations @gol
247 -Wlogical-op -Wlong-long @gol
248 -Wmain  -Wmissing-braces  -Wmissing-field-initializers @gol
249 -Wmissing-format-attribute  -Wmissing-include-dirs @gol
250 -Wmissing-noreturn  -Wno-mudflap @gol
251 -Wno-multichar  -Wnonnull  -Wno-overflow @gol
252 -Woverlength-strings  -Wpacked  -Wpadded @gol
253 -Wparentheses  -Wpointer-arith  -Wno-pointer-to-int-cast @gol
254 -Wredundant-decls @gol
255 -Wreturn-type  -Wsequence-point  -Wshadow @gol
256 -Wsign-compare  -Wsign-conversion  -Wstack-protector @gol
257 -Wstrict-aliasing -Wstrict-aliasing=n @gol
258 -Wstrict-overflow -Wstrict-overflow=@var{n} @gol
259 -Wswitch  -Wswitch-default  -Wswitch-enum @gol
260 -Wsystem-headers  -Wtrigraphs  -Wtype-limits  -Wundef  -Wuninitialized @gol
261 -Wunknown-pragmas  -Wno-pragmas -Wunreachable-code @gol
262 -Wunused  -Wunused-function  -Wunused-label  -Wunused-parameter @gol
263 -Wunused-value  -Wunused-variable @gol
264 -Wvariadic-macros -Wvla @gol
265 -Wvolatile-register-var  -Wwrite-strings}
266
267 @item C and Objective-C-only Warning Options
268 @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
269 -Wmissing-parameter-type  -Wmissing-prototypes  -Wnested-externs @gol
270 -Wold-style-declaration  -Wold-style-definition @gol
271 -Wstrict-prototypes  -Wtraditional  -Wtraditional-conversion @gol
272 -Wdeclaration-after-statement -Wpointer-sign}
273
274 @item Debugging Options
275 @xref{Debugging Options,,Options for Debugging Your Program or GCC}.
276 @gccoptlist{-d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
277 -fdbg-cnt-list -fdbg-cnt=@var{counter-value-list} @gol
278 -fdump-noaddr -fdump-unnumbered @gol
279 -fdump-translation-unit@r{[}-@var{n}@r{]} @gol
280 -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
281 -fdump-ipa-all -fdump-ipa-cgraph -fdump-ipa-inline @gol
282 -fdump-statistics @gol
283 -fdump-tree-all @gol
284 -fdump-tree-original@r{[}-@var{n}@r{]}  @gol
285 -fdump-tree-optimized@r{[}-@var{n}@r{]} @gol
286 -fdump-tree-cfg -fdump-tree-vcg -fdump-tree-alias @gol
287 -fdump-tree-ch @gol
288 -fdump-tree-ssa@r{[}-@var{n}@r{]} -fdump-tree-pre@r{[}-@var{n}@r{]} @gol
289 -fdump-tree-ccp@r{[}-@var{n}@r{]} -fdump-tree-dce@r{[}-@var{n}@r{]} @gol
290 -fdump-tree-gimple@r{[}-raw@r{]} -fdump-tree-mudflap@r{[}-@var{n}@r{]} @gol
291 -fdump-tree-dom@r{[}-@var{n}@r{]} @gol
292 -fdump-tree-dse@r{[}-@var{n}@r{]} @gol
293 -fdump-tree-phiopt@r{[}-@var{n}@r{]} @gol
294 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
295 -fdump-tree-copyrename@r{[}-@var{n}@r{]} @gol
296 -fdump-tree-nrv -fdump-tree-vect @gol
297 -fdump-tree-sink @gol
298 -fdump-tree-sra@r{[}-@var{n}@r{]} @gol
299 -fdump-tree-fre@r{[}-@var{n}@r{]} @gol
300 -fdump-tree-vrp@r{[}-@var{n}@r{]} @gol
301 -ftree-vectorizer-verbose=@var{n} @gol
302 -fdump-tree-storeccp@r{[}-@var{n}@r{]} @gol
303 -feliminate-dwarf2-dups -feliminate-unused-debug-types @gol
304 -feliminate-unused-debug-symbols -femit-class-debug-always @gol
305 -fmem-report -fpre-ipa-mem-report -fpost-ipa-mem-report -fprofile-arcs @gol
306 -frandom-seed=@var{string} -fsched-verbose=@var{n} @gol
307 -fsel-sched-verbose -fsel-sched-dump-cfg -fsel-sched-pipelining-verbose @gol
308 -ftest-coverage  -ftime-report -fvar-tracking @gol
309 -g  -g@var{level}  -gcoff -gdwarf-2 @gol
310 -ggdb  -gstabs  -gstabs+  -gvms  -gxcoff  -gxcoff+ @gol
311 -fno-merge-debug-strings -fno-dwarf2-cfi-asm @gol
312 -fdebug-prefix-map=@var{old}=@var{new} @gol
313 -femit-struct-debug-baseonly -femit-struct-debug-reduced @gol
314 -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol
315 -p  -pg  -print-file-name=@var{library}  -print-libgcc-file-name @gol
316 -print-multi-directory  -print-multi-lib @gol
317 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
318 -print-sysroot -print-sysroot-headers-suffix @gol
319 -save-temps  -time}
320
321 @item Optimization Options
322 @xref{Optimize Options,,Options that Control Optimization}.
323 @gccoptlist{
324 -falign-functions[=@var{n}] -falign-jumps[=@var{n}] @gol
325 -falign-labels[=@var{n}] -falign-loops[=@var{n}] -fassociative-math @gol
326 -fauto-inc-dec -fbranch-probabilities -fbranch-target-load-optimize @gol
327 -fbranch-target-load-optimize2 -fbtr-bb-exclusive -fcaller-saves @gol
328 -fcheck-data-deps -fconserve-stack -fcprop-registers -fcrossjumping @gol
329 -fcse-follow-jumps -fcse-skip-blocks -fcx-fortran-rules -fcx-limited-range @gol
330 -fdata-sections -fdce -fdce @gol
331 -fdelayed-branch -fdelete-null-pointer-checks -fdse -fdse @gol
332 -fearly-inlining -fexpensive-optimizations -ffast-math @gol
333 -ffinite-math-only -ffloat-store -fforward-propagate @gol
334 -ffunction-sections -fgcse -fgcse-after-reload -fgcse-las -fgcse-lm @gol
335 -fgcse-sm -fif-conversion -fif-conversion2 -findirect-inlining @gol
336 -finline-functions -finline-functions-called-once -finline-limit=@var{n} @gol
337 -finline-small-functions -fipa-cp -fipa-cp-clone -fipa-marix-reorg -fipa-pta @gol 
338 -fipa-pure-const -fipa-reference -fipa-struct-reorg @gol
339 -fipa-type-escape -fira -fira-algorithm=@var{algorithm} @gol
340 -fira-coalesce -fno-ira-share-save-slots @gol
341 -fno-ira-share-spill-slots -fira-verbose=@var{n} @gol
342 -fivopts -fkeep-inline-functions -fkeep-static-consts @gol
343 -floop-block -floop-interchange -floop-strip-mine @gol
344 -fmerge-all-constants -fmerge-constants -fmodulo-sched @gol
345 -fmodulo-sched-allow-regmoves -fmove-loop-invariants -fmudflap @gol
346 -fmudflapir -fmudflapth -fno-branch-count-reg -fno-default-inline @gol
347 -fno-defer-pop -fno-function-cse -fno-guess-branch-probability @gol
348 -fno-inline -fno-math-errno -fno-peephole -fno-peephole2 @gol
349 -fno-sched-interblock -fno-sched-spec -fno-signed-zeros @gol
350 -fno-toplevel-reorder -fno-trapping-math -fno-zero-initialized-in-bss @gol
351 -fomit-frame-pointer -foptimize-register-move -foptimize-sibling-calls @gol
352 -fpeel-loops -fpredictive-commoning -fprefetch-loop-arrays @gol
353 -fprofile-correction -fprofile-dir=@var{path} -fprofile-generate @gol
354 -fprofile-generate=@var{path} @gol
355 -fprofile-use -fprofile-use=@var{path} -fprofile-values @gol
356 -freciprocal-math -fregmove -frename-registers -freorder-blocks @gol
357 -freorder-blocks-and-partition -freorder-functions @gol
358 -frerun-cse-after-loop -freschedule-modulo-scheduled-loops @gol
359 -frounding-math -frtl-abstract-sequences -fsched2-use-superblocks @gol
360 -fsched2-use-traces -fsched-spec-load -fsched-spec-load-dangerous @gol
361 -fsched-stalled-insns-dep[=@var{n}] -fsched-stalled-insns[=@var{n}] @gol
362 -fschedule-insns -fschedule-insns2 -fsection-anchors -fsee @gol
363 -fselective-scheduling -fselective-scheduling2 @gol
364 -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops @gol
365 -fsignaling-nans -fsingle-precision-constant -fsplit-ivs-in-unroller @gol
366 -fsplit-wide-types -fstack-protector -fstack-protector-all @gol
367 -fstrict-aliasing -fstrict-overflow -fthread-jumps -ftracer @gol
368 -ftree-builtin-call-dce -ftree-ccp -ftree-ch -ftree-copy-prop @gol
369 -ftree-copyrename -ftree-dce @gol
370 -ftree-dominator-opts -ftree-dse -ftree-fre -ftree-loop-im @gol
371 -ftree-loop-distribution @gol
372 -ftree-loop-ivcanon -ftree-loop-linear -ftree-loop-optimize @gol
373 -ftree-parallelize-loops=@var{n} -ftree-pre -ftree-reassoc @gol
374 -ftree-sink -ftree-sra -ftree-switch-conversion @gol
375 -ftree-ter -ftree-vect-loop-version -ftree-vectorize -ftree-vrp @gol
376 -funit-at-a-time -funroll-all-loops -funroll-loops @gol
377 -funsafe-loop-optimizations -funsafe-math-optimizations -funswitch-loops @gol
378 -fvariable-expansion-in-unroller -fvect-cost-model -fvpt -fweb @gol
379 -fwhole-program @gol
380 --param @var{name}=@var{value}
381 -O  -O0  -O1  -O2  -O3  -Os}
382
383 @item Preprocessor Options
384 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
385 @gccoptlist{-A@var{question}=@var{answer} @gol
386 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
387 -C  -dD  -dI  -dM  -dN @gol
388 -D@var{macro}@r{[}=@var{defn}@r{]}  -E  -H @gol
389 -idirafter @var{dir} @gol
390 -include @var{file}  -imacros @var{file} @gol
391 -iprefix @var{file}  -iwithprefix @var{dir} @gol
392 -iwithprefixbefore @var{dir}  -isystem @var{dir} @gol
393 -imultilib @var{dir} -isysroot @var{dir} @gol
394 -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  @gol
395 -P  -fworking-directory  -remap @gol
396 -trigraphs  -undef  -U@var{macro}  -Wp,@var{option} @gol
397 -Xpreprocessor @var{option}}
398
399 @item Assembler Option
400 @xref{Assembler Options,,Passing Options to the Assembler}.
401 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
402
403 @item Linker Options
404 @xref{Link Options,,Options for Linking}.
405 @gccoptlist{@var{object-file-name}  -l@var{library} @gol
406 -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic @gol
407 -s  -static  -static-libgcc  -shared  -shared-libgcc  -symbolic @gol
408 -Wl,@var{option}  -Xlinker @var{option} @gol
409 -u @var{symbol}}
410
411 @item Directory Options
412 @xref{Directory Options,,Options for Directory Search}.
413 @gccoptlist{-B@var{prefix}  -I@var{dir}  -iquote@var{dir}  -L@var{dir}
414 -specs=@var{file}  -I- --sysroot=@var{dir}}
415
416 @item Target Options
417 @c I wrote this xref this way to avoid overfull hbox. -- rms
418 @xref{Target Options}.
419 @gccoptlist{-V @var{version}  -b @var{machine}}
420
421 @item Machine Dependent Options
422 @xref{Submodel Options,,Hardware Models and Configurations}.
423 @c This list is ordered alphanumerically by subsection name.
424 @c Try and put the significant identifier (CPU or system) first,
425 @c so users have a clue at guessing where the ones they want will be.
426
427 @emph{ARC Options}
428 @gccoptlist{-EB  -EL @gol
429 -mmangle-cpu  -mcpu=@var{cpu}  -mtext=@var{text-section} @gol
430 -mdata=@var{data-section}  -mrodata=@var{readonly-data-section}}
431
432 @emph{ARM Options}
433 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
434 -mabi=@var{name} @gol
435 -mapcs-stack-check  -mno-apcs-stack-check @gol
436 -mapcs-float  -mno-apcs-float @gol
437 -mapcs-reentrant  -mno-apcs-reentrant @gol
438 -msched-prolog  -mno-sched-prolog @gol
439 -mlittle-endian  -mbig-endian  -mwords-little-endian @gol
440 -mfloat-abi=@var{name}  -msoft-float  -mhard-float  -mfpe @gol
441 -mthumb-interwork  -mno-thumb-interwork @gol
442 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
443 -mstructure-size-boundary=@var{n} @gol
444 -mabort-on-noreturn @gol
445 -mlong-calls  -mno-long-calls @gol
446 -msingle-pic-base  -mno-single-pic-base @gol
447 -mpic-register=@var{reg} @gol
448 -mnop-fun-dllimport @gol
449 -mcirrus-fix-invalid-insns -mno-cirrus-fix-invalid-insns @gol
450 -mpoke-function-name @gol
451 -mthumb  -marm @gol
452 -mtpcs-frame  -mtpcs-leaf-frame @gol
453 -mcaller-super-interworking  -mcallee-super-interworking @gol
454 -mtp=@var{name}
455 -mword-relocations}
456
457 @emph{AVR Options}
458 @gccoptlist{-mmcu=@var{mcu}  -msize  -minit-stack=@var{n}  -mno-interrupts @gol
459 -mcall-prologues  -mno-tablejump  -mtiny-stack  -mint8}
460
461 @emph{Blackfin Options}
462 @gccoptlist{-mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]} @gol
463 -msim -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
464 -mspecld-anomaly  -mno-specld-anomaly  -mcsync-anomaly  -mno-csync-anomaly @gol
465 -mlow-64k -mno-low64k  -mstack-check-l1  -mid-shared-library @gol
466 -mno-id-shared-library  -mshared-library-id=@var{n} @gol
467 -mleaf-id-shared-library  -mno-leaf-id-shared-library @gol
468 -msep-data  -mno-sep-data  -mlong-calls  -mno-long-calls @gol
469 -mfast-fp -minline-plt -mmulticore  -mcorea  -mcoreb  -msdram}
470
471 @emph{CRIS Options}
472 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
473 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
474 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
475 -mstack-align  -mdata-align  -mconst-align @gol
476 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
477 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
478 -mmul-bug-workaround  -mno-mul-bug-workaround}
479
480 @emph{CRX Options}
481 @gccoptlist{-mmac -mpush-args}
482
483 @emph{Darwin Options}
484 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
485 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
486 -client_name  -compatibility_version  -current_version @gol
487 -dead_strip @gol
488 -dependency-file  -dylib_file  -dylinker_install_name @gol
489 -dynamic  -dynamiclib  -exported_symbols_list @gol
490 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
491 -force_flat_namespace  -headerpad_max_install_names @gol
492 -iframework @gol
493 -image_base  -init  -install_name  -keep_private_externs @gol
494 -multi_module  -multiply_defined  -multiply_defined_unused @gol
495 -noall_load   -no_dead_strip_inits_and_terms @gol
496 -nofixprebinding -nomultidefs  -noprebind  -noseglinkedit @gol
497 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
498 -private_bundle  -read_only_relocs  -sectalign @gol
499 -sectobjectsymbols  -whyload  -seg1addr @gol
500 -sectcreate  -sectobjectsymbols  -sectorder @gol
501 -segaddr -segs_read_only_addr -segs_read_write_addr @gol
502 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
503 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
504 -single_module  -static  -sub_library  -sub_umbrella @gol
505 -twolevel_namespace  -umbrella  -undefined @gol
506 -unexported_symbols_list  -weak_reference_mismatches @gol
507 -whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} @gol
508 -mkernel -mone-byte-bool}
509
510 @emph{DEC Alpha Options}
511 @gccoptlist{-mno-fp-regs  -msoft-float  -malpha-as  -mgas @gol
512 -mieee  -mieee-with-inexact  -mieee-conformant @gol
513 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
514 -mtrap-precision=@var{mode}  -mbuild-constants @gol
515 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
516 -mbwx  -mmax  -mfix  -mcix @gol
517 -mfloat-vax  -mfloat-ieee @gol
518 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
519 -msmall-text  -mlarge-text @gol
520 -mmemory-latency=@var{time}}
521
522 @emph{DEC Alpha/VMS Options}
523 @gccoptlist{-mvms-return-codes}
524
525 @emph{FRV Options}
526 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
527 -mhard-float  -msoft-float @gol
528 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
529 -mdouble  -mno-double @gol
530 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
531 -mfdpic  -minline-plt -mgprel-ro  -multilib-library-pic @gol
532 -mlinked-fp  -mlong-calls  -malign-labels @gol
533 -mlibrary-pic  -macc-4  -macc-8 @gol
534 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
535 -moptimize-membar -mno-optimize-membar @gol
536 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
537 -mvliw-branch  -mno-vliw-branch @gol
538 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
539 -mno-nested-cond-exec  -mtomcat-stats @gol
540 -mTLS -mtls @gol
541 -mcpu=@var{cpu}}
542
543 @emph{GNU/Linux Options}
544 @gccoptlist{-muclibc}
545
546 @emph{H8/300 Options}
547 @gccoptlist{-mrelax  -mh  -ms  -mn  -mint32  -malign-300}
548
549 @emph{HPPA Options}
550 @gccoptlist{-march=@var{architecture-type} @gol
551 -mbig-switch  -mdisable-fpregs  -mdisable-indexing @gol
552 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
553 -mfixed-range=@var{register-range} @gol
554 -mjump-in-delay -mlinker-opt -mlong-calls @gol
555 -mlong-load-store  -mno-big-switch  -mno-disable-fpregs @gol
556 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
557 -mno-jump-in-delay  -mno-long-load-store @gol
558 -mno-portable-runtime  -mno-soft-float @gol
559 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
560 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
561 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
562 -munix=@var{unix-std}  -nolibdld  -static  -threads}
563
564 @emph{i386 and x86-64 Options}
565 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
566 -mfpmath=@var{unit} @gol
567 -masm=@var{dialect}  -mno-fancy-math-387 @gol
568 -mno-fp-ret-in-387  -msoft-float @gol
569 -mno-wide-multiply  -mrtd  -malign-double @gol
570 -mpreferred-stack-boundary=@var{num}
571 -mincoming-stack-boundary=@var{num}
572 -mcld -mcx16 -msahf -mrecip @gol
573 -mmmx  -msse  -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -msse4 -mavx @gol
574 -maes -mpclmul @gol
575 -msse4a -m3dnow -mpopcnt -mabm -msse5 @gol
576 -mthreads  -mno-align-stringops  -minline-all-stringops @gol
577 -minline-stringops-dynamically -mstringop-strategy=@var{alg} @gol
578 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
579 -m96bit-long-double  -mregparm=@var{num}  -msseregparm @gol
580 -mveclibabi=@var{type} -mpc32 -mpc64 -mpc80 -mstackrealign @gol
581 -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs @gol
582 -mcmodel=@var{code-model} @gol
583 -m32  -m64 -mlarge-data-threshold=@var{num} @gol
584 -mfused-madd -mno-fused-madd -msse2avx}
585
586 @emph{IA-64 Options}
587 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
588 -mvolatile-asm-stop  -mregister-names  -mno-sdata @gol
589 -mconstant-gp  -mauto-pic  -minline-float-divide-min-latency @gol
590 -minline-float-divide-max-throughput @gol
591 -minline-int-divide-min-latency @gol
592 -minline-int-divide-max-throughput  @gol
593 -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
594 -mno-dwarf2-asm -mearly-stop-bits @gol
595 -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
596 -mtune=@var{cpu-type} -mt -pthread -milp32 -mlp64 @gol
597 -mno-sched-br-data-spec -msched-ar-data-spec -mno-sched-control-spec @gol
598 -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec @gol
599 -msched-ldc -mno-sched-control-ldc -mno-sched-spec-verbose @gol
600 -mno-sched-prefer-non-data-spec-insns @gol
601 -mno-sched-prefer-non-control-spec-insns @gol
602 -mno-sched-count-spec-in-critical-path}
603
604 @emph{M32R/D Options}
605 @gccoptlist{-m32r2 -m32rx -m32r @gol
606 -mdebug @gol
607 -malign-loops -mno-align-loops @gol
608 -missue-rate=@var{number} @gol
609 -mbranch-cost=@var{number} @gol
610 -mmodel=@var{code-size-model-type} @gol
611 -msdata=@var{sdata-type} @gol
612 -mno-flush-func -mflush-func=@var{name} @gol
613 -mno-flush-trap -mflush-trap=@var{number} @gol
614 -G @var{num}}
615
616 @emph{M32C Options}
617 @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
618
619 @emph{M680x0 Options}
620 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu}  -mtune=@var{tune}
621 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
622 -m68060  -mcpu32  -m5200  -m5206e  -m528x  -m5307  -m5407 @gol
623 -mcfv4e  -mbitfield  -mno-bitfield  -mc68000  -mc68020 @gol
624 -mnobitfield  -mrtd  -mno-rtd  -mdiv  -mno-div  -mshort @gol
625 -mno-short  -mhard-float  -m68881  -msoft-float  -mpcrel @gol
626 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
627 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library @gol
628 -mxgot -mno-xgot}
629
630 @emph{M68hc1x Options}
631 @gccoptlist{-m6811  -m6812  -m68hc11  -m68hc12   -m68hcs12 @gol
632 -mauto-incdec  -minmax  -mlong-calls  -mshort @gol
633 -msoft-reg-count=@var{count}}
634
635 @emph{MCore Options}
636 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
637 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
638 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
639 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
640 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
641
642 @emph{MIPS Options}
643 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
644 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2 @gol
645 -mips64  -mips64r2 @gol
646 -mips16  -mno-mips16  -mflip-mips16 @gol
647 -minterlink-mips16  -mno-interlink-mips16 @gol
648 -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
649 -mshared  -mno-shared  -mplt  -mno-plt  -mxgot  -mno-xgot @gol
650 -mgp32  -mgp64  -mfp32  -mfp64  -mhard-float  -msoft-float @gol
651 -msingle-float  -mdouble-float  -mdsp  -mno-dsp  -mdspr2  -mno-dspr2 @gol
652 -msmartmips  -mno-smartmips @gol
653 -mpaired-single  -mno-paired-single  -mdmx  -mno-mdmx @gol
654 -mips3d  -mno-mips3d  -mmt  -mno-mt  -mllsc  -mno-llsc @gol
655 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
656 -G@var{num}  -mlocal-sdata  -mno-local-sdata @gol
657 -mextern-sdata  -mno-extern-sdata  -mgpopt  -mno-gopt @gol
658 -membedded-data  -mno-embedded-data @gol
659 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
660 -mcode-readable=@var{setting} @gol
661 -msplit-addresses  -mno-split-addresses @gol
662 -mexplicit-relocs  -mno-explicit-relocs @gol
663 -mcheck-zero-division  -mno-check-zero-division @gol
664 -mdivide-traps  -mdivide-breaks @gol
665 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
666 -mmad  -mno-mad  -mfused-madd  -mno-fused-madd  -nocpp @gol
667 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
668 -mfix-vr4120  -mno-fix-vr4120  -mfix-vr4130  -mno-fix-vr4130 @gol
669 -mfix-sb1  -mno-fix-sb1 @gol
670 -mflush-func=@var{func}  -mno-flush-func @gol
671 -mbranch-cost=@var{num}  -mbranch-likely  -mno-branch-likely @gol
672 -mfp-exceptions -mno-fp-exceptions @gol
673 -mvr4130-align -mno-vr4130-align}
674
675 @emph{MMIX Options}
676 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
677 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
678 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
679 -mno-base-addresses  -msingle-exit  -mno-single-exit}
680
681 @emph{MN10300 Options}
682 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
683 -mam33  -mno-am33 @gol
684 -mam33-2  -mno-am33-2 @gol
685 -mreturn-pointer-on-d0 @gol
686 -mno-crt0  -mrelax}
687
688 @emph{PDP-11 Options}
689 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
690 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
691 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
692 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
693 -mbranch-expensive  -mbranch-cheap @gol
694 -msplit  -mno-split  -munix-asm  -mdec-asm}
695
696 @emph{picoChip Options}
697 @gccoptlist{-mae=@var{ae_type} -mvliw-lookahead=@var{N}
698 -msymbol-as-address -mno-inefficient-warnings}
699
700 @emph{PowerPC Options}
701 See RS/6000 and PowerPC Options.
702
703 @emph{RS/6000 and PowerPC Options}
704 @gccoptlist{-mcpu=@var{cpu-type} @gol
705 -mtune=@var{cpu-type} @gol
706 -mpower  -mno-power  -mpower2  -mno-power2 @gol
707 -mpowerpc  -mpowerpc64  -mno-powerpc @gol
708 -maltivec  -mno-altivec @gol
709 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
710 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
711 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb  -mfprnd  -mno-fprnd @gol
712 -mcmpb -mno-cmpb -mmfpgpr -mno-mfpgpr -mhard-dfp -mno-hard-dfp @gol
713 -mnew-mnemonics  -mold-mnemonics @gol
714 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
715 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
716 -malign-power  -malign-natural @gol
717 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
718 -msingle-float -mdouble-float -msimple-fpu @gol
719 -mstring  -mno-string  -mupdate  -mno-update @gol
720 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
721 -mstrict-align  -mno-strict-align  -mrelocatable @gol
722 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
723 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
724 -mdynamic-no-pic  -maltivec  -mswdiv @gol
725 -mprioritize-restricted-insns=@var{priority} @gol
726 -msched-costly-dep=@var{dependence_type} @gol
727 -minsert-sched-nops=@var{scheme} @gol
728 -mcall-sysv  -mcall-netbsd @gol
729 -maix-struct-return  -msvr4-struct-return @gol
730 -mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
731 -misel -mno-isel @gol
732 -misel=yes  -misel=no @gol
733 -mspe -mno-spe @gol
734 -mspe=yes  -mspe=no @gol
735 -mpaired @gol
736 -mvrsave -mno-vrsave @gol
737 -mmulhw -mno-mulhw @gol
738 -mdlmzb -mno-dlmzb @gol
739 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
740 -mprototype  -mno-prototype @gol
741 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
742 -msdata=@var{opt}  -mvxworks  -G @var{num}  -pthread}
743
744 @emph{S/390 and zSeries Options}
745 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
746 -mhard-float  -msoft-float  -mhard-dfp -mno-hard-dfp @gol
747 -mlong-double-64 -mlong-double-128 @gol
748 -mbackchain  -mno-backchain -mpacked-stack  -mno-packed-stack @gol
749 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
750 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
751 -mtpf-trace -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
752 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size -mstack-guard}
753
754 @emph{Score Options}
755 @gccoptlist{-meb -mel @gol
756 -mnhwloop @gol
757 -muls @gol
758 -mmac @gol
759 -mscore5 -mscore5u -mscore7 -mscore7d}
760
761 @emph{SH Options}
762 @gccoptlist{-m1  -m2  -m2e  -m3  -m3e @gol
763 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
764 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol
765 -m5-64media  -m5-64media-nofpu @gol
766 -m5-32media  -m5-32media-nofpu @gol
767 -m5-compact  -m5-compact-nofpu @gol
768 -mb  -ml  -mdalign  -mrelax @gol
769 -mbigtable  -mfmovd  -mhitachi -mrenesas -mno-renesas -mnomacsave @gol
770 -mieee  -mbitops  -misize  -minline-ic_invalidate -mpadstruct  -mspace @gol
771 -mprefergot  -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
772 -mdivsi3_libfunc=@var{name} -mfixed-range=@var{register-range} @gol
773 -madjust-unroll -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol
774 -minvalid-symbols}
775
776 @emph{SPARC Options}
777 @gccoptlist{-mcpu=@var{cpu-type} @gol
778 -mtune=@var{cpu-type} @gol
779 -mcmodel=@var{code-model} @gol
780 -m32  -m64  -mapp-regs  -mno-app-regs @gol
781 -mfaster-structs  -mno-faster-structs @gol
782 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
783 -mhard-quad-float  -msoft-quad-float @gol
784 -mimpure-text  -mno-impure-text  -mlittle-endian @gol
785 -mstack-bias  -mno-stack-bias @gol
786 -munaligned-doubles  -mno-unaligned-doubles @gol
787 -mv8plus  -mno-v8plus  -mvis  -mno-vis
788 -threads -pthreads -pthread}
789
790 @emph{SPU Options}
791 @gccoptlist{-mwarn-reloc -merror-reloc @gol
792 -msafe-dma -munsafe-dma @gol
793 -mbranch-hints @gol
794 -msmall-mem -mlarge-mem -mstdmain @gol
795 -mfixed-range=@var{register-range}}
796
797 @emph{System V Options}
798 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
799
800 @emph{V850 Options}
801 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
802 -mprolog-function  -mno-prolog-function  -mspace @gol
803 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
804 -mapp-regs  -mno-app-regs @gol
805 -mdisable-callt  -mno-disable-callt @gol
806 -mv850e1 @gol
807 -mv850e @gol
808 -mv850  -mbig-switch}
809
810 @emph{VAX Options}
811 @gccoptlist{-mg  -mgnu  -munix}
812
813 @emph{VxWorks Options}
814 @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
815 -Xbind-lazy  -Xbind-now}
816
817 @emph{x86-64 Options}
818 See i386 and x86-64 Options.
819
820 @emph{Xstormy16 Options}
821 @gccoptlist{-msim}
822
823 @emph{Xtensa Options}
824 @gccoptlist{-mconst16 -mno-const16 @gol
825 -mfused-madd  -mno-fused-madd @gol
826 -mserialize-volatile  -mno-serialize-volatile @gol
827 -mtext-section-literals  -mno-text-section-literals @gol
828 -mtarget-align  -mno-target-align @gol
829 -mlongcalls  -mno-longcalls}
830
831 @emph{zSeries Options}
832 See S/390 and zSeries Options.
833
834 @item Code Generation Options
835 @xref{Code Gen Options,,Options for Code Generation Conventions}.
836 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
837 -ffixed-@var{reg}  -fexceptions @gol
838 -fnon-call-exceptions  -funwind-tables @gol
839 -fasynchronous-unwind-tables @gol
840 -finhibit-size-directive  -finstrument-functions @gol
841 -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol
842 -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{} @gol
843 -fno-common  -fno-ident @gol
844 -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE @gol
845 -fno-jump-tables @gol
846 -frecord-gcc-switches @gol
847 -freg-struct-return  -fshort-enums @gol
848 -fshort-double  -fshort-wchar @gol
849 -fverbose-asm  -fpack-struct[=@var{n}]  -fstack-check @gol
850 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
851 -fno-stack-limit  -fargument-alias  -fargument-noalias @gol
852 -fargument-noalias-global  -fargument-noalias-anything @gol
853 -fleading-underscore  -ftls-model=@var{model} @gol
854 -ftrapv  -fwrapv  -fbounds-check @gol
855 -fvisibility}
856 @end table
857
858 @menu
859 * Overall Options::     Controlling the kind of output:
860                         an executable, object files, assembler files,
861                         or preprocessed source.
862 * C Dialect Options::   Controlling the variant of C language compiled.
863 * C++ Dialect Options:: Variations on C++.
864 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
865                         and Objective-C++.
866 * Language Independent Options:: Controlling how diagnostics should be
867                         formatted.
868 * Warning Options::     How picky should the compiler be?
869 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
870 * Optimize Options::    How much optimization?
871 * Preprocessor Options:: Controlling header files and macro definitions.
872                          Also, getting dependency information for Make.
873 * Assembler Options::   Passing options to the assembler.
874 * Link Options::        Specifying libraries and so on.
875 * Directory Options::   Where to find header files and libraries.
876                         Where to find the compiler executable files.
877 * Spec Files::          How to pass switches to sub-processes.
878 * Target Options::      Running a cross-compiler, or an old version of GCC.
879 @end menu
880
881 @node Overall Options
882 @section Options Controlling the Kind of Output
883
884 Compilation can involve up to four stages: preprocessing, compilation
885 proper, assembly and linking, always in that order.  GCC is capable of
886 preprocessing and compiling several files either into several
887 assembler input files, or into one assembler input file; then each
888 assembler input file produces an object file, and linking combines all
889 the object files (those newly compiled, and those specified as input)
890 into an executable file.
891
892 @cindex file name suffix
893 For any given input file, the file name suffix determines what kind of
894 compilation is done:
895
896 @table @gcctabopt
897 @item @var{file}.c
898 C source code which must be preprocessed.
899
900 @item @var{file}.i
901 C source code which should not be preprocessed.
902
903 @item @var{file}.ii
904 C++ source code which should not be preprocessed.
905
906 @item @var{file}.m
907 Objective-C source code.  Note that you must link with the @file{libobjc}
908 library to make an Objective-C program work.
909
910 @item @var{file}.mi
911 Objective-C source code which should not be preprocessed.
912
913 @item @var{file}.mm
914 @itemx @var{file}.M
915 Objective-C++ source code.  Note that you must link with the @file{libobjc}
916 library to make an Objective-C++ program work.  Note that @samp{.M} refers
917 to a literal capital M@.
918
919 @item @var{file}.mii
920 Objective-C++ source code which should not be preprocessed.
921
922 @item @var{file}.h
923 C, C++, Objective-C or Objective-C++ header file to be turned into a
924 precompiled header.
925
926 @item @var{file}.cc
927 @itemx @var{file}.cp
928 @itemx @var{file}.cxx
929 @itemx @var{file}.cpp
930 @itemx @var{file}.CPP
931 @itemx @var{file}.c++
932 @itemx @var{file}.C
933 C++ source code which must be preprocessed.  Note that in @samp{.cxx},
934 the last two letters must both be literally @samp{x}.  Likewise,
935 @samp{.C} refers to a literal capital C@.
936
937 @item @var{file}.mm
938 @itemx @var{file}.M
939 Objective-C++ source code which must be preprocessed.
940
941 @item @var{file}.mii
942 Objective-C++ source code which should not be preprocessed.
943
944 @item @var{file}.hh
945 @itemx @var{file}.H
946 @itemx @var{file}.hp
947 @itemx @var{file}.hxx
948 @itemx @var{file}.hpp
949 @itemx @var{file}.HPP
950 @itemx @var{file}.h++
951 @itemx @var{file}.tcc
952 C++ header file to be turned into a precompiled header.
953
954 @item @var{file}.f
955 @itemx @var{file}.for
956 @itemx @var{file}.ftn
957 Fixed form Fortran source code which should not be preprocessed.
958
959 @item @var{file}.F
960 @itemx @var{file}.FOR
961 @itemx @var{file}.fpp
962 @itemx @var{file}.FPP
963 @itemx @var{file}.FTN
964 Fixed form Fortran source code which must be preprocessed (with the traditional
965 preprocessor).
966
967 @item @var{file}.f90
968 @itemx @var{file}.f95
969 @itemx @var{file}.f03
970 @itemx @var{file}.f08
971 Free form Fortran source code which should not be preprocessed.
972
973 @item @var{file}.F90
974 @itemx @var{file}.F95
975 @itemx @var{file}.F03
976 @itemx @var{file}.F08
977 Free form Fortran source code which must be preprocessed (with the
978 traditional preprocessor).
979
980 @c FIXME: Descriptions of Java file types.
981 @c @var{file}.java
982 @c @var{file}.class
983 @c @var{file}.zip
984 @c @var{file}.jar
985
986 @item @var{file}.ads
987 Ada source code file which contains a library unit declaration (a
988 declaration of a package, subprogram, or generic, or a generic
989 instantiation), or a library unit renaming declaration (a package,
990 generic, or subprogram renaming declaration).  Such files are also
991 called @dfn{specs}.
992
993 @item @var{file}.adb
994 Ada source code file containing a library unit body (a subprogram or
995 package body).  Such files are also called @dfn{bodies}.
996
997 @c GCC also knows about some suffixes for languages not yet included:
998 @c Pascal:
999 @c @var{file}.p
1000 @c @var{file}.pas
1001 @c Ratfor:
1002 @c @var{file}.r
1003
1004 @item @var{file}.s
1005 Assembler code.
1006
1007 @item @var{file}.S
1008 @itemx @var{file}.sx
1009 Assembler code which must be preprocessed.
1010
1011 @item @var{other}
1012 An object file to be fed straight into linking.
1013 Any file name with no recognized suffix is treated this way.
1014 @end table
1015
1016 @opindex x
1017 You can specify the input language explicitly with the @option{-x} option:
1018
1019 @table @gcctabopt
1020 @item -x @var{language}
1021 Specify explicitly the @var{language} for the following input files
1022 (rather than letting the compiler choose a default based on the file
1023 name suffix).  This option applies to all following input files until
1024 the next @option{-x} option.  Possible values for @var{language} are:
1025 @smallexample
1026 c  c-header  c-cpp-output
1027 c++  c++-header  c++-cpp-output
1028 objective-c  objective-c-header  objective-c-cpp-output
1029 objective-c++ objective-c++-header objective-c++-cpp-output
1030 assembler  assembler-with-cpp
1031 ada
1032 f77  f77-cpp-input f95  f95-cpp-input
1033 java
1034 @end smallexample
1035
1036 @item -x none
1037 Turn off any specification of a language, so that subsequent files are
1038 handled according to their file name suffixes (as they are if @option{-x}
1039 has not been used at all).
1040
1041 @item -pass-exit-codes
1042 @opindex pass-exit-codes
1043 Normally the @command{gcc} program will exit with the code of 1 if any
1044 phase of the compiler returns a non-success return code.  If you specify
1045 @option{-pass-exit-codes}, the @command{gcc} program will instead return with
1046 numerically highest error produced by any phase that returned an error
1047 indication.  The C, C++, and Fortran frontends return 4, if an internal
1048 compiler error is encountered.
1049 @end table
1050
1051 If you only want some of the stages of compilation, you can use
1052 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
1053 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
1054 @command{gcc} is to stop.  Note that some combinations (for example,
1055 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
1056
1057 @table @gcctabopt
1058 @item -c
1059 @opindex c
1060 Compile or assemble the source files, but do not link.  The linking
1061 stage simply is not done.  The ultimate output is in the form of an
1062 object file for each source file.
1063
1064 By default, the object file name for a source file is made by replacing
1065 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1066
1067 Unrecognized input files, not requiring compilation or assembly, are
1068 ignored.
1069
1070 @item -S
1071 @opindex S
1072 Stop after the stage of compilation proper; do not assemble.  The output
1073 is in the form of an assembler code file for each non-assembler input
1074 file specified.
1075
1076 By default, the assembler file name for a source file is made by
1077 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1078
1079 Input files that don't require compilation are ignored.
1080
1081 @item -E
1082 @opindex E
1083 Stop after the preprocessing stage; do not run the compiler proper.  The
1084 output is in the form of preprocessed source code, which is sent to the
1085 standard output.
1086
1087 Input files which don't require preprocessing are ignored.
1088
1089 @cindex output file option
1090 @item -o @var{file}
1091 @opindex o
1092 Place output in file @var{file}.  This applies regardless to whatever
1093 sort of output is being produced, whether it be an executable file,
1094 an object file, an assembler file or preprocessed C code.
1095
1096 If @option{-o} is not specified, the default is to put an executable
1097 file in @file{a.out}, the object file for
1098 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1099 assembler file in @file{@var{source}.s}, a precompiled header file in
1100 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1101 standard output.
1102
1103 @item -v
1104 @opindex v
1105 Print (on standard error output) the commands executed to run the stages
1106 of compilation.  Also print the version number of the compiler driver
1107 program and of the preprocessor and the compiler proper.
1108
1109 @item -###
1110 @opindex ###
1111 Like @option{-v} except the commands are not executed and all command
1112 arguments are quoted.  This is useful for shell scripts to capture the
1113 driver-generated command lines.
1114
1115 @item -pipe
1116 @opindex pipe
1117 Use pipes rather than temporary files for communication between the
1118 various stages of compilation.  This fails to work on some systems where
1119 the assembler is unable to read from a pipe; but the GNU assembler has
1120 no trouble.
1121
1122 @item -combine
1123 @opindex combine
1124 If you are compiling multiple source files, this option tells the driver
1125 to pass all the source files to the compiler at once (for those
1126 languages for which the compiler can handle this).  This will allow
1127 intermodule analysis (IMA) to be performed by the compiler.  Currently the only
1128 language for which this is supported is C@.  If you pass source files for
1129 multiple languages to the driver, using this option, the driver will invoke
1130 the compiler(s) that support IMA once each, passing each compiler all the
1131 source files appropriate for it.  For those languages that do not support
1132 IMA this option will be ignored, and the compiler will be invoked once for
1133 each source file in that language.  If you use this option in conjunction
1134 with @option{-save-temps}, the compiler will generate multiple
1135 pre-processed files
1136 (one for each source file), but only one (combined) @file{.o} or
1137 @file{.s} file.
1138
1139 @item --help
1140 @opindex help
1141 Print (on the standard output) a description of the command line options
1142 understood by @command{gcc}.  If the @option{-v} option is also specified
1143 then @option{--help} will also be passed on to the various processes
1144 invoked by @command{gcc}, so that they can display the command line options
1145 they accept.  If the @option{-Wextra} option has also been specified
1146 (prior to the @option{--help} option), then command line options which
1147 have no documentation associated with them will also be displayed.
1148
1149 @item --target-help
1150 @opindex target-help
1151 Print (on the standard output) a description of target-specific command
1152 line options for each tool.  For some targets extra target-specific
1153 information may also be printed.
1154
1155 @item --help=@var{class}@r{[},@var{qualifier}@r{]}
1156 Print (on the standard output) a description of the command line
1157 options understood by the compiler that fit into a specific class.
1158 The class can be one of @samp{optimizers}, @samp{warnings}, @samp{target},
1159 @samp{params}, or @var{language}:
1160
1161 @table @asis
1162 @item @samp{optimizers}
1163 This will display all of the optimization options supported by the
1164 compiler.
1165
1166 @item @samp{warnings}
1167 This will display all of the options controlling warning messages
1168 produced by the compiler.
1169
1170 @item @samp{target}
1171 This will display target-specific options.  Unlike the
1172 @option{--target-help} option however, target-specific options of the
1173 linker and assembler will not be displayed.  This is because those
1174 tools do not currently support the extended @option{--help=} syntax.
1175
1176 @item @samp{params}
1177 This will display the values recognized by the @option{--param}
1178 option.
1179
1180 @item @var{language}
1181 This will display the options supported for @var{language}, where 
1182 @var{language} is the name of one of the languages supported in this 
1183 version of GCC.
1184
1185 @item @samp{common}
1186 This will display the options that are common to all languages.
1187 @end table
1188
1189 It is possible to further refine the output of the @option{--help=}
1190 option by adding a comma separated list of qualifiers after the
1191 class.  These can be any from the following list:
1192
1193 @table @asis
1194 @item @samp{undocumented}
1195 Display only those options which are undocumented.
1196
1197 @item @samp{joined}
1198 Display options which take an argument that appears after an equal
1199 sign in the same continuous piece of text, such as:
1200 @samp{--help=target}.
1201
1202 @item @samp{separate}
1203 Display options which take an argument that appears as a separate word
1204 following the original option, such as: @samp{-o output-file}.
1205 @end table
1206
1207 Thus for example to display all the undocumented target-specific
1208 switches supported by the compiler the following can be used:
1209
1210 @smallexample
1211 --help=target,undocumented
1212 @end smallexample
1213
1214 The sense of a qualifier can be inverted by prefixing it with the
1215 @var{^} character, so for example to display all binary warning
1216 options (i.e., ones that are either on or off and that do not take an
1217 argument), which have a description the following can be used:
1218
1219 @smallexample
1220 --help=warnings,^joined,^undocumented
1221 @end smallexample
1222
1223 A class can also be used as a qualifier, although this usually
1224 restricts the output by so much that there is nothing to display.  One
1225 case where it does work however is when one of the classes is
1226 @var{target}.  So for example to display all the target-specific
1227 optimization options the following can be used:
1228
1229 @smallexample
1230 --help=target,optimizers
1231 @end smallexample
1232
1233 The @option{--help=} option can be repeated on the command line.  Each
1234 successive use will display its requested class of options, skipping
1235 those that have already been displayed.
1236
1237 If the @option{-Q} option appears on the command line before the
1238 @option{--help=} option, then the descriptive text displayed by
1239 @option{--help=} is changed.  Instead of describing the displayed
1240 options, an indication is given as to whether the option is enabled,
1241 disabled or set to a specific value (assuming that the compiler
1242 knows this at the point where the @option{--help=} option is used).
1243
1244 Here is a truncated example from the ARM port of @command{gcc}:
1245
1246 @smallexample
1247   % gcc -Q -mabi=2 --help=target -c
1248   The following options are target specific:
1249   -mabi=                                2
1250   -mabort-on-noreturn                   [disabled]
1251   -mapcs                                [disabled]
1252 @end smallexample
1253
1254 The output is sensitive to the effects of previous command line
1255 options, so for example it is possible to find out which optimizations
1256 are enabled at @option{-O2} by using:
1257
1258 @smallexample
1259 -O2 --help=optimizers
1260 @end smallexample
1261
1262 Alternatively you can discover which binary optimizations are enabled
1263 by @option{-O3} by using:
1264
1265 @smallexample
1266 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1267 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1268 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1269 @end smallexample
1270
1271 @item --version
1272 @opindex version
1273 Display the version number and copyrights of the invoked GCC@.
1274
1275 @item -wrapper
1276 @opindex wrapper
1277 Invoke all subcommands under a wrapper program. It takes a single
1278 comma separated list as an argument, which will be used to invoke
1279 the wrapper:
1280
1281 @smallexample
1282 gcc -c t.c -wrapper gdb,--args
1283 @end smallexample
1284
1285 This will invoke all subprograms of gcc under "gdb --args",
1286 thus cc1 invocation will be "gdb --args cc1 ...".
1287
1288 @include @value{srcdir}/../libiberty/at-file.texi
1289 @end table
1290
1291 @node Invoking G++
1292 @section Compiling C++ Programs
1293
1294 @cindex suffixes for C++ source
1295 @cindex C++ source file suffixes
1296 C++ source files conventionally use one of the suffixes @samp{.C},
1297 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1298 @samp{.cxx}; C++ header files often use @samp{.hh}, @samp{.hpp},
1299 @samp{.H}, or (for shared template code) @samp{.tcc}; and
1300 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1301 files with these names and compiles them as C++ programs even if you
1302 call the compiler the same way as for compiling C programs (usually
1303 with the name @command{gcc}).
1304
1305 @findex g++
1306 @findex c++
1307 However, the use of @command{gcc} does not add the C++ library.
1308 @command{g++} is a program that calls GCC and treats @samp{.c},
1309 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1310 files unless @option{-x} is used, and automatically specifies linking
1311 against the C++ library.  This program is also useful when
1312 precompiling a C header file with a @samp{.h} extension for use in C++
1313 compilations.  On many systems, @command{g++} is also installed with
1314 the name @command{c++}.
1315
1316 @cindex invoking @command{g++}
1317 When you compile C++ programs, you may specify many of the same
1318 command-line options that you use for compiling programs in any
1319 language; or command-line options meaningful for C and related
1320 languages; or options that are meaningful only for C++ programs.
1321 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1322 explanations of options for languages related to C@.
1323 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1324 explanations of options that are meaningful only for C++ programs.
1325
1326 @node C Dialect Options
1327 @section Options Controlling C Dialect
1328 @cindex dialect options
1329 @cindex language dialect options
1330 @cindex options, dialect
1331
1332 The following options control the dialect of C (or languages derived
1333 from C, such as C++, Objective-C and Objective-C++) that the compiler
1334 accepts:
1335
1336 @table @gcctabopt
1337 @cindex ANSI support
1338 @cindex ISO support
1339 @item -ansi
1340 @opindex ansi
1341 In C mode, this is equivalent to @samp{-std=c89}. In C++ mode, it is
1342 equivalent to @samp{-std=c++98}.
1343
1344 This turns off certain features of GCC that are incompatible with ISO
1345 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1346 such as the @code{asm} and @code{typeof} keywords, and
1347 predefined macros such as @code{unix} and @code{vax} that identify the
1348 type of system you are using.  It also enables the undesirable and
1349 rarely used ISO trigraph feature.  For the C compiler,
1350 it disables recognition of C++ style @samp{//} comments as well as
1351 the @code{inline} keyword.
1352
1353 The alternate keywords @code{__asm__}, @code{__extension__},
1354 @code{__inline__} and @code{__typeof__} continue to work despite
1355 @option{-ansi}.  You would not want to use them in an ISO C program, of
1356 course, but it is useful to put them in header files that might be included
1357 in compilations done with @option{-ansi}.  Alternate predefined macros
1358 such as @code{__unix__} and @code{__vax__} are also available, with or
1359 without @option{-ansi}.
1360
1361 The @option{-ansi} option does not cause non-ISO programs to be
1362 rejected gratuitously.  For that, @option{-pedantic} is required in
1363 addition to @option{-ansi}.  @xref{Warning Options}.
1364
1365 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1366 option is used.  Some header files may notice this macro and refrain
1367 from declaring certain functions or defining certain macros that the
1368 ISO standard doesn't call for; this is to avoid interfering with any
1369 programs that might use these names for other things.
1370
1371 Functions that would normally be built in but do not have semantics
1372 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1373 functions when @option{-ansi} is used.  @xref{Other Builtins,,Other
1374 built-in functions provided by GCC}, for details of the functions
1375 affected.
1376
1377 @item -std=
1378 @opindex std
1379 Determine the language standard. @xref{Standards,,Language Standards
1380 Supported by GCC}, for details of these standard versions.  This option
1381 is currently only supported when compiling C or C++. 
1382
1383 The compiler can accept several base standards, such as @samp{c89} or
1384 @samp{c++98}, and GNU dialects of those standards, such as
1385 @samp{gnu89} or @samp{gnu++98}.  By specifing a base standard, the
1386 compiler will accept all programs following that standard and those
1387 using GNU extensions that do not contradict it.  For example,
1388 @samp{-std=c89} turns off certain features of GCC that are
1389 incompatible with ISO C90, such as the @code{asm} and @code{typeof}
1390 keywords, but not other GNU extensions that do not have a meaning in
1391 ISO C90, such as omitting the middle term of a @code{?:}
1392 expression. On the other hand, by specifing a GNU dialect of a
1393 standard, all features the compiler support are enabled, even when
1394 those features change the meaning of the base standard and some
1395 strict-conforming programs may be rejected.  The particular standard
1396 is used by @option{-pedantic} to identify which features are GNU
1397 extensions given that version of the standard. For example
1398 @samp{-std=gnu89 -pedantic} would warn about C++ style @samp{//}
1399 comments, while @samp{-std=gnu99 -pedantic} would not.
1400
1401 A value for this option must be provided; possible values are
1402
1403 @table @samp
1404 @item c89
1405 @itemx iso9899:1990
1406 Support all ISO C90 programs (certain GNU extensions that conflict
1407 with ISO C90 are disabled). Same as @option{-ansi} for C code.
1408
1409 @item iso9899:199409
1410 ISO C90 as modified in amendment 1.
1411
1412 @item c99
1413 @itemx c9x
1414 @itemx iso9899:1999
1415 @itemx iso9899:199x
1416 ISO C99.  Note that this standard is not yet fully supported; see
1417 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1418 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1419
1420 @item gnu89
1421 GNU dialect of ISO C90 (including some C99 features). This
1422 is the default for C code.
1423
1424 @item gnu99
1425 @itemx gnu9x
1426 GNU dialect of ISO C99.  When ISO C99 is fully implemented in GCC,
1427 this will become the default.  The name @samp{gnu9x} is deprecated.
1428
1429 @item c++98
1430 The 1998 ISO C++ standard plus amendments. Same as @option{-ansi} for
1431 C++ code.
1432
1433 @item gnu++98
1434 GNU dialect of @option{-std=c++98}.  This is the default for
1435 C++ code.
1436
1437 @item c++0x
1438 The working draft of the upcoming ISO C++0x standard. This option
1439 enables experimental features that are likely to be included in
1440 C++0x. The working draft is constantly changing, and any feature that is
1441 enabled by this flag may be removed from future versions of GCC if it is
1442 not part of the C++0x standard.
1443
1444 @item gnu++0x
1445 GNU dialect of @option{-std=c++0x}. This option enables
1446 experimental features that may be removed in future versions of GCC.
1447 @end table
1448
1449 @item -fgnu89-inline
1450 @opindex fgnu89-inline
1451 The option @option{-fgnu89-inline} tells GCC to use the traditional
1452 GNU semantics for @code{inline} functions when in C99 mode.
1453 @xref{Inline,,An Inline Function is As Fast As a Macro}.  This option
1454 is accepted and ignored by GCC versions 4.1.3 up to but not including
1455 4.3.  In GCC versions 4.3 and later it changes the behavior of GCC in
1456 C99 mode.  Using this option is roughly equivalent to adding the
1457 @code{gnu_inline} function attribute to all inline functions
1458 (@pxref{Function Attributes}).
1459
1460 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
1461 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
1462 specifies the default behavior).  This option was first supported in
1463 GCC 4.3.  This option is not supported in C89 or gnu89 mode.
1464
1465 The preprocessor macros @code{__GNUC_GNU_INLINE__} and
1466 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
1467 in effect for @code{inline} functions.  @xref{Common Predefined
1468 Macros,,,cpp,The C Preprocessor}.
1469
1470 @item -aux-info @var{filename}
1471 @opindex aux-info
1472 Output to the given filename prototyped declarations for all functions
1473 declared and/or defined in a translation unit, including those in header
1474 files.  This option is silently ignored in any language other than C@.
1475
1476 Besides declarations, the file indicates, in comments, the origin of
1477 each declaration (source file and line), whether the declaration was
1478 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1479 @samp{O} for old, respectively, in the first character after the line
1480 number and the colon), and whether it came from a declaration or a
1481 definition (@samp{C} or @samp{F}, respectively, in the following
1482 character).  In the case of function definitions, a K&R-style list of
1483 arguments followed by their declarations is also provided, inside
1484 comments, after the declaration.
1485
1486 @item -fno-asm
1487 @opindex fno-asm
1488 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1489 keyword, so that code can use these words as identifiers.  You can use
1490 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1491 instead.  @option{-ansi} implies @option{-fno-asm}.
1492
1493 In C++, this switch only affects the @code{typeof} keyword, since
1494 @code{asm} and @code{inline} are standard keywords.  You may want to
1495 use the @option{-fno-gnu-keywords} flag instead, which has the same
1496 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1497 switch only affects the @code{asm} and @code{typeof} keywords, since
1498 @code{inline} is a standard keyword in ISO C99.
1499
1500 @item -fno-builtin
1501 @itemx -fno-builtin-@var{function}
1502 @opindex fno-builtin
1503 @cindex built-in functions
1504 Don't recognize built-in functions that do not begin with
1505 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1506 functions provided by GCC}, for details of the functions affected,
1507 including those which are not built-in functions when @option{-ansi} or
1508 @option{-std} options for strict ISO C conformance are used because they
1509 do not have an ISO standard meaning.
1510
1511 GCC normally generates special code to handle certain built-in functions
1512 more efficiently; for instance, calls to @code{alloca} may become single
1513 instructions that adjust the stack directly, and calls to @code{memcpy}
1514 may become inline copy loops.  The resulting code is often both smaller
1515 and faster, but since the function calls no longer appear as such, you
1516 cannot set a breakpoint on those calls, nor can you change the behavior
1517 of the functions by linking with a different library.  In addition,
1518 when a function is recognized as a built-in function, GCC may use
1519 information about that function to warn about problems with calls to
1520 that function, or to generate more efficient code, even if the
1521 resulting code still contains calls to that function.  For example,
1522 warnings are given with @option{-Wformat} for bad calls to
1523 @code{printf}, when @code{printf} is built in, and @code{strlen} is
1524 known not to modify global memory.
1525
1526 With the @option{-fno-builtin-@var{function}} option
1527 only the built-in function @var{function} is
1528 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1529 function is named that is not built-in in this version of GCC, this
1530 option is ignored.  There is no corresponding
1531 @option{-fbuiltin-@var{function}} option; if you wish to enable
1532 built-in functions selectively when using @option{-fno-builtin} or
1533 @option{-ffreestanding}, you may define macros such as:
1534
1535 @smallexample
1536 #define abs(n)          __builtin_abs ((n))
1537 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1538 @end smallexample
1539
1540 @item -fhosted
1541 @opindex fhosted
1542 @cindex hosted environment
1543
1544 Assert that compilation takes place in a hosted environment.  This implies
1545 @option{-fbuiltin}.  A hosted environment is one in which the
1546 entire standard library is available, and in which @code{main} has a return
1547 type of @code{int}.  Examples are nearly everything except a kernel.
1548 This is equivalent to @option{-fno-freestanding}.
1549
1550 @item -ffreestanding
1551 @opindex ffreestanding
1552 @cindex hosted environment
1553
1554 Assert that compilation takes place in a freestanding environment.  This
1555 implies @option{-fno-builtin}.  A freestanding environment
1556 is one in which the standard library may not exist, and program startup may
1557 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1558 This is equivalent to @option{-fno-hosted}.
1559
1560 @xref{Standards,,Language Standards Supported by GCC}, for details of
1561 freestanding and hosted environments.
1562
1563 @item -fopenmp
1564 @opindex fopenmp
1565 @cindex openmp parallel
1566 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
1567 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
1568 compiler generates parallel code according to the OpenMP Application
1569 Program Interface v2.5 @w{@uref{http://www.openmp.org/}}.  This option
1570 implies @option{-pthread}, and thus is only supported on targets that
1571 have support for @option{-pthread}.
1572
1573 @item -fms-extensions
1574 @opindex fms-extensions
1575 Accept some non-standard constructs used in Microsoft header files.
1576
1577 Some cases of unnamed fields in structures and unions are only
1578 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
1579 fields within structs/unions}, for details.
1580
1581 @item -trigraphs
1582 @opindex trigraphs
1583 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
1584 options for strict ISO C conformance) implies @option{-trigraphs}.
1585
1586 @item -no-integrated-cpp
1587 @opindex no-integrated-cpp
1588 Performs a compilation in two passes: preprocessing and compiling.  This
1589 option allows a user supplied "cc1", "cc1plus", or "cc1obj" via the
1590 @option{-B} option.  The user supplied compilation step can then add in
1591 an additional preprocessing step after normal preprocessing but before
1592 compiling.  The default is to use the integrated cpp (internal cpp)
1593
1594 The semantics of this option will change if "cc1", "cc1plus", and
1595 "cc1obj" are merged.
1596
1597 @cindex traditional C language
1598 @cindex C language, traditional
1599 @item -traditional
1600 @itemx -traditional-cpp
1601 @opindex traditional-cpp
1602 @opindex traditional
1603 Formerly, these options caused GCC to attempt to emulate a pre-standard
1604 C compiler.  They are now only supported with the @option{-E} switch.
1605 The preprocessor continues to support a pre-standard mode.  See the GNU
1606 CPP manual for details.
1607
1608 @item -fcond-mismatch
1609 @opindex fcond-mismatch
1610 Allow conditional expressions with mismatched types in the second and
1611 third arguments.  The value of such an expression is void.  This option
1612 is not supported for C++.
1613
1614 @item -flax-vector-conversions
1615 @opindex flax-vector-conversions
1616 Allow implicit conversions between vectors with differing numbers of
1617 elements and/or incompatible element types.  This option should not be
1618 used for new code.
1619
1620 @item -funsigned-char
1621 @opindex funsigned-char
1622 Let the type @code{char} be unsigned, like @code{unsigned char}.
1623
1624 Each kind of machine has a default for what @code{char} should
1625 be.  It is either like @code{unsigned char} by default or like
1626 @code{signed char} by default.
1627
1628 Ideally, a portable program should always use @code{signed char} or
1629 @code{unsigned char} when it depends on the signedness of an object.
1630 But many programs have been written to use plain @code{char} and
1631 expect it to be signed, or expect it to be unsigned, depending on the
1632 machines they were written for.  This option, and its inverse, let you
1633 make such a program work with the opposite default.
1634
1635 The type @code{char} is always a distinct type from each of
1636 @code{signed char} or @code{unsigned char}, even though its behavior
1637 is always just like one of those two.
1638
1639 @item -fsigned-char
1640 @opindex fsigned-char
1641 Let the type @code{char} be signed, like @code{signed char}.
1642
1643 Note that this is equivalent to @option{-fno-unsigned-char}, which is
1644 the negative form of @option{-funsigned-char}.  Likewise, the option
1645 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
1646
1647 @item -fsigned-bitfields
1648 @itemx -funsigned-bitfields
1649 @itemx -fno-signed-bitfields
1650 @itemx -fno-unsigned-bitfields
1651 @opindex fsigned-bitfields
1652 @opindex funsigned-bitfields
1653 @opindex fno-signed-bitfields
1654 @opindex fno-unsigned-bitfields
1655 These options control whether a bit-field is signed or unsigned, when the
1656 declaration does not use either @code{signed} or @code{unsigned}.  By
1657 default, such a bit-field is signed, because this is consistent: the
1658 basic integer types such as @code{int} are signed types.
1659 @end table
1660
1661 @node C++ Dialect Options
1662 @section Options Controlling C++ Dialect
1663
1664 @cindex compiler options, C++
1665 @cindex C++ options, command line
1666 @cindex options, C++
1667 This section describes the command-line options that are only meaningful
1668 for C++ programs; but you can also use most of the GNU compiler options
1669 regardless of what language your program is in.  For example, you
1670 might compile a file @code{firstClass.C} like this:
1671
1672 @smallexample
1673 g++ -g -frepo -O -c firstClass.C
1674 @end smallexample
1675
1676 @noindent
1677 In this example, only @option{-frepo} is an option meant
1678 only for C++ programs; you can use the other options with any
1679 language supported by GCC@.
1680
1681 Here is a list of options that are @emph{only} for compiling C++ programs:
1682
1683 @table @gcctabopt
1684
1685 @item -fabi-version=@var{n}
1686 @opindex fabi-version
1687 Use version @var{n} of the C++ ABI@.  Version 2 is the version of the
1688 C++ ABI that first appeared in G++ 3.4.  Version 1 is the version of
1689 the C++ ABI that first appeared in G++ 3.2.  Version 0 will always be
1690 the version that conforms most closely to the C++ ABI specification.
1691 Therefore, the ABI obtained using version 0 will change as ABI bugs
1692 are fixed.
1693
1694 The default is version 2.
1695
1696 @item -fno-access-control
1697 @opindex fno-access-control
1698 Turn off all access checking.  This switch is mainly useful for working
1699 around bugs in the access control code.
1700
1701 @item -fcheck-new
1702 @opindex fcheck-new
1703 Check that the pointer returned by @code{operator new} is non-null
1704 before attempting to modify the storage allocated.  This check is
1705 normally unnecessary because the C++ standard specifies that
1706 @code{operator new} will only return @code{0} if it is declared
1707 @samp{throw()}, in which case the compiler will always check the
1708 return value even without this option.  In all other cases, when
1709 @code{operator new} has a non-empty exception specification, memory
1710 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
1711 @samp{new (nothrow)}.
1712
1713 @item -fconserve-space
1714 @opindex fconserve-space
1715 Put uninitialized or runtime-initialized global variables into the
1716 common segment, as C does.  This saves space in the executable at the
1717 cost of not diagnosing duplicate definitions.  If you compile with this
1718 flag and your program mysteriously crashes after @code{main()} has
1719 completed, you may have an object that is being destroyed twice because
1720 two definitions were merged.
1721
1722 This option is no longer useful on most targets, now that support has
1723 been added for putting variables into BSS without making them common.
1724
1725 @item -ffriend-injection
1726 @opindex ffriend-injection
1727 Inject friend functions into the enclosing namespace, so that they are
1728 visible outside the scope of the class in which they are declared.
1729 Friend functions were documented to work this way in the old Annotated
1730 C++ Reference Manual, and versions of G++ before 4.1 always worked
1731 that way.  However, in ISO C++ a friend function which is not declared
1732 in an enclosing scope can only be found using argument dependent
1733 lookup.  This option causes friends to be injected as they were in
1734 earlier releases.
1735
1736 This option is for compatibility, and may be removed in a future
1737 release of G++.
1738
1739 @item -fno-elide-constructors
1740 @opindex fno-elide-constructors
1741 The C++ standard allows an implementation to omit creating a temporary
1742 which is only used to initialize another object of the same type.
1743 Specifying this option disables that optimization, and forces G++ to
1744 call the copy constructor in all cases.
1745
1746 @item -fno-enforce-eh-specs
1747 @opindex fno-enforce-eh-specs
1748 Don't generate code to check for violation of exception specifications
1749 at runtime.  This option violates the C++ standard, but may be useful
1750 for reducing code size in production builds, much like defining
1751 @samp{NDEBUG}.  This does not give user code permission to throw
1752 exceptions in violation of the exception specifications; the compiler
1753 will still optimize based on the specifications, so throwing an
1754 unexpected exception will result in undefined behavior.
1755
1756 @item -ffor-scope
1757 @itemx -fno-for-scope
1758 @opindex ffor-scope
1759 @opindex fno-for-scope
1760 If @option{-ffor-scope} is specified, the scope of variables declared in
1761 a @i{for-init-statement} is limited to the @samp{for} loop itself,
1762 as specified by the C++ standard.
1763 If @option{-fno-for-scope} is specified, the scope of variables declared in
1764 a @i{for-init-statement} extends to the end of the enclosing scope,
1765 as was the case in old versions of G++, and other (traditional)
1766 implementations of C++.
1767
1768 The default if neither flag is given to follow the standard,
1769 but to allow and give a warning for old-style code that would
1770 otherwise be invalid, or have different behavior.
1771
1772 @item -fno-gnu-keywords
1773 @opindex fno-gnu-keywords
1774 Do not recognize @code{typeof} as a keyword, so that code can use this
1775 word as an identifier.  You can use the keyword @code{__typeof__} instead.
1776 @option{-ansi} implies @option{-fno-gnu-keywords}.
1777
1778 @item -fno-implicit-templates
1779 @opindex fno-implicit-templates
1780 Never emit code for non-inline templates which are instantiated
1781 implicitly (i.e.@: by use); only emit code for explicit instantiations.
1782 @xref{Template Instantiation}, for more information.
1783
1784 @item -fno-implicit-inline-templates
1785 @opindex fno-implicit-inline-templates
1786 Don't emit code for implicit instantiations of inline templates, either.
1787 The default is to handle inlines differently so that compiles with and
1788 without optimization will need the same set of explicit instantiations.
1789
1790 @item -fno-implement-inlines
1791 @opindex fno-implement-inlines
1792 To save space, do not emit out-of-line copies of inline functions
1793 controlled by @samp{#pragma implementation}.  This will cause linker
1794 errors if these functions are not inlined everywhere they are called.
1795
1796 @item -fms-extensions
1797 @opindex fms-extensions
1798 Disable pedantic warnings about constructs used in MFC, such as implicit
1799 int and getting a pointer to member function via non-standard syntax.
1800
1801 @item -fno-nonansi-builtins
1802 @opindex fno-nonansi-builtins
1803 Disable built-in declarations of functions that are not mandated by
1804 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
1805 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
1806
1807 @item -fno-operator-names
1808 @opindex fno-operator-names
1809 Do not treat the operator name keywords @code{and}, @code{bitand},
1810 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
1811 synonyms as keywords.
1812
1813 @item -fno-optional-diags
1814 @opindex fno-optional-diags
1815 Disable diagnostics that the standard says a compiler does not need to
1816 issue.  Currently, the only such diagnostic issued by G++ is the one for
1817 a name having multiple meanings within a class.
1818
1819 @item -fpermissive
1820 @opindex fpermissive
1821 Downgrade some diagnostics about nonconformant code from errors to
1822 warnings.  Thus, using @option{-fpermissive} will allow some
1823 nonconforming code to compile.
1824
1825 @item -frepo
1826 @opindex frepo
1827 Enable automatic template instantiation at link time.  This option also
1828 implies @option{-fno-implicit-templates}.  @xref{Template
1829 Instantiation}, for more information.
1830
1831 @item -fno-rtti
1832 @opindex fno-rtti
1833 Disable generation of information about every class with virtual
1834 functions for use by the C++ runtime type identification features
1835 (@samp{dynamic_cast} and @samp{typeid}).  If you don't use those parts
1836 of the language, you can save some space by using this flag.  Note that
1837 exception handling uses the same information, but it will generate it as
1838 needed. The @samp{dynamic_cast} operator can still be used for casts that
1839 do not require runtime type information, i.e.@: casts to @code{void *} or to
1840 unambiguous base classes.
1841
1842 @item -fstats
1843 @opindex fstats
1844 Emit statistics about front-end processing at the end of the compilation.
1845 This information is generally only useful to the G++ development team.
1846
1847 @item -ftemplate-depth-@var{n}
1848 @opindex ftemplate-depth
1849 Set the maximum instantiation depth for template classes to @var{n}.
1850 A limit on the template instantiation depth is needed to detect
1851 endless recursions during template class instantiation.  ANSI/ISO C++
1852 conforming programs must not rely on a maximum depth greater than 17.
1853
1854 @item -fno-threadsafe-statics
1855 @opindex fno-threadsafe-statics
1856 Do not emit the extra code to use the routines specified in the C++
1857 ABI for thread-safe initialization of local statics.  You can use this
1858 option to reduce code size slightly in code that doesn't need to be
1859 thread-safe.
1860
1861 @item -fuse-cxa-atexit
1862 @opindex fuse-cxa-atexit
1863 Register destructors for objects with static storage duration with the
1864 @code{__cxa_atexit} function rather than the @code{atexit} function.
1865 This option is required for fully standards-compliant handling of static
1866 destructors, but will only work if your C library supports
1867 @code{__cxa_atexit}.
1868
1869 @item -fno-use-cxa-get-exception-ptr
1870 @opindex fno-use-cxa-get-exception-ptr
1871 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
1872 will cause @code{std::uncaught_exception} to be incorrect, but is necessary
1873 if the runtime routine is not available.
1874
1875 @item -fvisibility-inlines-hidden
1876 @opindex fvisibility-inlines-hidden
1877 This switch declares that the user does not attempt to compare
1878 pointers to inline methods where the addresses of the two functions
1879 were taken in different shared objects.
1880
1881 The effect of this is that GCC may, effectively, mark inline methods with
1882 @code{__attribute__ ((visibility ("hidden")))} so that they do not
1883 appear in the export table of a DSO and do not require a PLT indirection
1884 when used within the DSO@.  Enabling this option can have a dramatic effect
1885 on load and link times of a DSO as it massively reduces the size of the
1886 dynamic export table when the library makes heavy use of templates.
1887
1888 The behavior of this switch is not quite the same as marking the
1889 methods as hidden directly, because it does not affect static variables
1890 local to the function or cause the compiler to deduce that
1891 the function is defined in only one shared object.
1892
1893 You may mark a method as having a visibility explicitly to negate the
1894 effect of the switch for that method.  For example, if you do want to
1895 compare pointers to a particular inline method, you might mark it as
1896 having default visibility.  Marking the enclosing class with explicit
1897 visibility will have no effect.
1898
1899 Explicitly instantiated inline methods are unaffected by this option
1900 as their linkage might otherwise cross a shared library boundary.
1901 @xref{Template Instantiation}.
1902
1903 @item -fvisibility-ms-compat
1904 @opindex fvisibility-ms-compat
1905 This flag attempts to use visibility settings to make GCC's C++
1906 linkage model compatible with that of Microsoft Visual Studio.
1907
1908 The flag makes these changes to GCC's linkage model:
1909
1910 @enumerate
1911 @item
1912 It sets the default visibility to @code{hidden}, like
1913 @option{-fvisibility=hidden}.
1914
1915 @item
1916 Types, but not their members, are not hidden by default.
1917
1918 @item
1919 The One Definition Rule is relaxed for types without explicit
1920 visibility specifications which are defined in more than one different
1921 shared object: those declarations are permitted if they would have
1922 been permitted when this option was not used.
1923 @end enumerate
1924
1925 In new code it is better to use @option{-fvisibility=hidden} and
1926 export those classes which are intended to be externally visible.
1927 Unfortunately it is possible for code to rely, perhaps accidentally,
1928 on the Visual Studio behavior.
1929
1930 Among the consequences of these changes are that static data members
1931 of the same type with the same name but defined in different shared
1932 objects will be different, so changing one will not change the other;
1933 and that pointers to function members defined in different shared
1934 objects may not compare equal.  When this flag is given, it is a
1935 violation of the ODR to define types with the same name differently.
1936
1937 @item -fno-weak
1938 @opindex fno-weak
1939 Do not use weak symbol support, even if it is provided by the linker.
1940 By default, G++ will use weak symbols if they are available.  This
1941 option exists only for testing, and should not be used by end-users;
1942 it will result in inferior code and has no benefits.  This option may
1943 be removed in a future release of G++.
1944
1945 @item -nostdinc++
1946 @opindex nostdinc++
1947 Do not search for header files in the standard directories specific to
1948 C++, but do still search the other standard directories.  (This option
1949 is used when building the C++ library.)
1950 @end table
1951
1952 In addition, these optimization, warning, and code generation options
1953 have meanings only for C++ programs:
1954
1955 @table @gcctabopt
1956 @item -fno-default-inline
1957 @opindex fno-default-inline
1958 Do not assume @samp{inline} for functions defined inside a class scope.
1959 @xref{Optimize Options,,Options That Control Optimization}.  Note that these
1960 functions will have linkage like inline functions; they just won't be
1961 inlined by default.
1962
1963 @item -Wabi @r{(C++ and Objective-C++ only)}
1964 @opindex Wabi
1965 @opindex Wno-abi
1966 Warn when G++ generates code that is probably not compatible with the
1967 vendor-neutral C++ ABI@.  Although an effort has been made to warn about
1968 all such cases, there are probably some cases that are not warned about,
1969 even though G++ is generating incompatible code.  There may also be
1970 cases where warnings are emitted even though the code that is generated
1971 will be compatible.
1972
1973 You should rewrite your code to avoid these warnings if you are
1974 concerned about the fact that code generated by G++ may not be binary
1975 compatible with code generated by other compilers.
1976
1977 The known incompatibilities at this point include:
1978
1979 @itemize @bullet
1980
1981 @item
1982 Incorrect handling of tail-padding for bit-fields.  G++ may attempt to
1983 pack data into the same byte as a base class.  For example:
1984
1985 @smallexample
1986 struct A @{ virtual void f(); int f1 : 1; @};
1987 struct B : public A @{ int f2 : 1; @};
1988 @end smallexample
1989
1990 @noindent
1991 In this case, G++ will place @code{B::f2} into the same byte
1992 as@code{A::f1}; other compilers will not.  You can avoid this problem
1993 by explicitly padding @code{A} so that its size is a multiple of the
1994 byte size on your platform; that will cause G++ and other compilers to
1995 layout @code{B} identically.
1996
1997 @item
1998 Incorrect handling of tail-padding for virtual bases.  G++ does not use
1999 tail padding when laying out virtual bases.  For example:
2000
2001 @smallexample
2002 struct A @{ virtual void f(); char c1; @};
2003 struct B @{ B(); char c2; @};
2004 struct C : public A, public virtual B @{@};
2005 @end smallexample
2006
2007 @noindent
2008 In this case, G++ will not place @code{B} into the tail-padding for
2009 @code{A}; other compilers will.  You can avoid this problem by
2010 explicitly padding @code{A} so that its size is a multiple of its
2011 alignment (ignoring virtual base classes); that will cause G++ and other
2012 compilers to layout @code{C} identically.
2013
2014 @item
2015 Incorrect handling of bit-fields with declared widths greater than that
2016 of their underlying types, when the bit-fields appear in a union.  For
2017 example:
2018
2019 @smallexample
2020 union U @{ int i : 4096; @};
2021 @end smallexample
2022
2023 @noindent
2024 Assuming that an @code{int} does not have 4096 bits, G++ will make the
2025 union too small by the number of bits in an @code{int}.
2026
2027 @item
2028 Empty classes can be placed at incorrect offsets.  For example:
2029
2030 @smallexample
2031 struct A @{@};
2032
2033 struct B @{
2034   A a;
2035   virtual void f ();
2036 @};
2037
2038 struct C : public B, public A @{@};
2039 @end smallexample
2040
2041 @noindent
2042 G++ will place the @code{A} base class of @code{C} at a nonzero offset;
2043 it should be placed at offset zero.  G++ mistakenly believes that the
2044 @code{A} data member of @code{B} is already at offset zero.
2045
2046 @item
2047 Names of template functions whose types involve @code{typename} or
2048 template template parameters can be mangled incorrectly.
2049
2050 @smallexample
2051 template <typename Q>
2052 void f(typename Q::X) @{@}
2053
2054 template <template <typename> class Q>
2055 void f(typename Q<int>::X) @{@}
2056 @end smallexample
2057
2058 @noindent
2059 Instantiations of these templates may be mangled incorrectly.
2060
2061 @end itemize
2062
2063 @item -Wctor-dtor-privacy @r{(C++ and Objective-C++ only)}
2064 @opindex Wctor-dtor-privacy
2065 @opindex Wno-ctor-dtor-privacy
2066 Warn when a class seems unusable because all the constructors or
2067 destructors in that class are private, and it has neither friends nor
2068 public static member functions.
2069
2070 @item -Wnon-virtual-dtor @r{(C++ and Objective-C++ only)}
2071 @opindex Wnon-virtual-dtor
2072 @opindex Wno-non-virtual-dtor
2073 Warn when a class has virtual functions and accessible non-virtual
2074 destructor, in which case it would be possible but unsafe to delete
2075 an instance of a derived class through a pointer to the base class.
2076 This warning is also enabled if -Weffc++ is specified.
2077
2078 @item -Wreorder @r{(C++ and Objective-C++ only)}
2079 @opindex Wreorder
2080 @opindex Wno-reorder
2081 @cindex reordering, warning
2082 @cindex warning for reordering of member initializers
2083 Warn when the order of member initializers given in the code does not
2084 match the order in which they must be executed.  For instance:
2085
2086 @smallexample
2087 struct A @{
2088   int i;
2089   int j;
2090   A(): j (0), i (1) @{ @}
2091 @};
2092 @end smallexample
2093
2094 The compiler will rearrange the member initializers for @samp{i}
2095 and @samp{j} to match the declaration order of the members, emitting
2096 a warning to that effect.  This warning is enabled by @option{-Wall}.
2097 @end table
2098
2099 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
2100
2101 @table @gcctabopt
2102 @item -Weffc++ @r{(C++ and Objective-C++ only)}
2103 @opindex Weffc++
2104 @opindex Wno-effc++
2105 Warn about violations of the following style guidelines from Scott Meyers'
2106 @cite{Effective C++} book:
2107
2108 @itemize @bullet
2109 @item
2110 Item 11:  Define a copy constructor and an assignment operator for classes
2111 with dynamically allocated memory.
2112
2113 @item
2114 Item 12:  Prefer initialization to assignment in constructors.
2115
2116 @item
2117 Item 14:  Make destructors virtual in base classes.
2118
2119 @item
2120 Item 15:  Have @code{operator=} return a reference to @code{*this}.
2121
2122 @item
2123 Item 23:  Don't try to return a reference when you must return an object.
2124
2125 @end itemize
2126
2127 Also warn about violations of the following style guidelines from
2128 Scott Meyers' @cite{More Effective C++} book:
2129
2130 @itemize @bullet
2131 @item
2132 Item 6:  Distinguish between prefix and postfix forms of increment and
2133 decrement operators.
2134
2135 @item
2136 Item 7:  Never overload @code{&&}, @code{||}, or @code{,}.
2137
2138 @end itemize
2139
2140 When selecting this option, be aware that the standard library
2141 headers do not obey all of these guidelines; use @samp{grep -v}
2142 to filter out those warnings.
2143
2144 @item -Wstrict-null-sentinel @r{(C++ and Objective-C++ only)}
2145 @opindex Wstrict-null-sentinel
2146 @opindex Wno-strict-null-sentinel
2147 Warn also about the use of an uncasted @code{NULL} as sentinel.  When
2148 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
2149 to @code{__null}.  Although it is a null pointer constant not a null pointer,
2150 it is guaranteed to of the same size as a pointer.  But this use is
2151 not portable across different compilers.
2152
2153 @item -Wno-non-template-friend @r{(C++ and Objective-C++ only)}
2154 @opindex Wno-non-template-friend
2155 @opindex Wnon-template-friend
2156 Disable warnings when non-templatized friend functions are declared
2157 within a template.  Since the advent of explicit template specification
2158 support in G++, if the name of the friend is an unqualified-id (i.e.,
2159 @samp{friend foo(int)}), the C++ language specification demands that the
2160 friend declare or define an ordinary, nontemplate function.  (Section
2161 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
2162 could be interpreted as a particular specialization of a templatized
2163 function.  Because this non-conforming behavior is no longer the default
2164 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
2165 check existing code for potential trouble spots and is on by default.
2166 This new compiler behavior can be turned off with
2167 @option{-Wno-non-template-friend} which keeps the conformant compiler code
2168 but disables the helpful warning.
2169
2170 @item -Wold-style-cast @r{(C++ and Objective-C++ only)}
2171 @opindex Wold-style-cast
2172 @opindex Wno-old-style-cast
2173 Warn if an old-style (C-style) cast to a non-void type is used within
2174 a C++ program.  The new-style casts (@samp{dynamic_cast},
2175 @samp{static_cast}, @samp{reinterpret_cast}, and @samp{const_cast}) are
2176 less vulnerable to unintended effects and much easier to search for.
2177
2178 @item -Woverloaded-virtual @r{(C++ and Objective-C++ only)}
2179 @opindex Woverloaded-virtual
2180 @opindex Wno-overloaded-virtual
2181 @cindex overloaded virtual fn, warning
2182 @cindex warning for overloaded virtual fn
2183 Warn when a function declaration hides virtual functions from a
2184 base class.  For example, in:
2185
2186 @smallexample
2187 struct A @{
2188   virtual void f();
2189 @};
2190
2191 struct B: public A @{
2192   void f(int);
2193 @};
2194 @end smallexample
2195
2196 the @code{A} class version of @code{f} is hidden in @code{B}, and code
2197 like:
2198
2199 @smallexample
2200 B* b;
2201 b->f();
2202 @end smallexample
2203
2204 will fail to compile.
2205
2206 @item -Wno-pmf-conversions @r{(C++ and Objective-C++ only)}
2207 @opindex Wno-pmf-conversions
2208 @opindex Wpmf-conversions
2209 Disable the diagnostic for converting a bound pointer to member function
2210 to a plain pointer.
2211
2212 @item -Wsign-promo @r{(C++ and Objective-C++ only)}
2213 @opindex Wsign-promo
2214 @opindex Wno-sign-promo
2215 Warn when overload resolution chooses a promotion from unsigned or
2216 enumerated type to a signed type, over a conversion to an unsigned type of
2217 the same size.  Previous versions of G++ would try to preserve
2218 unsignedness, but the standard mandates the current behavior.
2219
2220 @smallexample
2221 struct A @{
2222   operator int ();
2223   A& operator = (int);
2224 @};
2225
2226 main ()
2227 @{
2228   A a,b;
2229   a = b;
2230 @}
2231 @end smallexample
2232
2233 In this example, G++ will synthesize a default @samp{A& operator =
2234 (const A&);}, while cfront will use the user-defined @samp{operator =}.
2235 @end table
2236
2237 @node Objective-C and Objective-C++ Dialect Options
2238 @section Options Controlling Objective-C and Objective-C++ Dialects
2239
2240 @cindex compiler options, Objective-C and Objective-C++
2241 @cindex Objective-C and Objective-C++ options, command line
2242 @cindex options, Objective-C and Objective-C++
2243 (NOTE: This manual does not describe the Objective-C and Objective-C++
2244 languages themselves.  See @xref{Standards,,Language Standards
2245 Supported by GCC}, for references.)
2246
2247 This section describes the command-line options that are only meaningful
2248 for Objective-C and Objective-C++ programs, but you can also use most of
2249 the language-independent GNU compiler options.
2250 For example, you might compile a file @code{some_class.m} like this:
2251
2252 @smallexample
2253 gcc -g -fgnu-runtime -O -c some_class.m
2254 @end smallexample
2255
2256 @noindent
2257 In this example, @option{-fgnu-runtime} is an option meant only for
2258 Objective-C and Objective-C++ programs; you can use the other options with
2259 any language supported by GCC@.
2260
2261 Note that since Objective-C is an extension of the C language, Objective-C
2262 compilations may also use options specific to the C front-end (e.g.,
2263 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
2264 C++-specific options (e.g., @option{-Wabi}).
2265
2266 Here is a list of options that are @emph{only} for compiling Objective-C
2267 and Objective-C++ programs:
2268
2269 @table @gcctabopt
2270 @item -fconstant-string-class=@var{class-name}
2271 @opindex fconstant-string-class
2272 Use @var{class-name} as the name of the class to instantiate for each
2273 literal string specified with the syntax @code{@@"@dots{}"}.  The default
2274 class name is @code{NXConstantString} if the GNU runtime is being used, and
2275 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
2276 @option{-fconstant-cfstrings} option, if also present, will override the
2277 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
2278 to be laid out as constant CoreFoundation strings.
2279
2280 @item -fgnu-runtime
2281 @opindex fgnu-runtime
2282 Generate object code compatible with the standard GNU Objective-C
2283 runtime.  This is the default for most types of systems.
2284
2285 @item -fnext-runtime
2286 @opindex fnext-runtime
2287 Generate output compatible with the NeXT runtime.  This is the default
2288 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
2289 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
2290 used.
2291
2292 @item -fno-nil-receivers
2293 @opindex fno-nil-receivers
2294 Assume that all Objective-C message dispatches (e.g.,
2295 @code{[receiver message:arg]}) in this translation unit ensure that the receiver
2296 is not @code{nil}.  This allows for more efficient entry points in the runtime
2297 to be used.  Currently, this option is only available in conjunction with
2298 the NeXT runtime on Mac OS X 10.3 and later.
2299
2300 @item -fobjc-call-cxx-cdtors
2301 @opindex fobjc-call-cxx-cdtors
2302 For each Objective-C class, check if any of its instance variables is a
2303 C++ object with a non-trivial default constructor.  If so, synthesize a
2304 special @code{- (id) .cxx_construct} instance method that will run
2305 non-trivial default constructors on any such instance variables, in order,
2306 and then return @code{self}.  Similarly, check if any instance variable
2307 is a C++ object with a non-trivial destructor, and if so, synthesize a
2308 special @code{- (void) .cxx_destruct} method that will run
2309 all such default destructors, in reverse order.
2310
2311 The @code{- (id) .cxx_construct} and/or @code{- (void) .cxx_destruct} methods
2312 thusly generated will only operate on instance variables declared in the
2313 current Objective-C class, and not those inherited from superclasses.  It
2314 is the responsibility of the Objective-C runtime to invoke all such methods
2315 in an object's inheritance hierarchy.  The @code{- (id) .cxx_construct} methods
2316 will be invoked by the runtime immediately after a new object
2317 instance is allocated; the @code{- (void) .cxx_destruct} methods will
2318 be invoked immediately before the runtime deallocates an object instance.
2319
2320 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
2321 support for invoking the @code{- (id) .cxx_construct} and
2322 @code{- (void) .cxx_destruct} methods.
2323
2324 @item -fobjc-direct-dispatch
2325 @opindex fobjc-direct-dispatch
2326 Allow fast jumps to the message dispatcher.  On Darwin this is
2327 accomplished via the comm page.
2328
2329 @item -fobjc-exceptions
2330 @opindex fobjc-exceptions
2331 Enable syntactic support for structured exception handling in Objective-C,
2332 similar to what is offered by C++ and Java.  This option is
2333 unavailable in conjunction with the NeXT runtime on Mac OS X 10.2 and
2334 earlier.
2335
2336 @smallexample
2337   @@try @{
2338     @dots{}
2339        @@throw expr;
2340     @dots{}
2341   @}
2342   @@catch (AnObjCClass *exc) @{
2343     @dots{}
2344       @@throw expr;
2345     @dots{}
2346       @@throw;
2347     @dots{}
2348   @}
2349   @@catch (AnotherClass *exc) @{
2350     @dots{}
2351   @}
2352   @@catch (id allOthers) @{
2353     @dots{}
2354   @}
2355   @@finally @{
2356     @dots{}
2357       @@throw expr;
2358     @dots{}
2359   @}
2360 @end smallexample
2361
2362 The @code{@@throw} statement may appear anywhere in an Objective-C or
2363 Objective-C++ program; when used inside of a @code{@@catch} block, the
2364 @code{@@throw} may appear without an argument (as shown above), in which case
2365 the object caught by the @code{@@catch} will be rethrown.
2366
2367 Note that only (pointers to) Objective-C objects may be thrown and
2368 caught using this scheme.  When an object is thrown, it will be caught
2369 by the nearest @code{@@catch} clause capable of handling objects of that type,
2370 analogously to how @code{catch} blocks work in C++ and Java.  A
2371 @code{@@catch(id @dots{})} clause (as shown above) may also be provided to catch
2372 any and all Objective-C exceptions not caught by previous @code{@@catch}
2373 clauses (if any).
2374
2375 The @code{@@finally} clause, if present, will be executed upon exit from the
2376 immediately preceding @code{@@try @dots{} @@catch} section.  This will happen
2377 regardless of whether any exceptions are thrown, caught or rethrown
2378 inside the @code{@@try @dots{} @@catch} section, analogously to the behavior
2379 of the @code{finally} clause in Java.
2380
2381 There are several caveats to using the new exception mechanism:
2382
2383 @itemize @bullet
2384 @item
2385 Although currently designed to be binary compatible with @code{NS_HANDLER}-style
2386 idioms provided by the @code{NSException} class, the new
2387 exceptions can only be used on Mac OS X 10.3 (Panther) and later
2388 systems, due to additional functionality needed in the (NeXT) Objective-C
2389 runtime.
2390
2391 @item
2392 As mentioned above, the new exceptions do not support handling
2393 types other than Objective-C objects.   Furthermore, when used from
2394 Objective-C++, the Objective-C exception model does not interoperate with C++
2395 exceptions at this time.  This means you cannot @code{@@throw} an exception
2396 from Objective-C and @code{catch} it in C++, or vice versa
2397 (i.e., @code{throw @dots{} @@catch}).
2398 @end itemize
2399
2400 The @option{-fobjc-exceptions} switch also enables the use of synchronization
2401 blocks for thread-safe execution:
2402
2403 @smallexample
2404   @@synchronized (ObjCClass *guard) @{
2405     @dots{}
2406   @}
2407 @end smallexample
2408
2409 Upon entering the @code{@@synchronized} block, a thread of execution shall
2410 first check whether a lock has been placed on the corresponding @code{guard}
2411 object by another thread.  If it has, the current thread shall wait until
2412 the other thread relinquishes its lock.  Once @code{guard} becomes available,
2413 the current thread will place its own lock on it, execute the code contained in
2414 the @code{@@synchronized} block, and finally relinquish the lock (thereby
2415 making @code{guard} available to other threads).
2416
2417 Unlike Java, Objective-C does not allow for entire methods to be marked
2418 @code{@@synchronized}.  Note that throwing exceptions out of
2419 @code{@@synchronized} blocks is allowed, and will cause the guarding object
2420 to be unlocked properly.
2421
2422 @item -fobjc-gc
2423 @opindex fobjc-gc
2424 Enable garbage collection (GC) in Objective-C and Objective-C++ programs.
2425
2426 @item -freplace-objc-classes
2427 @opindex freplace-objc-classes
2428 Emit a special marker instructing @command{ld(1)} not to statically link in
2429 the resulting object file, and allow @command{dyld(1)} to load it in at
2430 run time instead.  This is used in conjunction with the Fix-and-Continue
2431 debugging mode, where the object file in question may be recompiled and
2432 dynamically reloaded in the course of program execution, without the need
2433 to restart the program itself.  Currently, Fix-and-Continue functionality
2434 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
2435 and later.
2436
2437 @item -fzero-link
2438 @opindex fzero-link
2439 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
2440 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
2441 compile time) with static class references that get initialized at load time,
2442 which improves run-time performance.  Specifying the @option{-fzero-link} flag
2443 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
2444 to be retained.  This is useful in Zero-Link debugging mode, since it allows
2445 for individual class implementations to be modified during program execution.
2446
2447 @item -gen-decls
2448 @opindex gen-decls
2449 Dump interface declarations for all classes seen in the source file to a
2450 file named @file{@var{sourcename}.decl}.
2451
2452 @item -Wassign-intercept @r{(Objective-C and Objective-C++ only)}
2453 @opindex Wassign-intercept
2454 @opindex Wno-assign-intercept
2455 Warn whenever an Objective-C assignment is being intercepted by the
2456 garbage collector.
2457
2458 @item -Wno-protocol @r{(Objective-C and Objective-C++ only)}
2459 @opindex Wno-protocol
2460 @opindex Wprotocol
2461 If a class is declared to implement a protocol, a warning is issued for
2462 every method in the protocol that is not implemented by the class.  The
2463 default behavior is to issue a warning for every method not explicitly
2464 implemented in the class, even if a method implementation is inherited
2465 from the superclass.  If you use the @option{-Wno-protocol} option, then
2466 methods inherited from the superclass are considered to be implemented,
2467 and no warning is issued for them.
2468
2469 @item -Wselector @r{(Objective-C and Objective-C++ only)}
2470 @opindex Wselector
2471 @opindex Wno-selector
2472 Warn if multiple methods of different types for the same selector are
2473 found during compilation.  The check is performed on the list of methods
2474 in the final stage of compilation.  Additionally, a check is performed
2475 for each selector appearing in a @code{@@selector(@dots{})}
2476 expression, and a corresponding method for that selector has been found
2477 during compilation.  Because these checks scan the method table only at
2478 the end of compilation, these warnings are not produced if the final
2479 stage of compilation is not reached, for example because an error is
2480 found during compilation, or because the @option{-fsyntax-only} option is
2481 being used.
2482
2483 @item -Wstrict-selector-match @r{(Objective-C and Objective-C++ only)}
2484 @opindex Wstrict-selector-match
2485 @opindex Wno-strict-selector-match
2486 Warn if multiple methods with differing argument and/or return types are
2487 found for a given selector when attempting to send a message using this
2488 selector to a receiver of type @code{id} or @code{Class}.  When this flag
2489 is off (which is the default behavior), the compiler will omit such warnings
2490 if any differences found are confined to types which share the same size
2491 and alignment.
2492
2493 @item -Wundeclared-selector @r{(Objective-C and Objective-C++ only)}
2494 @opindex Wundeclared-selector
2495 @opindex Wno-undeclared-selector
2496 Warn if a @code{@@selector(@dots{})} expression referring to an
2497 undeclared selector is found.  A selector is considered undeclared if no
2498 method with that name has been declared before the
2499 @code{@@selector(@dots{})} expression, either explicitly in an
2500 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
2501 an @code{@@implementation} section.  This option always performs its
2502 checks as soon as a @code{@@selector(@dots{})} expression is found,
2503 while @option{-Wselector} only performs its checks in the final stage of
2504 compilation.  This also enforces the coding style convention
2505 that methods and selectors must be declared before being used.
2506
2507 @item -print-objc-runtime-info
2508 @opindex print-objc-runtime-info
2509 Generate C header describing the largest structure that is passed by
2510 value, if any.
2511
2512 @end table
2513
2514 @node Language Independent Options
2515 @section Options to Control Diagnostic Messages Formatting
2516 @cindex options to control diagnostics formatting
2517 @cindex diagnostic messages
2518 @cindex message formatting
2519
2520 Traditionally, diagnostic messages have been formatted irrespective of
2521 the output device's aspect (e.g.@: its width, @dots{}).  The options described
2522 below can be used to control the diagnostic messages formatting
2523 algorithm, e.g.@: how many characters per line, how often source location
2524 information should be reported.  Right now, only the C++ front end can
2525 honor these options.  However it is expected, in the near future, that
2526 the remaining front ends would be able to digest them correctly.
2527
2528 @table @gcctabopt
2529 @item -fmessage-length=@var{n}
2530 @opindex fmessage-length
2531 Try to format error messages so that they fit on lines of about @var{n}
2532 characters.  The default is 72 characters for @command{g++} and 0 for the rest of
2533 the front ends supported by GCC@.  If @var{n} is zero, then no
2534 line-wrapping will be done; each error message will appear on a single
2535 line.
2536
2537 @opindex fdiagnostics-show-location
2538 @item -fdiagnostics-show-location=once
2539 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
2540 reporter to emit @emph{once} source location information; that is, in
2541 case the message is too long to fit on a single physical line and has to
2542 be wrapped, the source location won't be emitted (as prefix) again,
2543 over and over, in subsequent continuation lines.  This is the default
2544 behavior.
2545
2546 @item -fdiagnostics-show-location=every-line
2547 Only meaningful in line-wrapping mode.  Instructs the diagnostic
2548 messages reporter to emit the same source location information (as
2549 prefix) for physical lines that result from the process of breaking
2550 a message which is too long to fit on a single line.
2551
2552 @item -fdiagnostics-show-option
2553 @opindex fdiagnostics-show-option
2554 This option instructs the diagnostic machinery to add text to each
2555 diagnostic emitted, which indicates which command line option directly
2556 controls that diagnostic, when such an option is known to the
2557 diagnostic machinery.
2558
2559 @item -Wcoverage-mismatch
2560 @opindex Wcoverage-mismatch
2561 Warn if feedback profiles do not match when using the
2562 @option{-fprofile-use} option.
2563 If a source file was changed between @option{-fprofile-gen} and
2564 @option{-fprofile-use}, the files with the profile feedback can fail
2565 to match the source file and GCC can not use the profile feedback
2566 information.  By default, GCC emits an error message in this case.
2567 The option @option{-Wcoverage-mismatch} emits a warning instead of an
2568 error.  GCC does not use appropriate feedback profiles, so using this
2569 option can result in poorly optimized code.  This option is useful
2570 only in the case of very minor changes such as bug fixes to an
2571 existing code-base.
2572
2573 @end table
2574
2575 @node Warning Options
2576 @section Options to Request or Suppress Warnings
2577 @cindex options to control warnings
2578 @cindex warning messages
2579 @cindex messages, warning
2580 @cindex suppressing warnings
2581
2582 Warnings are diagnostic messages that report constructions which
2583 are not inherently erroneous but which are risky or suggest there
2584 may have been an error.
2585
2586 The following language-independent options do not enable specific
2587 warnings but control the kinds of diagnostics produced by GCC.
2588
2589 @table @gcctabopt
2590 @cindex syntax checking
2591 @item -fsyntax-only
2592 @opindex fsyntax-only
2593 Check the code for syntax errors, but don't do anything beyond that.
2594
2595 @item -w
2596 @opindex w
2597 Inhibit all warning messages.
2598
2599 @item -Werror
2600 @opindex Werror
2601 @opindex Wno-error
2602 Make all warnings into errors.
2603
2604 @item -Werror=
2605 @opindex Werror=
2606 @opindex Wno-error=
2607 Make the specified warning into an error.  The specifier for a warning
2608 is appended, for example @option{-Werror=switch} turns the warnings
2609 controlled by @option{-Wswitch} into errors.  This switch takes a
2610 negative form, to be used to negate @option{-Werror} for specific
2611 warnings, for example @option{-Wno-error=switch} makes
2612 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
2613 is in effect.  You can use the @option{-fdiagnostics-show-option}
2614 option to have each controllable warning amended with the option which
2615 controls it, to determine what to use with this option.
2616
2617 Note that specifying @option{-Werror=}@var{foo} automatically implies
2618 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
2619 imply anything.
2620
2621 @item -Wfatal-errors
2622 @opindex Wfatal-errors
2623 @opindex Wno-fatal-errors
2624 This option causes the compiler to abort compilation on the first error
2625 occurred rather than trying to keep going and printing further error
2626 messages.
2627
2628 @end table
2629
2630 You can request many specific warnings with options beginning
2631 @samp{-W}, for example @option{-Wimplicit} to request warnings on
2632 implicit declarations.  Each of these specific warning options also
2633 has a negative form beginning @samp{-Wno-} to turn off warnings; for
2634 example, @option{-Wno-implicit}.  This manual lists only one of the
2635 two forms, whichever is not the default.  For further,
2636 language-specific options also refer to @ref{C++ Dialect Options} and
2637 @ref{Objective-C and Objective-C++ Dialect Options}.
2638
2639 @table @gcctabopt
2640 @item -pedantic
2641 @opindex pedantic
2642 Issue all the warnings demanded by strict ISO C and ISO C++;
2643 reject all programs that use forbidden extensions, and some other
2644 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
2645 version of the ISO C standard specified by any @option{-std} option used.
2646
2647 Valid ISO C and ISO C++ programs should compile properly with or without
2648 this option (though a rare few will require @option{-ansi} or a
2649 @option{-std} option specifying the required version of ISO C)@.  However,
2650 without this option, certain GNU extensions and traditional C and C++
2651 features are supported as well.  With this option, they are rejected.
2652
2653 @option{-pedantic} does not cause warning messages for use of the
2654 alternate keywords whose names begin and end with @samp{__}.  Pedantic
2655 warnings are also disabled in the expression that follows
2656 @code{__extension__}.  However, only system header files should use
2657 these escape routes; application programs should avoid them.
2658 @xref{Alternate Keywords}.
2659
2660 Some users try to use @option{-pedantic} to check programs for strict ISO
2661 C conformance.  They soon find that it does not do quite what they want:
2662 it finds some non-ISO practices, but not all---only those for which
2663 ISO C @emph{requires} a diagnostic, and some others for which
2664 diagnostics have been added.
2665
2666 A feature to report any failure to conform to ISO C might be useful in
2667 some instances, but would require considerable additional work and would
2668 be quite different from @option{-pedantic}.  We don't have plans to
2669 support such a feature in the near future.
2670
2671 Where the standard specified with @option{-std} represents a GNU
2672 extended dialect of C, such as @samp{gnu89} or @samp{gnu99}, there is a
2673 corresponding @dfn{base standard}, the version of ISO C on which the GNU
2674 extended dialect is based.  Warnings from @option{-pedantic} are given
2675 where they are required by the base standard.  (It would not make sense
2676 for such warnings to be given only for features not in the specified GNU
2677 C dialect, since by definition the GNU dialects of C include all
2678 features the compiler supports with the given option, and there would be
2679 nothing to warn about.)
2680
2681 @item -pedantic-errors
2682 @opindex pedantic-errors
2683 Like @option{-pedantic}, except that errors are produced rather than
2684 warnings.
2685
2686 @item -Wall
2687 @opindex Wall
2688 @opindex Wno-all
2689 This enables all the warnings about constructions that some users
2690 consider questionable, and that are easy to avoid (or modify to
2691 prevent the warning), even in conjunction with macros.  This also
2692 enables some language-specific warnings described in @ref{C++ Dialect
2693 Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
2694
2695 @option{-Wall} turns on the following warning flags:
2696
2697 @gccoptlist{-Waddress   @gol
2698 -Warray-bounds @r{(only with} @option{-O2}@r{)}  @gol
2699 -Wc++0x-compat  @gol
2700 -Wchar-subscripts  @gol
2701 -Wimplicit-int  @gol
2702 -Wimplicit-function-declaration  @gol
2703 -Wcomment  @gol
2704 -Wformat   @gol
2705 -Wmain @r{(only for C/ObjC and unless} @option{-ffreestanding}@r{)}  @gol
2706 -Wmissing-braces  @gol
2707 -Wnonnull  @gol
2708 -Wparentheses  @gol
2709 -Wpointer-sign  @gol
2710 -Wreorder   @gol
2711 -Wreturn-type  @gol
2712 -Wsequence-point  @gol
2713 -Wsign-compare @r{(only in C++)}  @gol
2714 -Wstrict-aliasing  @gol
2715 -Wstrict-overflow=1  @gol
2716 -Wswitch  @gol
2717 -Wtrigraphs  @gol
2718 -Wuninitialized  @gol
2719 -Wunknown-pragmas  @gol
2720 -Wunused-function  @gol
2721 -Wunused-label     @gol
2722 -Wunused-value     @gol
2723 -Wunused-variable  @gol
2724 -Wvolatile-register-var @gol
2725 }
2726
2727 Note that some warning flags are not implied by @option{-Wall}.  Some of
2728 them warn about constructions that users generally do not consider
2729 questionable, but which occasionally you might wish to check for;
2730 others warn about constructions that are necessary or hard to avoid in
2731 some cases, and there is no simple way to modify the code to suppress
2732 the warning. Some of them are enabled by @option{-Wextra} but many of
2733 them must be enabled individually.
2734
2735 @item -Wextra
2736 @opindex W
2737 @opindex Wextra
2738 @opindex Wno-extra
2739 This enables some extra warning flags that are not enabled by
2740 @option{-Wall}. (This option used to be called @option{-W}.  The older
2741 name is still supported, but the newer name is more descriptive.)
2742
2743 @gccoptlist{-Wclobbered  @gol
2744 -Wempty-body  @gol
2745 -Wignored-qualifiers @gol
2746 -Wmissing-field-initializers  @gol
2747 -Wmissing-parameter-type @r{(C only)}  @gol
2748 -Wold-style-declaration @r{(C only)}  @gol
2749 -Woverride-init  @gol
2750 -Wsign-compare  @gol
2751 -Wtype-limits  @gol
2752 -Wuninitialized  @gol
2753 -Wunused-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)}  @gol
2754 }
2755
2756 The option @option{-Wextra} also prints warning messages for the
2757 following cases:
2758
2759 @itemize @bullet
2760
2761 @item
2762 A pointer is compared against integer zero with @samp{<}, @samp{<=},
2763 @samp{>}, or @samp{>=}.
2764
2765 @item 
2766 (C++ only) An enumerator and a non-enumerator both appear in a
2767 conditional expression.
2768
2769 @item 
2770 (C++ only) Ambiguous virtual bases.
2771
2772 @item 
2773 (C++ only) Subscripting an array which has been declared @samp{register}.
2774
2775 @item 
2776 (C++ only) Taking the address of a variable which has been declared
2777 @samp{register}.
2778
2779 @item 
2780 (C++ only) A base class is not initialized in a derived class' copy
2781 constructor.
2782
2783 @end itemize
2784
2785 @item -Wchar-subscripts
2786 @opindex Wchar-subscripts
2787 @opindex Wno-char-subscripts
2788 Warn if an array subscript has type @code{char}.  This is a common cause
2789 of error, as programmers often forget that this type is signed on some
2790 machines.
2791 This warning is enabled by @option{-Wall}.
2792
2793 @item -Wcomment
2794 @opindex Wcomment
2795 @opindex Wno-comment
2796 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
2797 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
2798 This warning is enabled by @option{-Wall}.
2799
2800 @item -Wformat
2801 @opindex Wformat
2802 @opindex Wno-format
2803 @opindex ffreestanding
2804 @opindex fno-builtin
2805 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
2806 the arguments supplied have types appropriate to the format string
2807 specified, and that the conversions specified in the format string make
2808 sense.  This includes standard functions, and others specified by format
2809 attributes (@pxref{Function Attributes}), in the @code{printf},
2810 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
2811 not in the C standard) families (or other target-specific families).
2812 Which functions are checked without format attributes having been
2813 specified depends on the standard version selected, and such checks of
2814 functions without the attribute specified are disabled by
2815 @option{-ffreestanding} or @option{-fno-builtin}.
2816
2817 The formats are checked against the format features supported by GNU
2818 libc version 2.2.  These include all ISO C90 and C99 features, as well
2819 as features from the Single Unix Specification and some BSD and GNU
2820 extensions.  Other library implementations may not support all these
2821 features; GCC does not support warning about features that go beyond a
2822 particular library's limitations.  However, if @option{-pedantic} is used
2823 with @option{-Wformat}, warnings will be given about format features not
2824 in the selected standard version (but not for @code{strfmon} formats,
2825 since those are not in any version of the C standard).  @xref{C Dialect
2826 Options,,Options Controlling C Dialect}.
2827
2828 Since @option{-Wformat} also checks for null format arguments for
2829 several functions, @option{-Wformat} also implies @option{-Wnonnull}.
2830
2831 @option{-Wformat} is included in @option{-Wall}.  For more control over some
2832 aspects of format checking, the options @option{-Wformat-y2k},
2833 @option{-Wno-format-extra-args}, @option{-Wno-format-zero-length},
2834 @option{-Wformat-nonliteral}, @option{-Wformat-security}, and
2835 @option{-Wformat=2} are available, but are not included in @option{-Wall}.
2836
2837 @item -Wformat-y2k
2838 @opindex Wformat-y2k
2839 @opindex Wno-format-y2k
2840 If @option{-Wformat} is specified, also warn about @code{strftime}
2841 formats which may yield only a two-digit year.
2842
2843 @item -Wno-format-contains-nul
2844 @opindex Wno-format-contains-nul
2845 @opindex Wformat-contains-nul
2846 If @option{-Wformat} is specified, do not warn about format strings that
2847 contain NUL bytes.
2848
2849 @item -Wno-format-extra-args
2850 @opindex Wno-format-extra-args
2851 @opindex Wformat-extra-args
2852 If @option{-Wformat} is specified, do not warn about excess arguments to a
2853 @code{printf} or @code{scanf} format function.  The C standard specifies
2854 that such arguments are ignored.
2855
2856 Where the unused arguments lie between used arguments that are
2857 specified with @samp{$} operand number specifications, normally
2858 warnings are still given, since the implementation could not know what
2859 type to pass to @code{va_arg} to skip the unused arguments.  However,
2860 in the case of @code{scanf} formats, this option will suppress the
2861 warning if the unused arguments are all pointers, since the Single
2862 Unix Specification says that such unused arguments are allowed.
2863
2864 @item -Wno-format-zero-length @r{(C and Objective-C only)}
2865 @opindex Wno-format-zero-length
2866 @opindex Wformat-zero-length
2867 If @option{-Wformat} is specified, do not warn about zero-length formats.
2868 The C standard specifies that zero-length formats are allowed.
2869
2870 @item -Wformat-nonliteral
2871 @opindex Wformat-nonliteral
2872 @opindex Wno-format-nonliteral
2873 If @option{-Wformat} is specified, also warn if the format string is not a
2874 string literal and so cannot be checked, unless the format function
2875 takes its format arguments as a @code{va_list}.
2876
2877 @item -Wformat-security
2878 @opindex Wformat-security
2879 @opindex Wno-format-security
2880 If @option{-Wformat} is specified, also warn about uses of format
2881 functions that represent possible security problems.  At present, this
2882 warns about calls to @code{printf} and @code{scanf} functions where the
2883 format string is not a string literal and there are no format arguments,
2884 as in @code{printf (foo);}.  This may be a security hole if the format
2885 string came from untrusted input and contains @samp{%n}.  (This is
2886 currently a subset of what @option{-Wformat-nonliteral} warns about, but
2887 in future warnings may be added to @option{-Wformat-security} that are not
2888 included in @option{-Wformat-nonliteral}.)
2889
2890 @item -Wformat=2
2891 @opindex Wformat=2
2892 @opindex Wno-format=2
2893 Enable @option{-Wformat} plus format checks not included in
2894 @option{-Wformat}.  Currently equivalent to @samp{-Wformat
2895 -Wformat-nonliteral -Wformat-security -Wformat-y2k}.
2896
2897 @item -Wnonnull @r{(C and Objective-C only)}
2898 @opindex Wnonnull
2899 @opindex Wno-nonnull
2900 Warn about passing a null pointer for arguments marked as
2901 requiring a non-null value by the @code{nonnull} function attribute.
2902
2903 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
2904 can be disabled with the @option{-Wno-nonnull} option.
2905
2906 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
2907 @opindex Winit-self
2908 @opindex Wno-init-self
2909 Warn about uninitialized variables which are initialized with themselves.
2910 Note this option can only be used with the @option{-Wuninitialized} option.
2911
2912 For example, GCC will warn about @code{i} being uninitialized in the
2913 following snippet only when @option{-Winit-self} has been specified:
2914 @smallexample
2915 @group
2916 int f()
2917 @{
2918   int i = i;
2919   return i;
2920 @}
2921 @end group
2922 @end smallexample
2923
2924 @item -Wimplicit-int @r{(C and Objective-C only)}
2925 @opindex Wimplicit-int
2926 @opindex Wno-implicit-int
2927 Warn when a declaration does not specify a type.
2928 This warning is enabled by @option{-Wall}.
2929
2930 @item -Wimplicit-function-declaration @r{(C and Objective-C only)}
2931 @opindex Wimplicit-function-declaration
2932 @opindex Wno-implicit-function-declaration
2933 Give a warning whenever a function is used before being declared. In
2934 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
2935 enabled by default and it is made into an error by
2936 @option{-pedantic-errors}. This warning is also enabled by
2937 @option{-Wall}.
2938
2939 @item -Wimplicit
2940 @opindex Wimplicit
2941 @opindex Wno-implicit
2942 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
2943 This warning is enabled by @option{-Wall}.
2944
2945 @item -Wignored-qualifiers @r{(C and C++ only)}
2946 @opindex Wignored-qualifiers
2947 @opindex Wno-ignored-qualifiers
2948 Warn if the return type of a function has a type qualifier
2949 such as @code{const}.  For ISO C such a type qualifier has no effect,
2950 since the value returned by a function is not an lvalue.
2951 For C++, the warning is only emitted for scalar types or @code{void}.
2952 ISO C prohibits qualified @code{void} return types on function
2953 definitions, so such return types always receive a warning
2954 even without this option.
2955
2956 This warning is also enabled by @option{-Wextra}.
2957
2958 @item -Wmain
2959 @opindex Wmain
2960 @opindex Wno-main
2961 Warn if the type of @samp{main} is suspicious.  @samp{main} should be
2962 a function with external linkage, returning int, taking either zero
2963 arguments, two, or three arguments of appropriate types.  This warning
2964 is enabled by default in C++ and is enabled by either @option{-Wall}
2965 or @option{-pedantic}.
2966
2967 @item -Wmissing-braces
2968 @opindex Wmissing-braces
2969 @opindex Wno-missing-braces
2970 Warn if an aggregate or union initializer is not fully bracketed.  In
2971 the following example, the initializer for @samp{a} is not fully
2972 bracketed, but that for @samp{b} is fully bracketed.
2973
2974 @smallexample
2975 int a[2][2] = @{ 0, 1, 2, 3 @};
2976 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
2977 @end smallexample
2978
2979 This warning is enabled by @option{-Wall}.
2980
2981 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
2982 @opindex Wmissing-include-dirs
2983 @opindex Wno-missing-include-dirs
2984 Warn if a user-supplied include directory does not exist.
2985
2986 @item -Wparentheses
2987 @opindex Wparentheses
2988 @opindex Wno-parentheses
2989 Warn if parentheses are omitted in certain contexts, such
2990 as when there is an assignment in a context where a truth value
2991 is expected, or when operators are nested whose precedence people
2992 often get confused about.
2993
2994 Also warn if a comparison like @samp{x<=y<=z} appears; this is
2995 equivalent to @samp{(x<=y ? 1 : 0) <= z}, which is a different
2996 interpretation from that of ordinary mathematical notation.
2997
2998 Also warn about constructions where there may be confusion to which
2999 @code{if} statement an @code{else} branch belongs.  Here is an example of
3000 such a case:
3001
3002 @smallexample
3003 @group
3004 @{
3005   if (a)
3006     if (b)
3007       foo ();
3008   else
3009     bar ();
3010 @}
3011 @end group
3012 @end smallexample
3013
3014 In C/C++, every @code{else} branch belongs to the innermost possible
3015 @code{if} statement, which in this example is @code{if (b)}.  This is
3016 often not what the programmer expected, as illustrated in the above
3017 example by indentation the programmer chose.  When there is the
3018 potential for this confusion, GCC will issue a warning when this flag
3019 is specified.  To eliminate the warning, add explicit braces around
3020 the innermost @code{if} statement so there is no way the @code{else}
3021 could belong to the enclosing @code{if}.  The resulting code would
3022 look like this:
3023
3024 @smallexample
3025 @group
3026 @{
3027   if (a)
3028     @{
3029       if (b)
3030         foo ();
3031       else
3032         bar ();
3033     @}
3034 @}
3035 @end group
3036 @end smallexample
3037
3038 This warning is enabled by @option{-Wall}.
3039
3040 @item -Wsequence-point
3041 @opindex Wsequence-point
3042 @opindex Wno-sequence-point
3043 Warn about code that may have undefined semantics because of violations
3044 of sequence point rules in the C and C++ standards.
3045
3046 The C and C++ standards defines the order in which expressions in a C/C++
3047 program are evaluated in terms of @dfn{sequence points}, which represent
3048 a partial ordering between the execution of parts of the program: those
3049 executed before the sequence point, and those executed after it.  These
3050 occur after the evaluation of a full expression (one which is not part
3051 of a larger expression), after the evaluation of the first operand of a
3052 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
3053 function is called (but after the evaluation of its arguments and the
3054 expression denoting the called function), and in certain other places.
3055 Other than as expressed by the sequence point rules, the order of
3056 evaluation of subexpressions of an expression is not specified.  All
3057 these rules describe only a partial order rather than a total order,
3058 since, for example, if two functions are called within one expression
3059 with no sequence point between them, the order in which the functions
3060 are called is not specified.  However, the standards committee have
3061 ruled that function calls do not overlap.
3062
3063 It is not specified when between sequence points modifications to the
3064 values of objects take effect.  Programs whose behavior depends on this
3065 have undefined behavior; the C and C++ standards specify that ``Between
3066 the previous and next sequence point an object shall have its stored
3067 value modified at most once by the evaluation of an expression.
3068 Furthermore, the prior value shall be read only to determine the value
3069 to be stored.''.  If a program breaks these rules, the results on any
3070 particular implementation are entirely unpredictable.
3071
3072 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
3073 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
3074 diagnosed by this option, and it may give an occasional false positive
3075 result, but in general it has been found fairly effective at detecting
3076 this sort of problem in programs.
3077
3078 The standard is worded confusingly, therefore there is some debate
3079 over the precise meaning of the sequence point rules in subtle cases.
3080 Links to discussions of the problem, including proposed formal
3081 definitions, may be found on the GCC readings page, at
3082 @w{@uref{http://gcc.gnu.org/readings.html}}.
3083
3084 This warning is enabled by @option{-Wall} for C and C++.
3085
3086 @item -Wreturn-type
3087 @opindex Wreturn-type
3088 @opindex Wno-return-type
3089 Warn whenever a function is defined with a return-type that defaults
3090 to @code{int}.  Also warn about any @code{return} statement with no
3091 return-value in a function whose return-type is not @code{void}
3092 (falling off the end of the function body is considered returning
3093 without a value), and about a @code{return} statement with a
3094 expression in a function whose return-type is @code{void}.
3095
3096 For C++, a function without return type always produces a diagnostic
3097 message, even when @option{-Wno-return-type} is specified.  The only
3098 exceptions are @samp{main} and functions defined in system headers.
3099
3100 This warning is enabled by @option{-Wall}.
3101
3102 @item -Wswitch
3103 @opindex Wswitch
3104 @opindex Wno-switch
3105 Warn whenever a @code{switch} statement has an index of enumerated type
3106 and lacks a @code{case} for one or more of the named codes of that
3107 enumeration.  (The presence of a @code{default} label prevents this
3108 warning.)  @code{case} labels outside the enumeration range also
3109 provoke warnings when this option is used.
3110 This warning is enabled by @option{-Wall}.
3111
3112 @item -Wswitch-default
3113 @opindex Wswitch-default
3114 @opindex Wno-switch-default
3115 Warn whenever a @code{switch} statement does not have a @code{default}
3116 case.
3117
3118 @item -Wswitch-enum
3119 @opindex Wswitch-enum
3120 @opindex Wno-switch-enum
3121 Warn whenever a @code{switch} statement has an index of enumerated type
3122 and lacks a @code{case} for one or more of the named codes of that
3123 enumeration.  @code{case} labels outside the enumeration range also
3124 provoke warnings when this option is used.
3125
3126 @item -Wtrigraphs
3127 @opindex Wtrigraphs
3128 @opindex Wno-trigraphs
3129 Warn if any trigraphs are encountered that might change the meaning of
3130 the program (trigraphs within comments are not warned about).
3131 This warning is enabled by @option{-Wall}.
3132
3133 @item -Wunused-function
3134 @opindex Wunused-function
3135 @opindex Wno-unused-function
3136 Warn whenever a static function is declared but not defined or a
3137 non-inline static function is unused.
3138 This warning is enabled by @option{-Wall}.
3139
3140 @item -Wunused-label
3141 @opindex Wunused-label
3142 @opindex Wno-unused-label
3143 Warn whenever a label is declared but not used.
3144 This warning is enabled by @option{-Wall}.
3145
3146 To suppress this warning use the @samp{unused} attribute
3147 (@pxref{Variable Attributes}).
3148
3149 @item -Wunused-parameter
3150 @opindex Wunused-parameter
3151 @opindex Wno-unused-parameter
3152 Warn whenever a function parameter is unused aside from its declaration.
3153
3154 To suppress this warning use the @samp{unused} attribute
3155 (@pxref{Variable Attributes}).
3156
3157 @item -Wunused-variable
3158 @opindex Wunused-variable
3159 @opindex Wno-unused-variable
3160 Warn whenever a local variable or non-constant static variable is unused
3161 aside from its declaration.
3162 This warning is enabled by @option{-Wall}.
3163
3164 To suppress this warning use the @samp{unused} attribute
3165 (@pxref{Variable Attributes}).
3166
3167 @item -Wunused-value
3168 @opindex Wunused-value
3169 @opindex Wno-unused-value
3170 Warn whenever a statement computes a result that is explicitly not
3171 used. To suppress this warning cast the unused expression to
3172 @samp{void}. This includes an expression-statement or the left-hand
3173 side of a comma expression that contains no side effects. For example,
3174 an expression such as @samp{x[i,j]} will cause a warning, while
3175 @samp{x[(void)i,j]} will not.
3176
3177 This warning is enabled by @option{-Wall}.
3178
3179 @item -Wunused
3180 @opindex Wunused
3181 @opindex Wno-unused
3182 All the above @option{-Wunused} options combined.
3183
3184 In order to get a warning about an unused function parameter, you must
3185 either specify @samp{-Wextra -Wunused} (note that @samp{-Wall} implies
3186 @samp{-Wunused}), or separately specify @option{-Wunused-parameter}.
3187
3188 @item -Wuninitialized
3189 @opindex Wuninitialized
3190 @opindex Wno-uninitialized
3191 Warn if an automatic variable is used without first being initialized
3192 or if a variable may be clobbered by a @code{setjmp} call. In C++,
3193 warn if a non-static reference or non-static @samp{const} member
3194 appears in a class without constructors.
3195
3196 If you want to warn about code which uses the uninitialized value of the
3197 variable in its own initializer, use the @option{-Winit-self} option.
3198
3199 These warnings occur for individual uninitialized or clobbered
3200 elements of structure, union or array variables as well as for
3201 variables which are uninitialized or clobbered as a whole.  They do
3202 not occur for variables or elements declared @code{volatile}.  Because
3203 these warnings depend on optimization, the exact variables or elements
3204 for which there are warnings will depend on the precise optimization
3205 options and version of GCC used.
3206
3207 Note that there may be no warning about a variable that is used only
3208 to compute a value that itself is never used, because such
3209 computations may be deleted by data flow analysis before the warnings
3210 are printed.
3211
3212 These warnings are made optional because GCC is not smart
3213 enough to see all the reasons why the code might be correct
3214 despite appearing to have an error.  Here is one example of how
3215 this can happen:
3216
3217 @smallexample
3218 @group
3219 @{
3220   int x;
3221   switch (y)
3222     @{
3223     case 1: x = 1;
3224       break;
3225     case 2: x = 4;
3226       break;
3227     case 3: x = 5;
3228     @}
3229   foo (x);
3230 @}
3231 @end group
3232 @end smallexample
3233
3234 @noindent
3235 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
3236 always initialized, but GCC doesn't know this.  Here is
3237 another common case:
3238
3239 @smallexample
3240 @{
3241   int save_y;
3242   if (change_y) save_y = y, y = new_y;
3243   @dots{}
3244   if (change_y) y = save_y;
3245 @}
3246 @end smallexample
3247
3248 @noindent
3249 This has no bug because @code{save_y} is used only if it is set.
3250
3251 @cindex @code{longjmp} warnings
3252 This option also warns when a non-volatile automatic variable might be
3253 changed by a call to @code{longjmp}.  These warnings as well are possible
3254 only in optimizing compilation.
3255
3256 The compiler sees only the calls to @code{setjmp}.  It cannot know
3257 where @code{longjmp} will be called; in fact, a signal handler could
3258 call it at any point in the code.  As a result, you may get a warning
3259 even when there is in fact no problem because @code{longjmp} cannot
3260 in fact be called at the place which would cause a problem.
3261
3262 Some spurious warnings can be avoided if you declare all the functions
3263 you use that never return as @code{noreturn}.  @xref{Function
3264 Attributes}.
3265
3266 This warning is enabled by @option{-Wall} or @option{-Wextra}.
3267
3268 @item -Wunknown-pragmas
3269 @opindex Wunknown-pragmas
3270 @opindex Wno-unknown-pragmas
3271 @cindex warning for unknown pragmas
3272 @cindex unknown pragmas, warning
3273 @cindex pragmas, warning of unknown
3274 Warn when a #pragma directive is encountered which is not understood by
3275 GCC@.  If this command line option is used, warnings will even be issued
3276 for unknown pragmas in system header files.  This is not the case if
3277 the warnings were only enabled by the @option{-Wall} command line option.
3278
3279 @item -Wno-pragmas
3280 @opindex Wno-pragmas
3281 @opindex Wpragmas
3282 Do not warn about misuses of pragmas, such as incorrect parameters,
3283 invalid syntax, or conflicts between pragmas.  See also
3284 @samp{-Wunknown-pragmas}.
3285
3286 @item -Wstrict-aliasing
3287 @opindex Wstrict-aliasing
3288 @opindex Wno-strict-aliasing
3289 This option is only active when @option{-fstrict-aliasing} is active.
3290 It warns about code which might break the strict aliasing rules that the
3291 compiler is using for optimization.  The warning does not catch all
3292 cases, but does attempt to catch the more common pitfalls.  It is
3293 included in @option{-Wall}.
3294 It is equivalent to @option{-Wstrict-aliasing=3}
3295
3296 @item -Wstrict-aliasing=n
3297 @opindex Wstrict-aliasing=n
3298 @opindex Wno-strict-aliasing=n
3299 This option is only active when @option{-fstrict-aliasing} is active.
3300 It warns about code which might break the strict aliasing rules that the
3301 compiler is using for optimization.
3302 Higher levels correspond to higher accuracy (fewer false positives).
3303 Higher levels also correspond to more effort, similar to the way -O works.
3304 @option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=n},
3305 with n=3.
3306
3307 Level 1: Most aggressive, quick, least accurate.
3308 Possibly useful when higher levels
3309 do not warn but -fstrict-aliasing still breaks the code, as it has very few 
3310 false negatives.  However, it has many false positives.
3311 Warns for all pointer conversions between possibly incompatible types, 
3312 even if never dereferenced.  Runs in the frontend only.
3313
3314 Level 2: Aggressive, quick, not too precise.
3315 May still have many false positives (not as many as level 1 though),
3316 and few false negatives (but possibly more than level 1).
3317 Unlike level 1, it only warns when an address is taken.  Warns about
3318 incomplete types.  Runs in the frontend only.
3319
3320 Level 3 (default for @option{-Wstrict-aliasing}): 
3321 Should have very few false positives and few false 
3322 negatives.  Slightly slower than levels 1 or 2 when optimization is enabled.
3323 Takes care of the common punn+dereference pattern in the frontend:
3324 @code{*(int*)&some_float}.
3325 If optimization is enabled, it also runs in the backend, where it deals 
3326 with multiple statement cases using flow-sensitive points-to information.
3327 Only warns when the converted pointer is dereferenced.
3328 Does not warn about incomplete types.
3329
3330 @item -Wstrict-overflow
3331 @itemx -Wstrict-overflow=@var{n}
3332 @opindex Wstrict-overflow
3333 @opindex Wno-strict-overflow
3334 This option is only active when @option{-fstrict-overflow} is active.
3335 It warns about cases where the compiler optimizes based on the
3336 assumption that signed overflow does not occur.  Note that it does not
3337 warn about all cases where the code might overflow: it only warns
3338 about cases where the compiler implements some optimization.  Thus
3339 this warning depends on the optimization level.
3340
3341 An optimization which assumes that signed overflow does not occur is
3342 perfectly safe if the values of the variables involved are such that
3343 overflow never does, in fact, occur.  Therefore this warning can
3344 easily give a false positive: a warning about code which is not
3345 actually a problem.  To help focus on important issues, several
3346 warning levels are defined.  No warnings are issued for the use of
3347 undefined signed overflow when estimating how many iterations a loop
3348 will require, in particular when determining whether a loop will be
3349 executed at all.
3350
3351 @table @gcctabopt
3352 @item -Wstrict-overflow=1
3353 Warn about cases which are both questionable and easy to avoid.  For
3354 example: @code{x + 1 > x}; with @option{-fstrict-overflow}, the
3355 compiler will simplify this to @code{1}.  This level of
3356 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
3357 are not, and must be explicitly requested.
3358
3359 @item -Wstrict-overflow=2
3360 Also warn about other cases where a comparison is simplified to a
3361 constant.  For example: @code{abs (x) >= 0}.  This can only be
3362 simplified when @option{-fstrict-overflow} is in effect, because
3363 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
3364 zero.  @option{-Wstrict-overflow} (with no level) is the same as
3365 @option{-Wstrict-overflow=2}.
3366
3367 @item -Wstrict-overflow=3
3368 Also warn about other cases where a comparison is simplified.  For
3369 example: @code{x + 1 > 1} will be simplified to @code{x > 0}.
3370
3371 @item -Wstrict-overflow=4
3372 Also warn about other simplifications not covered by the above cases.
3373 For example: @code{(x * 10) / 5} will be simplified to @code{x * 2}.
3374
3375 @item -Wstrict-overflow=5
3376 Also warn about cases where the compiler reduces the magnitude of a
3377 constant involved in a comparison.  For example: @code{x + 2 > y} will
3378 be simplified to @code{x + 1 >= y}.  This is reported only at the
3379 highest warning level because this simplification applies to many
3380 comparisons, so this warning level will give a very large number of
3381 false positives.
3382 @end table
3383
3384 @item -Warray-bounds
3385 @opindex Wno-array-bounds
3386 @opindex Warray-bounds
3387 This option is only active when @option{-ftree-vrp} is active
3388 (default for -O2 and above). It warns about subscripts to arrays
3389 that are always out of bounds. This warning is enabled by @option{-Wall}.
3390
3391 @item -Wno-div-by-zero
3392 @opindex Wno-div-by-zero
3393 @opindex Wdiv-by-zero
3394 Do not warn about compile-time integer division by zero.  Floating point
3395 division by zero is not warned about, as it can be a legitimate way of
3396 obtaining infinities and NaNs.
3397
3398 @item -Wsystem-headers
3399 @opindex Wsystem-headers
3400 @opindex Wno-system-headers
3401 @cindex warnings from system headers
3402 @cindex system headers, warnings from
3403 Print warning messages for constructs found in system header files.
3404 Warnings from system headers are normally suppressed, on the assumption
3405 that they usually do not indicate real problems and would only make the
3406 compiler output harder to read.  Using this command line option tells
3407 GCC to emit warnings from system headers as if they occurred in user
3408 code.  However, note that using @option{-Wall} in conjunction with this
3409 option will @emph{not} warn about unknown pragmas in system
3410 headers---for that, @option{-Wunknown-pragmas} must also be used.
3411
3412 @item -Wfloat-equal
3413 @opindex Wfloat-equal
3414 @opindex Wno-float-equal
3415 Warn if floating point values are used in equality comparisons.
3416
3417 The idea behind this is that sometimes it is convenient (for the
3418 programmer) to consider floating-point values as approximations to
3419 infinitely precise real numbers.  If you are doing this, then you need
3420 to compute (by analyzing the code, or in some other way) the maximum or
3421 likely maximum error that the computation introduces, and allow for it
3422 when performing comparisons (and when producing output, but that's a
3423 different problem).  In particular, instead of testing for equality, you
3424 would check to see whether the two values have ranges that overlap; and
3425 this is done with the relational operators, so equality comparisons are
3426 probably mistaken.
3427
3428 @item -Wtraditional @r{(C and Objective-C only)}
3429 @opindex Wtraditional
3430 @opindex Wno-traditional
3431 Warn about certain constructs that behave differently in traditional and
3432 ISO C@.  Also warn about ISO C constructs that have no traditional C
3433 equivalent, and/or problematic constructs which should be avoided.
3434
3435 @itemize @bullet
3436 @item
3437 Macro parameters that appear within string literals in the macro body.
3438 In traditional C macro replacement takes place within string literals,
3439 but does not in ISO C@.
3440
3441 @item
3442 In traditional C, some preprocessor directives did not exist.
3443 Traditional preprocessors would only consider a line to be a directive
3444 if the @samp{#} appeared in column 1 on the line.  Therefore
3445 @option{-Wtraditional} warns about directives that traditional C
3446 understands but would ignore because the @samp{#} does not appear as the
3447 first character on the line.  It also suggests you hide directives like
3448 @samp{#pragma} not understood by traditional C by indenting them.  Some
3449 traditional implementations would not recognize @samp{#elif}, so it
3450 suggests avoiding it altogether.
3451
3452 @item
3453 A function-like macro that appears without arguments.
3454
3455 @item
3456 The unary plus operator.
3457
3458 @item
3459 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating point
3460 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
3461 constants.)  Note, these suffixes appear in macros defined in the system
3462 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
3463 Use of these macros in user code might normally lead to spurious
3464 warnings, however GCC's integrated preprocessor has enough context to
3465 avoid warning in these cases.
3466
3467 @item
3468 A function declared external in one block and then used after the end of
3469 the block.
3470
3471 @item
3472 A @code{switch} statement has an operand of type @code{long}.
3473
3474 @item
3475 A non-@code{static} function declaration follows a @code{static} one.
3476 This construct is not accepted by some traditional C compilers.
3477
3478 @item
3479 The ISO type of an integer constant has a different width or
3480 signedness from its traditional type.  This warning is only issued if
3481 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
3482 typically represent bit patterns, are not warned about.
3483
3484 @item
3485 Usage of ISO string concatenation is detected.
3486
3487 @item
3488 Initialization of automatic aggregates.
3489
3490 @item
3491 Identifier conflicts with labels.  Traditional C lacks a separate
3492 namespace for labels.
3493
3494 @item
3495 Initialization of unions.  If the initializer is zero, the warning is
3496 omitted.  This is done under the assumption that the zero initializer in
3497 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
3498 initializer warnings and relies on default initialization to zero in the
3499 traditional C case.
3500
3501 @item
3502 Conversions by prototypes between fixed/floating point values and vice
3503 versa.  The absence of these prototypes when compiling with traditional
3504 C would cause serious problems.  This is a subset of the possible
3505 conversion warnings, for the full set use @option{-Wtraditional-conversion}.
3506
3507 @item
3508 Use of ISO C style function definitions.  This warning intentionally is
3509 @emph{not} issued for prototype declarations or variadic functions
3510 because these ISO C features will appear in your code when using
3511 libiberty's traditional C compatibility macros, @code{PARAMS} and
3512 @code{VPARAMS}.  This warning is also bypassed for nested functions
3513 because that feature is already a GCC extension and thus not relevant to
3514 traditional C compatibility.
3515 @end itemize
3516
3517 @item -Wtraditional-conversion @r{(C and Objective-C only)}
3518 @opindex Wtraditional-conversion
3519 @opindex Wno-traditional-conversion
3520 Warn if a prototype causes a type conversion that is different from what
3521 would happen to the same argument in the absence of a prototype.  This
3522 includes conversions of fixed point to floating and vice versa, and
3523 conversions changing the width or signedness of a fixed point argument
3524 except when the same as the default promotion.
3525
3526 @item -Wdeclaration-after-statement @r{(C and Objective-C only)}
3527 @opindex Wdeclaration-after-statement
3528 @opindex Wno-declaration-after-statement
3529 Warn when a declaration is found after a statement in a block.  This
3530 construct, known from C++, was introduced with ISO C99 and is by default
3531 allowed in GCC@.  It is not supported by ISO C90 and was not supported by
3532 GCC versions before GCC 3.0.  @xref{Mixed Declarations}.
3533
3534 @item -Wundef
3535 @opindex Wundef
3536 @opindex Wno-undef
3537 Warn if an undefined identifier is evaluated in an @samp{#if} directive.
3538
3539 @item -Wno-endif-labels
3540 @opindex Wno-endif-labels
3541 @opindex Wendif-labels
3542 Do not warn whenever an @samp{#else} or an @samp{#endif} are followed by text.
3543
3544 @item -Wshadow
3545 @opindex Wshadow
3546 @opindex Wno-shadow
3547 Warn whenever a local variable shadows another local variable, parameter or
3548 global variable or whenever a built-in function is shadowed.
3549
3550 @item -Wlarger-than=@var{len}
3551 @opindex Wlarger-than=@var{len}
3552 @opindex Wlarger-than-@var{len}
3553 Warn whenever an object of larger than @var{len} bytes is defined.
3554
3555 @item -Wframe-larger-than=@var{len}
3556 @opindex Wframe-larger-than
3557 Warn if the size of a function frame is larger than @var{len} bytes.
3558 The computation done to determine the stack frame size is approximate
3559 and not conservative.
3560 The actual requirements may be somewhat greater than @var{len}
3561 even if you do not get a warning.  In addition, any space allocated
3562 via @code{alloca}, variable-length arrays, or related constructs
3563 is not included by the compiler when determining
3564 whether or not to issue a warning.
3565
3566 @item -Wunsafe-loop-optimizations
3567 @opindex Wunsafe-loop-optimizations
3568 @opindex Wno-unsafe-loop-optimizations
3569 Warn if the loop cannot be optimized because the compiler could not
3570 assume anything on the bounds of the loop indices.  With
3571 @option{-funsafe-loop-optimizations} warn if the compiler made
3572 such assumptions.
3573
3574 @item -Wpointer-arith
3575 @opindex Wpointer-arith
3576 @opindex Wno-pointer-arith
3577 Warn about anything that depends on the ``size of'' a function type or
3578 of @code{void}.  GNU C assigns these types a size of 1, for
3579 convenience in calculations with @code{void *} pointers and pointers
3580 to functions.  In C++, warn also when an arithmetic operation involves
3581 @code{NULL}.  This warning is also enabled by @option{-pedantic}.
3582
3583 @item -Wtype-limits
3584 @opindex Wtype-limits
3585 @opindex Wno-type-limits
3586 Warn if a comparison is always true or always false due to the limited
3587 range of the data type, but do not warn for constant expressions.  For
3588 example, warn if an unsigned variable is compared against zero with
3589 @samp{<} or @samp{>=}.  This warning is also enabled by
3590 @option{-Wextra}.
3591
3592 @item -Wbad-function-cast @r{(C and Objective-C only)}
3593 @opindex Wbad-function-cast
3594 @opindex Wno-bad-function-cast
3595 Warn whenever a function call is cast to a non-matching type.
3596 For example, warn if @code{int malloc()} is cast to @code{anything *}.
3597
3598 @item -Wc++-compat @r{(C and Objective-C only)}
3599 Warn about ISO C constructs that are outside of the common subset of
3600 ISO C and ISO C++, e.g.@: request for implicit conversion from
3601 @code{void *} to a pointer to non-@code{void} type.
3602
3603 @item -Wc++0x-compat @r{(C++ and Objective-C++ only)}
3604 Warn about C++ constructs whose meaning differs between ISO C++ 1998 and
3605 ISO C++ 200x, e.g., identifiers in ISO C++ 1998 that will become keywords
3606 in ISO C++ 200x.  This warning is enabled by @option{-Wall}.
3607
3608 @item -Wcast-qual
3609 @opindex Wcast-qual
3610 @opindex Wno-cast-qual
3611 Warn whenever a pointer is cast so as to remove a type qualifier from
3612 the target type.  For example, warn if a @code{const char *} is cast
3613 to an ordinary @code{char *}.
3614
3615 @item -Wcast-align
3616 @opindex Wcast-align
3617 @opindex Wno-cast-align
3618 Warn whenever a pointer is cast such that the required alignment of the
3619 target is increased.  For example, warn if a @code{char *} is cast to
3620 an @code{int *} on machines where integers can only be accessed at
3621 two- or four-byte boundaries.
3622
3623 @item -Wwrite-strings
3624 @opindex Wwrite-strings
3625 @opindex Wno-write-strings
3626 When compiling C, give string constants the type @code{const
3627 char[@var{length}]} so that copying the address of one into a
3628 non-@code{const} @code{char *} pointer will get a warning.  These
3629 warnings will help you find at compile time code that can try to write
3630 into a string constant, but only if you have been very careful about
3631 using @code{const} in declarations and prototypes.  Otherwise, it will
3632 just be a nuisance. This is why we did not make @option{-Wall} request
3633 these warnings.
3634
3635 When compiling C++, warn about the deprecated conversion from string
3636 literals to @code{char *}.  This warning is enabled by default for C++
3637 programs.
3638
3639 @item -Wclobbered
3640 @opindex Wclobbered
3641 @opindex Wno-clobbered
3642 Warn for variables that might be changed by @samp{longjmp} or
3643 @samp{vfork}.  This warning is also enabled by @option{-Wextra}.
3644
3645 @item -Wconversion
3646 @opindex Wconversion
3647 @opindex Wno-conversion
3648 Warn for implicit conversions that may alter a value. This includes
3649 conversions between real and integer, like @code{abs (x)} when
3650 @code{x} is @code{double}; conversions between signed and unsigned,
3651 like @code{unsigned ui = -1}; and conversions to smaller types, like
3652 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
3653 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
3654 changed by the conversion like in @code{abs (2.0)}.  Warnings about
3655 conversions between signed and unsigned integers can be disabled by
3656 using @option{-Wno-sign-conversion}.
3657
3658 For C++, also warn for conversions between @code{NULL} and non-pointer
3659 types; confusing overload resolution for user-defined conversions; and
3660 conversions that will never use a type conversion operator:
3661 conversions to @code{void}, the same type, a base class or a reference
3662 to them. Warnings about conversions between signed and unsigned
3663 integers are disabled by default in C++ unless
3664 @option{-Wsign-conversion} is explicitly enabled.
3665
3666 @item -Wempty-body
3667 @opindex Wempty-body
3668 @opindex Wno-empty-body
3669 Warn if an empty body occurs in an @samp{if}, @samp{else} or @samp{do
3670 while} statement.  Additionally, in C++, warn when an empty body occurs
3671 in a @samp{while} or @samp{for} statement with no whitespacing before
3672 the semicolon.  This warning is also enabled by @option{-Wextra}.
3673
3674 @item -Wenum-compare @r{(C++ and Objective-C++ only)}
3675 @opindex Wenum-compare
3676 @opindex Wno-enum-compare
3677 Warn about a comparison between values of different enum types. This
3678 warning is enabled by default.
3679
3680 @item -Wsign-compare
3681 @opindex Wsign-compare
3682 @opindex Wno-sign-compare
3683 @cindex warning for comparison of signed and unsigned values
3684 @cindex comparison of signed and unsigned values, warning
3685 @cindex signed and unsigned values, comparison warning
3686 Warn when a comparison between signed and unsigned values could produce
3687 an incorrect result when the signed value is converted to unsigned.
3688 This warning is also enabled by @option{-Wextra}; to get the other warnings
3689 of @option{-Wextra} without this warning, use @samp{-Wextra -Wno-sign-compare}.
3690
3691 @item -Wsign-conversion
3692 @opindex Wsign-conversion
3693 @opindex Wno-sign-conversion
3694 Warn for implicit conversions that may change the sign of an integer
3695 value, like assigning a signed integer expression to an unsigned
3696 integer variable. An explicit cast silences the warning. In C, this
3697 option is enabled also by @option{-Wconversion}.
3698
3699 @item -Waddress
3700 @opindex Waddress
3701 @opindex Wno-address
3702 Warn about suspicious uses of memory addresses. These include using
3703 the address of a function in a conditional expression, such as
3704 @code{void func(void); if (func)}, and comparisons against the memory
3705 address of a string literal, such as @code{if (x == "abc")}.  Such
3706 uses typically indicate a programmer error: the address of a function
3707 always evaluates to true, so their use in a conditional usually
3708 indicate that the programmer forgot the parentheses in a function
3709 call; and comparisons against string literals result in unspecified
3710 behavior and are not portable in C, so they usually indicate that the
3711 programmer intended to use @code{strcmp}.  This warning is enabled by
3712 @option{-Wall}.
3713
3714 @item -Wlogical-op
3715 @opindex Wlogical-op
3716 @opindex Wno-logical-op
3717 Warn about suspicious uses of logical operators in expressions.
3718 This includes using logical operators in contexts where a
3719 bit-wise operator is likely to be expected.
3720
3721 @item -Waggregate-return
3722 @opindex Waggregate-return
3723 @opindex Wno-aggregate-return
3724 Warn if any functions that return structures or unions are defined or
3725 called.  (In languages where you can return an array, this also elicits
3726 a warning.)
3727
3728 @item -Wno-attributes
3729 @opindex Wno-attributes
3730 @opindex Wattributes
3731 Do not warn if an unexpected @code{__attribute__} is used, such as
3732 unrecognized attributes, function attributes applied to variables,
3733 etc.  This will not stop errors for incorrect use of supported
3734 attributes.
3735
3736 @item -Wno-builtin-macro-redefined
3737 @opindex Wno-builtin-macro-redefined
3738 @opindex Wbuiltin-macro-redefined
3739 Do not warn if certain built-in macros are redefined.  This suppresses
3740 warnings for redefinition of @code{__TIMESTAMP__}, @code{__TIME__},
3741 @code{__DATE__}, @code{__FILE__}, and @code{__BASE_FILE__}.
3742
3743 @item -Wstrict-prototypes @r{(C and Objective-C only)}
3744 @opindex Wstrict-prototypes
3745 @opindex Wno-strict-prototypes
3746 Warn if a function is declared or defined without specifying the
3747 argument types.  (An old-style function definition is permitted without
3748 a warning if preceded by a declaration which specifies the argument
3749 types.)
3750
3751 @item -Wold-style-declaration @r{(C and Objective-C only)}
3752 @opindex Wold-style-declaration
3753 @opindex Wno-old-style-declaration
3754 Warn for obsolescent usages, according to the C Standard, in a
3755 declaration. For example, warn if storage-class specifiers like
3756 @code{static} are not the first things in a declaration.  This warning
3757 is also enabled by @option{-Wextra}.
3758
3759 @item -Wold-style-definition @r{(C and Objective-C only)}
3760 @opindex Wold-style-definition
3761 @opindex Wno-old-style-definition
3762 Warn if an old-style function definition is used.  A warning is given
3763 even if there is a previous prototype.
3764
3765 @item -Wmissing-parameter-type @r{(C and Objective-C only)}
3766 @opindex Wmissing-parameter-type
3767 @opindex Wno-missing-parameter-type
3768 A function parameter is declared without a type specifier in K&R-style
3769 functions:
3770
3771 @smallexample
3772 void foo(bar) @{ @}
3773 @end smallexample
3774
3775 This warning is also enabled by @option{-Wextra}.
3776
3777 @item -Wmissing-prototypes @r{(C and Objective-C only)}
3778 @opindex Wmissing-prototypes
3779 @opindex Wno-missing-prototypes
3780 Warn if a global function is defined without a previous prototype
3781 declaration.  This warning is issued even if the definition itself
3782 provides a prototype.  The aim is to detect global functions that fail
3783 to be declared in header files.
3784
3785 @item -Wmissing-declarations
3786 @opindex Wmissing-declarations
3787 @opindex Wno-missing-declarations
3788 Warn if a global function is defined without a previous declaration.
3789 Do so even if the definition itself provides a prototype.
3790 Use this option to detect global functions that are not declared in
3791 header files.  In C++, no warnings are issued for function templates,
3792 or for inline functions, or for functions in anonymous namespaces.
3793
3794 @item -Wmissing-field-initializers
3795 @opindex Wmissing-field-initializers
3796 @opindex Wno-missing-field-initializers
3797 @opindex W
3798 @opindex Wextra
3799 @opindex Wno-extra
3800 Warn if a structure's initializer has some fields missing.  For
3801 example, the following code would cause such a warning, because
3802 @code{x.h} is implicitly zero:
3803
3804 @smallexample
3805 struct s @{ int f, g, h; @};
3806 struct s x = @{ 3, 4 @};
3807 @end smallexample
3808
3809 This option does not warn about designated initializers, so the following
3810 modification would not trigger a warning:
3811
3812 @smallexample
3813 struct s @{ int f, g, h; @};
3814 struct s x = @{ .f = 3, .g = 4 @};
3815 @end smallexample
3816
3817 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
3818 warnings without this one, use @samp{-Wextra -Wno-missing-field-initializers}.
3819
3820 @item -Wmissing-noreturn
3821 @opindex Wmissing-noreturn
3822 @opindex Wno-missing-noreturn
3823 Warn about functions which might be candidates for attribute @code{noreturn}.
3824 Note these are only possible candidates, not absolute ones.  Care should
3825 be taken to manually verify functions actually do not ever return before
3826 adding the @code{noreturn} attribute, otherwise subtle code generation
3827 bugs could be introduced.  You will not get a warning for @code{main} in
3828 hosted C environments.
3829
3830 @item -Wmissing-format-attribute
3831 @opindex Wmissing-format-attribute
3832 @opindex Wno-missing-format-attribute
3833 @opindex Wformat
3834 @opindex Wno-format
3835 Warn about function pointers which might be candidates for @code{format}
3836 attributes.  Note these are only possible candidates, not absolute ones.
3837 GCC will guess that function pointers with @code{format} attributes that
3838 are used in assignment, initialization, parameter passing or return
3839 statements should have a corresponding @code{format} attribute in the
3840 resulting type.  I.e.@: the left-hand side of the assignment or
3841 initialization, the type of the parameter variable, or the return type
3842 of the containing function respectively should also have a @code{format}
3843 attribute to avoid the warning.
3844
3845 GCC will also warn about function definitions which might be
3846 candidates for @code{format} attributes.  Again, these are only
3847 possible candidates.  GCC will guess that @code{format} attributes
3848 might be appropriate for any function that calls a function like
3849 @code{vprintf} or @code{vscanf}, but this might not always be the
3850 case, and some functions for which @code{format} attributes are
3851 appropriate may not be detected.
3852
3853 @item -Wno-multichar
3854 @opindex Wno-multichar
3855 @opindex Wmultichar
3856 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
3857 Usually they indicate a typo in the user's code, as they have
3858 implementation-defined values, and should not be used in portable code.
3859
3860 @item -Wnormalized=<none|id|nfc|nfkc>
3861 @opindex Wnormalized=
3862 @cindex NFC
3863 @cindex NFKC
3864 @cindex character set, input normalization
3865 In ISO C and ISO C++, two identifiers are different if they are
3866 different sequences of characters.  However, sometimes when characters
3867 outside the basic ASCII character set are used, you can have two
3868 different character sequences that look the same.  To avoid confusion,
3869 the ISO 10646 standard sets out some @dfn{normalization rules} which
3870 when applied ensure that two sequences that look the same are turned into
3871 the same sequence.  GCC can warn you if you are using identifiers which
3872 have not been normalized; this option controls that warning.
3873
3874 There are four levels of warning that GCC supports.  The default is
3875 @option{-Wnormalized=nfc}, which warns about any identifier which is
3876 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
3877 recommended form for most uses.
3878
3879 Unfortunately, there are some characters which ISO C and ISO C++ allow
3880 in identifiers that when turned into NFC aren't allowable as
3881 identifiers.  That is, there's no way to use these symbols in portable
3882 ISO C or C++ and have all your identifiers in NFC@.
3883 @option{-Wnormalized=id} suppresses the warning for these characters.
3884 It is hoped that future versions of the standards involved will correct
3885 this, which is why this option is not the default.
3886
3887 You can switch the warning off for all characters by writing
3888 @option{-Wnormalized=none}.  You would only want to do this if you
3889 were using some other normalization scheme (like ``D''), because
3890 otherwise you can easily create bugs that are literally impossible to see.
3891
3892 Some characters in ISO 10646 have distinct meanings but look identical
3893 in some fonts or display methodologies, especially once formatting has
3894 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
3895 LETTER N'', will display just like a regular @code{n} which has been
3896 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
3897 normalization scheme to convert all these into a standard form as
3898 well, and GCC will warn if your code is not in NFKC if you use
3899 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
3900 about every identifier that contains the letter O because it might be
3901 confused with the digit 0, and so is not the default, but may be
3902 useful as a local coding convention if the programming environment is
3903 unable to be fixed to display these characters distinctly.
3904
3905 @item -Wno-deprecated
3906 @opindex Wno-deprecated
3907 @opindex Wdeprecated
3908 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
3909
3910 @item -Wno-deprecated-declarations
3911 @opindex Wno-deprecated-declarations
3912 @opindex Wdeprecated-declarations
3913 Do not warn about uses of functions (@pxref{Function Attributes}),
3914 variables (@pxref{Variable Attributes}), and types (@pxref{Type
3915 Attributes}) marked as deprecated by using the @code{deprecated}
3916 attribute.
3917
3918 @item -Wno-overflow
3919 @opindex Wno-overflow
3920 @opindex Woverflow
3921 Do not warn about compile-time overflow in constant expressions.
3922
3923 @item -Woverride-init @r{(C and Objective-C only)}
3924 @opindex Woverride-init
3925 @opindex Wno-override-init
3926 @opindex W
3927 @opindex Wextra
3928 @opindex Wno-extra
3929 Warn if an initialized field without side effects is overridden when
3930 using designated initializers (@pxref{Designated Inits, , Designated
3931 Initializers}).
3932
3933 This warning is included in @option{-Wextra}.  To get other
3934 @option{-Wextra} warnings without this one, use @samp{-Wextra
3935 -Wno-override-init}.
3936
3937 @item -Wpacked
3938 @opindex Wpacked
3939 @opindex Wno-packed
3940 Warn if a structure is given the packed attribute, but the packed
3941 attribute has no effect on the layout or size of the structure.
3942 Such structures may be mis-aligned for little benefit.  For
3943 instance, in this code, the variable @code{f.x} in @code{struct bar}
3944 will be misaligned even though @code{struct bar} does not itself
3945 have the packed attribute:
3946
3947 @smallexample
3948 @group
3949 struct foo @{
3950   int x;
3951   char a, b, c, d;
3952 @} __attribute__((packed));
3953 struct bar @{
3954   char z;
3955   struct foo f;
3956 @};
3957 @end group
3958 @end smallexample
3959
3960 @item -Wpadded
3961 @opindex Wpadded
3962 @opindex Wno-padded
3963 Warn if padding is included in a structure, either to align an element
3964 of the structure or to align the whole structure.  Sometimes when this
3965 happens it is possible to rearrange the fields of the structure to
3966 reduce the padding and so make the structure smaller.
3967
3968 @item -Wredundant-decls
3969 @opindex Wredundant-decls
3970 @opindex Wno-redundant-decls
3971 Warn if anything is declared more than once in the same scope, even in
3972 cases where multiple declaration is valid and changes nothing.
3973
3974 @item -Wnested-externs @r{(C and Objective-C only)}
3975 @opindex Wnested-externs
3976 @opindex Wno-nested-externs
3977 Warn if an @code{extern} declaration is encountered within a function.
3978
3979 @item -Wunreachable-code
3980 @opindex Wunreachable-code
3981 @opindex Wno-unreachable-code
3982 Warn if the compiler detects that code will never be executed.
3983
3984 This option is intended to warn when the compiler detects that at
3985 least a whole line of source code will never be executed, because
3986 some condition is never satisfied or because it is after a
3987 procedure that never returns.
3988
3989 It is possible for this option to produce a warning even though there
3990 are circumstances under which part of the affected line can be executed,
3991 so care should be taken when removing apparently-unreachable code.
3992
3993 For instance, when a function is inlined, a warning may mean that the
3994 line is unreachable in only one inlined copy of the function.
3995
3996 This option is not made part of @option{-Wall} because in a debugging
3997 version of a program there is often substantial code which checks
3998 correct functioning of the program and is, hopefully, unreachable
3999 because the program does work.  Another common use of unreachable
4000 code is to provide behavior which is selectable at compile-time.
4001
4002 @item -Winline
4003 @opindex Winline
4004 @opindex Wno-inline
4005 Warn if a function can not be inlined and it was declared as inline.
4006 Even with this option, the compiler will not warn about failures to
4007 inline functions declared in system headers.
4008
4009 The compiler uses a variety of heuristics to determine whether or not
4010 to inline a function.  For example, the compiler takes into account
4011 the size of the function being inlined and the amount of inlining
4012 that has already been done in the current function.  Therefore,
4013 seemingly insignificant changes in the source program can cause the
4014 warnings produced by @option{-Winline} to appear or disappear.
4015
4016 @item -Wno-invalid-offsetof @r{(C++ and Objective-C++ only)}
4017 @opindex Wno-invalid-offsetof
4018 @opindex Winvalid-offsetof
4019 Suppress warnings from applying the @samp{offsetof} macro to a non-POD
4020 type.  According to the 1998 ISO C++ standard, applying @samp{offsetof}
4021 to a non-POD type is undefined.  In existing C++ implementations,
4022 however, @samp{offsetof} typically gives meaningful results even when
4023 applied to certain kinds of non-POD types. (Such as a simple
4024 @samp{struct} that fails to be a POD type only by virtue of having a
4025 constructor.)  This flag is for users who are aware that they are
4026 writing nonportable code and who have deliberately chosen to ignore the
4027 warning about it.
4028
4029 The restrictions on @samp{offsetof} may be relaxed in a future version
4030 of the C++ standard.
4031
4032 @item -Wno-int-to-pointer-cast @r{(C and Objective-C only)}
4033 @opindex Wno-int-to-pointer-cast
4034 @opindex Wint-to-pointer-cast
4035 Suppress warnings from casts to pointer type of an integer of a
4036 different size.
4037
4038 @item -Wno-pointer-to-int-cast @r{(C and Objective-C only)}
4039 @opindex Wno-pointer-to-int-cast
4040 @opindex Wpointer-to-int-cast
4041 Suppress warnings from casts from a pointer to an integer type of a
4042 different size.
4043
4044 @item -Winvalid-pch
4045 @opindex Winvalid-pch
4046 @opindex Wno-invalid-pch
4047 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
4048 the search path but can't be used.
4049
4050 @item -Wlong-long
4051 @opindex Wlong-long
4052 @opindex Wno-long-long
4053 Warn if @samp{long long} type is used.  This is default.  To inhibit
4054 the warning messages, use @option{-Wno-long-long}.  Flags
4055 @option{-Wlong-long} and @option{-Wno-long-long} are taken into account
4056 only when @option{-pedantic} flag is used.
4057
4058 @item -Wvariadic-macros
4059 @opindex Wvariadic-macros
4060 @opindex Wno-variadic-macros
4061 Warn if variadic macros are used in pedantic ISO C90 mode, or the GNU
4062 alternate syntax when in pedantic ISO C99 mode.  This is default.
4063 To inhibit the warning messages, use @option{-Wno-variadic-macros}.
4064
4065 @item -Wvla
4066 @opindex Wvla
4067 @opindex Wno-vla
4068 Warn if variable length array is used in the code.
4069 @option{-Wno-vla} will prevent the @option{-pedantic} warning of
4070 the variable length array.
4071
4072 @item -Wvolatile-register-var
4073 @opindex Wvolatile-register-var
4074 @opindex Wno-volatile-register-var
4075 Warn if a register variable is declared volatile.  The volatile
4076 modifier does not inhibit all optimizations that may eliminate reads
4077 and/or writes to register variables.  This warning is enabled by
4078 @option{-Wall}.
4079
4080 @item -Wdisabled-optimization
4081 @opindex Wdisabled-optimization
4082 @opindex Wno-disabled-optimization
4083 Warn if a requested optimization pass is disabled.  This warning does
4084 not generally indicate that there is anything wrong with your code; it
4085 merely indicates that GCC's optimizers were unable to handle the code
4086 effectively.  Often, the problem is that your code is too big or too
4087 complex; GCC will refuse to optimize programs when the optimization
4088 itself is likely to take inordinate amounts of time.
4089
4090 @item -Wpointer-sign @r{(C and Objective-C only)}
4091 @opindex Wpointer-sign
4092 @opindex Wno-pointer-sign
4093 Warn for pointer argument passing or assignment with different signedness.
4094 This option is only supported for C and Objective-C@.  It is implied by
4095 @option{-Wall} and by @option{-pedantic}, which can be disabled with
4096 @option{-Wno-pointer-sign}.
4097
4098 @item -Wstack-protector
4099 @opindex Wstack-protector
4100 @opindex Wno-stack-protector
4101 This option is only active when @option{-fstack-protector} is active.  It
4102 warns about functions that will not be protected against stack smashing.
4103
4104 @item -Wno-mudflap
4105 @opindex Wno-mudflap
4106 Suppress warnings about constructs that cannot be instrumented by
4107 @option{-fmudflap}.
4108
4109 @item -Woverlength-strings
4110 @opindex Woverlength-strings
4111 @opindex Wno-overlength-strings
4112 Warn about string constants which are longer than the ``minimum
4113 maximum'' length specified in the C standard.  Modern compilers
4114 generally allow string constants which are much longer than the
4115 standard's minimum limit, but very portable programs should avoid
4116 using longer strings.
4117
4118 The limit applies @emph{after} string constant concatenation, and does
4119 not count the trailing NUL@.  In C89, the limit was 509 characters; in
4120 C99, it was raised to 4095.  C++98 does not specify a normative
4121 minimum maximum, so we do not diagnose overlength strings in C++@.
4122
4123 This option is implied by @option{-pedantic}, and can be disabled with
4124 @option{-Wno-overlength-strings}.
4125
4126 @item -Wdisallowed-function-list=@var{sym},@var{sym},@dots{}
4127 @opindex Wdisallowed-function-list
4128
4129 If any of @var{sym} is called, GCC will issue a warning. This can be useful
4130 in enforcing coding conventions that ban calls to certain functions, for
4131 example, @code{alloca}, @code{malloc}, etc.
4132 @end table
4133
4134 @node Debugging Options
4135 @section Options for Debugging Your Program or GCC
4136 @cindex options, debugging
4137 @cindex debugging information options
4138
4139 GCC has various special options that are used for debugging
4140 either your program or GCC:
4141
4142 @table @gcctabopt
4143 @item -g
4144 @opindex g
4145 Produce debugging information in the operating system's native format
4146 (stabs, COFF, XCOFF, or DWARF 2)@.  GDB can work with this debugging
4147 information.
4148
4149 On most systems that use stabs format, @option{-g} enables use of extra
4150 debugging information that only GDB can use; this extra information
4151 makes debugging work better in GDB but will probably make other debuggers
4152 crash or
4153 refuse to read the program.  If you want to control for certain whether
4154 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
4155 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
4156
4157 GCC allows you to use @option{-g} with
4158 @option{-O}.  The shortcuts taken by optimized code may occasionally
4159 produce surprising results: some variables you declared may not exist
4160 at all; flow of control may briefly move where you did not expect it;
4161 some statements may not be executed because they compute constant
4162 results or their values were already at hand; some statements may
4163 execute in different places because they were moved out of loops.
4164
4165 Nevertheless it proves possible to debug optimized output.  This makes
4166 it reasonable to use the optimizer for programs that might have bugs.
4167
4168 The following options are useful when GCC is generated with the
4169 capability for more than one debugging format.
4170
4171 @item -ggdb
4172 @opindex ggdb
4173 Produce debugging information for use by GDB@.  This means to use the
4174 most expressive format available (DWARF 2, stabs, or the native format
4175 if neither of those are supported), including GDB extensions if at all
4176 possible.
4177
4178 @item -gstabs
4179 @opindex gstabs
4180 Produce debugging information in stabs format (if that is supported),
4181 without GDB extensions.  This is the format used by DBX on most BSD
4182 systems.  On MIPS, Alpha and System V Release 4 systems this option
4183 produces stabs debugging output which is not understood by DBX or SDB@.
4184 On System V Release 4 systems this option requires the GNU assembler.
4185
4186 @item -feliminate-unused-debug-symbols
4187 @opindex feliminate-unused-debug-symbols
4188 Produce debugging information in stabs format (if that is supported),
4189 for only symbols that are actually used.
4190
4191 @item -femit-class-debug-always
4192 Instead of emitting debugging information for a C++ class in only one
4193 object file, emit it in all object files using the class.  This option
4194 should be used only with debuggers that are unable to handle the way GCC
4195 normally emits debugging information for classes because using this
4196 option will increase the size of debugging information by as much as a
4197 factor of two.
4198
4199 @item -gstabs+
4200 @opindex gstabs+
4201 Produce debugging information in stabs format (if that is supported),
4202 using GNU extensions understood only by the GNU debugger (GDB)@.  The
4203 use of these extensions is likely to make other debuggers crash or
4204 refuse to read the program.
4205
4206 @item -gcoff
4207 @opindex gcoff
4208 Produce debugging information in COFF format (if that is supported).
4209 This is the format used by SDB on most System V systems prior to
4210 System V Release 4.
4211
4212 @item -gxcoff
4213 @opindex gxcoff
4214 Produce debugging information in XCOFF format (if that is supported).
4215 This is the format used by the DBX debugger on IBM RS/6000 systems.
4216
4217 @item -gxcoff+
4218 @opindex gxcoff+
4219 Produce debugging information in XCOFF format (if that is supported),
4220 using GNU extensions understood only by the GNU debugger (GDB)@.  The
4221 use of these extensions is likely to make other debuggers crash or
4222 refuse to read the program, and may cause assemblers other than the GNU
4223 assembler (GAS) to fail with an error.
4224
4225 @item -gdwarf-2
4226 @opindex gdwarf-2
4227 Produce debugging information in DWARF version 2 format (if that is
4228 supported).  This is the format used by DBX on IRIX 6.  With this
4229 option, GCC uses features of DWARF version 3 when they are useful;
4230 version 3 is upward compatible with version 2, but may still cause
4231 problems for older debuggers.
4232
4233 @item -gvms
4234 @opindex gvms
4235 Produce debugging information in VMS debug format (if that is
4236 supported).  This is the format used by DEBUG on VMS systems.
4237
4238 @item -g@var{level}
4239 @itemx -ggdb@var{level}
4240 @itemx -gstabs@var{level}
4241 @itemx -gcoff@var{level}
4242 @itemx -gxcoff@var{level}
4243 @itemx -gvms@var{level}
4244 Request debugging information and also use @var{level} to specify how
4245 much information.  The default level is 2.
4246
4247 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
4248 @option{-g}.
4249
4250 Level 1 produces minimal information, enough for making backtraces in
4251 parts of the program that you don't plan to debug.  This includes
4252 descriptions of functions and external variables, but no information
4253 about local variables and no line numbers.
4254
4255 Level 3 includes extra information, such as all the macro definitions
4256 present in the program.  Some debuggers support macro expansion when
4257 you use @option{-g3}.
4258
4259 @option{-gdwarf-2} does not accept a concatenated debug level, because
4260 GCC used to support an option @option{-gdwarf} that meant to generate
4261 debug information in version 1 of the DWARF format (which is very
4262 different from version 2), and it would have been too confusing.  That
4263 debug format is long obsolete, but the option cannot be changed now.
4264 Instead use an additional @option{-g@var{level}} option to change the
4265 debug level for DWARF2.
4266
4267 @item -feliminate-dwarf2-dups
4268 @opindex feliminate-dwarf2-dups
4269 Compress DWARF2 debugging information by eliminating duplicated
4270 information about each symbol.  This option only makes sense when
4271 generating DWARF2 debugging information with @option{-gdwarf-2}.
4272
4273 @item -femit-struct-debug-baseonly
4274 Emit debug information for struct-like types
4275 only when the base name of the compilation source file
4276 matches the base name of file in which the struct was defined.
4277
4278 This option substantially reduces the size of debugging information,
4279 but at significant potential loss in type information to the debugger.
4280 See @option{-femit-struct-debug-reduced} for a less aggressive option.
4281 See @option{-femit-struct-debug-detailed} for more detailed control.
4282
4283 This option works only with DWARF 2.
4284
4285 @item -femit-struct-debug-reduced
4286 Emit debug information for struct-like types
4287 only when the base name of the compilation source file
4288 matches the base name of file in which the type was defined,
4289 unless the struct is a template or defined in a system header.
4290
4291 This option significantly reduces the size of debugging information,
4292 with some potential loss in type information to the debugger.
4293 See @option{-femit-struct-debug-baseonly} for a more aggressive option.
4294 See @option{-femit-struct-debug-detailed} for more detailed control.
4295
4296 This option works only with DWARF 2.
4297
4298 @item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
4299 Specify the struct-like types
4300 for which the compiler will generate debug information.
4301 The intent is to reduce duplicate struct debug information
4302 between different object files within the same program.
4303
4304 This option is a detailed version of
4305 @option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
4306 which will serve for most needs.
4307
4308 A specification has the syntax
4309 [@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
4310
4311 The optional first word limits the specification to
4312 structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
4313 A struct type is used directly when it is the type of a variable, member.
4314 Indirect uses arise through pointers to structs.
4315 That is, when use of an incomplete struct would be legal, the use is indirect.
4316 An example is
4317 @samp{struct one direct; struct two * indirect;}.
4318
4319 The optional second word limits the specification to
4320 ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
4321 Generic structs are a bit complicated to explain.
4322 For C++, these are non-explicit specializations of template classes,
4323 or non-template classes within the above.
4324 Other programming languages have generics,
4325 but @samp{-femit-struct-debug-detailed} does not yet implement them.
4326
4327 The third word specifies the source files for those
4328 structs for which the compiler will emit debug information.
4329 The values @samp{none} and @samp{any} have the normal meaning.
4330 The value @samp{base} means that
4331 the base of name of the file in which the type declaration appears
4332 must match the base of the name of the main compilation file.
4333 In practice, this means that
4334 types declared in @file{foo.c} and @file{foo.h} will have debug information,
4335 but types declared in other header will not.
4336 The value @samp{sys} means those types satisfying @samp{base}
4337 or declared in system or compiler headers.
4338
4339 You may need to experiment to determine the best settings for your application.
4340
4341 The default is @samp{-femit-struct-debug-detailed=all}.
4342
4343 This option works only with DWARF 2.
4344
4345 @item -fno-merge-debug-strings
4346 @opindex fmerge-debug-strings
4347 @opindex fno-merge-debug-strings
4348 Direct the linker to merge together strings which are identical in
4349 different object files.  This is not supported by all assemblers or
4350 linker.  This decreases the size of the debug information in the
4351 output file at the cost of increasing link processing time.  This is
4352 on by default.
4353
4354 @item -fdebug-prefix-map=@var{old}=@var{new}
4355 @opindex fdebug-prefix-map
4356 When compiling files in directory @file{@var{old}}, record debugging
4357 information describing them as in @file{@var{new}} instead.
4358
4359 @item -fno-dwarf2-cfi-asm
4360 @opindex fdwarf2-cfi-asm
4361 @opindex fno-dwarf2-cfi-asm
4362 Emit DWARF 2 unwind info as compiler generated @code{.eh_frame} section
4363 instead of using GAS @code{.cfi_*} directives.
4364
4365 @cindex @command{prof}
4366 @item -p
4367 @opindex p
4368 Generate extra code to write profile information suitable for the
4369 analysis program @command{prof}.  You must use this option when compiling
4370 the source files you want data about, and you must also use it when
4371 linking.
4372
4373 @cindex @command{gprof}
4374 @item -pg
4375 @opindex pg
4376 Generate extra code to write profile information suitable for the
4377 analysis program @command{gprof}.  You must use this option when compiling
4378 the source files you want data about, and you must also use it when
4379 linking.
4380
4381 @item -Q
4382 @opindex Q
4383 Makes the compiler print out each function name as it is compiled, and
4384 print some statistics about each pass when it finishes.
4385
4386 @item -ftime-report
4387 @opindex ftime-report
4388 Makes the compiler print some statistics about the time consumed by each
4389 pass when it finishes.
4390
4391 @item -fmem-report
4392 @opindex fmem-report
4393 Makes the compiler print some statistics about permanent memory
4394 allocation when it finishes.
4395
4396 @item -fpre-ipa-mem-report
4397 @opindex fpre-ipa-mem-report
4398 @item -fpost-ipa-mem-report
4399 @opindex fpost-ipa-mem-report
4400 Makes the compiler print some statistics about permanent memory
4401 allocation before or after interprocedural optimization.
4402
4403 @item -fprofile-arcs
4404 @opindex fprofile-arcs
4405 Add code so that program flow @dfn{arcs} are instrumented.  During
4406 execution the program records how many times each branch and call is
4407 executed and how many times it is taken or returns.  When the compiled
4408 program exits it saves this data to a file called
4409 @file{@var{auxname}.gcda} for each source file.  The data may be used for
4410 profile-directed optimizations (@option{-fbranch-probabilities}), or for
4411 test coverage analysis (@option{-ftest-coverage}).  Each object file's
4412 @var{auxname} is generated from the name of the output file, if
4413 explicitly specified and it is not the final executable, otherwise it is
4414 the basename of the source file.  In both cases any suffix is removed
4415 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
4416 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
4417 @xref{Cross-profiling}.
4418
4419 @cindex @command{gcov}
4420 @item --coverage
4421 @opindex coverage
4422
4423 This option is used to compile and link code instrumented for coverage
4424 analysis.  The option is a synonym for @option{-fprofile-arcs}
4425 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
4426 linking).  See the documentation for those options for more details.
4427
4428 @itemize
4429
4430 @item
4431 Compile the source files with @option{-fprofile-arcs} plus optimization
4432 and code generation options.  For test coverage analysis, use the
4433 additional @option{-ftest-coverage} option.  You do not need to profile
4434 every source file in a program.
4435
4436 @item
4437 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
4438 (the latter implies the former).
4439
4440 @item
4441 Run the program on a representative workload to generate the arc profile
4442 information.  This may be repeated any number of times.  You can run
4443 concurrent instances of your program, and provided that the file system
4444 supports locking, the data files will be correctly updated.  Also
4445 @code{fork} calls are detected and correctly handled (double counting
4446 will not happen).
4447
4448 @item
4449 For profile-directed optimizations, compile the source files again with
4450 the same optimization and code generation options plus
4451 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
4452 Control Optimization}).
4453
4454 @item
4455 For test coverage analysis, use @command{gcov} to produce human readable
4456 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
4457 @command{gcov} documentation for further information.
4458
4459 @end itemize
4460
4461 With @option{-fprofile-arcs}, for each function of your program GCC
4462 creates a program flow graph, then finds a spanning tree for the graph.
4463 Only arcs that are not on the spanning tree have to be instrumented: the
4464 compiler adds code to count the number of times that these arcs are
4465 executed.  When an arc is the only exit or only entrance to a block, the
4466 instrumentation code can be added to the block; otherwise, a new basic
4467 block must be created to hold the instrumentation code.
4468
4469 @need 2000
4470 @item -ftest-coverage
4471 @opindex ftest-coverage
4472 Produce a notes file that the @command{gcov} code-coverage utility
4473 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
4474 show program coverage.  Each source file's note file is called
4475 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
4476 above for a description of @var{auxname} and instructions on how to
4477 generate test coverage data.  Coverage data will match the source files
4478 more closely, if you do not optimize.
4479
4480 @item -fdbg-cnt-list
4481 @opindex fdbg-cnt-list
4482 Print the name and the counter upperbound for all debug counters.
4483
4484 @item -fdbg-cnt=@var{counter-value-list}
4485 @opindex fdbg-cnt
4486 Set the internal debug counter upperbound. @var{counter-value-list} 
4487 is a comma-separated list of @var{name}:@var{value} pairs
4488 which sets the upperbound of each debug counter @var{name} to @var{value}.
4489 All debug counters have the initial upperbound of @var{UINT_MAX},
4490 thus dbg_cnt() returns true always unless the upperbound is set by this option.
4491 e.g. With -fdbg-cnt=dce:10,tail_call:0
4492 dbg_cnt(dce) will return true only for first 10 invocations
4493 and dbg_cnt(tail_call) will return false always.
4494
4495 @item -d@var{letters}
4496 @itemx -fdump-rtl-@var{pass}
4497 @opindex d
4498 Says to make debugging dumps during compilation at times specified by
4499 @var{letters}.    This is used for debugging the RTL-based passes of the
4500 compiler.  The file names for most of the dumps are made by appending a
4501 pass number and a word to the @var{dumpname}.  @var{dumpname} is generated
4502 from the name of the output file, if explicitly specified and it is not
4503 an executable, otherwise it is the basename of the source file. These
4504 switches may have different effects when @option{-E} is used for
4505 preprocessing.
4506
4507 Most debug dumps can be enabled either passing a letter to the @option{-d}
4508 option, or with a long @option{-fdump-rtl} switch; here are the possible
4509 letters for use in @var{letters} and @var{pass}, and their meanings:
4510
4511 @table @gcctabopt
4512 @item -dA
4513 @opindex dA
4514 Annotate the assembler output with miscellaneous debugging information.
4515
4516 @item -fdump-rtl-bbro
4517 @opindex fdump-rtl-bbro
4518 Dump after block reordering, to @file{@var{file}.148r.bbro}.
4519
4520 @item -fdump-rtl-combine
4521 @opindex fdump-rtl-combine
4522 Dump after the RTL instruction combination pass, to the file
4523 @file{@var{file}.129r.combine}.
4524
4525 @item -fdump-rtl-ce1
4526 @itemx -fdump-rtl-ce2
4527 @opindex fdump-rtl-ce1
4528 @opindex fdump-rtl-ce2
4529 @option{-fdump-rtl-ce1} enable dumping after the
4530 first if conversion, to the file @file{@var{file}.117r.ce1}. 
4531 @option{-fdump-rtl-ce2} enable dumping after the second if
4532 conversion, to the file @file{@var{file}.130r.ce2}.
4533
4534 @item -fdump-rtl-btl
4535 @itemx -fdump-rtl-dbr
4536 @opindex fdump-rtl-btl
4537 @opindex fdump-rtl-dbr
4538 @option{-fdump-rtl-btl} enable dumping after branch
4539 target load optimization, to @file{@var{file}.31.btl}.  
4540 @option{-fdump-rtl-dbr} enable dumping after delayed branch
4541 scheduling, to @file{@var{file}.36.dbr}.
4542
4543 @item -dD
4544 @opindex dD
4545 Dump all macro definitions, at the end of preprocessing, in addition to
4546 normal output.
4547
4548 @item -fdump-rtl-ce3
4549 @opindex fdump-rtl-ce3
4550 Dump after the third if conversion, to @file{@var{file}.146r.ce3}.
4551
4552 @item -fdump-rtl-cfg
4553 @itemx -fdump-rtl-life
4554 @opindex fdump-rtl-cfg
4555 @opindex fdump-rtl-life
4556 @option{-fdump-rtl-cfg} enable dumping after control
4557 and data flow analysis, to @file{@var{file}.116r.cfg}.  
4558 @option{-fdump-rtl-cfg} enable dumping dump after life analysis,
4559 to @file{@var{file}.128r.life1} and @file{@var{file}.135r.life2}.
4560
4561 @item -fdump-rtl-greg
4562 @opindex fdump-rtl-greg
4563 Dump after global register allocation, to @file{@var{file}.139r.greg}.
4564
4565 @item -fdump-rtl-gcse
4566 @itemx -fdump-rtl-bypass
4567 @opindex fdump-rtl-gcse
4568 @opindex fdump-rtl-bypass
4569 @option{-fdump-rtl-gcse} enable dumping after GCSE, to
4570 @file{@var{file}.114r.gcse}.  @option{-fdump-rtl-bypass}
4571 enable dumping after jump bypassing and control flow optimizations, to
4572 @file{@var{file}.115r.bypass}.
4573
4574 @item -fdump-rtl-eh
4575 @opindex fdump-rtl-eh
4576 Dump after finalization of EH handling code, to @file{@var{file}.02.eh}.
4577
4578 @item -fdump-rtl-sibling
4579 @opindex fdump-rtl-sibling
4580 Dump after sibling call optimizations, to @file{@var{file}.106r.sibling}.
4581
4582 @item -fdump-rtl-jump
4583 @opindex fdump-rtl-jump
4584 Dump after the first jump optimization, to @file{@var{file}.112r.jump}.
4585
4586 @item -fdump-rtl-stack
4587 @opindex fdump-rtl-stack
4588 Dump after conversion from GCC's "flat register file" registers to the
4589 x87's stack-like registers, to @file{@var{file}.152r.stack}.
4590
4591 @item -fdump-rtl-lreg
4592 @opindex fdump-rtl-lreg
4593 Dump after local register allocation, to @file{@var{file}.138r.lreg}.
4594
4595 @item -fdump-rtl-loop2
4596 @opindex fdump-rtl-loop2
4597 @option{-dL} and @option{-fdump-rtl-loop2} enable dumping after the
4598 loop optimization pass, to @file{@var{file}.119r.loop2},
4599 @file{@var{file}.120r.loop2_init},
4600 @file{@var{file}.121r.loop2_invariant}, and
4601 @file{@var{file}.125r.loop2_done}.
4602
4603 @item -fdump-rtl-sms
4604 @opindex fdump-rtl-sms
4605 Dump after modulo scheduling, to @file{@var{file}.136r.sms}.
4606
4607 @item -fdump-rtl-mach
4608 @opindex fdump-rtl-mach
4609 Dump after performing the machine dependent reorganization pass, to
4610 @file{@var{file}.155r.mach} if that pass exists.
4611
4612 @item -fdump-rtl-rnreg
4613 @opindex fdump-rtl-rnreg
4614 Dump after register renumbering, to @file{@var{file}.147r.rnreg}.
4615
4616 @item -fdump-rtl-regmove
4617 @opindex fdump-rtl-regmove
4618 Dump after the register move pass, to @file{@var{file}.132r.regmove}.
4619
4620 @item -fdump-rtl-postreload
4621 @opindex fdump-rtl-postreload
4622 Dump after post-reload optimizations, to @file{@var{file}.24.postreload}.
4623
4624 @item -fdump-rtl-expand
4625 @opindex fdump-rtl-expand
4626 Dump after RTL generation, to @file{@var{file}.104r.expand}.
4627
4628 @item -fdump-rtl-sched2
4629 @opindex fdump-rtl-sched2
4630 Dump after the second scheduling pass, to @file{@var{file}.149r.sched2}.
4631
4632 @item -fdump-rtl-cse
4633 @opindex fdump-rtl-cse
4634 Dump after CSE (including the jump optimization that sometimes follows
4635 CSE), to @file{@var{file}.113r.cse}.
4636
4637 @item -fdump-rtl-sched1
4638 @opindex fdump-rtl-sched1
4639 Dump after the first scheduling pass, to @file{@var{file}.136r.sched1}.
4640
4641 @item -fdump-rtl-cse2
4642 @opindex fdump-rtl-cse2
4643 Dump after the second CSE pass (including the jump optimization that
4644 sometimes follows CSE), to @file{@var{file}.127r.cse2}.
4645
4646 @item -fdump-rtl-tracer
4647 @opindex fdump-rtl-tracer
4648 Dump after running tracer, to @file{@var{file}.118r.tracer}.
4649
4650 @item -fdump-rtl-vpt
4651 @itemx -fdump-rtl-vartrack
4652 @opindex fdump-rtl-vpt
4653 @opindex fdump-rtl-vartrack
4654 @option{-fdump-rtl-vpt} enable dumping after the value
4655 profile transformations, to @file{@var{file}.10.vpt}.
4656 @option{-fdump-rtl-vartrack} enable dumping after variable tracking,
4657 to @file{@var{file}.154r.vartrack}.
4658
4659 @item -fdump-rtl-flow2
4660 @opindex fdump-rtl-flow2
4661 Dump after the second flow pass, to @file{@var{file}.142r.flow2}.
4662
4663 @item -fdump-rtl-peephole2
4664 @opindex fdump-rtl-peephole2
4665 Dump after the peephole pass, to @file{@var{file}.145r.peephole2}.
4666
4667 @item -fdump-rtl-web
4668 @opindex fdump-rtl-web
4669 Dump after live range splitting, to @file{@var{file}.126r.web}.
4670
4671 @item -fdump-rtl-all
4672 @opindex fdump-rtl-all
4673 Produce all the dumps listed above.
4674
4675 @item -dH
4676 @opindex dH
4677 Produce a core dump whenever an error occurs.
4678
4679 @item -dm
4680 @opindex dm
4681 Print statistics on memory usage, at the end of the run, to
4682 standard error.
4683
4684 @item -dp
4685 @opindex dp
4686 Annotate the assembler output with a comment indicating which
4687 pattern and alternative was used.  The length of each instruction is
4688 also printed.
4689
4690 @item -dP
4691 @opindex dP
4692 Dump the RTL in the assembler output as a comment before each instruction.
4693 Also turns on @option{-dp} annotation.
4694
4695 @item -dv
4696 @opindex dv
4697 For each of the other indicated dump files (either with @option{-d} or
4698 @option{-fdump-rtl-@var{pass}}), dump a representation of the control flow
4699 graph suitable for viewing with VCG to @file{@var{file}.@var{pass}.vcg}.
4700
4701 @item -dx
4702 @opindex dx
4703 Just generate RTL for a function instead of compiling it.  Usually used
4704 with @samp{r} (@option{-fdump-rtl-expand}).
4705
4706 @item -dy
4707 @opindex dy
4708 Dump debugging information during parsing, to standard error.
4709 @end table
4710
4711 @item -fdump-noaddr
4712 @opindex fdump-noaddr
4713 When doing debugging dumps (see @option{-d} option above), suppress
4714 address output.  This makes it more feasible to use diff on debugging
4715 dumps for compiler invocations with different compiler binaries and/or
4716 different text / bss / data / heap / stack / dso start locations.
4717
4718 @item -fdump-unnumbered
4719 @opindex fdump-unnumbered
4720 When doing debugging dumps (see @option{-d} option above), suppress instruction
4721 numbers and address output.  This makes it more feasible to
4722 use diff on debugging dumps for compiler invocations with different
4723 options, in particular with and without @option{-g}.
4724
4725 @item -fdump-translation-unit @r{(C++ only)}
4726 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
4727 @opindex fdump-translation-unit
4728 Dump a representation of the tree structure for the entire translation
4729 unit to a file.  The file name is made by appending @file{.tu} to the
4730 source file name.  If the @samp{-@var{options}} form is used, @var{options}
4731 controls the details of the dump as described for the
4732 @option{-fdump-tree} options.
4733
4734 @item -fdump-class-hierarchy @r{(C++ only)}
4735 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
4736 @opindex fdump-class-hierarchy
4737 Dump a representation of each class's hierarchy and virtual function
4738 table layout to a file.  The file name is made by appending @file{.class}
4739 to the source file name.  If the @samp{-@var{options}} form is used,
4740 @var{options} controls the details of the dump as described for the
4741 @option{-fdump-tree} options.
4742
4743 @item -fdump-ipa-@var{switch}
4744 @opindex fdump-ipa
4745 Control the dumping at various stages of inter-procedural analysis
4746 language tree to a file.  The file name is generated by appending a switch
4747 specific suffix to the source file name.  The following dumps are possible:
4748
4749 @table @samp
4750 @item all
4751 Enables all inter-procedural analysis dumps.
4752
4753 @item cgraph
4754 Dumps information about call-graph optimization, unused function removal,
4755 and inlining decisions.
4756
4757 @item inline
4758 Dump after function inlining.
4759
4760 @end table
4761
4762 @item -fdump-statistics-@var{option}
4763 @opindex -fdump-statistics
4764 Enable and control dumping of pass statistics in a separate file.  The
4765 file name is generated by appending a suffix ending in @samp{.statistics}
4766 to the source file name.  If the @samp{-@var{option}} form is used,
4767 @samp{-stats} will cause counters to be summed over the whole compilation unit
4768 while @samp{-details} will dump every event as the passes generate them.
4769 The default with no option is to sum counters for each function compiled.
4770
4771 @item -fdump-tree-@var{switch}
4772 @itemx -fdump-tree-@var{switch}-@var{options}
4773 @opindex fdump-tree
4774 Control the dumping at various stages of processing the intermediate
4775 language tree to a file.  The file name is generated by appending a switch
4776 specific suffix to the source file name.  If the @samp{-@var{options}}
4777 form is used, @var{options} is a list of @samp{-} separated options that
4778 control the details of the dump.  Not all options are applicable to all
4779 dumps, those which are not meaningful will be ignored.  The following
4780 options are available
4781
4782 @table @samp
4783 @item address
4784 Print the address of each node.  Usually this is not meaningful as it
4785 changes according to the environment and source file.  Its primary use
4786 is for tying up a dump file with a debug environment.
4787 @item slim
4788 Inhibit dumping of members of a scope or body of a function merely
4789 because that scope has been reached.  Only dump such items when they
4790 are directly reachable by some other path.  When dumping pretty-printed
4791 trees, this option inhibits dumping the bodies of control structures.
4792 @item raw
4793 Print a raw representation of the tree.  By default, trees are
4794 pretty-printed into a C-like representation.
4795 @item details
4796 Enable more detailed dumps (not honored by every dump option).
4797 @item stats
4798 Enable dumping various statistics about the pass (not honored by every dump
4799 option).
4800 @item blocks
4801 Enable showing basic block boundaries (disabled in raw dumps).
4802 @item vops
4803 Enable showing virtual operands for every statement.
4804 @item lineno
4805 Enable showing line numbers for statements.
4806 @item uid
4807 Enable showing the unique ID (@code{DECL_UID}) for each variable.
4808 @item verbose
4809 Enable showing the tree dump for each statement.
4810 @item all
4811 Turn on all options, except @option{raw}, @option{slim}, @option{verbose}
4812 and @option{lineno}.
4813 @end table
4814
4815 The following tree dumps are possible:
4816 @table @samp
4817
4818 @item original
4819 Dump before any tree based optimization, to @file{@var{file}.original}.
4820
4821 @item optimized
4822 Dump after all tree based optimization, to @file{@var{file}.optimized}.
4823
4824 @item gimple
4825 @opindex fdump-tree-gimple
4826 Dump each function before and after the gimplification pass to a file.  The
4827 file name is made by appending @file{.gimple} to the source file name.
4828
4829 @item cfg
4830 @opindex fdump-tree-cfg
4831 Dump the control flow graph of each function to a file.  The file name is
4832 made by appending @file{.cfg} to the source file name.
4833
4834 @item vcg
4835 @opindex fdump-tree-vcg
4836 Dump the control flow graph of each function to a file in VCG format.  The
4837 file name is made by appending @file{.vcg} to the source file name.  Note
4838 that if the file contains more than one function, the generated file cannot
4839 be used directly by VCG@.  You will need to cut and paste each function's
4840 graph into its own separate file first.
4841
4842 @item ch
4843 @opindex fdump-tree-ch
4844 Dump each function after copying loop headers.  The file name is made by
4845 appending @file{.ch} to the source file name.
4846
4847 @item ssa
4848 @opindex fdump-tree-ssa
4849 Dump SSA related information to a file.  The file name is made by appending
4850 @file{.ssa} to the source file name.
4851
4852 @item alias
4853 @opindex fdump-tree-alias
4854 Dump aliasing information for each function.  The file name is made by
4855 appending @file{.alias} to the source file name.
4856
4857 @item ccp
4858 @opindex fdump-tree-ccp
4859 Dump each function after CCP@.  The file name is made by appending
4860 @file{.ccp} to the source file name.
4861
4862 @item storeccp
4863 @opindex fdump-tree-storeccp
4864 Dump each function after STORE-CCP@.  The file name is made by appending
4865 @file{.storeccp} to the source file name.
4866
4867 @item pre
4868 @opindex fdump-tree-pre
4869 Dump trees after partial redundancy elimination.  The file name is made
4870 by appending @file{.pre} to the source file name.
4871
4872 @item fre
4873 @opindex fdump-tree-fre
4874 Dump trees after full redundancy elimination.  The file name is made
4875 by appending @file{.fre} to the source file name.
4876
4877 @item copyprop
4878 @opindex fdump-tree-copyprop
4879 Dump trees after copy propagation.  The file name is made
4880 by appending @file{.copyprop} to the source file name.
4881
4882 @item store_copyprop
4883 @opindex fdump-tree-store_copyprop
4884 Dump trees after store copy-propagation.  The file name is made
4885 by appending @file{.store_copyprop} to the source file name.
4886
4887 @item dce
4888 @opindex fdump-tree-dce
4889 Dump each function after dead code elimination.  The file name is made by
4890 appending @file{.dce} to the source file name.
4891
4892 @item mudflap
4893 @opindex fdump-tree-mudflap
4894 Dump each function after adding mudflap instrumentation.  The file name is
4895 made by appending @file{.mudflap} to the source file name.
4896
4897 @item sra
4898 @opindex fdump-tree-sra
4899 Dump each function after performing scalar replacement of aggregates.  The
4900 file name is made by appending @file{.sra} to the source file name.
4901
4902 @item sink
4903 @opindex fdump-tree-sink
4904 Dump each function after performing code sinking.  The file name is made
4905 by appending @file{.sink} to the source file name.
4906
4907 @item dom
4908 @opindex fdump-tree-dom
4909 Dump each function after applying dominator tree optimizations.  The file
4910 name is made by appending @file{.dom} to the source file name.
4911
4912 @item dse
4913 @opindex fdump-tree-dse
4914 Dump each function after applying dead store elimination.  The file
4915 name is made by appending @file{.dse} to the source file name.
4916
4917 @item phiopt
4918 @opindex fdump-tree-phiopt
4919 Dump each function after optimizing PHI nodes into straightline code.  The file
4920 name is made by appending @file{.phiopt} to the source file name.
4921
4922 @item forwprop
4923 @opindex fdump-tree-forwprop
4924 Dump each function after forward propagating single use variables.  The file
4925 name is made by appending @file{.forwprop} to the source file name.
4926
4927 @item copyrename
4928 @opindex fdump-tree-copyrename
4929 Dump each function after applying the copy rename optimization.  The file
4930 name is made by appending @file{.copyrename} to the source file name.
4931
4932 @item nrv
4933 @opindex fdump-tree-nrv
4934 Dump each function after applying the named return value optimization on
4935 generic trees.  The file name is made by appending @file{.nrv} to the source
4936 file name.
4937
4938 @item vect
4939 @opindex fdump-tree-vect
4940 Dump each function after applying vectorization of loops.  The file name is
4941 made by appending @file{.vect} to the source file name.
4942
4943 @item vrp
4944 @opindex fdump-tree-vrp
4945 Dump each function after Value Range Propagation (VRP).  The file name
4946 is made by appending @file{.vrp} to the source file name.
4947
4948 @item all
4949 @opindex fdump-tree-all
4950 Enable all the available tree dumps with the flags provided in this option.
4951 @end table
4952
4953 @item -ftree-vectorizer-verbose=@var{n}
4954 @opindex ftree-vectorizer-verbose
4955 This option controls the amount of debugging output the vectorizer prints.
4956 This information is written to standard error, unless
4957 @option{-fdump-tree-all} or @option{-fdump-tree-vect} is specified,
4958 in which case it is output to the usual dump listing file, @file{.vect}.
4959 For @var{n}=0 no diagnostic information is reported.
4960 If @var{n}=1 the vectorizer reports each loop that got vectorized,
4961 and the total number of loops that got vectorized.
4962 If @var{n}=2 the vectorizer also reports non-vectorized loops that passed
4963 the first analysis phase (vect_analyze_loop_form) - i.e.@: countable,
4964 inner-most, single-bb, single-entry/exit loops.  This is the same verbosity
4965 level that @option{-fdump-tree-vect-stats} uses.
4966 Higher verbosity levels mean either more information dumped for each
4967 reported loop, or same amount of information reported for more loops:
4968 If @var{n}=3, alignment related information is added to the reports.
4969 If @var{n}=4, data-references related information (e.g.@: memory dependences,
4970 memory access-patterns) is added to the reports.
4971 If @var{n}=5, the vectorizer reports also non-vectorized inner-most loops
4972 that did not pass the first analysis phase (i.e., may not be countable, or
4973 may have complicated control-flow).
4974 If @var{n}=6, the vectorizer reports also non-vectorized nested loops.
4975 For @var{n}=7, all the information the vectorizer generates during its
4976 analysis and transformation is reported.  This is the same verbosity level
4977 that @option{-fdump-tree-vect-details} uses.
4978
4979 @item -frandom-seed=@var{string}
4980 @opindex frandom-string
4981 This option provides a seed that GCC uses when it would otherwise use
4982 random numbers.  It is used to generate certain symbol names
4983 that have to be different in every compiled file.  It is also used to
4984 place unique stamps in coverage data files and the object files that
4985 produce them.  You can use the @option{-frandom-seed} option to produce
4986 reproducibly identical object files.
4987
4988 The @var{string} should be different for every file you compile.
4989
4990 @item -fsched-verbose=@var{n}
4991 @opindex fsched-verbose
4992 On targets that use instruction scheduling, this option controls the
4993 amount of debugging output the scheduler prints.  This information is
4994 written to standard error, unless @option{-dS} or @option{-dR} is
4995 specified, in which case it is output to the usual dump
4996 listing file, @file{.sched} or @file{.sched2} respectively.  However
4997 for @var{n} greater than nine, the output is always printed to standard
4998 error.
4999
5000 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
5001 same information as @option{-dRS}.  For @var{n} greater than one, it
5002 also output basic block probabilities, detailed ready list information
5003 and unit/insn info.  For @var{n} greater than two, it includes RTL
5004 at abort point, control-flow and regions info.  And for @var{n} over
5005 four, @option{-fsched-verbose} also includes dependence info.
5006
5007 @item -save-temps
5008 @opindex save-temps
5009 Store the usual ``temporary'' intermediate files permanently; place them
5010 in the current directory and name them based on the source file.  Thus,
5011 compiling @file{foo.c} with @samp{-c -save-temps} would produce files
5012 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
5013 preprocessed @file{foo.i} output file even though the compiler now
5014 normally uses an integrated preprocessor.
5015
5016 When used in combination with the @option{-x} command line option,
5017 @option{-save-temps} is sensible enough to avoid over writing an
5018 input source file with the same extension as an intermediate file.
5019 The corresponding intermediate file may be obtained by renaming the
5020 source file before using @option{-save-temps}.
5021
5022 @item -time
5023 @opindex time
5024 Report the CPU time taken by each subprocess in the compilation
5025 sequence.  For C source files, this is the compiler proper and assembler
5026 (plus the linker if linking is done).  The output looks like this:
5027
5028 @smallexample
5029 # cc1 0.12 0.01
5030 # as 0.00 0.01
5031 @end smallexample
5032
5033 The first number on each line is the ``user time'', that is time spent
5034 executing the program itself.  The second number is ``system time'',
5035 time spent executing operating system routines on behalf of the program.
5036 Both numbers are in seconds.
5037
5038 @item -fvar-tracking
5039 @opindex fvar-tracking
5040 Run variable tracking pass.  It computes where variables are stored at each
5041 position in code.  Better debugging information is then generated
5042 (if the debugging information format supports this information).
5043
5044 It is enabled by default when compiling with optimization (@option{-Os},
5045 @option{-O}, @option{-O2}, @dots{}), debugging information (@option{-g}) and
5046 the debug info format supports it.
5047
5048 @item -print-file-name=@var{library}
5049 @opindex print-file-name
5050 Print the full absolute name of the library file @var{library} that
5051 would be used when linking---and don't do anything else.  With this
5052 option, GCC does not compile or link anything; it just prints the
5053 file name.
5054
5055 @item -print-multi-directory
5056 @opindex print-multi-directory
5057 Print the directory name corresponding to the multilib selected by any
5058 other switches present in the command line.  This directory is supposed
5059 to exist in @env{GCC_EXEC_PREFIX}.
5060
5061 @item -print-multi-lib
5062 @opindex print-multi-lib
5063 Print the mapping from multilib directory names to compiler switches
5064 that enable them.  The directory name is separated from the switches by
5065 @samp{;}, and each switch starts with an @samp{@@} instead of the
5066 @samp{-}, without spaces between multiple switches.  This is supposed to
5067 ease shell-processing.
5068
5069 @item -print-prog-name=@var{program}
5070 @opindex print-prog-name
5071 Like @option{-print-file-name}, but searches for a program such as @samp{cpp}.
5072
5073 @item -print-libgcc-file-name
5074 @opindex print-libgcc-file-name
5075 Same as @option{-print-file-name=libgcc.a}.
5076
5077 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
5078 but you do want to link with @file{libgcc.a}.  You can do
5079
5080 @smallexample
5081 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
5082 @end smallexample
5083
5084 @item -print-search-dirs
5085 @opindex print-search-dirs
5086 Print the name of the configured installation directory and a list of
5087 program and library directories @command{gcc} will search---and don't do anything else.
5088
5089 This is useful when @command{gcc} prints the error message
5090 @samp{installation problem, cannot exec cpp0: No such file or directory}.
5091 To resolve this you either need to put @file{cpp0} and the other compiler
5092 components where @command{gcc} expects to find them, or you can set the environment
5093 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
5094 Don't forget the trailing @samp{/}.
5095 @xref{Environment Variables}.
5096
5097 @item -print-sysroot
5098 @opindex print-sysroot
5099 Print the target sysroot directory that will be used during
5100 compilation.  This is the target sysroot specified either at configure
5101 time or using the @option{--sysroot} option, possibly with an extra
5102 suffix that depends on compilation options.  If no target sysroot is
5103 specified, the option prints nothing.
5104
5105 @item -print-sysroot-headers-suffix
5106 @opindex print-sysroot-headers-suffix
5107 Print the suffix added to the target sysroot when searching for
5108 headers, or give an error if the compiler is not configured with such
5109 a suffix---and don't do anything else.
5110
5111 @item -dumpmachine
5112 @opindex dumpmachine
5113 Print the compiler's target machine (for example,
5114 @samp{i686-pc-linux-gnu})---and don't do anything else.
5115
5116 @item -dumpversion
5117 @opindex dumpversion
5118 Print the compiler version (for example, @samp{3.0})---and don't do
5119 anything else.
5120
5121 @item -dumpspecs
5122 @opindex dumpspecs
5123 Print the compiler's built-in specs---and don't do anything else.  (This
5124 is used when GCC itself is being built.)  @xref{Spec Files}.
5125
5126 @item -feliminate-unused-debug-types
5127 @opindex feliminate-unused-debug-types
5128 Normally, when producing DWARF2 output, GCC will emit debugging
5129 information for all types declared in a compilation
5130 unit, regardless of whether or not they are actually used
5131 in that compilation unit.  Sometimes this is useful, such as
5132 if, in the debugger, you want to cast a value to a type that is
5133 not actually used in your program (but is declared).  More often,
5134 however, this results in a significant amount of wasted space.
5135 With this option, GCC will avoid producing debug symbol output
5136 for types that are nowhere used in the source file being compiled.
5137 @end table
5138
5139 @node Optimize Options
5140 @section Options That Control Optimization
5141 @cindex optimize options
5142 @cindex options, optimization
5143
5144 These options control various sorts of optimizations.
5145
5146 Without any optimization option, the compiler's goal is to reduce the
5147 cost of compilation and to make debugging produce the expected
5148 results.  Statements are independent: if you stop the program with a
5149 breakpoint between statements, you can then assign a new value to any
5150 variable or change the program counter to any other statement in the
5151 function and get exactly the results you would expect from the source
5152 code.
5153
5154 Turning on optimization flags makes the compiler attempt to improve
5155 the performance and/or code size at the expense of compilation time
5156 and possibly the ability to debug the program.
5157
5158 The compiler performs optimization based on the knowledge it has of the
5159 program.  Compiling multiple files at once to a single output file mode allows
5160 the compiler to use information gained from all of the files when compiling
5161 each of them.
5162
5163 Not all optimizations are controlled directly by a flag.  Only
5164 optimizations that have a flag are listed.
5165
5166 @table @gcctabopt
5167 @item -O
5168 @itemx -O1
5169 @opindex O
5170 @opindex O1
5171 Optimize.  Optimizing compilation takes somewhat more time, and a lot
5172 more memory for a large function.
5173
5174 With @option{-O}, the compiler tries to reduce code size and execution
5175 time, without performing any optimizations that take a great deal of
5176 compilation time.
5177
5178 @option{-O} turns on the following optimization flags:
5179 @gccoptlist{
5180 -fauto-inc-dec @gol
5181 -fcprop-registers @gol
5182 -fdce @gol
5183 -fdefer-pop @gol
5184 -fdelayed-branch @gol
5185 -fdse @gol
5186 -fguess-branch-probability @gol
5187 -fif-conversion2 @gol
5188 -fif-conversion @gol
5189 -finline-small-functions @gol
5190 -fipa-pure-const @gol
5191 -fipa-reference @gol
5192 -fmerge-constants
5193 -fsplit-wide-types @gol
5194 -ftree-builtin-call-dce @gol
5195 -ftree-ccp @gol
5196 -ftree-ch @gol
5197 -ftree-copyrename @gol
5198 -ftree-dce @gol
5199 -ftree-dominator-opts @gol
5200 -ftree-dse @gol
5201 -ftree-fre @gol
5202 -ftree-sra @gol
5203 -ftree-ter @gol
5204 -funit-at-a-time}
5205
5206 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
5207 where doing so does not interfere with debugging.
5208
5209 @item -O2
5210 @opindex O2
5211 Optimize even more.  GCC performs nearly all supported optimizations
5212 that do not involve a space-speed tradeoff.  The compiler does not
5213 perform loop unrolling or function inlining when you specify @option{-O2}.
5214 As compared to @option{-O}, this option increases both compilation time
5215 and the performance of the generated code.
5216
5217 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
5218 also turns on the following optimization flags:
5219 @gccoptlist{-fthread-jumps @gol
5220 -falign-functions  -falign-jumps @gol
5221 -falign-loops  -falign-labels @gol
5222 -fcaller-saves @gol
5223 -fcrossjumping @gol
5224 -fcse-follow-jumps  -fcse-skip-blocks @gol
5225 -fdelete-null-pointer-checks @gol
5226 -fexpensive-optimizations @gol
5227 -fgcse  -fgcse-lm  @gol
5228 -findirect-inlining @gol
5229 -foptimize-sibling-calls @gol
5230 -fpeephole2 @gol
5231 -fregmove @gol
5232 -freorder-blocks  -freorder-functions @gol
5233 -frerun-cse-after-loop  @gol
5234 -fsched-interblock  -fsched-spec @gol
5235 -fschedule-insns  -fschedule-insns2 @gol
5236 -fstrict-aliasing -fstrict-overflow @gol
5237 -ftree-switch-conversion @gol
5238 -ftree-pre @gol
5239 -ftree-vrp}
5240
5241 Please note the warning under @option{-fgcse} about
5242 invoking @option{-O2} on programs that use computed gotos.
5243
5244 @item -O3
5245 @opindex O3
5246 Optimize yet more.  @option{-O3} turns on all optimizations specified
5247 by @option{-O2} and also turns on the @option{-finline-functions},
5248 @option{-funswitch-loops}, @option{-fpredictive-commoning},
5249 @option{-fgcse-after-reload} and @option{-ftree-vectorize} options.
5250
5251 @item -O0
5252 @opindex O0
5253 Reduce compilation time and make debugging produce the expected
5254 results.  This is the default.
5255
5256 @item -Os
5257 @opindex Os
5258 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
5259 do not typically increase code size.  It also performs further
5260 optimizations designed to reduce code size.
5261
5262 @option{-Os} disables the following optimization flags:
5263 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
5264 -falign-labels  -freorder-blocks  -freorder-blocks-and-partition @gol
5265 -fprefetch-loop-arrays  -ftree-vect-loop-version}
5266
5267 If you use multiple @option{-O} options, with or without level numbers,
5268 the last such option is the one that is effective.
5269 @end table
5270
5271 Options of the form @option{-f@var{flag}} specify machine-independent
5272 flags.  Most flags have both positive and negative forms; the negative
5273 form of @option{-ffoo} would be @option{-fno-foo}.  In the table
5274 below, only one of the forms is listed---the one you typically will
5275 use.  You can figure out the other form by either removing @samp{no-}
5276 or adding it.
5277
5278 The following options control specific optimizations.  They are either
5279 activated by @option{-O} options or are related to ones that are.  You
5280 can use the following flags in the rare cases when ``fine-tuning'' of
5281 optimizations to be performed is desired.
5282
5283 @table @gcctabopt
5284 @item -fno-default-inline
5285 @opindex fno-default-inline
5286 Do not make member functions inline by default merely because they are
5287 defined inside the class scope (C++ only).  Otherwise, when you specify
5288 @w{@option{-O}}, member functions defined inside class scope are compiled
5289 inline by default; i.e., you don't need to add @samp{inline} in front of
5290 the member function name.
5291
5292 @item -fno-defer-pop
5293 @opindex fno-defer-pop
5294 Always pop the arguments to each function call as soon as that function
5295 returns.  For machines which must pop arguments after a function call,
5296 the compiler normally lets arguments accumulate on the stack for several
5297 function calls and pops them all at once.
5298
5299 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5300
5301 @item -fforward-propagate
5302 @opindex fforward-propagate
5303 Perform a forward propagation pass on RTL@.  The pass tries to combine two
5304 instructions and checks if the result can be simplified.  If loop unrolling
5305 is active, two passes are performed and the second is scheduled after
5306 loop unrolling.
5307
5308 This option is enabled by default at optimization levels @option{-O2},
5309 @option{-O3}, @option{-Os}.
5310
5311 @item -fomit-frame-pointer
5312 @opindex fomit-frame-pointer
5313 Don't keep the frame pointer in a register for functions that
5314 don't need one.  This avoids the instructions to save, set up and
5315 restore frame pointers; it also makes an extra register available
5316 in many functions.  @strong{It also makes debugging impossible on
5317 some machines.}
5318
5319 On some machines, such as the VAX, this flag has no effect, because
5320 the standard calling sequence automatically handles the frame pointer
5321 and nothing is saved by pretending it doesn't exist.  The
5322 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
5323 whether a target machine supports this flag.  @xref{Registers,,Register
5324 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
5325
5326 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5327
5328 @item -foptimize-sibling-calls
5329 @opindex foptimize-sibling-calls
5330 Optimize sibling and tail recursive calls.
5331
5332 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5333
5334 @item -fno-inline
5335 @opindex fno-inline
5336 Don't pay attention to the @code{inline} keyword.  Normally this option
5337 is used to keep the compiler from expanding any functions inline.
5338 Note that if you are not optimizing, no functions can be expanded inline.
5339
5340 @item -finline-small-functions
5341 @opindex finline-small-functions
5342 Integrate functions into their callers when their body is smaller than expected
5343 function call code (so overall size of program gets smaller).  The compiler
5344 heuristically decides which functions are simple enough to be worth integrating
5345 in this way.
5346
5347 Enabled at level @option{-O2}.
5348
5349 @item -findirect-inlining
5350 @opindex findirect-inlining
5351 Inline also indirect calls that are discovered to be known at compile
5352 time thanks to previous inlining.  This option has any effect only
5353 when inlining itself is turned on by the @option{-finline-functions}
5354 or @option{-finline-small-functions} options.
5355
5356 Enabled at level @option{-O2}.
5357
5358 @item -finline-functions
5359 @opindex finline-functions
5360 Integrate all simple functions into their callers.  The compiler
5361 heuristically decides which functions are simple enough to be worth
5362 integrating in this way.
5363
5364 If all calls to a given function are integrated, and the function is
5365 declared @code{static}, then the function is normally not output as
5366 assembler code in its own right.
5367
5368 Enabled at level @option{-O3}.
5369
5370 @item -finline-functions-called-once
5371 @opindex finline-functions-called-once
5372 Consider all @code{static} functions called once for inlining into their
5373 caller even if they are not marked @code{inline}.  If a call to a given
5374 function is integrated, then the function is not output as assembler code
5375 in its own right.
5376
5377 Enabled at levels @option{-O1}, @option{-O2}, @option{-O3} and @option{-Os}.
5378
5379 @item -fearly-inlining
5380 @opindex fearly-inlining
5381 Inline functions marked by @code{always_inline} and functions whose body seems
5382 smaller than the function call overhead early before doing
5383 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
5384 makes profiling significantly cheaper and usually inlining faster on programs
5385 having large chains of nested wrapper functions.
5386
5387 Enabled by default.
5388
5389 @item -finline-limit=@var{n}
5390 @opindex finline-limit
5391 By default, GCC limits the size of functions that can be inlined.  This flag
5392 allows coarse control of this limit.  @var{n} is the size of functions that
5393 can be inlined in number of pseudo instructions.
5394
5395 Inlining is actually controlled by a number of parameters, which may be
5396 specified individually by using @option{--param @var{name}=@var{value}}.
5397 The @option{-finline-limit=@var{n}} option sets some of these parameters
5398 as follows:
5399
5400 @table @gcctabopt
5401 @item max-inline-insns-single
5402 is set to @var{n}/2.
5403 @item max-inline-insns-auto
5404 is set to @var{n}/2.
5405 @end table
5406
5407 See below for a documentation of the individual
5408 parameters controlling inlining and for the defaults of these parameters.
5409
5410 @emph{Note:} there may be no value to @option{-finline-limit} that results
5411 in default behavior.
5412
5413 @emph{Note:} pseudo instruction represents, in this particular context, an
5414 abstract measurement of function's size.  In no way does it represent a count
5415 of assembly instructions and as such its exact meaning might change from one
5416 release to an another.
5417
5418 @item -fkeep-inline-functions
5419 @opindex fkeep-inline-functions
5420 In C, emit @code{static} functions that are declared @code{inline}
5421 into the object file, even if the function has been inlined into all
5422 of its callers.  This switch does not affect functions using the
5423 @code{extern inline} extension in GNU C89@.  In C++, emit any and all
5424 inline functions into the object file.
5425
5426 @item -fkeep-static-consts
5427 @opindex fkeep-static-consts
5428 Emit variables declared @code{static const} when optimization isn't turned
5429 on, even if the variables aren't referenced.
5430
5431 GCC enables this option by default.  If you want to force the compiler to
5432 check if the variable was referenced, regardless of whether or not
5433 optimization is turned on, use the @option{-fno-keep-static-consts} option.
5434
5435 @item -fmerge-constants
5436 @opindex fmerge-constants
5437 Attempt to merge identical constants (string constants and floating point
5438 constants) across compilation units.
5439
5440 This option is the default for optimized compilation if the assembler and
5441 linker support it.  Use @option{-fno-merge-constants} to inhibit this
5442 behavior.
5443
5444 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5445
5446 @item -fmerge-all-constants
5447 @opindex fmerge-all-constants
5448 Attempt to merge identical constants and identical variables.
5449
5450 This option implies @option{-fmerge-constants}.  In addition to
5451 @option{-fmerge-constants} this considers e.g.@: even constant initialized
5452 arrays or initialized constant variables with integral or floating point
5453 types.  Languages like C or C++ require each non-automatic variable to
5454 have distinct location, so using this option will result in non-conforming
5455 behavior.
5456
5457 @item -fmodulo-sched
5458 @opindex fmodulo-sched
5459 Perform swing modulo scheduling immediately before the first scheduling
5460 pass.  This pass looks at innermost loops and reorders their
5461 instructions by overlapping different iterations.
5462
5463 @item -fmodulo-sched-allow-regmoves
5464 @opindex fmodulo-sched-allow-regmoves
5465 Perform more aggressive SMS based modulo scheduling with register moves
5466 allowed.  By setting this flag certain anti-dependences edges will be
5467 deleted which will trigger the generation of reg-moves based on the
5468 life-range analysis.  This option is effective only with
5469 @option{-fmodulo-sched} enabled.
5470
5471 @item -fno-branch-count-reg
5472 @opindex fno-branch-count-reg
5473 Do not use ``decrement and branch'' instructions on a count register,
5474 but instead generate a sequence of instructions that decrement a
5475 register, compare it against zero, then branch based upon the result.
5476 This option is only meaningful on architectures that support such
5477 instructions, which include x86, PowerPC, IA-64 and S/390.
5478
5479 The default is @option{-fbranch-count-reg}.
5480
5481 @item -fno-function-cse
5482 @opindex fno-function-cse
5483 Do not put function addresses in registers; make each instruction that
5484 calls a constant function contain the function's address explicitly.
5485
5486 This option results in less efficient code, but some strange hacks
5487 that alter the assembler output may be confused by the optimizations
5488 performed when this option is not used.
5489
5490 The default is @option{-ffunction-cse}
5491
5492 @item -fno-zero-initialized-in-bss
5493 @opindex fno-zero-initialized-in-bss
5494 If the target supports a BSS section, GCC by default puts variables that
5495 are initialized to zero into BSS@.  This can save space in the resulting
5496 code.
5497
5498 This option turns off this behavior because some programs explicitly
5499 rely on variables going to the data section.  E.g., so that the
5500 resulting executable can find the beginning of that section and/or make
5501 assumptions based on that.
5502
5503 The default is @option{-fzero-initialized-in-bss}.
5504
5505 @item -fmudflap -fmudflapth -fmudflapir
5506 @opindex fmudflap
5507 @opindex fmudflapth
5508 @opindex fmudflapir
5509 @cindex bounds checking
5510 @cindex mudflap
5511 For front-ends that support it (C and C++), instrument all risky
5512 pointer/array dereferencing operations, some standard library
5513 string/heap functions, and some other associated constructs with
5514 range/validity tests.  Modules so instrumented should be immune to
5515 buffer overflows, invalid heap use, and some other classes of C/C++
5516 programming errors.  The instrumentation relies on a separate runtime
5517 library (@file{libmudflap}), which will be linked into a program if
5518 @option{-fmudflap} is given at link time.  Run-time behavior of the
5519 instrumented program is controlled by the @env{MUDFLAP_OPTIONS}
5520 environment variable.  See @code{env MUDFLAP_OPTIONS=-help a.out}
5521 for its options.
5522
5523 Use @option{-fmudflapth} instead of @option{-fmudflap} to compile and to
5524 link if your program is multi-threaded.  Use @option{-fmudflapir}, in
5525 addition to @option{-fmudflap} or @option{-fmudflapth}, if
5526 instrumentation should ignore pointer reads.  This produces less
5527 instrumentation (and therefore faster execution) and still provides
5528 some protection against outright memory corrupting writes, but allows
5529 erroneously read data to propagate within a program.
5530
5531 @item -fthread-jumps
5532 @opindex fthread-jumps
5533 Perform optimizations where we check to see if a jump branches to a
5534 location where another comparison subsumed by the first is found.  If
5535 so, the first branch is redirected to either the destination of the
5536 second branch or a point immediately following it, depending on whether
5537 the condition is known to be true or false.
5538
5539 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5540
5541 @item -fsplit-wide-types
5542 @opindex fsplit-wide-types
5543 When using a type that occupies multiple registers, such as @code{long
5544 long} on a 32-bit system, split the registers apart and allocate them
5545 independently.  This normally generates better code for those types,
5546 but may make debugging more difficult.
5547
5548 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
5549 @option{-Os}.
5550
5551 @item -fcse-follow-jumps
5552 @opindex fcse-follow-jumps
5553 In common subexpression elimination (CSE), scan through jump instructions
5554 when the target of the jump is not reached by any other path.  For
5555 example, when CSE encounters an @code{if} statement with an
5556 @code{else} clause, CSE will follow the jump when the condition
5557 tested is false.
5558
5559 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5560
5561 @item -fcse-skip-blocks
5562 @opindex fcse-skip-blocks
5563 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
5564 follow jumps which conditionally skip over blocks.  When CSE
5565 encounters a simple @code{if} statement with no else clause,
5566 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
5567 body of the @code{if}.
5568
5569 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5570
5571 @item -frerun-cse-after-loop
5572 @opindex frerun-cse-after-loop
5573 Re-run common subexpression elimination after loop optimizations has been
5574 performed.
5575
5576 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5577
5578 @item -fgcse
5579 @opindex fgcse
5580 Perform a global common subexpression elimination pass.
5581 This pass also performs global constant and copy propagation.
5582
5583 @emph{Note:} When compiling a program using computed gotos, a GCC
5584 extension, you may get better runtime performance if you disable
5585 the global common subexpression elimination pass by adding
5586 @option{-fno-gcse} to the command line.
5587
5588 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5589
5590 @item -fgcse-lm
5591 @opindex fgcse-lm
5592 When @option{-fgcse-lm} is enabled, global common subexpression elimination will
5593 attempt to move loads which are only killed by stores into themselves.  This
5594 allows a loop containing a load/store sequence to be changed to a load outside
5595 the loop, and a copy/store within the loop.
5596
5597 Enabled by default when gcse is enabled.
5598
5599 @item -fgcse-sm
5600 @opindex fgcse-sm
5601 When @option{-fgcse-sm} is enabled, a store motion pass is run after
5602 global common subexpression elimination.  This pass will attempt to move
5603 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
5604 loops containing a load/store sequence can be changed to a load before
5605 the loop and a store after the loop.
5606
5607 Not enabled at any optimization level.
5608
5609 @item -fgcse-las
5610 @opindex fgcse-las
5611 When @option{-fgcse-las} is enabled, the global common subexpression
5612 elimination pass eliminates redundant loads that come after stores to the
5613 same memory location (both partial and full redundancies).
5614
5615 Not enabled at any optimization level.
5616
5617 @item -fgcse-after-reload
5618 @opindex fgcse-after-reload
5619 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
5620 pass is performed after reload.  The purpose of this pass is to cleanup
5621 redundant spilling.
5622
5623 @item -funsafe-loop-optimizations
5624 @opindex funsafe-loop-optimizations
5625 If given, the loop optimizer will assume that loop indices do not
5626 overflow, and that the loops with nontrivial exit condition are not
5627 infinite.  This enables a wider range of loop optimizations even if
5628 the loop optimizer itself cannot prove that these assumptions are valid.
5629 Using @option{-Wunsafe-loop-optimizations}, the compiler will warn you
5630 if it finds this kind of loop.
5631
5632 @item -fcrossjumping
5633 @opindex fcrossjumping
5634 Perform cross-jumping transformation.  This transformation unifies equivalent code and save code size.  The
5635 resulting code may or may not perform better than without cross-jumping.
5636
5637 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5638
5639 @item -fauto-inc-dec
5640 @opindex fauto-inc-dec
5641 Combine increments or decrements of addresses with memory accesses.
5642 This pass is always skipped on architectures that do not have
5643 instructions to support this.  Enabled by default at @option{-O} and
5644 higher on architectures that support this.
5645
5646 @item -fdce
5647 @opindex fdce
5648 Perform dead code elimination (DCE) on RTL@.
5649 Enabled by default at @option{-O} and higher.
5650
5651 @item -fdse
5652 @opindex fdse
5653 Perform dead store elimination (DSE) on RTL@.
5654 Enabled by default at @option{-O} and higher.
5655
5656 @item -fif-conversion
5657 @opindex fif-conversion
5658 Attempt to transform conditional jumps into branch-less equivalents.  This
5659 include use of conditional moves, min, max, set flags and abs instructions, and
5660 some tricks doable by standard arithmetics.  The use of conditional execution
5661 on chips where it is available is controlled by @code{if-conversion2}.
5662
5663 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5664
5665 @item -fif-conversion2
5666 @opindex fif-conversion2
5667 Use conditional execution (where available) to transform conditional jumps into
5668 branch-less equivalents.
5669
5670 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5671
5672 @item -fdelete-null-pointer-checks
5673 @opindex fdelete-null-pointer-checks
5674 Use global dataflow analysis to identify and eliminate useless checks
5675 for null pointers.  The compiler assumes that dereferencing a null
5676 pointer would have halted the program.  If a pointer is checked after
5677 it has already been dereferenced, it cannot be null.
5678
5679 In some environments, this assumption is not true, and programs can
5680 safely dereference null pointers.  Use
5681 @option{-fno-delete-null-pointer-checks} to disable this optimization
5682 for programs which depend on that behavior.
5683
5684 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5685
5686 @item -fexpensive-optimizations
5687 @opindex fexpensive-optimizations
5688 Perform a number of minor optimizations that are relatively expensive.
5689
5690 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5691
5692 @item -foptimize-register-move
5693 @itemx -fregmove
5694 @opindex foptimize-register-move
5695 @opindex fregmove
5696 Attempt to reassign register numbers in move instructions and as
5697 operands of other simple instructions in order to maximize the amount of
5698 register tying.  This is especially helpful on machines with two-operand
5699 instructions.
5700
5701 Note @option{-fregmove} and @option{-foptimize-register-move} are the same
5702 optimization.
5703
5704 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5705
5706 @item -fira
5707 @opindex fira
5708 Use the integrated register allocator (@acronym{IRA}) for register
5709 allocation.  It is a default if @acronym{IRA} has been ported for the
5710 target.
5711
5712 @item -fira-algorithm=@var{algorithm}
5713 Use specified algorithm for the integrated register allocator.  The
5714 @var{algorithm} argument should be one of @code{regional}, @code{CB},
5715 or @code{mixed}.  The second algorithm specifies Chaitin-Briggs
5716 coloring, the first one specifies regional coloring based on
5717 Chaitin-Briggs coloring, and the third one which is the default
5718 specifies a mix of Chaitin-Briggs and regional algorithms where loops
5719 with small register pressure are ignored.  The first algorithm can
5720 give best result for machines with small size and irregular register
5721 set, the second one is faster and generates decent code and the
5722 smallest size code, and the mixed algorithm usually give the best
5723 results in most cases and for most architectures.
5724
5725 @item -fira-coalesce
5726 @opindex fira-coalesce
5727 Do optimistic register coalescing.  This option might be profitable for
5728 architectures with big regular register files.
5729
5730 @item -fno-ira-share-save-slots
5731 @opindex fno-ira-share-save-slots
5732 Switch off sharing stack slots used for saving call used hard
5733 registers living through a call.  Each hard register will get a
5734 separate stack slot and as a result function stack frame will be
5735 bigger.
5736
5737 @item -fno-ira-share-spill-slots
5738 @opindex fno-ira-share-spill-slots
5739 Switch off sharing stack slots allocated for pseudo-registers.  Each
5740 pseudo-register which did not get a hard register will get a separate
5741 stack slot and as a result function stack frame will be bigger.
5742
5743 @item -fira-verbose=@var{n}
5744 @opindex fira-verbose
5745 Set up how verbose dump file for the integrated register allocator
5746 will be.  Default value is 5.  If the value is greater or equal to 10,
5747 the dump file will be stderr as if the value were @var{n} minus 10.
5748
5749 @item -fdelayed-branch
5750 @opindex fdelayed-branch
5751 If supported for the target machine, attempt to reorder instructions
5752 to exploit instruction slots available after delayed branch
5753 instructions.
5754
5755 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5756
5757 @item -fschedule-insns
5758 @opindex fschedule-insns
5759 If supported for the target machine, attempt to reorder instructions to
5760 eliminate execution stalls due to required data being unavailable.  This
5761 helps machines that have slow floating point or memory load instructions
5762 by allowing other instructions to be issued until the result of the load
5763 or floating point instruction is required.
5764
5765 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5766
5767 @item -fschedule-insns2
5768 @opindex fschedule-insns2
5769 Similar to @option{-fschedule-insns}, but requests an additional pass of
5770 instruction scheduling after register allocation has been done.  This is
5771 especially useful on machines with a relatively small number of
5772 registers and where memory load instructions take more than one cycle.
5773
5774 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5775
5776 @item -fno-sched-interblock
5777 @opindex fno-sched-interblock
5778 Don't schedule instructions across basic blocks.  This is normally
5779 enabled by default when scheduling before register allocation, i.e.@:
5780 with @option{-fschedule-insns} or at @option{-O2} or higher.
5781
5782 @item -fno-sched-spec
5783 @opindex fno-sched-spec
5784 Don't allow speculative motion of non-load instructions.  This is normally
5785 enabled by default when scheduling before register allocation, i.e.@:
5786 with @option{-fschedule-insns} or at @option{-O2} or higher.
5787
5788 @item -fsched-spec-load
5789 @opindex fsched-spec-load
5790 Allow speculative motion of some load instructions.  This only makes
5791 sense when scheduling before register allocation, i.e.@: with
5792 @option{-fschedule-insns} or at @option{-O2} or higher.
5793
5794 @item -fsched-spec-load-dangerous
5795 @opindex fsched-spec-load-dangerous
5796 Allow speculative motion of more load instructions.  This only makes
5797 sense when scheduling before register allocation, i.e.@: with
5798 @option{-fschedule-insns} or at @option{-O2} or higher.
5799
5800 @item -fsched-stalled-insns
5801 @itemx -fsched-stalled-insns=@var{n}
5802 @opindex fsched-stalled-insns
5803 Define how many insns (if any) can be moved prematurely from the queue
5804 of stalled insns into the ready list, during the second scheduling pass.
5805 @option{-fno-sched-stalled-insns} means that no insns will be moved
5806 prematurely, @option{-fsched-stalled-insns=0} means there is no limit
5807 on how many queued insns can be moved prematurely.
5808 @option{-fsched-stalled-insns} without a value is equivalent to
5809 @option{-fsched-stalled-insns=1}.
5810
5811 @item -fsched-stalled-insns-dep
5812 @itemx -fsched-stalled-insns-dep=@var{n}
5813 @opindex fsched-stalled-insns-dep
5814 Define how many insn groups (cycles) will be examined for a dependency
5815 on a stalled insn that is candidate for premature removal from the queue
5816 of stalled insns.  This has an effect only during the second scheduling pass,
5817 and only if @option{-fsched-stalled-insns} is used.
5818 @option{-fno-sched-stalled-insns-dep} is equivalent to
5819 @option{-fsched-stalled-insns-dep=0}.
5820 @option{-fsched-stalled-insns-dep} without a value is equivalent to
5821 @option{-fsched-stalled-insns-dep=1}.
5822
5823 @item -fsched2-use-superblocks
5824 @opindex fsched2-use-superblocks
5825 When scheduling after register allocation, do use superblock scheduling
5826 algorithm.  Superblock scheduling allows motion across basic block boundaries
5827 resulting on faster schedules.  This option is experimental, as not all machine
5828 descriptions used by GCC model the CPU closely enough to avoid unreliable
5829 results from the algorithm.
5830
5831 This only makes sense when scheduling after register allocation, i.e.@: with
5832 @option{-fschedule-insns2} or at @option{-O2} or higher.
5833
5834 @item -fsched2-use-traces
5835 @opindex fsched2-use-traces
5836 Use @option{-fsched2-use-superblocks} algorithm when scheduling after register
5837 allocation and additionally perform code duplication in order to increase the
5838 size of superblocks using tracer pass.  See @option{-ftracer} for details on
5839 trace formation.
5840
5841 This mode should produce faster but significantly longer programs.  Also
5842 without @option{-fbranch-probabilities} the traces constructed may not
5843 match the reality and hurt the performance.  This only makes
5844 sense when scheduling after register allocation, i.e.@: with
5845 @option{-fschedule-insns2} or at @option{-O2} or higher.
5846
5847 @item -fsee
5848 @opindex fsee
5849 Eliminate redundant sign extension instructions and move the non-redundant
5850 ones to optimal placement using lazy code motion (LCM).
5851
5852 @item -freschedule-modulo-scheduled-loops
5853 @opindex freschedule-modulo-scheduled-loops
5854 The modulo scheduling comes before the traditional scheduling, if a loop
5855 was modulo scheduled we may want to prevent the later scheduling passes
5856 from changing its schedule, we use this option to control that.
5857
5858 @item -fselective-scheduling
5859 @opindex fselective-scheduling
5860 Schedule instructions using selective scheduling algorithm.  Selective
5861 scheduling runs instead of the first scheduler pass.
5862
5863 @item -fselective-scheduling2
5864 @opindex fselective-scheduling2
5865 Schedule instructions using selective scheduling algorithm.  Selective
5866 scheduling runs instead of the second scheduler pass.
5867
5868 @item -fsel-sched-pipelining
5869 @opindex fsel-sched-pipelining
5870 Enable software pipelining of innermost loops during selective scheduling.  
5871 This option has no effect until one of @option{-fselective-scheduling} or 
5872 @option{-fselective-scheduling2} is turned on.
5873
5874 @item -fsel-sched-pipelining-outer-loops
5875 @opindex fsel-sched-pipelining-outer-loops
5876 When pipelining loops during selective scheduling, also pipeline outer loops.
5877 This option has no effect until @option{-fsel-sched-pipelining} is turned on.
5878
5879 @item -fcaller-saves
5880 @opindex fcaller-saves
5881 Enable values to be allocated in registers that will be clobbered by
5882 function calls, by emitting extra instructions to save and restore the
5883 registers around such calls.  Such allocation is done only when it
5884 seems to result in better code than would otherwise be produced.
5885
5886 This option is always enabled by default on certain machines, usually
5887 those which have no call-preserved registers to use instead.
5888
5889 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5890
5891 @item -fconserve-stack
5892 @opindex fconserve-stack
5893 Attempt to minimize stack usage.  The compiler will attempt to use less
5894 stack space, even if that makes the program slower.  This option
5895 implies setting the @option{large-stack-frame} parameter to 100
5896 and the @option{large-stack-frame-growth} parameter to 400.
5897
5898 @item -ftree-reassoc
5899 @opindex ftree-reassoc
5900 Perform reassociation on trees.  This flag is enabled by default
5901 at @option{-O} and higher.
5902
5903 @item -ftree-pre
5904 @opindex ftree-pre
5905 Perform partial redundancy elimination (PRE) on trees.  This flag is
5906 enabled by default at @option{-O2} and @option{-O3}.
5907
5908 @item -ftree-fre
5909 @opindex ftree-fre
5910 Perform full redundancy elimination (FRE) on trees.  The difference
5911 between FRE and PRE is that FRE only considers expressions
5912 that are computed on all paths leading to the redundant computation.
5913 This analysis is faster than PRE, though it exposes fewer redundancies.
5914 This flag is enabled by default at @option{-O} and higher.
5915
5916 @item -ftree-copy-prop
5917 @opindex ftree-copy-prop
5918 Perform copy propagation on trees.  This pass eliminates unnecessary
5919 copy operations.  This flag is enabled by default at @option{-O} and
5920 higher.
5921
5922 @item -fipa-pure-const
5923 @opindex fipa-pure-const
5924 Discover which functions are pure or constant.
5925 Enabled by default at @option{-O} and higher.
5926
5927 @item -fipa-reference
5928 @opindex fipa-reference
5929 Discover which static variables do not escape cannot escape the
5930 compilation unit.
5931 Enabled by default at @option{-O} and higher.
5932
5933 @item -fipa-struct-reorg
5934 @opindex fipa-struct-reorg
5935 Perform structure reorganization optimization, that change C-like structures 
5936 layout in order to better utilize spatial locality.  This transformation is 
5937 affective for programs containing arrays of structures.  Available in two 
5938 compilation modes: profile-based (enabled with @option{-fprofile-generate})
5939 or static (which uses built-in heuristics).  Require @option{-fipa-type-escape}
5940 to provide the safety of this transformation.  It works only in whole program
5941 mode, so it requires @option{-fwhole-program} and @option{-combine} to be
5942 enabled.  Structures considered @samp{cold} by this transformation are not
5943 affected (see @option{--param struct-reorg-cold-struct-ratio=@var{value}}).
5944
5945 With this flag, the program debug info reflects a new structure layout.
5946
5947 @item -fipa-pta
5948 @opindex fipa-pta
5949 Perform interprocedural pointer analysis.  This option is experimental
5950 and does not affect generated code.
5951
5952 @item -fipa-cp
5953 @opindex fipa-cp
5954 Perform interprocedural constant propagation.
5955 This optimization analyzes the program to determine when values passed
5956 to functions are constants and then optimizes accordingly.  
5957 This optimization can substantially increase performance
5958 if the application has constants passed to functions.
5959 This flag is enabled by default at @option{-O2}, @option{-Os} and @option{-O3}.
5960
5961 @item -fipa-cp-clone
5962 @opindex fipa-cp-clone
5963 Perform function cloning to make interprocedural constant propagation stronger.
5964 When enabled, interprocedural constant propagation will perform function cloning
5965 when externally visible function can be called with constant arguments.
5966 Because this optimization can create multiple copies of functions,
5967 it may significantly increase code size
5968 (see @option{--param ipcp-unit-growth=@var{value}}).
5969 This flag is enabled by default at @option{-O3}.
5970
5971 @item -fipa-matrix-reorg
5972 @opindex fipa-matrix-reorg
5973 Perform matrix flattening and transposing.
5974 Matrix flattening tries to replace a m-dimensional matrix 
5975 with its equivalent n-dimensional matrix, where n < m.
5976 This reduces the level of indirection needed for accessing the elements
5977 of the matrix. The second optimization is matrix transposing that
5978 attemps to change the order of the matrix's dimensions in order to 
5979 improve cache locality.
5980 Both optimizations need fwhole-program flag. 
5981 Transposing is enabled only if profiling information is avaliable.
5982
5983
5984 @item -ftree-sink
5985 @opindex ftree-sink
5986 Perform forward store motion  on trees.  This flag is
5987 enabled by default at @option{-O} and higher.
5988
5989 @item -ftree-ccp
5990 @opindex ftree-ccp
5991 Perform sparse conditional constant propagation (CCP) on trees.  This
5992 pass only operates on local scalar variables and is enabled by default
5993 at @option{-O} and higher.
5994
5995 @item -ftree-switch-conversion
5996 Perform conversion of simple initializations in a switch to
5997 initializations from a scalar array.  This flag is enabled by default
5998 at @option{-O2} and higher.
5999
6000 @item -ftree-dce
6001 @opindex ftree-dce
6002 Perform dead code elimination (DCE) on trees.  This flag is enabled by
6003 default at @option{-O} and higher.
6004
6005 @item -ftree-builtin-call-dce
6006 @opindex ftree-builtin-call-dce
6007 Perform conditional dead code elimination (DCE) for calls to builtin functions 
6008 that may set @code{errno} but are otherwise side-effect free.  This flag is 
6009 enabled by default at @option{-O2} and higher if @option{-Os} is not also 
6010 specified.
6011
6012 @item -ftree-dominator-opts
6013 @opindex ftree-dominator-opts
6014 Perform a variety of simple scalar cleanups (constant/copy
6015 propagation, redundancy elimination, range propagation and expression
6016 simplification) based on a dominator tree traversal.  This also
6017 performs jump threading (to reduce jumps to jumps). This flag is
6018 enabled by default at @option{-O} and higher.
6019
6020 @item -ftree-dse
6021 @opindex ftree-dse
6022 Perform dead store elimination (DSE) on trees.  A dead store is a store into
6023 a memory location which will later be overwritten by another store without
6024 any intervening loads.  In this case the earlier store can be deleted.  This
6025 flag is enabled by default at @option{-O} and higher.
6026
6027 @item -ftree-ch
6028 @opindex ftree-ch
6029 Perform loop header copying on trees.  This is beneficial since it increases
6030 effectiveness of code motion optimizations.  It also saves one jump.  This flag
6031 is enabled by default at @option{-O} and higher.  It is not enabled
6032 for @option{-Os}, since it usually increases code size.
6033
6034 @item -ftree-loop-optimize
6035 @opindex ftree-loop-optimize
6036 Perform loop optimizations on trees.  This flag is enabled by default
6037 at @option{-O} and higher.
6038
6039 @item -ftree-loop-linear
6040 @opindex ftree-loop-linear
6041 Perform linear loop transformations on tree.  This flag can improve cache
6042 performance and allow further loop optimizations to take place.
6043
6044 @item -floop-interchange
6045 Perform loop interchange transformations on loops.  Interchanging two
6046 nested loops switches the inner and outer loops.  For example, given a
6047 loop like:
6048 @smallexample
6049 DO J = 1, M
6050   DO I = 1, N
6051     A(J, I) = A(J, I) * C
6052   ENDDO
6053 ENDDO
6054 @end smallexample
6055 loop interchange will transform the loop as if the user had written:
6056 @smallexample
6057 DO I = 1, N
6058   DO J = 1, M
6059     A(J, I) = A(J, I) * C
6060   ENDDO
6061 ENDDO
6062 @end smallexample
6063 which can be beneficial when @code{N} is larger than the caches,
6064 because in Fortran, the elements of an array are stored in memory
6065 contiguously by column, and the original loop iterates over rows,
6066 potentially creating at each access a cache miss.  This optimization
6067 applies to all the languages supported by GCC and is not limited to
6068 Fortran.
6069
6070 @item -floop-strip-mine
6071 Perform loop strip mining transformations on loops.  Strip mining
6072 splits a loop into two nested loops.  The outer loop has strides 
6073 equal to the strip size and the inner loop has strides of the 
6074 original loop within a strip.  For example, given a loop like:
6075 @smallexample
6076 DO I = 1, N
6077   A(I) = A(I) + C
6078 ENDDO
6079 @end smallexample
6080 loop strip mining will transform the loop as if the user had written:
6081 @smallexample
6082 DO II = 1, N, 4
6083   DO I = II, min (II + 4, N)
6084     A(I) = A(I) + C
6085   ENDDO
6086 ENDDO
6087 @end smallexample
6088 This optimization applies to all the languages supported by GCC and is
6089 not limited to Fortran.
6090
6091 @item -floop-block
6092 Perform loop blocking transformations on loops.  Blocking strip mines
6093 each loop in the loop nest such that the memory accesses of the
6094 element loops fit inside caches.  For example, given a loop like:
6095 @smallexample
6096 DO I = 1, N
6097   DO J = 1, M
6098     A(J, I) = B(I) + C(J)
6099   ENDDO
6100 ENDDO
6101 @end smallexample
6102 loop blocking will transform the loop as if the user had written:
6103 @smallexample
6104 DO II = 1, N, 64
6105   DO JJ = 1, M, 64
6106     DO I = II, min (II + 64, N)
6107       DO J = JJ, min (JJ + 64, M)
6108         A(J, I) = B(I) + C(J)
6109       ENDDO
6110     ENDDO
6111   ENDDO
6112 ENDDO
6113 @end smallexample
6114 which can be beneficial when @code{M} is larger than the caches,
6115 because the innermost loop will iterate over a smaller amount of data
6116 that can be kept in the caches.  This optimization applies to all the
6117 languages supported by GCC and is not limited to Fortran.
6118
6119 @item -fcheck-data-deps
6120 @opindex fcheck-data-deps
6121 Compare the results of several data dependence analyzers.  This option
6122 is used for debugging the data dependence analyzers.
6123
6124 @item -ftree-loop-distribution
6125 Perform loop distribution.  This flag can improve cache performance on
6126 big loop bodies and allow further loop optimizations, like
6127 parallelization or vectorization, to take place.  For example, the loop
6128 @smallexample
6129 DO I = 1, N
6130   A(I) = B(I) + C
6131   D(I) = E(I) * F
6132 ENDDO
6133 @end smallexample
6134 is transformed to
6135 @smallexample
6136 DO I = 1, N
6137    A(I) = B(I) + C
6138 ENDDO
6139 DO I = 1, N
6140    D(I) = E(I) * F
6141 ENDDO
6142 @end smallexample
6143
6144 @item -ftree-loop-im
6145 @opindex ftree-loop-im
6146 Perform loop invariant motion on trees.  This pass moves only invariants that
6147 would be hard to handle at RTL level (function calls, operations that expand to
6148 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
6149 operands of conditions that are invariant out of the loop, so that we can use
6150 just trivial invariantness analysis in loop unswitching.  The pass also includes
6151 store motion.
6152
6153 @item -ftree-loop-ivcanon
6154 @opindex ftree-loop-ivcanon
6155 Create a canonical counter for number of iterations in the loop for that
6156 determining number of iterations requires complicated analysis.  Later
6157 optimizations then may determine the number easily.  Useful especially
6158 in connection with unrolling.
6159
6160 @item -fivopts
6161 @opindex fivopts
6162 Perform induction variable optimizations (strength reduction, induction
6163 variable merging and induction variable elimination) on trees.
6164
6165 @item -ftree-parallelize-loops=n
6166 @opindex ftree-parallelize-loops
6167 Parallelize loops, i.e., split their iteration space to run in n threads.
6168 This is only possible for loops whose iterations are independent
6169 and can be arbitrarily reordered.  The optimization is only
6170 profitable on multiprocessor machines, for loops that are CPU-intensive,
6171 rather than constrained e.g.@: by memory bandwidth.  This option
6172 implies @option{-pthread}, and thus is only supported on targets
6173 that have support for @option{-pthread}.
6174
6175 @item -ftree-sra
6176 @opindex ftree-sra
6177 Perform scalar replacement of aggregates.  This pass replaces structure
6178 references with scalars to prevent committing structures to memory too
6179 early.  This flag is enabled by default at @option{-O} and higher.
6180
6181 @item -ftree-copyrename
6182 @opindex ftree-copyrename
6183 Perform copy renaming on trees.  This pass attempts to rename compiler
6184 temporaries to other variables at copy locations, usually resulting in
6185 variable names which more closely resemble the original variables.  This flag
6186 is enabled by default at @option{-O} and higher.
6187
6188 @item -ftree-ter
6189 @opindex ftree-ter
6190 Perform temporary expression replacement during the SSA->normal phase.  Single
6191 use/single def temporaries are replaced at their use location with their
6192 defining expression.  This results in non-GIMPLE code, but gives the expanders
6193 much more complex trees to work on resulting in better RTL generation.  This is
6194 enabled by default at @option{-O} and higher.
6195
6196 @item -ftree-vectorize
6197 @opindex ftree-vectorize
6198 Perform loop vectorization on trees. This flag is enabled by default at
6199 @option{-O3}.
6200
6201 @item -ftree-vect-loop-version
6202 @opindex ftree-vect-loop-version
6203 Perform loop versioning when doing loop vectorization on trees.  When a loop
6204 appears to be vectorizable except that data alignment or data dependence cannot
6205 be determined at compile time then vectorized and non-vectorized versions of
6206 the loop are generated along with runtime checks for alignment or dependence
6207 to control which version is executed.  This option is enabled by default
6208 except at level @option{-Os} where it is disabled.
6209
6210 @item -fvect-cost-model
6211 @opindex fvect-cost-model
6212 Enable cost model for vectorization.
6213
6214 @item -ftree-vrp
6215 @opindex ftree-vrp
6216 Perform Value Range Propagation on trees.  This is similar to the
6217 constant propagation pass, but instead of values, ranges of values are
6218 propagated.  This allows the optimizers to remove unnecessary range
6219 checks like array bound checks and null pointer checks.  This is
6220 enabled by default at @option{-O2} and higher.  Null pointer check
6221 elimination is only done if @option{-fdelete-null-pointer-checks} is
6222 enabled.
6223
6224 @item -ftracer
6225 @opindex ftracer
6226 Perform tail duplication to enlarge superblock size.  This transformation
6227 simplifies the control flow of the function allowing other optimizations to do
6228 better job.
6229
6230 @item -funroll-loops
6231 @opindex funroll-loops
6232 Unroll loops whose number of iterations can be determined at compile
6233 time or upon entry to the loop.  @option{-funroll-loops} implies
6234 @option{-frerun-cse-after-loop}.  This option makes code larger,
6235 and may or may not make it run faster.
6236
6237 @item -funroll-all-loops
6238 @opindex funroll-all-loops
6239 Unroll all loops, even if their number of iterations is uncertain when
6240 the loop is entered.  This usually makes programs run more slowly.
6241 @option{-funroll-all-loops} implies the same options as
6242 @option{-funroll-loops},
6243
6244 @item -fsplit-ivs-in-unroller
6245 @opindex fsplit-ivs-in-unroller
6246 Enables expressing of values of induction variables in later iterations
6247 of the unrolled loop using the value in the first iteration.  This breaks
6248 long dependency chains, thus improving efficiency of the scheduling passes.
6249
6250 Combination of @option{-fweb} and CSE is often sufficient to obtain the
6251 same effect.  However in cases the loop body is more complicated than
6252 a single basic block, this is not reliable.  It also does not work at all
6253 on some of the architectures due to restrictions in the CSE pass.
6254
6255 This optimization is enabled by default.
6256
6257 @item -fvariable-expansion-in-unroller
6258 @opindex fvariable-expansion-in-unroller
6259 With this option, the compiler will create multiple copies of some
6260 local variables when unrolling a loop which can result in superior code.
6261
6262 @item -fpredictive-commoning
6263 @opindex fpredictive-commoning
6264 Perform predictive commoning optimization, i.e., reusing computations
6265 (especially memory loads and stores) performed in previous
6266 iterations of loops.
6267
6268 This option is enabled at level @option{-O3}.
6269
6270 @item -fprefetch-loop-arrays
6271 @opindex fprefetch-loop-arrays
6272 If supported by the target machine, generate instructions to prefetch
6273 memory to improve the performance of loops that access large arrays.
6274
6275 This option may generate better or worse code; results are highly
6276 dependent on the structure of loops within the source code.
6277
6278 Disabled at level @option{-Os}.
6279
6280 @item -fno-peephole
6281 @itemx -fno-peephole2
6282 @opindex fno-peephole
6283 @opindex fno-peephole2
6284 Disable any machine-specific peephole optimizations.  The difference
6285 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
6286 are implemented in the compiler; some targets use one, some use the
6287 other, a few use both.
6288
6289 @option{-fpeephole} is enabled by default.
6290 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6291
6292 @item -fno-guess-branch-probability
6293 @opindex fno-guess-branch-probability
6294 Do not guess branch probabilities using heuristics.
6295
6296 GCC will use heuristics to guess branch probabilities if they are
6297 not provided by profiling feedback (@option{-fprofile-arcs}).  These
6298 heuristics are based on the control flow graph.  If some branch probabilities
6299 are specified by @samp{__builtin_expect}, then the heuristics will be
6300 used to guess branch probabilities for the rest of the control flow graph,
6301 taking the @samp{__builtin_expect} info into account.  The interactions
6302 between the heuristics and @samp{__builtin_expect} can be complex, and in
6303 some cases, it may be useful to disable the heuristics so that the effects
6304 of @samp{__builtin_expect} are easier to understand.
6305
6306 The default is @option{-fguess-branch-probability} at levels
6307 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6308
6309 @item -freorder-blocks
6310 @opindex freorder-blocks
6311 Reorder basic blocks in the compiled function in order to reduce number of
6312 taken branches and improve code locality.
6313
6314 Enabled at levels @option{-O2}, @option{-O3}.
6315
6316 @item -freorder-blocks-and-partition
6317 @opindex freorder-blocks-and-partition
6318 In addition to reordering basic blocks in the compiled function, in order
6319 to reduce number of taken branches, partitions hot and cold basic blocks
6320 into separate sections of the assembly and .o files, to improve
6321 paging and cache locality performance.
6322
6323 This optimization is automatically turned off in the presence of
6324 exception handling, for linkonce sections, for functions with a user-defined
6325 section attribute and on any architecture that does not support named
6326 sections.
6327
6328 @item -freorder-functions
6329 @opindex freorder-functions
6330 Reorder functions in the object file in order to
6331 improve code locality.  This is implemented by using special
6332 subsections @code{.text.hot} for most frequently executed functions and
6333 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
6334 the linker so object file format must support named sections and linker must
6335 place them in a reasonable way.
6336
6337 Also profile feedback must be available in to make this option effective.  See
6338 @option{-fprofile-arcs} for details.
6339
6340 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6341
6342 @item -fstrict-aliasing
6343 @opindex fstrict-aliasing
6344 Allows the compiler to assume the strictest aliasing rules applicable to
6345 the language being compiled.  For C (and C++), this activates
6346 optimizations based on the type of expressions.  In particular, an
6347 object of one type is assumed never to reside at the same address as an
6348 object of a different type, unless the types are almost the same.  For
6349 example, an @code{unsigned int} can alias an @code{int}, but not a
6350 @code{void*} or a @code{double}.  A character type may alias any other
6351 type.
6352
6353 @anchor{Type-punning}Pay special attention to code like this:
6354 @smallexample
6355 union a_union @{
6356   int i;
6357   double d;
6358 @};
6359
6360 int f() @{
6361   a_union t;
6362   t.d = 3.0;
6363   return t.i;
6364 @}
6365 @end smallexample
6366 The practice of reading from a different union member than the one most
6367 recently written to (called ``type-punning'') is common.  Even with
6368 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
6369 is accessed through the union type.  So, the code above will work as
6370 expected.  @xref{Structures unions enumerations and bit-fields
6371 implementation}.  However, this code might not:
6372 @smallexample
6373 int f() @{
6374   a_union t;
6375   int* ip;
6376   t.d = 3.0;
6377   ip = &t.i;
6378   return *ip;
6379 @}
6380 @end smallexample
6381
6382 Similarly, access by taking the address, casting the resulting pointer
6383 and dereferencing the result has undefined behavior, even if the cast
6384 uses a union type, e.g.:
6385 @smallexample
6386 int f() @{
6387   double d = 3.0;
6388   return ((union a_union *) &d)->i;
6389 @}
6390 @end smallexample
6391
6392 The @option{-fstrict-aliasing} option is enabled at levels
6393 @option{-O2}, @option{-O3}, @option{-Os}.
6394
6395 @item -fstrict-overflow
6396 @opindex fstrict-overflow
6397 Allow the compiler to assume strict signed overflow rules, depending
6398 on the language being compiled.  For C (and C++) this means that
6399 overflow when doing arithmetic with signed numbers is undefined, which
6400 means that the compiler may assume that it will not happen.  This
6401 permits various optimizations.  For example, the compiler will assume
6402 that an expression like @code{i + 10 > i} will always be true for
6403 signed @code{i}.  This assumption is only valid if signed overflow is
6404 undefined, as the expression is false if @code{i + 10} overflows when
6405 using twos complement arithmetic.  When this option is in effect any
6406 attempt to determine whether an operation on signed numbers will
6407 overflow must be written carefully to not actually involve overflow.
6408
6409 This option also allows the compiler to assume strict pointer
6410 semantics: given a pointer to an object, if adding an offset to that
6411 pointer does not produce a pointer to the same object, the addition is
6412 undefined.  This permits the compiler to conclude that @code{p + u >
6413 p} is always true for a pointer @code{p} and unsigned integer
6414 @code{u}.  This assumption is only valid because pointer wraparound is
6415 undefined, as the expression is false if @code{p + u} overflows using
6416 twos complement arithmetic.
6417
6418 See also the @option{-fwrapv} option.  Using @option{-fwrapv} means
6419 that integer signed overflow is fully defined: it wraps.  When
6420 @option{-fwrapv} is used, there is no difference between
6421 @option{-fstrict-overflow} and @option{-fno-strict-overflow} for
6422 integers.  With @option{-fwrapv} certain types of overflow are
6423 permitted.  For example, if the compiler gets an overflow when doing
6424 arithmetic on constants, the overflowed value can still be used with
6425 @option{-fwrapv}, but not otherwise.
6426
6427 The @option{-fstrict-overflow} option is enabled at levels
6428 @option{-O2}, @option{-O3}, @option{-Os}.
6429
6430 @item -falign-functions
6431 @itemx -falign-functions=@var{n}
6432 @opindex falign-functions
6433 Align the start of functions to the next power-of-two greater than
6434 @var{n}, skipping up to @var{n} bytes.  For instance,
6435 @option{-falign-functions=32} aligns functions to the next 32-byte
6436 boundary, but @option{-falign-functions=24} would align to the next
6437 32-byte boundary only if this can be done by skipping 23 bytes or less.
6438
6439 @option{-fno-align-functions} and @option{-falign-functions=1} are
6440 equivalent and mean that functions will not be aligned.
6441
6442 Some assemblers only support this flag when @var{n} is a power of two;
6443 in that case, it is rounded up.
6444
6445 If @var{n} is not specified or is zero, use a machine-dependent default.
6446
6447 Enabled at levels @option{-O2}, @option{-O3}.
6448
6449 @item -falign-labels
6450 @itemx -falign-labels=@var{n}
6451 @opindex falign-labels
6452 Align all branch targets to a power-of-two boundary, skipping up to
6453 @var{n} bytes like @option{-falign-functions}.  This option can easily
6454 make code slower, because it must insert dummy operations for when the
6455 branch target is reached in the usual flow of the code.
6456
6457 @option{-fno-align-labels} and @option{-falign-labels=1} are
6458 equivalent and mean that labels will not be aligned.
6459
6460 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
6461 are greater than this value, then their values are used instead.
6462
6463 If @var{n} is not specified or is zero, use a machine-dependent default
6464 which is very likely to be @samp{1}, meaning no alignment.
6465
6466 Enabled at levels @option{-O2}, @option{-O3}.
6467
6468 @item -falign-loops
6469 @itemx -falign-loops=@var{n}
6470 @opindex falign-loops
6471 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
6472 like @option{-falign-functions}.  The hope is that the loop will be
6473 executed many times, which will make up for any execution of the dummy
6474 operations.
6475
6476 @option{-fno-align-loops} and @option{-falign-loops=1} are
6477 equivalent and mean that loops will not be aligned.
6478
6479 If @var{n} is not specified or is zero, use a machine-dependent default.
6480
6481 Enabled at levels @option{-O2}, @option{-O3}.
6482
6483 @item -falign-jumps
6484 @itemx -falign-jumps=@var{n}
6485 @opindex falign-jumps
6486 Align branch targets to a power-of-two boundary, for branch targets
6487 where the targets can only be reached by jumping, skipping up to @var{n}
6488 bytes like @option{-falign-functions}.  In this case, no dummy operations
6489 need be executed.
6490
6491 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
6492 equivalent and mean that loops will not be aligned.
6493
6494 If @var{n} is not specified or is zero, use a machine-dependent default.
6495
6496 Enabled at levels @option{-O2}, @option{-O3}.
6497
6498 @item -funit-at-a-time
6499 @opindex funit-at-a-time
6500 This option is left for compatibility reasons. @option{-funit-at-a-time}
6501 has no effect, while @option{-fno-unit-at-a-time} implies
6502 @option{-fno-toplevel-reorder} and @option{-fno-section-anchors}.
6503
6504 Enabled by default.
6505
6506 @item -fno-toplevel-reorder
6507 @opindex fno-toplevel-reorder
6508 Do not reorder top-level functions, variables, and @code{asm}
6509 statements.  Output them in the same order that they appear in the
6510 input file.  When this option is used, unreferenced static variables
6511 will not be removed.  This option is intended to support existing code
6512 which relies on a particular ordering.  For new code, it is better to
6513 use attributes.
6514
6515 Enabled at level @option{-O0}.  When disabled explicitly, it also imply
6516 @option{-fno-section-anchors} that is otherwise enabled at @option{-O0} on some
6517 targets.
6518
6519 @item -fweb
6520 @opindex fweb
6521 Constructs webs as commonly used for register allocation purposes and assign
6522 each web individual pseudo register.  This allows the register allocation pass
6523 to operate on pseudos directly, but also strengthens several other optimization
6524 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
6525 however, make debugging impossible, since variables will no longer stay in a
6526 ``home register''.
6527
6528 Enabled by default with @option{-funroll-loops}.
6529
6530 @item -fwhole-program
6531 @opindex fwhole-program
6532 Assume that the current compilation unit represents whole program being
6533 compiled.  All public functions and variables with the exception of @code{main}
6534 and those merged by attribute @code{externally_visible} become static functions
6535 and in a affect gets more aggressively optimized by interprocedural optimizers.
6536 While this option is equivalent to proper use of @code{static} keyword for
6537 programs consisting of single file, in combination with option
6538 @option{--combine} this flag can be used to compile most of smaller scale C
6539 programs since the functions and variables become local for the whole combined
6540 compilation unit, not for the single source file itself.
6541
6542 This option is not supported for Fortran programs.
6543
6544 @item -fcprop-registers
6545 @opindex fcprop-registers
6546 After register allocation and post-register allocation instruction splitting,
6547 we perform a copy-propagation pass to try to reduce scheduling dependencies
6548 and occasionally eliminate the copy.
6549
6550 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6551
6552 @item -fprofile-correction
6553 @opindex fprofile-correction
6554 Profiles collected using an instrumented binary for multi-threaded programs may
6555 be inconsistent due to missed counter updates. When this option is specified,
6556 GCC will use heuristics to correct or smooth out such inconsistencies. By
6557 default, GCC will emit an error message when an inconsistent profile is detected.
6558
6559 @item -fprofile-dir=@var{path}
6560 @opindex fprofile-dir
6561
6562 Set the directory to search the profile data files in to @var{path}.
6563 This option affects only the profile data generated by
6564 @option{-fprofile-generate}, @option{-ftest-coverage}, @option{-fprofile-arcs}
6565 and used by @option{-fprofile-use} and @option{-fbranch-probabilities} 
6566 and its related options.
6567 By default, GCC will use the current directory as @var{path}
6568 thus the profile data file will appear in the same directory as the object file.
6569
6570 @item -fprofile-generate
6571 @itemx -fprofile-generate=@var{path}
6572 @opindex fprofile-generate
6573
6574 Enable options usually used for instrumenting application to produce
6575 profile useful for later recompilation with profile feedback based
6576 optimization.  You must use @option{-fprofile-generate} both when
6577 compiling and when linking your program.
6578
6579 The following options are enabled: @code{-fprofile-arcs}, @code{-fprofile-values}, @code{-fvpt}.
6580
6581 If @var{path} is specified, GCC will look at the @var{path} to find
6582 the profile feeedback data files. See @option{-fprofile-dir}.
6583
6584 @item -fprofile-use
6585 @itemx -fprofile-use=@var{path}
6586 @opindex fprofile-use
6587 Enable profile feedback directed optimizations, and optimizations
6588 generally profitable only with profile feedback available.
6589
6590 The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt},
6591 @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}
6592
6593 By default, GCC emits an error message if the feedback profiles do not
6594 match the source code.  This error can be turned into a warning by using
6595 @option{-Wcoverage-mismatch}.  Note this may result in poorly optimized
6596 code.
6597
6598 If @var{path} is specified, GCC will look at the @var{path} to find
6599 the profile feedback data files. See @option{-fprofile-dir}.
6600 @end table
6601
6602 The following options control compiler behavior regarding floating
6603 point arithmetic.  These options trade off between speed and
6604 correctness.  All must be specifically enabled.
6605
6606 @table @gcctabopt
6607 @item -ffloat-store
6608 @opindex ffloat-store
6609 Do not store floating point variables in registers, and inhibit other
6610 options that might change whether a floating point value is taken from a
6611 register or memory.
6612
6613 @cindex floating point precision
6614 This option prevents undesirable excess precision on machines such as
6615 the 68000 where the floating registers (of the 68881) keep more
6616 precision than a @code{double} is supposed to have.  Similarly for the
6617 x86 architecture.  For most programs, the excess precision does only
6618 good, but a few programs rely on the precise definition of IEEE floating
6619 point.  Use @option{-ffloat-store} for such programs, after modifying
6620 them to store all pertinent intermediate computations into variables.
6621
6622 @item -ffast-math
6623 @opindex ffast-math
6624 Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations},
6625 @option{-ffinite-math-only}, @option{-fno-rounding-math},
6626 @option{-fno-signaling-nans} and @option{-fcx-limited-range}.
6627
6628 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
6629
6630 This option is not turned on by any @option{-O} option since
6631 it can result in incorrect output for programs which depend on
6632 an exact implementation of IEEE or ISO rules/specifications for
6633 math functions. It may, however, yield faster code for programs
6634 that do not require the guarantees of these specifications.
6635
6636 @item -fno-math-errno
6637 @opindex fno-math-errno
6638 Do not set ERRNO after calling math functions that are executed
6639 with a single instruction, e.g., sqrt.  A program that relies on
6640 IEEE exceptions for math error handling may want to use this flag
6641 for speed while maintaining IEEE arithmetic compatibility.
6642
6643 This option is not turned on by any @option{-O} option since
6644 it can result in incorrect output for programs which depend on
6645 an exact implementation of IEEE or ISO rules/specifications for
6646 math functions. It may, however, yield faster code for programs
6647 that do not require the guarantees of these specifications.
6648
6649 The default is @option{-fmath-errno}.
6650
6651 On Darwin systems, the math library never sets @code{errno}.  There is
6652 therefore no reason for the compiler to consider the possibility that
6653 it might, and @option{-fno-math-errno} is the default.
6654
6655 @item -funsafe-math-optimizations
6656 @opindex funsafe-math-optimizations
6657
6658 Allow optimizations for floating-point arithmetic that (a) assume
6659 that arguments and results are valid and (b) may violate IEEE or
6660 ANSI standards.  When used at link-time, it may include libraries
6661 or startup files that change the default FPU control word or other
6662 similar optimizations.
6663
6664 This option is not turned on by any @option{-O} option since
6665 it can result in incorrect output for programs which depend on
6666 an exact implementation of IEEE or ISO rules/specifications for
6667 math functions. It may, however, yield faster code for programs
6668 that do not require the guarantees of these specifications.
6669 Enables @option{-fno-signed-zeros}, @option{-fno-trapping-math},
6670 @option{-fassociative-math} and @option{-freciprocal-math}.
6671
6672 The default is @option{-fno-unsafe-math-optimizations}.
6673
6674 @item -fassociative-math
6675 @opindex fassociative-math
6676
6677 Allow re-association of operands in series of floating-point operations.
6678 This violates the ISO C and C++ language standard by possibly changing
6679 computation result.  NOTE: re-ordering may change the sign of zero as
6680 well as ignore NaNs and inhibit or create underflow or overflow (and
6681 thus cannot be used on a code which relies on rounding behavior like
6682 @code{(x + 2**52) - 2**52)}.  May also reorder floating-point comparisons
6683 and thus may not be used when ordered comparisons are required.
6684 This option requires that both @option{-fno-signed-zeros} and
6685 @option{-fno-trapping-math} be in effect.  Moreover, it doesn't make
6686 much sense with @option{-frounding-math}.
6687
6688 The default is @option{-fno-associative-math}.
6689
6690 @item -freciprocal-math
6691 @opindex freciprocal-math
6692
6693 Allow the reciprocal of a value to be used instead of dividing by
6694 the value if this enables optimizations.  For example @code{x / y}
6695 can be replaced with @code{x * (1/y)} which is useful if @code{(1/y)}
6696 is subject to common subexpression elimination.  Note that this loses
6697 precision and increases the number of flops operating on the value.
6698
6699 The default is @option{-fno-reciprocal-math}.
6700
6701 @item -ffinite-math-only
6702 @opindex ffinite-math-only
6703 Allow optimizations for floating-point arithmetic that assume
6704 that arguments and results are not NaNs or +-Infs.
6705
6706 This option is not turned on by any @option{-O} option since
6707 it can result in incorrect output for programs which depend on
6708 an exact implementation of IEEE or ISO rules/specifications for
6709 math functions. It may, however, yield faster code for programs
6710 that do not require the guarantees of these specifications.
6711
6712 The default is @option{-fno-finite-math-only}.
6713
6714 @item -fno-signed-zeros
6715 @opindex fno-signed-zeros
6716 Allow optimizations for floating point arithmetic that ignore the
6717 signedness of zero.  IEEE arithmetic specifies the behavior of
6718 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
6719 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
6720 This option implies that the sign of a zero result isn't significant.
6721
6722 The default is @option{-fsigned-zeros}.
6723
6724 @item -fno-trapping-math
6725 @opindex fno-trapping-math
6726 Compile code assuming that floating-point operations cannot generate
6727 user-visible traps.  These traps include division by zero, overflow,
6728 underflow, inexact result and invalid operation.  This option requires
6729 that @option{-fno-signaling-nans} be in effect.  Setting this option may
6730 allow faster code if one relies on ``non-stop'' IEEE arithmetic, for example.
6731
6732 This option should never be turned on by any @option{-O} option since
6733 it can result in incorrect output for programs which depend on
6734 an exact implementation of IEEE or ISO rules/specifications for
6735 math functions.
6736
6737 The default is @option{-ftrapping-math}.
6738
6739 @item -frounding-math
6740 @opindex frounding-math
6741 Disable transformations and optimizations that assume default floating
6742 point rounding behavior.  This is round-to-zero for all floating point
6743 to integer conversions, and round-to-nearest for all other arithmetic
6744 truncations.  This option should be specified for programs that change
6745 the FP rounding mode dynamically, or that may be executed with a
6746 non-default rounding mode.  This option disables constant folding of
6747 floating point expressions at compile-time (which may be affected by
6748 rounding mode) and arithmetic transformations that are unsafe in the
6749 presence of sign-dependent rounding modes.
6750
6751 The default is @option{-fno-rounding-math}.
6752
6753 This option is experimental and does not currently guarantee to
6754 disable all GCC optimizations that are affected by rounding mode.
6755 Future versions of GCC may provide finer control of this setting
6756 using C99's @code{FENV_ACCESS} pragma.  This command line option
6757 will be used to specify the default state for @code{FENV_ACCESS}.
6758
6759 @item -frtl-abstract-sequences
6760 @opindex frtl-abstract-sequences
6761 It is a size optimization method. This option is to find identical
6762 sequences of code, which can be turned into pseudo-procedures  and
6763 then  replace  all  occurrences with  calls to  the  newly created
6764 subroutine. It is kind of an opposite of @option{-finline-functions}.
6765 This optimization runs at RTL level.
6766
6767 @item -fsignaling-nans
6768 @opindex fsignaling-nans
6769 Compile code assuming that IEEE signaling NaNs may generate user-visible
6770 traps during floating-point operations.  Setting this option disables
6771 optimizations that may change the number of exceptions visible with
6772 signaling NaNs.  This option implies @option{-ftrapping-math}.
6773
6774 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
6775 be defined.
6776
6777 The default is @option{-fno-signaling-nans}.
6778
6779 This option is experimental and does not currently guarantee to
6780 disable all GCC optimizations that affect signaling NaN behavior.
6781
6782 @item -fsingle-precision-constant
6783 @opindex fsingle-precision-constant
6784 Treat floating point constant as single precision constant instead of
6785 implicitly converting it to double precision constant.
6786
6787 @item -fcx-limited-range
6788 @opindex fcx-limited-range
6789 When enabled, this option states that a range reduction step is not
6790 needed when performing complex division.  Also, there is no checking
6791 whether the result of a complex multiplication or division is @code{NaN
6792 + I*NaN}, with an attempt to rescue the situation in that case.  The
6793 default is @option{-fno-cx-limited-range}, but is enabled by
6794 @option{-ffast-math}.
6795
6796 This option controls the default setting of the ISO C99
6797 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
6798 all languages.
6799
6800 @item -fcx-fortran-rules
6801 @opindex fcx-fortran-rules
6802 Complex multiplication and division follow Fortran rules.  Range
6803 reduction is done as part of complex division, but there is no checking
6804 whether the result of a complex multiplication or division is @code{NaN
6805 + I*NaN}, with an attempt to rescue the situation in that case.
6806
6807 The default is @option{-fno-cx-fortran-rules}.
6808
6809 @end table
6810
6811 The following options control optimizations that may improve
6812 performance, but are not enabled by any @option{-O} options.  This
6813 section includes experimental options that may produce broken code.
6814
6815 @table @gcctabopt
6816 @item -fbranch-probabilities
6817 @opindex fbranch-probabilities
6818 After running a program compiled with @option{-fprofile-arcs}
6819 (@pxref{Debugging Options,, Options for Debugging Your Program or
6820 @command{gcc}}), you can compile it a second time using
6821 @option{-fbranch-probabilities}, to improve optimizations based on
6822 the number of times each branch was taken.  When the program
6823 compiled with @option{-fprofile-arcs} exits it saves arc execution
6824 counts to a file called @file{@var{sourcename}.gcda} for each source
6825 file.  The information in this data file is very dependent on the
6826 structure of the generated code, so you must use the same source code
6827 and the same optimization options for both compilations.
6828
6829 With @option{-fbranch-probabilities}, GCC puts a
6830 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
6831 These can be used to improve optimization.  Currently, they are only
6832 used in one place: in @file{reorg.c}, instead of guessing which path a
6833 branch is mostly to take, the @samp{REG_BR_PROB} values are used to
6834 exactly determine which path is taken more often.
6835
6836 @item -fprofile-values
6837 @opindex fprofile-values
6838 If combined with @option{-fprofile-arcs}, it adds code so that some
6839 data about values of expressions in the program is gathered.
6840
6841 With @option{-fbranch-probabilities}, it reads back the data gathered
6842 from profiling values of expressions and adds @samp{REG_VALUE_PROFILE}
6843 notes to instructions for their later usage in optimizations.
6844
6845 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
6846
6847 @item -fvpt
6848 @opindex fvpt
6849 If combined with @option{-fprofile-arcs}, it instructs the compiler to add
6850 a code to gather information about values of expressions.
6851
6852 With @option{-fbranch-probabilities}, it reads back the data gathered
6853 and actually performs the optimizations based on them.
6854 Currently the optimizations include specialization of division operation
6855 using the knowledge about the value of the denominator.
6856
6857 @item -frename-registers
6858 @opindex frename-registers
6859 Attempt to avoid false dependencies in scheduled code by making use
6860 of registers left over after register allocation.  This optimization
6861 will most benefit processors with lots of registers.  Depending on the
6862 debug information format adopted by the target, however, it can
6863 make debugging impossible, since variables will no longer stay in
6864 a ``home register''.
6865
6866 Enabled by default with @option{-funroll-loops}.
6867
6868 @item -ftracer
6869 @opindex ftracer
6870 Perform tail duplication to enlarge superblock size.  This transformation
6871 simplifies the control flow of the function allowing other optimizations to do
6872 better job.
6873
6874 Enabled with @option{-fprofile-use}.
6875
6876 @item -funroll-loops
6877 @opindex funroll-loops
6878 Unroll loops whose number of iterations can be determined at compile time or
6879 upon entry to the loop.  @option{-funroll-loops} implies
6880 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
6881 It also turns on complete loop peeling (i.e.@: complete removal of loops with
6882 small constant number of iterations).  This option makes code larger, and may
6883 or may not make it run faster.
6884
6885 Enabled with @option{-fprofile-use}.
6886
6887 @item -funroll-all-loops
6888 @opindex funroll-all-loops
6889 Unroll all loops, even if their number of iterations is uncertain when
6890 the loop is entered.  This usually makes programs run more slowly.
6891 @option{-funroll-all-loops} implies the same options as
6892 @option{-funroll-loops}.
6893
6894 @item -fpeel-loops
6895 @opindex fpeel-loops
6896 Peels the loops for that there is enough information that they do not
6897 roll much (from profile feedback).  It also turns on complete loop peeling
6898 (i.e.@: complete removal of loops with small constant number of iterations).
6899
6900 Enabled with @option{-fprofile-use}.
6901
6902 @item -fmove-loop-invariants
6903 @opindex fmove-loop-invariants
6904 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
6905 at level @option{-O1}
6906
6907 @item -funswitch-loops
6908 @opindex funswitch-loops
6909 Move branches with loop invariant conditions out of the loop, with duplicates
6910 of the loop on both branches (modified according to result of the condition).
6911
6912 @item -ffunction-sections
6913 @itemx -fdata-sections
6914 @opindex ffunction-sections
6915 @opindex fdata-sections
6916 Place each function or data item into its own section in the output
6917 file if the target supports arbitrary sections.  The name of the
6918 function or the name of the data item determines the section's name
6919 in the output file.
6920
6921 Use these options on systems where the linker can perform optimizations
6922 to improve locality of reference in the instruction space.  Most systems
6923 using the ELF object format and SPARC processors running Solaris 2 have
6924 linkers with such optimizations.  AIX may have these optimizations in
6925 the future.
6926
6927 Only use these options when there are significant benefits from doing
6928 so.  When you specify these options, the assembler and linker will
6929 create larger object and executable files and will also be slower.
6930 You will not be able to use @code{gprof} on all systems if you
6931 specify this option and you may have problems with debugging if
6932 you specify both this option and @option{-g}.
6933
6934 @item -fbranch-target-load-optimize
6935 @opindex fbranch-target-load-optimize
6936 Perform branch target register load optimization before prologue / epilogue
6937 threading.
6938 The use of target registers can typically be exposed only during reload,
6939 thus hoisting loads out of loops and doing inter-block scheduling needs
6940 a separate optimization pass.
6941
6942 @item -fbranch-target-load-optimize2
6943 @opindex fbranch-target-load-optimize2
6944 Perform branch target register load optimization after prologue / epilogue
6945 threading.
6946
6947 @item -fbtr-bb-exclusive
6948 @opindex fbtr-bb-exclusive
6949 When performing branch target register load optimization, don't reuse
6950 branch target registers in within any basic block.
6951
6952 @item -fstack-protector
6953 @opindex fstack-protector
6954 Emit extra code to check for buffer overflows, such as stack smashing
6955 attacks.  This is done by adding a guard variable to functions with
6956 vulnerable objects.  This includes functions that call alloca, and
6957 functions with buffers larger than 8 bytes.  The guards are initialized
6958 when a function is entered and then checked when the function exits.
6959 If a guard check fails, an error message is printed and the program exits.
6960
6961 @item -fstack-protector-all
6962 @opindex fstack-protector-all
6963 Like @option{-fstack-protector} except that all functions are protected.
6964
6965 @item -fsection-anchors
6966 @opindex fsection-anchors
6967 Try to reduce the number of symbolic address calculations by using
6968 shared ``anchor'' symbols to address nearby objects.  This transformation
6969 can help to reduce the number of GOT entries and GOT accesses on some
6970 targets.
6971
6972 For example, the implementation of the following function @code{foo}:
6973
6974 @smallexample
6975 static int a, b, c;
6976 int foo (void) @{ return a + b + c; @}
6977 @end smallexample
6978
6979 would usually calculate the addresses of all three variables, but if you
6980 compile it with @option{-fsection-anchors}, it will access the variables
6981 from a common anchor point instead.  The effect is similar to the
6982 following pseudocode (which isn't valid C):
6983
6984 @smallexample
6985 int foo (void)
6986 @{
6987   register int *xr = &x;
6988   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
6989 @}
6990 @end smallexample
6991
6992 Not all targets support this option.
6993
6994 @item --param @var{name}=@var{value}
6995 @opindex param
6996 In some places, GCC uses various constants to control the amount of
6997 optimization that is done.  For example, GCC will not inline functions
6998 that contain more that a certain number of instructions.  You can
6999 control some of these constants on the command-line using the
7000 @option{--param} option.
7001
7002 The names of specific parameters, and the meaning of the values, are
7003 tied to the internals of the compiler, and are subject to change
7004 without notice in future releases.
7005
7006 In each case, the @var{value} is an integer.  The allowable choices for
7007 @var{name} are given in the following table:
7008
7009 @table @gcctabopt
7010 @item sra-max-structure-size
7011 The maximum structure size, in bytes, at which the scalar replacement
7012 of aggregates (SRA) optimization will perform block copies.  The
7013 default value, 0, implies that GCC will select the most appropriate
7014 size itself.
7015
7016 @item sra-field-structure-ratio
7017 The threshold ratio (as a percentage) between instantiated fields and
7018 the complete structure size.  We say that if the ratio of the number
7019 of bytes in instantiated fields to the number of bytes in the complete
7020 structure exceeds this parameter, then block copies are not used.  The
7021 default is 75.
7022
7023 @item struct-reorg-cold-struct-ratio
7024 The threshold ratio (as a percentage) between a structure frequency
7025 and the frequency of the hottest structure in the program.  This parameter
7026 is used by struct-reorg optimization enabled by @option{-fipa-struct-reorg}.
7027 We say that if the ratio of a structure frequency, calculated by profiling, 
7028 to the hottest structure frequency in the program is less than this 
7029 parameter, then structure reorganization is not applied to this structure.
7030 The default is 10.
7031
7032 @item predictable-branch-cost-outcome
7033 When branch is predicted to be taken with probability lower than this threshold
7034 (in percent), then it is considered well predictable. The default is 10.
7035
7036 @item max-crossjump-edges
7037 The maximum number of incoming edges to consider for crossjumping.
7038 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
7039 the number of edges incoming to each block.  Increasing values mean
7040 more aggressive optimization, making the compile time increase with
7041 probably small improvement in executable size.
7042
7043 @item min-crossjump-insns
7044 The minimum number of instructions which must be matched at the end
7045 of two blocks before crossjumping will be performed on them.  This
7046 value is ignored in the case where all instructions in the block being
7047 crossjumped from are matched.  The default value is 5.
7048
7049 @item max-grow-copy-bb-insns
7050 The maximum code size expansion factor when copying basic blocks
7051 instead of jumping.  The expansion is relative to a jump instruction.
7052 The default value is 8.
7053
7054 @item max-goto-duplication-insns
7055 The maximum number of instructions to duplicate to a block that jumps
7056 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
7057 passes, GCC factors computed gotos early in the compilation process,
7058 and unfactors them as late as possible.  Only computed jumps at the
7059 end of a basic blocks with no more than max-goto-duplication-insns are
7060 unfactored.  The default value is 8.
7061
7062 @item max-delay-slot-insn-search
7063 The maximum number of instructions to consider when looking for an
7064 instruction to fill a delay slot.  If more than this arbitrary number of
7065 instructions is searched, the time savings from filling the delay slot
7066 will be minimal so stop searching.  Increasing values mean more
7067 aggressive optimization, making the compile time increase with probably
7068 small improvement in executable run time.
7069
7070 @item max-delay-slot-live-search
7071 When trying to fill delay slots, the maximum number of instructions to
7072 consider when searching for a block with valid live register
7073 information.  Increasing this arbitrarily chosen value means more
7074 aggressive optimization, increasing the compile time.  This parameter
7075 should be removed when the delay slot code is rewritten to maintain the
7076 control-flow graph.
7077
7078 @item max-gcse-memory
7079 The approximate maximum amount of memory that will be allocated in
7080 order to perform the global common subexpression elimination
7081 optimization.  If more memory than specified is required, the
7082 optimization will not be done.
7083
7084 @item max-gcse-passes
7085 The maximum number of passes of GCSE to run.  The default is 1.
7086
7087 @item max-pending-list-length
7088 The maximum number of pending dependencies scheduling will allow
7089 before flushing the current state and starting over.  Large functions
7090 with few branches or calls can create excessively large lists which
7091 needlessly consume memory and resources.
7092
7093 @item max-inline-insns-single
7094 Several parameters control the tree inliner used in gcc.
7095 This number sets the maximum number of instructions (counted in GCC's
7096 internal representation) in a single function that the tree inliner
7097 will consider for inlining.  This only affects functions declared
7098 inline and methods implemented in a class declaration (C++).
7099 The default value is 450.
7100
7101 @item max-inline-insns-auto
7102 When you use @option{-finline-functions} (included in @option{-O3}),
7103 a lot of functions that would otherwise not be considered for inlining
7104 by the compiler will be investigated.  To those functions, a different
7105 (more restrictive) limit compared to functions declared inline can
7106 be applied.
7107 The default value is 90.
7108
7109 @item large-function-insns
7110 The limit specifying really large functions.  For functions larger than this
7111 limit after inlining, inlining is constrained by
7112 @option{--param large-function-growth}.  This parameter is useful primarily
7113 to avoid extreme compilation time caused by non-linear algorithms used by the
7114 backend.
7115 The default value is 2700.
7116
7117 @item large-function-growth
7118 Specifies maximal growth of large function caused by inlining in percents.
7119 The default value is 100 which limits large function growth to 2.0 times
7120 the original size.
7121
7122 @item large-unit-insns
7123 The limit specifying large translation unit.  Growth caused by inlining of
7124 units larger than this limit is limited by @option{--param inline-unit-growth}.
7125 For small units this might be too tight (consider unit consisting of function A
7126 that is inline and B that just calls A three time.  If B is small relative to
7127 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
7128 large units consisting of small inlineable functions however the overall unit
7129 growth limit is needed to avoid exponential explosion of code size.  Thus for
7130 smaller units, the size is increased to @option{--param large-unit-insns}
7131 before applying @option{--param inline-unit-growth}.  The default is 10000
7132
7133 @item inline-unit-growth
7134 Specifies maximal overall growth of the compilation unit caused by inlining.
7135 The default value is 30 which limits unit growth to 1.3 times the original
7136 size.
7137
7138 @item ipcp-unit-growth
7139 Specifies maximal overall growth of the compilation unit caused by
7140 interprocedural constant propagation.  The default value is 10 which limits
7141 unit growth to 1.1 times the original size.
7142
7143 @item large-stack-frame
7144 The limit specifying large stack frames.  While inlining the algorithm is trying
7145 to not grow past this limit too much.  Default value is 256 bytes.
7146
7147 @item large-stack-frame-growth
7148 Specifies maximal growth of large stack frames caused by inlining in percents.
7149 The default value is 1000 which limits large stack frame growth to 11 times
7150 the original size.
7151
7152 @item max-inline-insns-recursive
7153 @itemx max-inline-insns-recursive-auto
7154 Specifies maximum number of instructions out-of-line copy of self recursive inline
7155 function can grow into by performing recursive inlining.
7156
7157 For functions declared inline @option{--param max-inline-insns-recursive} 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-insns-recursive-auto} is used.  The
7161 default value is 450.
7162
7163 @item max-inline-recursive-depth
7164 @itemx max-inline-recursive-depth-auto
7165 Specifies maximum recursion depth used by the recursive inlining.
7166
7167 For functions declared inline @option{--param max-inline-recursive-depth} is
7168 taken into account.  For function not declared inline, recursive inlining
7169 happens only when @option{-finline-functions} (included in @option{-O3}) is
7170 enabled and @option{--param max-inline-recursive-depth-auto} is used.  The
7171 default value is 8.
7172
7173 @item min-inline-recursive-probability
7174 Recursive inlining is profitable only for function having deep recursion
7175 in average and can hurt for function having little recursion depth by
7176 increasing the prologue size or complexity of function body to other
7177 optimizers.
7178
7179 When profile feedback is available (see @option{-fprofile-generate}) the actual
7180 recursion depth can be guessed from probability that function will recurse via
7181 given call expression.  This parameter limits inlining only to call expression
7182 whose probability exceeds given threshold (in percents).  The default value is
7183 10.
7184
7185 @item inline-call-cost
7186 Specify cost of call instruction relative to simple arithmetics operations
7187 (having cost of 1).  Increasing this cost disqualifies inlining of non-leaf
7188 functions and at the same time increases size of leaf function that is believed to
7189 reduce function size by being inlined.  In effect it increases amount of
7190 inlining for code having large abstraction penalty (many functions that just
7191 pass the arguments to other functions) and decrease inlining for code with low
7192 abstraction penalty.  The default value is 12.
7193
7194 @item min-vect-loop-bound
7195 The minimum number of iterations under which a loop will not get vectorized
7196 when @option{-ftree-vectorize} is used.  The number of iterations after
7197 vectorization needs to be greater than the value specified by this option
7198 to allow vectorization.  The default value is 0.
7199
7200 @item max-unrolled-insns
7201 The maximum number of instructions that a loop should have if that loop
7202 is unrolled, and if the loop is unrolled, it determines how many times
7203 the loop code is unrolled.
7204
7205 @item max-average-unrolled-insns
7206 The maximum number of instructions biased by probabilities of their execution
7207 that a loop should have if that loop is unrolled, and if the loop is unrolled,
7208 it determines how many times the loop code is unrolled.
7209
7210 @item max-unroll-times
7211 The maximum number of unrollings of a single loop.
7212
7213 @item max-peeled-insns
7214 The maximum number of instructions that a loop should have if that loop
7215 is peeled, and if the loop is peeled, it determines how many times
7216 the loop code is peeled.
7217
7218 @item max-peel-times
7219 The maximum number of peelings of a single loop.
7220
7221 @item max-completely-peeled-insns
7222 The maximum number of insns of a completely peeled loop.
7223
7224 @item max-completely-peel-times
7225 The maximum number of iterations of a loop to be suitable for complete peeling.
7226
7227 @item max-unswitch-insns
7228 The maximum number of insns of an unswitched loop.
7229
7230 @item max-unswitch-level
7231 The maximum number of branches unswitched in a single loop.
7232
7233 @item lim-expensive
7234 The minimum cost of an expensive expression in the loop invariant motion.
7235
7236 @item iv-consider-all-candidates-bound
7237 Bound on number of candidates for induction variables below that
7238 all candidates are considered for each use in induction variable
7239 optimizations.  Only the most relevant candidates are considered
7240 if there are more candidates, to avoid quadratic time complexity.
7241
7242 @item iv-max-considered-uses
7243 The induction variable optimizations give up on loops that contain more
7244 induction variable uses.
7245
7246 @item iv-always-prune-cand-set-bound
7247 If number of candidates in the set is smaller than this value,
7248 we always try to remove unnecessary ivs from the set during its
7249 optimization when a new iv is added to the set.
7250
7251 @item scev-max-expr-size
7252 Bound on size of expressions used in the scalar evolutions analyzer.
7253 Large expressions slow the analyzer.
7254
7255 @item omega-max-vars
7256 The maximum number of variables in an Omega constraint system.
7257 The default value is 128.
7258
7259 @item omega-max-geqs
7260 The maximum number of inequalities in an Omega constraint system.
7261 The default value is 256.
7262
7263 @item omega-max-eqs
7264 The maximum number of equalities in an Omega constraint system.
7265 The default value is 128.
7266
7267 @item omega-max-wild-cards
7268 The maximum number of wildcard variables that the Omega solver will
7269 be able to insert.  The default value is 18.
7270
7271 @item omega-hash-table-size
7272 The size of the hash table in the Omega solver.  The default value is
7273 550.
7274
7275 @item omega-max-keys
7276 The maximal number of keys used by the Omega solver.  The default
7277 value is 500.
7278
7279 @item omega-eliminate-redundant-constraints
7280 When set to 1, use expensive methods to eliminate all redundant
7281 constraints.  The default value is 0.
7282
7283 @item vect-max-version-for-alignment-checks
7284 The maximum number of runtime checks that can be performed when
7285 doing loop versioning for alignment in the vectorizer.  See option
7286 ftree-vect-loop-version for more information.
7287
7288 @item vect-max-version-for-alias-checks
7289 The maximum number of runtime checks that can be performed when
7290 doing loop versioning for alias in the vectorizer.  See option
7291 ftree-vect-loop-version for more information.
7292
7293 @item max-iterations-to-track
7294
7295 The maximum number of iterations of a loop the brute force algorithm
7296 for analysis of # of iterations of the loop tries to evaluate.
7297
7298 @item hot-bb-count-fraction
7299 Select fraction of the maximal count of repetitions of basic block in program
7300 given basic block needs to have to be considered hot.
7301
7302 @item hot-bb-frequency-fraction
7303 Select fraction of the maximal frequency of executions of basic block in
7304 function given basic block needs to have to be considered hot
7305
7306 @item max-predicted-iterations
7307 The maximum number of loop iterations we predict statically.  This is useful
7308 in cases where function contain single loop with known bound and other loop
7309 with unknown.  We predict the known number of iterations correctly, while
7310 the unknown number of iterations average to roughly 10.  This means that the
7311 loop without bounds would appear artificially cold relative to the other one.
7312
7313 @item align-threshold
7314
7315 Select fraction of the maximal frequency of executions of basic block in
7316 function given basic block will get aligned.
7317
7318 @item align-loop-iterations
7319
7320 A loop expected to iterate at lest the selected number of iterations will get
7321 aligned.
7322
7323 @item tracer-dynamic-coverage
7324 @itemx tracer-dynamic-coverage-feedback
7325
7326 This value is used to limit superblock formation once the given percentage of
7327 executed instructions is covered.  This limits unnecessary code size
7328 expansion.
7329
7330 The @option{tracer-dynamic-coverage-feedback} is used only when profile
7331 feedback is available.  The real profiles (as opposed to statically estimated
7332 ones) are much less balanced allowing the threshold to be larger value.
7333
7334 @item tracer-max-code-growth
7335 Stop tail duplication once code growth has reached given percentage.  This is
7336 rather hokey argument, as most of the duplicates will be eliminated later in
7337 cross jumping, so it may be set to much higher values than is the desired code
7338 growth.
7339
7340 @item tracer-min-branch-ratio
7341
7342 Stop reverse growth when the reverse probability of best edge is less than this
7343 threshold (in percent).
7344
7345 @item tracer-min-branch-ratio
7346 @itemx tracer-min-branch-ratio-feedback
7347
7348 Stop forward growth if the best edge do have probability lower than this
7349 threshold.
7350
7351 Similarly to @option{tracer-dynamic-coverage} two values are present, one for
7352 compilation for profile feedback and one for compilation without.  The value
7353 for compilation with profile feedback needs to be more conservative (higher) in
7354 order to make tracer effective.
7355
7356 @item max-cse-path-length
7357
7358 Maximum number of basic blocks on path that cse considers.  The default is 10.
7359
7360 @item max-cse-insns
7361 The maximum instructions CSE process before flushing. The default is 1000.
7362
7363 @item max-aliased-vops
7364
7365 Maximum number of virtual operands per function allowed to represent
7366 aliases before triggering the alias partitioning heuristic.  Alias
7367 partitioning reduces compile times and memory consumption needed for
7368 aliasing at the expense of precision loss in alias information.  The
7369 default value for this parameter is 100 for -O1, 500 for -O2 and 1000
7370 for -O3.
7371
7372 Notice that if a function contains more memory statements than the
7373 value of this parameter, it is not really possible to achieve this
7374 reduction.  In this case, the compiler will use the number of memory
7375 statements as the value for @option{max-aliased-vops}.
7376
7377 @item avg-aliased-vops
7378
7379 Average number of virtual operands per statement allowed to represent
7380 aliases before triggering the alias partitioning heuristic.  This
7381 works in conjunction with @option{max-aliased-vops}.  If a function
7382 contains more than @option{max-aliased-vops} virtual operators, then
7383 memory symbols will be grouped into memory partitions until either the
7384 total number of virtual operators is below @option{max-aliased-vops}
7385 or the average number of virtual operators per memory statement is
7386 below @option{avg-aliased-vops}.  The default value for this parameter
7387 is 1 for -O1 and -O2, and 3 for -O3.
7388
7389 @item ggc-min-expand
7390
7391 GCC uses a garbage collector to manage its own memory allocation.  This
7392 parameter specifies the minimum percentage by which the garbage
7393 collector's heap should be allowed to expand between collections.
7394 Tuning this may improve compilation speed; it has no effect on code
7395 generation.
7396
7397 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
7398 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of "RAM" is
7399 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
7400 GCC is not able to calculate RAM on a particular platform, the lower
7401 bound of 30% is used.  Setting this parameter and
7402 @option{ggc-min-heapsize} to zero causes a full collection to occur at
7403 every opportunity.  This is extremely slow, but can be useful for
7404 debugging.
7405
7406 @item ggc-min-heapsize
7407
7408 Minimum size of the garbage collector's heap before it begins bothering
7409 to collect garbage.  The first collection occurs after the heap expands
7410 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
7411 tuning this may improve compilation speed, and has no effect on code
7412 generation.
7413
7414 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit which
7415 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
7416 with a lower bound of 4096 (four megabytes) and an upper bound of
7417 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
7418 particular platform, the lower bound is used.  Setting this parameter
7419 very large effectively disables garbage collection.  Setting this
7420 parameter and @option{ggc-min-expand} to zero causes a full collection
7421 to occur at every opportunity.
7422
7423 @item max-reload-search-insns
7424 The maximum number of instruction reload should look backward for equivalent
7425 register.  Increasing values mean more aggressive optimization, making the
7426 compile time increase with probably slightly better performance.  The default
7427 value is 100.
7428
7429 @item max-cselib-memory-locations
7430 The maximum number of memory locations cselib should take into account.
7431 Increasing values mean more aggressive optimization, making the compile time
7432 increase with probably slightly better performance.  The default value is 500.
7433
7434 @item reorder-blocks-duplicate
7435 @itemx reorder-blocks-duplicate-feedback
7436
7437 Used by basic block reordering pass to decide whether to use unconditional
7438 branch or duplicate the code on its destination.  Code is duplicated when its
7439 estimated size is smaller than this value multiplied by the estimated size of
7440 unconditional jump in the hot spots of the program.
7441
7442 The @option{reorder-block-duplicate-feedback} is used only when profile
7443 feedback is available and may be set to higher values than
7444 @option{reorder-block-duplicate} since information about the hot spots is more
7445 accurate.
7446
7447 @item max-sched-ready-insns
7448 The maximum number of instructions ready to be issued the scheduler should
7449 consider at any given time during the first scheduling pass.  Increasing
7450 values mean more thorough searches, making the compilation time increase
7451 with probably little benefit.  The default value is 100.
7452
7453 @item max-sched-region-blocks
7454 The maximum number of blocks in a region to be considered for
7455 interblock scheduling.  The default value is 10.
7456
7457 @item max-pipeline-region-blocks
7458 The maximum number of blocks in a region to be considered for
7459 pipelining in the selective scheduler.  The default value is 15.
7460
7461 @item max-sched-region-insns
7462 The maximum number of insns in a region to be considered for
7463 interblock scheduling.  The default value is 100.
7464
7465 @item max-pipeline-region-insns
7466 The maximum number of insns in a region to be considered for
7467 pipelining in the selective scheduler.  The default value is 200.
7468
7469 @item min-spec-prob
7470 The minimum probability (in percents) of reaching a source block
7471 for interblock speculative scheduling.  The default value is 40.
7472
7473 @item max-sched-extend-regions-iters
7474 The maximum number of iterations through CFG to extend regions.
7475 0 - disable region extension,
7476 N - do at most N iterations.
7477 The default value is 0.
7478
7479 @item max-sched-insn-conflict-delay
7480 The maximum conflict delay for an insn to be considered for speculative motion.
7481 The default value is 3.
7482
7483 @item sched-spec-prob-cutoff
7484 The minimal probability of speculation success (in percents), so that
7485 speculative insn will be scheduled.
7486 The default value is 40.
7487
7488 @item sched-mem-true-dep-cost
7489 Minimal distance (in CPU cycles) between store and load targeting same
7490 memory locations.  The default value is 1.
7491
7492 @item selsched-max-lookahead
7493 The maximum size of the lookahead window of selective scheduling.  It is a
7494 depth of search for available instructions.
7495 The default value is 50.
7496
7497 @item selsched-max-sched-times
7498 The maximum number of times that an instruction will be scheduled during 
7499 selective scheduling.  This is the limit on the number of iterations 
7500 through which the instruction may be pipelined.  The default value is 2.
7501
7502 @item selsched-max-insns-to-rename
7503 The maximum number of best instructions in the ready list that are considered
7504 for renaming in the selective scheduler.  The default value is 2.
7505
7506 @item max-last-value-rtl
7507 The maximum size measured as number of RTLs that can be recorded in an expression
7508 in combiner for a pseudo register as last known value of that register.  The default
7509 is 10000.
7510
7511 @item integer-share-limit
7512 Small integer constants can use a shared data structure, reducing the
7513 compiler's memory usage and increasing its speed.  This sets the maximum
7514 value of a shared integer constant.  The default value is 256.
7515
7516 @item min-virtual-mappings
7517 Specifies the minimum number of virtual mappings in the incremental
7518 SSA updater that should be registered to trigger the virtual mappings
7519 heuristic defined by virtual-mappings-ratio.  The default value is
7520 100.
7521
7522 @item virtual-mappings-ratio
7523 If the number of virtual mappings is virtual-mappings-ratio bigger
7524 than the number of virtual symbols to be updated, then the incremental
7525 SSA updater switches to a full update for those symbols.  The default
7526 ratio is 3.
7527
7528 @item ssp-buffer-size
7529 The minimum size of buffers (i.e.@: arrays) that will receive stack smashing
7530 protection when @option{-fstack-protection} is used.
7531
7532 @item max-jump-thread-duplication-stmts
7533 Maximum number of statements allowed in a block that needs to be
7534 duplicated when threading jumps.
7535
7536 @item max-fields-for-field-sensitive
7537 Maximum number of fields in a structure we will treat in
7538 a field sensitive manner during pointer analysis.  The default is zero
7539 for -O0, and -O1 and 100 for -Os, -O2, and -O3.
7540
7541 @item prefetch-latency
7542 Estimate on average number of instructions that are executed before
7543 prefetch finishes.  The distance we prefetch ahead is proportional
7544 to this constant.  Increasing this number may also lead to less
7545 streams being prefetched (see @option{simultaneous-prefetches}).
7546
7547 @item simultaneous-prefetches
7548 Maximum number of prefetches that can run at the same time.
7549
7550 @item l1-cache-line-size
7551 The size of cache line in L1 cache, in bytes.
7552
7553 @item l1-cache-size
7554 The size of L1 cache, in kilobytes.
7555
7556 @item l2-cache-size
7557 The size of L2 cache, in kilobytes.
7558
7559 @item use-canonical-types
7560 Whether the compiler should use the ``canonical'' type system.  By
7561 default, this should always be 1, which uses a more efficient internal
7562 mechanism for comparing types in C++ and Objective-C++.  However, if
7563 bugs in the canonical type system are causing compilation failures,
7564 set this value to 0 to disable canonical types.
7565
7566 @item switch-conversion-max-branch-ratio
7567 Switch initialization conversion will refuse to create arrays that are
7568 bigger than @option{switch-conversion-max-branch-ratio} times the number of
7569 branches in the switch.
7570
7571 @item max-partial-antic-length
7572 Maximum length of the partial antic set computed during the tree
7573 partial redundancy elimination optimization (@option{-ftree-pre}) when
7574 optimizing at @option{-O3} and above.  For some sorts of source code
7575 the enhanced partial redundancy elimination optimization can run away,
7576 consuming all of the memory available on the host machine.  This
7577 parameter sets a limit on the length of the sets that are computed,
7578 which prevents the runaway behaviour.  Setting a value of 0 for
7579 this paramter will allow an unlimited set length.
7580
7581 @item sccvn-max-scc-size
7582 Maximum size of a strongly connected component (SCC) during SCCVN
7583 processing.  If this limit is hit, SCCVN processing for the whole
7584 function will not be done and optimizations depending on it will
7585 be disabled.  The default maximum SCC size is 10000.
7586
7587 @item ira-max-loops-num
7588 IRA uses a regional register allocation by default.  If a function
7589 contains loops more than number given by the parameter, non-regional
7590 register allocator will be used even when option
7591 @option{-fira-algorithm} is given.  The default value of the parameter
7592 is 20.
7593
7594 @end table
7595 @end table
7596
7597 @node Preprocessor Options
7598 @section Options Controlling the Preprocessor
7599 @cindex preprocessor options
7600 @cindex options, preprocessor
7601
7602 These options control the C preprocessor, which is run on each C source
7603 file before actual compilation.
7604
7605 If you use the @option{-E} option, nothing is done except preprocessing.
7606 Some of these options make sense only together with @option{-E} because
7607 they cause the preprocessor output to be unsuitable for actual
7608 compilation.
7609
7610 @table @gcctabopt
7611 @opindex Wp
7612 You can use @option{-Wp,@var{option}} to bypass the compiler driver
7613 and pass @var{option} directly through to the preprocessor.  If
7614 @var{option} contains commas, it is split into multiple options at the
7615 commas.  However, many options are modified, translated or interpreted
7616 by the compiler driver before being passed to the preprocessor, and
7617 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
7618 interface is undocumented and subject to change, so whenever possible
7619 you should avoid using @option{-Wp} and let the driver handle the
7620 options instead.
7621
7622 @item -Xpreprocessor @var{option}
7623 @opindex preprocessor
7624 Pass @var{option} as an option to the preprocessor.  You can use this to
7625 supply system-specific preprocessor options which GCC does not know how to
7626 recognize.
7627
7628 If you want to pass an option that takes an argument, you must use
7629 @option{-Xpreprocessor} twice, once for the option and once for the argument.
7630 @end table
7631
7632 @include cppopts.texi
7633
7634 @node Assembler Options
7635 @section Passing Options to the Assembler
7636
7637 @c prevent bad page break with this line
7638 You can pass options to the assembler.
7639
7640 @table @gcctabopt
7641 @item -Wa,@var{option}
7642 @opindex Wa
7643 Pass @var{option} as an option to the assembler.  If @var{option}
7644 contains commas, it is split into multiple options at the commas.
7645
7646 @item -Xassembler @var{option}
7647 @opindex Xassembler
7648 Pass @var{option} as an option to the assembler.  You can use this to
7649 supply system-specific assembler options which GCC does not know how to
7650 recognize.
7651
7652 If you want to pass an option that takes an argument, you must use
7653 @option{-Xassembler} twice, once for the option and once for the argument.
7654
7655 @end table
7656
7657 @node Link Options
7658 @section Options for Linking
7659 @cindex link options
7660 @cindex options, linking
7661
7662 These options come into play when the compiler links object files into
7663 an executable output file.  They are meaningless if the compiler is
7664 not doing a link step.
7665
7666 @table @gcctabopt
7667 @cindex file names
7668 @item @var{object-file-name}
7669 A file name that does not end in a special recognized suffix is
7670 considered to name an object file or library.  (Object files are
7671 distinguished from libraries by the linker according to the file
7672 contents.)  If linking is done, these object files are used as input
7673 to the linker.
7674
7675 @item -c
7676 @itemx -S
7677 @itemx -E
7678 @opindex c
7679 @opindex S
7680 @opindex E
7681 If any of these options is used, then the linker is not run, and
7682 object file names should not be used as arguments.  @xref{Overall
7683 Options}.
7684
7685 @cindex Libraries
7686 @item -l@var{library}
7687 @itemx -l @var{library}
7688 @opindex l
7689 Search the library named @var{library} when linking.  (The second
7690 alternative with the library as a separate argument is only for
7691 POSIX compliance and is not recommended.)
7692
7693 It makes a difference where in the command you write this option; the
7694 linker searches and processes libraries and object files in the order they
7695 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
7696 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
7697 to functions in @samp{z}, those functions may not be loaded.
7698
7699 The linker searches a standard list of directories for the library,
7700 which is actually a file named @file{lib@var{library}.a}.  The linker
7701 then uses this file as if it had been specified precisely by name.
7702
7703 The directories searched include several standard system directories
7704 plus any that you specify with @option{-L}.
7705
7706 Normally the files found this way are library files---archive files
7707 whose members are object files.  The linker handles an archive file by
7708 scanning through it for members which define symbols that have so far
7709 been referenced but not defined.  But if the file that is found is an
7710 ordinary object file, it is linked in the usual fashion.  The only
7711 difference between using an @option{-l} option and specifying a file name
7712 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
7713 and searches several directories.
7714
7715 @item -lobjc
7716 @opindex lobjc
7717 You need this special case of the @option{-l} option in order to
7718 link an Objective-C or Objective-C++ program.
7719
7720 @item -nostartfiles
7721 @opindex nostartfiles
7722 Do not use the standard system startup files when linking.
7723 The standard system libraries are used normally, unless @option{-nostdlib}
7724 or @option{-nodefaultlibs} is used.
7725
7726 @item -nodefaultlibs
7727 @opindex nodefaultlibs
7728 Do not use the standard system libraries when linking.
7729 Only the libraries you specify will be passed to the linker.
7730 The standard startup files are used normally, unless @option{-nostartfiles}
7731 is used.  The compiler may generate calls to @code{memcmp},
7732 @code{memset}, @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 @item -nostdlib
7738 @opindex nostdlib
7739 Do not use the standard system startup files or libraries when linking.
7740 No startup files and only the libraries you specify will be passed to
7741 the linker.  The compiler may generate calls to @code{memcmp}, @code{memset},
7742 @code{memcpy} and @code{memmove}.
7743 These entries are usually resolved by entries in
7744 libc.  These entry points should be supplied through some other
7745 mechanism when this option is specified.
7746
7747 @cindex @option{-lgcc}, use with @option{-nostdlib}
7748 @cindex @option{-nostdlib} and unresolved references
7749 @cindex unresolved references and @option{-nostdlib}
7750 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
7751 @cindex @option{-nodefaultlibs} and unresolved references
7752 @cindex unresolved references and @option{-nodefaultlibs}
7753 One of the standard libraries bypassed by @option{-nostdlib} and
7754 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
7755 that GCC uses to overcome shortcomings of particular machines, or special
7756 needs for some languages.
7757 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
7758 Collection (GCC) Internals},
7759 for more discussion of @file{libgcc.a}.)
7760 In most cases, you need @file{libgcc.a} even when you want to avoid
7761 other standard libraries.  In other words, when you specify @option{-nostdlib}
7762 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
7763 This ensures that you have no unresolved references to internal GCC
7764 library subroutines.  (For example, @samp{__main}, used to ensure C++
7765 constructors will be called; @pxref{Collect2,,@code{collect2}, gccint,
7766 GNU Compiler Collection (GCC) Internals}.)
7767
7768 @item -pie
7769 @opindex pie
7770 Produce a position independent executable on targets which support it.
7771 For predictable results, you must also specify the same set of options
7772 that were used to generate code (@option{-fpie}, @option{-fPIE},
7773 or model suboptions) when you specify this option.
7774
7775 @item -rdynamic
7776 @opindex rdynamic
7777 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
7778 that support it. This instructs the linker to add all symbols, not
7779 only used ones, to the dynamic symbol table. This option is needed
7780 for some uses of @code{dlopen} or to allow obtaining backtraces
7781 from within a program.
7782
7783 @item -s
7784 @opindex s
7785 Remove all symbol table and relocation information from the executable.
7786
7787 @item -static
7788 @opindex static
7789 On systems that support dynamic linking, this prevents linking with the shared
7790 libraries.  On other systems, this option has no effect.
7791
7792 @item -shared
7793 @opindex shared
7794 Produce a shared object which can then be linked with other objects to
7795 form an executable.  Not all systems support this option.  For predictable
7796 results, you must also specify the same set of options that were used to
7797 generate code (@option{-fpic}, @option{-fPIC}, or model suboptions)
7798 when you specify this option.@footnote{On some systems, @samp{gcc -shared}
7799 needs to build supplementary stub code for constructors to work.  On
7800 multi-libbed systems, @samp{gcc -shared} must select the correct support
7801 libraries to link against.  Failing to supply the correct flags may lead
7802 to subtle defects.  Supplying them in cases where they are not necessary
7803 is innocuous.}
7804
7805 @item -shared-libgcc
7806 @itemx -static-libgcc
7807 @opindex shared-libgcc
7808 @opindex static-libgcc
7809 On systems that provide @file{libgcc} as a shared library, these options
7810 force the use of either the shared or static version respectively.
7811 If no shared version of @file{libgcc} was built when the compiler was
7812 configured, these options have no effect.
7813
7814 There are several situations in which an application should use the
7815 shared @file{libgcc} instead of the static version.  The most common
7816 of these is when the application wishes to throw and catch exceptions
7817 across different shared libraries.  In that case, each of the libraries
7818 as well as the application itself should use the shared @file{libgcc}.
7819
7820 Therefore, the G++ and GCJ drivers automatically add
7821 @option{-shared-libgcc} whenever you build a shared library or a main
7822 executable, because C++ and Java programs typically use exceptions, so
7823 this is the right thing to do.
7824
7825 If, instead, you use the GCC driver to create shared libraries, you may
7826 find that they will not always be linked with the shared @file{libgcc}.
7827 If GCC finds, at its configuration time, that you have a non-GNU linker
7828 or a GNU linker that does not support option @option{--eh-frame-hdr},
7829 it will link the shared version of @file{libgcc} into shared libraries
7830 by default.  Otherwise, it will take advantage of the linker and optimize
7831 away the linking with the shared version of @file{libgcc}, linking with
7832 the static version of libgcc by default.  This allows exceptions to
7833 propagate through such shared libraries, without incurring relocation
7834 costs at library load time.
7835
7836 However, if a library or main executable is supposed to throw or catch
7837 exceptions, you must link it using the G++ or GCJ driver, as appropriate
7838 for the languages used in the program, or using the option
7839 @option{-shared-libgcc}, such that it is linked with the shared
7840 @file{libgcc}.
7841
7842 @item -symbolic
7843 @opindex symbolic
7844 Bind references to global symbols when building a shared object.  Warn
7845 about any unresolved references (unless overridden by the link editor
7846 option @samp{-Xlinker -z -Xlinker defs}).  Only a few systems support
7847 this option.
7848
7849 @item -Xlinker @var{option}
7850 @opindex Xlinker
7851 Pass @var{option} as an option to the linker.  You can use this to
7852 supply system-specific linker options which GCC does not know how to
7853 recognize.
7854
7855 If you want to pass an option that takes an argument, you must use
7856 @option{-Xlinker} twice, once for the option and once for the argument.
7857 For example, to pass @option{-assert definitions}, you must write
7858 @samp{-Xlinker -assert -Xlinker definitions}.  It does not work to write
7859 @option{-Xlinker "-assert definitions"}, because this passes the entire
7860 string as a single argument, which is not what the linker expects.
7861
7862 @item -Wl,@var{option}
7863 @opindex Wl
7864 Pass @var{option} as an option to the linker.  If @var{option} contains
7865 commas, it is split into multiple options at the commas.
7866
7867 @item -u @var{symbol}
7868 @opindex u
7869 Pretend the symbol @var{symbol} is undefined, to force linking of
7870 library modules to define it.  You can use @option{-u} multiple times with
7871 different symbols to force loading of additional library modules.
7872 @end table
7873
7874 @node Directory Options
7875 @section Options for Directory Search
7876 @cindex directory options
7877 @cindex options, directory search
7878 @cindex search path
7879
7880 These options specify directories to search for header files, for
7881 libraries and for parts of the compiler:
7882
7883 @table @gcctabopt
7884 @item -I@var{dir}
7885 @opindex I
7886 Add the directory @var{dir} to the head of the list of directories to be
7887 searched for header files.  This can be used to override a system header
7888 file, substituting your own version, since these directories are
7889 searched before the system header file directories.  However, you should
7890 not use this option to add directories that contain vendor-supplied
7891 system header files (use @option{-isystem} for that).  If you use more than
7892 one @option{-I} option, the directories are scanned in left-to-right
7893 order; the standard system directories come after.
7894
7895 If a standard system include directory, or a directory specified with
7896 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
7897 option will be ignored.  The directory will still be searched but as a
7898 system directory at its normal position in the system include chain.
7899 This is to ensure that GCC's procedure to fix buggy system headers and
7900 the ordering for the include_next directive are not inadvertently changed.
7901 If you really need to change the search order for system directories,
7902 use the @option{-nostdinc} and/or @option{-isystem} options.
7903
7904 @item -iquote@var{dir}
7905 @opindex iquote
7906 Add the directory @var{dir} to the head of the list of directories to
7907 be searched for header files only for the case of @samp{#include
7908 "@var{file}"}; they are not searched for @samp{#include <@var{file}>},
7909 otherwise just like @option{-I}.
7910
7911 @item -L@var{dir}
7912 @opindex L
7913 Add directory @var{dir} to the list of directories to be searched
7914 for @option{-l}.
7915
7916 @item -B@var{prefix}
7917 @opindex B
7918 This option specifies where to find the executables, libraries,
7919 include files, and data files of the compiler itself.
7920
7921 The compiler driver program runs one or more of the subprograms
7922 @file{cpp}, @file{cc1}, @file{as} and @file{ld}.  It tries
7923 @var{prefix} as a prefix for each program it tries to run, both with and
7924 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
7925
7926 For each subprogram to be run, the compiler driver first tries the
7927 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
7928 was not specified, the driver tries two standard prefixes, which are
7929 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
7930 those results in a file name that is found, the unmodified program
7931 name is searched for using the directories specified in your
7932 @env{PATH} environment variable.
7933
7934 The compiler will check to see if the path provided by the @option{-B}
7935 refers to a directory, and if necessary it will add a directory
7936 separator character at the end of the path.
7937
7938 @option{-B} prefixes that effectively specify directory names also apply
7939 to libraries in the linker, because the compiler translates these
7940 options into @option{-L} options for the linker.  They also apply to
7941 includes files in the preprocessor, because the compiler translates these
7942 options into @option{-isystem} options for the preprocessor.  In this case,
7943 the compiler appends @samp{include} to the prefix.
7944
7945 The run-time support file @file{libgcc.a} can also be searched for using
7946 the @option{-B} prefix, if needed.  If it is not found there, the two
7947 standard prefixes above are tried, and that is all.  The file is left
7948 out of the link if it is not found by those means.
7949
7950 Another way to specify a prefix much like the @option{-B} prefix is to use
7951 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
7952 Variables}.
7953
7954 As a special kludge, if the path provided by @option{-B} is
7955 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
7956 9, then it will be replaced by @file{[dir/]include}.  This is to help
7957 with boot-strapping the compiler.
7958
7959 @item -specs=@var{file}
7960 @opindex specs
7961 Process @var{file} after the compiler reads in the standard @file{specs}
7962 file, in order to override the defaults that the @file{gcc} driver
7963 program uses when determining what switches to pass to @file{cc1},
7964 @file{cc1plus}, @file{as}, @file{ld}, etc.  More than one
7965 @option{-specs=@var{file}} can be specified on the command line, and they
7966 are processed in order, from left to right.
7967
7968 @item --sysroot=@var{dir}
7969 @opindex sysroot
7970 Use @var{dir} as the logical root directory for headers and libraries.
7971 For example, if the compiler would normally search for headers in
7972 @file{/usr/include} and libraries in @file{/usr/lib}, it will instead
7973 search @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
7974
7975 If you use both this option and the @option{-isysroot} option, then
7976 the @option{--sysroot} option will apply to libraries, but the
7977 @option{-isysroot} option will apply to header files.
7978
7979 The GNU linker (beginning with version 2.16) has the necessary support
7980 for this option.  If your linker does not support this option, the
7981 header file aspect of @option{--sysroot} will still work, but the
7982 library aspect will not.
7983
7984 @item -I-
7985 @opindex I-
7986 This option has been deprecated.  Please use @option{-iquote} instead for
7987 @option{-I} directories before the @option{-I-} and remove the @option{-I-}.
7988 Any directories you specify with @option{-I} options before the @option{-I-}
7989 option are searched only for the case of @samp{#include "@var{file}"};
7990 they are not searched for @samp{#include <@var{file}>}.
7991
7992 If additional directories are specified with @option{-I} options after
7993 the @option{-I-}, these directories are searched for all @samp{#include}
7994 directives.  (Ordinarily @emph{all} @option{-I} directories are used
7995 this way.)
7996
7997 In addition, the @option{-I-} option inhibits the use of the current
7998 directory (where the current input file came from) as the first search
7999 directory for @samp{#include "@var{file}"}.  There is no way to
8000 override this effect of @option{-I-}.  With @option{-I.} you can specify
8001 searching the directory which was current when the compiler was
8002 invoked.  That is not exactly the same as what the preprocessor does
8003 by default, but it is often satisfactory.
8004
8005 @option{-I-} does not inhibit the use of the standard system directories
8006 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
8007 independent.
8008 @end table
8009
8010 @c man end
8011
8012 @node Spec Files
8013 @section Specifying subprocesses and the switches to pass to them
8014 @cindex Spec Files
8015
8016 @command{gcc} is a driver program.  It performs its job by invoking a
8017 sequence of other programs to do the work of compiling, assembling and
8018 linking.  GCC interprets its command-line parameters and uses these to
8019 deduce which programs it should invoke, and which command-line options
8020 it ought to place on their command lines.  This behavior is controlled
8021 by @dfn{spec strings}.  In most cases there is one spec string for each
8022 program that GCC can invoke, but a few programs have multiple spec
8023 strings to control their behavior.  The spec strings built into GCC can
8024 be overridden by using the @option{-specs=} command-line switch to specify
8025 a spec file.
8026
8027 @dfn{Spec files} are plaintext files that are used to construct spec
8028 strings.  They consist of a sequence of directives separated by blank
8029 lines.  The type of directive is determined by the first non-whitespace
8030 character on the line and it can be one of the following:
8031
8032 @table @code
8033 @item %@var{command}
8034 Issues a @var{command} to the spec file processor.  The commands that can
8035 appear here are:
8036
8037 @table @code
8038 @item %include <@var{file}>
8039 @cindex %include
8040 Search for @var{file} and insert its text at the current point in the
8041 specs file.
8042
8043 @item %include_noerr <@var{file}>
8044 @cindex %include_noerr
8045 Just like @samp{%include}, but do not generate an error message if the include
8046 file cannot be found.
8047
8048 @item %rename @var{old_name} @var{new_name}
8049 @cindex %rename
8050 Rename the spec string @var{old_name} to @var{new_name}.
8051
8052 @end table
8053
8054 @item *[@var{spec_name}]:
8055 This tells the compiler to create, override or delete the named spec
8056 string.  All lines after this directive up to the next directive or
8057 blank line are considered to be the text for the spec string.  If this
8058 results in an empty string then the spec will be deleted.  (Or, if the
8059 spec did not exist, then nothing will happened.)  Otherwise, if the spec
8060 does not currently exist a new spec will be created.  If the spec does
8061 exist then its contents will be overridden by the text of this
8062 directive, unless the first character of that text is the @samp{+}
8063 character, in which case the text will be appended to the spec.
8064
8065 @item [@var{suffix}]:
8066 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
8067 and up to the next directive or blank line are considered to make up the
8068 spec string for the indicated suffix.  When the compiler encounters an
8069 input file with the named suffix, it will processes the spec string in
8070 order to work out how to compile that file.  For example:
8071
8072 @smallexample
8073 .ZZ:
8074 z-compile -input %i
8075 @end smallexample
8076
8077 This says that any input file whose name ends in @samp{.ZZ} should be
8078 passed to the program @samp{z-compile}, which should be invoked with the
8079 command-line switch @option{-input} and with the result of performing the
8080 @samp{%i} substitution.  (See below.)
8081
8082 As an alternative to providing a spec string, the text that follows a
8083 suffix directive can be one of the following:
8084
8085 @table @code
8086 @item @@@var{language}
8087 This says that the suffix is an alias for a known @var{language}.  This is
8088 similar to using the @option{-x} command-line switch to GCC to specify a
8089 language explicitly.  For example:
8090
8091 @smallexample
8092 .ZZ:
8093 @@c++
8094 @end smallexample
8095
8096 Says that .ZZ files are, in fact, C++ source files.
8097
8098 @item #@var{name}
8099 This causes an error messages saying:
8100
8101 @smallexample
8102 @var{name} compiler not installed on this system.
8103 @end smallexample
8104 @end table
8105
8106 GCC already has an extensive list of suffixes built into it.
8107 This directive will add an entry to the end of the list of suffixes, but
8108 since the list is searched from the end backwards, it is effectively
8109 possible to override earlier entries using this technique.
8110
8111 @end table
8112
8113 GCC has the following spec strings built into it.  Spec files can
8114 override these strings or create their own.  Note that individual
8115 targets can also add their own spec strings to this list.
8116
8117 @smallexample
8118 asm          Options to pass to the assembler
8119 asm_final    Options to pass to the assembler post-processor
8120 cpp          Options to pass to the C preprocessor
8121 cc1          Options to pass to the C compiler
8122 cc1plus      Options to pass to the C++ compiler
8123 endfile      Object files to include at the end of the link
8124 link         Options to pass to the linker
8125 lib          Libraries to include on the command line to the linker
8126 libgcc       Decides which GCC support library to pass to the linker
8127 linker       Sets the name of the linker
8128 predefines   Defines to be passed to the C preprocessor
8129 signed_char  Defines to pass to CPP to say whether @code{char} is signed
8130              by default
8131 startfile    Object files to include at the start of the link
8132 @end smallexample
8133
8134 Here is a small example of a spec file:
8135
8136 @smallexample
8137 %rename lib                 old_lib
8138
8139 *lib:
8140 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
8141 @end smallexample
8142
8143 This example renames the spec called @samp{lib} to @samp{old_lib} and
8144 then overrides the previous definition of @samp{lib} with a new one.
8145 The new definition adds in some extra command-line options before
8146 including the text of the old definition.
8147
8148 @dfn{Spec strings} are a list of command-line options to be passed to their
8149 corresponding program.  In addition, the spec strings can contain
8150 @samp{%}-prefixed sequences to substitute variable text or to
8151 conditionally insert text into the command line.  Using these constructs
8152 it is possible to generate quite complex command lines.
8153
8154 Here is a table of all defined @samp{%}-sequences for spec
8155 strings.  Note that spaces are not generated automatically around the
8156 results of expanding these sequences.  Therefore you can concatenate them
8157 together or combine them with constant text in a single argument.
8158
8159 @table @code
8160 @item %%
8161 Substitute one @samp{%} into the program name or argument.
8162
8163 @item %i
8164 Substitute the name of the input file being processed.
8165
8166 @item %b
8167 Substitute the basename of the input file being processed.
8168 This is the substring up to (and not including) the last period
8169 and not including the directory.
8170
8171 @item %B
8172 This is the same as @samp{%b}, but include the file suffix (text after
8173 the last period).
8174
8175 @item %d
8176 Marks the argument containing or following the @samp{%d} as a
8177 temporary file name, so that that file will be deleted if GCC exits
8178 successfully.  Unlike @samp{%g}, this contributes no text to the
8179 argument.
8180
8181 @item %g@var{suffix}
8182 Substitute a file name that has suffix @var{suffix} and is chosen
8183 once per compilation, and mark the argument in the same way as
8184 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
8185 name is now chosen in a way that is hard to predict even when previously
8186 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
8187 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
8188 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
8189 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
8190 was simply substituted with a file name chosen once per compilation,
8191 without regard to any appended suffix (which was therefore treated
8192 just like ordinary text), making such attacks more likely to succeed.
8193
8194 @item %u@var{suffix}
8195 Like @samp{%g}, but generates a new temporary file name even if
8196 @samp{%u@var{suffix}} was already seen.
8197
8198 @item %U@var{suffix}
8199 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
8200 new one if there is no such last file name.  In the absence of any
8201 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
8202 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
8203 would involve the generation of two distinct file names, one
8204 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
8205 simply substituted with a file name chosen for the previous @samp{%u},
8206 without regard to any appended suffix.
8207
8208 @item %j@var{suffix}
8209 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
8210 writable, and if save-temps is off; otherwise, substitute the name
8211 of a temporary file, just like @samp{%u}.  This temporary file is not
8212 meant for communication between processes, but rather as a junk
8213 disposal mechanism.
8214
8215 @item %|@var{suffix}
8216 @itemx %m@var{suffix}
8217 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
8218 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
8219 all.  These are the two most common ways to instruct a program that it
8220 should read from standard input or write to standard output.  If you
8221 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
8222 construct: see for example @file{f/lang-specs.h}.
8223
8224 @item %.@var{SUFFIX}
8225 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
8226 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
8227 terminated by the next space or %.
8228
8229 @item %w
8230 Marks the argument containing or following the @samp{%w} as the
8231 designated output file of this compilation.  This puts the argument
8232 into the sequence of arguments that @samp{%o} will substitute later.
8233
8234 @item %o
8235 Substitutes the names of all the output files, with spaces
8236 automatically placed around them.  You should write spaces
8237 around the @samp{%o} as well or the results are undefined.
8238 @samp{%o} is for use in the specs for running the linker.
8239 Input files whose names have no recognized suffix are not compiled
8240 at all, but they are included among the output files, so they will
8241 be linked.
8242
8243 @item %O
8244 Substitutes the suffix for object files.  Note that this is
8245 handled specially when it immediately follows @samp{%g, %u, or %U},
8246 because of the need for those to form complete file names.  The
8247 handling is such that @samp{%O} is treated exactly as if it had already
8248 been substituted, except that @samp{%g, %u, and %U} do not currently
8249 support additional @var{suffix} characters following @samp{%O} as they would
8250 following, for example, @samp{.o}.
8251
8252 @item %p
8253 Substitutes the standard macro predefinitions for the
8254 current target machine.  Use this when running @code{cpp}.
8255
8256 @item %P
8257 Like @samp{%p}, but puts @samp{__} before and after the name of each
8258 predefined macro, except for macros that start with @samp{__} or with
8259 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
8260 C@.
8261
8262 @item %I
8263 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
8264 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
8265 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
8266 and @option{-imultilib} as necessary.
8267
8268 @item %s
8269 Current argument is the name of a library or startup file of some sort.
8270 Search for that file in a standard list of directories and substitute
8271 the full name found.
8272
8273 @item %e@var{str}
8274 Print @var{str} as an error message.  @var{str} is terminated by a newline.
8275 Use this when inconsistent options are detected.
8276
8277 @item %(@var{name})
8278 Substitute the contents of spec string @var{name} at this point.
8279
8280 @item %[@var{name}]
8281 Like @samp{%(@dots{})} but put @samp{__} around @option{-D} arguments.
8282
8283 @item %x@{@var{option}@}
8284 Accumulate an option for @samp{%X}.
8285
8286 @item %X
8287 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
8288 spec string.
8289
8290 @item %Y
8291 Output the accumulated assembler options specified by @option{-Wa}.
8292
8293 @item %Z
8294 Output the accumulated preprocessor options specified by @option{-Wp}.
8295
8296 @item %a
8297 Process the @code{asm} spec.  This is used to compute the
8298 switches to be passed to the assembler.
8299
8300 @item %A
8301 Process the @code{asm_final} spec.  This is a spec string for
8302 passing switches to an assembler post-processor, if such a program is
8303 needed.
8304
8305 @item %l
8306 Process the @code{link} spec.  This is the spec for computing the
8307 command line passed to the linker.  Typically it will make use of the
8308 @samp{%L %G %S %D and %E} sequences.
8309
8310 @item %D
8311 Dump out a @option{-L} option for each directory that GCC believes might
8312 contain startup files.  If the target supports multilibs then the
8313 current multilib directory will be prepended to each of these paths.
8314
8315 @item %L
8316 Process the @code{lib} spec.  This is a spec string for deciding which
8317 libraries should be included on the command line to the linker.
8318
8319 @item %G
8320 Process the @code{libgcc} spec.  This is a spec string for deciding
8321 which GCC support library should be included on the command line to the linker.
8322
8323 @item %S
8324 Process the @code{startfile} spec.  This is a spec for deciding which
8325 object files should be the first ones passed to the linker.  Typically
8326 this might be a file named @file{crt0.o}.
8327
8328 @item %E
8329 Process the @code{endfile} spec.  This is a spec string that specifies
8330 the last object files that will be passed to the linker.
8331
8332 @item %C
8333 Process the @code{cpp} spec.  This is used to construct the arguments
8334 to be passed to the C preprocessor.
8335
8336 @item %1
8337 Process the @code{cc1} spec.  This is used to construct the options to be
8338 passed to the actual C compiler (@samp{cc1}).
8339
8340 @item %2
8341 Process the @code{cc1plus} spec.  This is used to construct the options to be
8342 passed to the actual C++ compiler (@samp{cc1plus}).
8343
8344 @item %*
8345 Substitute the variable part of a matched option.  See below.
8346 Note that each comma in the substituted string is replaced by
8347 a single space.
8348
8349 @item %<@code{S}
8350 Remove all occurrences of @code{-S} from the command line.  Note---this
8351 command is position dependent.  @samp{%} commands in the spec string
8352 before this one will see @code{-S}, @samp{%} commands in the spec string
8353 after this one will not.
8354
8355 @item %:@var{function}(@var{args})
8356 Call the named function @var{function}, passing it @var{args}.
8357 @var{args} is first processed as a nested spec string, then split
8358 into an argument vector in the usual fashion.  The function returns
8359 a string which is processed as if it had appeared literally as part
8360 of the current spec.
8361
8362 The following built-in spec functions are provided:
8363
8364 @table @code
8365 @item @code{getenv}
8366 The @code{getenv} spec function takes two arguments: an environment
8367 variable name and a string.  If the environment variable is not
8368 defined, a fatal error is issued.  Otherwise, the return value is the
8369 value of the environment variable concatenated with the string.  For
8370 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
8371
8372 @smallexample
8373 %:getenv(TOPDIR /include)
8374 @end smallexample
8375
8376 expands to @file{/path/to/top/include}.
8377
8378 @item @code{if-exists}
8379 The @code{if-exists} spec function takes one argument, an absolute
8380 pathname to a file.  If the file exists, @code{if-exists} returns the
8381 pathname.  Here is a small example of its usage:
8382
8383 @smallexample
8384 *startfile:
8385 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
8386 @end smallexample
8387
8388 @item @code{if-exists-else}
8389 The @code{if-exists-else} spec function is similar to the @code{if-exists}
8390 spec function, except that it takes two arguments.  The first argument is
8391 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
8392 returns the pathname.  If it does not exist, it returns the second argument.
8393 This way, @code{if-exists-else} can be used to select one file or another,
8394 based on the existence of the first.  Here is a small example of its usage:
8395
8396 @smallexample
8397 *startfile:
8398 crt0%O%s %:if-exists(crti%O%s) \
8399 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
8400 @end smallexample
8401
8402 @item @code{replace-outfile}
8403 The @code{replace-outfile} spec function takes two arguments.  It looks for the
8404 first argument in the outfiles array and replaces it with the second argument.  Here
8405 is a small example of its usage:
8406
8407 @smallexample
8408 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
8409 @end smallexample
8410
8411 @item @code{print-asm-header}
8412 The @code{print-asm-header} function takes no arguments and simply
8413 prints a banner like:
8414
8415 @smallexample
8416 Assembler options
8417 =================
8418
8419 Use "-Wa,OPTION" to pass "OPTION" to the assembler.
8420 @end smallexample
8421
8422 It is used to separate compiler options from assembler options
8423 in the @option{--target-help} output.
8424 @end table
8425
8426 @item %@{@code{S}@}
8427 Substitutes the @code{-S} switch, if that switch was given to GCC@.
8428 If that switch was not specified, this substitutes nothing.  Note that
8429 the leading dash is omitted when specifying this option, and it is
8430 automatically inserted if the substitution is performed.  Thus the spec
8431 string @samp{%@{foo@}} would match the command-line option @option{-foo}
8432 and would output the command line option @option{-foo}.
8433
8434 @item %W@{@code{S}@}
8435 Like %@{@code{S}@} but mark last argument supplied within as a file to be
8436 deleted on failure.
8437
8438 @item %@{@code{S}*@}
8439 Substitutes all the switches specified to GCC whose names start
8440 with @code{-S}, but which also take an argument.  This is used for
8441 switches like @option{-o}, @option{-D}, @option{-I}, etc.
8442 GCC considers @option{-o foo} as being
8443 one switch whose names starts with @samp{o}.  %@{o*@} would substitute this
8444 text, including the space.  Thus two arguments would be generated.
8445
8446 @item %@{@code{S}*&@code{T}*@}
8447 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
8448 (the order of @code{S} and @code{T} in the spec is not significant).
8449 There can be any number of ampersand-separated variables; for each the
8450 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
8451
8452 @item %@{@code{S}:@code{X}@}
8453 Substitutes @code{X}, if the @samp{-S} switch was given to GCC@.
8454
8455 @item %@{!@code{S}:@code{X}@}
8456 Substitutes @code{X}, if the @samp{-S} switch was @emph{not} given to GCC@.
8457
8458 @item %@{@code{S}*:@code{X}@}
8459 Substitutes @code{X} if one or more switches whose names start with
8460 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
8461 once, no matter how many such switches appeared.  However, if @code{%*}
8462 appears somewhere in @code{X}, then @code{X} will be substituted once
8463 for each matching switch, with the @code{%*} replaced by the part of
8464 that switch that matched the @code{*}.
8465
8466 @item %@{.@code{S}:@code{X}@}
8467 Substitutes @code{X}, if processing a file with suffix @code{S}.
8468
8469 @item %@{!.@code{S}:@code{X}@}
8470 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
8471
8472 @item %@{,@code{S}:@code{X}@}
8473 Substitutes @code{X}, if processing a file for language @code{S}.
8474
8475 @item %@{!,@code{S}:@code{X}@}
8476 Substitutes @code{X}, if not processing a file for language @code{S}.
8477
8478 @item %@{@code{S}|@code{P}:@code{X}@}
8479 Substitutes @code{X} if either @code{-S} or @code{-P} was given to
8480 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
8481 @code{*} sequences as well, although they have a stronger binding than
8482 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
8483 alternatives must be starred, and only the first matching alternative
8484 is substituted.
8485
8486 For example, a spec string like this:
8487
8488 @smallexample
8489 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
8490 @end smallexample
8491
8492 will output the following command-line options from the following input
8493 command-line options:
8494
8495 @smallexample
8496 fred.c        -foo -baz
8497 jim.d         -bar -boggle
8498 -d fred.c     -foo -baz -boggle
8499 -d jim.d      -bar -baz -boggle
8500 @end smallexample
8501
8502 @item %@{S:X; T:Y; :D@}
8503
8504 If @code{S} was given to GCC, substitutes @code{X}; else if @code{T} was
8505 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
8506 be as many clauses as you need.  This may be combined with @code{.},
8507 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
8508
8509
8510 @end table
8511
8512 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
8513 construct may contain other nested @samp{%} constructs or spaces, or
8514 even newlines.  They are processed as usual, as described above.
8515 Trailing white space in @code{X} is ignored.  White space may also
8516 appear anywhere on the left side of the colon in these constructs,
8517 except between @code{.} or @code{*} and the corresponding word.
8518
8519 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
8520 handled specifically in these constructs.  If another value of
8521 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
8522 @option{-W} switch is found later in the command line, the earlier
8523 switch value is ignored, except with @{@code{S}*@} where @code{S} is
8524 just one letter, which passes all matching options.
8525
8526 The character @samp{|} at the beginning of the predicate text is used to
8527 indicate that a command should be piped to the following command, but
8528 only if @option{-pipe} is specified.
8529
8530 It is built into GCC which switches take arguments and which do not.
8531 (You might think it would be useful to generalize this to allow each
8532 compiler's spec to say which switches take arguments.  But this cannot
8533 be done in a consistent fashion.  GCC cannot even decide which input
8534 files have been specified without knowing which switches take arguments,
8535 and it must know which input files to compile in order to tell which
8536 compilers to run).
8537
8538 GCC also knows implicitly that arguments starting in @option{-l} are to be
8539 treated as compiler output files, and passed to the linker in their
8540 proper position among the other output files.
8541
8542 @c man begin OPTIONS
8543
8544 @node Target Options
8545 @section Specifying Target Machine and Compiler Version
8546 @cindex target options
8547 @cindex cross compiling
8548 @cindex specifying machine version
8549 @cindex specifying compiler version and target machine
8550 @cindex compiler version, specifying
8551 @cindex target machine, specifying
8552
8553 The usual way to run GCC is to run the executable called @file{gcc}, or
8554 @file{<machine>-gcc} when cross-compiling, or
8555 @file{<machine>-gcc-<version>} to run a version other than the one that
8556 was installed last.  Sometimes this is inconvenient, so GCC provides
8557 options that will switch to another cross-compiler or version.
8558
8559 @table @gcctabopt
8560 @item -b @var{machine}
8561 @opindex b
8562 The argument @var{machine} specifies the target machine for compilation.
8563
8564 The value to use for @var{machine} is the same as was specified as the
8565 machine type when configuring GCC as a cross-compiler.  For
8566 example, if a cross-compiler was configured with @samp{configure
8567 arm-elf}, meaning to compile for an arm processor with elf binaries,
8568 then you would specify @option{-b arm-elf} to run that cross compiler.
8569 Because there are other options beginning with @option{-b}, the
8570 configuration must contain a hyphen.
8571
8572 @item -V @var{version}
8573 @opindex V
8574 The argument @var{version} specifies which version of GCC to run.
8575 This is useful when multiple versions are installed.  For example,
8576 @var{version} might be @samp{4.0}, meaning to run GCC version 4.0.
8577 @end table
8578
8579 The @option{-V} and @option{-b} options work by running the
8580 @file{<machine>-gcc-<version>} executable, so there's no real reason to
8581 use them if you can just run that directly.
8582
8583 @node Submodel Options
8584 @section Hardware Models and Configurations
8585 @cindex submodel options
8586 @cindex specifying hardware config
8587 @cindex hardware models and configurations, specifying
8588 @cindex machine dependent options
8589
8590 Earlier we discussed the standard option @option{-b} which chooses among
8591 different installed compilers for completely different target
8592 machines, such as VAX vs.@: 68000 vs.@: 80386.
8593
8594 In addition, each of these target machine types can have its own
8595 special options, starting with @samp{-m}, to choose among various
8596 hardware models or configurations---for example, 68010 vs 68020,
8597 floating coprocessor or none.  A single installed version of the
8598 compiler can compile for any model or configuration, according to the
8599 options specified.
8600
8601 Some configurations of the compiler also support additional special
8602 options, usually for compatibility with other compilers on the same
8603 platform.
8604
8605 @c This list is ordered alphanumerically by subsection name.
8606 @c It should be the same order and spelling as these options are listed
8607 @c in Machine Dependent Options
8608
8609 @menu
8610 * ARC Options::
8611 * ARM Options::
8612 * AVR Options::
8613 * Blackfin Options::
8614 * CRIS Options::
8615 * CRX Options::
8616 * Darwin Options::
8617 * DEC Alpha Options::
8618 * DEC Alpha/VMS Options::
8619 * FRV Options::
8620 * GNU/Linux Options::
8621 * H8/300 Options::
8622 * HPPA Options::
8623 * i386 and x86-64 Options::
8624 * IA-64 Options::
8625 * M32C Options::
8626 * M32R/D Options::
8627 * M680x0 Options::
8628 * M68hc1x Options::
8629 * MCore Options::
8630 * MIPS Options::
8631 * MMIX Options::
8632 * MN10300 Options::
8633 * PDP-11 Options::
8634 * picoChip Options::
8635 * PowerPC Options::
8636 * RS/6000 and PowerPC Options::
8637 * S/390 and zSeries Options::
8638 * Score Options::
8639 * SH Options::
8640 * SPARC Options::
8641 * SPU Options::
8642 * System V Options::
8643 * V850 Options::
8644 * VAX Options::
8645 * VxWorks Options::
8646 * x86-64 Options::
8647 * Xstormy16 Options::
8648 * Xtensa Options::
8649 * zSeries Options::
8650 @end menu
8651
8652 @node ARC Options
8653 @subsection ARC Options
8654 @cindex ARC Options
8655
8656 These options are defined for ARC implementations:
8657
8658 @table @gcctabopt
8659 @item -EL
8660 @opindex EL
8661 Compile code for little endian mode.  This is the default.
8662
8663 @item -EB
8664 @opindex EB
8665 Compile code for big endian mode.
8666
8667 @item -mmangle-cpu
8668 @opindex mmangle-cpu
8669 Prepend the name of the cpu to all public symbol names.
8670 In multiple-processor systems, there are many ARC variants with different
8671 instruction and register set characteristics.  This flag prevents code
8672 compiled for one cpu to be linked with code compiled for another.
8673 No facility exists for handling variants that are ``almost identical''.
8674 This is an all or nothing option.
8675
8676 @item -mcpu=@var{cpu}
8677 @opindex mcpu
8678 Compile code for ARC variant @var{cpu}.
8679 Which variants are supported depend on the configuration.
8680 All variants support @option{-mcpu=base}, this is the default.
8681
8682 @item -mtext=@var{text-section}
8683 @itemx -mdata=@var{data-section}
8684 @itemx -mrodata=@var{readonly-data-section}
8685 @opindex mtext
8686 @opindex mdata
8687 @opindex mrodata
8688 Put functions, data, and readonly data in @var{text-section},
8689 @var{data-section}, and @var{readonly-data-section} respectively
8690 by default.  This can be overridden with the @code{section} attribute.
8691 @xref{Variable Attributes}.
8692
8693 @end table
8694
8695 @node ARM Options
8696 @subsection ARM Options
8697 @cindex ARM options
8698
8699 These @samp{-m} options are defined for Advanced RISC Machines (ARM)
8700 architectures:
8701
8702 @table @gcctabopt
8703 @item -mabi=@var{name}
8704 @opindex mabi
8705 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
8706 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
8707
8708 @item -mapcs-frame
8709 @opindex mapcs-frame
8710 Generate a stack frame that is compliant with the ARM Procedure Call
8711 Standard for all functions, even if this is not strictly necessary for
8712 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
8713 with this option will cause the stack frames not to be generated for
8714 leaf functions.  The default is @option{-mno-apcs-frame}.
8715
8716 @item -mapcs
8717 @opindex mapcs
8718 This is a synonym for @option{-mapcs-frame}.
8719
8720 @ignore
8721 @c not currently implemented
8722 @item -mapcs-stack-check
8723 @opindex mapcs-stack-check
8724 Generate code to check the amount of stack space available upon entry to
8725 every function (that actually uses some stack space).  If there is
8726 insufficient space available then either the function
8727 @samp{__rt_stkovf_split_small} or @samp{__rt_stkovf_split_big} will be
8728 called, depending upon the amount of stack space required.  The run time
8729 system is required to provide these functions.  The default is
8730 @option{-mno-apcs-stack-check}, since this produces smaller code.
8731
8732 @c not currently implemented
8733 @item -mapcs-float
8734 @opindex mapcs-float
8735 Pass floating point arguments using the float point registers.  This is
8736 one of the variants of the APCS@.  This option is recommended if the
8737 target hardware has a floating point unit or if a lot of floating point
8738 arithmetic is going to be performed by the code.  The default is
8739 @option{-mno-apcs-float}, since integer only code is slightly increased in
8740 size if @option{-mapcs-float} is used.
8741
8742 @c not currently implemented
8743 @item -mapcs-reentrant
8744 @opindex mapcs-reentrant
8745 Generate reentrant, position independent code.  The default is
8746 @option{-mno-apcs-reentrant}.
8747 @end ignore
8748
8749 @item -mthumb-interwork
8750 @opindex mthumb-interwork
8751 Generate code which supports calling between the ARM and Thumb
8752 instruction sets.  Without this option the two instruction sets cannot
8753 be reliably used inside one program.  The default is
8754 @option{-mno-thumb-interwork}, since slightly larger code is generated
8755 when @option{-mthumb-interwork} is specified.
8756
8757 @item -mno-sched-prolog
8758 @opindex mno-sched-prolog
8759 Prevent the reordering of instructions in the function prolog, or the
8760 merging of those instruction with the instructions in the function's
8761 body.  This means that all functions will start with a recognizable set
8762 of instructions (or in fact one of a choice from a small set of
8763 different function prologues), and this information can be used to
8764 locate the start if functions inside an executable piece of code.  The
8765 default is @option{-msched-prolog}.
8766
8767 @item -mfloat-abi=@var{name}
8768 @opindex mfloat-abi
8769 Specifies which floating-point ABI to use.  Permissible values
8770 are: @samp{soft}, @samp{softfp} and @samp{hard}.
8771
8772 Specifying @samp{soft} causes GCC to generate output containing 
8773 library calls for floating-point operations.
8774 @samp{softfp} allows the generation of code using hardware floating-point 
8775 instructions, but still uses the soft-float calling conventions.  
8776 @samp{hard} allows generation of floating-point instructions 
8777 and uses FPU-specific calling conventions.
8778
8779 Using @option{-mfloat-abi=hard} with VFP coprocessors is not supported.
8780 Use @option{-mfloat-abi=softfp} with the appropriate @option{-mfpu} option
8781 to allow the compiler to generate code that makes use of the hardware
8782 floating-point capabilities for these CPUs.
8783
8784 The default depends on the specific target configuration.  Note that
8785 the hard-float and soft-float ABIs are not link-compatible; you must
8786 compile your entire program with the same ABI, and link with a
8787 compatible set of libraries.
8788
8789 @item -mhard-float
8790 @opindex mhard-float
8791 Equivalent to @option{-mfloat-abi=hard}.
8792
8793 @item -msoft-float
8794 @opindex msoft-float
8795 Equivalent to @option{-mfloat-abi=soft}.
8796
8797 @item -mlittle-endian
8798 @opindex mlittle-endian
8799 Generate code for a processor running in little-endian mode.  This is
8800 the default for all standard configurations.
8801
8802 @item -mbig-endian
8803 @opindex mbig-endian
8804 Generate code for a processor running in big-endian mode; the default is
8805 to compile code for a little-endian processor.
8806
8807 @item -mwords-little-endian
8808 @opindex mwords-little-endian
8809 This option only applies when generating code for big-endian processors.
8810 Generate code for a little-endian word order but a big-endian byte
8811 order.  That is, a byte order of the form @samp{32107654}.  Note: this
8812 option should only be used if you require compatibility with code for
8813 big-endian ARM processors generated by versions of the compiler prior to
8814 2.8.
8815
8816 @item -mcpu=@var{name}
8817 @opindex mcpu
8818 This specifies the name of the target ARM processor.  GCC uses this name
8819 to determine what kind of instructions it can emit when generating
8820 assembly code.  Permissible names are: @samp{arm2}, @samp{arm250},
8821 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
8822 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
8823 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
8824 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
8825 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
8826 @samp{arm8}, @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
8827 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
8828 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
8829 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
8830 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
8831 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
8832 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
8833 @samp{arm1156t2-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
8834 @samp{cortex-a8}, @samp{cortex-r4}, @samp{cortex-r4f}, @samp{cortex-m3},
8835 @samp{cortex-m1},
8836 @samp{xscale}, @samp{iwmmxt}, @samp{ep9312}.
8837
8838 @item -mtune=@var{name}
8839 @opindex mtune
8840 This option is very similar to the @option{-mcpu=} option, except that
8841 instead of specifying the actual target processor type, and hence
8842 restricting which instructions can be used, it specifies that GCC should
8843 tune the performance of the code as if the target were of the type
8844 specified in this option, but still choosing the instructions that it
8845 will generate based on the cpu specified by a @option{-mcpu=} option.
8846 For some ARM implementations better performance can be obtained by using
8847 this option.
8848
8849 @item -march=@var{name}
8850 @opindex march
8851 This specifies the name of the target ARM architecture.  GCC uses this
8852 name to determine what kind of instructions it can emit when generating
8853 assembly code.  This option can be used in conjunction with or instead
8854 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
8855 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
8856 @samp{armv5}, @samp{armv5t}, @samp{armv5te}, @samp{armv6}, @samp{armv6j},
8857 @samp{armv6t2}, @samp{armv6z}, @samp{armv6zk}, @samp{armv6-m},
8858 @samp{armv7}, @samp{armv7-a}, @samp{armv7-r}, @samp{armv7-m},
8859 @samp{iwmmxt}, @samp{ep9312}.
8860
8861 @item -mfpu=@var{name}
8862 @itemx -mfpe=@var{number}
8863 @itemx -mfp=@var{number}
8864 @opindex mfpu
8865 @opindex mfpe
8866 @opindex mfp
8867 This specifies what floating point hardware (or hardware emulation) is
8868 available on the target.  Permissible names are: @samp{fpa}, @samp{fpe2},
8869 @samp{fpe3}, @samp{maverick}, @samp{vfp}, @samp{vfpv3}, @samp{vfpv3-d16} and
8870 @samp{neon}.  @option{-mfp} and @option{-mfpe}
8871 are synonyms for @option{-mfpu}=@samp{fpe}@var{number}, for compatibility
8872 with older versions of GCC@.
8873
8874 If @option{-msoft-float} is specified this specifies the format of
8875 floating point values.
8876
8877 @item -mstructure-size-boundary=@var{n}
8878 @opindex mstructure-size-boundary
8879 The size of all structures and unions will be rounded up to a multiple
8880 of the number of bits set by this option.  Permissible values are 8, 32
8881 and 64.  The default value varies for different toolchains.  For the COFF
8882 targeted toolchain the default value is 8.  A value of 64 is only allowed
8883 if the underlying ABI supports it.
8884
8885 Specifying the larger number can produce faster, more efficient code, but
8886 can also increase the size of the program.  Different values are potentially
8887 incompatible.  Code compiled with one value cannot necessarily expect to
8888 work with code or libraries compiled with another value, if they exchange
8889 information using structures or unions.
8890
8891 @item -mabort-on-noreturn
8892 @opindex mabort-on-noreturn
8893 Generate a call to the function @code{abort} at the end of a
8894 @code{noreturn} function.  It will be executed if the function tries to
8895 return.
8896
8897 @item -mlong-calls
8898 @itemx -mno-long-calls
8899 @opindex mlong-calls
8900 @opindex mno-long-calls
8901 Tells the compiler to perform function calls by first loading the
8902 address of the function into a register and then performing a subroutine
8903 call on this register.  This switch is needed if the target function
8904 will lie outside of the 64 megabyte addressing range of the offset based
8905 version of subroutine call instruction.
8906
8907 Even if this switch is enabled, not all function calls will be turned
8908 into long calls.  The heuristic is that static functions, functions
8909 which have the @samp{short-call} attribute, functions that are inside
8910 the scope of a @samp{#pragma no_long_calls} directive and functions whose
8911 definitions have already been compiled within the current compilation
8912 unit, will not be turned into long calls.  The exception to this rule is
8913 that weak function definitions, functions with the @samp{long-call}
8914 attribute or the @samp{section} attribute, and functions that are within
8915 the scope of a @samp{#pragma long_calls} directive, will always be
8916 turned into long calls.
8917
8918 This feature is not enabled by default.  Specifying
8919 @option{-mno-long-calls} will restore the default behavior, as will
8920 placing the function calls within the scope of a @samp{#pragma
8921 long_calls_off} directive.  Note these switches have no effect on how
8922 the compiler generates code to handle function calls via function
8923 pointers.
8924
8925 @item -mnop-fun-dllimport
8926 @opindex mnop-fun-dllimport
8927 Disable support for the @code{dllimport} attribute.
8928
8929 @item -msingle-pic-base
8930 @opindex msingle-pic-base
8931 Treat the register used for PIC addressing as read-only, rather than
8932 loading it in the prologue for each function.  The run-time system is
8933 responsible for initializing this register with an appropriate value
8934 before execution begins.
8935
8936 @item -mpic-register=@var{reg}
8937 @opindex mpic-register
8938 Specify the register to be used for PIC addressing.  The default is R10
8939 unless stack-checking is enabled, when R9 is used.
8940
8941 @item -mcirrus-fix-invalid-insns
8942 @opindex mcirrus-fix-invalid-insns
8943 @opindex mno-cirrus-fix-invalid-insns
8944 Insert NOPs into the instruction stream to in order to work around
8945 problems with invalid Maverick instruction combinations.  This option
8946 is only valid if the @option{-mcpu=ep9312} option has been used to
8947 enable generation of instructions for the Cirrus Maverick floating
8948 point co-processor.  This option is not enabled by default, since the
8949 problem is only present in older Maverick implementations.  The default
8950 can be re-enabled by use of the @option{-mno-cirrus-fix-invalid-insns}
8951 switch.
8952
8953 @item -mpoke-function-name
8954 @opindex mpoke-function-name
8955 Write the name of each function into the text section, directly
8956 preceding the function prologue.  The generated code is similar to this:
8957
8958 @smallexample
8959      t0
8960          .ascii "arm_poke_function_name", 0
8961          .align
8962      t1
8963          .word 0xff000000 + (t1 - t0)
8964      arm_poke_function_name
8965          mov     ip, sp
8966          stmfd   sp!, @{fp, ip, lr, pc@}
8967          sub     fp, ip, #4
8968 @end smallexample
8969
8970 When performing a stack backtrace, code can inspect the value of
8971 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
8972 location @code{pc - 12} and the top 8 bits are set, then we know that
8973 there is a function name embedded immediately preceding this location
8974 and has length @code{((pc[-3]) & 0xff000000)}.
8975
8976 @item -mthumb
8977 @opindex mthumb
8978 Generate code for the Thumb instruction set.  The default is to
8979 use the 32-bit ARM instruction set.
8980 This option automatically enables either 16-bit Thumb-1 or
8981 mixed 16/32-bit Thumb-2 instructions based on the @option{-mcpu=@var{name}}
8982 and @option{-march=@var{name}} options.
8983
8984 @item -mtpcs-frame
8985 @opindex mtpcs-frame
8986 Generate a stack frame that is compliant with the Thumb Procedure Call
8987 Standard for all non-leaf functions.  (A leaf function is one that does
8988 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
8989
8990 @item -mtpcs-leaf-frame
8991 @opindex mtpcs-leaf-frame
8992 Generate a stack frame that is compliant with the Thumb Procedure Call
8993 Standard for all leaf functions.  (A leaf function is one that does
8994 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
8995
8996 @item -mcallee-super-interworking
8997 @opindex mcallee-super-interworking
8998 Gives all externally visible functions in the file being compiled an ARM
8999 instruction set header which switches to Thumb mode before executing the
9000 rest of the function.  This allows these functions to be called from
9001 non-interworking code.
9002
9003 @item -mcaller-super-interworking
9004 @opindex mcaller-super-interworking
9005 Allows calls via function pointers (including virtual functions) to
9006 execute correctly regardless of whether the target code has been
9007 compiled for interworking or not.  There is a small overhead in the cost
9008 of executing a function pointer if this option is enabled.
9009
9010 @item -mtp=@var{name}
9011 @opindex mtp
9012 Specify the access model for the thread local storage pointer.  The valid
9013 models are @option{soft}, which generates calls to @code{__aeabi_read_tp},
9014 @option{cp15}, which fetches the thread pointer from @code{cp15} directly
9015 (supported in the arm6k architecture), and @option{auto}, which uses the
9016 best available method for the selected processor.  The default setting is
9017 @option{auto}.
9018
9019 @item -mword-relocations
9020 @opindex mword-relocations
9021 Only generate absolute relocations on word sized values (i.e. R_ARM_ABS32).
9022 This is enabled by default on targets (uClinux, SymbianOS) where the runtime
9023 loader imposes this restriction, and when @option{-fpic} or @option{-fPIC}
9024 is speficied.
9025
9026 @end table
9027
9028 @node AVR Options
9029 @subsection AVR Options
9030 @cindex AVR Options
9031
9032 These options are defined for AVR implementations:
9033
9034 @table @gcctabopt
9035 @item -mmcu=@var{mcu}
9036 @opindex mmcu
9037 Specify ATMEL AVR instruction set or MCU type.
9038
9039 Instruction set avr1 is for the minimal AVR core, not supported by the C
9040 compiler, only for assembler programs (MCU types: at90s1200, attiny10,
9041 attiny11, attiny12, attiny15, attiny28).
9042
9043 Instruction set avr2 (default) is for the classic AVR core with up to
9044 8K program memory space (MCU types: at90s2313, at90s2323, attiny22,
9045 at90s2333, at90s2343, at90s4414, at90s4433, at90s4434, at90s8515,
9046 at90c8534, at90s8535).
9047
9048 Instruction set avr3 is for the classic AVR core with up to 128K program
9049 memory space (MCU types: atmega103, atmega603, at43usb320, at76c711).
9050
9051 Instruction set avr4 is for the enhanced AVR core with up to 8K program
9052 memory space (MCU types: atmega8, atmega83, atmega85).
9053
9054 Instruction set avr5 is for the enhanced AVR core with up to 128K program
9055 memory space (MCU types: atmega16, atmega161, atmega163, atmega32, atmega323,
9056 atmega64, atmega128, at43usb355, at94k).
9057
9058 @item -msize
9059 @opindex msize
9060 Output instruction sizes to the asm file.
9061
9062 @item -minit-stack=@var{N}
9063 @opindex minit-stack
9064 Specify the initial stack address, which may be a symbol or numeric value,
9065 @samp{__stack} is the default.
9066
9067 @item -mno-interrupts
9068 @opindex mno-interrupts
9069 Generated code is not compatible with hardware interrupts.
9070 Code size will be smaller.
9071
9072 @item -mcall-prologues
9073 @opindex mcall-prologues
9074 Functions prologues/epilogues expanded as call to appropriate
9075 subroutines.  Code size will be smaller.
9076
9077 @item -mno-tablejump
9078 @opindex mno-tablejump
9079 Do not generate tablejump insns which sometimes increase code size.
9080
9081 @item -mtiny-stack
9082 @opindex mtiny-stack
9083 Change only the low 8 bits of the stack pointer.
9084
9085 @item -mint8
9086 @opindex mint8
9087 Assume int to be 8 bit integer.  This affects the sizes of all types: A
9088 char will be 1 byte, an int will be 1 byte, an long will be 2 bytes
9089 and long long will be 4 bytes.  Please note that this option does not
9090 comply to the C standards, but it will provide you with smaller code
9091 size.
9092 @end table
9093
9094 @node Blackfin Options
9095 @subsection Blackfin Options
9096 @cindex Blackfin Options
9097
9098 @table @gcctabopt
9099 @item -mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]}
9100 @opindex mcpu=
9101 Specifies the name of the target Blackfin processor.  Currently, @var{cpu}
9102 can be one of @samp{bf522}, @samp{bf523}, @samp{bf524},
9103 @samp{bf525}, @samp{bf526}, @samp{bf527},
9104 @samp{bf531}, @samp{bf532}, @samp{bf533}, @samp{bf534},
9105 @samp{bf536}, @samp{bf537}, @samp{bf538}, @samp{bf539},
9106 @samp{bf542}, @samp{bf544}, @samp{bf547}, @samp{bf548}, @samp{bf549},
9107 @samp{bf561}.
9108 The optional @var{sirevision} specifies the silicon revision of the target
9109 Blackfin processor.  Any workarounds available for the targeted silicon revision
9110 will be enabled.  If @var{sirevision} is @samp{none}, no workarounds are enabled.
9111 If @var{sirevision} is @samp{any}, all workarounds for the targeted processor
9112 will be enabled.  The @code{__SILICON_REVISION__} macro is defined to two
9113 hexadecimal digits representing the major and minor numbers in the silicon
9114 revision.  If @var{sirevision} is @samp{none}, the @code{__SILICON_REVISION__}
9115 is not defined.  If @var{sirevision} is @samp{any}, the
9116 @code{__SILICON_REVISION__} is defined to be @code{0xffff}.
9117 If this optional @var{sirevision} is not used, GCC assumes the latest known
9118 silicon revision of the targeted Blackfin processor.
9119
9120 Support for @samp{bf561} is incomplete.  For @samp{bf561},
9121 Only the processor macro is defined.
9122 Without this option, @samp{bf532} is used as the processor by default.
9123 The corresponding predefined processor macros for @var{cpu} is to
9124 be defined.  And for @samp{bfin-elf} toolchain, this causes the hardware BSP
9125 provided by libgloss to be linked in if @option{-msim} is not given.
9126
9127 @item -msim
9128 @opindex msim
9129 Specifies that the program will be run on the simulator.  This causes
9130 the simulator BSP provided by libgloss to be linked in.  This option
9131 has effect only for @samp{bfin-elf} toolchain.
9132 Certain other options, such as @option{-mid-shared-library} and
9133 @option{-mfdpic}, imply @option{-msim}.
9134
9135 @item -momit-leaf-frame-pointer
9136 @opindex momit-leaf-frame-pointer
9137 Don't keep the frame pointer in a register for leaf functions.  This
9138 avoids the instructions to save, set up and restore frame pointers and
9139 makes an extra register available in leaf functions.  The option
9140 @option{-fomit-frame-pointer} removes the frame pointer for all functions
9141 which might make debugging harder.
9142
9143 @item -mspecld-anomaly
9144 @opindex mspecld-anomaly
9145 When enabled, the compiler will ensure that the generated code does not
9146 contain speculative loads after jump instructions. If this option is used,
9147 @code{__WORKAROUND_SPECULATIVE_LOADS} is defined.
9148
9149 @item -mno-specld-anomaly
9150 @opindex mno-specld-anomaly
9151 Don't generate extra code to prevent speculative loads from occurring.
9152
9153 @item -mcsync-anomaly
9154 @opindex mcsync-anomaly
9155 When enabled, the compiler will ensure that the generated code does not
9156 contain CSYNC or SSYNC instructions too soon after conditional branches.
9157 If this option is used, @code{__WORKAROUND_SPECULATIVE_SYNCS} is defined.
9158
9159 @item -mno-csync-anomaly
9160 @opindex mno-csync-anomaly
9161 Don't generate extra code to prevent CSYNC or SSYNC instructions from
9162 occurring too soon after a conditional branch.
9163
9164 @item -mlow-64k
9165 @opindex mlow-64k
9166 When enabled, the compiler is free to take advantage of the knowledge that
9167 the entire program fits into the low 64k of memory.
9168
9169 @item -mno-low-64k
9170 @opindex mno-low-64k
9171 Assume that the program is arbitrarily large.  This is the default.
9172
9173 @item -mstack-check-l1
9174 @opindex mstack-check-l1
9175 Do stack checking using information placed into L1 scratchpad memory by the
9176 uClinux kernel.
9177
9178 @item -mid-shared-library
9179 @opindex mid-shared-library
9180 Generate code that supports shared libraries via the library ID method.
9181 This allows for execute in place and shared libraries in an environment
9182 without virtual memory management.  This option implies @option{-fPIC}.
9183 With a @samp{bfin-elf} target, this option implies @option{-msim}.
9184
9185 @item -mno-id-shared-library
9186 @opindex mno-id-shared-library
9187 Generate code that doesn't assume ID based shared libraries are being used.
9188 This is the default.
9189
9190 @item -mleaf-id-shared-library
9191 @opindex mleaf-id-shared-library
9192 Generate code that supports shared libraries via the library ID method,
9193 but assumes that this library or executable won't link against any other
9194 ID shared libraries.  That allows the compiler to use faster code for jumps
9195 and calls.
9196
9197 @item -mno-leaf-id-shared-library
9198 @opindex mno-leaf-id-shared-library
9199 Do not assume that the code being compiled won't link against any ID shared
9200 libraries.  Slower code will be generated for jump and call insns.
9201
9202 @item -mshared-library-id=n
9203 @opindex mshared-library-id
9204 Specified the identification number of the ID based shared library being
9205 compiled.  Specifying a value of 0 will generate more compact code, specifying
9206 other values will force the allocation of that number to the current
9207 library but is no more space or time efficient than omitting this option.
9208
9209 @item -msep-data
9210 @opindex msep-data
9211 Generate code that allows the data segment to be located in a different
9212 area of memory from the text segment.  This allows for execute in place in
9213 an environment without virtual memory management by eliminating relocations
9214 against the text section.
9215
9216 @item -mno-sep-data
9217 @opindex mno-sep-data
9218 Generate code that assumes that the data segment follows the text segment.
9219 This is the default.
9220
9221 @item -mlong-calls
9222 @itemx -mno-long-calls
9223 @opindex mlong-calls
9224 @opindex mno-long-calls
9225 Tells the compiler to perform function calls by first loading the
9226 address of the function into a register and then performing a subroutine
9227 call on this register.  This switch is needed if the target function
9228 will lie outside of the 24 bit addressing range of the offset based
9229 version of subroutine call instruction.
9230
9231 This feature is not enabled by default.  Specifying
9232 @option{-mno-long-calls} will restore the default behavior.  Note these
9233 switches have no effect on how the compiler generates code to handle
9234 function calls via function pointers.
9235
9236 @item -mfast-fp
9237 @opindex mfast-fp
9238 Link with the fast floating-point library. This library relaxes some of
9239 the IEEE floating-point standard's rules for checking inputs against
9240 Not-a-Number (NAN), in the interest of performance.
9241
9242 @item -minline-plt
9243 @opindex minline-plt
9244 Enable inlining of PLT entries in function calls to functions that are
9245 not known to bind locally.  It has no effect without @option{-mfdpic}.
9246
9247 @item -mmulticore
9248 @opindex mmulticore
9249 Build standalone application for multicore Blackfin processor. Proper
9250 start files and link scripts will be used to support multicore.
9251 This option defines @code{__BFIN_MULTICORE}. It can only be used with
9252 @option{-mcpu=bf561@r{[}-@var{sirevision}@r{]}}. It can be used with
9253 @option{-mcorea} or @option{-mcoreb}. If it's used without
9254 @option{-mcorea} or @option{-mcoreb}, single application/dual core
9255 programming model is used. In this model, the main function of Core B
9256 should be named as coreb_main. If it's used with @option{-mcorea} or
9257 @option{-mcoreb}, one application per core programming model is used.
9258 If this option is not used, single core application programming
9259 model is used.
9260
9261 @item -mcorea
9262 @opindex mcorea
9263 Build standalone application for Core A of BF561 when using
9264 one application per core programming model. Proper start files
9265 and link scripts will be used to support Core A. This option
9266 defines @code{__BFIN_COREA}. It must be used with @option{-mmulticore}.
9267
9268 @item -mcoreb
9269 @opindex mcoreb
9270 Build standalone application for Core B of BF561 when using
9271 one application per core programming model. Proper start files
9272 and link scripts will be used to support Core B. This option
9273 defines @code{__BFIN_COREB}. When this option is used, coreb_main
9274 should be used instead of main. It must be used with
9275 @option{-mmulticore}. 
9276
9277 @item -msdram
9278 @opindex msdram
9279 Build standalone application for SDRAM. Proper start files and
9280 link scripts will be used to put the application into SDRAM.
9281 Loader should initialize SDRAM before loading the application
9282 into SDRAM. This option defines @code{__BFIN_SDRAM}.
9283 @end table
9284
9285 @node CRIS Options
9286 @subsection CRIS Options
9287 @cindex CRIS Options
9288
9289 These options are defined specifically for the CRIS ports.
9290
9291 @table @gcctabopt
9292 @item -march=@var{architecture-type}
9293 @itemx -mcpu=@var{architecture-type}
9294 @opindex march
9295 @opindex mcpu
9296 Generate code for the specified architecture.  The choices for
9297 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
9298 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
9299 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
9300 @samp{v10}.
9301
9302 @item -mtune=@var{architecture-type}
9303 @opindex mtune
9304 Tune to @var{architecture-type} everything applicable about the generated
9305 code, except for the ABI and the set of available instructions.  The
9306 choices for @var{architecture-type} are the same as for
9307 @option{-march=@var{architecture-type}}.
9308
9309 @item -mmax-stack-frame=@var{n}
9310 @opindex mmax-stack-frame
9311 Warn when the stack frame of a function exceeds @var{n} bytes.
9312
9313 @item -metrax4
9314 @itemx -metrax100
9315 @opindex metrax4
9316 @opindex metrax100
9317 The options @option{-metrax4} and @option{-metrax100} are synonyms for
9318 @option{-march=v3} and @option{-march=v8} respectively.
9319
9320 @item -mmul-bug-workaround
9321 @itemx -mno-mul-bug-workaround
9322 @opindex mmul-bug-workaround
9323 @opindex mno-mul-bug-workaround
9324 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
9325 models where it applies.  This option is active by default.
9326
9327 @item -mpdebug
9328 @opindex mpdebug
9329 Enable CRIS-specific verbose debug-related information in the assembly
9330 code.  This option also has the effect to turn off the @samp{#NO_APP}
9331 formatted-code indicator to the assembler at the beginning of the
9332 assembly file.
9333
9334 @item -mcc-init
9335 @opindex mcc-init
9336 Do not use condition-code results from previous instruction; always emit
9337 compare and test instructions before use of condition codes.
9338
9339 @item -mno-side-effects
9340 @opindex mno-side-effects
9341 Do not emit instructions with side-effects in addressing modes other than
9342 post-increment.
9343
9344 @item -mstack-align
9345 @itemx -mno-stack-align
9346 @itemx -mdata-align
9347 @itemx -mno-data-align
9348 @itemx -mconst-align
9349 @itemx -mno-const-align
9350 @opindex mstack-align
9351 @opindex mno-stack-align
9352 @opindex mdata-align
9353 @opindex mno-data-align
9354 @opindex mconst-align
9355 @opindex mno-const-align
9356 These options (no-options) arranges (eliminate arrangements) for the
9357 stack-frame, individual data and constants to be aligned for the maximum
9358 single data access size for the chosen CPU model.  The default is to
9359 arrange for 32-bit alignment.  ABI details such as structure layout are
9360 not affected by these options.
9361
9362 @item -m32-bit
9363 @itemx -m16-bit
9364 @itemx -m8-bit
9365 @opindex m32-bit
9366 @opindex m16-bit
9367 @opindex m8-bit
9368 Similar to the stack- data- and const-align options above, these options
9369 arrange for stack-frame, writable data and constants to all be 32-bit,
9370 16-bit or 8-bit aligned.  The default is 32-bit alignment.
9371
9372 @item -mno-prologue-epilogue
9373 @itemx -mprologue-epilogue
9374 @opindex mno-prologue-epilogue
9375 @opindex mprologue-epilogue
9376 With @option{-mno-prologue-epilogue}, the normal function prologue and
9377 epilogue that sets up the stack-frame are omitted and no return
9378 instructions or return sequences are generated in the code.  Use this
9379 option only together with visual inspection of the compiled code: no
9380 warnings or errors are generated when call-saved registers must be saved,
9381 or storage for local variable needs to be allocated.
9382
9383 @item -mno-gotplt
9384 @itemx -mgotplt
9385 @opindex mno-gotplt
9386 @opindex mgotplt
9387 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
9388 instruction sequences that load addresses for functions from the PLT part
9389 of the GOT rather than (traditional on other architectures) calls to the
9390 PLT@.  The default is @option{-mgotplt}.
9391
9392 @item -melf
9393 @opindex melf
9394 Legacy no-op option only recognized with the cris-axis-elf and
9395 cris-axis-linux-gnu targets.
9396
9397 @item -mlinux
9398 @opindex mlinux
9399 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
9400
9401 @item -sim
9402 @opindex sim
9403 This option, recognized for the cris-axis-elf arranges
9404 to link with input-output functions from a simulator library.  Code,
9405 initialized data and zero-initialized data are allocated consecutively.
9406
9407 @item -sim2
9408 @opindex sim2
9409 Like @option{-sim}, but pass linker options to locate initialized data at
9410 0x40000000 and zero-initialized data at 0x80000000.
9411 @end table
9412
9413 @node CRX Options
9414 @subsection CRX Options
9415 @cindex CRX Options
9416
9417 These options are defined specifically for the CRX ports.
9418
9419 @table @gcctabopt
9420
9421 @item -mmac
9422 @opindex mmac
9423 Enable the use of multiply-accumulate instructions. Disabled by default.
9424
9425 @item -mpush-args
9426 @opindex mpush-args
9427 Push instructions will be used to pass outgoing arguments when functions
9428 are called. Enabled by default.
9429 @end table
9430
9431 @node Darwin Options
9432 @subsection Darwin Options
9433 @cindex Darwin options
9434
9435 These options are defined for all architectures running the Darwin operating
9436 system.
9437
9438 FSF GCC on Darwin does not create ``fat'' object files; it will create
9439 an object file for the single architecture that it was built to
9440 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
9441 @option{-arch} options are used; it does so by running the compiler or
9442 linker multiple times and joining the results together with
9443 @file{lipo}.
9444
9445 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
9446 @samp{i686}) is determined by the flags that specify the ISA
9447 that GCC is targetting, like @option{-mcpu} or @option{-march}.  The
9448 @option{-force_cpusubtype_ALL} option can be used to override this.
9449
9450 The Darwin tools vary in their behavior when presented with an ISA
9451 mismatch.  The assembler, @file{as}, will only permit instructions to
9452 be used that are valid for the subtype of the file it is generating,
9453 so you cannot put 64-bit instructions in an @samp{ppc750} object file.
9454 The linker for shared libraries, @file{/usr/bin/libtool}, will fail
9455 and print an error if asked to create a shared library with a less
9456 restrictive subtype than its input files (for instance, trying to put
9457 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
9458 for executables, @file{ld}, will quietly give the executable the most
9459 restrictive subtype of any of its input files.
9460
9461 @table @gcctabopt
9462 @item -F@var{dir}
9463 @opindex F
9464 Add the framework directory @var{dir} to the head of the list of
9465 directories to be searched for header files.  These directories are
9466 interleaved with those specified by @option{-I} options and are
9467 scanned in a left-to-right order.
9468
9469 A framework directory is a directory with frameworks in it.  A
9470 framework is a directory with a @samp{"Headers"} and/or
9471 @samp{"PrivateHeaders"} directory contained directly in it that ends
9472 in @samp{".framework"}.  The name of a framework is the name of this
9473 directory excluding the @samp{".framework"}.  Headers associated with
9474 the framework are found in one of those two directories, with
9475 @samp{"Headers"} being searched first.  A subframework is a framework
9476 directory that is in a framework's @samp{"Frameworks"} directory.
9477 Includes of subframework headers can only appear in a header of a
9478 framework that contains the subframework, or in a sibling subframework
9479 header.  Two subframeworks are siblings if they occur in the same
9480 framework.  A subframework should not have the same name as a
9481 framework, a warning will be issued if this is violated.  Currently a
9482 subframework cannot have subframeworks, in the future, the mechanism
9483 may be extended to support this.  The standard frameworks can be found
9484 in @samp{"/System/Library/Frameworks"} and
9485 @samp{"/Library/Frameworks"}.  An example include looks like
9486 @code{#include <Framework/header.h>}, where @samp{Framework} denotes
9487 the name of the framework and header.h is found in the
9488 @samp{"PrivateHeaders"} or @samp{"Headers"} directory.
9489
9490 @item -iframework@var{dir}
9491 @opindex iframework
9492 Like @option{-F} except the directory is a treated as a system
9493 directory.  The main difference between this @option{-iframework} and
9494 @option{-F} is that with @option{-iframework} the compiler does not
9495 warn about constructs contained within header files found via
9496 @var{dir}.  This option is valid only for the C family of languages.
9497
9498 @item -gused
9499 @opindex gused
9500 Emit debugging information for symbols that are used.  For STABS
9501 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
9502 This is by default ON@.
9503
9504 @item -gfull
9505 @opindex gfull
9506 Emit debugging information for all symbols and types.
9507
9508 @item -mmacosx-version-min=@var{version}
9509 The earliest version of MacOS X that this executable will run on
9510 is @var{version}.  Typical values of @var{version} include @code{10.1},
9511 @code{10.2}, and @code{10.3.9}.
9512
9513 If the compiler was built to use the system's headers by default,
9514 then the default for this option is the system version on which the
9515 compiler is running, otherwise the default is to make choices which
9516 are compatible with as many systems and code bases as possible.
9517
9518 @item -mkernel
9519 @opindex mkernel
9520 Enable kernel development mode.  The @option{-mkernel} option sets
9521 @option{-static}, @option{-fno-common}, @option{-fno-cxa-atexit},
9522 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
9523 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
9524 applicable.  This mode also sets @option{-mno-altivec},
9525 @option{-msoft-float}, @option{-fno-builtin} and
9526 @option{-mlong-branch} for PowerPC targets.
9527
9528 @item -mone-byte-bool
9529 @opindex mone-byte-bool
9530 Override the defaults for @samp{bool} so that @samp{sizeof(bool)==1}.
9531 By default @samp{sizeof(bool)} is @samp{4} when compiling for
9532 Darwin/PowerPC and @samp{1} when compiling for Darwin/x86, so this
9533 option has no effect on x86.
9534
9535 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
9536 to generate code that is not binary compatible with code generated
9537 without that switch.  Using this switch may require recompiling all
9538 other modules in a program, including system libraries.  Use this
9539 switch to conform to a non-default data model.
9540
9541 @item -mfix-and-continue
9542 @itemx -ffix-and-continue
9543 @itemx -findirect-data
9544 @opindex mfix-and-continue
9545 @opindex ffix-and-continue
9546 @opindex findirect-data
9547 Generate code suitable for fast turn around development.  Needed to
9548 enable gdb to dynamically load @code{.o} files into already running
9549 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
9550 are provided for backwards compatibility.
9551
9552 @item -all_load
9553 @opindex all_load
9554 Loads all members of static archive libraries.
9555 See man ld(1) for more information.
9556
9557 @item -arch_errors_fatal
9558 @opindex arch_errors_fatal
9559 Cause the errors having to do with files that have the wrong architecture
9560 to be fatal.
9561
9562 @item -bind_at_load
9563 @opindex bind_at_load
9564 Causes the output file to be marked such that the dynamic linker will
9565 bind all undefined references when the file is loaded or launched.
9566
9567 @item -bundle
9568 @opindex bundle
9569 Produce a Mach-o bundle format file.
9570 See man ld(1) for more information.
9571
9572 @item -bundle_loader @var{executable}
9573 @opindex bundle_loader
9574 This option specifies the @var{executable} that will be loading the build
9575 output file being linked.  See man ld(1) for more information.
9576
9577 @item -dynamiclib
9578 @opindex dynamiclib
9579 When passed this option, GCC will produce a dynamic library instead of
9580 an executable when linking, using the Darwin @file{libtool} command.
9581
9582 @item -force_cpusubtype_ALL
9583 @opindex force_cpusubtype_ALL
9584 This causes GCC's output file to have the @var{ALL} subtype, instead of
9585 one controlled by the @option{-mcpu} or @option{-march} option.
9586
9587 @item -allowable_client  @var{client_name}
9588 @itemx -client_name
9589 @itemx -compatibility_version
9590 @itemx -current_version
9591 @itemx -dead_strip
9592 @itemx -dependency-file
9593 @itemx -dylib_file
9594 @itemx -dylinker_install_name
9595 @itemx -dynamic
9596 @itemx -exported_symbols_list
9597 @itemx -filelist
9598 @itemx -flat_namespace
9599 @itemx -force_flat_namespace
9600 @itemx -headerpad_max_install_names
9601 @itemx -image_base
9602 @itemx -init
9603 @itemx -install_name
9604 @itemx -keep_private_externs
9605 @itemx -multi_module
9606 @itemx -multiply_defined
9607 @itemx -multiply_defined_unused
9608 @itemx -noall_load
9609 @itemx -no_dead_strip_inits_and_terms
9610 @itemx -nofixprebinding
9611 @itemx -nomultidefs
9612 @itemx -noprebind
9613 @itemx -noseglinkedit
9614 @itemx -pagezero_size
9615 @itemx -prebind
9616 @itemx -prebind_all_twolevel_modules
9617 @itemx -private_bundle
9618 @itemx -read_only_relocs
9619 @itemx -sectalign
9620 @itemx -sectobjectsymbols
9621 @itemx -whyload
9622 @itemx -seg1addr
9623 @itemx -sectcreate
9624 @itemx -sectobjectsymbols
9625 @itemx -sectorder
9626 @itemx -segaddr
9627 @itemx -segs_read_only_addr
9628 @itemx -segs_read_write_addr
9629 @itemx -seg_addr_table
9630 @itemx -seg_addr_table_filename
9631 @itemx -seglinkedit
9632 @itemx -segprot
9633 @itemx -segs_read_only_addr
9634 @itemx -segs_read_write_addr
9635 @itemx -single_module
9636 @itemx -static
9637 @itemx -sub_library
9638 @itemx -sub_umbrella
9639 @itemx -twolevel_namespace
9640 @itemx -umbrella
9641 @itemx -undefined
9642 @itemx -unexported_symbols_list
9643 @itemx -weak_reference_mismatches
9644 @itemx -whatsloaded
9645 @opindex allowable_client
9646 @opindex client_name
9647 @opindex compatibility_version
9648 @opindex current_version
9649 @opindex dead_strip
9650 @opindex dependency-file
9651 @opindex dylib_file
9652 @opindex dylinker_install_name
9653 @opindex dynamic
9654 @opindex exported_symbols_list
9655 @opindex filelist
9656 @opindex flat_namespace
9657 @opindex force_flat_namespace
9658 @opindex headerpad_max_install_names
9659 @opindex image_base
9660 @opindex init
9661 @opindex install_name
9662 @opindex keep_private_externs
9663 @opindex multi_module
9664 @opindex multiply_defined
9665 @opindex multiply_defined_unused
9666 @opindex noall_load
9667 @opindex no_dead_strip_inits_and_terms
9668 @opindex nofixprebinding
9669 @opindex nomultidefs
9670 @opindex noprebind
9671 @opindex noseglinkedit
9672 @opindex pagezero_size
9673 @opindex prebind
9674 @opindex prebind_all_twolevel_modules
9675 @opindex private_bundle
9676 @opindex read_only_relocs
9677 @opindex sectalign
9678 @opindex sectobjectsymbols
9679 @opindex whyload
9680 @opindex seg1addr
9681 @opindex sectcreate
9682 @opindex sectobjectsymbols
9683 @opindex sectorder
9684 @opindex segaddr
9685 @opindex segs_read_only_addr
9686 @opindex segs_read_write_addr
9687 @opindex seg_addr_table
9688 @opindex seg_addr_table_filename
9689 @opindex seglinkedit
9690 @opindex segprot
9691 @opindex segs_read_only_addr
9692 @opindex segs_read_write_addr
9693 @opindex single_module
9694 @opindex static
9695 @opindex sub_library
9696 @opindex sub_umbrella
9697 @opindex twolevel_namespace
9698 @opindex umbrella
9699 @opindex undefined
9700 @opindex unexported_symbols_list
9701 @opindex weak_reference_mismatches
9702 @opindex whatsloaded
9703 These options are passed to the Darwin linker.  The Darwin linker man page
9704 describes them in detail.
9705 @end table
9706
9707 @node DEC Alpha Options
9708 @subsection DEC Alpha Options
9709
9710 These @samp{-m} options are defined for the DEC Alpha implementations:
9711
9712 @table @gcctabopt
9713 @item -mno-soft-float
9714 @itemx -msoft-float
9715 @opindex mno-soft-float
9716 @opindex msoft-float
9717 Use (do not use) the hardware floating-point instructions for
9718 floating-point operations.  When @option{-msoft-float} is specified,
9719 functions in @file{libgcc.a} will be used to perform floating-point
9720 operations.  Unless they are replaced by routines that emulate the
9721 floating-point operations, or compiled in such a way as to call such
9722 emulations routines, these routines will issue floating-point
9723 operations.   If you are compiling for an Alpha without floating-point
9724 operations, you must ensure that the library is built so as not to call
9725 them.
9726
9727 Note that Alpha implementations without floating-point operations are
9728 required to have floating-point registers.
9729
9730 @item -mfp-reg
9731 @itemx -mno-fp-regs
9732 @opindex mfp-reg
9733 @opindex mno-fp-regs
9734 Generate code that uses (does not use) the floating-point register set.
9735 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
9736 register set is not used, floating point operands are passed in integer
9737 registers as if they were integers and floating-point results are passed
9738 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
9739 so any function with a floating-point argument or return value called by code
9740 compiled with @option{-mno-fp-regs} must also be compiled with that
9741 option.
9742
9743 A typical use of this option is building a kernel that does not use,
9744 and hence need not save and restore, any floating-point registers.
9745
9746 @item -mieee
9747 @opindex mieee
9748 The Alpha architecture implements floating-point hardware optimized for
9749 maximum performance.  It is mostly compliant with the IEEE floating
9750 point standard.  However, for full compliance, software assistance is
9751 required.  This option generates code fully IEEE compliant code
9752 @emph{except} that the @var{inexact-flag} is not maintained (see below).
9753 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
9754 defined during compilation.  The resulting code is less efficient but is
9755 able to correctly support denormalized numbers and exceptional IEEE
9756 values such as not-a-number and plus/minus infinity.  Other Alpha
9757 compilers call this option @option{-ieee_with_no_inexact}.
9758
9759 @item -mieee-with-inexact
9760 @opindex mieee-with-inexact
9761 This is like @option{-mieee} except the generated code also maintains
9762 the IEEE @var{inexact-flag}.  Turning on this option causes the
9763 generated code to implement fully-compliant IEEE math.  In addition to
9764 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
9765 macro.  On some Alpha implementations the resulting code may execute
9766 significantly slower than the code generated by default.  Since there is
9767 very little code that depends on the @var{inexact-flag}, you should
9768 normally not specify this option.  Other Alpha compilers call this
9769 option @option{-ieee_with_inexact}.
9770
9771 @item -mfp-trap-mode=@var{trap-mode}
9772 @opindex mfp-trap-mode
9773 This option controls what floating-point related traps are enabled.
9774 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
9775 The trap mode can be set to one of four values:
9776
9777 @table @samp
9778 @item n
9779 This is the default (normal) setting.  The only traps that are enabled
9780 are the ones that cannot be disabled in software (e.g., division by zero
9781 trap).
9782
9783 @item u
9784 In addition to the traps enabled by @samp{n}, underflow traps are enabled
9785 as well.
9786
9787 @item su
9788 Like @samp{u}, but the instructions are marked to be safe for software
9789 completion (see Alpha architecture manual for details).
9790
9791 @item sui
9792 Like @samp{su}, but inexact traps are enabled as well.
9793 @end table
9794
9795 @item -mfp-rounding-mode=@var{rounding-mode}
9796 @opindex mfp-rounding-mode
9797 Selects the IEEE rounding mode.  Other Alpha compilers call this option
9798 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
9799 of:
9800
9801 @table @samp
9802 @item n
9803 Normal IEEE rounding mode.  Floating point numbers are rounded towards
9804 the nearest machine number or towards the even machine number in case
9805 of a tie.
9806
9807 @item m
9808 Round towards minus infinity.
9809
9810 @item c
9811 Chopped rounding mode.  Floating point numbers are rounded towards zero.
9812
9813 @item d
9814 Dynamic rounding mode.  A field in the floating point control register
9815 (@var{fpcr}, see Alpha architecture reference manual) controls the
9816 rounding mode in effect.  The C library initializes this register for
9817 rounding towards plus infinity.  Thus, unless your program modifies the
9818 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
9819 @end table
9820
9821 @item -mtrap-precision=@var{trap-precision}
9822 @opindex mtrap-precision
9823 In the Alpha architecture, floating point traps are imprecise.  This
9824 means without software assistance it is impossible to recover from a
9825 floating trap and program execution normally needs to be terminated.
9826 GCC can generate code that can assist operating system trap handlers
9827 in determining the exact location that caused a floating point trap.
9828 Depending on the requirements of an application, different levels of
9829 precisions can be selected:
9830
9831 @table @samp
9832 @item p
9833 Program precision.  This option is the default and means a trap handler
9834 can only identify which program caused a floating point exception.
9835
9836 @item f
9837 Function precision.  The trap handler can determine the function that
9838 caused a floating point exception.
9839
9840 @item i
9841 Instruction precision.  The trap handler can determine the exact
9842 instruction that caused a floating point exception.
9843 @end table
9844
9845 Other Alpha compilers provide the equivalent options called
9846 @option{-scope_safe} and @option{-resumption_safe}.
9847
9848 @item -mieee-conformant
9849 @opindex mieee-conformant
9850 This option marks the generated code as IEEE conformant.  You must not
9851 use this option unless you also specify @option{-mtrap-precision=i} and either
9852 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
9853 is to emit the line @samp{.eflag 48} in the function prologue of the
9854 generated assembly file.  Under DEC Unix, this has the effect that
9855 IEEE-conformant math library routines will be linked in.
9856
9857 @item -mbuild-constants
9858 @opindex mbuild-constants
9859 Normally GCC examines a 32- or 64-bit integer constant to
9860 see if it can construct it from smaller constants in two or three
9861 instructions.  If it cannot, it will output the constant as a literal and
9862 generate code to load it from the data segment at runtime.
9863
9864 Use this option to require GCC to construct @emph{all} integer constants
9865 using code, even if it takes more instructions (the maximum is six).
9866
9867 You would typically use this option to build a shared library dynamic
9868 loader.  Itself a shared library, it must relocate itself in memory
9869 before it can find the variables and constants in its own data segment.
9870
9871 @item -malpha-as
9872 @itemx -mgas
9873 @opindex malpha-as
9874 @opindex mgas
9875 Select whether to generate code to be assembled by the vendor-supplied
9876 assembler (@option{-malpha-as}) or by the GNU assembler @option{-mgas}.
9877
9878 @item -mbwx
9879 @itemx -mno-bwx
9880 @itemx -mcix
9881 @itemx -mno-cix
9882 @itemx -mfix
9883 @itemx -mno-fix
9884 @itemx -mmax
9885 @itemx -mno-max
9886 @opindex mbwx
9887 @opindex mno-bwx
9888 @opindex mcix
9889 @opindex mno-cix
9890 @opindex mfix
9891 @opindex mno-fix
9892 @opindex mmax
9893 @opindex mno-max
9894 Indicate whether GCC should generate code to use the optional BWX,
9895 CIX, FIX and MAX instruction sets.  The default is to use the instruction
9896 sets supported by the CPU type specified via @option{-mcpu=} option or that
9897 of the CPU on which GCC was built if none was specified.
9898
9899 @item -mfloat-vax
9900 @itemx -mfloat-ieee
9901 @opindex mfloat-vax
9902 @opindex mfloat-ieee
9903 Generate code that uses (does not use) VAX F and G floating point
9904 arithmetic instead of IEEE single and double precision.
9905
9906 @item -mexplicit-relocs
9907 @itemx -mno-explicit-relocs
9908 @opindex mexplicit-relocs
9909 @opindex mno-explicit-relocs
9910 Older Alpha assemblers provided no way to generate symbol relocations
9911 except via assembler macros.  Use of these macros does not allow
9912 optimal instruction scheduling.  GNU binutils as of version 2.12
9913 supports a new syntax that allows the compiler to explicitly mark
9914 which relocations should apply to which instructions.  This option
9915 is mostly useful for debugging, as GCC detects the capabilities of
9916 the assembler when it is built and sets the default accordingly.
9917
9918 @item -msmall-data
9919 @itemx -mlarge-data
9920 @opindex msmall-data
9921 @opindex mlarge-data
9922 When @option{-mexplicit-relocs} is in effect, static data is
9923 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
9924 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
9925 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
9926 16-bit relocations off of the @code{$gp} register.  This limits the
9927 size of the small data area to 64KB, but allows the variables to be
9928 directly accessed via a single instruction.
9929
9930 The default is @option{-mlarge-data}.  With this option the data area
9931 is limited to just below 2GB@.  Programs that require more than 2GB of
9932 data must use @code{malloc} or @code{mmap} to allocate the data in the
9933 heap instead of in the program's data segment.
9934
9935 When generating code for shared libraries, @option{-fpic} implies
9936 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
9937
9938 @item -msmall-text
9939 @itemx -mlarge-text
9940 @opindex msmall-text
9941 @opindex mlarge-text
9942 When @option{-msmall-text} is used, the compiler assumes that the
9943 code of the entire program (or shared library) fits in 4MB, and is
9944 thus reachable with a branch instruction.  When @option{-msmall-data}
9945 is used, the compiler can assume that all local symbols share the
9946 same @code{$gp} value, and thus reduce the number of instructions
9947 required for a function call from 4 to 1.
9948
9949 The default is @option{-mlarge-text}.
9950
9951 @item -mcpu=@var{cpu_type}
9952 @opindex mcpu
9953 Set the instruction set and instruction scheduling parameters for
9954 machine type @var{cpu_type}.  You can specify either the @samp{EV}
9955 style name or the corresponding chip number.  GCC supports scheduling
9956 parameters for the EV4, EV5 and EV6 family of processors and will
9957 choose the default values for the instruction set from the processor
9958 you specify.  If you do not specify a processor type, GCC will default
9959 to the processor on which the compiler was built.
9960
9961 Supported values for @var{cpu_type} are
9962
9963 @table @samp
9964 @item ev4
9965 @itemx ev45
9966 @itemx 21064
9967 Schedules as an EV4 and has no instruction set extensions.
9968
9969 @item ev5
9970 @itemx 21164
9971 Schedules as an EV5 and has no instruction set extensions.
9972
9973 @item ev56
9974 @itemx 21164a
9975 Schedules as an EV5 and supports the BWX extension.
9976
9977 @item pca56
9978 @itemx 21164pc
9979 @itemx 21164PC
9980 Schedules as an EV5 and supports the BWX and MAX extensions.
9981
9982 @item ev6
9983 @itemx 21264
9984 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
9985
9986 @item ev67
9987 @itemx 21264a
9988 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
9989 @end table
9990
9991 @item -mtune=@var{cpu_type}
9992 @opindex mtune
9993 Set only the instruction scheduling parameters for machine type
9994 @var{cpu_type}.  The instruction set is not changed.
9995
9996 @item -mmemory-latency=@var{time}
9997 @opindex mmemory-latency
9998 Sets the latency the scheduler should assume for typical memory
9999 references as seen by the application.  This number is highly
10000 dependent on the memory access patterns used by the application
10001 and the size of the external cache on the machine.
10002
10003 Valid options for @var{time} are
10004
10005 @table @samp
10006 @item @var{number}
10007 A decimal number representing clock cycles.
10008
10009 @item L1
10010 @itemx L2
10011 @itemx L3
10012 @itemx main
10013 The compiler contains estimates of the number of clock cycles for
10014 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
10015 (also called Dcache, Scache, and Bcache), as well as to main memory.
10016 Note that L3 is only valid for EV5.
10017
10018 @end table
10019 @end table
10020
10021 @node DEC Alpha/VMS Options
10022 @subsection DEC Alpha/VMS Options
10023
10024 These @samp{-m} options are defined for the DEC Alpha/VMS implementations:
10025
10026 @table @gcctabopt
10027 @item -mvms-return-codes
10028 @opindex mvms-return-codes
10029 Return VMS condition codes from main.  The default is to return POSIX
10030 style condition (e.g.@: error) codes.
10031 @end table
10032
10033 @node FRV Options
10034 @subsection FRV Options
10035 @cindex FRV Options
10036
10037 @table @gcctabopt
10038 @item -mgpr-32
10039 @opindex mgpr-32
10040
10041 Only use the first 32 general purpose registers.
10042
10043 @item -mgpr-64
10044 @opindex mgpr-64
10045
10046 Use all 64 general purpose registers.
10047
10048 @item -mfpr-32
10049 @opindex mfpr-32
10050
10051 Use only the first 32 floating point registers.
10052
10053 @item -mfpr-64
10054 @opindex mfpr-64
10055
10056 Use all 64 floating point registers
10057
10058 @item -mhard-float
10059 @opindex mhard-float
10060
10061 Use hardware instructions for floating point operations.
10062
10063 @item -msoft-float
10064 @opindex msoft-float
10065
10066 Use library routines for floating point operations.
10067
10068 @item -malloc-cc
10069 @opindex malloc-cc
10070
10071 Dynamically allocate condition code registers.
10072
10073 @item -mfixed-cc
10074 @opindex mfixed-cc
10075
10076 Do not try to dynamically allocate condition code registers, only
10077 use @code{icc0} and @code{fcc0}.
10078
10079 @item -mdword
10080 @opindex mdword
10081
10082 Change ABI to use double word insns.
10083
10084 @item -mno-dword
10085 @opindex mno-dword
10086
10087 Do not use double word instructions.
10088
10089 @item -mdouble
10090 @opindex mdouble
10091
10092 Use floating point double instructions.
10093
10094 @item -mno-double
10095 @opindex mno-double
10096
10097 Do not use floating point double instructions.
10098
10099 @item -mmedia
10100 @opindex mmedia
10101
10102 Use media instructions.
10103
10104 @item -mno-media
10105 @opindex mno-media
10106
10107 Do not use media instructions.
10108
10109 @item -mmuladd
10110 @opindex mmuladd
10111
10112 Use multiply and add/subtract instructions.
10113
10114 @item -mno-muladd
10115 @opindex mno-muladd
10116
10117 Do not use multiply and add/subtract instructions.
10118
10119 @item -mfdpic
10120 @opindex mfdpic
10121
10122 Select the FDPIC ABI, that uses function descriptors to represent
10123 pointers to functions.  Without any PIC/PIE-related options, it
10124 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
10125 assumes GOT entries and small data are within a 12-bit range from the
10126 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
10127 are computed with 32 bits.
10128 With a @samp{bfin-elf} target, this option implies @option{-msim}.
10129
10130 @item -minline-plt
10131 @opindex minline-plt
10132
10133 Enable inlining of PLT entries in function calls to functions that are
10134 not known to bind locally.  It has no effect without @option{-mfdpic}.
10135 It's enabled by default if optimizing for speed and compiling for
10136 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
10137 optimization option such as @option{-O3} or above is present in the
10138 command line.
10139
10140 @item -mTLS
10141 @opindex TLS
10142
10143 Assume a large TLS segment when generating thread-local code.
10144
10145 @item -mtls
10146 @opindex tls
10147
10148 Do not assume a large TLS segment when generating thread-local code.
10149
10150 @item -mgprel-ro
10151 @opindex mgprel-ro
10152
10153 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
10154 that is known to be in read-only sections.  It's enabled by default,
10155 except for @option{-fpic} or @option{-fpie}: even though it may help
10156 make the global offset table smaller, it trades 1 instruction for 4.
10157 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
10158 one of which may be shared by multiple symbols, and it avoids the need
10159 for a GOT entry for the referenced symbol, so it's more likely to be a
10160 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
10161
10162 @item -multilib-library-pic
10163 @opindex multilib-library-pic
10164
10165 Link with the (library, not FD) pic libraries.  It's implied by
10166 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
10167 @option{-fpic} without @option{-mfdpic}.  You should never have to use
10168 it explicitly.
10169
10170 @item -mlinked-fp
10171 @opindex mlinked-fp
10172
10173 Follow the EABI requirement of always creating a frame pointer whenever
10174 a stack frame is allocated.  This option is enabled by default and can
10175 be disabled with @option{-mno-linked-fp}.
10176
10177 @item -mlong-calls
10178 @opindex mlong-calls
10179
10180 Use indirect addressing to call functions outside the current
10181 compilation unit.  This allows the functions to be placed anywhere
10182 within the 32-bit address space.
10183
10184 @item -malign-labels
10185 @opindex malign-labels
10186
10187 Try to align labels to an 8-byte boundary by inserting nops into the
10188 previous packet.  This option only has an effect when VLIW packing
10189 is enabled.  It doesn't create new packets; it merely adds nops to
10190 existing ones.
10191
10192 @item -mlibrary-pic
10193 @opindex mlibrary-pic
10194
10195 Generate position-independent EABI code.
10196
10197 @item -macc-4
10198 @opindex macc-4
10199
10200 Use only the first four media accumulator registers.
10201
10202 @item -macc-8
10203 @opindex macc-8
10204
10205 Use all eight media accumulator registers.
10206
10207 @item -mpack
10208 @opindex mpack
10209
10210 Pack VLIW instructions.
10211
10212 @item -mno-pack
10213 @opindex mno-pack
10214
10215 Do not pack VLIW instructions.
10216
10217 @item -mno-eflags
10218 @opindex mno-eflags
10219
10220 Do not mark ABI switches in e_flags.
10221
10222 @item -mcond-move
10223 @opindex mcond-move
10224
10225 Enable the use of conditional-move instructions (default).
10226
10227 This switch is mainly for debugging the compiler and will likely be removed
10228 in a future version.
10229
10230 @item -mno-cond-move
10231 @opindex mno-cond-move
10232
10233 Disable the use of conditional-move instructions.
10234
10235 This switch is mainly for debugging the compiler and will likely be removed
10236 in a future version.
10237
10238 @item -mscc
10239 @opindex mscc
10240
10241 Enable the use of conditional set instructions (default).
10242
10243 This switch is mainly for debugging the compiler and will likely be removed
10244 in a future version.
10245
10246 @item -mno-scc
10247 @opindex mno-scc
10248
10249 Disable the use of conditional set instructions.
10250
10251 This switch is mainly for debugging the compiler and will likely be removed
10252 in a future version.
10253
10254 @item -mcond-exec
10255 @opindex mcond-exec
10256
10257 Enable the use of conditional execution (default).
10258
10259 This switch is mainly for debugging the compiler and will likely be removed
10260 in a future version.
10261
10262 @item -mno-cond-exec
10263 @opindex mno-cond-exec
10264
10265 Disable the use of conditional execution.
10266
10267 This switch is mainly for debugging the compiler and will likely be removed
10268 in a future version.
10269
10270 @item -mvliw-branch
10271 @opindex mvliw-branch
10272
10273 Run a pass to pack branches into VLIW instructions (default).
10274
10275 This switch is mainly for debugging the compiler and will likely be removed
10276 in a future version.
10277
10278 @item -mno-vliw-branch
10279 @opindex mno-vliw-branch
10280
10281 Do not run a pass to pack branches into VLIW instructions.
10282
10283 This switch is mainly for debugging the compiler and will likely be removed
10284 in a future version.
10285
10286 @item -mmulti-cond-exec
10287 @opindex mmulti-cond-exec
10288
10289 Enable optimization of @code{&&} and @code{||} in conditional execution
10290 (default).
10291
10292 This switch is mainly for debugging the compiler and will likely be removed
10293 in a future version.
10294
10295 @item -mno-multi-cond-exec
10296 @opindex mno-multi-cond-exec
10297
10298 Disable optimization of @code{&&} and @code{||} in conditional execution.
10299
10300 This switch is mainly for debugging the compiler and will likely be removed
10301 in a future version.
10302
10303 @item -mnested-cond-exec
10304 @opindex mnested-cond-exec
10305
10306 Enable nested conditional execution optimizations (default).
10307
10308 This switch is mainly for debugging the compiler and will likely be removed
10309 in a future version.
10310
10311 @item -mno-nested-cond-exec
10312 @opindex mno-nested-cond-exec
10313
10314 Disable nested conditional execution optimizations.
10315
10316 This switch is mainly for debugging the compiler and will likely be removed
10317 in a future version.
10318
10319 @item -moptimize-membar
10320 @opindex moptimize-membar
10321
10322 This switch removes redundant @code{membar} instructions from the
10323 compiler generated code.  It is enabled by default.
10324
10325 @item -mno-optimize-membar
10326 @opindex mno-optimize-membar
10327
10328 This switch disables the automatic removal of redundant @code{membar}
10329 instructions from the generated code.
10330
10331 @item -mtomcat-stats
10332 @opindex mtomcat-stats
10333
10334 Cause gas to print out tomcat statistics.
10335
10336 @item -mcpu=@var{cpu}
10337 @opindex mcpu
10338
10339 Select the processor type for which to generate code.  Possible values are
10340 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
10341 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
10342
10343 @end table
10344
10345 @node GNU/Linux Options
10346 @subsection GNU/Linux Options
10347
10348 These @samp{-m} options are defined for GNU/Linux targets:
10349
10350 @table @gcctabopt
10351 @item -mglibc
10352 @opindex mglibc
10353 Use the GNU C library instead of uClibc.  This is the default except
10354 on @samp{*-*-linux-*uclibc*} targets.
10355
10356 @item -muclibc
10357 @opindex muclibc
10358 Use uClibc instead of the GNU C library.  This is the default on
10359 @samp{*-*-linux-*uclibc*} targets.
10360 @end table
10361
10362 @node H8/300 Options
10363 @subsection H8/300 Options
10364
10365 These @samp{-m} options are defined for the H8/300 implementations:
10366
10367 @table @gcctabopt
10368 @item -mrelax
10369 @opindex mrelax
10370 Shorten some address references at link time, when possible; uses the
10371 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
10372 ld, Using ld}, for a fuller description.
10373
10374 @item -mh
10375 @opindex mh
10376 Generate code for the H8/300H@.
10377
10378 @item -ms
10379 @opindex ms
10380 Generate code for the H8S@.
10381
10382 @item -mn
10383 @opindex mn
10384 Generate code for the H8S and H8/300H in the normal mode.  This switch
10385 must be used either with @option{-mh} or @option{-ms}.
10386
10387 @item -ms2600
10388 @opindex ms2600
10389 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
10390
10391 @item -mint32
10392 @opindex mint32
10393 Make @code{int} data 32 bits by default.
10394
10395 @item -malign-300
10396 @opindex malign-300
10397 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
10398 The default for the H8/300H and H8S is to align longs and floats on 4
10399 byte boundaries.
10400 @option{-malign-300} causes them to be aligned on 2 byte boundaries.
10401 This option has no effect on the H8/300.
10402 @end table
10403
10404 @node HPPA Options
10405 @subsection HPPA Options
10406 @cindex HPPA Options
10407
10408 These @samp{-m} options are defined for the HPPA family of computers:
10409
10410 @table @gcctabopt
10411 @item -march=@var{architecture-type}
10412 @opindex march
10413 Generate code for the specified architecture.  The choices for
10414 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
10415 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
10416 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
10417 architecture option for your machine.  Code compiled for lower numbered
10418 architectures will run on higher numbered architectures, but not the
10419 other way around.
10420
10421 @item -mpa-risc-1-0
10422 @itemx -mpa-risc-1-1
10423 @itemx -mpa-risc-2-0
10424 @opindex mpa-risc-1-0
10425 @opindex mpa-risc-1-1
10426 @opindex mpa-risc-2-0
10427 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
10428
10429 @item -mbig-switch
10430 @opindex mbig-switch
10431 Generate code suitable for big switch tables.  Use this option only if
10432 the assembler/linker complain about out of range branches within a switch
10433 table.
10434
10435 @item -mjump-in-delay
10436 @opindex mjump-in-delay
10437 Fill delay slots of function calls with unconditional jump instructions
10438 by modifying the return pointer for the function call to be the target
10439 of the conditional jump.
10440
10441 @item -mdisable-fpregs
10442 @opindex mdisable-fpregs
10443 Prevent floating point registers from being used in any manner.  This is
10444 necessary for compiling kernels which perform lazy context switching of
10445 floating point registers.  If you use this option and attempt to perform
10446 floating point operations, the compiler will abort.
10447
10448 @item -mdisable-indexing
10449 @opindex mdisable-indexing
10450 Prevent the compiler from using indexing address modes.  This avoids some
10451 rather obscure problems when compiling MIG generated code under MACH@.
10452
10453 @item -mno-space-regs
10454 @opindex mno-space-regs
10455 Generate code that assumes the target has no space registers.  This allows
10456 GCC to generate faster indirect calls and use unscaled index address modes.
10457
10458 Such code is suitable for level 0 PA systems and kernels.
10459
10460 @item -mfast-indirect-calls
10461 @opindex mfast-indirect-calls
10462 Generate code that assumes calls never cross space boundaries.  This
10463 allows GCC to emit code which performs faster indirect calls.
10464
10465 This option will not work in the presence of shared libraries or nested
10466 functions.
10467
10468 @item -mfixed-range=@var{register-range}
10469 @opindex mfixed-range
10470 Generate code treating the given register range as fixed registers.
10471 A fixed register is one that the register allocator can not use.  This is
10472 useful when compiling kernel code.  A register range is specified as
10473 two registers separated by a dash.  Multiple register ranges can be
10474 specified separated by a comma.
10475
10476 @item -mlong-load-store
10477 @opindex mlong-load-store
10478 Generate 3-instruction load and store sequences as sometimes required by
10479 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
10480 the HP compilers.
10481
10482 @item -mportable-runtime
10483 @opindex mportable-runtime
10484 Use the portable calling conventions proposed by HP for ELF systems.
10485
10486 @item -mgas
10487 @opindex mgas
10488 Enable the use of assembler directives only GAS understands.
10489
10490 @item -mschedule=@var{cpu-type}
10491 @opindex mschedule
10492 Schedule code according to the constraints for the machine type
10493 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
10494 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
10495 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
10496 proper scheduling option for your machine.  The default scheduling is
10497 @samp{8000}.
10498
10499 @item -mlinker-opt
10500 @opindex mlinker-opt
10501 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
10502 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
10503 linkers in which they give bogus error messages when linking some programs.
10504
10505 @item -msoft-float
10506 @opindex msoft-float
10507 Generate output containing library calls for floating point.
10508 @strong{Warning:} the requisite libraries are not available for all HPPA
10509 targets.  Normally the facilities of the machine's usual C compiler are
10510 used, but this cannot be done directly in cross-compilation.  You must make
10511 your own arrangements to provide suitable library functions for
10512 cross-compilation.
10513
10514 @option{-msoft-float} changes the calling convention in the output file;
10515 therefore, it is only useful if you compile @emph{all} of a program with
10516 this option.  In particular, you need to compile @file{libgcc.a}, the
10517 library that comes with GCC, with @option{-msoft-float} in order for
10518 this to work.
10519
10520 @item -msio
10521 @opindex msio
10522 Generate the predefine, @code{_SIO}, for server IO@.  The default is
10523 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
10524 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
10525 options are available under HP-UX and HI-UX@.
10526
10527 @item -mgnu-ld
10528 @opindex gnu-ld
10529 Use GNU ld specific options.  This passes @option{-shared} to ld when
10530 building a shared library.  It is the default when GCC is configured,
10531 explicitly or implicitly, with the GNU linker.  This option does not
10532 have any affect on which ld is called, it only changes what parameters
10533 are passed to that ld.  The ld that is called is determined by the
10534 @option{--with-ld} configure option, GCC's program search path, and
10535 finally by the user's @env{PATH}.  The linker used by GCC can be printed
10536 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
10537 on the 64 bit HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
10538
10539 @item -mhp-ld
10540 @opindex hp-ld
10541 Use HP ld specific options.  This passes @option{-b} to ld when building
10542 a shared library and passes @option{+Accept TypeMismatch} to ld on all
10543 links.  It is the default when GCC is configured, explicitly or
10544 implicitly, with the HP linker.  This option does not have any affect on
10545 which ld is called, it only changes what parameters are passed to that
10546 ld.  The ld that is called is determined by the @option{--with-ld}
10547 configure option, GCC's program search path, and finally by the user's
10548 @env{PATH}.  The linker used by GCC can be printed using @samp{which
10549 `gcc -print-prog-name=ld`}.  This option is only available on the 64 bit
10550 HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
10551
10552 @item -mlong-calls
10553 @opindex mno-long-calls
10554 Generate code that uses long call sequences.  This ensures that a call
10555 is always able to reach linker generated stubs.  The default is to generate
10556 long calls only when the distance from the call site to the beginning
10557 of the function or translation unit, as the case may be, exceeds a
10558 predefined limit set by the branch type being used.  The limits for
10559 normal calls are 7,600,000 and 240,000 bytes, respectively for the
10560 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
10561 240,000 bytes.
10562
10563 Distances are measured from the beginning of functions when using the
10564 @option{-ffunction-sections} option, or when using the @option{-mgas}
10565 and @option{-mno-portable-runtime} options together under HP-UX with
10566 the SOM linker.
10567
10568 It is normally not desirable to use this option as it will degrade
10569 performance.  However, it may be useful in large applications,
10570 particularly when partial linking is used to build the application.
10571
10572 The types of long calls used depends on the capabilities of the
10573 assembler and linker, and the type of code being generated.  The
10574 impact on systems that support long absolute calls, and long pic
10575 symbol-difference or pc-relative calls should be relatively small.
10576 However, an indirect call is used on 32-bit ELF systems in pic code
10577 and it is quite long.
10578
10579 @item -munix=@var{unix-std}
10580 @opindex march
10581 Generate compiler predefines and select a startfile for the specified
10582 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
10583 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
10584 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
10585 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
10586 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
10587 and later.
10588
10589 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
10590 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
10591 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
10592 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
10593 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
10594 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
10595
10596 It is @emph{important} to note that this option changes the interfaces
10597 for various library routines.  It also affects the operational behavior
10598 of the C library.  Thus, @emph{extreme} care is needed in using this
10599 option.
10600
10601 Library code that is intended to operate with more than one UNIX
10602 standard must test, set and restore the variable @var{__xpg4_extended_mask}
10603 as appropriate.  Most GNU software doesn't provide this capability.
10604
10605 @item -nolibdld
10606 @opindex nolibdld
10607 Suppress the generation of link options to search libdld.sl when the
10608 @option{-static} option is specified on HP-UX 10 and later.
10609
10610 @item -static
10611 @opindex static
10612 The HP-UX implementation of setlocale in libc has a dependency on
10613 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
10614 when the @option{-static} option is specified, special link options
10615 are needed to resolve this dependency.
10616
10617 On HP-UX 10 and later, the GCC driver adds the necessary options to
10618 link with libdld.sl when the @option{-static} option is specified.
10619 This causes the resulting binary to be dynamic.  On the 64-bit port,
10620 the linkers generate dynamic binaries by default in any case.  The
10621 @option{-nolibdld} option can be used to prevent the GCC driver from
10622 adding these link options.
10623
10624 @item -threads
10625 @opindex threads
10626 Add support for multithreading with the @dfn{dce thread} library
10627 under HP-UX@.  This option sets flags for both the preprocessor and
10628 linker.
10629 @end table
10630
10631 @node i386 and x86-64 Options
10632 @subsection Intel 386 and AMD x86-64 Options
10633 @cindex i386 Options
10634 @cindex x86-64 Options
10635 @cindex Intel 386 Options
10636 @cindex AMD x86-64 Options
10637
10638 These @samp{-m} options are defined for the i386 and x86-64 family of
10639 computers:
10640
10641 @table @gcctabopt
10642 @item -mtune=@var{cpu-type}
10643 @opindex mtune
10644 Tune to @var{cpu-type} everything applicable about the generated code, except
10645 for the ABI and the set of available instructions.  The choices for
10646 @var{cpu-type} are:
10647 @table @emph
10648 @item generic
10649 Produce code optimized for the most common IA32/AMD64/EM64T processors.
10650 If you know the CPU on which your code will run, then you should use
10651 the corresponding @option{-mtune} option instead of
10652 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
10653 of your application will have, then you should use this option.
10654
10655 As new processors are deployed in the marketplace, the behavior of this
10656 option will change.  Therefore, if you upgrade to a newer version of
10657 GCC, the code generated option will change to reflect the processors
10658 that were most common when that version of GCC was released.
10659
10660 There is no @option{-march=generic} option because @option{-march}
10661 indicates the instruction set the compiler can use, and there is no
10662 generic instruction set applicable to all processors.  In contrast,
10663 @option{-mtune} indicates the processor (or, in this case, collection of
10664 processors) for which the code is optimized.
10665 @item native
10666 This selects the CPU to tune for at compilation time by determining
10667 the processor type of the compiling machine.  Using @option{-mtune=native}
10668 will produce code optimized for the local machine under the constraints
10669 of the selected instruction set.  Using @option{-march=native} will
10670 enable all instruction subsets supported by the local machine (hence
10671 the result might not run on different machines).
10672 @item i386
10673 Original Intel's i386 CPU@.
10674 @item i486
10675 Intel's i486 CPU@.  (No scheduling is implemented for this chip.)
10676 @item i586, pentium
10677 Intel Pentium CPU with no MMX support.
10678 @item pentium-mmx
10679 Intel PentiumMMX CPU based on Pentium core with MMX instruction set support.
10680 @item pentiumpro
10681 Intel PentiumPro CPU@.
10682 @item i686
10683 Same as @code{generic}, but when used as @code{march} option, PentiumPro
10684 instruction set will be used, so the code will run on all i686 family chips.
10685 @item pentium2
10686 Intel Pentium2 CPU based on PentiumPro core with MMX instruction set support.
10687 @item pentium3, pentium3m
10688 Intel Pentium3 CPU based on PentiumPro core with MMX and SSE instruction set
10689 support.
10690 @item pentium-m
10691 Low power version of Intel Pentium3 CPU with MMX, SSE and SSE2 instruction set
10692 support.  Used by Centrino notebooks.
10693 @item pentium4, pentium4m
10694 Intel Pentium4 CPU with MMX, SSE and SSE2 instruction set support.
10695 @item prescott
10696 Improved version of Intel Pentium4 CPU with MMX, SSE, SSE2 and SSE3 instruction
10697 set support.
10698 @item nocona
10699 Improved version of Intel Pentium4 CPU with 64-bit extensions, MMX, SSE,
10700 SSE2 and SSE3 instruction set support.
10701 @item core2
10702 Intel Core2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
10703 instruction set support.
10704 @item k6
10705 AMD K6 CPU with MMX instruction set support.
10706 @item k6-2, k6-3
10707 Improved versions of AMD K6 CPU with MMX and 3dNOW!@: instruction set support.
10708 @item athlon, athlon-tbird
10709 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW!@: and SSE prefetch instructions
10710 support.
10711 @item athlon-4, athlon-xp, athlon-mp
10712 Improved AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW!@: and full SSE
10713 instruction set support.
10714 @item k8, opteron, athlon64, athlon-fx
10715 AMD K8 core based CPUs with x86-64 instruction set support.  (This supersets
10716 MMX, SSE, SSE2, 3dNOW!, enhanced 3dNOW!@: and 64-bit instruction set extensions.)
10717 @item k8-sse3, opteron-sse3, athlon64-sse3
10718 Improved versions of k8, opteron and athlon64 with SSE3 instruction set support.
10719 @item amdfam10, barcelona
10720 AMD Family 10h core based CPUs with x86-64 instruction set support.  (This
10721 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3dNOW!, enhanced 3dNOW!, ABM and 64-bit
10722 instruction set extensions.)
10723 @item winchip-c6
10724 IDT Winchip C6 CPU, dealt in same way as i486 with additional MMX instruction
10725 set support.
10726 @item winchip2
10727 IDT Winchip2 CPU, dealt in same way as i486 with additional MMX and 3dNOW!@:
10728 instruction set support.
10729 @item c3
10730 Via C3 CPU with MMX and 3dNOW!@: instruction set support.  (No scheduling is
10731 implemented for this chip.)
10732 @item c3-2
10733 Via C3-2 CPU with MMX and SSE instruction set support.  (No scheduling is
10734 implemented for this chip.)
10735 @item geode
10736 Embedded AMD CPU with MMX and 3dNOW! instruction set support.
10737 @end table
10738
10739 While picking a specific @var{cpu-type} will schedule things appropriately
10740 for that particular chip, the compiler will not generate any code that
10741 does not run on the i386 without the @option{-march=@var{cpu-type}} option
10742 being used.
10743
10744 @item -march=@var{cpu-type}
10745 @opindex march
10746 Generate instructions for the machine type @var{cpu-type}.  The choices
10747 for @var{cpu-type} are the same as for @option{-mtune}.  Moreover,
10748 specifying @option{-march=@var{cpu-type}} implies @option{-mtune=@var{cpu-type}}.
10749
10750 @item -mcpu=@var{cpu-type}
10751 @opindex mcpu
10752 A deprecated synonym for @option{-mtune}.
10753
10754 @item -mfpmath=@var{unit}
10755 @opindex march
10756 Generate floating point arithmetics for selected unit @var{unit}.  The choices
10757 for @var{unit} are:
10758
10759 @table @samp
10760 @item 387
10761 Use the standard 387 floating point coprocessor present majority of chips and
10762 emulated otherwise.  Code compiled with this option will run almost everywhere.
10763 The temporary results are computed in 80bit precision instead of precision
10764 specified by the type resulting in slightly different results compared to most
10765 of other chips.  See @option{-ffloat-store} for more detailed description.
10766
10767 This is the default choice for i386 compiler.
10768
10769 @item sse
10770 Use scalar floating point instructions present in the SSE instruction set.
10771 This instruction set is supported by Pentium3 and newer chips, in the AMD line
10772 by Athlon-4, Athlon-xp and Athlon-mp chips.  The earlier version of SSE
10773 instruction set supports only single precision arithmetics, thus the double and
10774 extended precision arithmetics is still done using 387.  Later version, present
10775 only in Pentium4 and the future AMD x86-64 chips supports double precision
10776 arithmetics too.
10777
10778 For the i386 compiler, you need to use @option{-march=@var{cpu-type}}, @option{-msse}
10779 or @option{-msse2} switches to enable SSE extensions and make this option
10780 effective.  For the x86-64 compiler, these extensions are enabled by default.
10781
10782 The resulting code should be considerably faster in the majority of cases and avoid
10783 the numerical instability problems of 387 code, but may break some existing
10784 code that expects temporaries to be 80bit.
10785
10786 This is the default choice for the x86-64 compiler.
10787
10788 @item sse,387
10789 @itemx sse+387
10790 @itemx both
10791 Attempt to utilize both instruction sets at once.  This effectively double the
10792 amount of available registers and on chips with separate execution units for
10793 387 and SSE the execution resources too.  Use this option with care, as it is
10794 still experimental, because the GCC register allocator does not model separate
10795 functional units well resulting in instable performance.
10796 @end table
10797
10798 @item -masm=@var{dialect}
10799 @opindex masm=@var{dialect}
10800 Output asm instructions using selected @var{dialect}.  Supported
10801 choices are @samp{intel} or @samp{att} (the default one).  Darwin does
10802 not support @samp{intel}.
10803
10804 @item -mieee-fp
10805 @itemx -mno-ieee-fp
10806 @opindex mieee-fp
10807 @opindex mno-ieee-fp
10808 Control whether or not the compiler uses IEEE floating point
10809 comparisons.  These handle correctly the case where the result of a
10810 comparison is unordered.
10811
10812 @item -msoft-float
10813 @opindex msoft-float
10814 Generate output containing library calls for floating point.
10815 @strong{Warning:} the requisite libraries are not part of GCC@.
10816 Normally the facilities of the machine's usual C compiler are used, but
10817 this can't be done directly in cross-compilation.  You must make your
10818 own arrangements to provide suitable library functions for
10819 cross-compilation.
10820
10821 On machines where a function returns floating point results in the 80387
10822 register stack, some floating point opcodes may be emitted even if
10823 @option{-msoft-float} is used.
10824
10825 @item -mno-fp-ret-in-387
10826 @opindex mno-fp-ret-in-387
10827 Do not use the FPU registers for return values of functions.
10828
10829 The usual calling convention has functions return values of types
10830 @code{float} and @code{double} in an FPU register, even if there
10831 is no FPU@.  The idea is that the operating system should emulate
10832 an FPU@.
10833
10834 The option @option{-mno-fp-ret-in-387} causes such values to be returned
10835 in ordinary CPU registers instead.
10836
10837 @item -mno-fancy-math-387
10838 @opindex mno-fancy-math-387
10839 Some 387 emulators do not support the @code{sin}, @code{cos} and
10840 @code{sqrt} instructions for the 387.  Specify this option to avoid
10841 generating those instructions.  This option is the default on FreeBSD,
10842 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
10843 indicates that the target cpu will always have an FPU and so the
10844 instruction will not need emulation.  As of revision 2.6.1, these
10845 instructions are not generated unless you also use the
10846 @option{-funsafe-math-optimizations} switch.
10847
10848 @item -malign-double
10849 @itemx -mno-align-double
10850 @opindex malign-double
10851 @opindex mno-align-double
10852 Control whether GCC aligns @code{double}, @code{long double}, and
10853 @code{long long} variables on a two word boundary or a one word
10854 boundary.  Aligning @code{double} variables on a two word boundary will
10855 produce code that runs somewhat faster on a @samp{Pentium} at the
10856 expense of more memory.
10857
10858 On x86-64, @option{-malign-double} is enabled by default.
10859
10860 @strong{Warning:} if you use the @option{-malign-double} switch,
10861 structures containing the above types will be aligned differently than
10862 the published application binary interface specifications for the 386
10863 and will not be binary compatible with structures in code compiled
10864 without that switch.
10865
10866 @item -m96bit-long-double
10867 @itemx -m128bit-long-double
10868 @opindex m96bit-long-double
10869 @opindex m128bit-long-double
10870 These switches control the size of @code{long double} type.  The i386
10871 application binary interface specifies the size to be 96 bits,
10872 so @option{-m96bit-long-double} is the default in 32 bit mode.
10873
10874 Modern architectures (Pentium and newer) would prefer @code{long double}
10875 to be aligned to an 8 or 16 byte boundary.  In arrays or structures
10876 conforming to the ABI, this would not be possible.  So specifying a
10877 @option{-m128bit-long-double} will align @code{long double}
10878 to a 16 byte boundary by padding the @code{long double} with an additional
10879 32 bit zero.
10880
10881 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
10882 its ABI specifies that @code{long double} is to be aligned on 16 byte boundary.
10883
10884 Notice that neither of these options enable any extra precision over the x87
10885 standard of 80 bits for a @code{long double}.
10886
10887 @strong{Warning:} if you override the default value for your target ABI, the
10888 structures and arrays containing @code{long double} variables will change
10889 their size as well as function calling convention for function taking
10890 @code{long double} will be modified.  Hence they will not be binary
10891 compatible with arrays or structures in code compiled without that switch.
10892
10893 @item -mmlarge-data-threshold=@var{number}
10894 @opindex mlarge-data-threshold=@var{number}
10895 When @option{-mcmodel=medium} is specified, the data greater than
10896 @var{threshold} are placed in large data section.  This value must be the
10897 same across all object linked into the binary and defaults to 65535.
10898
10899 @item -mrtd
10900 @opindex mrtd
10901 Use a different function-calling convention, in which functions that
10902 take a fixed number of arguments return with the @code{ret} @var{num}
10903 instruction, which pops their arguments while returning.  This saves one
10904 instruction in the caller since there is no need to pop the arguments
10905 there.
10906
10907 You can specify that an individual function is called with this calling
10908 sequence with the function attribute @samp{stdcall}.  You can also
10909 override the @option{-mrtd} option by using the function attribute
10910 @samp{cdecl}.  @xref{Function Attributes}.
10911
10912 @strong{Warning:} this calling convention is incompatible with the one
10913 normally used on Unix, so you cannot use it if you need to call
10914 libraries compiled with the Unix compiler.
10915
10916 Also, you must provide function prototypes for all functions that
10917 take variable numbers of arguments (including @code{printf});
10918 otherwise incorrect code will be generated for calls to those
10919 functions.
10920
10921 In addition, seriously incorrect code will result if you call a
10922 function with too many arguments.  (Normally, extra arguments are
10923 harmlessly ignored.)
10924
10925 @item -mregparm=@var{num}
10926 @opindex mregparm
10927 Control how many registers are used to pass integer arguments.  By
10928 default, no registers are used to pass arguments, and at most 3
10929 registers can be used.  You can control this behavior for a specific
10930 function by using the function attribute @samp{regparm}.
10931 @xref{Function Attributes}.
10932
10933 @strong{Warning:} if you use this switch, and
10934 @var{num} is nonzero, then you must build all modules with the same
10935 value, including any libraries.  This includes the system libraries and
10936 startup modules.
10937
10938 @item -msseregparm
10939 @opindex msseregparm
10940 Use SSE register passing conventions for float and double arguments
10941 and return values.  You can control this behavior for a specific
10942 function by using the function attribute @samp{sseregparm}.
10943 @xref{Function Attributes}.
10944
10945 @strong{Warning:} if you use this switch then you must build all
10946 modules with the same value, including any libraries.  This includes
10947 the system libraries and startup modules.
10948
10949 @item -mpc32
10950 @itemx -mpc64
10951 @itemx -mpc80
10952 @opindex mpc32
10953 @opindex mpc64
10954 @opindex mpc80
10955
10956 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
10957 is specified, the significands of results of floating-point operations are
10958 rounded to 24 bits (single precision); @option{-mpc64} rounds the
10959 significands of results of floating-point operations to 53 bits (double
10960 precision) and @option{-mpc80} rounds the significands of results of
10961 floating-point operations to 64 bits (extended double precision), which is
10962 the default.  When this option is used, floating-point operations in higher
10963 precisions are not available to the programmer without setting the FPU
10964 control word explicitly.
10965
10966 Setting the rounding of floating-point operations to less than the default
10967 80 bits can speed some programs by 2% or more.  Note that some mathematical
10968 libraries assume that extended precision (80 bit) floating-point operations
10969 are enabled by default; routines in such libraries could suffer significant
10970 loss of accuracy, typically through so-called "catastrophic cancellation",
10971 when this option is used to set the precision to less than extended precision. 
10972
10973 @item -mstackrealign
10974 @opindex mstackrealign
10975 Realign the stack at entry.  On the Intel x86, the @option{-mstackrealign}
10976 option will generate an alternate prologue and epilogue that realigns the
10977 runtime stack if necessary.  This supports mixing legacy codes that keep
10978 a 4-byte aligned stack with modern codes that keep a 16-byte stack for
10979 SSE compatibility.  See also the attribute @code{force_align_arg_pointer},
10980 applicable to individual functions.
10981
10982 @item -mpreferred-stack-boundary=@var{num}
10983 @opindex mpreferred-stack-boundary
10984 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
10985 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
10986 the default is 4 (16 bytes or 128 bits).
10987
10988 @item -mincoming-stack-boundary=@var{num}
10989 @opindex mincoming-stack-boundary
10990 Assume the incoming stack is aligned to a 2 raised to @var{num} byte
10991 boundary.  If @option{-mincoming-stack-boundary} is not specified,
10992 the one specified by @option{-mpreferred-stack-boundary} will be used.
10993
10994 On Pentium and PentiumPro, @code{double} and @code{long double} values
10995 should be aligned to an 8 byte boundary (see @option{-malign-double}) or
10996 suffer significant run time performance penalties.  On Pentium III, the
10997 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
10998 properly if it is not 16 byte aligned.
10999
11000 To ensure proper alignment of this values on the stack, the stack boundary
11001 must be as aligned as that required by any value stored on the stack.
11002 Further, every function must be generated such that it keeps the stack
11003 aligned.  Thus calling a function compiled with a higher preferred
11004 stack boundary from a function compiled with a lower preferred stack
11005 boundary will most likely misalign the stack.  It is recommended that
11006 libraries that use callbacks always use the default setting.
11007
11008 This extra alignment does consume extra stack space, and generally
11009 increases code size.  Code that is sensitive to stack space usage, such
11010 as embedded systems and operating system kernels, may want to reduce the
11011 preferred alignment to @option{-mpreferred-stack-boundary=2}.
11012
11013 @item -mmmx
11014 @itemx -mno-mmx
11015 @itemx -msse
11016 @itemx -mno-sse
11017 @itemx -msse2
11018 @itemx -mno-sse2
11019 @itemx -msse3
11020 @itemx -mno-sse3
11021 @itemx -mssse3
11022 @itemx -mno-ssse3
11023 @itemx -msse4.1
11024 @itemx -mno-sse4.1
11025 @itemx -msse4.2
11026 @itemx -mno-sse4.2
11027 @itemx -msse4
11028 @itemx -mno-sse4
11029 @itemx -mavx
11030 @itemx -mno-avx
11031 @itemx -maes
11032 @itemx -mno-aes
11033 @itemx -mpclmul
11034 @itemx -mno-pclmul
11035 @itemx -msse4a
11036 @itemx -mno-sse4a
11037 @itemx -msse5
11038 @itemx -mno-sse5
11039 @itemx -m3dnow
11040 @itemx -mno-3dnow
11041 @itemx -mpopcnt
11042 @itemx -mno-popcnt
11043 @itemx -mabm
11044 @itemx -mno-abm
11045 @opindex mmmx
11046 @opindex mno-mmx
11047 @opindex msse
11048 @opindex mno-sse
11049 @opindex m3dnow
11050 @opindex mno-3dnow
11051 These switches enable or disable the use of instructions in the MMX,
11052 SSE, SSE2, SSE3, SSSE3, SSE4.1, AVX, AES, PCLMUL, SSE4A, SSE5, ABM or
11053 3DNow!@: extended instruction sets.
11054 These extensions are also available as built-in functions: see
11055 @ref{X86 Built-in Functions}, for details of the functions enabled and
11056 disabled by these switches.
11057
11058 To have SSE/SSE2 instructions generated automatically from floating-point
11059 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
11060
11061 GCC depresses SSEx instructions when @option{-mavx} is used. Instead, it
11062 generates new AVX instructions or AVX equivalence for all SSEx instructions
11063 when needed.
11064
11065 These options will enable GCC to use these extended instructions in
11066 generated code, even without @option{-mfpmath=sse}.  Applications which
11067 perform runtime CPU detection must compile separate files for each
11068 supported architecture, using the appropriate flags.  In particular,
11069 the file containing the CPU detection code should be compiled without
11070 these options.
11071
11072 @item -mcld
11073 @opindex mcld
11074 This option instructs GCC to emit a @code{cld} instruction in the prologue
11075 of functions that use string instructions.  String instructions depend on
11076 the DF flag to select between autoincrement or autodecrement mode.  While the
11077 ABI specifies the DF flag to be cleared on function entry, some operating
11078 systems violate this specification by not clearing the DF flag in their
11079 exception dispatchers.  The exception handler can be invoked with the DF flag
11080 set which leads to wrong direction mode, when string instructions are used.
11081 This option can be enabled by default on 32-bit x86 targets by configuring
11082 GCC with the @option{--enable-cld} configure option.  Generation of @code{cld}
11083 instructions can be suppressed with the @option{-mno-cld} compiler option
11084 in this case.
11085
11086 @item -mcx16
11087 @opindex mcx16
11088 This option will enable GCC to use CMPXCHG16B instruction in generated code.
11089 CMPXCHG16B allows for atomic operations on 128-bit double quadword (or oword)
11090 data types.  This is useful for high resolution counters that could be updated
11091 by multiple processors (or cores).  This instruction is generated as part of
11092 atomic built-in functions: see @ref{Atomic Builtins} for details.
11093
11094 @item -msahf
11095 @opindex msahf
11096 This option will enable GCC to use SAHF instruction in generated 64-bit code.
11097 Early Intel CPUs with Intel 64 lacked LAHF and SAHF instructions supported
11098 by AMD64 until introduction of Pentium 4 G1 step in December 2005.  LAHF and
11099 SAHF are load and store instructions, respectively, for certain status flags.
11100 In 64-bit mode, SAHF instruction is used to optimize @code{fmod}, @code{drem}
11101 or @code{remainder} built-in functions: see @ref{Other Builtins} for details.
11102
11103 @item -mrecip
11104 @opindex mrecip
11105 This option will enable GCC to use RCPSS and RSQRTSS instructions (and their
11106 vectorized variants RCPPS and RSQRTPS) with an additional Newton-Rhapson step
11107 to increase precision instead of DIVSS and SQRTSS (and their vectorized
11108 variants) for single precision floating point arguments.  These instructions
11109 are generated only when @option{-funsafe-math-optimizations} is enabled
11110 together with @option{-finite-math-only} and @option{-fno-trapping-math}.
11111 Note that while the throughput of the sequence is higher than the throughput
11112 of the non-reciprocal instruction, the precision of the sequence can be
11113 decreased by up to 2 ulp (i.e. the inverse of 1.0 equals 0.99999994).
11114
11115 @item -mveclibabi=@var{type}
11116 @opindex mveclibabi
11117 Specifies the ABI type to use for vectorizing intrinsics using an
11118 external library.  Supported types are @code{svml} for the Intel short
11119 vector math library and @code{acml} for the AMD math core library style
11120 of interfacing.  GCC will currently emit calls to @code{vmldExp2},
11121 @code{vmldLn2}, @code{vmldLog102}, @code{vmldLog102}, @code{vmldPow2},
11122 @code{vmldTanh2}, @code{vmldTan2}, @code{vmldAtan2}, @code{vmldAtanh2},
11123 @code{vmldCbrt2}, @code{vmldSinh2}, @code{vmldSin2}, @code{vmldAsinh2},
11124 @code{vmldAsin2}, @code{vmldCosh2}, @code{vmldCos2}, @code{vmldAcosh2},
11125 @code{vmldAcos2}, @code{vmlsExp4}, @code{vmlsLn4}, @code{vmlsLog104},
11126 @code{vmlsLog104}, @code{vmlsPow4}, @code{vmlsTanh4}, @code{vmlsTan4},
11127 @code{vmlsAtan4}, @code{vmlsAtanh4}, @code{vmlsCbrt4}, @code{vmlsSinh4},
11128 @code{vmlsSin4}, @code{vmlsAsinh4}, @code{vmlsAsin4}, @code{vmlsCosh4},
11129 @code{vmlsCos4}, @code{vmlsAcosh4} and @code{vmlsAcos4} for corresponding
11130 function type when @option{-mveclibabi=svml} is used and @code{__vrd2_sin},
11131 @code{__vrd2_cos}, @code{__vrd2_exp}, @code{__vrd2_log}, @code{__vrd2_log2},
11132 @code{__vrd2_log10}, @code{__vrs4_sinf}, @code{__vrs4_cosf},
11133 @code{__vrs4_expf}, @code{__vrs4_logf}, @code{__vrs4_log2f},
11134 @code{__vrs4_log10f} and @code{__vrs4_powf} for corresponding function type
11135 when @option{-mveclibabi=acml} is used. Both @option{-ftree-vectorize} and
11136 @option{-funsafe-math-optimizations} have to be enabled. A SVML or ACML ABI
11137 compatible library will have to be specified at link time.
11138
11139 @item -mpush-args
11140 @itemx -mno-push-args
11141 @opindex mpush-args
11142 @opindex mno-push-args
11143 Use PUSH operations to store outgoing parameters.  This method is shorter
11144 and usually equally fast as method using SUB/MOV operations and is enabled
11145 by default.  In some cases disabling it may improve performance because of
11146 improved scheduling and reduced dependencies.
11147
11148 @item -maccumulate-outgoing-args
11149 @opindex maccumulate-outgoing-args
11150 If enabled, the maximum amount of space required for outgoing arguments will be
11151 computed in the function prologue.  This is faster on most modern CPUs
11152 because of reduced dependencies, improved scheduling and reduced stack usage
11153 when preferred stack boundary is not equal to 2.  The drawback is a notable
11154 increase in code size.  This switch implies @option{-mno-push-args}.
11155
11156 @item -mthreads
11157 @opindex mthreads
11158 Support thread-safe exception handling on @samp{Mingw32}.  Code that relies
11159 on thread-safe exception handling must compile and link all code with the
11160 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
11161 @option{-D_MT}; when linking, it links in a special thread helper library
11162 @option{-lmingwthrd} which cleans up per thread exception handling data.
11163
11164 @item -mno-align-stringops
11165 @opindex mno-align-stringops
11166 Do not align destination of inlined string operations.  This switch reduces
11167 code size and improves performance in case the destination is already aligned,
11168 but GCC doesn't know about it.
11169
11170 @item -minline-all-stringops
11171 @opindex minline-all-stringops
11172 By default GCC inlines string operations only when destination is known to be
11173 aligned at least to 4 byte boundary.  This enables more inlining, increase code
11174 size, but may improve performance of code that depends on fast memcpy, strlen
11175 and memset for short lengths.
11176
11177 @item -minline-stringops-dynamically
11178 @opindex minline-stringops-dynamically
11179 For string operation of unknown size, inline runtime checks so for small
11180 blocks inline code is used, while for large blocks library call is used.
11181
11182 @item -mstringop-strategy=@var{alg}
11183 @opindex mstringop-strategy=@var{alg}
11184 Overwrite internal decision heuristic about particular algorithm to inline
11185 string operation with.  The allowed values are @code{rep_byte},
11186 @code{rep_4byte}, @code{rep_8byte} for expanding using i386 @code{rep} prefix
11187 of specified size, @code{byte_loop}, @code{loop}, @code{unrolled_loop} for
11188 expanding inline loop, @code{libcall} for always expanding library call.
11189
11190 @item -momit-leaf-frame-pointer
11191 @opindex momit-leaf-frame-pointer
11192 Don't keep the frame pointer in a register for leaf functions.  This
11193 avoids the instructions to save, set up and restore frame pointers and
11194 makes an extra register available in leaf functions.  The option
11195 @option{-fomit-frame-pointer} removes the frame pointer for all functions
11196 which might make debugging harder.
11197
11198 @item -mtls-direct-seg-refs
11199 @itemx -mno-tls-direct-seg-refs
11200 @opindex mtls-direct-seg-refs
11201 Controls whether TLS variables may be accessed with offsets from the
11202 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
11203 or whether the thread base pointer must be added.  Whether or not this
11204 is legal depends on the operating system, and whether it maps the
11205 segment to cover the entire TLS area.
11206
11207 For systems that use GNU libc, the default is on.
11208
11209 @item -mfused-madd
11210 @itemx -mno-fused-madd
11211 @opindex mfused-madd
11212 Enable automatic generation of fused floating point multiply-add instructions
11213 if the ISA supports such instructions.  The -mfused-madd option is on by
11214 default.  The fused multiply-add instructions have a different
11215 rounding behavior compared to executing a multiply followed by an add.
11216
11217 @item -msse2avx
11218 @itemx -mno-sse2avx
11219 @opindex msse2avx
11220 Specify that the assembler should encode SSE instructions with VEX
11221 prefix.  The option @option{-mavx} turns this on by default.
11222 @end table
11223
11224 These @samp{-m} switches are supported in addition to the above
11225 on AMD x86-64 processors in 64-bit environments.
11226
11227 @table @gcctabopt
11228 @item -m32
11229 @itemx -m64
11230 @opindex m32
11231 @opindex m64
11232 Generate code for a 32-bit or 64-bit environment.
11233 The 32-bit environment sets int, long and pointer to 32 bits and
11234 generates code that runs on any i386 system.
11235 The 64-bit environment sets int to 32 bits and long and pointer
11236 to 64 bits and generates code for AMD's x86-64 architecture. For
11237 darwin only the -m64 option turns off the @option{-fno-pic} and
11238 @option{-mdynamic-no-pic} options.
11239
11240 @item -mno-red-zone
11241 @opindex no-red-zone
11242 Do not use a so called red zone for x86-64 code.  The red zone is mandated
11243 by the x86-64 ABI, it is a 128-byte area beyond the location of the
11244 stack pointer that will not be modified by signal or interrupt handlers
11245 and therefore can be used for temporary data without adjusting the stack
11246 pointer.  The flag @option{-mno-red-zone} disables this red zone.
11247
11248 @item -mcmodel=small
11249 @opindex mcmodel=small
11250 Generate code for the small code model: the program and its symbols must
11251 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
11252 Programs can be statically or dynamically linked.  This is the default
11253 code model.
11254
11255 @item -mcmodel=kernel
11256 @opindex mcmodel=kernel
11257 Generate code for the kernel code model.  The kernel runs in the
11258 negative 2 GB of the address space.
11259 This model has to be used for Linux kernel code.
11260
11261 @item -mcmodel=medium
11262 @opindex mcmodel=medium
11263 Generate code for the medium model: The program is linked in the lower 2
11264 GB of the address space but symbols can be located anywhere in the
11265 address space.  Programs can be statically or dynamically linked, but
11266 building of shared libraries are not supported with the medium model.
11267
11268 @item -mcmodel=large
11269 @opindex mcmodel=large
11270 Generate code for the large model: This model makes no assumptions
11271 about addresses and sizes of sections.
11272 @end table
11273
11274 @node IA-64 Options
11275 @subsection IA-64 Options
11276 @cindex IA-64 Options
11277
11278 These are the @samp{-m} options defined for the Intel IA-64 architecture.
11279
11280 @table @gcctabopt
11281 @item -mbig-endian
11282 @opindex mbig-endian
11283 Generate code for a big endian target.  This is the default for HP-UX@.
11284
11285 @item -mlittle-endian
11286 @opindex mlittle-endian
11287 Generate code for a little endian target.  This is the default for AIX5
11288 and GNU/Linux.
11289
11290 @item -mgnu-as
11291 @itemx -mno-gnu-as
11292 @opindex mgnu-as
11293 @opindex mno-gnu-as
11294 Generate (or don't) code for the GNU assembler.  This is the default.
11295 @c Also, this is the default if the configure option @option{--with-gnu-as}
11296 @c is used.
11297
11298 @item -mgnu-ld
11299 @itemx -mno-gnu-ld
11300 @opindex mgnu-ld
11301 @opindex mno-gnu-ld
11302 Generate (or don't) code for the GNU linker.  This is the default.
11303 @c Also, this is the default if the configure option @option{--with-gnu-ld}
11304 @c is used.
11305
11306 @item -mno-pic
11307 @opindex mno-pic
11308 Generate code that does not use a global pointer register.  The result
11309 is not position independent code, and violates the IA-64 ABI@.
11310
11311 @item -mvolatile-asm-stop
11312 @itemx -mno-volatile-asm-stop
11313 @opindex mvolatile-asm-stop
11314 @opindex mno-volatile-asm-stop
11315 Generate (or don't) a stop bit immediately before and after volatile asm
11316 statements.
11317
11318 @item -mregister-names
11319 @itemx -mno-register-names
11320 @opindex mregister-names
11321 @opindex mno-register-names
11322 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
11323 the stacked registers.  This may make assembler output more readable.
11324
11325 @item -mno-sdata
11326 @itemx -msdata
11327 @opindex mno-sdata
11328 @opindex msdata
11329 Disable (or enable) optimizations that use the small data section.  This may
11330 be useful for working around optimizer bugs.
11331
11332 @item -mconstant-gp
11333 @opindex mconstant-gp
11334 Generate code that uses a single constant global pointer value.  This is
11335 useful when compiling kernel code.
11336
11337 @item -mauto-pic
11338 @opindex mauto-pic
11339 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
11340 This is useful when compiling firmware code.
11341
11342 @item -minline-float-divide-min-latency
11343 @opindex minline-float-divide-min-latency
11344 Generate code for inline divides of floating point values
11345 using the minimum latency algorithm.
11346
11347 @item -minline-float-divide-max-throughput
11348 @opindex minline-float-divide-max-throughput
11349 Generate code for inline divides of floating point values
11350 using the maximum throughput algorithm.
11351
11352 @item -minline-int-divide-min-latency
11353 @opindex minline-int-divide-min-latency
11354 Generate code for inline divides of integer values
11355 using the minimum latency algorithm.
11356
11357 @item -minline-int-divide-max-throughput
11358 @opindex minline-int-divide-max-throughput
11359 Generate code for inline divides of integer values
11360 using the maximum throughput algorithm.
11361
11362 @item -minline-sqrt-min-latency
11363 @opindex minline-sqrt-min-latency
11364 Generate code for inline square roots
11365 using the minimum latency algorithm.
11366
11367 @item -minline-sqrt-max-throughput
11368 @opindex minline-sqrt-max-throughput
11369 Generate code for inline square roots
11370 using the maximum throughput algorithm.
11371
11372 @item -mno-dwarf2-asm
11373 @itemx -mdwarf2-asm
11374 @opindex mno-dwarf2-asm
11375 @opindex mdwarf2-asm
11376 Don't (or do) generate assembler code for the DWARF2 line number debugging
11377 info.  This may be useful when not using the GNU assembler.
11378
11379 @item -mearly-stop-bits
11380 @itemx -mno-early-stop-bits
11381 @opindex mearly-stop-bits
11382 @opindex mno-early-stop-bits
11383 Allow stop bits to be placed earlier than immediately preceding the
11384 instruction that triggered the stop bit.  This can improve instruction
11385 scheduling, but does not always do so.
11386
11387 @item -mfixed-range=@var{register-range}
11388 @opindex mfixed-range
11389 Generate code treating the given register range as fixed registers.
11390 A fixed register is one that the register allocator can not use.  This is
11391 useful when compiling kernel code.  A register range is specified as
11392 two registers separated by a dash.  Multiple register ranges can be
11393 specified separated by a comma.
11394
11395 @item -mtls-size=@var{tls-size}
11396 @opindex mtls-size
11397 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
11398 64.
11399
11400 @item -mtune=@var{cpu-type}
11401 @opindex mtune
11402 Tune the instruction scheduling for a particular CPU, Valid values are
11403 itanium, itanium1, merced, itanium2, and mckinley.
11404
11405 @item -mt
11406 @itemx -pthread
11407 @opindex mt
11408 @opindex pthread
11409 Add support for multithreading using the POSIX threads library.  This
11410 option sets flags for both the preprocessor and linker.  It does
11411 not affect the thread safety of object code produced by the compiler or
11412 that of libraries supplied with it.  These are HP-UX specific flags.
11413
11414 @item -milp32
11415 @itemx -mlp64
11416 @opindex milp32
11417 @opindex mlp64
11418 Generate code for a 32-bit or 64-bit environment.
11419 The 32-bit environment sets int, long and pointer to 32 bits.
11420 The 64-bit environment sets int to 32 bits and long and pointer
11421 to 64 bits.  These are HP-UX specific flags.
11422
11423 @item -mno-sched-br-data-spec
11424 @itemx -msched-br-data-spec
11425 @opindex mno-sched-br-data-spec
11426 @opindex msched-br-data-spec
11427 (Dis/En)able data speculative scheduling before reload.
11428 This will result in generation of the ld.a instructions and
11429 the corresponding check instructions (ld.c / chk.a).
11430 The default is 'disable'.
11431
11432 @item -msched-ar-data-spec
11433 @itemx -mno-sched-ar-data-spec
11434 @opindex msched-ar-data-spec
11435 @opindex mno-sched-ar-data-spec
11436 (En/Dis)able data speculative scheduling after reload.
11437 This will result in generation of the ld.a instructions and
11438 the corresponding check instructions (ld.c / chk.a).
11439 The default is 'enable'.
11440
11441 @item -mno-sched-control-spec
11442 @itemx -msched-control-spec
11443 @opindex mno-sched-control-spec
11444 @opindex msched-control-spec
11445 (Dis/En)able control speculative scheduling.  This feature is
11446 available only during region scheduling (i.e.@: before reload).
11447 This will result in generation of the ld.s instructions and
11448 the corresponding check instructions chk.s .
11449 The default is 'disable'.
11450
11451 @item -msched-br-in-data-spec
11452 @itemx -mno-sched-br-in-data-spec
11453 @opindex msched-br-in-data-spec
11454 @opindex mno-sched-br-in-data-spec
11455 (En/Dis)able speculative scheduling of the instructions that
11456 are dependent on the data speculative loads before reload.
11457 This is effective only with @option{-msched-br-data-spec} enabled.
11458 The default is 'enable'.
11459
11460 @item -msched-ar-in-data-spec
11461 @itemx -mno-sched-ar-in-data-spec
11462 @opindex msched-ar-in-data-spec
11463 @opindex mno-sched-ar-in-data-spec
11464 (En/Dis)able speculative scheduling of the instructions that
11465 are dependent on the data speculative loads after reload.
11466 This is effective only with @option{-msched-ar-data-spec} enabled.
11467 The default is 'enable'.
11468
11469 @item -msched-in-control-spec
11470 @itemx -mno-sched-in-control-spec
11471 @opindex msched-in-control-spec
11472 @opindex mno-sched-in-control-spec
11473 (En/Dis)able speculative scheduling of the instructions that
11474 are dependent on the control speculative loads.
11475 This is effective only with @option{-msched-control-spec} enabled.
11476 The default is 'enable'.
11477
11478 @item -msched-ldc
11479 @itemx -mno-sched-ldc
11480 @opindex msched-ldc
11481 @opindex mno-sched-ldc
11482 (En/Dis)able use of simple data speculation checks ld.c .
11483 If disabled, only chk.a instructions will be emitted to check
11484 data speculative loads.
11485 The default is 'enable'.
11486
11487 @item -mno-sched-control-ldc
11488 @itemx -msched-control-ldc
11489 @opindex mno-sched-control-ldc
11490 @opindex msched-control-ldc
11491 (Dis/En)able use of ld.c instructions to check control speculative loads.
11492 If enabled, in case of control speculative load with no speculatively
11493 scheduled dependent instructions this load will be emitted as ld.sa and
11494 ld.c will be used to check it.
11495 The default is 'disable'.
11496
11497 @item -mno-sched-spec-verbose
11498 @itemx -msched-spec-verbose
11499 @opindex mno-sched-spec-verbose
11500 @opindex msched-spec-verbose
11501 (Dis/En)able printing of the information about speculative motions.
11502
11503 @item -mno-sched-prefer-non-data-spec-insns
11504 @itemx -msched-prefer-non-data-spec-insns
11505 @opindex mno-sched-prefer-non-data-spec-insns
11506 @opindex msched-prefer-non-data-spec-insns
11507 If enabled, data speculative instructions will be chosen for schedule
11508 only if there are no other choices at the moment.  This will make
11509 the use of the data speculation much more conservative.
11510 The default is 'disable'.
11511
11512 @item -mno-sched-prefer-non-control-spec-insns
11513 @itemx -msched-prefer-non-control-spec-insns
11514 @opindex mno-sched-prefer-non-control-spec-insns
11515 @opindex msched-prefer-non-control-spec-insns
11516 If enabled, control speculative instructions will be chosen for schedule
11517 only if there are no other choices at the moment.  This will make
11518 the use of the control speculation much more conservative.
11519 The default is 'disable'.
11520
11521 @item -mno-sched-count-spec-in-critical-path
11522 @itemx -msched-count-spec-in-critical-path
11523 @opindex mno-sched-count-spec-in-critical-path
11524 @opindex msched-count-spec-in-critical-path
11525 If enabled, speculative dependencies will be considered during
11526 computation of the instructions priorities.  This will make the use of the
11527 speculation a bit more conservative.
11528 The default is 'disable'.
11529
11530 @end table
11531
11532 @node M32C Options
11533 @subsection M32C Options
11534 @cindex M32C options
11535
11536 @table @gcctabopt
11537 @item -mcpu=@var{name}
11538 @opindex mcpu=
11539 Select the CPU for which code is generated.  @var{name} may be one of
11540 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
11541 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
11542 the M32C/80 series.
11543
11544 @item -msim
11545 @opindex msim
11546 Specifies that the program will be run on the simulator.  This causes
11547 an alternate runtime library to be linked in which supports, for
11548 example, file I/O@.  You must not use this option when generating
11549 programs that will run on real hardware; you must provide your own
11550 runtime library for whatever I/O functions are needed.
11551
11552 @item -memregs=@var{number}
11553 @opindex memregs=
11554 Specifies the number of memory-based pseudo-registers GCC will use
11555 during code generation.  These pseudo-registers will be used like real
11556 registers, so there is a tradeoff between GCC's ability to fit the
11557 code into available registers, and the performance penalty of using
11558 memory instead of registers.  Note that all modules in a program must
11559 be compiled with the same value for this option.  Because of that, you
11560 must not use this option with the default runtime libraries gcc
11561 builds.
11562
11563 @end table
11564
11565 @node M32R/D Options
11566 @subsection M32R/D Options
11567 @cindex M32R/D options
11568
11569 These @option{-m} options are defined for Renesas M32R/D architectures:
11570
11571 @table @gcctabopt
11572 @item -m32r2
11573 @opindex m32r2
11574 Generate code for the M32R/2@.
11575
11576 @item -m32rx
11577 @opindex m32rx
11578 Generate code for the M32R/X@.
11579
11580 @item -m32r
11581 @opindex m32r
11582 Generate code for the M32R@.  This is the default.
11583
11584 @item -mmodel=small
11585 @opindex mmodel=small
11586 Assume all objects live in the lower 16MB of memory (so that their addresses
11587 can be loaded with the @code{ld24} instruction), and assume all subroutines
11588 are reachable with the @code{bl} instruction.
11589 This is the default.
11590
11591 The addressability of a particular object can be set with the
11592 @code{model} attribute.
11593
11594 @item -mmodel=medium
11595 @opindex mmodel=medium
11596 Assume objects may be anywhere in the 32-bit address space (the compiler
11597 will generate @code{seth/add3} instructions to load their addresses), and
11598 assume all subroutines are reachable with the @code{bl} instruction.
11599
11600 @item -mmodel=large
11601 @opindex mmodel=large
11602 Assume objects may be anywhere in the 32-bit address space (the compiler
11603 will generate @code{seth/add3} instructions to load their addresses), and
11604 assume subroutines may not be reachable with the @code{bl} instruction
11605 (the compiler will generate the much slower @code{seth/add3/jl}
11606 instruction sequence).
11607
11608 @item -msdata=none
11609 @opindex msdata=none
11610 Disable use of the small data area.  Variables will be put into
11611 one of @samp{.data}, @samp{bss}, or @samp{.rodata} (unless the
11612 @code{section} attribute has been specified).
11613 This is the default.
11614
11615 The small data area consists of sections @samp{.sdata} and @samp{.sbss}.
11616 Objects may be explicitly put in the small data area with the
11617 @code{section} attribute using one of these sections.
11618
11619 @item -msdata=sdata
11620 @opindex msdata=sdata
11621 Put small global and static data in the small data area, but do not
11622 generate special code to reference them.
11623
11624 @item -msdata=use
11625 @opindex msdata=use
11626 Put small global and static data in the small data area, and generate
11627 special instructions to reference them.
11628
11629 @item -G @var{num}
11630 @opindex G
11631 @cindex smaller data references
11632 Put global and static objects less than or equal to @var{num} bytes
11633 into the small data or bss sections instead of the normal data or bss
11634 sections.  The default value of @var{num} is 8.
11635 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
11636 for this option to have any effect.
11637
11638 All modules should be compiled with the same @option{-G @var{num}} value.
11639 Compiling with different values of @var{num} may or may not work; if it
11640 doesn't the linker will give an error message---incorrect code will not be
11641 generated.
11642
11643 @item -mdebug
11644 @opindex mdebug
11645 Makes the M32R specific code in the compiler display some statistics
11646 that might help in debugging programs.
11647
11648 @item -malign-loops
11649 @opindex malign-loops
11650 Align all loops to a 32-byte boundary.
11651
11652 @item -mno-align-loops
11653 @opindex mno-align-loops
11654 Do not enforce a 32-byte alignment for loops.  This is the default.
11655
11656 @item -missue-rate=@var{number}
11657 @opindex missue-rate=@var{number}
11658 Issue @var{number} instructions per cycle.  @var{number} can only be 1
11659 or 2.
11660
11661 @item -mbranch-cost=@var{number}
11662 @opindex mbranch-cost=@var{number}
11663 @var{number} can only be 1 or 2.  If it is 1 then branches will be
11664 preferred over conditional code, if it is 2, then the opposite will
11665 apply.
11666
11667 @item -mflush-trap=@var{number}
11668 @opindex mflush-trap=@var{number}
11669 Specifies the trap number to use to flush the cache.  The default is
11670 12.  Valid numbers are between 0 and 15 inclusive.
11671
11672 @item -mno-flush-trap
11673 @opindex mno-flush-trap
11674 Specifies that the cache cannot be flushed by using a trap.
11675
11676 @item -mflush-func=@var{name}
11677 @opindex mflush-func=@var{name}
11678 Specifies the name of the operating system function to call to flush
11679 the cache.  The default is @emph{_flush_cache}, but a function call
11680 will only be used if a trap is not available.
11681
11682 @item -mno-flush-func
11683 @opindex mno-flush-func
11684 Indicates that there is no OS function for flushing the cache.
11685
11686 @end table
11687
11688 @node M680x0 Options
11689 @subsection M680x0 Options
11690 @cindex M680x0 options
11691
11692 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
11693 The default settings depend on which architecture was selected when
11694 the compiler was configured; the defaults for the most common choices
11695 are given below.
11696
11697 @table @gcctabopt
11698 @item -march=@var{arch}
11699 @opindex march
11700 Generate code for a specific M680x0 or ColdFire instruction set
11701 architecture.  Permissible values of @var{arch} for M680x0
11702 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
11703 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
11704 architectures are selected according to Freescale's ISA classification
11705 and the permissible values are: @samp{isaa}, @samp{isaaplus},
11706 @samp{isab} and @samp{isac}.
11707
11708 gcc defines a macro @samp{__mcf@var{arch}__} whenever it is generating
11709 code for a ColdFire target.  The @var{arch} in this macro is one of the
11710 @option{-march} arguments given above.
11711
11712 When used together, @option{-march} and @option{-mtune} select code
11713 that runs on a family of similar processors but that is optimized
11714 for a particular microarchitecture.
11715
11716 @item -mcpu=@var{cpu}
11717 @opindex mcpu
11718 Generate code for a specific M680x0 or ColdFire processor.
11719 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
11720 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
11721 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
11722 below, which also classifies the CPUs into families:
11723
11724 @multitable @columnfractions 0.20 0.80
11725 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
11726 @item @samp{51qe} @tab @samp{51qe}
11727 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
11728 @item @samp{5206e} @tab @samp{5206e}
11729 @item @samp{5208} @tab @samp{5207} @samp{5208}
11730 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
11731 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
11732 @item @samp{5216} @tab @samp{5214} @samp{5216}
11733 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
11734 @item @samp{5225} @tab @samp{5224} @samp{5225}
11735 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
11736 @item @samp{5249} @tab @samp{5249}
11737 @item @samp{5250} @tab @samp{5250}
11738 @item @samp{5271} @tab @samp{5270} @samp{5271}
11739 @item @samp{5272} @tab @samp{5272}
11740 @item @samp{5275} @tab @samp{5274} @samp{5275}
11741 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
11742 @item @samp{5307} @tab @samp{5307}
11743 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
11744 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
11745 @item @samp{5407} @tab @samp{5407}
11746 @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}
11747 @end multitable
11748
11749 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
11750 @var{arch} is compatible with @var{cpu}.  Other combinations of
11751 @option{-mcpu} and @option{-march} are rejected.
11752
11753 gcc defines the macro @samp{__mcf_cpu_@var{cpu}} when ColdFire target
11754 @var{cpu} is selected.  It also defines @samp{__mcf_family_@var{family}},
11755 where the value of @var{family} is given by the table above.
11756
11757 @item -mtune=@var{tune}
11758 @opindex mtune
11759 Tune the code for a particular microarchitecture, within the
11760 constraints set by @option{-march} and @option{-mcpu}.
11761 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
11762 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
11763 and @samp{cpu32}.  The ColdFire microarchitectures
11764 are: @samp{cfv1}, @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
11765
11766 You can also use @option{-mtune=68020-40} for code that needs
11767 to run relatively well on 68020, 68030 and 68040 targets.
11768 @option{-mtune=68020-60} is similar but includes 68060 targets
11769 as well.  These two options select the same tuning decisions as
11770 @option{-m68020-40} and @option{-m68020-60} respectively.
11771
11772 gcc defines the macros @samp{__mc@var{arch}} and @samp{__mc@var{arch}__}
11773 when tuning for 680x0 architecture @var{arch}.  It also defines
11774 @samp{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
11775 option is used.  If gcc is tuning for a range of architectures,
11776 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
11777 it defines the macros for every architecture in the range.
11778
11779 gcc also defines the macro @samp{__m@var{uarch}__} when tuning for
11780 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
11781 of the arguments given above.
11782
11783 @item -m68000
11784 @itemx -mc68000
11785 @opindex m68000
11786 @opindex mc68000
11787 Generate output for a 68000.  This is the default
11788 when the compiler is configured for 68000-based systems.
11789 It is equivalent to @option{-march=68000}.
11790
11791 Use this option for microcontrollers with a 68000 or EC000 core,
11792 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
11793
11794 @item -m68010
11795 @opindex m68010
11796 Generate output for a 68010.  This is the default
11797 when the compiler is configured for 68010-based systems.
11798 It is equivalent to @option{-march=68010}.
11799
11800 @item -m68020
11801 @itemx -mc68020
11802 @opindex m68020
11803 @opindex mc68020
11804 Generate output for a 68020.  This is the default
11805 when the compiler is configured for 68020-based systems.
11806 It is equivalent to @option{-march=68020}.
11807
11808 @item -m68030
11809 @opindex m68030
11810 Generate output for a 68030.  This is the default when the compiler is
11811 configured for 68030-based systems.  It is equivalent to
11812 @option{-march=68030}.
11813
11814 @item -m68040
11815 @opindex m68040
11816 Generate output for a 68040.  This is the default when the compiler is
11817 configured for 68040-based systems.  It is equivalent to
11818 @option{-march=68040}.
11819
11820 This option inhibits the use of 68881/68882 instructions that have to be
11821 emulated by software on the 68040.  Use this option if your 68040 does not
11822 have code to emulate those instructions.
11823
11824 @item -m68060
11825 @opindex m68060
11826 Generate output for a 68060.  This is the default when the compiler is
11827 configured for 68060-based systems.  It is equivalent to
11828 @option{-march=68060}.
11829
11830 This option inhibits the use of 68020 and 68881/68882 instructions that
11831 have to be emulated by software on the 68060.  Use this option if your 68060
11832 does not have code to emulate those instructions.
11833
11834 @item -mcpu32
11835 @opindex mcpu32
11836 Generate output for a CPU32.  This is the default
11837 when the compiler is configured for CPU32-based systems.
11838 It is equivalent to @option{-march=cpu32}.
11839
11840 Use this option for microcontrollers with a
11841 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
11842 68336, 68340, 68341, 68349 and 68360.
11843
11844 @item -m5200
11845 @opindex m5200
11846 Generate output for a 520X ColdFire CPU@.  This is the default
11847 when the compiler is configured for 520X-based systems.
11848 It is equivalent to @option{-mcpu=5206}, and is now deprecated
11849 in favor of that option.
11850
11851 Use this option for microcontroller with a 5200 core, including
11852 the MCF5202, MCF5203, MCF5204 and MCF5206.
11853
11854 @item -m5206e
11855 @opindex m5206e
11856 Generate output for a 5206e ColdFire CPU@.  The option is now
11857 deprecated in favor of the equivalent @option{-mcpu=5206e}.
11858
11859 @item -m528x
11860 @opindex m528x
11861 Generate output for a member of the ColdFire 528X family.
11862 The option is now deprecated in favor of the equivalent
11863 @option{-mcpu=528x}.
11864
11865 @item -m5307
11866 @opindex m5307
11867 Generate output for a ColdFire 5307 CPU@.  The option is now deprecated
11868 in favor of the equivalent @option{-mcpu=5307}.
11869
11870 @item -m5407
11871 @opindex m5407
11872 Generate output for a ColdFire 5407 CPU@.  The option is now deprecated
11873 in favor of the equivalent @option{-mcpu=5407}.
11874
11875 @item -mcfv4e
11876 @opindex mcfv4e
11877 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
11878 This includes use of hardware floating point instructions.
11879 The option is equivalent to @option{-mcpu=547x}, and is now
11880 deprecated in favor of that option.
11881
11882 @item -m68020-40
11883 @opindex m68020-40
11884 Generate output for a 68040, without using any of the new instructions.
11885 This results in code which can run relatively efficiently on either a
11886 68020/68881 or a 68030 or a 68040.  The generated code does use the
11887 68881 instructions that are emulated on the 68040.
11888
11889 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
11890
11891 @item -m68020-60
11892 @opindex m68020-60
11893 Generate output for a 68060, without using any of the new instructions.
11894 This results in code which can run relatively efficiently on either a
11895 68020/68881 or a 68030 or a 68040.  The generated code does use the
11896 68881 instructions that are emulated on the 68060.
11897
11898 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
11899
11900 @item -mhard-float
11901 @itemx -m68881
11902 @opindex mhard-float
11903 @opindex m68881
11904 Generate floating-point instructions.  This is the default for 68020
11905 and above, and for ColdFire devices that have an FPU@.  It defines the
11906 macro @samp{__HAVE_68881__} on M680x0 targets and @samp{__mcffpu__}
11907 on ColdFire targets.
11908
11909 @item -msoft-float
11910 @opindex msoft-float
11911 Do not generate floating-point instructions; use library calls instead.
11912 This is the default for 68000, 68010, and 68832 targets.  It is also
11913 the default for ColdFire devices that have no FPU.
11914
11915 @item -mdiv
11916 @itemx -mno-div
11917 @opindex mdiv
11918 @opindex mno-div
11919 Generate (do not generate) ColdFire hardware divide and remainder
11920 instructions.  If @option{-march} is used without @option{-mcpu},
11921 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
11922 architectures.  Otherwise, the default is taken from the target CPU
11923 (either the default CPU, or the one specified by @option{-mcpu}).  For
11924 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
11925 @option{-mcpu=5206e}.
11926
11927 gcc defines the macro @samp{__mcfhwdiv__} when this option is enabled.
11928
11929 @item -mshort
11930 @opindex mshort
11931 Consider type @code{int} to be 16 bits wide, like @code{short int}.
11932 Additionally, parameters passed on the stack are also aligned to a
11933 16-bit boundary even on targets whose API mandates promotion to 32-bit.
11934
11935 @item -mno-short
11936 @opindex mno-short
11937 Do not consider type @code{int} to be 16 bits wide.  This is the default.
11938
11939 @item -mnobitfield
11940 @itemx -mno-bitfield
11941 @opindex mnobitfield
11942 @opindex mno-bitfield
11943 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
11944 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
11945
11946 @item -mbitfield
11947 @opindex mbitfield
11948 Do use the bit-field instructions.  The @option{-m68020} option implies
11949 @option{-mbitfield}.  This is the default if you use a configuration
11950 designed for a 68020.
11951
11952 @item -mrtd
11953 @opindex mrtd
11954 Use a different function-calling convention, in which functions
11955 that take a fixed number of arguments return with the @code{rtd}
11956 instruction, which pops their arguments while returning.  This
11957 saves one instruction in the caller since there is no need to pop
11958 the arguments there.
11959
11960 This calling convention is incompatible with the one normally
11961 used on Unix, so you cannot use it if you need to call libraries
11962 compiled with the Unix compiler.
11963
11964 Also, you must provide function prototypes for all functions that
11965 take variable numbers of arguments (including @code{printf});
11966 otherwise incorrect code will be generated for calls to those
11967 functions.
11968
11969 In addition, seriously incorrect code will result if you call a
11970 function with too many arguments.  (Normally, extra arguments are
11971 harmlessly ignored.)
11972
11973 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
11974 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
11975
11976 @item -mno-rtd
11977 @opindex mno-rtd
11978 Do not use the calling conventions selected by @option{-mrtd}.
11979 This is the default.
11980
11981 @item -malign-int
11982 @itemx -mno-align-int
11983 @opindex malign-int
11984 @opindex mno-align-int
11985 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
11986 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
11987 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
11988 Aligning variables on 32-bit boundaries produces code that runs somewhat
11989 faster on processors with 32-bit busses at the expense of more memory.
11990
11991 @strong{Warning:} if you use the @option{-malign-int} switch, GCC will
11992 align structures containing the above types  differently than
11993 most published application binary interface specifications for the m68k.
11994
11995 @item -mpcrel
11996 @opindex mpcrel
11997 Use the pc-relative addressing mode of the 68000 directly, instead of
11998 using a global offset table.  At present, this option implies @option{-fpic},
11999 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
12000 not presently supported with @option{-mpcrel}, though this could be supported for
12001 68020 and higher processors.
12002
12003 @item -mno-strict-align
12004 @itemx -mstrict-align
12005 @opindex mno-strict-align
12006 @opindex mstrict-align
12007 Do not (do) assume that unaligned memory references will be handled by
12008 the system.
12009
12010 @item -msep-data
12011 Generate code that allows the data segment to be located in a different
12012 area of memory from the text segment.  This allows for execute in place in
12013 an environment without virtual memory management.  This option implies
12014 @option{-fPIC}.
12015
12016 @item -mno-sep-data
12017 Generate code that assumes that the data segment follows the text segment.
12018 This is the default.
12019
12020 @item -mid-shared-library
12021 Generate code that supports shared libraries via the library ID method.
12022 This allows for execute in place and shared libraries in an environment
12023 without virtual memory management.  This option implies @option{-fPIC}.
12024
12025 @item -mno-id-shared-library
12026 Generate code that doesn't assume ID based shared libraries are being used.
12027 This is the default.
12028
12029 @item -mshared-library-id=n
12030 Specified the identification number of the ID based shared library being
12031 compiled.  Specifying a value of 0 will generate more compact code, specifying
12032 other values will force the allocation of that number to the current
12033 library but is no more space or time efficient than omitting this option.
12034
12035 @item -mxgot
12036 @itemx -mno-xgot
12037 @opindex mxgot
12038 @opindex mno-xgot
12039 When generating position-independent code for ColdFire, generate code
12040 that works if the GOT has more than 8192 entries.  This code is
12041 larger and slower than code generated without this option.  On M680x0
12042 processors, this option is not needed; @option{-fPIC} suffices.
12043
12044 GCC normally uses a single instruction to load values from the GOT@.
12045 While this is relatively efficient, it only works if the GOT
12046 is smaller than about 64k.  Anything larger causes the linker
12047 to report an error such as:
12048
12049 @cindex relocation truncated to fit (ColdFire)
12050 @smallexample
12051 relocation truncated to fit: R_68K_GOT16O foobar
12052 @end smallexample
12053
12054 If this happens, you should recompile your code with @option{-mxgot}.
12055 It should then work with very large GOTs.  However, code generated with
12056 @option{-mxgot} is less efficient, since it takes 4 instructions to fetch
12057 the value of a global symbol.
12058
12059 Note that some linkers, including newer versions of the GNU linker,
12060 can create multiple GOTs and sort GOT entries.  If you have such a linker,
12061 you should only need to use @option{-mxgot} when compiling a single
12062 object file that accesses more than 8192 GOT entries.  Very few do.
12063
12064 These options have no effect unless GCC is generating
12065 position-independent code.
12066
12067 @end table
12068
12069 @node M68hc1x Options
12070 @subsection M68hc1x Options
12071 @cindex M68hc1x options
12072
12073 These are the @samp{-m} options defined for the 68hc11 and 68hc12
12074 microcontrollers.  The default values for these options depends on
12075 which style of microcontroller was selected when the compiler was configured;
12076 the defaults for the most common choices are given below.
12077
12078 @table @gcctabopt
12079 @item -m6811
12080 @itemx -m68hc11
12081 @opindex m6811
12082 @opindex m68hc11
12083 Generate output for a 68HC11.  This is the default
12084 when the compiler is configured for 68HC11-based systems.
12085
12086 @item -m6812
12087 @itemx -m68hc12
12088 @opindex m6812
12089 @opindex m68hc12
12090 Generate output for a 68HC12.  This is the default
12091 when the compiler is configured for 68HC12-based systems.
12092
12093 @item -m68S12
12094 @itemx -m68hcs12
12095 @opindex m68S12
12096 @opindex m68hcs12
12097 Generate output for a 68HCS12.
12098
12099 @item -mauto-incdec
12100 @opindex mauto-incdec
12101 Enable the use of 68HC12 pre and post auto-increment and auto-decrement
12102 addressing modes.
12103
12104 @item -minmax
12105 @itemx -nominmax
12106 @opindex minmax
12107 @opindex mnominmax
12108 Enable the use of 68HC12 min and max instructions.
12109
12110 @item -mlong-calls
12111 @itemx -mno-long-calls
12112 @opindex mlong-calls
12113 @opindex mno-long-calls
12114 Treat all calls as being far away (near).  If calls are assumed to be
12115 far away, the compiler will use the @code{call} instruction to
12116 call a function and the @code{rtc} instruction for returning.
12117
12118 @item -mshort
12119 @opindex mshort
12120 Consider type @code{int} to be 16 bits wide, like @code{short int}.
12121
12122 @item -msoft-reg-count=@var{count}
12123 @opindex msoft-reg-count
12124 Specify the number of pseudo-soft registers which are used for the
12125 code generation.  The maximum number is 32.  Using more pseudo-soft
12126 register may or may not result in better code depending on the program.
12127 The default is 4 for 68HC11 and 2 for 68HC12.
12128
12129 @end table
12130
12131 @node MCore Options
12132 @subsection MCore Options
12133 @cindex MCore options
12134
12135 These are the @samp{-m} options defined for the Motorola M*Core
12136 processors.
12137
12138 @table @gcctabopt
12139
12140 @item -mhardlit
12141 @itemx -mno-hardlit
12142 @opindex mhardlit
12143 @opindex mno-hardlit
12144 Inline constants into the code stream if it can be done in two
12145 instructions or less.
12146
12147 @item -mdiv
12148 @itemx -mno-div
12149 @opindex mdiv
12150 @opindex mno-div
12151 Use the divide instruction.  (Enabled by default).
12152
12153 @item -mrelax-immediate
12154 @itemx -mno-relax-immediate
12155 @opindex mrelax-immediate
12156 @opindex mno-relax-immediate
12157 Allow arbitrary sized immediates in bit operations.
12158
12159 @item -mwide-bitfields
12160 @itemx -mno-wide-bitfields
12161 @opindex mwide-bitfields
12162 @opindex mno-wide-bitfields
12163 Always treat bit-fields as int-sized.
12164
12165 @item -m4byte-functions
12166 @itemx -mno-4byte-functions
12167 @opindex m4byte-functions
12168 @opindex mno-4byte-functions
12169 Force all functions to be aligned to a four byte boundary.
12170
12171 @item -mcallgraph-data
12172 @itemx -mno-callgraph-data
12173 @opindex mcallgraph-data
12174 @opindex mno-callgraph-data
12175 Emit callgraph information.
12176
12177 @item -mslow-bytes
12178 @itemx -mno-slow-bytes
12179 @opindex mslow-bytes
12180 @opindex mno-slow-bytes
12181 Prefer word access when reading byte quantities.
12182
12183 @item -mlittle-endian
12184 @itemx -mbig-endian
12185 @opindex mlittle-endian
12186 @opindex mbig-endian
12187 Generate code for a little endian target.
12188
12189 @item -m210
12190 @itemx -m340
12191 @opindex m210
12192 @opindex m340
12193 Generate code for the 210 processor.
12194 @end table
12195
12196 @node MIPS Options
12197 @subsection MIPS Options
12198 @cindex MIPS options
12199
12200 @table @gcctabopt
12201
12202 @item -EB
12203 @opindex EB
12204 Generate big-endian code.
12205
12206 @item -EL
12207 @opindex EL
12208 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
12209 configurations.
12210
12211 @item -march=@var{arch}
12212 @opindex march
12213 Generate code that will run on @var{arch}, which can be the name of a
12214 generic MIPS ISA, or the name of a particular processor.
12215 The ISA names are:
12216 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
12217 @samp{mips32}, @samp{mips32r2}, @samp{mips64} and @samp{mips64r2}.
12218 The processor names are:
12219 @samp{4kc}, @samp{4km}, @samp{4kp}, @samp{4ksc},
12220 @samp{4kec}, @samp{4kem}, @samp{4kep}, @samp{4ksd},
12221 @samp{5kc}, @samp{5kf},
12222 @samp{20kc},
12223 @samp{24kc}, @samp{24kf2_1}, @samp{24kf1_1},
12224 @samp{24kec}, @samp{24kef2_1}, @samp{24kef1_1},
12225 @samp{34kc}, @samp{34kf2_1}, @samp{34kf1_1},
12226 @samp{74kc}, @samp{74kf2_1}, @samp{74kf1_1}, @samp{74kf3_2},
12227 @samp{loongson2e}, @samp{loongson2f},
12228 @samp{m4k},
12229 @samp{octeon},
12230 @samp{orion},
12231 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
12232 @samp{r4600}, @samp{r4650}, @samp{r6000}, @samp{r8000},
12233 @samp{rm7000}, @samp{rm9000},
12234 @samp{sb1},
12235 @samp{sr71000},
12236 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
12237 @samp{vr5000}, @samp{vr5400}, @samp{vr5500}
12238 and @samp{xlr}.
12239 The special value @samp{from-abi} selects the
12240 most compatible architecture for the selected ABI (that is,
12241 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
12242
12243 Native Linux/GNU toolchains also support the value @samp{native},
12244 which selects the best architecture option for the host processor.
12245 @option{-march=native} has no effect if GCC does not recognize
12246 the processor.
12247
12248 In processor names, a final @samp{000} can be abbreviated as @samp{k}
12249 (for example, @samp{-march=r2k}).  Prefixes are optional, and
12250 @samp{vr} may be written @samp{r}.
12251
12252 Names of the form @samp{@var{n}f2_1} refer to processors with
12253 FPUs clocked at half the rate of the core, names of the form
12254 @samp{@var{n}f1_1} refer to processors with FPUs clocked at the same
12255 rate as the core, and names of the form @samp{@var{n}f3_2} refer to
12256 processors with FPUs clocked a ratio of 3:2 with respect to the core.
12257 For compatibility reasons, @samp{@var{n}f} is accepted as a synonym
12258 for @samp{@var{n}f2_1} while @samp{@var{n}x} and @samp{@var{b}fx} are
12259 accepted as synonyms for @samp{@var{n}f1_1}.
12260
12261 GCC defines two macros based on the value of this option.  The first
12262 is @samp{_MIPS_ARCH}, which gives the name of target architecture, as
12263 a string.  The second has the form @samp{_MIPS_ARCH_@var{foo}},
12264 where @var{foo} is the capitalized value of @samp{_MIPS_ARCH}@.
12265 For example, @samp{-march=r2000} will set @samp{_MIPS_ARCH}
12266 to @samp{"r2000"} and define the macro @samp{_MIPS_ARCH_R2000}.
12267
12268 Note that the @samp{_MIPS_ARCH} macro uses the processor names given
12269 above.  In other words, it will have the full prefix and will not
12270 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
12271 the macro names the resolved architecture (either @samp{"mips1"} or
12272 @samp{"mips3"}).  It names the default architecture when no
12273 @option{-march} option is given.
12274
12275 @item -mtune=@var{arch}
12276 @opindex mtune
12277 Optimize for @var{arch}.  Among other things, this option controls
12278 the way instructions are scheduled, and the perceived cost of arithmetic
12279 operations.  The list of @var{arch} values is the same as for
12280 @option{-march}.
12281
12282 When this option is not used, GCC will optimize for the processor
12283 specified by @option{-march}.  By using @option{-march} and
12284 @option{-mtune} together, it is possible to generate code that will
12285 run on a family of processors, but optimize the code for one
12286 particular member of that family.
12287
12288 @samp{-mtune} defines the macros @samp{_MIPS_TUNE} and
12289 @samp{_MIPS_TUNE_@var{foo}}, which work in the same way as the
12290 @samp{-march} ones described above.
12291
12292 @item -mips1
12293 @opindex mips1
12294 Equivalent to @samp{-march=mips1}.
12295
12296 @item -mips2
12297 @opindex mips2
12298 Equivalent to @samp{-march=mips2}.
12299
12300 @item -mips3
12301 @opindex mips3
12302 Equivalent to @samp{-march=mips3}.
12303
12304 @item -mips4
12305 @opindex mips4
12306 Equivalent to @samp{-march=mips4}.
12307
12308 @item -mips32
12309 @opindex mips32
12310 Equivalent to @samp{-march=mips32}.
12311
12312 @item -mips32r2
12313 @opindex mips32r2
12314 Equivalent to @samp{-march=mips32r2}.
12315
12316 @item -mips64
12317 @opindex mips64
12318 Equivalent to @samp{-march=mips64}.
12319
12320 @item -mips64r2
12321 @opindex mips64r2
12322 Equivalent to @samp{-march=mips64r2}.
12323
12324 @item -mips16
12325 @itemx -mno-mips16
12326 @opindex mips16
12327 @opindex mno-mips16
12328 Generate (do not generate) MIPS16 code.  If GCC is targetting a
12329 MIPS32 or MIPS64 architecture, it will make use of the MIPS16e ASE@.
12330
12331 MIPS16 code generation can also be controlled on a per-function basis
12332 by means of @code{mips16} and @code{nomips16} attributes.  
12333 @xref{Function Attributes}, for more information.
12334
12335 @item -mflip-mips16
12336 @opindex mflip-mips16
12337 Generate MIPS16 code on alternating functions.  This option is provided
12338 for regression testing of mixed MIPS16/non-MIPS16 code generation, and is
12339 not intended for ordinary use in compiling user code.
12340
12341 @item -minterlink-mips16
12342 @itemx -mno-interlink-mips16
12343 @opindex minterlink-mips16
12344 @opindex mno-interlink-mips16
12345 Require (do not require) that non-MIPS16 code be link-compatible with
12346 MIPS16 code.
12347
12348 For example, non-MIPS16 code cannot jump directly to MIPS16 code;
12349 it must either use a call or an indirect jump.  @option{-minterlink-mips16}
12350 therefore disables direct jumps unless GCC knows that the target of the
12351 jump is not MIPS16.
12352
12353 @item -mabi=32
12354 @itemx -mabi=o64
12355 @itemx -mabi=n32
12356 @itemx -mabi=64
12357 @itemx -mabi=eabi
12358 @opindex mabi=32
12359 @opindex mabi=o64
12360 @opindex mabi=n32
12361 @opindex mabi=64
12362 @opindex mabi=eabi
12363 Generate code for the given ABI@.
12364
12365 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
12366 generates 64-bit code when you select a 64-bit architecture, but you
12367 can use @option{-mgp32} to get 32-bit code instead.
12368
12369 For information about the O64 ABI, see
12370 @w{@uref{http://gcc.gnu.org/projects/mipso64-abi.html}}.
12371
12372 GCC supports a variant of the o32 ABI in which floating-point registers
12373 are 64 rather than 32 bits wide.  You can select this combination with
12374 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @samp{mthc1}
12375 and @samp{mfhc1} instructions and is therefore only supported for
12376 MIPS32R2 processors.
12377
12378 The register assignments for arguments and return values remain the
12379 same, but each scalar value is passed in a single 64-bit register
12380 rather than a pair of 32-bit registers.  For example, scalar
12381 floating-point values are returned in @samp{$f0} only, not a
12382 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
12383 remains the same, but all 64 bits are saved.
12384
12385 @item -mabicalls
12386 @itemx -mno-abicalls
12387 @opindex mabicalls
12388 @opindex mno-abicalls
12389 Generate (do not generate) code that is suitable for SVR4-style
12390 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
12391 systems.
12392
12393 @item -mshared
12394 @itemx -mno-shared
12395 Generate (do not generate) code that is fully position-independent,
12396 and that can therefore be linked into shared libraries.  This option
12397 only affects @option{-mabicalls}.
12398
12399 All @option{-mabicalls} code has traditionally been position-independent,
12400 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
12401 as an extension, the GNU toolchain allows executables to use absolute
12402 accesses for locally-binding symbols.  It can also use shorter GP
12403 initialization sequences and generate direct calls to locally-defined
12404 functions.  This mode is selected by @option{-mno-shared}.
12405
12406 @option{-mno-shared} depends on binutils 2.16 or higher and generates
12407 objects that can only be linked by the GNU linker.  However, the option
12408 does not affect the ABI of the final executable; it only affects the ABI
12409 of relocatable objects.  Using @option{-mno-shared} will generally make
12410 executables both smaller and quicker.
12411
12412 @option{-mshared} is the default.
12413
12414 @item -mplt
12415 @itemx -mno-plt
12416 @opindex mplt
12417 @opindex mno-plt
12418 Assume (do not assume) that the static and dynamic linkers
12419 support PLTs and copy relocations.  This option only affects
12420 @samp{-mno-shared -mabicalls}.  For the n64 ABI, this option
12421 has no effect without @samp{-msym32}.
12422
12423 You can make @option{-mplt} the default by configuring
12424 GCC with @option{--with-mips-plt}.  The default is
12425 @option{-mno-plt} otherwise.
12426
12427 @item -mxgot
12428 @itemx -mno-xgot
12429 @opindex mxgot
12430 @opindex mno-xgot
12431 Lift (do not lift) the usual restrictions on the size of the global
12432 offset table.
12433
12434 GCC normally uses a single instruction to load values from the GOT@.
12435 While this is relatively efficient, it will only work if the GOT
12436 is smaller than about 64k.  Anything larger will cause the linker
12437 to report an error such as:
12438
12439 @cindex relocation truncated to fit (MIPS)
12440 @smallexample
12441 relocation truncated to fit: R_MIPS_GOT16 foobar
12442 @end smallexample
12443
12444 If this happens, you should recompile your code with @option{-mxgot}.
12445 It should then work with very large GOTs, although it will also be
12446 less efficient, since it will take three instructions to fetch the
12447 value of a global symbol.
12448
12449 Note that some linkers can create multiple GOTs.  If you have such a
12450 linker, you should only need to use @option{-mxgot} when a single object
12451 file accesses more than 64k's worth of GOT entries.  Very few do.
12452
12453 These options have no effect unless GCC is generating position
12454 independent code.
12455
12456 @item -mgp32
12457 @opindex mgp32
12458 Assume that general-purpose registers are 32 bits wide.
12459
12460 @item -mgp64
12461 @opindex mgp64
12462 Assume that general-purpose registers are 64 bits wide.
12463
12464 @item -mfp32
12465 @opindex mfp32
12466 Assume that floating-point registers are 32 bits wide.
12467
12468 @item -mfp64
12469 @opindex mfp64
12470 Assume that floating-point registers are 64 bits wide.
12471
12472 @item -mhard-float
12473 @opindex mhard-float
12474 Use floating-point coprocessor instructions.
12475
12476 @item -msoft-float
12477 @opindex msoft-float
12478 Do not use floating-point coprocessor instructions.  Implement
12479 floating-point calculations using library calls instead.
12480
12481 @item -msingle-float
12482 @opindex msingle-float
12483 Assume that the floating-point coprocessor only supports single-precision
12484 operations.
12485
12486 @item -mdouble-float
12487 @opindex mdouble-float
12488 Assume that the floating-point coprocessor supports double-precision
12489 operations.  This is the default.
12490
12491 @item -mllsc
12492 @itemx -mno-llsc
12493 @opindex mllsc
12494 @opindex mno-llsc
12495 Use (do not use) @samp{ll}, @samp{sc}, and @samp{sync} instructions to
12496 implement atomic memory built-in functions.  When neither option is
12497 specified, GCC will use the instructions if the target architecture
12498 supports them.
12499
12500 @option{-mllsc} is useful if the runtime environment can emulate the
12501 instructions and @option{-mno-llsc} can be useful when compiling for
12502 nonstandard ISAs.  You can make either option the default by
12503 configuring GCC with @option{--with-llsc} and @option{--without-llsc}
12504 respectively.  @option{--with-llsc} is the default for some
12505 configurations; see the installation documentation for details.
12506
12507 @item -mdsp
12508 @itemx -mno-dsp
12509 @opindex mdsp
12510 @opindex mno-dsp
12511 Use (do not use) revision 1 of the MIPS DSP ASE@.
12512 @xref{MIPS DSP Built-in Functions}.  This option defines the
12513 preprocessor macro @samp{__mips_dsp}.  It also defines
12514 @samp{__mips_dsp_rev} to 1.
12515
12516 @item -mdspr2
12517 @itemx -mno-dspr2
12518 @opindex mdspr2
12519 @opindex mno-dspr2
12520 Use (do not use) revision 2 of the MIPS DSP ASE@.
12521 @xref{MIPS DSP Built-in Functions}.  This option defines the
12522 preprocessor macros @samp{__mips_dsp} and @samp{__mips_dspr2}.
12523 It also defines @samp{__mips_dsp_rev} to 2.
12524
12525 @item -msmartmips
12526 @itemx -mno-smartmips
12527 @opindex msmartmips
12528 @opindex mno-smartmips
12529 Use (do not use) the MIPS SmartMIPS ASE.
12530
12531 @item -mpaired-single
12532 @itemx -mno-paired-single
12533 @opindex mpaired-single
12534 @opindex mno-paired-single
12535 Use (do not use) paired-single floating-point instructions.
12536 @xref{MIPS Paired-Single Support}.  This option requires
12537 hardware floating-point support to be enabled.
12538
12539 @item -mdmx
12540 @itemx -mno-mdmx
12541 @opindex mdmx
12542 @opindex mno-mdmx
12543 Use (do not use) MIPS Digital Media Extension instructions.
12544 This option can only be used when generating 64-bit code and requires
12545 hardware floating-point support to be enabled.
12546
12547 @item -mips3d
12548 @itemx -mno-mips3d
12549 @opindex mips3d
12550 @opindex mno-mips3d
12551 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
12552 The option @option{-mips3d} implies @option{-mpaired-single}.
12553
12554 @item -mmt
12555 @itemx -mno-mt
12556 @opindex mmt
12557 @opindex mno-mt
12558 Use (do not use) MT Multithreading instructions.
12559
12560 @item -mlong64
12561 @opindex mlong64
12562 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
12563 an explanation of the default and the way that the pointer size is
12564 determined.
12565
12566 @item -mlong32
12567 @opindex mlong32
12568 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
12569
12570 The default size of @code{int}s, @code{long}s and pointers depends on
12571 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
12572 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
12573 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
12574 or the same size as integer registers, whichever is smaller.
12575
12576 @item -msym32
12577 @itemx -mno-sym32
12578 @opindex msym32
12579 @opindex mno-sym32
12580 Assume (do not assume) that all symbols have 32-bit values, regardless
12581 of the selected ABI@.  This option is useful in combination with
12582 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
12583 to generate shorter and faster references to symbolic addresses.
12584
12585 @item -G @var{num}
12586 @opindex G
12587 Put definitions of externally-visible data in a small data section
12588 if that data is no bigger than @var{num} bytes.  GCC can then access
12589 the data more efficiently; see @option{-mgpopt} for details.
12590
12591 The default @option{-G} option depends on the configuration.
12592
12593 @item -mlocal-sdata
12594 @itemx -mno-local-sdata
12595 @opindex mlocal-sdata
12596 @opindex mno-local-sdata
12597 Extend (do not extend) the @option{-G} behavior to local data too,
12598 such as to static variables in C@.  @option{-mlocal-sdata} is the
12599 default for all configurations.
12600
12601 If the linker complains that an application is using too much small data,
12602 you might want to try rebuilding the less performance-critical parts with
12603 @option{-mno-local-sdata}.  You might also want to build large
12604 libraries with @option{-mno-local-sdata}, so that the libraries leave
12605 more room for the main program.
12606
12607 @item -mextern-sdata
12608 @itemx -mno-extern-sdata
12609 @opindex mextern-sdata
12610 @opindex mno-extern-sdata
12611 Assume (do not assume) that externally-defined data will be in
12612 a small data section if that data is within the @option{-G} limit.
12613 @option{-mextern-sdata} is the default for all configurations.
12614
12615 If you compile a module @var{Mod} with @option{-mextern-sdata} @option{-G
12616 @var{num}} @option{-mgpopt}, and @var{Mod} references a variable @var{Var}
12617 that is no bigger than @var{num} bytes, you must make sure that @var{Var}
12618 is placed in a small data section.  If @var{Var} is defined by another
12619 module, you must either compile that module with a high-enough
12620 @option{-G} setting or attach a @code{section} attribute to @var{Var}'s
12621 definition.  If @var{Var} is common, you must link the application
12622 with a high-enough @option{-G} setting.
12623
12624 The easiest way of satisfying these restrictions is to compile
12625 and link every module with the same @option{-G} option.  However,
12626 you may wish to build a library that supports several different
12627 small data limits.  You can do this by compiling the library with
12628 the highest supported @option{-G} setting and additionally using
12629 @option{-mno-extern-sdata} to stop the library from making assumptions
12630 about externally-defined data.
12631
12632 @item -mgpopt
12633 @itemx -mno-gpopt
12634 @opindex mgpopt
12635 @opindex mno-gpopt
12636 Use (do not use) GP-relative accesses for symbols that are known to be
12637 in a small data section; see @option{-G}, @option{-mlocal-sdata} and
12638 @option{-mextern-sdata}.  @option{-mgpopt} is the default for all
12639 configurations.
12640
12641 @option{-mno-gpopt} is useful for cases where the @code{$gp} register
12642 might not hold the value of @code{_gp}.  For example, if the code is
12643 part of a library that might be used in a boot monitor, programs that
12644 call boot monitor routines will pass an unknown value in @code{$gp}.
12645 (In such situations, the boot monitor itself would usually be compiled
12646 with @option{-G0}.)
12647
12648 @option{-mno-gpopt} implies @option{-mno-local-sdata} and
12649 @option{-mno-extern-sdata}.
12650
12651 @item -membedded-data
12652 @itemx -mno-embedded-data
12653 @opindex membedded-data
12654 @opindex mno-embedded-data
12655 Allocate variables to the read-only data section first if possible, then
12656 next in the small data section if possible, otherwise in data.  This gives
12657 slightly slower code than the default, but reduces the amount of RAM required
12658 when executing, and thus may be preferred for some embedded systems.
12659
12660 @item -muninit-const-in-rodata
12661 @itemx -mno-uninit-const-in-rodata
12662 @opindex muninit-const-in-rodata
12663 @opindex mno-uninit-const-in-rodata
12664 Put uninitialized @code{const} variables in the read-only data section.
12665 This option is only meaningful in conjunction with @option{-membedded-data}.
12666
12667 @item -mcode-readable=@var{setting}
12668 @opindex mcode-readable
12669 Specify whether GCC may generate code that reads from executable sections.
12670 There are three possible settings:
12671
12672 @table @gcctabopt
12673 @item -mcode-readable=yes
12674 Instructions may freely access executable sections.  This is the
12675 default setting.
12676
12677 @item -mcode-readable=pcrel
12678 MIPS16 PC-relative load instructions can access executable sections,
12679 but other instructions must not do so.  This option is useful on 4KSc
12680 and 4KSd processors when the code TLBs have the Read Inhibit bit set.
12681 It is also useful on processors that can be configured to have a dual
12682 instruction/data SRAM interface and that, like the M4K, automatically
12683 redirect PC-relative loads to the instruction RAM.
12684
12685 @item -mcode-readable=no
12686 Instructions must not access executable sections.  This option can be
12687 useful on targets that are configured to have a dual instruction/data
12688 SRAM interface but that (unlike the M4K) do not automatically redirect
12689 PC-relative loads to the instruction RAM.
12690 @end table
12691
12692 @item -msplit-addresses
12693 @itemx -mno-split-addresses
12694 @opindex msplit-addresses
12695 @opindex mno-split-addresses
12696 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
12697 relocation operators.  This option has been superseded by
12698 @option{-mexplicit-relocs} but is retained for backwards compatibility.
12699
12700 @item -mexplicit-relocs
12701 @itemx -mno-explicit-relocs
12702 @opindex mexplicit-relocs
12703 @opindex mno-explicit-relocs
12704 Use (do not use) assembler relocation operators when dealing with symbolic
12705 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
12706 is to use assembler macros instead.
12707
12708 @option{-mexplicit-relocs} is the default if GCC was configured
12709 to use an assembler that supports relocation operators.
12710
12711 @item -mcheck-zero-division
12712 @itemx -mno-check-zero-division
12713 @opindex mcheck-zero-division
12714 @opindex mno-check-zero-division
12715 Trap (do not trap) on integer division by zero.
12716
12717 The default is @option{-mcheck-zero-division}.
12718
12719 @item -mdivide-traps
12720 @itemx -mdivide-breaks
12721 @opindex mdivide-traps
12722 @opindex mdivide-breaks
12723 MIPS systems check for division by zero by generating either a
12724 conditional trap or a break instruction.  Using traps results in
12725 smaller code, but is only supported on MIPS II and later.  Also, some
12726 versions of the Linux kernel have a bug that prevents trap from
12727 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
12728 allow conditional traps on architectures that support them and
12729 @option{-mdivide-breaks} to force the use of breaks.
12730
12731 The default is usually @option{-mdivide-traps}, but this can be
12732 overridden at configure time using @option{--with-divide=breaks}.
12733 Divide-by-zero checks can be completely disabled using
12734 @option{-mno-check-zero-division}.
12735
12736 @item -mmemcpy
12737 @itemx -mno-memcpy
12738 @opindex mmemcpy
12739 @opindex mno-memcpy
12740 Force (do not force) the use of @code{memcpy()} for non-trivial block
12741 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
12742 most constant-sized copies.
12743
12744 @item -mlong-calls
12745 @itemx -mno-long-calls
12746 @opindex mlong-calls
12747 @opindex mno-long-calls
12748 Disable (do not disable) use of the @code{jal} instruction.  Calling
12749 functions using @code{jal} is more efficient but requires the caller
12750 and callee to be in the same 256 megabyte segment.
12751
12752 This option has no effect on abicalls code.  The default is
12753 @option{-mno-long-calls}.
12754
12755 @item -mmad
12756 @itemx -mno-mad
12757 @opindex mmad
12758 @opindex mno-mad
12759 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
12760 instructions, as provided by the R4650 ISA@.
12761
12762 @item -mfused-madd
12763 @itemx -mno-fused-madd
12764 @opindex mfused-madd
12765 @opindex mno-fused-madd
12766 Enable (disable) use of the floating point multiply-accumulate
12767 instructions, when they are available.  The default is
12768 @option{-mfused-madd}.
12769
12770 When multiply-accumulate instructions are used, the intermediate
12771 product is calculated to infinite precision and is not subject to
12772 the FCSR Flush to Zero bit.  This may be undesirable in some
12773 circumstances.
12774
12775 @item -nocpp
12776 @opindex nocpp
12777 Tell the MIPS assembler to not run its preprocessor over user
12778 assembler files (with a @samp{.s} suffix) when assembling them.
12779
12780 @item -mfix-r4000
12781 @itemx -mno-fix-r4000
12782 @opindex mfix-r4000
12783 @opindex mno-fix-r4000
12784 Work around certain R4000 CPU errata:
12785 @itemize @minus
12786 @item
12787 A double-word or a variable shift may give an incorrect result if executed
12788 immediately after starting an integer division.
12789 @item
12790 A double-word or a variable shift may give an incorrect result if executed
12791 while an integer multiplication is in progress.
12792 @item
12793 An integer division may give an incorrect result if started in a delay slot
12794 of a taken branch or a jump.
12795 @end itemize
12796
12797 @item -mfix-r4400
12798 @itemx -mno-fix-r4400
12799 @opindex mfix-r4400
12800 @opindex mno-fix-r4400
12801 Work around certain R4400 CPU errata:
12802 @itemize @minus
12803 @item
12804 A double-word or a variable shift may give an incorrect result if executed
12805 immediately after starting an integer division.
12806 @end itemize
12807
12808 @item -mfix-vr4120
12809 @itemx -mno-fix-vr4120
12810 @opindex mfix-vr4120
12811 Work around certain VR4120 errata:
12812 @itemize @minus
12813 @item
12814 @code{dmultu} does not always produce the correct result.
12815 @item
12816 @code{div} and @code{ddiv} do not always produce the correct result if one
12817 of the operands is negative.
12818 @end itemize
12819 The workarounds for the division errata rely on special functions in
12820 @file{libgcc.a}.  At present, these functions are only provided by
12821 the @code{mips64vr*-elf} configurations.
12822
12823 Other VR4120 errata require a nop to be inserted between certain pairs of
12824 instructions.  These errata are handled by the assembler, not by GCC itself.
12825
12826 @item -mfix-vr4130
12827 @opindex mfix-vr4130
12828 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
12829 workarounds are implemented by the assembler rather than by GCC,
12830 although GCC will avoid using @code{mflo} and @code{mfhi} if the
12831 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
12832 instructions are available instead.
12833
12834 @item -mfix-sb1
12835 @itemx -mno-fix-sb1
12836 @opindex mfix-sb1
12837 Work around certain SB-1 CPU core errata.
12838 (This flag currently works around the SB-1 revision 2
12839 ``F1'' and ``F2'' floating point errata.)
12840
12841 @item -mr10k-cache-barrier=@var{setting}
12842 @opindex mr10k-cache-barrier
12843 Specify whether GCC should insert cache barriers to avoid the
12844 side-effects of speculation on R10K processors.
12845
12846 In common with many processors, the R10K tries to predict the outcome
12847 of a conditional branch and speculatively executes instructions from
12848 the ``taken'' branch.  It later aborts these instructions if the
12849 predicted outcome was wrong.  However, on the R10K, even aborted
12850 instructions can have side effects.
12851
12852 This problem only affects kernel stores and, depending on the system,
12853 kernel loads.  As an example, a speculatively-executed store may load
12854 the target memory into cache and mark the cache line as dirty, even if
12855 the store itself is later aborted.  If a DMA operation writes to the
12856 same area of memory before the ``dirty'' line is flushed, the cached
12857 data will overwrite the DMA-ed data.  See the R10K processor manual
12858 for a full description, including other potential problems.
12859
12860 One workaround is to insert cache barrier instructions before every memory
12861 access that might be speculatively executed and that might have side
12862 effects even if aborted.  @option{-mr10k-cache-barrier=@var{setting}}
12863 controls GCC's implementation of this workaround.  It assumes that
12864 aborted accesses to any byte in the following regions will not have
12865 side effects:
12866
12867 @enumerate
12868 @item
12869 the memory occupied by the current function's stack frame;
12870
12871 @item
12872 the memory occupied by an incoming stack argument;
12873
12874 @item
12875 the memory occupied by an object with a link-time-constant address.
12876 @end enumerate
12877
12878 It is the kernel's responsibility to ensure that speculative
12879 accesses to these regions are indeed safe.
12880
12881 If the input program contains a function declaration such as:
12882
12883 @smallexample
12884 void foo (void);
12885 @end smallexample
12886
12887 then the implementation of @code{foo} must allow @code{j foo} and
12888 @code{jal foo} to be executed speculatively.  GCC honors this
12889 restriction for functions it compiles itself.  It expects non-GCC
12890 functions (such as hand-written assembly code) to do the same.
12891
12892 The option has three forms:
12893
12894 @table @gcctabopt
12895 @item -mr10k-cache-barrier=load-store
12896 Insert a cache barrier before a load or store that might be
12897 speculatively executed and that might have side effects even
12898 if aborted.
12899
12900 @item -mr10k-cache-barrier=store
12901 Insert a cache barrier before a store that might be speculatively
12902 executed and that might have side effects even if aborted.
12903
12904 @item -mr10k-cache-barrier=none
12905 Disable the insertion of cache barriers.  This is the default setting.
12906 @end table
12907
12908 @item -mflush-func=@var{func}
12909 @itemx -mno-flush-func
12910 @opindex mflush-func
12911 Specifies the function to call to flush the I and D caches, or to not
12912 call any such function.  If called, the function must take the same
12913 arguments as the common @code{_flush_func()}, that is, the address of the
12914 memory range for which the cache is being flushed, the size of the
12915 memory range, and the number 3 (to flush both caches).  The default
12916 depends on the target GCC was configured for, but commonly is either
12917 @samp{_flush_func} or @samp{__cpu_flush}.
12918
12919 @item mbranch-cost=@var{num}
12920 @opindex mbranch-cost
12921 Set the cost of branches to roughly @var{num} ``simple'' instructions.
12922 This cost is only a heuristic and is not guaranteed to produce
12923 consistent results across releases.  A zero cost redundantly selects
12924 the default, which is based on the @option{-mtune} setting.
12925
12926 @item -mbranch-likely
12927 @itemx -mno-branch-likely
12928 @opindex mbranch-likely
12929 @opindex mno-branch-likely
12930 Enable or disable use of Branch Likely instructions, regardless of the
12931 default for the selected architecture.  By default, Branch Likely
12932 instructions may be generated if they are supported by the selected
12933 architecture.  An exception is for the MIPS32 and MIPS64 architectures
12934 and processors which implement those architectures; for those, Branch
12935 Likely instructions will not be generated by default because the MIPS32
12936 and MIPS64 architectures specifically deprecate their use.
12937
12938 @item -mfp-exceptions
12939 @itemx -mno-fp-exceptions
12940 @opindex mfp-exceptions
12941 Specifies whether FP exceptions are enabled.  This affects how we schedule
12942 FP instructions for some processors.  The default is that FP exceptions are
12943 enabled.
12944
12945 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
12946 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
12947 FP pipe.
12948
12949 @item -mvr4130-align
12950 @itemx -mno-vr4130-align
12951 @opindex mvr4130-align
12952 The VR4130 pipeline is two-way superscalar, but can only issue two
12953 instructions together if the first one is 8-byte aligned.  When this
12954 option is enabled, GCC will align pairs of instructions that it
12955 thinks should execute in parallel.
12956
12957 This option only has an effect when optimizing for the VR4130.
12958 It normally makes code faster, but at the expense of making it bigger.
12959 It is enabled by default at optimization level @option{-O3}.
12960 @end table
12961
12962 @node MMIX Options
12963 @subsection MMIX Options
12964 @cindex MMIX Options
12965
12966 These options are defined for the MMIX:
12967
12968 @table @gcctabopt
12969 @item -mlibfuncs
12970 @itemx -mno-libfuncs
12971 @opindex mlibfuncs
12972 @opindex mno-libfuncs
12973 Specify that intrinsic library functions are being compiled, passing all
12974 values in registers, no matter the size.
12975
12976 @item -mepsilon
12977 @itemx -mno-epsilon
12978 @opindex mepsilon
12979 @opindex mno-epsilon
12980 Generate floating-point comparison instructions that compare with respect
12981 to the @code{rE} epsilon register.
12982
12983 @item -mabi=mmixware
12984 @itemx -mabi=gnu
12985 @opindex mabi-mmixware
12986 @opindex mabi=gnu
12987 Generate code that passes function parameters and return values that (in
12988 the called function) are seen as registers @code{$0} and up, as opposed to
12989 the GNU ABI which uses global registers @code{$231} and up.
12990
12991 @item -mzero-extend
12992 @itemx -mno-zero-extend
12993 @opindex mzero-extend
12994 @opindex mno-zero-extend
12995 When reading data from memory in sizes shorter than 64 bits, use (do not
12996 use) zero-extending load instructions by default, rather than
12997 sign-extending ones.
12998
12999 @item -mknuthdiv
13000 @itemx -mno-knuthdiv
13001 @opindex mknuthdiv
13002 @opindex mno-knuthdiv
13003 Make the result of a division yielding a remainder have the same sign as
13004 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
13005 remainder follows the sign of the dividend.  Both methods are
13006 arithmetically valid, the latter being almost exclusively used.
13007
13008 @item -mtoplevel-symbols
13009 @itemx -mno-toplevel-symbols
13010 @opindex mtoplevel-symbols
13011 @opindex mno-toplevel-symbols
13012 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
13013 code can be used with the @code{PREFIX} assembly directive.
13014
13015 @item -melf
13016 @opindex melf
13017 Generate an executable in the ELF format, rather than the default
13018 @samp{mmo} format used by the @command{mmix} simulator.
13019
13020 @item -mbranch-predict
13021 @itemx -mno-branch-predict
13022 @opindex mbranch-predict
13023 @opindex mno-branch-predict
13024 Use (do not use) the probable-branch instructions, when static branch
13025 prediction indicates a probable branch.
13026
13027 @item -mbase-addresses
13028 @itemx -mno-base-addresses
13029 @opindex mbase-addresses
13030 @opindex mno-base-addresses
13031 Generate (do not generate) code that uses @emph{base addresses}.  Using a
13032 base address automatically generates a request (handled by the assembler
13033 and the linker) for a constant to be set up in a global register.  The
13034 register is used for one or more base address requests within the range 0
13035 to 255 from the value held in the register.  The generally leads to short
13036 and fast code, but the number of different data items that can be
13037 addressed is limited.  This means that a program that uses lots of static
13038 data may require @option{-mno-base-addresses}.
13039
13040 @item -msingle-exit
13041 @itemx -mno-single-exit
13042 @opindex msingle-exit
13043 @opindex mno-single-exit
13044 Force (do not force) generated code to have a single exit point in each
13045 function.
13046 @end table
13047
13048 @node MN10300 Options
13049 @subsection MN10300 Options
13050 @cindex MN10300 options
13051
13052 These @option{-m} options are defined for Matsushita MN10300 architectures:
13053
13054 @table @gcctabopt
13055 @item -mmult-bug
13056 @opindex mmult-bug
13057 Generate code to avoid bugs in the multiply instructions for the MN10300
13058 processors.  This is the default.
13059
13060 @item -mno-mult-bug
13061 @opindex mno-mult-bug
13062 Do not generate code to avoid bugs in the multiply instructions for the
13063 MN10300 processors.
13064
13065 @item -mam33
13066 @opindex mam33
13067 Generate code which uses features specific to the AM33 processor.
13068
13069 @item -mno-am33
13070 @opindex mno-am33
13071 Do not generate code which uses features specific to the AM33 processor.  This
13072 is the default.
13073
13074 @item -mreturn-pointer-on-d0
13075 @opindex mreturn-pointer-on-d0
13076 When generating a function which returns a pointer, return the pointer
13077 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
13078 only in a0, and attempts to call such functions without a prototype
13079 would result in errors.  Note that this option is on by default; use
13080 @option{-mno-return-pointer-on-d0} to disable it.
13081
13082 @item -mno-crt0
13083 @opindex mno-crt0
13084 Do not link in the C run-time initialization object file.
13085
13086 @item -mrelax
13087 @opindex mrelax
13088 Indicate to the linker that it should perform a relaxation optimization pass
13089 to shorten branches, calls and absolute memory addresses.  This option only
13090 has an effect when used on the command line for the final link step.
13091
13092 This option makes symbolic debugging impossible.
13093 @end table
13094
13095 @node PDP-11 Options
13096 @subsection PDP-11 Options
13097 @cindex PDP-11 Options
13098
13099 These options are defined for the PDP-11:
13100
13101 @table @gcctabopt
13102 @item -mfpu
13103 @opindex mfpu
13104 Use hardware FPP floating point.  This is the default.  (FIS floating
13105 point on the PDP-11/40 is not supported.)
13106
13107 @item -msoft-float
13108 @opindex msoft-float
13109 Do not use hardware floating point.
13110
13111 @item -mac0
13112 @opindex mac0
13113 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
13114
13115 @item -mno-ac0
13116 @opindex mno-ac0
13117 Return floating-point results in memory.  This is the default.
13118
13119 @item -m40
13120 @opindex m40
13121 Generate code for a PDP-11/40.
13122
13123 @item -m45
13124 @opindex m45
13125 Generate code for a PDP-11/45.  This is the default.
13126
13127 @item -m10
13128 @opindex m10
13129 Generate code for a PDP-11/10.
13130
13131 @item -mbcopy-builtin
13132 @opindex bcopy-builtin
13133 Use inline @code{movmemhi} patterns for copying memory.  This is the
13134 default.
13135
13136 @item -mbcopy
13137 @opindex mbcopy
13138 Do not use inline @code{movmemhi} patterns for copying memory.
13139
13140 @item -mint16
13141 @itemx -mno-int32
13142 @opindex mint16
13143 @opindex mno-int32
13144 Use 16-bit @code{int}.  This is the default.
13145
13146 @item -mint32
13147 @itemx -mno-int16
13148 @opindex mint32
13149 @opindex mno-int16
13150 Use 32-bit @code{int}.
13151
13152 @item -mfloat64
13153 @itemx -mno-float32
13154 @opindex mfloat64
13155 @opindex mno-float32
13156 Use 64-bit @code{float}.  This is the default.
13157
13158 @item -mfloat32
13159 @itemx -mno-float64
13160 @opindex mfloat32
13161 @opindex mno-float64
13162 Use 32-bit @code{float}.
13163
13164 @item -mabshi
13165 @opindex mabshi
13166 Use @code{abshi2} pattern.  This is the default.
13167
13168 @item -mno-abshi
13169 @opindex mno-abshi
13170 Do not use @code{abshi2} pattern.
13171
13172 @item -mbranch-expensive
13173 @opindex mbranch-expensive
13174 Pretend that branches are expensive.  This is for experimenting with
13175 code generation only.
13176
13177 @item -mbranch-cheap
13178 @opindex mbranch-cheap
13179 Do not pretend that branches are expensive.  This is the default.
13180
13181 @item -msplit
13182 @opindex msplit
13183 Generate code for a system with split I&D@.
13184
13185 @item -mno-split
13186 @opindex mno-split
13187 Generate code for a system without split I&D@.  This is the default.
13188
13189 @item -munix-asm
13190 @opindex munix-asm
13191 Use Unix assembler syntax.  This is the default when configured for
13192 @samp{pdp11-*-bsd}.
13193
13194 @item -mdec-asm
13195 @opindex mdec-asm
13196 Use DEC assembler syntax.  This is the default when configured for any
13197 PDP-11 target other than @samp{pdp11-*-bsd}.
13198 @end table
13199
13200 @node picoChip Options
13201 @subsection picoChip Options
13202 @cindex picoChip options
13203
13204 These @samp{-m} options are defined for picoChip implementations:
13205
13206 @table @gcctabopt
13207
13208 @item -mae=@var{ae_type}
13209 @opindex mcpu
13210 Set the instruction set, register set, and instruction scheduling
13211 parameters for array element type @var{ae_type}.  Supported values
13212 for @var{ae_type} are @samp{ANY}, @samp{MUL}, and @samp{MAC}.
13213
13214 @option{-mae=ANY} selects a completely generic AE type.  Code
13215 generated with this option will run on any of the other AE types.  The
13216 code will not be as efficient as it would be if compiled for a specific
13217 AE type, and some types of operation (e.g., multiplication) will not
13218 work properly on all types of AE.
13219
13220 @option{-mae=MUL} selects a MUL AE type.  This is the most useful AE type
13221 for compiled code, and is the default.
13222
13223 @option{-mae=MAC} selects a DSP-style MAC AE.  Code compiled with this
13224 option may suffer from poor performance of byte (char) manipulation,
13225 since the DSP AE does not provide hardware support for byte load/stores.
13226
13227 @item -msymbol-as-address
13228 Enable the compiler to directly use a symbol name as an address in a
13229 load/store instruction, without first loading it into a
13230 register.  Typically, the use of this option will generate larger
13231 programs, which run faster than when the option isn't used.  However, the
13232 results vary from program to program, so it is left as a user option,
13233 rather than being permanently enabled.
13234
13235 @item -mno-inefficient-warnings
13236 Disables warnings about the generation of inefficient code.  These
13237 warnings can be generated, for example, when compiling code which
13238 performs byte-level memory operations on the MAC AE type.  The MAC AE has
13239 no hardware support for byte-level memory operations, so all byte
13240 load/stores must be synthesised from word load/store operations.  This is
13241 inefficient and a warning will be generated indicating to the programmer
13242 that they should rewrite the code to avoid byte operations, or to target
13243 an AE type which has the necessary hardware support.  This option enables
13244 the warning to be turned off.
13245
13246 @end table
13247
13248 @node PowerPC Options
13249 @subsection PowerPC Options
13250 @cindex PowerPC options
13251
13252 These are listed under @xref{RS/6000 and PowerPC Options}.
13253
13254 @node RS/6000 and PowerPC Options
13255 @subsection IBM RS/6000 and PowerPC Options
13256 @cindex RS/6000 and PowerPC Options
13257 @cindex IBM RS/6000 and PowerPC Options
13258
13259 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
13260 @table @gcctabopt
13261 @item -mpower
13262 @itemx -mno-power
13263 @itemx -mpower2
13264 @itemx -mno-power2
13265 @itemx -mpowerpc
13266 @itemx -mno-powerpc
13267 @itemx -mpowerpc-gpopt
13268 @itemx -mno-powerpc-gpopt
13269 @itemx -mpowerpc-gfxopt
13270 @itemx -mno-powerpc-gfxopt
13271 @itemx -mpowerpc64
13272 @itemx -mno-powerpc64
13273 @itemx -mmfcrf
13274 @itemx -mno-mfcrf
13275 @itemx -mpopcntb
13276 @itemx -mno-popcntb
13277 @itemx -mfprnd
13278 @itemx -mno-fprnd
13279 @itemx -mcmpb
13280 @itemx -mno-cmpb
13281 @itemx -mmfpgpr
13282 @itemx -mno-mfpgpr
13283 @itemx -mhard-dfp
13284 @itemx -mno-hard-dfp
13285 @opindex mpower
13286 @opindex mno-power
13287 @opindex mpower2
13288 @opindex mno-power2
13289 @opindex mpowerpc
13290 @opindex mno-powerpc
13291 @opindex mpowerpc-gpopt
13292 @opindex mno-powerpc-gpopt
13293 @opindex mpowerpc-gfxopt
13294 @opindex mno-powerpc-gfxopt
13295 @opindex mpowerpc64
13296 @opindex mno-powerpc64
13297 @opindex mmfcrf
13298 @opindex mno-mfcrf
13299 @opindex mpopcntb
13300 @opindex mno-popcntb
13301 @opindex mfprnd
13302 @opindex mno-fprnd
13303 @opindex mcmpb
13304 @opindex mno-cmpb
13305 @opindex mmfpgpr
13306 @opindex mno-mfpgpr
13307 @opindex mhard-dfp
13308 @opindex mno-hard-dfp
13309 GCC supports two related instruction set architectures for the
13310 RS/6000 and PowerPC@.  The @dfn{POWER} instruction set are those
13311 instructions supported by the @samp{rios} chip set used in the original
13312 RS/6000 systems and the @dfn{PowerPC} instruction set is the
13313 architecture of the Freescale MPC5xx, MPC6xx, MPC8xx microprocessors, and
13314 the IBM 4xx, 6xx, and follow-on microprocessors.
13315
13316 Neither architecture is a subset of the other.  However there is a
13317 large common subset of instructions supported by both.  An MQ
13318 register is included in processors supporting the POWER architecture.
13319
13320 You use these options to specify which instructions are available on the
13321 processor you are using.  The default value of these options is
13322 determined when configuring GCC@.  Specifying the
13323 @option{-mcpu=@var{cpu_type}} overrides the specification of these
13324 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
13325 rather than the options listed above.
13326
13327 The @option{-mpower} option allows GCC to generate instructions that
13328 are found only in the POWER architecture and to use the MQ register.
13329 Specifying @option{-mpower2} implies @option{-power} and also allows GCC
13330 to generate instructions that are present in the POWER2 architecture but
13331 not the original POWER architecture.
13332
13333 The @option{-mpowerpc} option allows GCC to generate instructions that
13334 are found only in the 32-bit subset of the PowerPC architecture.
13335 Specifying @option{-mpowerpc-gpopt} implies @option{-mpowerpc} and also allows
13336 GCC to use the optional PowerPC architecture instructions in the
13337 General Purpose group, including floating-point square root.  Specifying
13338 @option{-mpowerpc-gfxopt} implies @option{-mpowerpc} and also allows GCC to
13339 use the optional PowerPC architecture instructions in the Graphics
13340 group, including floating-point select.
13341
13342 The @option{-mmfcrf} option allows GCC to generate the move from
13343 condition register field instruction implemented on the POWER4
13344 processor and other processors that support the PowerPC V2.01
13345 architecture.
13346 The @option{-mpopcntb} option allows GCC to generate the popcount and
13347 double precision FP reciprocal estimate instruction implemented on the
13348 POWER5 processor and other processors that support the PowerPC V2.02
13349 architecture.
13350 The @option{-mfprnd} option allows GCC to generate the FP round to
13351 integer instructions implemented on the POWER5+ processor and other
13352 processors that support the PowerPC V2.03 architecture.
13353 The @option{-mcmpb} option allows GCC to generate the compare bytes
13354 instruction implemented on the POWER6 processor and other processors
13355 that support the PowerPC V2.05 architecture.
13356 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
13357 general purpose register instructions implemented on the POWER6X
13358 processor and other processors that support the extended PowerPC V2.05
13359 architecture.
13360 The @option{-mhard-dfp} option allows GCC to generate the decimal floating
13361 point instructions implemented on some POWER processors.
13362
13363 The @option{-mpowerpc64} option allows GCC to generate the additional
13364 64-bit instructions that are found in the full PowerPC64 architecture
13365 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
13366 @option{-mno-powerpc64}.
13367
13368 If you specify both @option{-mno-power} and @option{-mno-powerpc}, GCC
13369 will use only the instructions in the common subset of both
13370 architectures plus some special AIX common-mode calls, and will not use
13371 the MQ register.  Specifying both @option{-mpower} and @option{-mpowerpc}
13372 permits GCC to use any instruction from either architecture and to
13373 allow use of the MQ register; specify this for the Motorola MPC601.
13374
13375 @item -mnew-mnemonics
13376 @itemx -mold-mnemonics
13377 @opindex mnew-mnemonics
13378 @opindex mold-mnemonics
13379 Select which mnemonics to use in the generated assembler code.  With
13380 @option{-mnew-mnemonics}, GCC uses the assembler mnemonics defined for
13381 the PowerPC architecture.  With @option{-mold-mnemonics} it uses the
13382 assembler mnemonics defined for the POWER architecture.  Instructions
13383 defined in only one architecture have only one mnemonic; GCC uses that
13384 mnemonic irrespective of which of these options is specified.
13385
13386 GCC defaults to the mnemonics appropriate for the architecture in
13387 use.  Specifying @option{-mcpu=@var{cpu_type}} sometimes overrides the
13388 value of these option.  Unless you are building a cross-compiler, you
13389 should normally not specify either @option{-mnew-mnemonics} or
13390 @option{-mold-mnemonics}, but should instead accept the default.
13391
13392 @item -mcpu=@var{cpu_type}
13393 @opindex mcpu
13394 Set architecture type, register usage, choice of mnemonics, and
13395 instruction scheduling parameters for machine type @var{cpu_type}.
13396 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
13397 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{464}, @samp{464fp},
13398 @samp{505}, @samp{601}, @samp{602}, @samp{603}, @samp{603e}, @samp{604},
13399 @samp{604e}, @samp{620}, @samp{630}, @samp{740}, @samp{7400},
13400 @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
13401 @samp{860}, @samp{970}, @samp{8540}, @samp{e300c2}, @samp{e300c3},
13402 @samp{e500mc}, @samp{ec603e}, @samp{G3}, @samp{G4}, @samp{G5},
13403 @samp{power}, @samp{power2}, @samp{power3}, @samp{power4},
13404 @samp{power5}, @samp{power5+}, @samp{power6}, @samp{power6x}, @samp{power7}
13405 @samp{common}, @samp{powerpc}, @samp{powerpc64}, @samp{rios},
13406 @samp{rios1}, @samp{rios2}, @samp{rsc}, and @samp{rs64}.
13407
13408 @option{-mcpu=common} selects a completely generic processor.  Code
13409 generated under this option will run on any POWER or PowerPC processor.
13410 GCC will use only the instructions in the common subset of both
13411 architectures, and will not use the MQ register.  GCC assumes a generic
13412 processor model for scheduling purposes.
13413
13414 @option{-mcpu=power}, @option{-mcpu=power2}, @option{-mcpu=powerpc}, and
13415 @option{-mcpu=powerpc64} specify generic POWER, POWER2, pure 32-bit
13416 PowerPC (i.e., not MPC601), and 64-bit PowerPC architecture machine
13417 types, with an appropriate, generic processor model assumed for
13418 scheduling purposes.
13419
13420 The other options specify a specific processor.  Code generated under
13421 those options will run best on that processor, and may not run at all on
13422 others.
13423
13424 The @option{-mcpu} options automatically enable or disable the
13425 following options:
13426
13427 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
13428 -mnew-mnemonics  -mpopcntb  -mpower  -mpower2  -mpowerpc64 @gol
13429 -mpowerpc-gpopt  -mpowerpc-gfxopt  -msingle-float -mdouble-float @gol
13430 -msimple-fpu -mstring  -mmulhw  -mdlmzb  -mmfpgpr}
13431
13432 The particular options set for any particular CPU will vary between
13433 compiler versions, depending on what setting seems to produce optimal
13434 code for that CPU; it doesn't necessarily reflect the actual hardware's
13435 capabilities.  If you wish to set an individual option to a particular
13436 value, you may specify it after the @option{-mcpu} option, like
13437 @samp{-mcpu=970 -mno-altivec}.
13438
13439 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
13440 not enabled or disabled by the @option{-mcpu} option at present because
13441 AIX does not have full support for these options.  You may still
13442 enable or disable them individually if you're sure it'll work in your
13443 environment.
13444
13445 @item -mtune=@var{cpu_type}
13446 @opindex mtune
13447 Set the instruction scheduling parameters for machine type
13448 @var{cpu_type}, but do not set the architecture type, register usage, or
13449 choice of mnemonics, as @option{-mcpu=@var{cpu_type}} would.  The same
13450 values for @var{cpu_type} are used for @option{-mtune} as for
13451 @option{-mcpu}.  If both are specified, the code generated will use the
13452 architecture, registers, and mnemonics set by @option{-mcpu}, but the
13453 scheduling parameters set by @option{-mtune}.
13454
13455 @item -mswdiv
13456 @itemx -mno-swdiv
13457 @opindex mswdiv
13458 @opindex mno-swdiv
13459 Generate code to compute division as reciprocal estimate and iterative
13460 refinement, creating opportunities for increased throughput.  This
13461 feature requires: optional PowerPC Graphics instruction set for single
13462 precision and FRE instruction for double precision, assuming divides
13463 cannot generate user-visible traps, and the domain values not include
13464 Infinities, denormals or zero denominator.
13465
13466 @item -maltivec
13467 @itemx -mno-altivec
13468 @opindex maltivec
13469 @opindex mno-altivec
13470 Generate code that uses (does not use) AltiVec instructions, and also
13471 enable the use of built-in functions that allow more direct access to
13472 the AltiVec instruction set.  You may also need to set
13473 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
13474 enhancements.
13475
13476 @item -mvrsave
13477 @itemx -mno-vrsave
13478 @opindex mvrsave
13479 @opindex mno-vrsave
13480 Generate VRSAVE instructions when generating AltiVec code.
13481
13482 @item -msecure-plt
13483 @opindex msecure-plt
13484 Generate code that allows ld and ld.so to build executables and shared
13485 libraries with non-exec .plt and .got sections.  This is a PowerPC
13486 32-bit SYSV ABI option.
13487
13488 @item -mbss-plt
13489 @opindex mbss-plt
13490 Generate code that uses a BSS .plt section that ld.so fills in, and
13491 requires .plt and .got sections that are both writable and executable.
13492 This is a PowerPC 32-bit SYSV ABI option.
13493
13494 @item -misel
13495 @itemx -mno-isel
13496 @opindex misel
13497 @opindex mno-isel
13498 This switch enables or disables the generation of ISEL instructions.
13499
13500 @item -misel=@var{yes/no}
13501 This switch has been deprecated.  Use @option{-misel} and
13502 @option{-mno-isel} instead.
13503
13504 @item -mspe
13505 @itemx -mno-spe
13506 @opindex mspe
13507 @opindex mno-spe
13508 This switch enables or disables the generation of SPE simd
13509 instructions.
13510
13511 @item -mpaired
13512 @itemx -mno-paired
13513 @opindex mpaired
13514 @opindex mno-paired
13515 This switch enables or disables the generation of PAIRED simd
13516 instructions.
13517
13518 @item -mspe=@var{yes/no}
13519 This option has been deprecated.  Use @option{-mspe} and
13520 @option{-mno-spe} instead.
13521
13522 @item -mfloat-gprs=@var{yes/single/double/no}
13523 @itemx -mfloat-gprs
13524 @opindex mfloat-gprs
13525 This switch enables or disables the generation of floating point
13526 operations on the general purpose registers for architectures that
13527 support it.
13528
13529 The argument @var{yes} or @var{single} enables the use of
13530 single-precision floating point operations.
13531
13532 The argument @var{double} enables the use of single and
13533 double-precision floating point operations.
13534
13535 The argument @var{no} disables floating point operations on the
13536 general purpose registers.
13537
13538 This option is currently only available on the MPC854x.
13539
13540 @item -m32
13541 @itemx -m64
13542 @opindex m32
13543 @opindex m64
13544 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
13545 targets (including GNU/Linux).  The 32-bit environment sets int, long
13546 and pointer to 32 bits and generates code that runs on any PowerPC
13547 variant.  The 64-bit environment sets int to 32 bits and long and
13548 pointer to 64 bits, and generates code for PowerPC64, as for
13549 @option{-mpowerpc64}.
13550
13551 @item -mfull-toc
13552 @itemx -mno-fp-in-toc
13553 @itemx -mno-sum-in-toc
13554 @itemx -mminimal-toc
13555 @opindex mfull-toc
13556 @opindex mno-fp-in-toc
13557 @opindex mno-sum-in-toc
13558 @opindex mminimal-toc
13559 Modify generation of the TOC (Table Of Contents), which is created for
13560 every executable file.  The @option{-mfull-toc} option is selected by
13561 default.  In that case, GCC will allocate at least one TOC entry for
13562 each unique non-automatic variable reference in your program.  GCC
13563 will also place floating-point constants in the TOC@.  However, only
13564 16,384 entries are available in the TOC@.
13565
13566 If you receive a linker error message that saying you have overflowed
13567 the available TOC space, you can reduce the amount of TOC space used
13568 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
13569 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
13570 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
13571 generate code to calculate the sum of an address and a constant at
13572 run-time instead of putting that sum into the TOC@.  You may specify one
13573 or both of these options.  Each causes GCC to produce very slightly
13574 slower and larger code at the expense of conserving TOC space.
13575
13576 If you still run out of space in the TOC even when you specify both of
13577 these options, specify @option{-mminimal-toc} instead.  This option causes
13578 GCC to make only one TOC entry for every file.  When you specify this
13579 option, GCC will produce code that is slower and larger but which
13580 uses extremely little TOC space.  You may wish to use this option
13581 only on files that contain less frequently executed code.
13582
13583 @item -maix64
13584 @itemx -maix32
13585 @opindex maix64
13586 @opindex maix32
13587 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
13588 @code{long} type, and the infrastructure needed to support them.
13589 Specifying @option{-maix64} implies @option{-mpowerpc64} and
13590 @option{-mpowerpc}, while @option{-maix32} disables the 64-bit ABI and
13591 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
13592
13593 @item -mxl-compat
13594 @itemx -mno-xl-compat
13595 @opindex mxl-compat
13596 @opindex mno-xl-compat
13597 Produce code that conforms more closely to IBM XL compiler semantics
13598 when using AIX-compatible ABI@.  Pass floating-point arguments to
13599 prototyped functions beyond the register save area (RSA) on the stack
13600 in addition to argument FPRs.  Do not assume that most significant
13601 double in 128-bit long double value is properly rounded when comparing
13602 values and converting to double.  Use XL symbol names for long double
13603 support routines.
13604
13605 The AIX calling convention was extended but not initially documented to
13606 handle an obscure K&R C case of calling a function that takes the
13607 address of its arguments with fewer arguments than declared.  IBM XL
13608 compilers access floating point arguments which do not fit in the
13609 RSA from the stack when a subroutine is compiled without
13610 optimization.  Because always storing floating-point arguments on the
13611 stack is inefficient and rarely needed, this option is not enabled by
13612 default and only is necessary when calling subroutines compiled by IBM
13613 XL compilers without optimization.
13614
13615 @item -mpe
13616 @opindex mpe
13617 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
13618 application written to use message passing with special startup code to
13619 enable the application to run.  The system must have PE installed in the
13620 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
13621 must be overridden with the @option{-specs=} option to specify the
13622 appropriate directory location.  The Parallel Environment does not
13623 support threads, so the @option{-mpe} option and the @option{-pthread}
13624 option are incompatible.
13625
13626 @item -malign-natural
13627 @itemx -malign-power
13628 @opindex malign-natural
13629 @opindex malign-power
13630 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
13631 @option{-malign-natural} overrides the ABI-defined alignment of larger
13632 types, such as floating-point doubles, on their natural size-based boundary.
13633 The option @option{-malign-power} instructs GCC to follow the ABI-specified
13634 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
13635
13636 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
13637 is not supported.
13638
13639 @item -msoft-float
13640 @itemx -mhard-float
13641 @opindex msoft-float
13642 @opindex mhard-float
13643 Generate code that does not use (uses) the floating-point register set.
13644 Software floating point emulation is provided if you use the
13645 @option{-msoft-float} option, and pass the option to GCC when linking.
13646
13647 @item -msingle-float
13648 @itemx -mdouble-float
13649 @opindex msingle-float
13650 @opindex mdouble-float
13651 Generate code for single or double-precision floating point operations. 
13652 @option{-mdouble-float} implies @option{-msingle-float}. 
13653
13654 @item -msimple-fpu
13655 @opindex msimple-fpu
13656 Do not generate sqrt and div instructions for hardware floating point unit.
13657
13658 @item -mmultiple
13659 @itemx -mno-multiple
13660 @opindex mmultiple
13661 @opindex mno-multiple
13662 Generate code that uses (does not use) the load multiple word
13663 instructions and the store multiple word instructions.  These
13664 instructions are generated by default on POWER systems, and not
13665 generated on PowerPC systems.  Do not use @option{-mmultiple} on little
13666 endian PowerPC systems, since those instructions do not work when the
13667 processor is in little endian mode.  The exceptions are PPC740 and
13668 PPC750 which permit the instructions usage in little endian mode.
13669
13670 @item -mstring
13671 @itemx -mno-string
13672 @opindex mstring
13673 @opindex mno-string
13674 Generate code that uses (does not use) the load string instructions
13675 and the store string word instructions to save multiple registers and
13676 do small block moves.  These instructions are generated by default on
13677 POWER systems, and not generated on PowerPC systems.  Do not use
13678 @option{-mstring} on little endian PowerPC systems, since those
13679 instructions do not work when the processor is in little endian mode.
13680 The exceptions are PPC740 and PPC750 which permit the instructions
13681 usage in little endian mode.
13682
13683 @item -mupdate
13684 @itemx -mno-update
13685 @opindex mupdate
13686 @opindex mno-update
13687 Generate code that uses (does not use) the load or store instructions
13688 that update the base register to the address of the calculated memory
13689 location.  These instructions are generated by default.  If you use
13690 @option{-mno-update}, there is a small window between the time that the
13691 stack pointer is updated and the address of the previous frame is
13692 stored, which means code that walks the stack frame across interrupts or
13693 signals may get corrupted data.
13694
13695 @item -mfused-madd
13696 @itemx -mno-fused-madd
13697 @opindex mfused-madd
13698 @opindex mno-fused-madd
13699 Generate code that uses (does not use) the floating point multiply and
13700 accumulate instructions.  These instructions are generated by default if
13701 hardware floating is used.
13702
13703 @item -mmulhw
13704 @itemx -mno-mulhw
13705 @opindex mmulhw
13706 @opindex mno-mulhw
13707 Generate code that uses (does not use) the half-word multiply and
13708 multiply-accumulate instructions on the IBM 405, 440 and 464 processors.
13709 These instructions are generated by default when targetting those
13710 processors.
13711
13712 @item -mdlmzb
13713 @itemx -mno-dlmzb
13714 @opindex mdlmzb
13715 @opindex mno-dlmzb
13716 Generate code that uses (does not use) the string-search @samp{dlmzb}
13717 instruction on the IBM 405, 440 and 464 processors.  This instruction is
13718 generated by default when targetting those processors.
13719
13720 @item -mno-bit-align
13721 @itemx -mbit-align
13722 @opindex mno-bit-align
13723 @opindex mbit-align
13724 On System V.4 and embedded PowerPC systems do not (do) force structures
13725 and unions that contain bit-fields to be aligned to the base type of the
13726 bit-field.
13727
13728 For example, by default a structure containing nothing but 8
13729 @code{unsigned} bit-fields of length 1 would be aligned to a 4 byte
13730 boundary and have a size of 4 bytes.  By using @option{-mno-bit-align},
13731 the structure would be aligned to a 1 byte boundary and be one byte in
13732 size.
13733
13734 @item -mno-strict-align
13735 @itemx -mstrict-align
13736 @opindex mno-strict-align
13737 @opindex mstrict-align
13738 On System V.4 and embedded PowerPC systems do not (do) assume that
13739 unaligned memory references will be handled by the system.
13740
13741 @item -mrelocatable
13742 @itemx -mno-relocatable
13743 @opindex mrelocatable
13744 @opindex mno-relocatable
13745 On embedded PowerPC systems generate code that allows (does not allow)
13746 the program to be relocated to a different address at runtime.  If you
13747 use @option{-mrelocatable} on any module, all objects linked together must
13748 be compiled with @option{-mrelocatable} or @option{-mrelocatable-lib}.
13749
13750 @item -mrelocatable-lib
13751 @itemx -mno-relocatable-lib
13752 @opindex mrelocatable-lib
13753 @opindex mno-relocatable-lib
13754 On embedded PowerPC systems generate code that allows (does not allow)
13755 the program to be relocated to a different address at runtime.  Modules
13756 compiled with @option{-mrelocatable-lib} can be linked with either modules
13757 compiled without @option{-mrelocatable} and @option{-mrelocatable-lib} or
13758 with modules compiled with the @option{-mrelocatable} options.
13759
13760 @item -mno-toc
13761 @itemx -mtoc
13762 @opindex mno-toc
13763 @opindex mtoc
13764 On System V.4 and embedded PowerPC systems do not (do) assume that
13765 register 2 contains a pointer to a global area pointing to the addresses
13766 used in the program.
13767
13768 @item -mlittle
13769 @itemx -mlittle-endian
13770 @opindex mlittle
13771 @opindex mlittle-endian
13772 On System V.4 and embedded PowerPC systems compile code for the
13773 processor in little endian mode.  The @option{-mlittle-endian} option is
13774 the same as @option{-mlittle}.
13775
13776 @item -mbig
13777 @itemx -mbig-endian
13778 @opindex mbig
13779 @opindex mbig-endian
13780 On System V.4 and embedded PowerPC systems compile code for the
13781 processor in big endian mode.  The @option{-mbig-endian} option is
13782 the same as @option{-mbig}.
13783
13784 @item -mdynamic-no-pic
13785 @opindex mdynamic-no-pic
13786 On Darwin and Mac OS X systems, compile code so that it is not
13787 relocatable, but that its external references are relocatable.  The
13788 resulting code is suitable for applications, but not shared
13789 libraries.
13790
13791 @item -mprioritize-restricted-insns=@var{priority}
13792 @opindex mprioritize-restricted-insns
13793 This option controls the priority that is assigned to
13794 dispatch-slot restricted instructions during the second scheduling
13795 pass.  The argument @var{priority} takes the value @var{0/1/2} to assign
13796 @var{no/highest/second-highest} priority to dispatch slot restricted
13797 instructions.
13798
13799 @item -msched-costly-dep=@var{dependence_type}
13800 @opindex msched-costly-dep
13801 This option controls which dependences are considered costly
13802 by the target during instruction scheduling.  The argument
13803 @var{dependence_type} takes one of the following values:
13804 @var{no}: no dependence is costly,
13805 @var{all}: all dependences are costly,
13806 @var{true_store_to_load}: a true dependence from store to load is costly,
13807 @var{store_to_load}: any dependence from store to load is costly,
13808 @var{number}: any dependence which latency >= @var{number} is costly.
13809
13810 @item -minsert-sched-nops=@var{scheme}
13811 @opindex minsert-sched-nops
13812 This option controls which nop insertion scheme will be used during
13813 the second scheduling pass.  The argument @var{scheme} takes one of the
13814 following values:
13815 @var{no}: Don't insert nops.
13816 @var{pad}: Pad with nops any dispatch group which has vacant issue slots,
13817 according to the scheduler's grouping.
13818 @var{regroup_exact}: Insert nops to force costly dependent insns into
13819 separate groups.  Insert exactly as many nops as needed to force an insn
13820 to a new group, according to the estimated processor grouping.
13821 @var{number}: Insert nops to force costly dependent insns into
13822 separate groups.  Insert @var{number} nops to force an insn to a new group.
13823
13824 @item -mcall-sysv
13825 @opindex mcall-sysv
13826 On System V.4 and embedded PowerPC systems compile code using calling
13827 conventions that adheres to the March 1995 draft of the System V
13828 Application Binary Interface, PowerPC processor supplement.  This is the
13829 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
13830
13831 @item -mcall-sysv-eabi
13832 @opindex mcall-sysv-eabi
13833 Specify both @option{-mcall-sysv} and @option{-meabi} options.
13834
13835 @item -mcall-sysv-noeabi
13836 @opindex mcall-sysv-noeabi
13837 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
13838
13839 @item -mcall-solaris
13840 @opindex mcall-solaris
13841 On System V.4 and embedded PowerPC systems compile code for the Solaris
13842 operating system.
13843
13844 @item -mcall-linux
13845 @opindex mcall-linux
13846 On System V.4 and embedded PowerPC systems compile code for the
13847 Linux-based GNU system.
13848
13849 @item -mcall-gnu
13850 @opindex mcall-gnu
13851 On System V.4 and embedded PowerPC systems compile code for the
13852 Hurd-based GNU system.
13853
13854 @item -mcall-netbsd
13855 @opindex mcall-netbsd
13856 On System V.4 and embedded PowerPC systems compile code for the
13857 NetBSD operating system.
13858
13859 @item -maix-struct-return
13860 @opindex maix-struct-return
13861 Return all structures in memory (as specified by the AIX ABI)@.
13862
13863 @item -msvr4-struct-return
13864 @opindex msvr4-struct-return
13865 Return structures smaller than 8 bytes in registers (as specified by the
13866 SVR4 ABI)@.
13867
13868 @item -mabi=@var{abi-type}
13869 @opindex mabi
13870 Extend the current ABI with a particular extension, or remove such extension.
13871 Valid values are @var{altivec}, @var{no-altivec}, @var{spe},
13872 @var{no-spe}, @var{ibmlongdouble}, @var{ieeelongdouble}@.
13873
13874 @item -mabi=spe
13875 @opindex mabi=spe
13876 Extend the current ABI with SPE ABI extensions.  This does not change
13877 the default ABI, instead it adds the SPE ABI extensions to the current
13878 ABI@.
13879
13880 @item -mabi=no-spe
13881 @opindex mabi=no-spe
13882 Disable Booke SPE ABI extensions for the current ABI@.
13883
13884 @item -mabi=ibmlongdouble
13885 @opindex mabi=ibmlongdouble
13886 Change the current ABI to use IBM extended precision long double.
13887 This is a PowerPC 32-bit SYSV ABI option.
13888
13889 @item -mabi=ieeelongdouble
13890 @opindex mabi=ieeelongdouble
13891 Change the current ABI to use IEEE extended precision long double.
13892 This is a PowerPC 32-bit Linux ABI option.
13893
13894 @item -mprototype
13895 @itemx -mno-prototype
13896 @opindex mprototype
13897 @opindex mno-prototype
13898 On System V.4 and embedded PowerPC systems assume that all calls to
13899 variable argument functions are properly prototyped.  Otherwise, the
13900 compiler must insert an instruction before every non prototyped call to
13901 set or clear bit 6 of the condition code register (@var{CR}) to
13902 indicate whether floating point values were passed in the floating point
13903 registers in case the function takes a variable arguments.  With
13904 @option{-mprototype}, only calls to prototyped variable argument functions
13905 will set or clear the bit.
13906
13907 @item -msim
13908 @opindex msim
13909 On embedded PowerPC systems, assume that the startup module is called
13910 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
13911 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}
13912 configurations.
13913
13914 @item -mmvme
13915 @opindex mmvme
13916 On embedded PowerPC systems, assume that the startup module is called
13917 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
13918 @file{libc.a}.
13919
13920 @item -mads
13921 @opindex mads
13922 On embedded PowerPC systems, assume that the startup module is called
13923 @file{crt0.o} and the standard C libraries are @file{libads.a} and
13924 @file{libc.a}.
13925
13926 @item -myellowknife
13927 @opindex myellowknife
13928 On embedded PowerPC systems, assume that the startup module is called
13929 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
13930 @file{libc.a}.
13931
13932 @item -mvxworks
13933 @opindex mvxworks
13934 On System V.4 and embedded PowerPC systems, specify that you are
13935 compiling for a VxWorks system.
13936
13937 @item -memb
13938 @opindex memb
13939 On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
13940 header to indicate that @samp{eabi} extended relocations are used.
13941
13942 @item -meabi
13943 @itemx -mno-eabi
13944 @opindex meabi
13945 @opindex mno-eabi
13946 On System V.4 and embedded PowerPC systems do (do not) adhere to the
13947 Embedded Applications Binary Interface (eabi) which is a set of
13948 modifications to the System V.4 specifications.  Selecting @option{-meabi}
13949 means that the stack is aligned to an 8 byte boundary, a function
13950 @code{__eabi} is called to from @code{main} to set up the eabi
13951 environment, and the @option{-msdata} option can use both @code{r2} and
13952 @code{r13} to point to two separate small data areas.  Selecting
13953 @option{-mno-eabi} means that the stack is aligned to a 16 byte boundary,
13954 do not call an initialization function from @code{main}, and the
13955 @option{-msdata} option will only use @code{r13} to point to a single
13956 small data area.  The @option{-meabi} option is on by default if you
13957 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
13958
13959 @item -msdata=eabi
13960 @opindex msdata=eabi
13961 On System V.4 and embedded PowerPC systems, put small initialized
13962 @code{const} global and static data in the @samp{.sdata2} section, which
13963 is pointed to by register @code{r2}.  Put small initialized
13964 non-@code{const} global and static data in the @samp{.sdata} section,
13965 which is pointed to by register @code{r13}.  Put small uninitialized
13966 global and static data in the @samp{.sbss} section, which is adjacent to
13967 the @samp{.sdata} section.  The @option{-msdata=eabi} option is
13968 incompatible with the @option{-mrelocatable} option.  The
13969 @option{-msdata=eabi} option also sets the @option{-memb} option.
13970
13971 @item -msdata=sysv
13972 @opindex msdata=sysv
13973 On System V.4 and embedded PowerPC systems, put small global and static
13974 data in the @samp{.sdata} section, which is pointed to by register
13975 @code{r13}.  Put small uninitialized global and static data in the
13976 @samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
13977 The @option{-msdata=sysv} option is incompatible with the
13978 @option{-mrelocatable} option.
13979
13980 @item -msdata=default
13981 @itemx -msdata
13982 @opindex msdata=default
13983 @opindex msdata
13984 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
13985 compile code the same as @option{-msdata=eabi}, otherwise compile code the
13986 same as @option{-msdata=sysv}.
13987
13988 @item -msdata-data
13989 @opindex msdata-data
13990 On System V.4 and embedded PowerPC systems, put small global
13991 data in the @samp{.sdata} section.  Put small uninitialized global
13992 data in the @samp{.sbss} section.  Do not use register @code{r13}
13993 to address small data however.  This is the default behavior unless
13994 other @option{-msdata} options are used.
13995
13996 @item -msdata=none
13997 @itemx -mno-sdata
13998 @opindex msdata=none
13999 @opindex mno-sdata
14000 On embedded PowerPC systems, put all initialized global and static data
14001 in the @samp{.data} section, and all uninitialized data in the
14002 @samp{.bss} section.
14003
14004 @item -G @var{num}
14005 @opindex G
14006 @cindex smaller data references (PowerPC)
14007 @cindex .sdata/.sdata2 references (PowerPC)
14008 On embedded PowerPC systems, put global and static items less than or
14009 equal to @var{num} bytes into the small data or bss sections instead of
14010 the normal data or bss section.  By default, @var{num} is 8.  The
14011 @option{-G @var{num}} switch is also passed to the linker.
14012 All modules should be compiled with the same @option{-G @var{num}} value.
14013
14014 @item -mregnames
14015 @itemx -mno-regnames
14016 @opindex mregnames
14017 @opindex mno-regnames
14018 On System V.4 and embedded PowerPC systems do (do not) emit register
14019 names in the assembly language output using symbolic forms.
14020
14021 @item -mlongcall
14022 @itemx -mno-longcall
14023 @opindex mlongcall
14024 @opindex mno-longcall
14025 By default assume that all calls are far away so that a longer more
14026 expensive calling sequence is required.  This is required for calls
14027 further than 32 megabytes (33,554,432 bytes) from the current location.
14028 A short call will be generated if the compiler knows
14029 the call cannot be that far away.  This setting can be overridden by
14030 the @code{shortcall} function attribute, or by @code{#pragma
14031 longcall(0)}.
14032
14033 Some linkers are capable of detecting out-of-range calls and generating
14034 glue code on the fly.  On these systems, long calls are unnecessary and
14035 generate slower code.  As of this writing, the AIX linker can do this,
14036 as can the GNU linker for PowerPC/64.  It is planned to add this feature
14037 to the GNU linker for 32-bit PowerPC systems as well.
14038
14039 On Darwin/PPC systems, @code{#pragma longcall} will generate ``jbsr
14040 callee, L42'', plus a ``branch island'' (glue code).  The two target
14041 addresses represent the callee and the ``branch island''.  The
14042 Darwin/PPC linker will prefer the first address and generate a ``bl
14043 callee'' if the PPC ``bl'' instruction will reach the callee directly;
14044 otherwise, the linker will generate ``bl L42'' to call the ``branch
14045 island''.  The ``branch island'' is appended to the body of the
14046 calling function; it computes the full 32-bit address of the callee
14047 and jumps to it.
14048
14049 On Mach-O (Darwin) systems, this option directs the compiler emit to
14050 the glue for every direct call, and the Darwin linker decides whether
14051 to use or discard it.
14052
14053 In the future, we may cause GCC to ignore all longcall specifications
14054 when the linker is known to generate glue.
14055
14056 @item -pthread
14057 @opindex pthread
14058 Adds support for multithreading with the @dfn{pthreads} library.
14059 This option sets flags for both the preprocessor and linker.
14060
14061 @end table
14062
14063 @node S/390 and zSeries Options
14064 @subsection S/390 and zSeries Options
14065 @cindex S/390 and zSeries Options
14066
14067 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
14068
14069 @table @gcctabopt
14070 @item -mhard-float
14071 @itemx -msoft-float
14072 @opindex mhard-float
14073 @opindex msoft-float
14074 Use (do not use) the hardware floating-point instructions and registers
14075 for floating-point operations.  When @option{-msoft-float} is specified,
14076 functions in @file{libgcc.a} will be used to perform floating-point
14077 operations.  When @option{-mhard-float} is specified, the compiler
14078 generates IEEE floating-point instructions.  This is the default.
14079
14080 @item -mhard-dfp
14081 @itemx -mno-hard-dfp
14082 @opindex mhard-dfp
14083 @opindex mno-hard-dfp
14084 Use (do not use) the hardware decimal-floating-point instructions for
14085 decimal-floating-point operations.  When @option{-mno-hard-dfp} is
14086 specified, functions in @file{libgcc.a} will be used to perform
14087 decimal-floating-point operations.  When @option{-mhard-dfp} is
14088 specified, the compiler generates decimal-floating-point hardware
14089 instructions.  This is the default for @option{-march=z9-ec} or higher.
14090
14091 @item -mlong-double-64
14092 @itemx -mlong-double-128
14093 @opindex mlong-double-64
14094 @opindex mlong-double-128
14095 These switches control the size of @code{long double} type. A size
14096 of 64bit makes the @code{long double} type equivalent to the @code{double}
14097 type. This is the default.
14098
14099 @item -mbackchain
14100 @itemx -mno-backchain
14101 @opindex mbackchain
14102 @opindex mno-backchain
14103 Store (do not store) the address of the caller's frame as backchain pointer
14104 into the callee's stack frame.
14105 A backchain may be needed to allow debugging using tools that do not understand
14106 DWARF-2 call frame information.
14107 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
14108 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
14109 the backchain is placed into the topmost word of the 96/160 byte register
14110 save area.
14111
14112 In general, code compiled with @option{-mbackchain} is call-compatible with
14113 code compiled with @option{-mmo-backchain}; however, use of the backchain
14114 for debugging purposes usually requires that the whole binary is built with
14115 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
14116 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
14117 to build a linux kernel use @option{-msoft-float}.
14118
14119 The default is to not maintain the backchain.
14120
14121 @item -mpacked-stack
14122 @itemx -mno-packed-stack
14123 @opindex mpacked-stack
14124 @opindex mno-packed-stack
14125 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
14126 specified, the compiler uses the all fields of the 96/160 byte register save
14127 area only for their default purpose; unused fields still take up stack space.
14128 When @option{-mpacked-stack} is specified, register save slots are densely
14129 packed at the top of the register save area; unused space is reused for other
14130 purposes, allowing for more efficient use of the available stack space.
14131 However, when @option{-mbackchain} is also in effect, the topmost word of
14132 the save area is always used to store the backchain, and the return address
14133 register is always saved two words below the backchain.
14134
14135 As long as the stack frame backchain is not used, code generated with
14136 @option{-mpacked-stack} is call-compatible with code generated with
14137 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
14138 S/390 or zSeries generated code that uses the stack frame backchain at run
14139 time, not just for debugging purposes.  Such code is not call-compatible
14140 with code compiled with @option{-mpacked-stack}.  Also, note that the
14141 combination of @option{-mbackchain},
14142 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
14143 to build a linux kernel use @option{-msoft-float}.
14144
14145 The default is to not use the packed stack layout.
14146
14147 @item -msmall-exec
14148 @itemx -mno-small-exec
14149 @opindex msmall-exec
14150 @opindex mno-small-exec
14151 Generate (or do not generate) code using the @code{bras} instruction
14152 to do subroutine calls.
14153 This only works reliably if the total executable size does not
14154 exceed 64k.  The default is to use the @code{basr} instruction instead,
14155 which does not have this limitation.
14156
14157 @item -m64
14158 @itemx -m31
14159 @opindex m64
14160 @opindex m31
14161 When @option{-m31} is specified, generate code compliant to the
14162 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
14163 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
14164 particular to generate 64-bit instructions.  For the @samp{s390}
14165 targets, the default is @option{-m31}, while the @samp{s390x}
14166 targets default to @option{-m64}.
14167
14168 @item -mzarch
14169 @itemx -mesa
14170 @opindex mzarch
14171 @opindex mesa
14172 When @option{-mzarch} is specified, generate code using the
14173 instructions available on z/Architecture.
14174 When @option{-mesa} is specified, generate code using the
14175 instructions available on ESA/390.  Note that @option{-mesa} is
14176 not possible with @option{-m64}.
14177 When generating code compliant to the GNU/Linux for S/390 ABI,
14178 the default is @option{-mesa}.  When generating code compliant
14179 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
14180
14181 @item -mmvcle
14182 @itemx -mno-mvcle
14183 @opindex mmvcle
14184 @opindex mno-mvcle
14185 Generate (or do not generate) code using the @code{mvcle} instruction
14186 to perform block moves.  When @option{-mno-mvcle} is specified,
14187 use a @code{mvc} loop instead.  This is the default unless optimizing for
14188 size.
14189
14190 @item -mdebug
14191 @itemx -mno-debug
14192 @opindex mdebug
14193 @opindex mno-debug
14194 Print (or do not print) additional debug information when compiling.
14195 The default is to not print debug information.
14196
14197 @item -march=@var{cpu-type}
14198 @opindex march
14199 Generate code that will run on @var{cpu-type}, which is the name of a system
14200 representing a certain processor type.  Possible values for
14201 @var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, @samp{z990},
14202 @samp{z9-109}, @samp{z9-ec} and @samp{z10}.
14203 When generating code using the instructions available on z/Architecture,
14204 the default is @option{-march=z900}.  Otherwise, the default is
14205 @option{-march=g5}.
14206
14207 @item -mtune=@var{cpu-type}
14208 @opindex mtune
14209 Tune to @var{cpu-type} everything applicable about the generated code,
14210 except for the ABI and the set of available instructions.
14211 The list of @var{cpu-type} values is the same as for @option{-march}.
14212 The default is the value used for @option{-march}.
14213
14214 @item -mtpf-trace
14215 @itemx -mno-tpf-trace
14216 @opindex mtpf-trace
14217 @opindex mno-tpf-trace
14218 Generate code that adds (does not add) in TPF OS specific branches to trace
14219 routines in the operating system.  This option is off by default, even
14220 when compiling for the TPF OS@.
14221
14222 @item -mfused-madd
14223 @itemx -mno-fused-madd
14224 @opindex mfused-madd
14225 @opindex mno-fused-madd
14226 Generate code that uses (does not use) the floating point multiply and
14227 accumulate instructions.  These instructions are generated by default if
14228 hardware floating point is used.
14229
14230 @item -mwarn-framesize=@var{framesize}
14231 @opindex mwarn-framesize
14232 Emit a warning if the current function exceeds the given frame size.  Because
14233 this is a compile time check it doesn't need to be a real problem when the program
14234 runs.  It is intended to identify functions which most probably cause
14235 a stack overflow.  It is useful to be used in an environment with limited stack
14236 size e.g.@: the linux kernel.
14237
14238 @item -mwarn-dynamicstack
14239 @opindex mwarn-dynamicstack
14240 Emit a warning if the function calls alloca or uses dynamically
14241 sized arrays.  This is generally a bad idea with a limited stack size.
14242
14243 @item -mstack-guard=@var{stack-guard}
14244 @itemx -mstack-size=@var{stack-size}
14245 @opindex mstack-guard
14246 @opindex mstack-size
14247 If these options are provided the s390 back end emits additional instructions in
14248 the function prologue which trigger a trap if the stack size is @var{stack-guard}
14249 bytes above the @var{stack-size} (remember that the stack on s390 grows downward).
14250 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
14251 the frame size of the compiled function is chosen.
14252 These options are intended to be used to help debugging stack overflow problems.
14253 The additionally emitted code causes only little overhead and hence can also be
14254 used in production like systems without greater performance degradation.  The given
14255 values have to be exact powers of 2 and @var{stack-size} has to be greater than
14256 @var{stack-guard} without exceeding 64k.
14257 In order to be efficient the extra code makes the assumption that the stack starts
14258 at an address aligned to the value given by @var{stack-size}.
14259 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
14260 @end table
14261
14262 @node Score Options
14263 @subsection Score Options
14264 @cindex Score Options
14265
14266 These options are defined for Score implementations:
14267
14268 @table @gcctabopt
14269 @item -meb
14270 @opindex meb
14271 Compile code for big endian mode.  This is the default.
14272
14273 @item -mel
14274 @opindex mel
14275 Compile code for little endian mode. 
14276
14277 @item -mnhwloop
14278 @opindex mnhwloop
14279 Disable generate bcnz instruction.
14280
14281 @item -muls
14282 @opindex muls
14283 Enable generate unaligned load and store instruction.
14284
14285 @item -mmac
14286 @opindex mmac
14287 Enable the use of multiply-accumulate instructions. Disabled by default. 
14288
14289 @item -mscore5
14290 @opindex mscore5
14291 Specify the SCORE5 as the target architecture.
14292
14293 @item -mscore5u
14294 @opindex mscore5u
14295 Specify the SCORE5U of the target architecture.
14296
14297 @item -mscore7
14298 @opindex mscore7
14299 Specify the SCORE7 as the target architecture. This is the default.
14300
14301 @item -mscore7d
14302 @opindex mscore7d
14303 Specify the SCORE7D as the target architecture.
14304 @end table
14305
14306 @node SH Options
14307 @subsection SH Options
14308
14309 These @samp{-m} options are defined for the SH implementations:
14310
14311 @table @gcctabopt
14312 @item -m1
14313 @opindex m1
14314 Generate code for the SH1.
14315
14316 @item -m2
14317 @opindex m2
14318 Generate code for the SH2.
14319
14320 @item -m2e
14321 Generate code for the SH2e.
14322
14323 @item -m3
14324 @opindex m3
14325 Generate code for the SH3.
14326
14327 @item -m3e
14328 @opindex m3e
14329 Generate code for the SH3e.
14330
14331 @item -m4-nofpu
14332 @opindex m4-nofpu
14333 Generate code for the SH4 without a floating-point unit.
14334
14335 @item -m4-single-only
14336 @opindex m4-single-only
14337 Generate code for the SH4 with a floating-point unit that only
14338 supports single-precision arithmetic.
14339
14340 @item -m4-single
14341 @opindex m4-single
14342 Generate code for the SH4 assuming the floating-point unit is in
14343 single-precision mode by default.
14344
14345 @item -m4
14346 @opindex m4
14347 Generate code for the SH4.
14348
14349 @item -m4a-nofpu
14350 @opindex m4a-nofpu
14351 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
14352 floating-point unit is not used.
14353
14354 @item -m4a-single-only
14355 @opindex m4a-single-only
14356 Generate code for the SH4a, in such a way that no double-precision
14357 floating point operations are used.
14358
14359 @item -m4a-single
14360 @opindex m4a-single
14361 Generate code for the SH4a assuming the floating-point unit is in
14362 single-precision mode by default.
14363
14364 @item -m4a
14365 @opindex m4a
14366 Generate code for the SH4a.
14367
14368 @item -m4al
14369 @opindex m4al
14370 Same as @option{-m4a-nofpu}, except that it implicitly passes
14371 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
14372 instructions at the moment.
14373
14374 @item -mb
14375 @opindex mb
14376 Compile code for the processor in big endian mode.
14377
14378 @item -ml
14379 @opindex ml
14380 Compile code for the processor in little endian mode.
14381
14382 @item -mdalign
14383 @opindex mdalign
14384 Align doubles at 64-bit boundaries.  Note that this changes the calling
14385 conventions, and thus some functions from the standard C library will
14386 not work unless you recompile it first with @option{-mdalign}.
14387
14388 @item -mrelax
14389 @opindex mrelax
14390 Shorten some address references at link time, when possible; uses the
14391 linker option @option{-relax}.
14392
14393 @item -mbigtable
14394 @opindex mbigtable
14395 Use 32-bit offsets in @code{switch} tables.  The default is to use
14396 16-bit offsets.
14397
14398 @item -mbitops
14399 @opindex mbitops
14400 Enable the use of bit manipulation instructions on SH2A.
14401
14402 @item -mfmovd
14403 @opindex mfmovd
14404 Enable the use of the instruction @code{fmovd}.
14405
14406 @item -mhitachi
14407 @opindex mhitachi
14408 Comply with the calling conventions defined by Renesas.
14409
14410 @item -mrenesas
14411 @opindex mhitachi
14412 Comply with the calling conventions defined by Renesas.
14413
14414 @item -mno-renesas
14415 @opindex mhitachi
14416 Comply with the calling conventions defined for GCC before the Renesas
14417 conventions were available.  This option is the default for all
14418 targets of the SH toolchain except for @samp{sh-symbianelf}.
14419
14420 @item -mnomacsave
14421 @opindex mnomacsave
14422 Mark the @code{MAC} register as call-clobbered, even if
14423 @option{-mhitachi} is given.
14424
14425 @item -mieee
14426 @opindex mieee
14427 Increase IEEE-compliance of floating-point code.
14428 At the moment, this is equivalent to @option{-fno-finite-math-only}.
14429 When generating 16 bit SH opcodes, getting IEEE-conforming results for
14430 comparisons of NANs / infinities incurs extra overhead in every
14431 floating point comparison, therefore the default is set to
14432 @option{-ffinite-math-only}.
14433
14434 @item -minline-ic_invalidate
14435 @opindex minline-ic_invalidate
14436 Inline code to invalidate instruction cache entries after setting up
14437 nested function trampolines.
14438 This option has no effect if -musermode is in effect and the selected
14439 code generation option (e.g. -m4) does not allow the use of the icbi
14440 instruction.
14441 If the selected code generation option does not allow the use of the icbi
14442 instruction, and -musermode is not in effect, the inlined code will
14443 manipulate the instruction cache address array directly with an associative
14444 write.  This not only requires privileged mode, but it will also
14445 fail if the cache line had been mapped via the TLB and has become unmapped.
14446
14447 @item -misize
14448 @opindex misize
14449 Dump instruction size and location in the assembly code.
14450
14451 @item -mpadstruct
14452 @opindex mpadstruct
14453 This option is deprecated.  It pads structures to multiple of 4 bytes,
14454 which is incompatible with the SH ABI@.
14455
14456 @item -mspace
14457 @opindex mspace
14458 Optimize for space instead of speed.  Implied by @option{-Os}.
14459
14460 @item -mprefergot
14461 @opindex mprefergot
14462 When generating position-independent code, emit function calls using
14463 the Global Offset Table instead of the Procedure Linkage Table.
14464
14465 @item -musermode
14466 @opindex musermode
14467 Don't generate privileged mode only code; implies -mno-inline-ic_invalidate
14468 if the inlined code would not work in user mode.
14469 This is the default when the target is @code{sh-*-linux*}.
14470
14471 @item -multcost=@var{number}
14472 @opindex multcost=@var{number}
14473 Set the cost to assume for a multiply insn.
14474
14475 @item -mdiv=@var{strategy}
14476 @opindex mdiv=@var{strategy}
14477 Set the division strategy to use for SHmedia code.  @var{strategy} must be
14478 one of: call, call2, fp, inv, inv:minlat, inv20u, inv20l, inv:call,
14479 inv:call2, inv:fp .
14480 "fp" performs the operation in floating point.  This has a very high latency,
14481 but needs only a few instructions, so it might be a good choice if
14482 your code has enough easily exploitable ILP to allow the compiler to
14483 schedule the floating point instructions together with other instructions.
14484 Division by zero causes a floating point exception.
14485 "inv" uses integer operations to calculate the inverse of the divisor,
14486 and then multiplies the dividend with the inverse.  This strategy allows
14487 cse and hoisting of the inverse calculation.  Division by zero calculates
14488 an unspecified result, but does not trap.
14489 "inv:minlat" is a variant of "inv" where if no cse / hoisting opportunities
14490 have been found, or if the entire operation has been hoisted to the same
14491 place, the last stages of the inverse calculation are intertwined with the
14492 final multiply to reduce the overall latency, at the expense of using a few
14493 more instructions, and thus offering fewer scheduling opportunities with
14494 other code.
14495 "call" calls a library function that usually implements the inv:minlat
14496 strategy.
14497 This gives high code density for m5-*media-nofpu compilations.
14498 "call2" uses a different entry point of the same library function, where it
14499 assumes that a pointer to a lookup table has already been set up, which
14500 exposes the pointer load to cse / code hoisting optimizations.
14501 "inv:call", "inv:call2" and "inv:fp" all use the "inv" algorithm for initial
14502 code generation, but if the code stays unoptimized, revert to the "call",
14503 "call2", or "fp" strategies, respectively.  Note that the
14504 potentially-trapping side effect of division by zero is carried by a
14505 separate instruction, so it is possible that all the integer instructions
14506 are hoisted out, but the marker for the side effect stays where it is.
14507 A recombination to fp operations or a call is not possible in that case.
14508 "inv20u" and "inv20l" are variants of the "inv:minlat" strategy.  In the case
14509 that the inverse calculation was nor separated from the multiply, they speed
14510 up division where the dividend fits into 20 bits (plus sign where applicable),
14511 by inserting a test to skip a number of operations in this case; this test
14512 slows down the case of larger dividends.  inv20u assumes the case of a such
14513 a small dividend to be unlikely, and inv20l assumes it to be likely.
14514
14515 @item -mdivsi3_libfunc=@var{name}
14516 @opindex mdivsi3_libfunc=@var{name}
14517 Set the name of the library function used for 32 bit signed division to
14518 @var{name}.  This only affect the name used in the call and inv:call
14519 division strategies, and the compiler will still expect the same
14520 sets of input/output/clobbered registers as if this option was not present.
14521
14522 @item -mfixed-range=@var{register-range}
14523 @opindex mfixed-range
14524 Generate code treating the given register range as fixed registers.
14525 A fixed register is one that the register allocator can not use.  This is
14526 useful when compiling kernel code.  A register range is specified as
14527 two registers separated by a dash.  Multiple register ranges can be
14528 specified separated by a comma.
14529
14530 @item -madjust-unroll
14531 @opindex madjust-unroll
14532 Throttle unrolling to avoid thrashing target registers.
14533 This option only has an effect if the gcc code base supports the
14534 TARGET_ADJUST_UNROLL_MAX target hook.
14535
14536 @item -mindexed-addressing
14537 @opindex mindexed-addressing
14538 Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
14539 This is only safe if the hardware and/or OS implement 32 bit wrap-around
14540 semantics for the indexed addressing mode.  The architecture allows the
14541 implementation of processors with 64 bit MMU, which the OS could use to
14542 get 32 bit addressing, but since no current hardware implementation supports
14543 this or any other way to make the indexed addressing mode safe to use in
14544 the 32 bit ABI, the default is -mno-indexed-addressing.
14545
14546 @item -mgettrcost=@var{number}
14547 @opindex mgettrcost=@var{number}
14548 Set the cost assumed for the gettr instruction to @var{number}.
14549 The default is 2 if @option{-mpt-fixed} is in effect, 100 otherwise.
14550
14551 @item -mpt-fixed
14552 @opindex mpt-fixed
14553 Assume pt* instructions won't trap.  This will generally generate better
14554 scheduled code, but is unsafe on current hardware.  The current architecture
14555 definition says that ptabs and ptrel trap when the target anded with 3 is 3.
14556 This has the unintentional effect of making it unsafe to schedule ptabs /
14557 ptrel before a branch, or hoist it out of a loop.  For example,
14558 __do_global_ctors, a part of libgcc that runs constructors at program
14559 startup, calls functions in a list which is delimited by @minus{}1.  With the
14560 -mpt-fixed option, the ptabs will be done before testing against @minus{}1.
14561 That means that all the constructors will be run a bit quicker, but when
14562 the loop comes to the end of the list, the program crashes because ptabs
14563 loads @minus{}1 into a target register.  Since this option is unsafe for any
14564 hardware implementing the current architecture specification, the default
14565 is -mno-pt-fixed.  Unless the user specifies a specific cost with
14566 @option{-mgettrcost}, -mno-pt-fixed also implies @option{-mgettrcost=100};
14567 this deters register allocation using target registers for storing
14568 ordinary integers.
14569
14570 @item -minvalid-symbols
14571 @opindex minvalid-symbols
14572 Assume symbols might be invalid.  Ordinary function symbols generated by
14573 the compiler will always be valid to load with movi/shori/ptabs or
14574 movi/shori/ptrel, but with assembler and/or linker tricks it is possible
14575 to generate symbols that will cause ptabs / ptrel to trap.
14576 This option is only meaningful when @option{-mno-pt-fixed} is in effect.
14577 It will then prevent cross-basic-block cse, hoisting and most scheduling
14578 of symbol loads.  The default is @option{-mno-invalid-symbols}.
14579 @end table
14580
14581 @node SPARC Options
14582 @subsection SPARC Options
14583 @cindex SPARC options
14584
14585 These @samp{-m} options are supported on the SPARC:
14586
14587 @table @gcctabopt
14588 @item -mno-app-regs
14589 @itemx -mapp-regs
14590 @opindex mno-app-regs
14591 @opindex mapp-regs
14592 Specify @option{-mapp-regs} to generate output using the global registers
14593 2 through 4, which the SPARC SVR4 ABI reserves for applications.  This
14594 is the default.
14595
14596 To be fully SVR4 ABI compliant at the cost of some performance loss,
14597 specify @option{-mno-app-regs}.  You should compile libraries and system
14598 software with this option.
14599
14600 @item -mfpu
14601 @itemx -mhard-float
14602 @opindex mfpu
14603 @opindex mhard-float
14604 Generate output containing floating point instructions.  This is the
14605 default.
14606
14607 @item -mno-fpu
14608 @itemx -msoft-float
14609 @opindex mno-fpu
14610 @opindex msoft-float
14611 Generate output containing library calls for floating point.
14612 @strong{Warning:} the requisite libraries are not available for all SPARC
14613 targets.  Normally the facilities of the machine's usual C compiler are
14614 used, but this cannot be done directly in cross-compilation.  You must make
14615 your own arrangements to provide suitable library functions for
14616 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
14617 @samp{sparclite-*-*} do provide software floating point support.
14618
14619 @option{-msoft-float} changes the calling convention in the output file;
14620 therefore, it is only useful if you compile @emph{all} of a program with
14621 this option.  In particular, you need to compile @file{libgcc.a}, the
14622 library that comes with GCC, with @option{-msoft-float} in order for
14623 this to work.
14624
14625 @item -mhard-quad-float
14626 @opindex mhard-quad-float
14627 Generate output containing quad-word (long double) floating point
14628 instructions.
14629
14630 @item -msoft-quad-float
14631 @opindex msoft-quad-float
14632 Generate output containing library calls for quad-word (long double)
14633 floating point instructions.  The functions called are those specified
14634 in the SPARC ABI@.  This is the default.
14635
14636 As of this writing, there are no SPARC implementations that have hardware
14637 support for the quad-word floating point instructions.  They all invoke
14638 a trap handler for one of these instructions, and then the trap handler
14639 emulates the effect of the instruction.  Because of the trap handler overhead,
14640 this is much slower than calling the ABI library routines.  Thus the
14641 @option{-msoft-quad-float} option is the default.
14642
14643 @item -mno-unaligned-doubles
14644 @itemx -munaligned-doubles
14645 @opindex mno-unaligned-doubles
14646 @opindex munaligned-doubles
14647 Assume that doubles have 8 byte alignment.  This is the default.
14648
14649 With @option{-munaligned-doubles}, GCC assumes that doubles have 8 byte
14650 alignment only if they are contained in another type, or if they have an
14651 absolute address.  Otherwise, it assumes they have 4 byte alignment.
14652 Specifying this option avoids some rare compatibility problems with code
14653 generated by other compilers.  It is not the default because it results
14654 in a performance loss, especially for floating point code.
14655
14656 @item -mno-faster-structs
14657 @itemx -mfaster-structs
14658 @opindex mno-faster-structs
14659 @opindex mfaster-structs
14660 With @option{-mfaster-structs}, the compiler assumes that structures
14661 should have 8 byte alignment.  This enables the use of pairs of
14662 @code{ldd} and @code{std} instructions for copies in structure
14663 assignment, in place of twice as many @code{ld} and @code{st} pairs.
14664 However, the use of this changed alignment directly violates the SPARC
14665 ABI@.  Thus, it's intended only for use on targets where the developer
14666 acknowledges that their resulting code will not be directly in line with
14667 the rules of the ABI@.
14668
14669 @item -mimpure-text
14670 @opindex mimpure-text
14671 @option{-mimpure-text}, used in addition to @option{-shared}, tells
14672 the compiler to not pass @option{-z text} to the linker when linking a
14673 shared object.  Using this option, you can link position-dependent
14674 code into a shared object.
14675
14676 @option{-mimpure-text} suppresses the ``relocations remain against
14677 allocatable but non-writable sections'' linker error message.
14678 However, the necessary relocations will trigger copy-on-write, and the
14679 shared object is not actually shared across processes.  Instead of
14680 using @option{-mimpure-text}, you should compile all source code with
14681 @option{-fpic} or @option{-fPIC}.
14682
14683 This option is only available on SunOS and Solaris.
14684
14685 @item -mcpu=@var{cpu_type}
14686 @opindex mcpu
14687 Set the instruction set, register set, and instruction scheduling parameters
14688 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
14689 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{sparclite},
14690 @samp{f930}, @samp{f934}, @samp{hypersparc}, @samp{sparclite86x},
14691 @samp{sparclet}, @samp{tsc701}, @samp{v9}, @samp{ultrasparc},
14692 @samp{ultrasparc3}, @samp{niagara} and @samp{niagara2}.
14693
14694 Default instruction scheduling parameters are used for values that select
14695 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
14696 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
14697
14698 Here is a list of each supported architecture and their supported
14699 implementations.
14700
14701 @smallexample
14702     v7:             cypress
14703     v8:             supersparc, hypersparc
14704     sparclite:      f930, f934, sparclite86x
14705     sparclet:       tsc701
14706     v9:             ultrasparc, ultrasparc3, niagara, niagara2
14707 @end smallexample
14708
14709 By default (unless configured otherwise), GCC generates code for the V7
14710 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
14711 additionally optimizes it for the Cypress CY7C602 chip, as used in the
14712 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
14713 SPARCStation 1, 2, IPX etc.
14714
14715 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
14716 architecture.  The only difference from V7 code is that the compiler emits
14717 the integer multiply and integer divide instructions which exist in SPARC-V8
14718 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
14719 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
14720 2000 series.
14721
14722 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
14723 the SPARC architecture.  This adds the integer multiply, integer divide step
14724 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
14725 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
14726 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
14727 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
14728 MB86934 chip, which is the more recent SPARClite with FPU@.
14729
14730 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
14731 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
14732 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
14733 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
14734 optimizes it for the TEMIC SPARClet chip.
14735
14736 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
14737 architecture.  This adds 64-bit integer and floating-point move instructions,
14738 3 additional floating-point condition code registers and conditional move
14739 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
14740 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
14741 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
14742 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
14743 @option{-mcpu=niagara}, the compiler additionally optimizes it for
14744 Sun UltraSPARC T1 chips.  With @option{-mcpu=niagara2}, the compiler
14745 additionally optimizes it for Sun UltraSPARC T2 chips.
14746
14747 @item -mtune=@var{cpu_type}
14748 @opindex mtune
14749 Set the instruction scheduling parameters for machine type
14750 @var{cpu_type}, but do not set the instruction set or register set that the
14751 option @option{-mcpu=@var{cpu_type}} would.
14752
14753 The same values for @option{-mcpu=@var{cpu_type}} can be used for
14754 @option{-mtune=@var{cpu_type}}, but the only useful values are those
14755 that select a particular cpu implementation.  Those are @samp{cypress},
14756 @samp{supersparc}, @samp{hypersparc}, @samp{f930}, @samp{f934},
14757 @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc},
14758 @samp{ultrasparc3}, @samp{niagara}, and @samp{niagara2}.
14759
14760 @item -mv8plus
14761 @itemx -mno-v8plus
14762 @opindex mv8plus
14763 @opindex mno-v8plus
14764 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
14765 difference from the V8 ABI is that the global and out registers are
14766 considered 64-bit wide.  This is enabled by default on Solaris in 32-bit
14767 mode for all SPARC-V9 processors.
14768
14769 @item -mvis
14770 @itemx -mno-vis
14771 @opindex mvis
14772 @opindex mno-vis
14773 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
14774 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
14775 @end table
14776
14777 These @samp{-m} options are supported in addition to the above
14778 on SPARC-V9 processors in 64-bit environments:
14779
14780 @table @gcctabopt
14781 @item -mlittle-endian
14782 @opindex mlittle-endian
14783 Generate code for a processor running in little-endian mode.  It is only
14784 available for a few configurations and most notably not on Solaris and Linux.
14785
14786 @item -m32
14787 @itemx -m64
14788 @opindex m32
14789 @opindex m64
14790 Generate code for a 32-bit or 64-bit environment.
14791 The 32-bit environment sets int, long and pointer to 32 bits.
14792 The 64-bit environment sets int to 32 bits and long and pointer
14793 to 64 bits.
14794
14795 @item -mcmodel=medlow
14796 @opindex mcmodel=medlow
14797 Generate code for the Medium/Low code model: 64-bit addresses, programs
14798 must be linked in the low 32 bits of memory.  Programs can be statically
14799 or dynamically linked.
14800
14801 @item -mcmodel=medmid
14802 @opindex mcmodel=medmid
14803 Generate code for the Medium/Middle code model: 64-bit addresses, programs
14804 must be linked in the low 44 bits of memory, the text and data segments must
14805 be less than 2GB in size and the data segment must be located within 2GB of
14806 the text segment.
14807
14808 @item -mcmodel=medany
14809 @opindex mcmodel=medany
14810 Generate code for the Medium/Anywhere code model: 64-bit addresses, programs
14811 may be linked anywhere in memory, the text and data segments must be less
14812 than 2GB in size and the data segment must be located within 2GB of the
14813 text segment.
14814
14815 @item -mcmodel=embmedany
14816 @opindex mcmodel=embmedany
14817 Generate code for the Medium/Anywhere code model for embedded systems:
14818 64-bit addresses, the text and data segments must be less than 2GB in
14819 size, both starting anywhere in memory (determined at link time).  The
14820 global register %g4 points to the base of the data segment.  Programs
14821 are statically linked and PIC is not supported.
14822
14823 @item -mstack-bias
14824 @itemx -mno-stack-bias
14825 @opindex mstack-bias
14826 @opindex mno-stack-bias
14827 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
14828 frame pointer if present, are offset by @minus{}2047 which must be added back
14829 when making stack frame references.  This is the default in 64-bit mode.
14830 Otherwise, assume no such offset is present.
14831 @end table
14832
14833 These switches are supported in addition to the above on Solaris:
14834
14835 @table @gcctabopt
14836 @item -threads
14837 @opindex threads
14838 Add support for multithreading using the Solaris threads library.  This
14839 option sets flags for both the preprocessor and linker.  This option does
14840 not affect the thread safety of object code produced by the compiler or
14841 that of libraries supplied with it.
14842
14843 @item -pthreads
14844 @opindex pthreads
14845 Add support for multithreading using the POSIX threads library.  This
14846 option sets flags for both the preprocessor and linker.  This option does
14847 not affect the thread safety of object code produced  by the compiler or
14848 that of libraries supplied with it.
14849
14850 @item -pthread
14851 @opindex pthread
14852 This is a synonym for @option{-pthreads}.
14853 @end table
14854
14855 @node SPU Options
14856 @subsection SPU Options
14857 @cindex SPU options
14858
14859 These @samp{-m} options are supported on the SPU:
14860
14861 @table @gcctabopt
14862 @item -mwarn-reloc
14863 @itemx -merror-reloc
14864 @opindex mwarn-reloc
14865 @opindex merror-reloc
14866
14867 The loader for SPU does not handle dynamic relocations.  By default, GCC
14868 will give an error when it generates code that requires a dynamic
14869 relocation.  @option{-mno-error-reloc} disables the error,
14870 @option{-mwarn-reloc} will generate a warning instead.
14871
14872 @item -msafe-dma
14873 @itemx -munsafe-dma
14874 @opindex msafe-dma
14875 @opindex munsafe-dma
14876
14877 Instructions which initiate or test completion of DMA must not be
14878 reordered with respect to loads and stores of the memory which is being
14879 accessed.  Users typically address this problem using the volatile
14880 keyword, but that can lead to inefficient code in places where the
14881 memory is known to not change.  Rather than mark the memory as volatile
14882 we treat the DMA instructions as potentially effecting all memory.  With
14883 @option{-munsafe-dma} users must use the volatile keyword to protect
14884 memory accesses.
14885
14886 @item -mbranch-hints
14887 @opindex mbranch-hints
14888
14889 By default, GCC will generate a branch hint instruction to avoid
14890 pipeline stalls for always taken or probably taken branches.  A hint
14891 will not be generated closer than 8 instructions away from its branch.
14892 There is little reason to disable them, except for debugging purposes,
14893 or to make an object a little bit smaller.
14894
14895 @item -msmall-mem
14896 @itemx -mlarge-mem
14897 @opindex msmall-mem
14898 @opindex mlarge-mem
14899
14900 By default, GCC generates code assuming that addresses are never larger
14901 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
14902 a full 32 bit address.
14903
14904 @item -mstdmain
14905 @opindex mstdmain
14906
14907 By default, GCC links against startup code that assumes the SPU-style
14908 main function interface (which has an unconventional parameter list).
14909 With @option{-mstdmain}, GCC will link your program against startup
14910 code that assumes a C99-style interface to @code{main}, including a
14911 local copy of @code{argv} strings.
14912
14913 @item -mfixed-range=@var{register-range}
14914 @opindex mfixed-range
14915 Generate code treating the given register range as fixed registers.
14916 A fixed register is one that the register allocator can not use.  This is
14917 useful when compiling kernel code.  A register range is specified as
14918 two registers separated by a dash.  Multiple register ranges can be
14919 specified separated by a comma.
14920
14921 @item -mdual-nops
14922 @itemx -mdual-nops=@var{n}
14923 @opindex mdual-nops
14924 By default, GCC will insert nops to increase dual issue when it expects
14925 it to increase performance.  @var{n} can be a value from 0 to 10.  A
14926 smaller @var{n} will insert fewer nops.  10 is the default, 0 is the
14927 same as @option{-mno-dual-nops}.  Disabled with @option{-Os}.
14928
14929 @item -mhint-max-nops=@var{n}
14930 @opindex mhint-max-nops
14931 Maximum number of nops to insert for a branch hint.  A branch hint must
14932 be at least 8 instructions away from the branch it is effecting.  GCC
14933 will insert up to @var{n} nops to enforce this, otherwise it will not
14934 generate the branch hint.
14935
14936 @item -mhint-max-distance=@var{n}
14937 @opindex mhint-max-distance
14938 The encoding of the branch hint instruction limits the hint to be within
14939 256 instructions of the branch it is effecting.  By default, GCC makes
14940 sure it is within 125. 
14941
14942 @item -msafe-hints
14943 @opindex msafe-hints
14944 Work around a hardware bug which causes the SPU to stall indefinitely.
14945 By default, GCC will insert the @code{hbrp} instruction to make sure
14946 this stall won't happen.
14947
14948 @end table
14949
14950 @node System V Options
14951 @subsection Options for System V
14952
14953 These additional options are available on System V Release 4 for
14954 compatibility with other compilers on those systems:
14955
14956 @table @gcctabopt
14957 @item -G
14958 @opindex G
14959 Create a shared object.
14960 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
14961
14962 @item -Qy
14963 @opindex Qy
14964 Identify the versions of each tool used by the compiler, in a
14965 @code{.ident} assembler directive in the output.
14966
14967 @item -Qn
14968 @opindex Qn
14969 Refrain from adding @code{.ident} directives to the output file (this is
14970 the default).
14971
14972 @item -YP,@var{dirs}
14973 @opindex YP
14974 Search the directories @var{dirs}, and no others, for libraries
14975 specified with @option{-l}.
14976
14977 @item -Ym,@var{dir}
14978 @opindex Ym
14979 Look in the directory @var{dir} to find the M4 preprocessor.
14980 The assembler uses this option.
14981 @c This is supposed to go with a -Yd for predefined M4 macro files, but
14982 @c the generic assembler that comes with Solaris takes just -Ym.
14983 @end table
14984
14985 @node V850 Options
14986 @subsection V850 Options
14987 @cindex V850 Options
14988
14989 These @samp{-m} options are defined for V850 implementations:
14990
14991 @table @gcctabopt
14992 @item -mlong-calls
14993 @itemx -mno-long-calls
14994 @opindex mlong-calls
14995 @opindex mno-long-calls
14996 Treat all calls as being far away (near).  If calls are assumed to be
14997 far away, the compiler will always load the functions address up into a
14998 register, and call indirect through the pointer.
14999
15000 @item -mno-ep
15001 @itemx -mep
15002 @opindex mno-ep
15003 @opindex mep
15004 Do not optimize (do optimize) basic blocks that use the same index
15005 pointer 4 or more times to copy pointer into the @code{ep} register, and
15006 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
15007 option is on by default if you optimize.
15008
15009 @item -mno-prolog-function
15010 @itemx -mprolog-function
15011 @opindex mno-prolog-function
15012 @opindex mprolog-function
15013 Do not use (do use) external functions to save and restore registers
15014 at the prologue and epilogue of a function.  The external functions
15015 are slower, but use less code space if more than one function saves
15016 the same number of registers.  The @option{-mprolog-function} option
15017 is on by default if you optimize.
15018
15019 @item -mspace
15020 @opindex mspace
15021 Try to make the code as small as possible.  At present, this just turns
15022 on the @option{-mep} and @option{-mprolog-function} options.
15023
15024 @item -mtda=@var{n}
15025 @opindex mtda
15026 Put static or global variables whose size is @var{n} bytes or less into
15027 the tiny data area that register @code{ep} points to.  The tiny data
15028 area can hold up to 256 bytes in total (128 bytes for byte references).
15029
15030 @item -msda=@var{n}
15031 @opindex msda
15032 Put static or global variables whose size is @var{n} bytes or less into
15033 the small data area that register @code{gp} points to.  The small data
15034 area can hold up to 64 kilobytes.
15035
15036 @item -mzda=@var{n}
15037 @opindex mzda
15038 Put static or global variables whose size is @var{n} bytes or less into
15039 the first 32 kilobytes of memory.
15040
15041 @item -mv850
15042 @opindex mv850
15043 Specify that the target processor is the V850.
15044
15045 @item -mbig-switch
15046 @opindex mbig-switch
15047 Generate code suitable for big switch tables.  Use this option only if
15048 the assembler/linker complain about out of range branches within a switch
15049 table.
15050
15051 @item -mapp-regs
15052 @opindex mapp-regs
15053 This option will cause r2 and r5 to be used in the code generated by
15054 the compiler.  This setting is the default.
15055
15056 @item -mno-app-regs
15057 @opindex mno-app-regs
15058 This option will cause r2 and r5 to be treated as fixed registers.
15059
15060 @item -mv850e1
15061 @opindex mv850e1
15062 Specify that the target processor is the V850E1.  The preprocessor
15063 constants @samp{__v850e1__} and @samp{__v850e__} will be defined if
15064 this option is used.
15065
15066 @item -mv850e
15067 @opindex mv850e
15068 Specify that the target processor is the V850E@.  The preprocessor
15069 constant @samp{__v850e__} will be defined if this option is used.
15070
15071 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
15072 are defined then a default target processor will be chosen and the
15073 relevant @samp{__v850*__} preprocessor constant will be defined.
15074
15075 The preprocessor constants @samp{__v850} and @samp{__v851__} are always
15076 defined, regardless of which processor variant is the target.
15077
15078 @item -mdisable-callt
15079 @opindex mdisable-callt
15080 This option will suppress generation of the CALLT instruction for the
15081 v850e and v850e1 flavors of the v850 architecture.  The default is
15082 @option{-mno-disable-callt} which allows the CALLT instruction to be used.
15083
15084 @end table
15085
15086 @node VAX Options
15087 @subsection VAX Options
15088 @cindex VAX options
15089
15090 These @samp{-m} options are defined for the VAX:
15091
15092 @table @gcctabopt
15093 @item -munix
15094 @opindex munix
15095 Do not output certain jump instructions (@code{aobleq} and so on)
15096 that the Unix assembler for the VAX cannot handle across long
15097 ranges.
15098
15099 @item -mgnu
15100 @opindex mgnu
15101 Do output those jump instructions, on the assumption that you
15102 will assemble with the GNU assembler.
15103
15104 @item -mg
15105 @opindex mg
15106 Output code for g-format floating point numbers instead of d-format.
15107 @end table
15108
15109 @node VxWorks Options
15110 @subsection VxWorks Options
15111 @cindex VxWorks Options
15112
15113 The options in this section are defined for all VxWorks targets.
15114 Options specific to the target hardware are listed with the other
15115 options for that target.
15116
15117 @table @gcctabopt
15118 @item -mrtp
15119 @opindex mrtp
15120 GCC can generate code for both VxWorks kernels and real time processes
15121 (RTPs).  This option switches from the former to the latter.  It also
15122 defines the preprocessor macro @code{__RTP__}.
15123
15124 @item -non-static
15125 @opindex non-static
15126 Link an RTP executable against shared libraries rather than static
15127 libraries.  The options @option{-static} and @option{-shared} can
15128 also be used for RTPs (@pxref{Link Options}); @option{-static}
15129 is the default.
15130
15131 @item -Bstatic
15132 @itemx -Bdynamic
15133 @opindex Bstatic
15134 @opindex Bdynamic
15135 These options are passed down to the linker.  They are defined for
15136 compatibility with Diab.
15137
15138 @item -Xbind-lazy
15139 @opindex Xbind-lazy
15140 Enable lazy binding of function calls.  This option is equivalent to
15141 @option{-Wl,-z,now} and is defined for compatibility with Diab.
15142
15143 @item -Xbind-now
15144 @opindex Xbind-now
15145 Disable lazy binding of function calls.  This option is the default and
15146 is defined for compatibility with Diab.
15147 @end table
15148
15149 @node x86-64 Options
15150 @subsection x86-64 Options
15151 @cindex x86-64 options
15152
15153 These are listed under @xref{i386 and x86-64 Options}.
15154
15155 @node Xstormy16 Options
15156 @subsection Xstormy16 Options
15157 @cindex Xstormy16 Options
15158
15159 These options are defined for Xstormy16:
15160
15161 @table @gcctabopt
15162 @item -msim
15163 @opindex msim
15164 Choose startup files and linker script suitable for the simulator.
15165 @end table
15166
15167 @node Xtensa Options
15168 @subsection Xtensa Options
15169 @cindex Xtensa Options
15170
15171 These options are supported for Xtensa targets:
15172
15173 @table @gcctabopt
15174 @item -mconst16
15175 @itemx -mno-const16
15176 @opindex mconst16
15177 @opindex mno-const16
15178 Enable or disable use of @code{CONST16} instructions for loading
15179 constant values.  The @code{CONST16} instruction is currently not a
15180 standard option from Tensilica.  When enabled, @code{CONST16}
15181 instructions are always used in place of the standard @code{L32R}
15182 instructions.  The use of @code{CONST16} is enabled by default only if
15183 the @code{L32R} instruction is not available.
15184
15185 @item -mfused-madd
15186 @itemx -mno-fused-madd
15187 @opindex mfused-madd
15188 @opindex mno-fused-madd
15189 Enable or disable use of fused multiply/add and multiply/subtract
15190 instructions in the floating-point option.  This has no effect if the
15191 floating-point option is not also enabled.  Disabling fused multiply/add
15192 and multiply/subtract instructions forces the compiler to use separate
15193 instructions for the multiply and add/subtract operations.  This may be
15194 desirable in some cases where strict IEEE 754-compliant results are
15195 required: the fused multiply add/subtract instructions do not round the
15196 intermediate result, thereby producing results with @emph{more} bits of
15197 precision than specified by the IEEE standard.  Disabling fused multiply
15198 add/subtract instructions also ensures that the program output is not
15199 sensitive to the compiler's ability to combine multiply and add/subtract
15200 operations.
15201
15202 @item -mserialize-volatile
15203 @itemx -mno-serialize-volatile
15204 @opindex mserialize-volatile
15205 @opindex mno-serialize-volatile
15206 When this option is enabled, GCC inserts @code{MEMW} instructions before
15207 @code{volatile} memory references to guarantee sequential consistency.
15208 The default is @option{-mserialize-volatile}.  Use
15209 @option{-mno-serialize-volatile} to omit the @code{MEMW} instructions.
15210
15211 @item -mtext-section-literals
15212 @itemx -mno-text-section-literals
15213 @opindex mtext-section-literals
15214 @opindex mno-text-section-literals
15215 Control the treatment of literal pools.  The default is
15216 @option{-mno-text-section-literals}, which places literals in a separate
15217 section in the output file.  This allows the literal pool to be placed
15218 in a data RAM/ROM, and it also allows the linker to combine literal
15219 pools from separate object files to remove redundant literals and
15220 improve code size.  With @option{-mtext-section-literals}, the literals
15221 are interspersed in the text section in order to keep them as close as
15222 possible to their references.  This may be necessary for large assembly
15223 files.
15224
15225 @item -mtarget-align
15226 @itemx -mno-target-align
15227 @opindex mtarget-align
15228 @opindex mno-target-align
15229 When this option is enabled, GCC instructs the assembler to
15230 automatically align instructions to reduce branch penalties at the
15231 expense of some code density.  The assembler attempts to widen density
15232 instructions to align branch targets and the instructions following call
15233 instructions.  If there are not enough preceding safe density
15234 instructions to align a target, no widening will be performed.  The
15235 default is @option{-mtarget-align}.  These options do not affect the
15236 treatment of auto-aligned instructions like @code{LOOP}, which the
15237 assembler will always align, either by widening density instructions or
15238 by inserting no-op instructions.
15239
15240 @item -mlongcalls
15241 @itemx -mno-longcalls
15242 @opindex mlongcalls
15243 @opindex mno-longcalls
15244 When this option is enabled, GCC instructs the assembler to translate
15245 direct calls to indirect calls unless it can determine that the target
15246 of a direct call is in the range allowed by the call instruction.  This
15247 translation typically occurs for calls to functions in other source
15248 files.  Specifically, the assembler translates a direct @code{CALL}
15249 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
15250 The default is @option{-mno-longcalls}.  This option should be used in
15251 programs where the call target can potentially be out of range.  This
15252 option is implemented in the assembler, not the compiler, so the
15253 assembly code generated by GCC will still show direct call
15254 instructions---look at the disassembled object code to see the actual
15255 instructions.  Note that the assembler will use an indirect call for
15256 every cross-file call, not just those that really will be out of range.
15257 @end table
15258
15259 @node zSeries Options
15260 @subsection zSeries Options
15261 @cindex zSeries options
15262
15263 These are listed under @xref{S/390 and zSeries Options}.
15264
15265 @node Code Gen Options
15266 @section Options for Code Generation Conventions
15267 @cindex code generation conventions
15268 @cindex options, code generation
15269 @cindex run-time options
15270
15271 These machine-independent options control the interface conventions
15272 used in code generation.
15273
15274 Most of them have both positive and negative forms; the negative form
15275 of @option{-ffoo} would be @option{-fno-foo}.  In the table below, only
15276 one of the forms is listed---the one which is not the default.  You
15277 can figure out the other form by either removing @samp{no-} or adding
15278 it.
15279
15280 @table @gcctabopt
15281 @item -fbounds-check
15282 @opindex fbounds-check
15283 For front-ends that support it, generate additional code to check that
15284 indices used to access arrays are within the declared range.  This is
15285 currently only supported by the Java and Fortran front-ends, where
15286 this option defaults to true and false respectively.
15287
15288 @item -ftrapv
15289 @opindex ftrapv
15290 This option generates traps for signed overflow on addition, subtraction,
15291 multiplication operations.
15292
15293 @item -fwrapv
15294 @opindex fwrapv
15295 This option instructs the compiler to assume that signed arithmetic
15296 overflow of addition, subtraction and multiplication wraps around
15297 using twos-complement representation.  This flag enables some optimizations
15298 and disables others.  This option is enabled by default for the Java
15299 front-end, as required by the Java language specification.
15300
15301 @item -fexceptions
15302 @opindex fexceptions
15303 Enable exception handling.  Generates extra code needed to propagate
15304 exceptions.  For some targets, this implies GCC will generate frame
15305 unwind information for all functions, which can produce significant data
15306 size overhead, although it does not affect execution.  If you do not
15307 specify this option, GCC will enable it by default for languages like
15308 C++ which normally require exception handling, and disable it for
15309 languages like C that do not normally require it.  However, you may need
15310 to enable this option when compiling C code that needs to interoperate
15311 properly with exception handlers written in C++.  You may also wish to
15312 disable this option if you are compiling older C++ programs that don't
15313 use exception handling.
15314
15315 @item -fnon-call-exceptions
15316 @opindex fnon-call-exceptions
15317 Generate code that allows trapping instructions to throw exceptions.
15318 Note that this requires platform-specific runtime support that does
15319 not exist everywhere.  Moreover, it only allows @emph{trapping}
15320 instructions to throw exceptions, i.e.@: memory references or floating
15321 point instructions.  It does not allow exceptions to be thrown from
15322 arbitrary signal handlers such as @code{SIGALRM}.
15323
15324 @item -funwind-tables
15325 @opindex funwind-tables
15326 Similar to @option{-fexceptions}, except that it will just generate any needed
15327 static data, but will not affect the generated code in any other way.
15328 You will normally not enable this option; instead, a language processor
15329 that needs this handling would enable it on your behalf.
15330
15331 @item -fasynchronous-unwind-tables
15332 @opindex fasynchronous-unwind-tables
15333 Generate unwind table in dwarf2 format, if supported by target machine.  The
15334 table is exact at each instruction boundary, so it can be used for stack
15335 unwinding from asynchronous events (such as debugger or garbage collector).
15336
15337 @item -fpcc-struct-return
15338 @opindex fpcc-struct-return
15339 Return ``short'' @code{struct} and @code{union} values in memory like
15340 longer ones, rather than in registers.  This convention is less
15341 efficient, but it has the advantage of allowing intercallability between
15342 GCC-compiled files and files compiled with other compilers, particularly
15343 the Portable C Compiler (pcc).
15344
15345 The precise convention for returning structures in memory depends
15346 on the target configuration macros.
15347
15348 Short structures and unions are those whose size and alignment match
15349 that of some integer type.
15350
15351 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
15352 switch is not binary compatible with code compiled with the
15353 @option{-freg-struct-return} switch.
15354 Use it to conform to a non-default application binary interface.
15355
15356 @item -freg-struct-return
15357 @opindex freg-struct-return
15358 Return @code{struct} and @code{union} values in registers when possible.
15359 This is more efficient for small structures than
15360 @option{-fpcc-struct-return}.
15361
15362 If you specify neither @option{-fpcc-struct-return} nor
15363 @option{-freg-struct-return}, GCC defaults to whichever convention is
15364 standard for the target.  If there is no standard convention, GCC
15365 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
15366 the principal compiler.  In those cases, we can choose the standard, and
15367 we chose the more efficient register return alternative.
15368
15369 @strong{Warning:} code compiled with the @option{-freg-struct-return}
15370 switch is not binary compatible with code compiled with the
15371 @option{-fpcc-struct-return} switch.
15372 Use it to conform to a non-default application binary interface.
15373
15374 @item -fshort-enums
15375 @opindex fshort-enums
15376 Allocate to an @code{enum} type only as many bytes as it needs for the
15377 declared range of possible values.  Specifically, the @code{enum} type
15378 will be equivalent to the smallest integer type which has enough room.
15379
15380 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
15381 code that is not binary compatible with code generated without that switch.
15382 Use it to conform to a non-default application binary interface.
15383
15384 @item -fshort-double
15385 @opindex fshort-double
15386 Use the same size for @code{double} as for @code{float}.
15387
15388 @strong{Warning:} the @option{-fshort-double} switch causes GCC to generate
15389 code that is not binary compatible with code generated without that switch.
15390 Use it to conform to a non-default application binary interface.
15391
15392 @item -fshort-wchar
15393 @opindex fshort-wchar
15394 Override the underlying type for @samp{wchar_t} to be @samp{short
15395 unsigned int} instead of the default for the target.  This option is
15396 useful for building programs to run under WINE@.
15397
15398 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
15399 code that is not binary compatible with code generated without that switch.
15400 Use it to conform to a non-default application binary interface.
15401
15402 @item -fno-common
15403 @opindex fno-common
15404 In C, allocate even uninitialized global variables in the data section of the
15405 object file, rather than generating them as common blocks.  This has the
15406 effect that if the same variable is declared (without @code{extern}) in
15407 two different compilations, you will get an error when you link them.
15408 The only reason this might be useful is if you wish to verify that the
15409 program will work on other systems which always work this way.
15410
15411 @item -fno-ident
15412 @opindex fno-ident
15413 Ignore the @samp{#ident} directive.
15414
15415 @item -finhibit-size-directive
15416 @opindex finhibit-size-directive
15417 Don't output a @code{.size} assembler directive, or anything else that
15418 would cause trouble if the function is split in the middle, and the
15419 two halves are placed at locations far apart in memory.  This option is
15420 used when compiling @file{crtstuff.c}; you should not need to use it
15421 for anything else.
15422
15423 @item -fverbose-asm
15424 @opindex fverbose-asm
15425 Put extra commentary information in the generated assembly code to
15426 make it more readable.  This option is generally only of use to those
15427 who actually need to read the generated assembly code (perhaps while
15428 debugging the compiler itself).
15429
15430 @option{-fno-verbose-asm}, the default, causes the
15431 extra information to be omitted and is useful when comparing two assembler
15432 files.
15433
15434 @item -frecord-gcc-switches
15435 @opindex frecord-gcc-switches
15436 This switch causes the command line that was used to invoke the
15437 compiler to be recorded into the object file that is being created.
15438 This switch is only implemented on some targets and the exact format
15439 of the recording is target and binary file format dependent, but it
15440 usually takes the form of a section containing ASCII text.  This
15441 switch is related to the @option{-fverbose-asm} switch, but that
15442 switch only records information in the assembler output file as
15443 comments, so it never reaches the object file.
15444
15445 @item -fpic
15446 @opindex fpic
15447 @cindex global offset table
15448 @cindex PIC
15449 Generate position-independent code (PIC) suitable for use in a shared
15450 library, if supported for the target machine.  Such code accesses all
15451 constant addresses through a global offset table (GOT)@.  The dynamic
15452 loader resolves the GOT entries when the program starts (the dynamic
15453 loader is not part of GCC; it is part of the operating system).  If
15454 the GOT size for the linked executable exceeds a machine-specific
15455 maximum size, you get an error message from the linker indicating that
15456 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
15457 instead.  (These maximums are 8k on the SPARC and 32k
15458 on the m68k and RS/6000.  The 386 has no such limit.)
15459
15460 Position-independent code requires special support, and therefore works
15461 only on certain machines.  For the 386, GCC supports PIC for System V
15462 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
15463 position-independent.
15464
15465 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
15466 are defined to 1.
15467
15468 @item -fPIC
15469 @opindex fPIC
15470 If supported for the target machine, emit position-independent code,
15471 suitable for dynamic linking and avoiding any limit on the size of the
15472 global offset table.  This option makes a difference on the m68k,
15473 PowerPC and SPARC@.
15474
15475 Position-independent code requires special support, and therefore works
15476 only on certain machines.
15477
15478 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
15479 are defined to 2.
15480
15481 @item -fpie
15482 @itemx -fPIE
15483 @opindex fpie
15484 @opindex fPIE
15485 These options are similar to @option{-fpic} and @option{-fPIC}, but
15486 generated position independent code can be only linked into executables.
15487 Usually these options are used when @option{-pie} GCC option will be
15488 used during linking.
15489
15490 @option{-fpie} and @option{-fPIE} both define the macros
15491 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
15492 for @option{-fpie} and 2 for @option{-fPIE}.
15493
15494 @item -fno-jump-tables
15495 @opindex fno-jump-tables
15496 Do not use jump tables for switch statements even where it would be
15497 more efficient than other code generation strategies.  This option is
15498 of use in conjunction with @option{-fpic} or @option{-fPIC} for
15499 building code which forms part of a dynamic linker and cannot
15500 reference the address of a jump table.  On some targets, jump tables
15501 do not require a GOT and this option is not needed.
15502
15503 @item -ffixed-@var{reg}
15504 @opindex ffixed
15505 Treat the register named @var{reg} as a fixed register; generated code
15506 should never refer to it (except perhaps as a stack pointer, frame
15507 pointer or in some other fixed role).
15508
15509 @var{reg} must be the name of a register.  The register names accepted
15510 are machine-specific and are defined in the @code{REGISTER_NAMES}
15511 macro in the machine description macro file.
15512
15513 This flag does not have a negative form, because it specifies a
15514 three-way choice.
15515
15516 @item -fcall-used-@var{reg}
15517 @opindex fcall-used
15518 Treat the register named @var{reg} as an allocable register that is
15519 clobbered by function calls.  It may be allocated for temporaries or
15520 variables that do not live across a call.  Functions compiled this way
15521 will not save and restore the register @var{reg}.
15522
15523 It is an error to used this flag with the frame pointer or stack pointer.
15524 Use of this flag for other registers that have fixed pervasive roles in
15525 the machine's execution model will produce disastrous results.
15526
15527 This flag does not have a negative form, because it specifies a
15528 three-way choice.
15529
15530 @item -fcall-saved-@var{reg}
15531 @opindex fcall-saved
15532 Treat the register named @var{reg} as an allocable register saved by
15533 functions.  It may be allocated even for temporaries or variables that
15534 live across a call.  Functions compiled this way will save and restore
15535 the register @var{reg} if they use it.
15536
15537 It is an error to used this flag with the frame pointer or stack pointer.
15538 Use of this flag for other registers that have fixed pervasive roles in
15539 the machine's execution model will produce disastrous results.
15540
15541 A different sort of disaster will result from the use of this flag for
15542 a register in which function values may be returned.
15543
15544 This flag does not have a negative form, because it specifies a
15545 three-way choice.
15546
15547 @item -fpack-struct[=@var{n}]
15548 @opindex fpack-struct
15549 Without a value specified, pack all structure members together without
15550 holes.  When a value is specified (which must be a small power of two), pack
15551 structure members according to this value, representing the maximum
15552 alignment (that is, objects with default alignment requirements larger than
15553 this will be output potentially unaligned at the next fitting location.
15554
15555 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
15556 code that is not binary compatible with code generated without that switch.
15557 Additionally, it makes the code suboptimal.
15558 Use it to conform to a non-default application binary interface.
15559
15560 @item -finstrument-functions
15561 @opindex finstrument-functions
15562 Generate instrumentation calls for entry and exit to functions.  Just
15563 after function entry and just before function exit, the following
15564 profiling functions will be called with the address of the current
15565 function and its call site.  (On some platforms,
15566 @code{__builtin_return_address} does not work beyond the current
15567 function, so the call site information may not be available to the
15568 profiling functions otherwise.)
15569
15570 @smallexample
15571 void __cyg_profile_func_enter (void *this_fn,
15572                                void *call_site);
15573 void __cyg_profile_func_exit  (void *this_fn,
15574                                void *call_site);
15575 @end smallexample
15576
15577 The first argument is the address of the start of the current function,
15578 which may be looked up exactly in the symbol table.
15579
15580 This instrumentation is also done for functions expanded inline in other
15581 functions.  The profiling calls will indicate where, conceptually, the
15582 inline function is entered and exited.  This means that addressable
15583 versions of such functions must be available.  If all your uses of a
15584 function are expanded inline, this may mean an additional expansion of
15585 code size.  If you use @samp{extern inline} in your C code, an
15586 addressable version of such functions must be provided.  (This is
15587 normally the case anyways, but if you get lucky and the optimizer always
15588 expands the functions inline, you might have gotten away without
15589 providing static copies.)
15590
15591 A function may be given the attribute @code{no_instrument_function}, in
15592 which case this instrumentation will not be done.  This can be used, for
15593 example, for the profiling functions listed above, high-priority
15594 interrupt routines, and any functions from which the profiling functions
15595 cannot safely be called (perhaps signal handlers, if the profiling
15596 routines generate output or allocate memory).
15597
15598 @item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
15599 @opindex finstrument-functions-exclude-file-list
15600
15601 Set the list of functions that are excluded from instrumentation (see
15602 the description of @code{-finstrument-functions}).  If the file that
15603 contains a function definition matches with one of @var{file}, then
15604 that function is not instrumented.  The match is done on substrings:
15605 if the @var{file} parameter is a substring of the file name, it is
15606 considered to be a match.
15607
15608 For example,
15609 @code{-finstrument-functions-exclude-file-list=/bits/stl,include/sys}
15610 will exclude any inline function defined in files whose pathnames
15611 contain @code{/bits/stl} or @code{include/sys}.
15612
15613 If, for some reason, you want to include letter @code{','} in one of
15614 @var{sym}, write @code{'\,'}. For example,
15615 @code{-finstrument-functions-exclude-file-list='\,\,tmp'}
15616 (note the single quote surrounding the option).
15617
15618 @item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{}
15619 @opindex finstrument-functions-exclude-function-list
15620
15621 This is similar to @code{-finstrument-functions-exclude-file-list},
15622 but this option sets the list of function names to be excluded from
15623 instrumentation.  The function name to be matched is its user-visible
15624 name, such as @code{vector<int> blah(const vector<int> &)}, not the
15625 internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}).  The
15626 match is done on substrings: if the @var{sym} parameter is a substring
15627 of the function name, it is considered to be a match.
15628
15629 @item -fstack-check
15630 @opindex fstack-check
15631 Generate code to verify that you do not go beyond the boundary of the
15632 stack.  You should specify this flag if you are running in an
15633 environment with multiple threads, but only rarely need to specify it in
15634 a single-threaded environment since stack overflow is automatically
15635 detected on nearly all systems if there is only one stack.
15636
15637 Note that this switch does not actually cause checking to be done; the
15638 operating system or the language runtime must do that.  The switch causes
15639 generation of code to ensure that they see the stack being extended.
15640
15641 You can additionally specify a string parameter: @code{no} means no
15642 checking, @code{generic} means force the use of old-style checking,
15643 @code{specific} means use the best checking method and is equivalent
15644 to bare @option{-fstack-check}.
15645
15646 Old-style checking is a generic mechanism that requires no specific
15647 target support in the compiler but comes with the following drawbacks:
15648
15649 @enumerate
15650 @item
15651 Modified allocation strategy for large objects: they will always be
15652 allocated dynamically if their size exceeds a fixed threshold.
15653
15654 @item
15655 Fixed limit on the size of the static frame of functions: when it is
15656 topped by a particular function, stack checking is not reliable and
15657 a warning is issued by the compiler.
15658
15659 @item
15660 Inefficiency: because of both the modified allocation strategy and the
15661 generic implementation, the performances of the code are hampered.
15662 @end enumerate
15663
15664 Note that old-style stack checking is also the fallback method for
15665 @code{specific} if no target support has been added in the compiler.
15666
15667 @item -fstack-limit-register=@var{reg}
15668 @itemx -fstack-limit-symbol=@var{sym}
15669 @itemx -fno-stack-limit
15670 @opindex fstack-limit-register
15671 @opindex fstack-limit-symbol
15672 @opindex fno-stack-limit
15673 Generate code to ensure that the stack does not grow beyond a certain value,
15674 either the value of a register or the address of a symbol.  If the stack
15675 would grow beyond the value, a signal is raised.  For most targets,
15676 the signal is raised before the stack overruns the boundary, so
15677 it is possible to catch the signal without taking special precautions.
15678
15679 For instance, if the stack starts at absolute address @samp{0x80000000}
15680 and grows downwards, you can use the flags
15681 @option{-fstack-limit-symbol=__stack_limit} and
15682 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
15683 of 128KB@.  Note that this may only work with the GNU linker.
15684
15685 @cindex aliasing of parameters
15686 @cindex parameters, aliased
15687 @item -fargument-alias
15688 @itemx -fargument-noalias
15689 @itemx -fargument-noalias-global
15690 @itemx -fargument-noalias-anything
15691 @opindex fargument-alias
15692 @opindex fargument-noalias
15693 @opindex fargument-noalias-global
15694 @opindex fargument-noalias-anything
15695 Specify the possible relationships among parameters and between
15696 parameters and global data.
15697
15698 @option{-fargument-alias} specifies that arguments (parameters) may
15699 alias each other and may alias global storage.@*
15700 @option{-fargument-noalias} specifies that arguments do not alias
15701 each other, but may alias global storage.@*
15702 @option{-fargument-noalias-global} specifies that arguments do not
15703 alias each other and do not alias global storage.
15704 @option{-fargument-noalias-anything} specifies that arguments do not
15705 alias any other storage.
15706
15707 Each language will automatically use whatever option is required by
15708 the language standard.  You should not need to use these options yourself.
15709
15710 @item -fleading-underscore
15711 @opindex fleading-underscore
15712 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
15713 change the way C symbols are represented in the object file.  One use
15714 is to help link with legacy assembly code.
15715
15716 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
15717 generate code that is not binary compatible with code generated without that
15718 switch.  Use it to conform to a non-default application binary interface.
15719 Not all targets provide complete support for this switch.
15720
15721 @item -ftls-model=@var{model}
15722 @opindex ftls-model
15723 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
15724 The @var{model} argument should be one of @code{global-dynamic},
15725 @code{local-dynamic}, @code{initial-exec} or @code{local-exec}.
15726
15727 The default without @option{-fpic} is @code{initial-exec}; with
15728 @option{-fpic} the default is @code{global-dynamic}.
15729
15730 @item -fvisibility=@var{default|internal|hidden|protected}
15731 @opindex fvisibility
15732 Set the default ELF image symbol visibility to the specified option---all
15733 symbols will be marked with this unless overridden within the code.
15734 Using this feature can very substantially improve linking and
15735 load times of shared object libraries, produce more optimized
15736 code, provide near-perfect API export and prevent symbol clashes.
15737 It is @strong{strongly} recommended that you use this in any shared objects
15738 you distribute.
15739
15740 Despite the nomenclature, @code{default} always means public ie;
15741 available to be linked against from outside the shared object.
15742 @code{protected} and @code{internal} are pretty useless in real-world
15743 usage so the only other commonly used option will be @code{hidden}.
15744 The default if @option{-fvisibility} isn't specified is
15745 @code{default}, i.e., make every
15746 symbol public---this causes the same behavior as previous versions of
15747 GCC@.
15748
15749 A good explanation of the benefits offered by ensuring ELF
15750 symbols have the correct visibility is given by ``How To Write
15751 Shared Libraries'' by Ulrich Drepper (which can be found at
15752 @w{@uref{http://people.redhat.com/~drepper/}})---however a superior
15753 solution made possible by this option to marking things hidden when
15754 the default is public is to make the default hidden and mark things
15755 public.  This is the norm with DLL's on Windows and with @option{-fvisibility=hidden}
15756 and @code{__attribute__ ((visibility("default")))} instead of
15757 @code{__declspec(dllexport)} you get almost identical semantics with
15758 identical syntax.  This is a great boon to those working with
15759 cross-platform projects.
15760
15761 For those adding visibility support to existing code, you may find
15762 @samp{#pragma GCC visibility} of use.  This works by you enclosing
15763 the declarations you wish to set visibility for with (for example)
15764 @samp{#pragma GCC visibility push(hidden)} and
15765 @samp{#pragma GCC visibility pop}.
15766 Bear in mind that symbol visibility should be viewed @strong{as
15767 part of the API interface contract} and thus all new code should
15768 always specify visibility when it is not the default ie; declarations
15769 only for use within the local DSO should @strong{always} be marked explicitly
15770 as hidden as so to avoid PLT indirection overheads---making this
15771 abundantly clear also aids readability and self-documentation of the code.
15772 Note that due to ISO C++ specification requirements, operator new and
15773 operator delete must always be of default visibility.
15774
15775 Be aware that headers from outside your project, in particular system
15776 headers and headers from any other library you use, may not be
15777 expecting to be compiled with visibility other than the default.  You
15778 may need to explicitly say @samp{#pragma GCC visibility push(default)}
15779 before including any such headers.
15780
15781 @samp{extern} declarations are not affected by @samp{-fvisibility}, so
15782 a lot of code can be recompiled with @samp{-fvisibility=hidden} with
15783 no modifications.  However, this means that calls to @samp{extern}
15784 functions with no explicit visibility will use the PLT, so it is more
15785 effective to use @samp{__attribute ((visibility))} and/or
15786 @samp{#pragma GCC visibility} to tell the compiler which @samp{extern}
15787 declarations should be treated as hidden.
15788
15789 Note that @samp{-fvisibility} does affect C++ vague linkage
15790 entities. This means that, for instance, an exception class that will
15791 be thrown between DSOs must be explicitly marked with default
15792 visibility so that the @samp{type_info} nodes will be unified between
15793 the DSOs.
15794
15795 An overview of these techniques, their benefits and how to use them
15796 is at @w{@uref{http://gcc.gnu.org/wiki/Visibility}}.
15797
15798 @end table
15799
15800 @c man end
15801
15802 @node Environment Variables
15803 @section Environment Variables Affecting GCC
15804 @cindex environment variables
15805
15806 @c man begin ENVIRONMENT
15807 This section describes several environment variables that affect how GCC
15808 operates.  Some of them work by specifying directories or prefixes to use
15809 when searching for various kinds of files.  Some are used to specify other
15810 aspects of the compilation environment.
15811
15812 Note that you can also specify places to search using options such as
15813 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
15814 take precedence over places specified using environment variables, which
15815 in turn take precedence over those specified by the configuration of GCC@.
15816 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
15817 GNU Compiler Collection (GCC) Internals}.
15818
15819 @table @env
15820 @item LANG
15821 @itemx LC_CTYPE
15822 @c @itemx LC_COLLATE
15823 @itemx LC_MESSAGES
15824 @c @itemx LC_MONETARY
15825 @c @itemx LC_NUMERIC
15826 @c @itemx LC_TIME
15827 @itemx LC_ALL
15828 @findex LANG
15829 @findex LC_CTYPE
15830 @c @findex LC_COLLATE
15831 @findex LC_MESSAGES
15832 @c @findex LC_MONETARY
15833 @c @findex LC_NUMERIC
15834 @c @findex LC_TIME
15835 @findex LC_ALL
15836 @cindex locale
15837 These environment variables control the way that GCC uses
15838 localization information that allow GCC to work with different
15839 national conventions.  GCC inspects the locale categories
15840 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
15841 so.  These locale categories can be set to any value supported by your
15842 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
15843 Kingdom encoded in UTF-8.
15844
15845 The @env{LC_CTYPE} environment variable specifies character
15846 classification.  GCC uses it to determine the character boundaries in
15847 a string; this is needed for some multibyte encodings that contain quote
15848 and escape characters that would otherwise be interpreted as a string
15849 end or escape.
15850
15851 The @env{LC_MESSAGES} environment variable specifies the language to
15852 use in diagnostic messages.
15853
15854 If the @env{LC_ALL} environment variable is set, it overrides the value
15855 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
15856 and @env{LC_MESSAGES} default to the value of the @env{LANG}
15857 environment variable.  If none of these variables are set, GCC
15858 defaults to traditional C English behavior.
15859
15860 @item TMPDIR
15861 @findex TMPDIR
15862 If @env{TMPDIR} is set, it specifies the directory to use for temporary
15863 files.  GCC uses temporary files to hold the output of one stage of
15864 compilation which is to be used as input to the next stage: for example,
15865 the output of the preprocessor, which is the input to the compiler
15866 proper.
15867
15868 @item GCC_EXEC_PREFIX
15869 @findex GCC_EXEC_PREFIX
15870 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
15871 names of the subprograms executed by the compiler.  No slash is added
15872 when this prefix is combined with the name of a subprogram, but you can
15873 specify a prefix that ends with a slash if you wish.
15874
15875 If @env{GCC_EXEC_PREFIX} is not set, GCC will attempt to figure out
15876 an appropriate prefix to use based on the pathname it was invoked with.
15877
15878 If GCC cannot find the subprogram using the specified prefix, it
15879 tries looking in the usual places for the subprogram.
15880
15881 The default value of @env{GCC_EXEC_PREFIX} is
15882 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
15883 the installed compiler. In many cases @var{prefix} is the value
15884 of @code{prefix} when you ran the @file{configure} script.
15885
15886 Other prefixes specified with @option{-B} take precedence over this prefix.
15887
15888 This prefix is also used for finding files such as @file{crt0.o} that are
15889 used for linking.
15890
15891 In addition, the prefix is used in an unusual way in finding the
15892 directories to search for header files.  For each of the standard
15893 directories whose name normally begins with @samp{/usr/local/lib/gcc}
15894 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
15895 replacing that beginning with the specified prefix to produce an
15896 alternate directory name.  Thus, with @option{-Bfoo/}, GCC will search
15897 @file{foo/bar} where it would normally search @file{/usr/local/lib/bar}.
15898 These alternate directories are searched first; the standard directories
15899 come next. If a standard directory begins with the configured
15900 @var{prefix} then the value of @var{prefix} is replaced by
15901 @env{GCC_EXEC_PREFIX} when looking for header files.
15902
15903 @item COMPILER_PATH
15904 @findex COMPILER_PATH
15905 The value of @env{COMPILER_PATH} is a colon-separated list of
15906 directories, much like @env{PATH}.  GCC tries the directories thus
15907 specified when searching for subprograms, if it can't find the
15908 subprograms using @env{GCC_EXEC_PREFIX}.
15909
15910 @item LIBRARY_PATH
15911 @findex LIBRARY_PATH
15912 The value of @env{LIBRARY_PATH} is a colon-separated list of
15913 directories, much like @env{PATH}.  When configured as a native compiler,
15914 GCC tries the directories thus specified when searching for special
15915 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
15916 using GCC also uses these directories when searching for ordinary
15917 libraries for the @option{-l} option (but directories specified with
15918 @option{-L} come first).
15919
15920 @item LANG
15921 @findex LANG
15922 @cindex locale definition
15923 This variable is used to pass locale information to the compiler.  One way in
15924 which this information is used is to determine the character set to be used
15925 when character literals, string literals and comments are parsed in C and C++.
15926 When the compiler is configured to allow multibyte characters,
15927 the following values for @env{LANG} are recognized:
15928
15929 @table @samp
15930 @item C-JIS
15931 Recognize JIS characters.
15932 @item C-SJIS
15933 Recognize SJIS characters.
15934 @item C-EUCJP
15935 Recognize EUCJP characters.
15936 @end table
15937
15938 If @env{LANG} is not defined, or if it has some other value, then the
15939 compiler will use mblen and mbtowc as defined by the default locale to
15940 recognize and translate multibyte characters.
15941 @end table
15942
15943 @noindent
15944 Some additional environments variables affect the behavior of the
15945 preprocessor.
15946
15947 @include cppenv.texi
15948
15949 @c man end
15950
15951 @node Precompiled Headers
15952 @section Using Precompiled Headers
15953 @cindex precompiled headers
15954 @cindex speed of compilation
15955
15956 Often large projects have many header files that are included in every
15957 source file.  The time the compiler takes to process these header files
15958 over and over again can account for nearly all of the time required to
15959 build the project.  To make builds faster, GCC allows users to
15960 `precompile' a header file; then, if builds can use the precompiled
15961 header file they will be much faster.
15962
15963 To create a precompiled header file, simply compile it as you would any
15964 other file, if necessary using the @option{-x} option to make the driver
15965 treat it as a C or C++ header file.  You will probably want to use a
15966 tool like @command{make} to keep the precompiled header up-to-date when
15967 the headers it contains change.
15968
15969 A precompiled header file will be searched for when @code{#include} is
15970 seen in the compilation.  As it searches for the included file
15971 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
15972 compiler looks for a precompiled header in each directory just before it
15973 looks for the include file in that directory.  The name searched for is
15974 the name specified in the @code{#include} with @samp{.gch} appended.  If
15975 the precompiled header file can't be used, it is ignored.
15976
15977 For instance, if you have @code{#include "all.h"}, and you have
15978 @file{all.h.gch} in the same directory as @file{all.h}, then the
15979 precompiled header file will be used if possible, and the original
15980 header will be used otherwise.
15981
15982 Alternatively, you might decide to put the precompiled header file in a
15983 directory and use @option{-I} to ensure that directory is searched
15984 before (or instead of) the directory containing the original header.
15985 Then, if you want to check that the precompiled header file is always
15986 used, you can put a file of the same name as the original header in this
15987 directory containing an @code{#error} command.
15988
15989 This also works with @option{-include}.  So yet another way to use
15990 precompiled headers, good for projects not designed with precompiled
15991 header files in mind, is to simply take most of the header files used by
15992 a project, include them from another header file, precompile that header
15993 file, and @option{-include} the precompiled header.  If the header files
15994 have guards against multiple inclusion, they will be skipped because
15995 they've already been included (in the precompiled header).
15996
15997 If you need to precompile the same header file for different
15998 languages, targets, or compiler options, you can instead make a
15999 @emph{directory} named like @file{all.h.gch}, and put each precompiled
16000 header in the directory, perhaps using @option{-o}.  It doesn't matter
16001 what you call the files in the directory, every precompiled header in
16002 the directory will be considered.  The first precompiled header
16003 encountered in the directory that is valid for this compilation will
16004 be used; they're searched in no particular order.
16005
16006 There are many other possibilities, limited only by your imagination,
16007 good sense, and the constraints of your build system.
16008
16009 A precompiled header file can be used only when these conditions apply:
16010
16011 @itemize
16012 @item
16013 Only one precompiled header can be used in a particular compilation.
16014
16015 @item
16016 A precompiled header can't be used once the first C token is seen.  You
16017 can have preprocessor directives before a precompiled header; you can
16018 even include a precompiled header from inside another header, so long as
16019 there are no C tokens before the @code{#include}.
16020
16021 @item
16022 The precompiled header file must be produced for the same language as
16023 the current compilation.  You can't use a C precompiled header for a C++
16024 compilation.
16025
16026 @item
16027 The precompiled header file must have been produced by the same compiler
16028 binary as the current compilation is using.
16029
16030 @item
16031 Any macros defined before the precompiled header is included must
16032 either be defined in the same way as when the precompiled header was
16033 generated, or must not affect the precompiled header, which usually
16034 means that they don't appear in the precompiled header at all.
16035
16036 The @option{-D} option is one way to define a macro before a
16037 precompiled header is included; using a @code{#define} can also do it.
16038 There are also some options that define macros implicitly, like
16039 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
16040 defined this way.
16041
16042 @item If debugging information is output when using the precompiled
16043 header, using @option{-g} or similar, the same kind of debugging information
16044 must have been output when building the precompiled header.  However,
16045 a precompiled header built using @option{-g} can be used in a compilation
16046 when no debugging information is being output.
16047
16048 @item The same @option{-m} options must generally be used when building
16049 and using the precompiled header.  @xref{Submodel Options},
16050 for any cases where this rule is relaxed.
16051
16052 @item Each of the following options must be the same when building and using
16053 the precompiled header:
16054
16055 @gccoptlist{-fexceptions}
16056
16057 @item
16058 Some other command-line options starting with @option{-f},
16059 @option{-p}, or @option{-O} must be defined in the same way as when
16060 the precompiled header was generated.  At present, it's not clear
16061 which options are safe to change and which are not; the safest choice
16062 is to use exactly the same options when generating and using the
16063 precompiled header.  The following are known to be safe:
16064
16065 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
16066 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
16067 -fsched-verbose=<number>  -fschedule-insns  -fvisibility= @gol
16068 -pedantic-errors}
16069
16070 @end itemize
16071
16072 For all of these except the last, the compiler will automatically
16073 ignore the precompiled header if the conditions aren't met.  If you
16074 find an option combination that doesn't work and doesn't cause the
16075 precompiled header to be ignored, please consider filing a bug report,
16076 see @ref{Bugs}.
16077
16078 If you do use differing options when generating and using the
16079 precompiled header, the actual behavior will be a mixture of the
16080 behavior for the options.  For instance, if you use @option{-g} to
16081 generate the precompiled header but not when using it, you may or may
16082 not get debugging information for routines in the precompiled header.
16083
16084 @node Running Protoize
16085 @section Running Protoize
16086
16087 The program @code{protoize} is an optional part of GCC@.  You can use
16088 it to add prototypes to a program, thus converting the program to ISO
16089 C in one respect.  The companion program @code{unprotoize} does the
16090 reverse: it removes argument types from any prototypes that are found.
16091
16092 When you run these programs, you must specify a set of source files as
16093 command line arguments.  The conversion programs start out by compiling
16094 these files to see what functions they define.  The information gathered
16095 about a file @var{foo} is saved in a file named @file{@var{foo}.X}.
16096
16097 After scanning comes actual conversion.  The specified files are all
16098 eligible to be converted; any files they include (whether sources or
16099 just headers) are eligible as well.
16100
16101 But not all the eligible files are converted.  By default,
16102 @code{protoize} and @code{unprotoize} convert only source and header
16103 files in the current directory.  You can specify additional directories
16104 whose files should be converted with the @option{-d @var{directory}}
16105 option.  You can also specify particular files to exclude with the
16106 @option{-x @var{file}} option.  A file is converted if it is eligible, its
16107 directory name matches one of the specified directory names, and its
16108 name within the directory has not been excluded.
16109
16110 Basic conversion with @code{protoize} consists of rewriting most
16111 function definitions and function declarations to specify the types of
16112 the arguments.  The only ones not rewritten are those for varargs
16113 functions.
16114
16115 @code{protoize} optionally inserts prototype declarations at the
16116 beginning of the source file, to make them available for any calls that
16117 precede the function's definition.  Or it can insert prototype
16118 declarations with block scope in the blocks where undeclared functions
16119 are called.
16120
16121 Basic conversion with @code{unprotoize} consists of rewriting most
16122 function declarations to remove any argument types, and rewriting
16123 function definitions to the old-style pre-ISO form.
16124
16125 Both conversion programs print a warning for any function declaration or
16126 definition that they can't convert.  You can suppress these warnings
16127 with @option{-q}.
16128
16129 The output from @code{protoize} or @code{unprotoize} replaces the
16130 original source file.  The original file is renamed to a name ending
16131 with @samp{.save} (for DOS, the saved filename ends in @samp{.sav}
16132 without the original @samp{.c} suffix).  If the @samp{.save} (@samp{.sav}
16133 for DOS) file already exists, then the source file is simply discarded.
16134
16135 @code{protoize} and @code{unprotoize} both depend on GCC itself to
16136 scan the program and collect information about the functions it uses.
16137 So neither of these programs will work until GCC is installed.
16138
16139 Here is a table of the options you can use with @code{protoize} and
16140 @code{unprotoize}.  Each option works with both programs unless
16141 otherwise stated.
16142
16143 @table @code
16144 @item -B @var{directory}
16145 Look for the file @file{SYSCALLS.c.X} in @var{directory}, instead of the
16146 usual directory (normally @file{/usr/local/lib}).  This file contains
16147 prototype information about standard system functions.  This option
16148 applies only to @code{protoize}.
16149
16150 @item -c @var{compilation-options}
16151 Use @var{compilation-options} as the options when running @command{gcc} to
16152 produce the @samp{.X} files.  The special option @option{-aux-info} is
16153 always passed in addition, to tell @command{gcc} to write a @samp{.X} file.
16154
16155 Note that the compilation options must be given as a single argument to
16156 @code{protoize} or @code{unprotoize}.  If you want to specify several
16157 @command{gcc} options, you must quote the entire set of compilation options
16158 to make them a single word in the shell.
16159
16160 There are certain @command{gcc} arguments that you cannot use, because they
16161 would produce the wrong kind of output.  These include @option{-g},
16162 @option{-O}, @option{-c}, @option{-S}, and @option{-o} If you include these in
16163 the @var{compilation-options}, they are ignored.
16164
16165 @item -C
16166 Rename files to end in @samp{.C} (@samp{.cc} for DOS-based file
16167 systems) instead of @samp{.c}.  This is convenient if you are converting
16168 a C program to C++.  This option applies only to @code{protoize}.
16169
16170 @item -g
16171 Add explicit global declarations.  This means inserting explicit
16172 declarations at the beginning of each source file for each function
16173 that is called in the file and was not declared.  These declarations
16174 precede the first function definition that contains a call to an
16175 undeclared function.  This option applies only to @code{protoize}.
16176
16177 @item -i @var{string}
16178 Indent old-style parameter declarations with the string @var{string}.
16179 This option applies only to @code{protoize}.
16180
16181 @code{unprotoize} converts prototyped function definitions to old-style
16182 function definitions, where the arguments are declared between the
16183 argument list and the initial @samp{@{}.  By default, @code{unprotoize}
16184 uses five spaces as the indentation.  If you want to indent with just
16185 one space instead, use @option{-i " "}.
16186
16187 @item -k
16188 Keep the @samp{.X} files.  Normally, they are deleted after conversion
16189 is finished.
16190
16191 @item -l
16192 Add explicit local declarations.  @code{protoize} with @option{-l} inserts
16193 a prototype declaration for each function in each block which calls the
16194 function without any declaration.  This option applies only to
16195 @code{protoize}.
16196
16197 @item -n
16198 Make no real changes.  This mode just prints information about the conversions
16199 that would have been done without @option{-n}.
16200
16201 @item -N
16202 Make no @samp{.save} files.  The original files are simply deleted.
16203 Use this option with caution.
16204
16205 @item -p @var{program}
16206 Use the program @var{program} as the compiler.  Normally, the name
16207 @file{gcc} is used.
16208
16209 @item -q
16210 Work quietly.  Most warnings are suppressed.
16211
16212 @item -v
16213 Print the version number, just like @option{-v} for @command{gcc}.
16214 @end table
16215
16216 If you need special compiler options to compile one of your program's
16217 source files, then you should generate that file's @samp{.X} file
16218 specially, by running @command{gcc} on that source file with the
16219 appropriate options and the option @option{-aux-info}.  Then run
16220 @code{protoize} on the entire set of files.  @code{protoize} will use
16221 the existing @samp{.X} file because it is newer than the source file.
16222 For example:
16223
16224 @smallexample
16225 gcc -Dfoo=bar file1.c -aux-info file1.X
16226 protoize *.c
16227 @end smallexample
16228
16229 @noindent
16230 You need to include the special files along with the rest in the
16231 @code{protoize} command, even though their @samp{.X} files already
16232 exist, because otherwise they won't get converted.
16233
16234 @xref{Protoize Caveats}, for more information on how to use
16235 @code{protoize} successfully.