OSDN Git Service

2009-06-26 Daniel Gutson <dgutson@codesourcery.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, 2009
3 @c Free Software Foundation, Inc.
4 @c This is part of the GCC manual.
5 @c For copying conditions, see the file gcc.texi.
6
7 @ignore
8 @c man begin INCLUDE
9 @include gcc-vers.texi
10 @c man end
11
12 @c man begin COPYRIGHT
13 Copyright @copyright{} 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
14 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
15 Free Software Foundation, Inc.
16
17 Permission is granted to copy, distribute and/or modify this document
18 under the terms of the GNU Free Documentation License, Version 1.2 or
19 any later version published by the Free Software Foundation; with the
20 Invariant Sections being ``GNU General Public License'' and ``Funding
21 Free Software'', the Front-Cover texts being (a) (see below), and with
22 the Back-Cover Texts being (b) (see below).  A copy of the license is
23 included in the gfdl(7) man page.
24
25 (a) The FSF's Front-Cover Text is:
26
27      A GNU Manual
28
29 (b) The FSF's Back-Cover Text is:
30
31      You have freedom to copy and modify this GNU Manual, like GNU
32      software.  Copies published by the Free Software Foundation raise
33      funds for GNU development.
34 @c man end
35 @c Set file name and title for the man page.
36 @setfilename gcc
37 @settitle GNU project C and C++ compiler
38 @c man begin SYNOPSIS
39 gcc [@option{-c}|@option{-S}|@option{-E}] [@option{-std=}@var{standard}]
40     [@option{-g}] [@option{-pg}] [@option{-O}@var{level}]
41     [@option{-W}@var{warn}@dots{}] [@option{-pedantic}]
42     [@option{-I}@var{dir}@dots{}] [@option{-L}@var{dir}@dots{}]
43     [@option{-D}@var{macro}[=@var{defn}]@dots{}] [@option{-U}@var{macro}]
44     [@option{-f}@var{option}@dots{}] [@option{-m}@var{machine-option}@dots{}]
45     [@option{-o} @var{outfile}] [@@@var{file}] @var{infile}@dots{}
46
47 Only the most useful options are listed here; see below for the
48 remainder.  @samp{g++} accepts mostly the same options as @samp{gcc}.
49 @c man end
50 @c man begin SEEALSO
51 gpl(7), gfdl(7), fsf-funding(7),
52 cpp(1), gcov(1), as(1), ld(1), gdb(1), adb(1), dbx(1), sdb(1)
53 and the Info entries for @file{gcc}, @file{cpp}, @file{as},
54 @file{ld}, @file{binutils} and @file{gdb}.
55 @c man end
56 @c man begin BUGS
57 For instructions on reporting bugs, see
58 @w{@value{BUGURL}}.
59 @c man end
60 @c man begin AUTHOR
61 See the Info entry for @command{gcc}, or
62 @w{@uref{http://gcc.gnu.org/onlinedocs/gcc/Contributors.html}},
63 for contributors to GCC@.
64 @c man end
65 @end ignore
66
67 @node Invoking GCC
68 @chapter GCC Command Options
69 @cindex GCC command options
70 @cindex command options
71 @cindex options, GCC command
72
73 @c man begin DESCRIPTION
74 When you invoke GCC, it normally does preprocessing, compilation,
75 assembly and linking.  The ``overall options'' allow you to stop this
76 process at an intermediate stage.  For example, the @option{-c} option
77 says not to run the linker.  Then the output consists of object files
78 output by the assembler.
79
80 Other options are passed on to one stage of processing.  Some options
81 control the preprocessor and others the compiler itself.  Yet other
82 options control the assembler and linker; most of these are not
83 documented here, since you rarely need to use any of them.
84
85 @cindex C compilation options
86 Most of the command line options that you can use with GCC are useful
87 for C programs; when an option is only useful with another language
88 (usually C++), the explanation says so explicitly.  If the description
89 for a particular option does not mention a source language, you can use
90 that option with all supported languages.
91
92 @cindex C++ compilation options
93 @xref{Invoking G++,,Compiling C++ Programs}, for a summary of special
94 options for compiling C++ programs.
95
96 @cindex grouping options
97 @cindex options, grouping
98 The @command{gcc} program accepts options and file names as operands.  Many
99 options have multi-letter names; therefore multiple single-letter options
100 may @emph{not} be grouped: @option{-dv} is very different from @w{@samp{-d
101 -v}}.
102
103 @cindex order of options
104 @cindex options, order
105 You can mix options and other arguments.  For the most part, the order
106 you use doesn't matter.  Order does matter when you use several
107 options of the same kind; for example, if you specify @option{-L} more
108 than once, the directories are searched in the order specified.  Also,
109 the placement of the @option{-l} option is significant.
110
111 Many options have long names starting with @samp{-f} or with
112 @samp{-W}---for example,
113 @option{-fmove-loop-invariants}, @option{-Wformat} and so on.  Most of
114 these have both positive and negative forms; the negative form of
115 @option{-ffoo} would be @option{-fno-foo}.  This manual documents
116 only one of these two forms, whichever one is not the default.
117
118 @c man end
119
120 @xref{Option Index}, for an index to GCC's options.
121
122 @menu
123 * Option Summary::      Brief list of all options, without explanations.
124 * Overall Options::     Controlling the kind of output:
125                         an executable, object files, assembler files,
126                         or preprocessed source.
127 * Invoking G++::        Compiling C++ programs.
128 * C Dialect Options::   Controlling the variant of C language compiled.
129 * C++ Dialect Options:: Variations on C++.
130 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
131                         and Objective-C++.
132 * Language Independent Options:: Controlling how diagnostics should be
133                         formatted.
134 * Warning Options::     How picky should the compiler be?
135 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
136 * Optimize Options::    How much optimization?
137 * Preprocessor Options:: Controlling header files and macro definitions.
138                          Also, getting dependency information for Make.
139 * Assembler Options::   Passing options to the assembler.
140 * Link Options::        Specifying libraries and so on.
141 * Directory Options::   Where to find header files and libraries.
142                         Where to find the compiler executable files.
143 * Spec Files::          How to pass switches to sub-processes.
144 * Target Options::      Running a cross-compiler, or an old version of GCC.
145 * Submodel Options::    Specifying minor hardware or convention variations,
146                         such as 68010 vs 68020.
147 * Code Gen Options::    Specifying conventions for function calls, data layout
148                         and register usage.
149 * Environment Variables:: Env vars that affect GCC.
150 * Precompiled Headers:: Compiling a header once, and using it many times.
151 @end menu
152
153 @c man begin OPTIONS
154
155 @node Option Summary
156 @section Option Summary
157
158 Here is a summary of all the options, grouped by type.  Explanations are
159 in the following sections.
160
161 @table @emph
162 @item Overall Options
163 @xref{Overall Options,,Options Controlling the Kind of Output}.
164 @gccoptlist{-c  -S  -E  -o @var{file}  -combine  -pipe  -pass-exit-codes  @gol
165 -x @var{language}  -v  -###  --help@r{[}=@var{class}@r{[},@dots{}@r{]]}  --target-help  @gol
166 --version -wrapper@@@var{file} -fplugin=@var{file} -fplugin-arg-@var{name}=@var{arg}}
167
168 @item C Language Options
169 @xref{C Dialect Options,,Options Controlling C Dialect}.
170 @gccoptlist{-ansi  -std=@var{standard}  -fgnu89-inline @gol
171 -aux-info @var{filename} @gol
172 -fno-asm  -fno-builtin  -fno-builtin-@var{function} @gol
173 -fhosted  -ffreestanding -fopenmp -fms-extensions @gol
174 -trigraphs  -no-integrated-cpp  -traditional  -traditional-cpp @gol
175 -fallow-single-precision  -fcond-mismatch -flax-vector-conversions @gol
176 -fsigned-bitfields  -fsigned-char @gol
177 -funsigned-bitfields  -funsigned-char}
178
179 @item C++ Language Options
180 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}.
181 @gccoptlist{-fabi-version=@var{n}  -fno-access-control  -fcheck-new @gol
182 -fconserve-space  -ffriend-injection @gol
183 -fno-elide-constructors @gol
184 -fno-enforce-eh-specs @gol
185 -ffor-scope  -fno-for-scope  -fno-gnu-keywords @gol
186 -fno-implicit-templates @gol
187 -fno-implicit-inline-templates @gol
188 -fno-implement-inlines  -fms-extensions @gol
189 -fno-nonansi-builtins  -fno-operator-names @gol
190 -fno-optional-diags  -fpermissive @gol
191 -fno-pretty-templates @gol
192 -frepo  -fno-rtti  -fstats  -ftemplate-depth-@var{n} @gol
193 -fno-threadsafe-statics -fuse-cxa-atexit  -fno-weak  -nostdinc++ @gol
194 -fno-default-inline  -fvisibility-inlines-hidden @gol
195 -fvisibility-ms-compat @gol
196 -Wabi  -Wctor-dtor-privacy @gol
197 -Wnon-virtual-dtor  -Wreorder @gol
198 -Weffc++  -Wstrict-null-sentinel @gol
199 -Wno-non-template-friend  -Wold-style-cast @gol
200 -Woverloaded-virtual  -Wno-pmf-conversions @gol
201 -Wsign-promo}
202
203 @item Objective-C and Objective-C++ Language Options
204 @xref{Objective-C and Objective-C++ Dialect Options,,Options Controlling
205 Objective-C and Objective-C++ Dialects}.
206 @gccoptlist{-fconstant-string-class=@var{class-name} @gol
207 -fgnu-runtime  -fnext-runtime @gol
208 -fno-nil-receivers @gol
209 -fobjc-call-cxx-cdtors @gol
210 -fobjc-direct-dispatch @gol
211 -fobjc-exceptions @gol
212 -fobjc-gc @gol
213 -freplace-objc-classes @gol
214 -fzero-link @gol
215 -gen-decls @gol
216 -Wassign-intercept @gol
217 -Wno-protocol  -Wselector @gol
218 -Wstrict-selector-match @gol
219 -Wundeclared-selector}
220
221 @item Language Independent Options
222 @xref{Language Independent Options,,Options to Control Diagnostic Messages Formatting}.
223 @gccoptlist{-fmessage-length=@var{n}  @gol
224 -fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]}  @gol
225 -fdiagnostics-show-option}
226
227 @item Warning Options
228 @xref{Warning Options,,Options to Request or Suppress Warnings}.
229 @gccoptlist{-fsyntax-only  -pedantic  -pedantic-errors @gol
230 -w  -Wextra  -Wall  -Waddress  -Waggregate-return  -Warray-bounds @gol
231 -Wno-attributes -Wno-builtin-macro-redefined @gol
232 -Wc++-compat -Wc++0x-compat -Wcast-align  -Wcast-qual  @gol
233 -Wchar-subscripts -Wclobbered  -Wcomment @gol
234 -Wconversion  -Wcoverage-mismatch  -Wno-deprecated  @gol
235 -Wno-deprecated-declarations -Wdisabled-optimization  @gol
236 -Wno-div-by-zero -Wempty-body  -Wenum-compare -Wno-endif-labels @gol
237 -Werror  -Werror=* @gol
238 -Wfatal-errors  -Wfloat-equal  -Wformat  -Wformat=2 @gol
239 -Wno-format-contains-nul -Wno-format-extra-args -Wformat-nonliteral @gol
240 -Wformat-security  -Wformat-y2k @gol
241 -Wframe-larger-than=@var{len} -Wjump-misses-init -Wignored-qualifiers @gol
242 -Wimplicit  -Wimplicit-function-declaration  -Wimplicit-int @gol
243 -Winit-self  -Winline @gol
244 -Wno-int-to-pointer-cast -Wno-invalid-offsetof @gol
245 -Winvalid-pch -Wlarger-than=@var{len}  -Wunsafe-loop-optimizations @gol
246 -Wlogical-op -Wlong-long @gol
247 -Wmain  -Wmissing-braces  -Wmissing-field-initializers @gol
248 -Wmissing-format-attribute  -Wmissing-include-dirs @gol
249 -Wmissing-noreturn  -Wno-mudflap @gol
250 -Wno-multichar  -Wnonnull  -Wno-overflow @gol
251 -Woverlength-strings  -Wpacked  -Wpacked-bitfield-compat  -Wpadded @gol
252 -Wparentheses  -Wpedantic-ms-format -Wno-pedantic-ms-format @gol
253 -Wpointer-arith  -Wno-pointer-to-int-cast @gol
254 -Wredundant-decls @gol
255 -Wreturn-type  -Wsequence-point  -Wshadow @gol
256 -Wsign-compare  -Wsign-conversion  -Wstack-protector @gol
257 -Wstrict-aliasing -Wstrict-aliasing=n @gol
258 -Wstrict-overflow -Wstrict-overflow=@var{n} @gol
259 -Wswitch  -Wswitch-default  -Wswitch-enum -Wsync-nand @gol
260 -Wsystem-headers  -Wtrigraphs  -Wtype-limits  -Wundef  -Wuninitialized @gol
261 -Wunknown-pragmas  -Wno-pragmas -Wunreachable-code @gol
262 -Wunsuffixed-float-constants  -Wunused  -Wunused-function @gol
263 -Wunused-label  -Wunused-parameter  -Wunused-value  -Wunused-variable @gol
264 -Wvariadic-macros -Wvla @gol
265 -Wvolatile-register-var  -Wwrite-strings}
266
267 @item C and Objective-C-only Warning Options
268 @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
269 -Wmissing-parameter-type  -Wmissing-prototypes  -Wnested-externs @gol
270 -Wold-style-declaration  -Wold-style-definition @gol
271 -Wstrict-prototypes  -Wtraditional  -Wtraditional-conversion @gol
272 -Wdeclaration-after-statement -Wpointer-sign}
273
274 @item Debugging Options
275 @xref{Debugging Options,,Options for Debugging Your Program or GCC}.
276 @gccoptlist{-d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
277 -fdbg-cnt-list -fdbg-cnt=@var{counter-value-list} @gol
278 -fdump-noaddr -fdump-unnumbered -fdump-unnumbered-links @gol
279 -fdump-translation-unit@r{[}-@var{n}@r{]} @gol
280 -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
281 -fdump-ipa-all -fdump-ipa-cgraph -fdump-ipa-inline @gol
282 -fdump-statistics @gol
283 -fdump-tree-all @gol
284 -fdump-tree-original@r{[}-@var{n}@r{]}  @gol
285 -fdump-tree-optimized@r{[}-@var{n}@r{]} @gol
286 -fdump-tree-cfg -fdump-tree-vcg -fdump-tree-alias @gol
287 -fdump-tree-ch @gol
288 -fdump-tree-ssa@r{[}-@var{n}@r{]} -fdump-tree-pre@r{[}-@var{n}@r{]} @gol
289 -fdump-tree-ccp@r{[}-@var{n}@r{]} -fdump-tree-dce@r{[}-@var{n}@r{]} @gol
290 -fdump-tree-gimple@r{[}-raw@r{]} -fdump-tree-mudflap@r{[}-@var{n}@r{]} @gol
291 -fdump-tree-dom@r{[}-@var{n}@r{]} @gol
292 -fdump-tree-dse@r{[}-@var{n}@r{]} @gol
293 -fdump-tree-phiprop@r{[}-@var{n}@r{]} @gol
294 -fdump-tree-phiopt@r{[}-@var{n}@r{]} @gol
295 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
296 -fdump-tree-copyrename@r{[}-@var{n}@r{]} @gol
297 -fdump-tree-nrv -fdump-tree-vect @gol
298 -fdump-tree-sink @gol
299 -fdump-tree-sra@r{[}-@var{n}@r{]} @gol
300 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
301 -fdump-tree-fre@r{[}-@var{n}@r{]} @gol
302 -fdump-tree-vrp@r{[}-@var{n}@r{]} @gol
303 -ftree-vectorizer-verbose=@var{n} @gol
304 -fdump-tree-storeccp@r{[}-@var{n}@r{]} @gol
305 -fdump-final-insns=@var{file} @gol
306 -fcompare-debug@r{[}=@var{opts}@r{]}  -fcompare-debug-second @gol
307 -feliminate-dwarf2-dups -feliminate-unused-debug-types @gol
308 -feliminate-unused-debug-symbols -femit-class-debug-always @gol
309 -fmem-report -fpre-ipa-mem-report -fpost-ipa-mem-report -fprofile-arcs @gol
310 -frandom-seed=@var{string} -fsched-verbose=@var{n} @gol
311 -fsel-sched-verbose -fsel-sched-dump-cfg -fsel-sched-pipelining-verbose @gol
312 -ftest-coverage  -ftime-report -fvar-tracking @gol
313 -g  -g@var{level}  -gtoggle  -gcoff  -gdwarf-@var{version} @gol
314 -ggdb  -gstabs  -gstabs+  -gvms  -gxcoff  -gxcoff+ @gol
315 -fno-merge-debug-strings -fno-dwarf2-cfi-asm @gol
316 -fdebug-prefix-map=@var{old}=@var{new} @gol
317 -femit-struct-debug-baseonly -femit-struct-debug-reduced @gol
318 -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol
319 -p  -pg  -print-file-name=@var{library}  -print-libgcc-file-name @gol
320 -print-multi-directory  -print-multi-lib @gol
321 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
322 -print-sysroot -print-sysroot-headers-suffix @gol
323 -save-temps -save-temps=cwd -save-temps=obj -time@r{[}=@var{file}@r{]}}
324
325 @item Optimization Options
326 @xref{Optimize Options,,Options that Control Optimization}.
327 @gccoptlist{
328 -falign-functions[=@var{n}] -falign-jumps[=@var{n}] @gol
329 -falign-labels[=@var{n}] -falign-loops[=@var{n}] -fassociative-math @gol
330 -fauto-inc-dec -fbranch-probabilities -fbranch-target-load-optimize @gol
331 -fbranch-target-load-optimize2 -fbtr-bb-exclusive -fcaller-saves @gol
332 -fcheck-data-deps -fconserve-stack -fcprop-registers -fcrossjumping @gol
333 -fcse-follow-jumps -fcse-skip-blocks -fcx-fortran-rules -fcx-limited-range @gol
334 -fdata-sections -fdce -fdce @gol
335 -fdelayed-branch -fdelete-null-pointer-checks -fdse -fdse @gol
336 -fearly-inlining -fexpensive-optimizations -ffast-math @gol
337 -ffinite-math-only -ffloat-store -fexcess-precision=@var{style} @gol
338 -fforward-propagate -ffunction-sections @gol
339 -fgcse -fgcse-after-reload -fgcse-las -fgcse-lm @gol
340 -fgcse-sm -fif-conversion -fif-conversion2 -findirect-inlining @gol
341 -finline-functions -finline-functions-called-once -finline-limit=@var{n} @gol
342 -finline-small-functions -fipa-cp -fipa-cp-clone -fipa-matrix-reorg -fipa-pta @gol 
343 -fipa-pure-const -fipa-reference -fipa-struct-reorg @gol
344 -fipa-type-escape -fira-algorithm=@var{algorithm} @gol
345 -fira-region=@var{region} -fira-coalesce -fno-ira-share-save-slots @gol
346 -fno-ira-share-spill-slots -fira-verbose=@var{n} @gol
347 -fivopts -fkeep-inline-functions -fkeep-static-consts @gol
348 -floop-block -floop-interchange -floop-strip-mine @gol
349 -fmerge-all-constants -fmerge-constants -fmodulo-sched @gol
350 -fmodulo-sched-allow-regmoves -fmove-loop-invariants -fmudflap @gol
351 -fmudflapir -fmudflapth -fno-branch-count-reg -fno-default-inline @gol
352 -fno-defer-pop -fno-function-cse -fno-guess-branch-probability @gol
353 -fno-inline -fno-math-errno -fno-peephole -fno-peephole2 @gol
354 -fno-sched-interblock -fno-sched-spec -fno-signed-zeros @gol
355 -fno-toplevel-reorder -fno-trapping-math -fno-zero-initialized-in-bss @gol
356 -fomit-frame-pointer -foptimize-register-move -foptimize-sibling-calls @gol
357 -fpeel-loops -fpredictive-commoning -fprefetch-loop-arrays @gol
358 -fprofile-correction -fprofile-dir=@var{path} -fprofile-generate @gol
359 -fprofile-generate=@var{path} @gol
360 -fprofile-use -fprofile-use=@var{path} -fprofile-values @gol
361 -freciprocal-math -fregmove -frename-registers -freorder-blocks @gol
362 -freorder-blocks-and-partition -freorder-functions @gol
363 -frerun-cse-after-loop -freschedule-modulo-scheduled-loops @gol
364 -frounding-math -fsched2-use-superblocks @gol
365 -fsched2-use-traces -fsched-spec-load -fsched-spec-load-dangerous @gol
366 -fsched-stalled-insns-dep[=@var{n}] -fsched-stalled-insns[=@var{n}] @gol
367 -fschedule-insns -fschedule-insns2 -fsection-anchors @gol
368 -fselective-scheduling -fselective-scheduling2 @gol
369 -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops @gol
370 -fsignaling-nans -fsingle-precision-constant -fsplit-ivs-in-unroller @gol
371 -fsplit-wide-types -fstack-protector -fstack-protector-all @gol
372 -fstrict-aliasing -fstrict-overflow -fthread-jumps -ftracer @gol
373 -ftree-builtin-call-dce -ftree-ccp -ftree-ch -ftree-copy-prop @gol
374 -ftree-copyrename -ftree-dce @gol
375 -ftree-dominator-opts -ftree-dse -ftree-forwprop -ftree-fre -ftree-loop-im @gol
376 -ftree-phiprop -ftree-loop-distribution @gol
377 -ftree-loop-ivcanon -ftree-loop-linear -ftree-loop-optimize @gol
378 -ftree-parallelize-loops=@var{n} -ftree-pre -ftree-pta -ftree-reassoc @gol
379 -ftree-sink -ftree-sra -ftree-switch-conversion @gol
380 -ftree-ter -ftree-vect-loop-version -ftree-vectorize -ftree-vrp @gol
381 -funit-at-a-time -funroll-all-loops -funroll-loops @gol
382 -funsafe-loop-optimizations -funsafe-math-optimizations -funswitch-loops @gol
383 -fvariable-expansion-in-unroller -fvect-cost-model -fvpt -fweb @gol
384 -fwhole-program @gol
385 --param @var{name}=@var{value}
386 -O  -O0  -O1  -O2  -O3  -Os}
387
388 @item Preprocessor Options
389 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
390 @gccoptlist{-A@var{question}=@var{answer} @gol
391 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
392 -C  -dD  -dI  -dM  -dN @gol
393 -D@var{macro}@r{[}=@var{defn}@r{]}  -E  -H @gol
394 -idirafter @var{dir} @gol
395 -include @var{file}  -imacros @var{file} @gol
396 -iprefix @var{file}  -iwithprefix @var{dir} @gol
397 -iwithprefixbefore @var{dir}  -isystem @var{dir} @gol
398 -imultilib @var{dir} -isysroot @var{dir} @gol
399 -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  @gol
400 -P  -fworking-directory  -remap @gol
401 -trigraphs  -undef  -U@var{macro}  -Wp,@var{option} @gol
402 -Xpreprocessor @var{option}}
403
404 @item Assembler Option
405 @xref{Assembler Options,,Passing Options to the Assembler}.
406 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
407
408 @item Linker Options
409 @xref{Link Options,,Options for Linking}.
410 @gccoptlist{@var{object-file-name}  -l@var{library} @gol
411 -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic @gol
412 -s  -static  -static-libgcc  -static-libstdc++ -shared  @gol
413 -shared-libgcc  -symbolic @gol
414 -T @var{script}  -Wl,@var{option}  -Xlinker @var{option} @gol
415 -u @var{symbol}}
416
417 @item Directory Options
418 @xref{Directory Options,,Options for Directory Search}.
419 @gccoptlist{-B@var{prefix}  -I@var{dir}  -iquote@var{dir}  -L@var{dir}
420 -specs=@var{file}  -I- --sysroot=@var{dir}}
421
422 @item Target Options
423 @c I wrote this xref this way to avoid overfull hbox. -- rms
424 @xref{Target Options}.
425 @gccoptlist{-V @var{version}  -b @var{machine}}
426
427 @item Machine Dependent Options
428 @xref{Submodel Options,,Hardware Models and Configurations}.
429 @c This list is ordered alphanumerically by subsection name.
430 @c Try and put the significant identifier (CPU or system) first,
431 @c so users have a clue at guessing where the ones they want will be.
432
433 @emph{ARC Options}
434 @gccoptlist{-EB  -EL @gol
435 -mmangle-cpu  -mcpu=@var{cpu}  -mtext=@var{text-section} @gol
436 -mdata=@var{data-section}  -mrodata=@var{readonly-data-section}}
437
438 @emph{ARM Options}
439 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
440 -mabi=@var{name} @gol
441 -mapcs-stack-check  -mno-apcs-stack-check @gol
442 -mapcs-float  -mno-apcs-float @gol
443 -mapcs-reentrant  -mno-apcs-reentrant @gol
444 -msched-prolog  -mno-sched-prolog @gol
445 -mlittle-endian  -mbig-endian  -mwords-little-endian @gol
446 -mfloat-abi=@var{name}  -msoft-float  -mhard-float  -mfpe @gol
447 -mfp16-format=@var{name}
448 -mthumb-interwork  -mno-thumb-interwork @gol
449 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
450 -mstructure-size-boundary=@var{n} @gol
451 -mabort-on-noreturn @gol
452 -mlong-calls  -mno-long-calls @gol
453 -msingle-pic-base  -mno-single-pic-base @gol
454 -mpic-register=@var{reg} @gol
455 -mnop-fun-dllimport @gol
456 -mcirrus-fix-invalid-insns -mno-cirrus-fix-invalid-insns @gol
457 -mpoke-function-name @gol
458 -mthumb  -marm @gol
459 -mtpcs-frame  -mtpcs-leaf-frame @gol
460 -mcaller-super-interworking  -mcallee-super-interworking @gol
461 -mtp=@var{name} @gol
462 -mword-relocations @gol
463 -mfix-cortex-m3-ldrd}
464
465 @emph{AVR Options}
466 @gccoptlist{-mmcu=@var{mcu}  -msize  -minit-stack=@var{n}  -mno-interrupts @gol
467 -mcall-prologues  -mtiny-stack  -mint8}
468
469 @emph{Blackfin Options}
470 @gccoptlist{-mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]} @gol
471 -msim -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
472 -mspecld-anomaly  -mno-specld-anomaly  -mcsync-anomaly  -mno-csync-anomaly @gol
473 -mlow-64k -mno-low64k  -mstack-check-l1  -mid-shared-library @gol
474 -mno-id-shared-library  -mshared-library-id=@var{n} @gol
475 -mleaf-id-shared-library  -mno-leaf-id-shared-library @gol
476 -msep-data  -mno-sep-data  -mlong-calls  -mno-long-calls @gol
477 -mfast-fp -minline-plt -mmulticore  -mcorea  -mcoreb  -msdram @gol
478 -micplb}
479
480 @emph{CRIS Options}
481 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
482 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
483 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
484 -mstack-align  -mdata-align  -mconst-align @gol
485 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
486 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
487 -mmul-bug-workaround  -mno-mul-bug-workaround}
488
489 @emph{CRX Options}
490 @gccoptlist{-mmac -mpush-args}
491
492 @emph{Darwin Options}
493 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
494 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
495 -client_name  -compatibility_version  -current_version @gol
496 -dead_strip @gol
497 -dependency-file  -dylib_file  -dylinker_install_name @gol
498 -dynamic  -dynamiclib  -exported_symbols_list @gol
499 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
500 -force_flat_namespace  -headerpad_max_install_names @gol
501 -iframework @gol
502 -image_base  -init  -install_name  -keep_private_externs @gol
503 -multi_module  -multiply_defined  -multiply_defined_unused @gol
504 -noall_load   -no_dead_strip_inits_and_terms @gol
505 -nofixprebinding -nomultidefs  -noprebind  -noseglinkedit @gol
506 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
507 -private_bundle  -read_only_relocs  -sectalign @gol
508 -sectobjectsymbols  -whyload  -seg1addr @gol
509 -sectcreate  -sectobjectsymbols  -sectorder @gol
510 -segaddr -segs_read_only_addr -segs_read_write_addr @gol
511 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
512 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
513 -single_module  -static  -sub_library  -sub_umbrella @gol
514 -twolevel_namespace  -umbrella  -undefined @gol
515 -unexported_symbols_list  -weak_reference_mismatches @gol
516 -whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} @gol
517 -mkernel -mone-byte-bool}
518
519 @emph{DEC Alpha Options}
520 @gccoptlist{-mno-fp-regs  -msoft-float  -malpha-as  -mgas @gol
521 -mieee  -mieee-with-inexact  -mieee-conformant @gol
522 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
523 -mtrap-precision=@var{mode}  -mbuild-constants @gol
524 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
525 -mbwx  -mmax  -mfix  -mcix @gol
526 -mfloat-vax  -mfloat-ieee @gol
527 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
528 -msmall-text  -mlarge-text @gol
529 -mmemory-latency=@var{time}}
530
531 @emph{DEC Alpha/VMS Options}
532 @gccoptlist{-mvms-return-codes}
533
534 @emph{FR30 Options}
535 @gccoptlist{-msmall-model -mno-lsim}
536
537 @emph{FRV Options}
538 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
539 -mhard-float  -msoft-float @gol
540 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
541 -mdouble  -mno-double @gol
542 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
543 -mfdpic  -minline-plt -mgprel-ro  -multilib-library-pic @gol
544 -mlinked-fp  -mlong-calls  -malign-labels @gol
545 -mlibrary-pic  -macc-4  -macc-8 @gol
546 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
547 -moptimize-membar -mno-optimize-membar @gol
548 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
549 -mvliw-branch  -mno-vliw-branch @gol
550 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
551 -mno-nested-cond-exec  -mtomcat-stats @gol
552 -mTLS -mtls @gol
553 -mcpu=@var{cpu}}
554
555 @emph{GNU/Linux Options}
556 @gccoptlist{-muclibc}
557
558 @emph{H8/300 Options}
559 @gccoptlist{-mrelax  -mh  -ms  -mn  -mint32  -malign-300}
560
561 @emph{HPPA Options}
562 @gccoptlist{-march=@var{architecture-type} @gol
563 -mbig-switch  -mdisable-fpregs  -mdisable-indexing @gol
564 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
565 -mfixed-range=@var{register-range} @gol
566 -mjump-in-delay -mlinker-opt -mlong-calls @gol
567 -mlong-load-store  -mno-big-switch  -mno-disable-fpregs @gol
568 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
569 -mno-jump-in-delay  -mno-long-load-store @gol
570 -mno-portable-runtime  -mno-soft-float @gol
571 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
572 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
573 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
574 -munix=@var{unix-std}  -nolibdld  -static  -threads}
575
576 @emph{i386 and x86-64 Options}
577 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
578 -mfpmath=@var{unit} @gol
579 -masm=@var{dialect}  -mno-fancy-math-387 @gol
580 -mno-fp-ret-in-387  -msoft-float @gol
581 -mno-wide-multiply  -mrtd  -malign-double @gol
582 -mpreferred-stack-boundary=@var{num}
583 -mincoming-stack-boundary=@var{num}
584 -mcld -mcx16 -msahf -mmovbe -mcrc32 -mrecip @gol
585 -mmmx  -msse  -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -msse4 -mavx @gol
586 -maes -mpclmul @gol
587 -msse4a -m3dnow -mpopcnt -mabm -msse5 @gol
588 -mthreads  -mno-align-stringops  -minline-all-stringops @gol
589 -minline-stringops-dynamically -mstringop-strategy=@var{alg} @gol
590 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
591 -m96bit-long-double  -mregparm=@var{num}  -msseregparm @gol
592 -mveclibabi=@var{type} -mpc32 -mpc64 -mpc80 -mstackrealign @gol
593 -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs @gol
594 -mcmodel=@var{code-model} -mabi=@var{name} @gol
595 -m32  -m64 -mlarge-data-threshold=@var{num} @gol
596 -mfused-madd -mno-fused-madd -msse2avx}
597
598 @emph{IA-64 Options}
599 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
600 -mvolatile-asm-stop  -mregister-names  -msdata -mno-sdata @gol
601 -mconstant-gp  -mauto-pic  -mfused-madd @gol
602 -minline-float-divide-min-latency @gol
603 -minline-float-divide-max-throughput @gol
604 -mno-inline-float-divide @gol
605 -minline-int-divide-min-latency @gol
606 -minline-int-divide-max-throughput  @gol
607 -mno-inline-int-divide @gol
608 -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
609 -mno-inline-sqrt @gol
610 -mdwarf2-asm -mearly-stop-bits @gol
611 -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
612 -mtune=@var{cpu-type} -milp32 -mlp64 @gol
613 -msched-br-data-spec -msched-ar-data-spec -msched-control-spec @gol
614 -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec @gol
615 -msched-spec-ldc -msched-spec-control-ldc @gol
616 -msched-prefer-non-data-spec-insns -msched-prefer-non-control-spec-insns @gol
617 -msched-stop-bits-after-every-cycle -msched-count-spec-in-critical-path @gol
618 -msel-sched-dont-check-control-spec -msched-fp-mem-deps-zero-cost @gol
619 -msched-max-memory-insns-hard-limit -msched-max-memory-insns=@var{max-insns}}
620
621 @emph{M32R/D Options}
622 @gccoptlist{-m32r2 -m32rx -m32r @gol
623 -mdebug @gol
624 -malign-loops -mno-align-loops @gol
625 -missue-rate=@var{number} @gol
626 -mbranch-cost=@var{number} @gol
627 -mmodel=@var{code-size-model-type} @gol
628 -msdata=@var{sdata-type} @gol
629 -mno-flush-func -mflush-func=@var{name} @gol
630 -mno-flush-trap -mflush-trap=@var{number} @gol
631 -G @var{num}}
632
633 @emph{M32C Options}
634 @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
635
636 @emph{M680x0 Options}
637 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu}  -mtune=@var{tune}
638 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
639 -m68060  -mcpu32  -m5200  -m5206e  -m528x  -m5307  -m5407 @gol
640 -mcfv4e  -mbitfield  -mno-bitfield  -mc68000  -mc68020 @gol
641 -mnobitfield  -mrtd  -mno-rtd  -mdiv  -mno-div  -mshort @gol
642 -mno-short  -mhard-float  -m68881  -msoft-float  -mpcrel @gol
643 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
644 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library @gol
645 -mxgot -mno-xgot}
646
647 @emph{M68hc1x Options}
648 @gccoptlist{-m6811  -m6812  -m68hc11  -m68hc12   -m68hcs12 @gol
649 -mauto-incdec  -minmax  -mlong-calls  -mshort @gol
650 -msoft-reg-count=@var{count}}
651
652 @emph{MCore Options}
653 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
654 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
655 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
656 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
657 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
658
659 @emph{MIPS Options}
660 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
661 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2 @gol
662 -mips64  -mips64r2 @gol
663 -mips16  -mno-mips16  -mflip-mips16 @gol
664 -minterlink-mips16  -mno-interlink-mips16 @gol
665 -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
666 -mshared  -mno-shared  -mplt  -mno-plt  -mxgot  -mno-xgot @gol
667 -mgp32  -mgp64  -mfp32  -mfp64  -mhard-float  -msoft-float @gol
668 -msingle-float  -mdouble-float  -mdsp  -mno-dsp  -mdspr2  -mno-dspr2 @gol
669 -mfpu=@var{fpu-type} @gol
670 -msmartmips  -mno-smartmips @gol
671 -mpaired-single  -mno-paired-single  -mdmx  -mno-mdmx @gol
672 -mips3d  -mno-mips3d  -mmt  -mno-mt  -mllsc  -mno-llsc @gol
673 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
674 -G@var{num}  -mlocal-sdata  -mno-local-sdata @gol
675 -mextern-sdata  -mno-extern-sdata  -mgpopt  -mno-gopt @gol
676 -membedded-data  -mno-embedded-data @gol
677 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
678 -mcode-readable=@var{setting} @gol
679 -msplit-addresses  -mno-split-addresses @gol
680 -mexplicit-relocs  -mno-explicit-relocs @gol
681 -mcheck-zero-division  -mno-check-zero-division @gol
682 -mdivide-traps  -mdivide-breaks @gol
683 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
684 -mmad  -mno-mad  -mfused-madd  -mno-fused-madd  -nocpp @gol
685 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
686 -mfix-r10000 -mno-fix-r10000  -mfix-vr4120  -mno-fix-vr4120 @gol
687 -mfix-vr4130  -mno-fix-vr4130  -mfix-sb1  -mno-fix-sb1 @gol
688 -mflush-func=@var{func}  -mno-flush-func @gol
689 -mbranch-cost=@var{num}  -mbranch-likely  -mno-branch-likely @gol
690 -mfp-exceptions -mno-fp-exceptions @gol
691 -mvr4130-align -mno-vr4130-align}
692
693 @emph{MMIX Options}
694 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
695 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
696 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
697 -mno-base-addresses  -msingle-exit  -mno-single-exit}
698
699 @emph{MN10300 Options}
700 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
701 -mam33  -mno-am33 @gol
702 -mam33-2  -mno-am33-2 @gol
703 -mreturn-pointer-on-d0 @gol
704 -mno-crt0  -mrelax}
705
706 @emph{PDP-11 Options}
707 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
708 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
709 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
710 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
711 -mbranch-expensive  -mbranch-cheap @gol
712 -msplit  -mno-split  -munix-asm  -mdec-asm}
713
714 @emph{picoChip Options}
715 @gccoptlist{-mae=@var{ae_type} -mvliw-lookahead=@var{N}
716 -msymbol-as-address -mno-inefficient-warnings}
717
718 @emph{PowerPC Options}
719 See RS/6000 and PowerPC Options.
720
721 @emph{RS/6000 and PowerPC Options}
722 @gccoptlist{-mcpu=@var{cpu-type} @gol
723 -mtune=@var{cpu-type} @gol
724 -mpower  -mno-power  -mpower2  -mno-power2 @gol
725 -mpowerpc  -mpowerpc64  -mno-powerpc @gol
726 -maltivec  -mno-altivec @gol
727 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
728 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
729 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb  -mfprnd  -mno-fprnd @gol
730 -mcmpb -mno-cmpb -mmfpgpr -mno-mfpgpr -mhard-dfp -mno-hard-dfp @gol
731 -mnew-mnemonics  -mold-mnemonics @gol
732 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
733 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
734 -malign-power  -malign-natural @gol
735 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
736 -msingle-float -mdouble-float -msimple-fpu @gol
737 -mstring  -mno-string  -mupdate  -mno-update @gol
738 -mavoid-indexed-addresses  -mno-avoid-indexed-addresses @gol
739 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
740 -mstrict-align  -mno-strict-align  -mrelocatable @gol
741 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
742 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
743 -mdynamic-no-pic  -maltivec  -mswdiv @gol
744 -mprioritize-restricted-insns=@var{priority} @gol
745 -msched-costly-dep=@var{dependence_type} @gol
746 -minsert-sched-nops=@var{scheme} @gol
747 -mcall-sysv  -mcall-netbsd @gol
748 -maix-struct-return  -msvr4-struct-return @gol
749 -mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
750 -misel -mno-isel @gol
751 -misel=yes  -misel=no @gol
752 -mspe -mno-spe @gol
753 -mspe=yes  -mspe=no @gol
754 -mpaired @gol
755 -mgen-cell-microcode -mwarn-cell-microcode @gol
756 -mvrsave -mno-vrsave @gol
757 -mmulhw -mno-mulhw @gol
758 -mdlmzb -mno-dlmzb @gol
759 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
760 -mprototype  -mno-prototype @gol
761 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
762 -msdata=@var{opt}  -mvxworks  -G @var{num}  -pthread}
763
764 @emph{S/390 and zSeries Options}
765 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
766 -mhard-float  -msoft-float  -mhard-dfp -mno-hard-dfp @gol
767 -mlong-double-64 -mlong-double-128 @gol
768 -mbackchain  -mno-backchain -mpacked-stack  -mno-packed-stack @gol
769 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
770 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
771 -mtpf-trace -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
772 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size -mstack-guard}
773
774 @emph{Score Options}
775 @gccoptlist{-meb -mel @gol
776 -mnhwloop @gol
777 -muls @gol
778 -mmac @gol
779 -mscore5 -mscore5u -mscore7 -mscore7d}
780
781 @emph{SH Options}
782 @gccoptlist{-m1  -m2  -m2e @gol
783 -m2a-nofpu -m2a-single-only -m2a-single -m2a @gol
784 -m3  -m3e @gol
785 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
786 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol
787 -m5-64media  -m5-64media-nofpu @gol
788 -m5-32media  -m5-32media-nofpu @gol
789 -m5-compact  -m5-compact-nofpu @gol
790 -mb  -ml  -mdalign  -mrelax @gol
791 -mbigtable  -mfmovd  -mhitachi -mrenesas -mno-renesas -mnomacsave @gol
792 -mieee  -mbitops  -misize  -minline-ic_invalidate -mpadstruct  -mspace @gol
793 -mprefergot  -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
794 -mdivsi3_libfunc=@var{name} -mfixed-range=@var{register-range} @gol
795 -madjust-unroll -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol
796 -minvalid-symbols}
797
798 @emph{SPARC Options}
799 @gccoptlist{-mcpu=@var{cpu-type} @gol
800 -mtune=@var{cpu-type} @gol
801 -mcmodel=@var{code-model} @gol
802 -m32  -m64  -mapp-regs  -mno-app-regs @gol
803 -mfaster-structs  -mno-faster-structs @gol
804 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
805 -mhard-quad-float  -msoft-quad-float @gol
806 -mimpure-text  -mno-impure-text  -mlittle-endian @gol
807 -mstack-bias  -mno-stack-bias @gol
808 -munaligned-doubles  -mno-unaligned-doubles @gol
809 -mv8plus  -mno-v8plus  -mvis  -mno-vis
810 -threads -pthreads -pthread}
811
812 @emph{SPU Options}
813 @gccoptlist{-mwarn-reloc -merror-reloc @gol
814 -msafe-dma -munsafe-dma @gol
815 -mbranch-hints @gol
816 -msmall-mem -mlarge-mem -mstdmain @gol
817 -mfixed-range=@var{register-range}}
818
819 @emph{System V Options}
820 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
821
822 @emph{V850 Options}
823 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
824 -mprolog-function  -mno-prolog-function  -mspace @gol
825 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
826 -mapp-regs  -mno-app-regs @gol
827 -mdisable-callt  -mno-disable-callt @gol
828 -mv850e1 @gol
829 -mv850e @gol
830 -mv850  -mbig-switch}
831
832 @emph{VAX Options}
833 @gccoptlist{-mg  -mgnu  -munix}
834
835 @emph{VxWorks Options}
836 @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
837 -Xbind-lazy  -Xbind-now}
838
839 @emph{x86-64 Options}
840 See i386 and x86-64 Options.
841
842 @emph{i386 and x86-64 Windows Options}
843 @gccoptlist{-mconsole -mcygwin -mno-cygwin -mdll
844 -mnop-fun-dllimport -mthread -municode -mwin32 -mwindows}
845
846 @emph{Xstormy16 Options}
847 @gccoptlist{-msim}
848
849 @emph{Xtensa Options}
850 @gccoptlist{-mconst16 -mno-const16 @gol
851 -mfused-madd  -mno-fused-madd @gol
852 -mserialize-volatile  -mno-serialize-volatile @gol
853 -mtext-section-literals  -mno-text-section-literals @gol
854 -mtarget-align  -mno-target-align @gol
855 -mlongcalls  -mno-longcalls}
856
857 @emph{zSeries Options}
858 See S/390 and zSeries Options.
859
860 @item Code Generation Options
861 @xref{Code Gen Options,,Options for Code Generation Conventions}.
862 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
863 -ffixed-@var{reg}  -fexceptions @gol
864 -fnon-call-exceptions  -funwind-tables @gol
865 -fasynchronous-unwind-tables @gol
866 -finhibit-size-directive  -finstrument-functions @gol
867 -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol
868 -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{} @gol
869 -fno-common  -fno-ident @gol
870 -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE @gol
871 -fno-jump-tables @gol
872 -frecord-gcc-switches @gol
873 -freg-struct-return  -fshort-enums @gol
874 -fshort-double  -fshort-wchar @gol
875 -fverbose-asm  -fpack-struct[=@var{n}]  -fstack-check @gol
876 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
877 -fno-stack-limit  -fargument-alias  -fargument-noalias @gol
878 -fargument-noalias-global  -fargument-noalias-anything @gol
879 -fleading-underscore  -ftls-model=@var{model} @gol
880 -ftrapv  -fwrapv  -fbounds-check @gol
881 -fvisibility}
882 @end table
883
884 @menu
885 * Overall Options::     Controlling the kind of output:
886                         an executable, object files, assembler files,
887                         or preprocessed source.
888 * C Dialect Options::   Controlling the variant of C language compiled.
889 * C++ Dialect Options:: Variations on C++.
890 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
891                         and Objective-C++.
892 * Language Independent Options:: Controlling how diagnostics should be
893                         formatted.
894 * Warning Options::     How picky should the compiler be?
895 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
896 * Optimize Options::    How much optimization?
897 * Preprocessor Options:: Controlling header files and macro definitions.
898                          Also, getting dependency information for Make.
899 * Assembler Options::   Passing options to the assembler.
900 * Link Options::        Specifying libraries and so on.
901 * Directory Options::   Where to find header files and libraries.
902                         Where to find the compiler executable files.
903 * Spec Files::          How to pass switches to sub-processes.
904 * Target Options::      Running a cross-compiler, or an old version of GCC.
905 @end menu
906
907 @node Overall Options
908 @section Options Controlling the Kind of Output
909
910 Compilation can involve up to four stages: preprocessing, compilation
911 proper, assembly and linking, always in that order.  GCC is capable of
912 preprocessing and compiling several files either into several
913 assembler input files, or into one assembler input file; then each
914 assembler input file produces an object file, and linking combines all
915 the object files (those newly compiled, and those specified as input)
916 into an executable file.
917
918 @cindex file name suffix
919 For any given input file, the file name suffix determines what kind of
920 compilation is done:
921
922 @table @gcctabopt
923 @item @var{file}.c
924 C source code which must be preprocessed.
925
926 @item @var{file}.i
927 C source code which should not be preprocessed.
928
929 @item @var{file}.ii
930 C++ source code which should not be preprocessed.
931
932 @item @var{file}.m
933 Objective-C source code.  Note that you must link with the @file{libobjc}
934 library to make an Objective-C program work.
935
936 @item @var{file}.mi
937 Objective-C source code which should not be preprocessed.
938
939 @item @var{file}.mm
940 @itemx @var{file}.M
941 Objective-C++ source code.  Note that you must link with the @file{libobjc}
942 library to make an Objective-C++ program work.  Note that @samp{.M} refers
943 to a literal capital M@.
944
945 @item @var{file}.mii
946 Objective-C++ source code which should not be preprocessed.
947
948 @item @var{file}.h
949 C, C++, Objective-C or Objective-C++ header file to be turned into a
950 precompiled header.
951
952 @item @var{file}.cc
953 @itemx @var{file}.cp
954 @itemx @var{file}.cxx
955 @itemx @var{file}.cpp
956 @itemx @var{file}.CPP
957 @itemx @var{file}.c++
958 @itemx @var{file}.C
959 C++ source code which must be preprocessed.  Note that in @samp{.cxx},
960 the last two letters must both be literally @samp{x}.  Likewise,
961 @samp{.C} refers to a literal capital C@.
962
963 @item @var{file}.mm
964 @itemx @var{file}.M
965 Objective-C++ source code which must be preprocessed.
966
967 @item @var{file}.mii
968 Objective-C++ source code which should not be preprocessed.
969
970 @item @var{file}.hh
971 @itemx @var{file}.H
972 @itemx @var{file}.hp
973 @itemx @var{file}.hxx
974 @itemx @var{file}.hpp
975 @itemx @var{file}.HPP
976 @itemx @var{file}.h++
977 @itemx @var{file}.tcc
978 C++ header file to be turned into a precompiled header.
979
980 @item @var{file}.f
981 @itemx @var{file}.for
982 @itemx @var{file}.ftn
983 Fixed form Fortran source code which should not be preprocessed.
984
985 @item @var{file}.F
986 @itemx @var{file}.FOR
987 @itemx @var{file}.fpp
988 @itemx @var{file}.FPP
989 @itemx @var{file}.FTN
990 Fixed form Fortran source code which must be preprocessed (with the traditional
991 preprocessor).
992
993 @item @var{file}.f90
994 @itemx @var{file}.f95
995 @itemx @var{file}.f03
996 @itemx @var{file}.f08
997 Free form Fortran source code which should not be preprocessed.
998
999 @item @var{file}.F90
1000 @itemx @var{file}.F95
1001 @itemx @var{file}.F03
1002 @itemx @var{file}.F08
1003 Free form Fortran source code which must be preprocessed (with the
1004 traditional preprocessor).
1005
1006 @c FIXME: Descriptions of Java file types.
1007 @c @var{file}.java
1008 @c @var{file}.class
1009 @c @var{file}.zip
1010 @c @var{file}.jar
1011
1012 @item @var{file}.ads
1013 Ada source code file which contains a library unit declaration (a
1014 declaration of a package, subprogram, or generic, or a generic
1015 instantiation), or a library unit renaming declaration (a package,
1016 generic, or subprogram renaming declaration).  Such files are also
1017 called @dfn{specs}.
1018
1019 @item @var{file}.adb
1020 Ada source code file containing a library unit body (a subprogram or
1021 package body).  Such files are also called @dfn{bodies}.
1022
1023 @c GCC also knows about some suffixes for languages not yet included:
1024 @c Pascal:
1025 @c @var{file}.p
1026 @c @var{file}.pas
1027 @c Ratfor:
1028 @c @var{file}.r
1029
1030 @item @var{file}.s
1031 Assembler code.
1032
1033 @item @var{file}.S
1034 @itemx @var{file}.sx
1035 Assembler code which must be preprocessed.
1036
1037 @item @var{other}
1038 An object file to be fed straight into linking.
1039 Any file name with no recognized suffix is treated this way.
1040 @end table
1041
1042 @opindex x
1043 You can specify the input language explicitly with the @option{-x} option:
1044
1045 @table @gcctabopt
1046 @item -x @var{language}
1047 Specify explicitly the @var{language} for the following input files
1048 (rather than letting the compiler choose a default based on the file
1049 name suffix).  This option applies to all following input files until
1050 the next @option{-x} option.  Possible values for @var{language} are:
1051 @smallexample
1052 c  c-header  c-cpp-output
1053 c++  c++-header  c++-cpp-output
1054 objective-c  objective-c-header  objective-c-cpp-output
1055 objective-c++ objective-c++-header objective-c++-cpp-output
1056 assembler  assembler-with-cpp
1057 ada
1058 f77  f77-cpp-input f95  f95-cpp-input
1059 java
1060 @end smallexample
1061
1062 @item -x none
1063 Turn off any specification of a language, so that subsequent files are
1064 handled according to their file name suffixes (as they are if @option{-x}
1065 has not been used at all).
1066
1067 @item -pass-exit-codes
1068 @opindex pass-exit-codes
1069 Normally the @command{gcc} program will exit with the code of 1 if any
1070 phase of the compiler returns a non-success return code.  If you specify
1071 @option{-pass-exit-codes}, the @command{gcc} program will instead return with
1072 numerically highest error produced by any phase that returned an error
1073 indication.  The C, C++, and Fortran frontends return 4, if an internal
1074 compiler error is encountered.
1075 @end table
1076
1077 If you only want some of the stages of compilation, you can use
1078 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
1079 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
1080 @command{gcc} is to stop.  Note that some combinations (for example,
1081 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
1082
1083 @table @gcctabopt
1084 @item -c
1085 @opindex c
1086 Compile or assemble the source files, but do not link.  The linking
1087 stage simply is not done.  The ultimate output is in the form of an
1088 object file for each source file.
1089
1090 By default, the object file name for a source file is made by replacing
1091 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1092
1093 Unrecognized input files, not requiring compilation or assembly, are
1094 ignored.
1095
1096 @item -S
1097 @opindex S
1098 Stop after the stage of compilation proper; do not assemble.  The output
1099 is in the form of an assembler code file for each non-assembler input
1100 file specified.
1101
1102 By default, the assembler file name for a source file is made by
1103 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1104
1105 Input files that don't require compilation are ignored.
1106
1107 @item -E
1108 @opindex E
1109 Stop after the preprocessing stage; do not run the compiler proper.  The
1110 output is in the form of preprocessed source code, which is sent to the
1111 standard output.
1112
1113 Input files which don't require preprocessing are ignored.
1114
1115 @cindex output file option
1116 @item -o @var{file}
1117 @opindex o
1118 Place output in file @var{file}.  This applies regardless to whatever
1119 sort of output is being produced, whether it be an executable file,
1120 an object file, an assembler file or preprocessed C code.
1121
1122 If @option{-o} is not specified, the default is to put an executable
1123 file in @file{a.out}, the object file for
1124 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1125 assembler file in @file{@var{source}.s}, a precompiled header file in
1126 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1127 standard output.
1128
1129 @item -v
1130 @opindex v
1131 Print (on standard error output) the commands executed to run the stages
1132 of compilation.  Also print the version number of the compiler driver
1133 program and of the preprocessor and the compiler proper.
1134
1135 @item -###
1136 @opindex ###
1137 Like @option{-v} except the commands are not executed and all command
1138 arguments are quoted.  This is useful for shell scripts to capture the
1139 driver-generated command lines.
1140
1141 @item -pipe
1142 @opindex pipe
1143 Use pipes rather than temporary files for communication between the
1144 various stages of compilation.  This fails to work on some systems where
1145 the assembler is unable to read from a pipe; but the GNU assembler has
1146 no trouble.
1147
1148 @item -combine
1149 @opindex combine
1150 If you are compiling multiple source files, this option tells the driver
1151 to pass all the source files to the compiler at once (for those
1152 languages for which the compiler can handle this).  This will allow
1153 intermodule analysis (IMA) to be performed by the compiler.  Currently the only
1154 language for which this is supported is C@.  If you pass source files for
1155 multiple languages to the driver, using this option, the driver will invoke
1156 the compiler(s) that support IMA once each, passing each compiler all the
1157 source files appropriate for it.  For those languages that do not support
1158 IMA this option will be ignored, and the compiler will be invoked once for
1159 each source file in that language.  If you use this option in conjunction
1160 with @option{-save-temps}, the compiler will generate multiple
1161 pre-processed files
1162 (one for each source file), but only one (combined) @file{.o} or
1163 @file{.s} file.
1164
1165 @item --help
1166 @opindex help
1167 Print (on the standard output) a description of the command line options
1168 understood by @command{gcc}.  If the @option{-v} option is also specified
1169 then @option{--help} will also be passed on to the various processes
1170 invoked by @command{gcc}, so that they can display the command line options
1171 they accept.  If the @option{-Wextra} option has also been specified
1172 (prior to the @option{--help} option), then command line options which
1173 have no documentation associated with them will also be displayed.
1174
1175 @item --target-help
1176 @opindex target-help
1177 Print (on the standard output) a description of target-specific command
1178 line options for each tool.  For some targets extra target-specific
1179 information may also be printed.
1180
1181 @item --help=@{@var{class}@r{|[}^@r{]}@var{qualifier}@}@r{[},@dots{}@r{]}
1182 Print (on the standard output) a description of the command line
1183 options understood by the compiler that fit into all specified classes
1184 and qualifiers.  These are the supported classes:
1185
1186 @table @asis
1187 @item @samp{optimizers}
1188 This will display all of the optimization options supported by the
1189 compiler.
1190
1191 @item @samp{warnings}
1192 This will display all of the options controlling warning messages
1193 produced by the compiler.
1194
1195 @item @samp{target}
1196 This will display target-specific options.  Unlike the
1197 @option{--target-help} option however, target-specific options of the
1198 linker and assembler will not be displayed.  This is because those
1199 tools do not currently support the extended @option{--help=} syntax.
1200
1201 @item @samp{params}
1202 This will display the values recognized by the @option{--param}
1203 option.
1204
1205 @item @var{language}
1206 This will display the options supported for @var{language}, where 
1207 @var{language} is the name of one of the languages supported in this 
1208 version of GCC.
1209
1210 @item @samp{common}
1211 This will display the options that are common to all languages.
1212 @end table
1213
1214 These are the supported qualifiers:
1215
1216 @table @asis
1217 @item @samp{undocumented}
1218 Display only those options which are undocumented.
1219
1220 @item @samp{joined}
1221 Display options which take an argument that appears after an equal
1222 sign in the same continuous piece of text, such as:
1223 @samp{--help=target}.
1224
1225 @item @samp{separate}
1226 Display options which take an argument that appears as a separate word
1227 following the original option, such as: @samp{-o output-file}.
1228 @end table
1229
1230 Thus for example to display all the undocumented target-specific
1231 switches supported by the compiler the following can be used:
1232
1233 @smallexample
1234 --help=target,undocumented
1235 @end smallexample
1236
1237 The sense of a qualifier can be inverted by prefixing it with the
1238 @samp{^} character, so for example to display all binary warning
1239 options (i.e., ones that are either on or off and that do not take an
1240 argument), which have a description the following can be used:
1241
1242 @smallexample
1243 --help=warnings,^joined,^undocumented
1244 @end smallexample
1245
1246 The argument to @option{--help=} should not consist solely of inverted
1247 qualifiers.
1248
1249 Combining several classes is possible, although this usually
1250 restricts the output by so much that there is nothing to display.  One
1251 case where it does work however is when one of the classes is
1252 @var{target}.  So for example to display all the target-specific
1253 optimization options the following can be used:
1254
1255 @smallexample
1256 --help=target,optimizers
1257 @end smallexample
1258
1259 The @option{--help=} option can be repeated on the command line.  Each
1260 successive use will display its requested class of options, skipping
1261 those that have already been displayed.
1262
1263 If the @option{-Q} option appears on the command line before the
1264 @option{--help=} option, then the descriptive text displayed by
1265 @option{--help=} is changed.  Instead of describing the displayed
1266 options, an indication is given as to whether the option is enabled,
1267 disabled or set to a specific value (assuming that the compiler
1268 knows this at the point where the @option{--help=} option is used).
1269
1270 Here is a truncated example from the ARM port of @command{gcc}:
1271
1272 @smallexample
1273   % gcc -Q -mabi=2 --help=target -c
1274   The following options are target specific:
1275   -mabi=                                2
1276   -mabort-on-noreturn                   [disabled]
1277   -mapcs                                [disabled]
1278 @end smallexample
1279
1280 The output is sensitive to the effects of previous command line
1281 options, so for example it is possible to find out which optimizations
1282 are enabled at @option{-O2} by using:
1283
1284 @smallexample
1285 -Q -O2 --help=optimizers
1286 @end smallexample
1287
1288 Alternatively you can discover which binary optimizations are enabled
1289 by @option{-O3} by using:
1290
1291 @smallexample
1292 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1293 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1294 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1295 @end smallexample
1296
1297 @item --version
1298 @opindex version
1299 Display the version number and copyrights of the invoked GCC@.
1300
1301 @item -wrapper
1302 @opindex wrapper
1303 Invoke all subcommands under a wrapper program. It takes a single
1304 comma separated list as an argument, which will be used to invoke
1305 the wrapper:
1306
1307 @smallexample
1308 gcc -c t.c -wrapper gdb,--args
1309 @end smallexample
1310
1311 This will invoke all subprograms of gcc under "gdb --args",
1312 thus cc1 invocation will be "gdb --args cc1 ...".
1313
1314 @item -fplugin=@var{name}.so
1315 Load the plugin code in file @var{name}.so, assumed to be a
1316 shared object to be dlopen'd by the compiler.  The base name of
1317 the shared object file is used to identify the plugin for the
1318 purposes of argument parsing (See
1319 @option{-fplugin-arg-@var{name}-@var{key}=@var{value}} below).
1320 Each plugin should define the callback functions specified in the
1321 Plugins API.
1322
1323 @item -fplugin-arg-@var{name}-@var{key}=@var{value}
1324 Define an argument called @var{key} with a value of @var{value}
1325 for the plugin called @var{name}.
1326
1327 @include @value{srcdir}/../libiberty/at-file.texi
1328 @end table
1329
1330 @node Invoking G++
1331 @section Compiling C++ Programs
1332
1333 @cindex suffixes for C++ source
1334 @cindex C++ source file suffixes
1335 C++ source files conventionally use one of the suffixes @samp{.C},
1336 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1337 @samp{.cxx}; C++ header files often use @samp{.hh}, @samp{.hpp},
1338 @samp{.H}, or (for shared template code) @samp{.tcc}; and
1339 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1340 files with these names and compiles them as C++ programs even if you
1341 call the compiler the same way as for compiling C programs (usually
1342 with the name @command{gcc}).
1343
1344 @findex g++
1345 @findex c++
1346 However, the use of @command{gcc} does not add the C++ library.
1347 @command{g++} is a program that calls GCC and treats @samp{.c},
1348 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1349 files unless @option{-x} is used, and automatically specifies linking
1350 against the C++ library.  This program is also useful when
1351 precompiling a C header file with a @samp{.h} extension for use in C++
1352 compilations.  On many systems, @command{g++} is also installed with
1353 the name @command{c++}.
1354
1355 @cindex invoking @command{g++}
1356 When you compile C++ programs, you may specify many of the same
1357 command-line options that you use for compiling programs in any
1358 language; or command-line options meaningful for C and related
1359 languages; or options that are meaningful only for C++ programs.
1360 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1361 explanations of options for languages related to C@.
1362 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1363 explanations of options that are meaningful only for C++ programs.
1364
1365 @node C Dialect Options
1366 @section Options Controlling C Dialect
1367 @cindex dialect options
1368 @cindex language dialect options
1369 @cindex options, dialect
1370
1371 The following options control the dialect of C (or languages derived
1372 from C, such as C++, Objective-C and Objective-C++) that the compiler
1373 accepts:
1374
1375 @table @gcctabopt
1376 @cindex ANSI support
1377 @cindex ISO support
1378 @item -ansi
1379 @opindex ansi
1380 In C mode, this is equivalent to @samp{-std=c89}. In C++ mode, it is
1381 equivalent to @samp{-std=c++98}.
1382
1383 This turns off certain features of GCC that are incompatible with ISO
1384 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1385 such as the @code{asm} and @code{typeof} keywords, and
1386 predefined macros such as @code{unix} and @code{vax} that identify the
1387 type of system you are using.  It also enables the undesirable and
1388 rarely used ISO trigraph feature.  For the C compiler,
1389 it disables recognition of C++ style @samp{//} comments as well as
1390 the @code{inline} keyword.
1391
1392 The alternate keywords @code{__asm__}, @code{__extension__},
1393 @code{__inline__} and @code{__typeof__} continue to work despite
1394 @option{-ansi}.  You would not want to use them in an ISO C program, of
1395 course, but it is useful to put them in header files that might be included
1396 in compilations done with @option{-ansi}.  Alternate predefined macros
1397 such as @code{__unix__} and @code{__vax__} are also available, with or
1398 without @option{-ansi}.
1399
1400 The @option{-ansi} option does not cause non-ISO programs to be
1401 rejected gratuitously.  For that, @option{-pedantic} is required in
1402 addition to @option{-ansi}.  @xref{Warning Options}.
1403
1404 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1405 option is used.  Some header files may notice this macro and refrain
1406 from declaring certain functions or defining certain macros that the
1407 ISO standard doesn't call for; this is to avoid interfering with any
1408 programs that might use these names for other things.
1409
1410 Functions that would normally be built in but do not have semantics
1411 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1412 functions when @option{-ansi} is used.  @xref{Other Builtins,,Other
1413 built-in functions provided by GCC}, for details of the functions
1414 affected.
1415
1416 @item -std=
1417 @opindex std
1418 Determine the language standard. @xref{Standards,,Language Standards
1419 Supported by GCC}, for details of these standard versions.  This option
1420 is currently only supported when compiling C or C++. 
1421
1422 The compiler can accept several base standards, such as @samp{c89} or
1423 @samp{c++98}, and GNU dialects of those standards, such as
1424 @samp{gnu89} or @samp{gnu++98}.  By specifying a base standard, the
1425 compiler will accept all programs following that standard and those
1426 using GNU extensions that do not contradict it.  For example,
1427 @samp{-std=c89} turns off certain features of GCC that are
1428 incompatible with ISO C90, such as the @code{asm} and @code{typeof}
1429 keywords, but not other GNU extensions that do not have a meaning in
1430 ISO C90, such as omitting the middle term of a @code{?:}
1431 expression. On the other hand, by specifying a GNU dialect of a
1432 standard, all features the compiler support are enabled, even when
1433 those features change the meaning of the base standard and some
1434 strict-conforming programs may be rejected.  The particular standard
1435 is used by @option{-pedantic} to identify which features are GNU
1436 extensions given that version of the standard. For example
1437 @samp{-std=gnu89 -pedantic} would warn about C++ style @samp{//}
1438 comments, while @samp{-std=gnu99 -pedantic} would not.
1439
1440 A value for this option must be provided; possible values are
1441
1442 @table @samp
1443 @item c89
1444 @itemx iso9899:1990
1445 Support all ISO C90 programs (certain GNU extensions that conflict
1446 with ISO C90 are disabled). Same as @option{-ansi} for C code.
1447
1448 @item iso9899:199409
1449 ISO C90 as modified in amendment 1.
1450
1451 @item c99
1452 @itemx c9x
1453 @itemx iso9899:1999
1454 @itemx iso9899:199x
1455 ISO C99.  Note that this standard is not yet fully supported; see
1456 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1457 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1458
1459 @item gnu89
1460 GNU dialect of ISO C90 (including some C99 features). This
1461 is the default for C code.
1462
1463 @item gnu99
1464 @itemx gnu9x
1465 GNU dialect of ISO C99.  When ISO C99 is fully implemented in GCC,
1466 this will become the default.  The name @samp{gnu9x} is deprecated.
1467
1468 @item c++98
1469 The 1998 ISO C++ standard plus amendments. Same as @option{-ansi} for
1470 C++ code.
1471
1472 @item gnu++98
1473 GNU dialect of @option{-std=c++98}.  This is the default for
1474 C++ code.
1475
1476 @item c++0x
1477 The working draft of the upcoming ISO C++0x standard. This option
1478 enables experimental features that are likely to be included in
1479 C++0x. The working draft is constantly changing, and any feature that is
1480 enabled by this flag may be removed from future versions of GCC if it is
1481 not part of the C++0x standard.
1482
1483 @item gnu++0x
1484 GNU dialect of @option{-std=c++0x}. This option enables
1485 experimental features that may be removed in future versions of GCC.
1486 @end table
1487
1488 @item -fgnu89-inline
1489 @opindex fgnu89-inline
1490 The option @option{-fgnu89-inline} tells GCC to use the traditional
1491 GNU semantics for @code{inline} functions when in C99 mode.
1492 @xref{Inline,,An Inline Function is As Fast As a Macro}.  This option
1493 is accepted and ignored by GCC versions 4.1.3 up to but not including
1494 4.3.  In GCC versions 4.3 and later it changes the behavior of GCC in
1495 C99 mode.  Using this option is roughly equivalent to adding the
1496 @code{gnu_inline} function attribute to all inline functions
1497 (@pxref{Function Attributes}).
1498
1499 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
1500 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
1501 specifies the default behavior).  This option was first supported in
1502 GCC 4.3.  This option is not supported in C89 or gnu89 mode.
1503
1504 The preprocessor macros @code{__GNUC_GNU_INLINE__} and
1505 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
1506 in effect for @code{inline} functions.  @xref{Common Predefined
1507 Macros,,,cpp,The C Preprocessor}.
1508
1509 @item -aux-info @var{filename}
1510 @opindex aux-info
1511 Output to the given filename prototyped declarations for all functions
1512 declared and/or defined in a translation unit, including those in header
1513 files.  This option is silently ignored in any language other than C@.
1514
1515 Besides declarations, the file indicates, in comments, the origin of
1516 each declaration (source file and line), whether the declaration was
1517 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1518 @samp{O} for old, respectively, in the first character after the line
1519 number and the colon), and whether it came from a declaration or a
1520 definition (@samp{C} or @samp{F}, respectively, in the following
1521 character).  In the case of function definitions, a K&R-style list of
1522 arguments followed by their declarations is also provided, inside
1523 comments, after the declaration.
1524
1525 @item -fno-asm
1526 @opindex fno-asm
1527 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1528 keyword, so that code can use these words as identifiers.  You can use
1529 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1530 instead.  @option{-ansi} implies @option{-fno-asm}.
1531
1532 In C++, this switch only affects the @code{typeof} keyword, since
1533 @code{asm} and @code{inline} are standard keywords.  You may want to
1534 use the @option{-fno-gnu-keywords} flag instead, which has the same
1535 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1536 switch only affects the @code{asm} and @code{typeof} keywords, since
1537 @code{inline} is a standard keyword in ISO C99.
1538
1539 @item -fno-builtin
1540 @itemx -fno-builtin-@var{function}
1541 @opindex fno-builtin
1542 @cindex built-in functions
1543 Don't recognize built-in functions that do not begin with
1544 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1545 functions provided by GCC}, for details of the functions affected,
1546 including those which are not built-in functions when @option{-ansi} or
1547 @option{-std} options for strict ISO C conformance are used because they
1548 do not have an ISO standard meaning.
1549
1550 GCC normally generates special code to handle certain built-in functions
1551 more efficiently; for instance, calls to @code{alloca} may become single
1552 instructions that adjust the stack directly, and calls to @code{memcpy}
1553 may become inline copy loops.  The resulting code is often both smaller
1554 and faster, but since the function calls no longer appear as such, you
1555 cannot set a breakpoint on those calls, nor can you change the behavior
1556 of the functions by linking with a different library.  In addition,
1557 when a function is recognized as a built-in function, GCC may use
1558 information about that function to warn about problems with calls to
1559 that function, or to generate more efficient code, even if the
1560 resulting code still contains calls to that function.  For example,
1561 warnings are given with @option{-Wformat} for bad calls to
1562 @code{printf}, when @code{printf} is built in, and @code{strlen} is
1563 known not to modify global memory.
1564
1565 With the @option{-fno-builtin-@var{function}} option
1566 only the built-in function @var{function} is
1567 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1568 function is named that is not built-in in this version of GCC, this
1569 option is ignored.  There is no corresponding
1570 @option{-fbuiltin-@var{function}} option; if you wish to enable
1571 built-in functions selectively when using @option{-fno-builtin} or
1572 @option{-ffreestanding}, you may define macros such as:
1573
1574 @smallexample
1575 #define abs(n)          __builtin_abs ((n))
1576 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1577 @end smallexample
1578
1579 @item -fhosted
1580 @opindex fhosted
1581 @cindex hosted environment
1582
1583 Assert that compilation takes place in a hosted environment.  This implies
1584 @option{-fbuiltin}.  A hosted environment is one in which the
1585 entire standard library is available, and in which @code{main} has a return
1586 type of @code{int}.  Examples are nearly everything except a kernel.
1587 This is equivalent to @option{-fno-freestanding}.
1588
1589 @item -ffreestanding
1590 @opindex ffreestanding
1591 @cindex hosted environment
1592
1593 Assert that compilation takes place in a freestanding environment.  This
1594 implies @option{-fno-builtin}.  A freestanding environment
1595 is one in which the standard library may not exist, and program startup may
1596 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1597 This is equivalent to @option{-fno-hosted}.
1598
1599 @xref{Standards,,Language Standards Supported by GCC}, for details of
1600 freestanding and hosted environments.
1601
1602 @item -fopenmp
1603 @opindex fopenmp
1604 @cindex openmp parallel
1605 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
1606 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
1607 compiler generates parallel code according to the OpenMP Application
1608 Program Interface v3.0 @w{@uref{http://www.openmp.org/}}.  This option
1609 implies @option{-pthread}, and thus is only supported on targets that
1610 have support for @option{-pthread}.
1611
1612 @item -fms-extensions
1613 @opindex fms-extensions
1614 Accept some non-standard constructs used in Microsoft header files.
1615
1616 Some cases of unnamed fields in structures and unions are only
1617 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
1618 fields within structs/unions}, for details.
1619
1620 @item -trigraphs
1621 @opindex trigraphs
1622 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
1623 options for strict ISO C conformance) implies @option{-trigraphs}.
1624
1625 @item -no-integrated-cpp
1626 @opindex no-integrated-cpp
1627 Performs a compilation in two passes: preprocessing and compiling.  This
1628 option allows a user supplied "cc1", "cc1plus", or "cc1obj" via the
1629 @option{-B} option.  The user supplied compilation step can then add in
1630 an additional preprocessing step after normal preprocessing but before
1631 compiling.  The default is to use the integrated cpp (internal cpp)
1632
1633 The semantics of this option will change if "cc1", "cc1plus", and
1634 "cc1obj" are merged.
1635
1636 @cindex traditional C language
1637 @cindex C language, traditional
1638 @item -traditional
1639 @itemx -traditional-cpp
1640 @opindex traditional-cpp
1641 @opindex traditional
1642 Formerly, these options caused GCC to attempt to emulate a pre-standard
1643 C compiler.  They are now only supported with the @option{-E} switch.
1644 The preprocessor continues to support a pre-standard mode.  See the GNU
1645 CPP manual for details.
1646
1647 @item -fcond-mismatch
1648 @opindex fcond-mismatch
1649 Allow conditional expressions with mismatched types in the second and
1650 third arguments.  The value of such an expression is void.  This option
1651 is not supported for C++.
1652
1653 @item -flax-vector-conversions
1654 @opindex flax-vector-conversions
1655 Allow implicit conversions between vectors with differing numbers of
1656 elements and/or incompatible element types.  This option should not be
1657 used for new code.
1658
1659 @item -funsigned-char
1660 @opindex funsigned-char
1661 Let the type @code{char} be unsigned, like @code{unsigned char}.
1662
1663 Each kind of machine has a default for what @code{char} should
1664 be.  It is either like @code{unsigned char} by default or like
1665 @code{signed char} by default.
1666
1667 Ideally, a portable program should always use @code{signed char} or
1668 @code{unsigned char} when it depends on the signedness of an object.
1669 But many programs have been written to use plain @code{char} and
1670 expect it to be signed, or expect it to be unsigned, depending on the
1671 machines they were written for.  This option, and its inverse, let you
1672 make such a program work with the opposite default.
1673
1674 The type @code{char} is always a distinct type from each of
1675 @code{signed char} or @code{unsigned char}, even though its behavior
1676 is always just like one of those two.
1677
1678 @item -fsigned-char
1679 @opindex fsigned-char
1680 Let the type @code{char} be signed, like @code{signed char}.
1681
1682 Note that this is equivalent to @option{-fno-unsigned-char}, which is
1683 the negative form of @option{-funsigned-char}.  Likewise, the option
1684 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
1685
1686 @item -fsigned-bitfields
1687 @itemx -funsigned-bitfields
1688 @itemx -fno-signed-bitfields
1689 @itemx -fno-unsigned-bitfields
1690 @opindex fsigned-bitfields
1691 @opindex funsigned-bitfields
1692 @opindex fno-signed-bitfields
1693 @opindex fno-unsigned-bitfields
1694 These options control whether a bit-field is signed or unsigned, when the
1695 declaration does not use either @code{signed} or @code{unsigned}.  By
1696 default, such a bit-field is signed, because this is consistent: the
1697 basic integer types such as @code{int} are signed types.
1698 @end table
1699
1700 @node C++ Dialect Options
1701 @section Options Controlling C++ Dialect
1702
1703 @cindex compiler options, C++
1704 @cindex C++ options, command line
1705 @cindex options, C++
1706 This section describes the command-line options that are only meaningful
1707 for C++ programs; but you can also use most of the GNU compiler options
1708 regardless of what language your program is in.  For example, you
1709 might compile a file @code{firstClass.C} like this:
1710
1711 @smallexample
1712 g++ -g -frepo -O -c firstClass.C
1713 @end smallexample
1714
1715 @noindent
1716 In this example, only @option{-frepo} is an option meant
1717 only for C++ programs; you can use the other options with any
1718 language supported by GCC@.
1719
1720 Here is a list of options that are @emph{only} for compiling C++ programs:
1721
1722 @table @gcctabopt
1723
1724 @item -fabi-version=@var{n}
1725 @opindex fabi-version
1726 Use version @var{n} of the C++ ABI@.  Version 2 is the version of the
1727 C++ ABI that first appeared in G++ 3.4.  Version 1 is the version of
1728 the C++ ABI that first appeared in G++ 3.2.  Version 0 will always be
1729 the version that conforms most closely to the C++ ABI specification.
1730 Therefore, the ABI obtained using version 0 will change as ABI bugs
1731 are fixed.
1732
1733 The default is version 2.
1734
1735 @item -fno-access-control
1736 @opindex fno-access-control
1737 Turn off all access checking.  This switch is mainly useful for working
1738 around bugs in the access control code.
1739
1740 @item -fcheck-new
1741 @opindex fcheck-new
1742 Check that the pointer returned by @code{operator new} is non-null
1743 before attempting to modify the storage allocated.  This check is
1744 normally unnecessary because the C++ standard specifies that
1745 @code{operator new} will only return @code{0} if it is declared
1746 @samp{throw()}, in which case the compiler will always check the
1747 return value even without this option.  In all other cases, when
1748 @code{operator new} has a non-empty exception specification, memory
1749 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
1750 @samp{new (nothrow)}.
1751
1752 @item -fconserve-space
1753 @opindex fconserve-space
1754 Put uninitialized or runtime-initialized global variables into the
1755 common segment, as C does.  This saves space in the executable at the
1756 cost of not diagnosing duplicate definitions.  If you compile with this
1757 flag and your program mysteriously crashes after @code{main()} has
1758 completed, you may have an object that is being destroyed twice because
1759 two definitions were merged.
1760
1761 This option is no longer useful on most targets, now that support has
1762 been added for putting variables into BSS without making them common.
1763
1764 @item -ffriend-injection
1765 @opindex ffriend-injection
1766 Inject friend functions into the enclosing namespace, so that they are
1767 visible outside the scope of the class in which they are declared.
1768 Friend functions were documented to work this way in the old Annotated
1769 C++ Reference Manual, and versions of G++ before 4.1 always worked
1770 that way.  However, in ISO C++ a friend function which is not declared
1771 in an enclosing scope can only be found using argument dependent
1772 lookup.  This option causes friends to be injected as they were in
1773 earlier releases.
1774
1775 This option is for compatibility, and may be removed in a future
1776 release of G++.
1777
1778 @item -fno-elide-constructors
1779 @opindex fno-elide-constructors
1780 The C++ standard allows an implementation to omit creating a temporary
1781 which is only used to initialize another object of the same type.
1782 Specifying this option disables that optimization, and forces G++ to
1783 call the copy constructor in all cases.
1784
1785 @item -fno-enforce-eh-specs
1786 @opindex fno-enforce-eh-specs
1787 Don't generate code to check for violation of exception specifications
1788 at runtime.  This option violates the C++ standard, but may be useful
1789 for reducing code size in production builds, much like defining
1790 @samp{NDEBUG}.  This does not give user code permission to throw
1791 exceptions in violation of the exception specifications; the compiler
1792 will still optimize based on the specifications, so throwing an
1793 unexpected exception will result in undefined behavior.
1794
1795 @item -ffor-scope
1796 @itemx -fno-for-scope
1797 @opindex ffor-scope
1798 @opindex fno-for-scope
1799 If @option{-ffor-scope} is specified, the scope of variables declared in
1800 a @i{for-init-statement} is limited to the @samp{for} loop itself,
1801 as specified by the C++ standard.
1802 If @option{-fno-for-scope} is specified, the scope of variables declared in
1803 a @i{for-init-statement} extends to the end of the enclosing scope,
1804 as was the case in old versions of G++, and other (traditional)
1805 implementations of C++.
1806
1807 The default if neither flag is given to follow the standard,
1808 but to allow and give a warning for old-style code that would
1809 otherwise be invalid, or have different behavior.
1810
1811 @item -fno-gnu-keywords
1812 @opindex fno-gnu-keywords
1813 Do not recognize @code{typeof} as a keyword, so that code can use this
1814 word as an identifier.  You can use the keyword @code{__typeof__} instead.
1815 @option{-ansi} implies @option{-fno-gnu-keywords}.
1816
1817 @item -fno-implicit-templates
1818 @opindex fno-implicit-templates
1819 Never emit code for non-inline templates which are instantiated
1820 implicitly (i.e.@: by use); only emit code for explicit instantiations.
1821 @xref{Template Instantiation}, for more information.
1822
1823 @item -fno-implicit-inline-templates
1824 @opindex fno-implicit-inline-templates
1825 Don't emit code for implicit instantiations of inline templates, either.
1826 The default is to handle inlines differently so that compiles with and
1827 without optimization will need the same set of explicit instantiations.
1828
1829 @item -fno-implement-inlines
1830 @opindex fno-implement-inlines
1831 To save space, do not emit out-of-line copies of inline functions
1832 controlled by @samp{#pragma implementation}.  This will cause linker
1833 errors if these functions are not inlined everywhere they are called.
1834
1835 @item -fms-extensions
1836 @opindex fms-extensions
1837 Disable pedantic warnings about constructs used in MFC, such as implicit
1838 int and getting a pointer to member function via non-standard syntax.
1839
1840 @item -fno-nonansi-builtins
1841 @opindex fno-nonansi-builtins
1842 Disable built-in declarations of functions that are not mandated by
1843 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
1844 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
1845
1846 @item -fno-operator-names
1847 @opindex fno-operator-names
1848 Do not treat the operator name keywords @code{and}, @code{bitand},
1849 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
1850 synonyms as keywords.
1851
1852 @item -fno-optional-diags
1853 @opindex fno-optional-diags
1854 Disable diagnostics that the standard says a compiler does not need to
1855 issue.  Currently, the only such diagnostic issued by G++ is the one for
1856 a name having multiple meanings within a class.
1857
1858 @item -fpermissive
1859 @opindex fpermissive
1860 Downgrade some diagnostics about nonconformant code from errors to
1861 warnings.  Thus, using @option{-fpermissive} will allow some
1862 nonconforming code to compile.
1863
1864 @item -fno-pretty-templates
1865 @opindex fno-pretty-templates
1866 When an error message refers to a specialization of a function
1867 template, the compiler will normally print the signature of the
1868 template followed by the template arguments and any typedefs or
1869 typenames in the signature (e.g. @code{void f(T) [with T = int]}
1870 rather than @code{void f(int)}) so that it's clear which template is
1871 involved.  When an error message refers to a specialization of a class
1872 template, the compiler will omit any template arguments which match
1873 the default template arguments for that template.  If either of these
1874 behaviors make it harder to understand the error message rather than
1875 easier, using @option{-fno-pretty-templates} will disable them.
1876
1877 @item -frepo
1878 @opindex frepo
1879 Enable automatic template instantiation at link time.  This option also
1880 implies @option{-fno-implicit-templates}.  @xref{Template
1881 Instantiation}, for more information.
1882
1883 @item -fno-rtti
1884 @opindex fno-rtti
1885 Disable generation of information about every class with virtual
1886 functions for use by the C++ runtime type identification features
1887 (@samp{dynamic_cast} and @samp{typeid}).  If you don't use those parts
1888 of the language, you can save some space by using this flag.  Note that
1889 exception handling uses the same information, but it will generate it as
1890 needed. The @samp{dynamic_cast} operator can still be used for casts that
1891 do not require runtime type information, i.e.@: casts to @code{void *} or to
1892 unambiguous base classes.
1893
1894 @item -fstats
1895 @opindex fstats
1896 Emit statistics about front-end processing at the end of the compilation.
1897 This information is generally only useful to the G++ development team.
1898
1899 @item -ftemplate-depth-@var{n}
1900 @opindex ftemplate-depth
1901 Set the maximum instantiation depth for template classes to @var{n}.
1902 A limit on the template instantiation depth is needed to detect
1903 endless recursions during template class instantiation.  ANSI/ISO C++
1904 conforming programs must not rely on a maximum depth greater than 17.
1905
1906 @item -fno-threadsafe-statics
1907 @opindex fno-threadsafe-statics
1908 Do not emit the extra code to use the routines specified in the C++
1909 ABI for thread-safe initialization of local statics.  You can use this
1910 option to reduce code size slightly in code that doesn't need to be
1911 thread-safe.
1912
1913 @item -fuse-cxa-atexit
1914 @opindex fuse-cxa-atexit
1915 Register destructors for objects with static storage duration with the
1916 @code{__cxa_atexit} function rather than the @code{atexit} function.
1917 This option is required for fully standards-compliant handling of static
1918 destructors, but will only work if your C library supports
1919 @code{__cxa_atexit}.
1920
1921 @item -fno-use-cxa-get-exception-ptr
1922 @opindex fno-use-cxa-get-exception-ptr
1923 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
1924 will cause @code{std::uncaught_exception} to be incorrect, but is necessary
1925 if the runtime routine is not available.
1926
1927 @item -fvisibility-inlines-hidden
1928 @opindex fvisibility-inlines-hidden
1929 This switch declares that the user does not attempt to compare
1930 pointers to inline methods where the addresses of the two functions
1931 were taken in different shared objects.
1932
1933 The effect of this is that GCC may, effectively, mark inline methods with
1934 @code{__attribute__ ((visibility ("hidden")))} so that they do not
1935 appear in the export table of a DSO and do not require a PLT indirection
1936 when used within the DSO@.  Enabling this option can have a dramatic effect
1937 on load and link times of a DSO as it massively reduces the size of the
1938 dynamic export table when the library makes heavy use of templates.
1939
1940 The behavior of this switch is not quite the same as marking the
1941 methods as hidden directly, because it does not affect static variables
1942 local to the function or cause the compiler to deduce that
1943 the function is defined in only one shared object.
1944
1945 You may mark a method as having a visibility explicitly to negate the
1946 effect of the switch for that method.  For example, if you do want to
1947 compare pointers to a particular inline method, you might mark it as
1948 having default visibility.  Marking the enclosing class with explicit
1949 visibility will have no effect.
1950
1951 Explicitly instantiated inline methods are unaffected by this option
1952 as their linkage might otherwise cross a shared library boundary.
1953 @xref{Template Instantiation}.
1954
1955 @item -fvisibility-ms-compat
1956 @opindex fvisibility-ms-compat
1957 This flag attempts to use visibility settings to make GCC's C++
1958 linkage model compatible with that of Microsoft Visual Studio.
1959
1960 The flag makes these changes to GCC's linkage model:
1961
1962 @enumerate
1963 @item
1964 It sets the default visibility to @code{hidden}, like
1965 @option{-fvisibility=hidden}.
1966
1967 @item
1968 Types, but not their members, are not hidden by default.
1969
1970 @item
1971 The One Definition Rule is relaxed for types without explicit
1972 visibility specifications which are defined in more than one different
1973 shared object: those declarations are permitted if they would have
1974 been permitted when this option was not used.
1975 @end enumerate
1976
1977 In new code it is better to use @option{-fvisibility=hidden} and
1978 export those classes which are intended to be externally visible.
1979 Unfortunately it is possible for code to rely, perhaps accidentally,
1980 on the Visual Studio behavior.
1981
1982 Among the consequences of these changes are that static data members
1983 of the same type with the same name but defined in different shared
1984 objects will be different, so changing one will not change the other;
1985 and that pointers to function members defined in different shared
1986 objects may not compare equal.  When this flag is given, it is a
1987 violation of the ODR to define types with the same name differently.
1988
1989 @item -fno-weak
1990 @opindex fno-weak
1991 Do not use weak symbol support, even if it is provided by the linker.
1992 By default, G++ will use weak symbols if they are available.  This
1993 option exists only for testing, and should not be used by end-users;
1994 it will result in inferior code and has no benefits.  This option may
1995 be removed in a future release of G++.
1996
1997 @item -nostdinc++
1998 @opindex nostdinc++
1999 Do not search for header files in the standard directories specific to
2000 C++, but do still search the other standard directories.  (This option
2001 is used when building the C++ library.)
2002 @end table
2003
2004 In addition, these optimization, warning, and code generation options
2005 have meanings only for C++ programs:
2006
2007 @table @gcctabopt
2008 @item -fno-default-inline
2009 @opindex fno-default-inline
2010 Do not assume @samp{inline} for functions defined inside a class scope.
2011 @xref{Optimize Options,,Options That Control Optimization}.  Note that these
2012 functions will have linkage like inline functions; they just won't be
2013 inlined by default.
2014
2015 @item -Wabi @r{(C, Objective-C, C++ and Objective-C++ only)}
2016 @opindex Wabi
2017 @opindex Wno-abi
2018 Warn when G++ generates code that is probably not compatible with the
2019 vendor-neutral C++ ABI@.  Although an effort has been made to warn about
2020 all such cases, there are probably some cases that are not warned about,
2021 even though G++ is generating incompatible code.  There may also be
2022 cases where warnings are emitted even though the code that is generated
2023 will be compatible.
2024
2025 You should rewrite your code to avoid these warnings if you are
2026 concerned about the fact that code generated by G++ may not be binary
2027 compatible with code generated by other compilers.
2028
2029 The known incompatibilities at this point include:
2030
2031 @itemize @bullet
2032
2033 @item
2034 Incorrect handling of tail-padding for bit-fields.  G++ may attempt to
2035 pack data into the same byte as a base class.  For example:
2036
2037 @smallexample
2038 struct A @{ virtual void f(); int f1 : 1; @};
2039 struct B : public A @{ int f2 : 1; @};
2040 @end smallexample
2041
2042 @noindent
2043 In this case, G++ will place @code{B::f2} into the same byte
2044 as@code{A::f1}; other compilers will not.  You can avoid this problem
2045 by explicitly padding @code{A} so that its size is a multiple of the
2046 byte size on your platform; that will cause G++ and other compilers to
2047 layout @code{B} identically.
2048
2049 @item
2050 Incorrect handling of tail-padding for virtual bases.  G++ does not use
2051 tail padding when laying out virtual bases.  For example:
2052
2053 @smallexample
2054 struct A @{ virtual void f(); char c1; @};
2055 struct B @{ B(); char c2; @};
2056 struct C : public A, public virtual B @{@};
2057 @end smallexample
2058
2059 @noindent
2060 In this case, G++ will not place @code{B} into the tail-padding for
2061 @code{A}; other compilers will.  You can avoid this problem by
2062 explicitly padding @code{A} so that its size is a multiple of its
2063 alignment (ignoring virtual base classes); that will cause G++ and other
2064 compilers to layout @code{C} identically.
2065
2066 @item
2067 Incorrect handling of bit-fields with declared widths greater than that
2068 of their underlying types, when the bit-fields appear in a union.  For
2069 example:
2070
2071 @smallexample
2072 union U @{ int i : 4096; @};
2073 @end smallexample
2074
2075 @noindent
2076 Assuming that an @code{int} does not have 4096 bits, G++ will make the
2077 union too small by the number of bits in an @code{int}.
2078
2079 @item
2080 Empty classes can be placed at incorrect offsets.  For example:
2081
2082 @smallexample
2083 struct A @{@};
2084
2085 struct B @{
2086   A a;
2087   virtual void f ();
2088 @};
2089
2090 struct C : public B, public A @{@};
2091 @end smallexample
2092
2093 @noindent
2094 G++ will place the @code{A} base class of @code{C} at a nonzero offset;
2095 it should be placed at offset zero.  G++ mistakenly believes that the
2096 @code{A} data member of @code{B} is already at offset zero.
2097
2098 @item
2099 Names of template functions whose types involve @code{typename} or
2100 template template parameters can be mangled incorrectly.
2101
2102 @smallexample
2103 template <typename Q>
2104 void f(typename Q::X) @{@}
2105
2106 template <template <typename> class Q>
2107 void f(typename Q<int>::X) @{@}
2108 @end smallexample
2109
2110 @noindent
2111 Instantiations of these templates may be mangled incorrectly.
2112
2113 @end itemize
2114
2115 It also warns psABI related changes.  The known psABI changes at this
2116 point include:
2117
2118 @itemize @bullet
2119
2120 @item
2121 For SYSV/x86-64, when passing union with long double, it is changed to
2122 pass in memory as specified in psABI.  For example:
2123
2124 @smallexample
2125 union U @{
2126   long double ld;
2127   int i;
2128 @};
2129 @end smallexample
2130
2131 @noindent
2132 @code{union U} will always be passed in memory.
2133
2134 @end itemize
2135
2136 @item -Wctor-dtor-privacy @r{(C++ and Objective-C++ only)}
2137 @opindex Wctor-dtor-privacy
2138 @opindex Wno-ctor-dtor-privacy
2139 Warn when a class seems unusable because all the constructors or
2140 destructors in that class are private, and it has neither friends nor
2141 public static member functions.
2142
2143 @item -Wnon-virtual-dtor @r{(C++ and Objective-C++ only)}
2144 @opindex Wnon-virtual-dtor
2145 @opindex Wno-non-virtual-dtor
2146 Warn when a class has virtual functions and accessible non-virtual
2147 destructor, in which case it would be possible but unsafe to delete
2148 an instance of a derived class through a pointer to the base class.
2149 This warning is also enabled if -Weffc++ is specified.
2150
2151 @item -Wreorder @r{(C++ and Objective-C++ only)}
2152 @opindex Wreorder
2153 @opindex Wno-reorder
2154 @cindex reordering, warning
2155 @cindex warning for reordering of member initializers
2156 Warn when the order of member initializers given in the code does not
2157 match the order in which they must be executed.  For instance:
2158
2159 @smallexample
2160 struct A @{
2161   int i;
2162   int j;
2163   A(): j (0), i (1) @{ @}
2164 @};
2165 @end smallexample
2166
2167 The compiler will rearrange the member initializers for @samp{i}
2168 and @samp{j} to match the declaration order of the members, emitting
2169 a warning to that effect.  This warning is enabled by @option{-Wall}.
2170 @end table
2171
2172 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
2173
2174 @table @gcctabopt
2175 @item -Weffc++ @r{(C++ and Objective-C++ only)}
2176 @opindex Weffc++
2177 @opindex Wno-effc++
2178 Warn about violations of the following style guidelines from Scott Meyers'
2179 @cite{Effective C++} book:
2180
2181 @itemize @bullet
2182 @item
2183 Item 11:  Define a copy constructor and an assignment operator for classes
2184 with dynamically allocated memory.
2185
2186 @item
2187 Item 12:  Prefer initialization to assignment in constructors.
2188
2189 @item
2190 Item 14:  Make destructors virtual in base classes.
2191
2192 @item
2193 Item 15:  Have @code{operator=} return a reference to @code{*this}.
2194
2195 @item
2196 Item 23:  Don't try to return a reference when you must return an object.
2197
2198 @end itemize
2199
2200 Also warn about violations of the following style guidelines from
2201 Scott Meyers' @cite{More Effective C++} book:
2202
2203 @itemize @bullet
2204 @item
2205 Item 6:  Distinguish between prefix and postfix forms of increment and
2206 decrement operators.
2207
2208 @item
2209 Item 7:  Never overload @code{&&}, @code{||}, or @code{,}.
2210
2211 @end itemize
2212
2213 When selecting this option, be aware that the standard library
2214 headers do not obey all of these guidelines; use @samp{grep -v}
2215 to filter out those warnings.
2216
2217 @item -Wstrict-null-sentinel @r{(C++ and Objective-C++ only)}
2218 @opindex Wstrict-null-sentinel
2219 @opindex Wno-strict-null-sentinel
2220 Warn also about the use of an uncasted @code{NULL} as sentinel.  When
2221 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
2222 to @code{__null}.  Although it is a null pointer constant not a null pointer,
2223 it is guaranteed to be of the same size as a pointer.  But this use is
2224 not portable across different compilers.
2225
2226 @item -Wno-non-template-friend @r{(C++ and Objective-C++ only)}
2227 @opindex Wno-non-template-friend
2228 @opindex Wnon-template-friend
2229 Disable warnings when non-templatized friend functions are declared
2230 within a template.  Since the advent of explicit template specification
2231 support in G++, if the name of the friend is an unqualified-id (i.e.,
2232 @samp{friend foo(int)}), the C++ language specification demands that the
2233 friend declare or define an ordinary, nontemplate function.  (Section
2234 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
2235 could be interpreted as a particular specialization of a templatized
2236 function.  Because this non-conforming behavior is no longer the default
2237 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
2238 check existing code for potential trouble spots and is on by default.
2239 This new compiler behavior can be turned off with
2240 @option{-Wno-non-template-friend} which keeps the conformant compiler code
2241 but disables the helpful warning.
2242
2243 @item -Wold-style-cast @r{(C++ and Objective-C++ only)}
2244 @opindex Wold-style-cast
2245 @opindex Wno-old-style-cast
2246 Warn if an old-style (C-style) cast to a non-void type is used within
2247 a C++ program.  The new-style casts (@samp{dynamic_cast},
2248 @samp{static_cast}, @samp{reinterpret_cast}, and @samp{const_cast}) are
2249 less vulnerable to unintended effects and much easier to search for.
2250
2251 @item -Woverloaded-virtual @r{(C++ and Objective-C++ only)}
2252 @opindex Woverloaded-virtual
2253 @opindex Wno-overloaded-virtual
2254 @cindex overloaded virtual fn, warning
2255 @cindex warning for overloaded virtual fn
2256 Warn when a function declaration hides virtual functions from a
2257 base class.  For example, in:
2258
2259 @smallexample
2260 struct A @{
2261   virtual void f();
2262 @};
2263
2264 struct B: public A @{
2265   void f(int);
2266 @};
2267 @end smallexample
2268
2269 the @code{A} class version of @code{f} is hidden in @code{B}, and code
2270 like:
2271
2272 @smallexample
2273 B* b;
2274 b->f();
2275 @end smallexample
2276
2277 will fail to compile.
2278
2279 @item -Wno-pmf-conversions @r{(C++ and Objective-C++ only)}
2280 @opindex Wno-pmf-conversions
2281 @opindex Wpmf-conversions
2282 Disable the diagnostic for converting a bound pointer to member function
2283 to a plain pointer.
2284
2285 @item -Wsign-promo @r{(C++ and Objective-C++ only)}
2286 @opindex Wsign-promo
2287 @opindex Wno-sign-promo
2288 Warn when overload resolution chooses a promotion from unsigned or
2289 enumerated type to a signed type, over a conversion to an unsigned type of
2290 the same size.  Previous versions of G++ would try to preserve
2291 unsignedness, but the standard mandates the current behavior.
2292
2293 @smallexample
2294 struct A @{
2295   operator int ();
2296   A& operator = (int);
2297 @};
2298
2299 main ()
2300 @{
2301   A a,b;
2302   a = b;
2303 @}
2304 @end smallexample
2305
2306 In this example, G++ will synthesize a default @samp{A& operator =
2307 (const A&);}, while cfront will use the user-defined @samp{operator =}.
2308 @end table
2309
2310 @node Objective-C and Objective-C++ Dialect Options
2311 @section Options Controlling Objective-C and Objective-C++ Dialects
2312
2313 @cindex compiler options, Objective-C and Objective-C++
2314 @cindex Objective-C and Objective-C++ options, command line
2315 @cindex options, Objective-C and Objective-C++
2316 (NOTE: This manual does not describe the Objective-C and Objective-C++
2317 languages themselves.  See @xref{Standards,,Language Standards
2318 Supported by GCC}, for references.)
2319
2320 This section describes the command-line options that are only meaningful
2321 for Objective-C and Objective-C++ programs, but you can also use most of
2322 the language-independent GNU compiler options.
2323 For example, you might compile a file @code{some_class.m} like this:
2324
2325 @smallexample
2326 gcc -g -fgnu-runtime -O -c some_class.m
2327 @end smallexample
2328
2329 @noindent
2330 In this example, @option{-fgnu-runtime} is an option meant only for
2331 Objective-C and Objective-C++ programs; you can use the other options with
2332 any language supported by GCC@.
2333
2334 Note that since Objective-C is an extension of the C language, Objective-C
2335 compilations may also use options specific to the C front-end (e.g.,
2336 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
2337 C++-specific options (e.g., @option{-Wabi}).
2338
2339 Here is a list of options that are @emph{only} for compiling Objective-C
2340 and Objective-C++ programs:
2341
2342 @table @gcctabopt
2343 @item -fconstant-string-class=@var{class-name}
2344 @opindex fconstant-string-class
2345 Use @var{class-name} as the name of the class to instantiate for each
2346 literal string specified with the syntax @code{@@"@dots{}"}.  The default
2347 class name is @code{NXConstantString} if the GNU runtime is being used, and
2348 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
2349 @option{-fconstant-cfstrings} option, if also present, will override the
2350 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
2351 to be laid out as constant CoreFoundation strings.
2352
2353 @item -fgnu-runtime
2354 @opindex fgnu-runtime
2355 Generate object code compatible with the standard GNU Objective-C
2356 runtime.  This is the default for most types of systems.
2357
2358 @item -fnext-runtime
2359 @opindex fnext-runtime
2360 Generate output compatible with the NeXT runtime.  This is the default
2361 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
2362 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
2363 used.
2364
2365 @item -fno-nil-receivers
2366 @opindex fno-nil-receivers
2367 Assume that all Objective-C message dispatches (e.g.,
2368 @code{[receiver message:arg]}) in this translation unit ensure that the receiver
2369 is not @code{nil}.  This allows for more efficient entry points in the runtime
2370 to be used.  Currently, this option is only available in conjunction with
2371 the NeXT runtime on Mac OS X 10.3 and later.
2372
2373 @item -fobjc-call-cxx-cdtors
2374 @opindex fobjc-call-cxx-cdtors
2375 For each Objective-C class, check if any of its instance variables is a
2376 C++ object with a non-trivial default constructor.  If so, synthesize a
2377 special @code{- (id) .cxx_construct} instance method that will run
2378 non-trivial default constructors on any such instance variables, in order,
2379 and then return @code{self}.  Similarly, check if any instance variable
2380 is a C++ object with a non-trivial destructor, and if so, synthesize a
2381 special @code{- (void) .cxx_destruct} method that will run
2382 all such default destructors, in reverse order.
2383
2384 The @code{- (id) .cxx_construct} and/or @code{- (void) .cxx_destruct} methods
2385 thusly generated will only operate on instance variables declared in the
2386 current Objective-C class, and not those inherited from superclasses.  It
2387 is the responsibility of the Objective-C runtime to invoke all such methods
2388 in an object's inheritance hierarchy.  The @code{- (id) .cxx_construct} methods
2389 will be invoked by the runtime immediately after a new object
2390 instance is allocated; the @code{- (void) .cxx_destruct} methods will
2391 be invoked immediately before the runtime deallocates an object instance.
2392
2393 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
2394 support for invoking the @code{- (id) .cxx_construct} and
2395 @code{- (void) .cxx_destruct} methods.
2396
2397 @item -fobjc-direct-dispatch
2398 @opindex fobjc-direct-dispatch
2399 Allow fast jumps to the message dispatcher.  On Darwin this is
2400 accomplished via the comm page.
2401
2402 @item -fobjc-exceptions
2403 @opindex fobjc-exceptions
2404 Enable syntactic support for structured exception handling in Objective-C,
2405 similar to what is offered by C++ and Java.  This option is
2406 unavailable in conjunction with the NeXT runtime on Mac OS X 10.2 and
2407 earlier.
2408
2409 @smallexample
2410   @@try @{
2411     @dots{}
2412        @@throw expr;
2413     @dots{}
2414   @}
2415   @@catch (AnObjCClass *exc) @{
2416     @dots{}
2417       @@throw expr;
2418     @dots{}
2419       @@throw;
2420     @dots{}
2421   @}
2422   @@catch (AnotherClass *exc) @{
2423     @dots{}
2424   @}
2425   @@catch (id allOthers) @{
2426     @dots{}
2427   @}
2428   @@finally @{
2429     @dots{}
2430       @@throw expr;
2431     @dots{}
2432   @}
2433 @end smallexample
2434
2435 The @code{@@throw} statement may appear anywhere in an Objective-C or
2436 Objective-C++ program; when used inside of a @code{@@catch} block, the
2437 @code{@@throw} may appear without an argument (as shown above), in which case
2438 the object caught by the @code{@@catch} will be rethrown.
2439
2440 Note that only (pointers to) Objective-C objects may be thrown and
2441 caught using this scheme.  When an object is thrown, it will be caught
2442 by the nearest @code{@@catch} clause capable of handling objects of that type,
2443 analogously to how @code{catch} blocks work in C++ and Java.  A
2444 @code{@@catch(id @dots{})} clause (as shown above) may also be provided to catch
2445 any and all Objective-C exceptions not caught by previous @code{@@catch}
2446 clauses (if any).
2447
2448 The @code{@@finally} clause, if present, will be executed upon exit from the
2449 immediately preceding @code{@@try @dots{} @@catch} section.  This will happen
2450 regardless of whether any exceptions are thrown, caught or rethrown
2451 inside the @code{@@try @dots{} @@catch} section, analogously to the behavior
2452 of the @code{finally} clause in Java.
2453
2454 There are several caveats to using the new exception mechanism:
2455
2456 @itemize @bullet
2457 @item
2458 Although currently designed to be binary compatible with @code{NS_HANDLER}-style
2459 idioms provided by the @code{NSException} class, the new
2460 exceptions can only be used on Mac OS X 10.3 (Panther) and later
2461 systems, due to additional functionality needed in the (NeXT) Objective-C
2462 runtime.
2463
2464 @item
2465 As mentioned above, the new exceptions do not support handling
2466 types other than Objective-C objects.   Furthermore, when used from
2467 Objective-C++, the Objective-C exception model does not interoperate with C++
2468 exceptions at this time.  This means you cannot @code{@@throw} an exception
2469 from Objective-C and @code{catch} it in C++, or vice versa
2470 (i.e., @code{throw @dots{} @@catch}).
2471 @end itemize
2472
2473 The @option{-fobjc-exceptions} switch also enables the use of synchronization
2474 blocks for thread-safe execution:
2475
2476 @smallexample
2477   @@synchronized (ObjCClass *guard) @{
2478     @dots{}
2479   @}
2480 @end smallexample
2481
2482 Upon entering the @code{@@synchronized} block, a thread of execution shall
2483 first check whether a lock has been placed on the corresponding @code{guard}
2484 object by another thread.  If it has, the current thread shall wait until
2485 the other thread relinquishes its lock.  Once @code{guard} becomes available,
2486 the current thread will place its own lock on it, execute the code contained in
2487 the @code{@@synchronized} block, and finally relinquish the lock (thereby
2488 making @code{guard} available to other threads).
2489
2490 Unlike Java, Objective-C does not allow for entire methods to be marked
2491 @code{@@synchronized}.  Note that throwing exceptions out of
2492 @code{@@synchronized} blocks is allowed, and will cause the guarding object
2493 to be unlocked properly.
2494
2495 @item -fobjc-gc
2496 @opindex fobjc-gc
2497 Enable garbage collection (GC) in Objective-C and Objective-C++ programs.
2498
2499 @item -freplace-objc-classes
2500 @opindex freplace-objc-classes
2501 Emit a special marker instructing @command{ld(1)} not to statically link in
2502 the resulting object file, and allow @command{dyld(1)} to load it in at
2503 run time instead.  This is used in conjunction with the Fix-and-Continue
2504 debugging mode, where the object file in question may be recompiled and
2505 dynamically reloaded in the course of program execution, without the need
2506 to restart the program itself.  Currently, Fix-and-Continue functionality
2507 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
2508 and later.
2509
2510 @item -fzero-link
2511 @opindex fzero-link
2512 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
2513 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
2514 compile time) with static class references that get initialized at load time,
2515 which improves run-time performance.  Specifying the @option{-fzero-link} flag
2516 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
2517 to be retained.  This is useful in Zero-Link debugging mode, since it allows
2518 for individual class implementations to be modified during program execution.
2519
2520 @item -gen-decls
2521 @opindex gen-decls
2522 Dump interface declarations for all classes seen in the source file to a
2523 file named @file{@var{sourcename}.decl}.
2524
2525 @item -Wassign-intercept @r{(Objective-C and Objective-C++ only)}
2526 @opindex Wassign-intercept
2527 @opindex Wno-assign-intercept
2528 Warn whenever an Objective-C assignment is being intercepted by the
2529 garbage collector.
2530
2531 @item -Wno-protocol @r{(Objective-C and Objective-C++ only)}
2532 @opindex Wno-protocol
2533 @opindex Wprotocol
2534 If a class is declared to implement a protocol, a warning is issued for
2535 every method in the protocol that is not implemented by the class.  The
2536 default behavior is to issue a warning for every method not explicitly
2537 implemented in the class, even if a method implementation is inherited
2538 from the superclass.  If you use the @option{-Wno-protocol} option, then
2539 methods inherited from the superclass are considered to be implemented,
2540 and no warning is issued for them.
2541
2542 @item -Wselector @r{(Objective-C and Objective-C++ only)}
2543 @opindex Wselector
2544 @opindex Wno-selector
2545 Warn if multiple methods of different types for the same selector are
2546 found during compilation.  The check is performed on the list of methods
2547 in the final stage of compilation.  Additionally, a check is performed
2548 for each selector appearing in a @code{@@selector(@dots{})}
2549 expression, and a corresponding method for that selector has been found
2550 during compilation.  Because these checks scan the method table only at
2551 the end of compilation, these warnings are not produced if the final
2552 stage of compilation is not reached, for example because an error is
2553 found during compilation, or because the @option{-fsyntax-only} option is
2554 being used.
2555
2556 @item -Wstrict-selector-match @r{(Objective-C and Objective-C++ only)}
2557 @opindex Wstrict-selector-match
2558 @opindex Wno-strict-selector-match
2559 Warn if multiple methods with differing argument and/or return types are
2560 found for a given selector when attempting to send a message using this
2561 selector to a receiver of type @code{id} or @code{Class}.  When this flag
2562 is off (which is the default behavior), the compiler will omit such warnings
2563 if any differences found are confined to types which share the same size
2564 and alignment.
2565
2566 @item -Wundeclared-selector @r{(Objective-C and Objective-C++ only)}
2567 @opindex Wundeclared-selector
2568 @opindex Wno-undeclared-selector
2569 Warn if a @code{@@selector(@dots{})} expression referring to an
2570 undeclared selector is found.  A selector is considered undeclared if no
2571 method with that name has been declared before the
2572 @code{@@selector(@dots{})} expression, either explicitly in an
2573 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
2574 an @code{@@implementation} section.  This option always performs its
2575 checks as soon as a @code{@@selector(@dots{})} expression is found,
2576 while @option{-Wselector} only performs its checks in the final stage of
2577 compilation.  This also enforces the coding style convention
2578 that methods and selectors must be declared before being used.
2579
2580 @item -print-objc-runtime-info
2581 @opindex print-objc-runtime-info
2582 Generate C header describing the largest structure that is passed by
2583 value, if any.
2584
2585 @end table
2586
2587 @node Language Independent Options
2588 @section Options to Control Diagnostic Messages Formatting
2589 @cindex options to control diagnostics formatting
2590 @cindex diagnostic messages
2591 @cindex message formatting
2592
2593 Traditionally, diagnostic messages have been formatted irrespective of
2594 the output device's aspect (e.g.@: its width, @dots{}).  The options described
2595 below can be used to control the diagnostic messages formatting
2596 algorithm, e.g.@: how many characters per line, how often source location
2597 information should be reported.  Right now, only the C++ front end can
2598 honor these options.  However it is expected, in the near future, that
2599 the remaining front ends would be able to digest them correctly.
2600
2601 @table @gcctabopt
2602 @item -fmessage-length=@var{n}
2603 @opindex fmessage-length
2604 Try to format error messages so that they fit on lines of about @var{n}
2605 characters.  The default is 72 characters for @command{g++} and 0 for the rest of
2606 the front ends supported by GCC@.  If @var{n} is zero, then no
2607 line-wrapping will be done; each error message will appear on a single
2608 line.
2609
2610 @opindex fdiagnostics-show-location
2611 @item -fdiagnostics-show-location=once
2612 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
2613 reporter to emit @emph{once} source location information; that is, in
2614 case the message is too long to fit on a single physical line and has to
2615 be wrapped, the source location won't be emitted (as prefix) again,
2616 over and over, in subsequent continuation lines.  This is the default
2617 behavior.
2618
2619 @item -fdiagnostics-show-location=every-line
2620 Only meaningful in line-wrapping mode.  Instructs the diagnostic
2621 messages reporter to emit the same source location information (as
2622 prefix) for physical lines that result from the process of breaking
2623 a message which is too long to fit on a single line.
2624
2625 @item -fdiagnostics-show-option
2626 @opindex fdiagnostics-show-option
2627 This option instructs the diagnostic machinery to add text to each
2628 diagnostic emitted, which indicates which command line option directly
2629 controls that diagnostic, when such an option is known to the
2630 diagnostic machinery.
2631
2632 @item -Wcoverage-mismatch
2633 @opindex Wcoverage-mismatch
2634 Warn if feedback profiles do not match when using the
2635 @option{-fprofile-use} option.
2636 If a source file was changed between @option{-fprofile-gen} and
2637 @option{-fprofile-use}, the files with the profile feedback can fail
2638 to match the source file and GCC can not use the profile feedback
2639 information.  By default, GCC emits an error message in this case.
2640 The option @option{-Wcoverage-mismatch} emits a warning instead of an
2641 error.  GCC does not use appropriate feedback profiles, so using this
2642 option can result in poorly optimized code.  This option is useful
2643 only in the case of very minor changes such as bug fixes to an
2644 existing code-base.
2645
2646 @end table
2647
2648 @node Warning Options
2649 @section Options to Request or Suppress Warnings
2650 @cindex options to control warnings
2651 @cindex warning messages
2652 @cindex messages, warning
2653 @cindex suppressing warnings
2654
2655 Warnings are diagnostic messages that report constructions which
2656 are not inherently erroneous but which are risky or suggest there
2657 may have been an error.
2658
2659 The following language-independent options do not enable specific
2660 warnings but control the kinds of diagnostics produced by GCC.
2661
2662 @table @gcctabopt
2663 @cindex syntax checking
2664 @item -fsyntax-only
2665 @opindex fsyntax-only
2666 Check the code for syntax errors, but don't do anything beyond that.
2667
2668 @item -w
2669 @opindex w
2670 Inhibit all warning messages.
2671
2672 @item -Werror
2673 @opindex Werror
2674 @opindex Wno-error
2675 Make all warnings into errors.
2676
2677 @item -Werror=
2678 @opindex Werror=
2679 @opindex Wno-error=
2680 Make the specified warning into an error.  The specifier for a warning
2681 is appended, for example @option{-Werror=switch} turns the warnings
2682 controlled by @option{-Wswitch} into errors.  This switch takes a
2683 negative form, to be used to negate @option{-Werror} for specific
2684 warnings, for example @option{-Wno-error=switch} makes
2685 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
2686 is in effect.  You can use the @option{-fdiagnostics-show-option}
2687 option to have each controllable warning amended with the option which
2688 controls it, to determine what to use with this option.
2689
2690 Note that specifying @option{-Werror=}@var{foo} automatically implies
2691 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
2692 imply anything.
2693
2694 @item -Wfatal-errors
2695 @opindex Wfatal-errors
2696 @opindex Wno-fatal-errors
2697 This option causes the compiler to abort compilation on the first error
2698 occurred rather than trying to keep going and printing further error
2699 messages.
2700
2701 @end table
2702
2703 You can request many specific warnings with options beginning
2704 @samp{-W}, for example @option{-Wimplicit} to request warnings on
2705 implicit declarations.  Each of these specific warning options also
2706 has a negative form beginning @samp{-Wno-} to turn off warnings; for
2707 example, @option{-Wno-implicit}.  This manual lists only one of the
2708 two forms, whichever is not the default.  For further,
2709 language-specific options also refer to @ref{C++ Dialect Options} and
2710 @ref{Objective-C and Objective-C++ Dialect Options}.
2711
2712 @table @gcctabopt
2713 @item -pedantic
2714 @opindex pedantic
2715 Issue all the warnings demanded by strict ISO C and ISO C++;
2716 reject all programs that use forbidden extensions, and some other
2717 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
2718 version of the ISO C standard specified by any @option{-std} option used.
2719
2720 Valid ISO C and ISO C++ programs should compile properly with or without
2721 this option (though a rare few will require @option{-ansi} or a
2722 @option{-std} option specifying the required version of ISO C)@.  However,
2723 without this option, certain GNU extensions and traditional C and C++
2724 features are supported as well.  With this option, they are rejected.
2725
2726 @option{-pedantic} does not cause warning messages for use of the
2727 alternate keywords whose names begin and end with @samp{__}.  Pedantic
2728 warnings are also disabled in the expression that follows
2729 @code{__extension__}.  However, only system header files should use
2730 these escape routes; application programs should avoid them.
2731 @xref{Alternate Keywords}.
2732
2733 Some users try to use @option{-pedantic} to check programs for strict ISO
2734 C conformance.  They soon find that it does not do quite what they want:
2735 it finds some non-ISO practices, but not all---only those for which
2736 ISO C @emph{requires} a diagnostic, and some others for which
2737 diagnostics have been added.
2738
2739 A feature to report any failure to conform to ISO C might be useful in
2740 some instances, but would require considerable additional work and would
2741 be quite different from @option{-pedantic}.  We don't have plans to
2742 support such a feature in the near future.
2743
2744 Where the standard specified with @option{-std} represents a GNU
2745 extended dialect of C, such as @samp{gnu89} or @samp{gnu99}, there is a
2746 corresponding @dfn{base standard}, the version of ISO C on which the GNU
2747 extended dialect is based.  Warnings from @option{-pedantic} are given
2748 where they are required by the base standard.  (It would not make sense
2749 for such warnings to be given only for features not in the specified GNU
2750 C dialect, since by definition the GNU dialects of C include all
2751 features the compiler supports with the given option, and there would be
2752 nothing to warn about.)
2753
2754 @item -pedantic-errors
2755 @opindex pedantic-errors
2756 Like @option{-pedantic}, except that errors are produced rather than
2757 warnings.
2758
2759 @item -Wall
2760 @opindex Wall
2761 @opindex Wno-all
2762 This enables all the warnings about constructions that some users
2763 consider questionable, and that are easy to avoid (or modify to
2764 prevent the warning), even in conjunction with macros.  This also
2765 enables some language-specific warnings described in @ref{C++ Dialect
2766 Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
2767
2768 @option{-Wall} turns on the following warning flags:
2769
2770 @gccoptlist{-Waddress   @gol
2771 -Warray-bounds @r{(only with} @option{-O2}@r{)}  @gol
2772 -Wc++0x-compat  @gol
2773 -Wchar-subscripts  @gol
2774 -Wenum-compare @r{(in C/Objc; this is on by default in C++)} @gol
2775 -Wimplicit-int  @gol
2776 -Wimplicit-function-declaration  @gol
2777 -Wcomment  @gol
2778 -Wformat   @gol
2779 -Wmain @r{(only for C/ObjC and unless} @option{-ffreestanding}@r{)}  @gol
2780 -Wmissing-braces  @gol
2781 -Wnonnull  @gol
2782 -Wparentheses  @gol
2783 -Wpointer-sign  @gol
2784 -Wreorder   @gol
2785 -Wreturn-type  @gol
2786 -Wsequence-point  @gol
2787 -Wsign-compare @r{(only in C++)}  @gol
2788 -Wstrict-aliasing  @gol
2789 -Wstrict-overflow=1  @gol
2790 -Wswitch  @gol
2791 -Wtrigraphs  @gol
2792 -Wuninitialized  @gol
2793 -Wunknown-pragmas  @gol
2794 -Wunused-function  @gol
2795 -Wunused-label     @gol
2796 -Wunused-value     @gol
2797 -Wunused-variable  @gol
2798 -Wvolatile-register-var @gol
2799 }
2800
2801 Note that some warning flags are not implied by @option{-Wall}.  Some of
2802 them warn about constructions that users generally do not consider
2803 questionable, but which occasionally you might wish to check for;
2804 others warn about constructions that are necessary or hard to avoid in
2805 some cases, and there is no simple way to modify the code to suppress
2806 the warning. Some of them are enabled by @option{-Wextra} but many of
2807 them must be enabled individually.
2808
2809 @item -Wextra
2810 @opindex W
2811 @opindex Wextra
2812 @opindex Wno-extra
2813 This enables some extra warning flags that are not enabled by
2814 @option{-Wall}. (This option used to be called @option{-W}.  The older
2815 name is still supported, but the newer name is more descriptive.)
2816
2817 @gccoptlist{-Wclobbered  @gol
2818 -Wempty-body  @gol
2819 -Wignored-qualifiers @gol
2820 -Wmissing-field-initializers  @gol
2821 -Wmissing-parameter-type @r{(C only)}  @gol
2822 -Wold-style-declaration @r{(C only)}  @gol
2823 -Woverride-init  @gol
2824 -Wsign-compare  @gol
2825 -Wtype-limits  @gol
2826 -Wuninitialized  @gol
2827 -Wunused-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)}  @gol
2828 }
2829
2830 The option @option{-Wextra} also prints warning messages for the
2831 following cases:
2832
2833 @itemize @bullet
2834
2835 @item
2836 A pointer is compared against integer zero with @samp{<}, @samp{<=},
2837 @samp{>}, or @samp{>=}.
2838
2839 @item 
2840 (C++ only) An enumerator and a non-enumerator both appear in a
2841 conditional expression.
2842
2843 @item 
2844 (C++ only) Ambiguous virtual bases.
2845
2846 @item 
2847 (C++ only) Subscripting an array which has been declared @samp{register}.
2848
2849 @item 
2850 (C++ only) Taking the address of a variable which has been declared
2851 @samp{register}.
2852
2853 @item 
2854 (C++ only) A base class is not initialized in a derived class' copy
2855 constructor.
2856
2857 @end itemize
2858
2859 @item -Wchar-subscripts
2860 @opindex Wchar-subscripts
2861 @opindex Wno-char-subscripts
2862 Warn if an array subscript has type @code{char}.  This is a common cause
2863 of error, as programmers often forget that this type is signed on some
2864 machines.
2865 This warning is enabled by @option{-Wall}.
2866
2867 @item -Wcomment
2868 @opindex Wcomment
2869 @opindex Wno-comment
2870 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
2871 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
2872 This warning is enabled by @option{-Wall}.
2873
2874 @item -Wformat
2875 @opindex Wformat
2876 @opindex Wno-format
2877 @opindex ffreestanding
2878 @opindex fno-builtin
2879 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
2880 the arguments supplied have types appropriate to the format string
2881 specified, and that the conversions specified in the format string make
2882 sense.  This includes standard functions, and others specified by format
2883 attributes (@pxref{Function Attributes}), in the @code{printf},
2884 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
2885 not in the C standard) families (or other target-specific families).
2886 Which functions are checked without format attributes having been
2887 specified depends on the standard version selected, and such checks of
2888 functions without the attribute specified are disabled by
2889 @option{-ffreestanding} or @option{-fno-builtin}.
2890
2891 The formats are checked against the format features supported by GNU
2892 libc version 2.2.  These include all ISO C90 and C99 features, as well
2893 as features from the Single Unix Specification and some BSD and GNU
2894 extensions.  Other library implementations may not support all these
2895 features; GCC does not support warning about features that go beyond a
2896 particular library's limitations.  However, if @option{-pedantic} is used
2897 with @option{-Wformat}, warnings will be given about format features not
2898 in the selected standard version (but not for @code{strfmon} formats,
2899 since those are not in any version of the C standard).  @xref{C Dialect
2900 Options,,Options Controlling C Dialect}.
2901
2902 Since @option{-Wformat} also checks for null format arguments for
2903 several functions, @option{-Wformat} also implies @option{-Wnonnull}.
2904
2905 @option{-Wformat} is included in @option{-Wall}.  For more control over some
2906 aspects of format checking, the options @option{-Wformat-y2k},
2907 @option{-Wno-format-extra-args}, @option{-Wno-format-zero-length},
2908 @option{-Wformat-nonliteral}, @option{-Wformat-security}, and
2909 @option{-Wformat=2} are available, but are not included in @option{-Wall}.
2910
2911 @item -Wformat-y2k
2912 @opindex Wformat-y2k
2913 @opindex Wno-format-y2k
2914 If @option{-Wformat} is specified, also warn about @code{strftime}
2915 formats which may yield only a two-digit year.
2916
2917 @item -Wno-format-contains-nul
2918 @opindex Wno-format-contains-nul
2919 @opindex Wformat-contains-nul
2920 If @option{-Wformat} is specified, do not warn about format strings that
2921 contain NUL bytes.
2922
2923 @item -Wno-format-extra-args
2924 @opindex Wno-format-extra-args
2925 @opindex Wformat-extra-args
2926 If @option{-Wformat} is specified, do not warn about excess arguments to a
2927 @code{printf} or @code{scanf} format function.  The C standard specifies
2928 that such arguments are ignored.
2929
2930 Where the unused arguments lie between used arguments that are
2931 specified with @samp{$} operand number specifications, normally
2932 warnings are still given, since the implementation could not know what
2933 type to pass to @code{va_arg} to skip the unused arguments.  However,
2934 in the case of @code{scanf} formats, this option will suppress the
2935 warning if the unused arguments are all pointers, since the Single
2936 Unix Specification says that such unused arguments are allowed.
2937
2938 @item -Wno-format-zero-length @r{(C and Objective-C only)}
2939 @opindex Wno-format-zero-length
2940 @opindex Wformat-zero-length
2941 If @option{-Wformat} is specified, do not warn about zero-length formats.
2942 The C standard specifies that zero-length formats are allowed.
2943
2944 @item -Wformat-nonliteral
2945 @opindex Wformat-nonliteral
2946 @opindex Wno-format-nonliteral
2947 If @option{-Wformat} is specified, also warn if the format string is not a
2948 string literal and so cannot be checked, unless the format function
2949 takes its format arguments as a @code{va_list}.
2950
2951 @item -Wformat-security
2952 @opindex Wformat-security
2953 @opindex Wno-format-security
2954 If @option{-Wformat} is specified, also warn about uses of format
2955 functions that represent possible security problems.  At present, this
2956 warns about calls to @code{printf} and @code{scanf} functions where the
2957 format string is not a string literal and there are no format arguments,
2958 as in @code{printf (foo);}.  This may be a security hole if the format
2959 string came from untrusted input and contains @samp{%n}.  (This is
2960 currently a subset of what @option{-Wformat-nonliteral} warns about, but
2961 in future warnings may be added to @option{-Wformat-security} that are not
2962 included in @option{-Wformat-nonliteral}.)
2963
2964 @item -Wformat=2
2965 @opindex Wformat=2
2966 @opindex Wno-format=2
2967 Enable @option{-Wformat} plus format checks not included in
2968 @option{-Wformat}.  Currently equivalent to @samp{-Wformat
2969 -Wformat-nonliteral -Wformat-security -Wformat-y2k}.
2970
2971 @item -Wnonnull @r{(C and Objective-C only)}
2972 @opindex Wnonnull
2973 @opindex Wno-nonnull
2974 Warn about passing a null pointer for arguments marked as
2975 requiring a non-null value by the @code{nonnull} function attribute.
2976
2977 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
2978 can be disabled with the @option{-Wno-nonnull} option.
2979
2980 @item -Wjump-misses-init @r{(C, Objective-C only)}
2981 @opindex Wjump-misses-init
2982 @opindex Wno-jump-misses-init
2983 Warn if a @code{goto} statement or a @code{switch} statement jumps
2984 forward across the initialization of a variable, or jumps backward to a
2985 label after the variable has been initialized.  This only warns about
2986 variables which are initialized when they are declared.  This warning is
2987 only supported for C and Objective C; in C++ this sort of branch is an
2988 error in any case.
2989
2990 @option{-Wjump-misses-init} is included in @option{-Wall} and
2991 @option{-Wc++-compat}.  It can be disabled with the
2992 @option{-Wno-jump-misses-init} option.
2993
2994 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
2995 @opindex Winit-self
2996 @opindex Wno-init-self
2997 Warn about uninitialized variables which are initialized with themselves.
2998 Note this option can only be used with the @option{-Wuninitialized} option.
2999
3000 For example, GCC will warn about @code{i} being uninitialized in the
3001 following snippet only when @option{-Winit-self} has been specified:
3002 @smallexample
3003 @group
3004 int f()
3005 @{
3006   int i = i;
3007   return i;
3008 @}
3009 @end group
3010 @end smallexample
3011
3012 @item -Wimplicit-int @r{(C and Objective-C only)}
3013 @opindex Wimplicit-int
3014 @opindex Wno-implicit-int
3015 Warn when a declaration does not specify a type.
3016 This warning is enabled by @option{-Wall}.
3017
3018 @item -Wimplicit-function-declaration @r{(C and Objective-C only)}
3019 @opindex Wimplicit-function-declaration
3020 @opindex Wno-implicit-function-declaration
3021 Give a warning whenever a function is used before being declared. In
3022 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
3023 enabled by default and it is made into an error by
3024 @option{-pedantic-errors}. This warning is also enabled by
3025 @option{-Wall}.
3026
3027 @item -Wimplicit
3028 @opindex Wimplicit
3029 @opindex Wno-implicit
3030 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
3031 This warning is enabled by @option{-Wall}.
3032
3033 @item -Wignored-qualifiers @r{(C and C++ only)}
3034 @opindex Wignored-qualifiers
3035 @opindex Wno-ignored-qualifiers
3036 Warn if the return type of a function has a type qualifier
3037 such as @code{const}.  For ISO C such a type qualifier has no effect,
3038 since the value returned by a function is not an lvalue.
3039 For C++, the warning is only emitted for scalar types or @code{void}.
3040 ISO C prohibits qualified @code{void} return types on function
3041 definitions, so such return types always receive a warning
3042 even without this option.
3043
3044 This warning is also enabled by @option{-Wextra}.
3045
3046 @item -Wmain
3047 @opindex Wmain
3048 @opindex Wno-main
3049 Warn if the type of @samp{main} is suspicious.  @samp{main} should be
3050 a function with external linkage, returning int, taking either zero
3051 arguments, two, or three arguments of appropriate types.  This warning
3052 is enabled by default in C++ and is enabled by either @option{-Wall}
3053 or @option{-pedantic}.
3054
3055 @item -Wmissing-braces
3056 @opindex Wmissing-braces
3057 @opindex Wno-missing-braces
3058 Warn if an aggregate or union initializer is not fully bracketed.  In
3059 the following example, the initializer for @samp{a} is not fully
3060 bracketed, but that for @samp{b} is fully bracketed.
3061
3062 @smallexample
3063 int a[2][2] = @{ 0, 1, 2, 3 @};
3064 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
3065 @end smallexample
3066
3067 This warning is enabled by @option{-Wall}.
3068
3069 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
3070 @opindex Wmissing-include-dirs
3071 @opindex Wno-missing-include-dirs
3072 Warn if a user-supplied include directory does not exist.
3073
3074 @item -Wparentheses
3075 @opindex Wparentheses
3076 @opindex Wno-parentheses
3077 Warn if parentheses are omitted in certain contexts, such
3078 as when there is an assignment in a context where a truth value
3079 is expected, or when operators are nested whose precedence people
3080 often get confused about.
3081
3082 Also warn if a comparison like @samp{x<=y<=z} appears; this is
3083 equivalent to @samp{(x<=y ? 1 : 0) <= z}, which is a different
3084 interpretation from that of ordinary mathematical notation.
3085
3086 Also warn about constructions where there may be confusion to which
3087 @code{if} statement an @code{else} branch belongs.  Here is an example of
3088 such a case:
3089
3090 @smallexample
3091 @group
3092 @{
3093   if (a)
3094     if (b)
3095       foo ();
3096   else
3097     bar ();
3098 @}
3099 @end group
3100 @end smallexample
3101
3102 In C/C++, every @code{else} branch belongs to the innermost possible
3103 @code{if} statement, which in this example is @code{if (b)}.  This is
3104 often not what the programmer expected, as illustrated in the above
3105 example by indentation the programmer chose.  When there is the
3106 potential for this confusion, GCC will issue a warning when this flag
3107 is specified.  To eliminate the warning, add explicit braces around
3108 the innermost @code{if} statement so there is no way the @code{else}
3109 could belong to the enclosing @code{if}.  The resulting code would
3110 look like this:
3111
3112 @smallexample
3113 @group
3114 @{
3115   if (a)
3116     @{
3117       if (b)
3118         foo ();
3119       else
3120         bar ();
3121     @}
3122 @}
3123 @end group
3124 @end smallexample
3125
3126 This warning is enabled by @option{-Wall}.
3127
3128 @item -Wsequence-point
3129 @opindex Wsequence-point
3130 @opindex Wno-sequence-point
3131 Warn about code that may have undefined semantics because of violations
3132 of sequence point rules in the C and C++ standards.
3133
3134 The C and C++ standards defines the order in which expressions in a C/C++
3135 program are evaluated in terms of @dfn{sequence points}, which represent
3136 a partial ordering between the execution of parts of the program: those
3137 executed before the sequence point, and those executed after it.  These
3138 occur after the evaluation of a full expression (one which is not part
3139 of a larger expression), after the evaluation of the first operand of a
3140 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
3141 function is called (but after the evaluation of its arguments and the
3142 expression denoting the called function), and in certain other places.
3143 Other than as expressed by the sequence point rules, the order of
3144 evaluation of subexpressions of an expression is not specified.  All
3145 these rules describe only a partial order rather than a total order,
3146 since, for example, if two functions are called within one expression
3147 with no sequence point between them, the order in which the functions
3148 are called is not specified.  However, the standards committee have
3149 ruled that function calls do not overlap.
3150
3151 It is not specified when between sequence points modifications to the
3152 values of objects take effect.  Programs whose behavior depends on this
3153 have undefined behavior; the C and C++ standards specify that ``Between
3154 the previous and next sequence point an object shall have its stored
3155 value modified at most once by the evaluation of an expression.
3156 Furthermore, the prior value shall be read only to determine the value
3157 to be stored.''.  If a program breaks these rules, the results on any
3158 particular implementation are entirely unpredictable.
3159
3160 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
3161 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
3162 diagnosed by this option, and it may give an occasional false positive
3163 result, but in general it has been found fairly effective at detecting
3164 this sort of problem in programs.
3165
3166 The standard is worded confusingly, therefore there is some debate
3167 over the precise meaning of the sequence point rules in subtle cases.
3168 Links to discussions of the problem, including proposed formal
3169 definitions, may be found on the GCC readings page, at
3170 @w{@uref{http://gcc.gnu.org/readings.html}}.
3171
3172 This warning is enabled by @option{-Wall} for C and C++.
3173
3174 @item -Wreturn-type
3175 @opindex Wreturn-type
3176 @opindex Wno-return-type
3177 Warn whenever a function is defined with a return-type that defaults
3178 to @code{int}.  Also warn about any @code{return} statement with no
3179 return-value in a function whose return-type is not @code{void}
3180 (falling off the end of the function body is considered returning
3181 without a value), and about a @code{return} statement with an
3182 expression in a function whose return-type is @code{void}.
3183
3184 For C++, a function without return type always produces a diagnostic
3185 message, even when @option{-Wno-return-type} is specified.  The only
3186 exceptions are @samp{main} and functions defined in system headers.
3187
3188 This warning is enabled by @option{-Wall}.
3189
3190 @item -Wswitch
3191 @opindex Wswitch
3192 @opindex Wno-switch
3193 Warn whenever a @code{switch} statement has an index of enumerated type
3194 and lacks a @code{case} for one or more of the named codes of that
3195 enumeration.  (The presence of a @code{default} label prevents this
3196 warning.)  @code{case} labels outside the enumeration range also
3197 provoke warnings when this option is used (even if there is a
3198 @code{default} label).
3199 This warning is enabled by @option{-Wall}.
3200
3201 @item -Wswitch-default
3202 @opindex Wswitch-default
3203 @opindex Wno-switch-default
3204 Warn whenever a @code{switch} statement does not have a @code{default}
3205 case.
3206
3207 @item -Wswitch-enum
3208 @opindex Wswitch-enum
3209 @opindex Wno-switch-enum
3210 Warn whenever a @code{switch} statement has an index of enumerated type
3211 and lacks a @code{case} for one or more of the named codes of that
3212 enumeration.  @code{case} labels outside the enumeration range also
3213 provoke warnings when this option is used.  The only difference
3214 between @option{-Wswitch} and this option is that this option gives a
3215 warning about an omitted enumeration code even if there is a
3216 @code{default} label.
3217
3218 @item -Wsync-nand @r{(C and C++ only)}
3219 @opindex Wsync-nand
3220 @opindex Wno-sync-nand
3221 Warn when @code{__sync_fetch_and_nand} and @code{__sync_nand_and_fetch}
3222 built-in functions are used.  These functions changed semantics in GCC 4.4.
3223
3224 @item -Wtrigraphs
3225 @opindex Wtrigraphs
3226 @opindex Wno-trigraphs
3227 Warn if any trigraphs are encountered that might change the meaning of
3228 the program (trigraphs within comments are not warned about).
3229 This warning is enabled by @option{-Wall}.
3230
3231 @item -Wunused-function
3232 @opindex Wunused-function
3233 @opindex Wno-unused-function
3234 Warn whenever a static function is declared but not defined or a
3235 non-inline static function is unused.
3236 This warning is enabled by @option{-Wall}.
3237
3238 @item -Wunused-label
3239 @opindex Wunused-label
3240 @opindex Wno-unused-label
3241 Warn whenever a label is declared but not used.
3242 This warning is enabled by @option{-Wall}.
3243
3244 To suppress this warning use the @samp{unused} attribute
3245 (@pxref{Variable Attributes}).
3246
3247 @item -Wunused-parameter
3248 @opindex Wunused-parameter
3249 @opindex Wno-unused-parameter
3250 Warn whenever a function parameter is unused aside from its declaration.
3251
3252 To suppress this warning use the @samp{unused} attribute
3253 (@pxref{Variable Attributes}).
3254
3255 @item -Wunused-variable
3256 @opindex Wunused-variable
3257 @opindex Wno-unused-variable
3258 Warn whenever a local variable or non-constant static variable is unused
3259 aside from its declaration.
3260 This warning is enabled by @option{-Wall}.
3261
3262 To suppress this warning use the @samp{unused} attribute
3263 (@pxref{Variable Attributes}).
3264
3265 @item -Wunused-value
3266 @opindex Wunused-value
3267 @opindex Wno-unused-value
3268 Warn whenever a statement computes a result that is explicitly not
3269 used. To suppress this warning cast the unused expression to
3270 @samp{void}. This includes an expression-statement or the left-hand
3271 side of a comma expression that contains no side effects. For example,
3272 an expression such as @samp{x[i,j]} will cause a warning, while
3273 @samp{x[(void)i,j]} will not.
3274
3275 This warning is enabled by @option{-Wall}.
3276
3277 @item -Wunused
3278 @opindex Wunused
3279 @opindex Wno-unused
3280 All the above @option{-Wunused} options combined.
3281
3282 In order to get a warning about an unused function parameter, you must
3283 either specify @samp{-Wextra -Wunused} (note that @samp{-Wall} implies
3284 @samp{-Wunused}), or separately specify @option{-Wunused-parameter}.
3285
3286 @item -Wuninitialized
3287 @opindex Wuninitialized
3288 @opindex Wno-uninitialized
3289 Warn if an automatic variable is used without first being initialized
3290 or if a variable may be clobbered by a @code{setjmp} call. In C++,
3291 warn if a non-static reference or non-static @samp{const} member
3292 appears in a class without constructors.
3293
3294 If you want to warn about code which uses the uninitialized value of the
3295 variable in its own initializer, use the @option{-Winit-self} option.
3296
3297 These warnings occur for individual uninitialized or clobbered
3298 elements of structure, union or array variables as well as for
3299 variables which are uninitialized or clobbered as a whole.  They do
3300 not occur for variables or elements declared @code{volatile}.  Because
3301 these warnings depend on optimization, the exact variables or elements
3302 for which there are warnings will depend on the precise optimization
3303 options and version of GCC used.
3304
3305 Note that there may be no warning about a variable that is used only
3306 to compute a value that itself is never used, because such
3307 computations may be deleted by data flow analysis before the warnings
3308 are printed.
3309
3310 These warnings are made optional because GCC is not smart
3311 enough to see all the reasons why the code might be correct
3312 despite appearing to have an error.  Here is one example of how
3313 this can happen:
3314
3315 @smallexample
3316 @group
3317 @{
3318   int x;
3319   switch (y)
3320     @{
3321     case 1: x = 1;
3322       break;
3323     case 2: x = 4;
3324       break;
3325     case 3: x = 5;
3326     @}
3327   foo (x);
3328 @}
3329 @end group
3330 @end smallexample
3331
3332 @noindent
3333 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
3334 always initialized, but GCC doesn't know this.  Here is
3335 another common case:
3336
3337 @smallexample
3338 @{
3339   int save_y;
3340   if (change_y) save_y = y, y = new_y;
3341   @dots{}
3342   if (change_y) y = save_y;
3343 @}
3344 @end smallexample
3345
3346 @noindent
3347 This has no bug because @code{save_y} is used only if it is set.
3348
3349 @cindex @code{longjmp} warnings
3350 This option also warns when a non-volatile automatic variable might be
3351 changed by a call to @code{longjmp}.  These warnings as well are possible
3352 only in optimizing compilation.
3353
3354 The compiler sees only the calls to @code{setjmp}.  It cannot know
3355 where @code{longjmp} will be called; in fact, a signal handler could
3356 call it at any point in the code.  As a result, you may get a warning
3357 even when there is in fact no problem because @code{longjmp} cannot
3358 in fact be called at the place which would cause a problem.
3359
3360 Some spurious warnings can be avoided if you declare all the functions
3361 you use that never return as @code{noreturn}.  @xref{Function
3362 Attributes}.
3363
3364 This warning is enabled by @option{-Wall} or @option{-Wextra}.
3365
3366 @item -Wunknown-pragmas
3367 @opindex Wunknown-pragmas
3368 @opindex Wno-unknown-pragmas
3369 @cindex warning for unknown pragmas
3370 @cindex unknown pragmas, warning
3371 @cindex pragmas, warning of unknown
3372 Warn when a #pragma directive is encountered which is not understood by
3373 GCC@.  If this command line option is used, warnings will even be issued
3374 for unknown pragmas in system header files.  This is not the case if
3375 the warnings were only enabled by the @option{-Wall} command line option.
3376
3377 @item -Wno-pragmas
3378 @opindex Wno-pragmas
3379 @opindex Wpragmas
3380 Do not warn about misuses of pragmas, such as incorrect parameters,
3381 invalid syntax, or conflicts between pragmas.  See also
3382 @samp{-Wunknown-pragmas}.
3383
3384 @item -Wstrict-aliasing
3385 @opindex Wstrict-aliasing
3386 @opindex Wno-strict-aliasing
3387 This option is only active when @option{-fstrict-aliasing} is active.
3388 It warns about code which might break the strict aliasing rules that the
3389 compiler is using for optimization.  The warning does not catch all
3390 cases, but does attempt to catch the more common pitfalls.  It is
3391 included in @option{-Wall}.
3392 It is equivalent to @option{-Wstrict-aliasing=3}
3393
3394 @item -Wstrict-aliasing=n
3395 @opindex Wstrict-aliasing=n
3396 @opindex Wno-strict-aliasing=n
3397 This option is only active when @option{-fstrict-aliasing} is active.
3398 It warns about code which might break the strict aliasing rules that the
3399 compiler is using for optimization.
3400 Higher levels correspond to higher accuracy (fewer false positives).
3401 Higher levels also correspond to more effort, similar to the way -O works.
3402 @option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=n},
3403 with n=3.
3404
3405 Level 1: Most aggressive, quick, least accurate.
3406 Possibly useful when higher levels
3407 do not warn but -fstrict-aliasing still breaks the code, as it has very few 
3408 false negatives.  However, it has many false positives.
3409 Warns for all pointer conversions between possibly incompatible types, 
3410 even if never dereferenced.  Runs in the frontend only.
3411
3412 Level 2: Aggressive, quick, not too precise.
3413 May still have many false positives (not as many as level 1 though),
3414 and few false negatives (but possibly more than level 1).
3415 Unlike level 1, it only warns when an address is taken.  Warns about
3416 incomplete types.  Runs in the frontend only.
3417
3418 Level 3 (default for @option{-Wstrict-aliasing}): 
3419 Should have very few false positives and few false 
3420 negatives.  Slightly slower than levels 1 or 2 when optimization is enabled.
3421 Takes care of the common punn+dereference pattern in the frontend:
3422 @code{*(int*)&some_float}.
3423 If optimization is enabled, it also runs in the backend, where it deals 
3424 with multiple statement cases using flow-sensitive points-to information.
3425 Only warns when the converted pointer is dereferenced.
3426 Does not warn about incomplete types.
3427
3428 @item -Wstrict-overflow
3429 @itemx -Wstrict-overflow=@var{n}
3430 @opindex Wstrict-overflow
3431 @opindex Wno-strict-overflow
3432 This option is only active when @option{-fstrict-overflow} is active.
3433 It warns about cases where the compiler optimizes based on the
3434 assumption that signed overflow does not occur.  Note that it does not
3435 warn about all cases where the code might overflow: it only warns
3436 about cases where the compiler implements some optimization.  Thus
3437 this warning depends on the optimization level.
3438
3439 An optimization which assumes that signed overflow does not occur is
3440 perfectly safe if the values of the variables involved are such that
3441 overflow never does, in fact, occur.  Therefore this warning can
3442 easily give a false positive: a warning about code which is not
3443 actually a problem.  To help focus on important issues, several
3444 warning levels are defined.  No warnings are issued for the use of
3445 undefined signed overflow when estimating how many iterations a loop
3446 will require, in particular when determining whether a loop will be
3447 executed at all.
3448
3449 @table @gcctabopt
3450 @item -Wstrict-overflow=1
3451 Warn about cases which are both questionable and easy to avoid.  For
3452 example: @code{x + 1 > x}; with @option{-fstrict-overflow}, the
3453 compiler will simplify this to @code{1}.  This level of
3454 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
3455 are not, and must be explicitly requested.
3456
3457 @item -Wstrict-overflow=2
3458 Also warn about other cases where a comparison is simplified to a
3459 constant.  For example: @code{abs (x) >= 0}.  This can only be
3460 simplified when @option{-fstrict-overflow} is in effect, because
3461 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
3462 zero.  @option{-Wstrict-overflow} (with no level) is the same as
3463 @option{-Wstrict-overflow=2}.
3464
3465 @item -Wstrict-overflow=3
3466 Also warn about other cases where a comparison is simplified.  For
3467 example: @code{x + 1 > 1} will be simplified to @code{x > 0}.
3468
3469 @item -Wstrict-overflow=4
3470 Also warn about other simplifications not covered by the above cases.
3471 For example: @code{(x * 10) / 5} will be simplified to @code{x * 2}.
3472
3473 @item -Wstrict-overflow=5
3474 Also warn about cases where the compiler reduces the magnitude of a
3475 constant involved in a comparison.  For example: @code{x + 2 > y} will
3476 be simplified to @code{x + 1 >= y}.  This is reported only at the
3477 highest warning level because this simplification applies to many
3478 comparisons, so this warning level will give a very large number of
3479 false positives.
3480 @end table
3481
3482 @item -Warray-bounds
3483 @opindex Wno-array-bounds
3484 @opindex Warray-bounds
3485 This option is only active when @option{-ftree-vrp} is active
3486 (default for -O2 and above). It warns about subscripts to arrays
3487 that are always out of bounds. This warning is enabled by @option{-Wall}.
3488
3489 @item -Wno-div-by-zero
3490 @opindex Wno-div-by-zero
3491 @opindex Wdiv-by-zero
3492 Do not warn about compile-time integer division by zero.  Floating point
3493 division by zero is not warned about, as it can be a legitimate way of
3494 obtaining infinities and NaNs.
3495
3496 @item -Wsystem-headers
3497 @opindex Wsystem-headers
3498 @opindex Wno-system-headers
3499 @cindex warnings from system headers
3500 @cindex system headers, warnings from
3501 Print warning messages for constructs found in system header files.
3502 Warnings from system headers are normally suppressed, on the assumption
3503 that they usually do not indicate real problems and would only make the
3504 compiler output harder to read.  Using this command line option tells
3505 GCC to emit warnings from system headers as if they occurred in user
3506 code.  However, note that using @option{-Wall} in conjunction with this
3507 option will @emph{not} warn about unknown pragmas in system
3508 headers---for that, @option{-Wunknown-pragmas} must also be used.
3509
3510 @item -Wfloat-equal
3511 @opindex Wfloat-equal
3512 @opindex Wno-float-equal
3513 Warn if floating point values are used in equality comparisons.
3514
3515 The idea behind this is that sometimes it is convenient (for the
3516 programmer) to consider floating-point values as approximations to
3517 infinitely precise real numbers.  If you are doing this, then you need
3518 to compute (by analyzing the code, or in some other way) the maximum or
3519 likely maximum error that the computation introduces, and allow for it
3520 when performing comparisons (and when producing output, but that's a
3521 different problem).  In particular, instead of testing for equality, you
3522 would check to see whether the two values have ranges that overlap; and
3523 this is done with the relational operators, so equality comparisons are
3524 probably mistaken.
3525
3526 @item -Wtraditional @r{(C and Objective-C only)}
3527 @opindex Wtraditional
3528 @opindex Wno-traditional
3529 Warn about certain constructs that behave differently in traditional and
3530 ISO C@.  Also warn about ISO C constructs that have no traditional C
3531 equivalent, and/or problematic constructs which should be avoided.
3532
3533 @itemize @bullet
3534 @item
3535 Macro parameters that appear within string literals in the macro body.
3536 In traditional C macro replacement takes place within string literals,
3537 but does not in ISO C@.
3538
3539 @item
3540 In traditional C, some preprocessor directives did not exist.
3541 Traditional preprocessors would only consider a line to be a directive
3542 if the @samp{#} appeared in column 1 on the line.  Therefore
3543 @option{-Wtraditional} warns about directives that traditional C
3544 understands but would ignore because the @samp{#} does not appear as the
3545 first character on the line.  It also suggests you hide directives like
3546 @samp{#pragma} not understood by traditional C by indenting them.  Some
3547 traditional implementations would not recognize @samp{#elif}, so it
3548 suggests avoiding it altogether.
3549
3550 @item
3551 A function-like macro that appears without arguments.
3552
3553 @item
3554 The unary plus operator.
3555
3556 @item
3557 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating point
3558 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
3559 constants.)  Note, these suffixes appear in macros defined in the system
3560 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
3561 Use of these macros in user code might normally lead to spurious
3562 warnings, however GCC's integrated preprocessor has enough context to
3563 avoid warning in these cases.
3564
3565 @item
3566 A function declared external in one block and then used after the end of
3567 the block.
3568
3569 @item
3570 A @code{switch} statement has an operand of type @code{long}.
3571
3572 @item
3573 A non-@code{static} function declaration follows a @code{static} one.
3574 This construct is not accepted by some traditional C compilers.
3575
3576 @item
3577 The ISO type of an integer constant has a different width or
3578 signedness from its traditional type.  This warning is only issued if
3579 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
3580 typically represent bit patterns, are not warned about.
3581
3582 @item
3583 Usage of ISO string concatenation is detected.
3584
3585 @item
3586 Initialization of automatic aggregates.
3587
3588 @item
3589 Identifier conflicts with labels.  Traditional C lacks a separate
3590 namespace for labels.
3591
3592 @item
3593 Initialization of unions.  If the initializer is zero, the warning is
3594 omitted.  This is done under the assumption that the zero initializer in
3595 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
3596 initializer warnings and relies on default initialization to zero in the
3597 traditional C case.
3598
3599 @item
3600 Conversions by prototypes between fixed/floating point values and vice
3601 versa.  The absence of these prototypes when compiling with traditional
3602 C would cause serious problems.  This is a subset of the possible
3603 conversion warnings, for the full set use @option{-Wtraditional-conversion}.
3604
3605 @item
3606 Use of ISO C style function definitions.  This warning intentionally is
3607 @emph{not} issued for prototype declarations or variadic functions
3608 because these ISO C features will appear in your code when using
3609 libiberty's traditional C compatibility macros, @code{PARAMS} and
3610 @code{VPARAMS}.  This warning is also bypassed for nested functions
3611 because that feature is already a GCC extension and thus not relevant to
3612 traditional C compatibility.
3613 @end itemize
3614
3615 @item -Wtraditional-conversion @r{(C and Objective-C only)}
3616 @opindex Wtraditional-conversion
3617 @opindex Wno-traditional-conversion
3618 Warn if a prototype causes a type conversion that is different from what
3619 would happen to the same argument in the absence of a prototype.  This
3620 includes conversions of fixed point to floating and vice versa, and
3621 conversions changing the width or signedness of a fixed point argument
3622 except when the same as the default promotion.
3623
3624 @item -Wdeclaration-after-statement @r{(C and Objective-C only)}
3625 @opindex Wdeclaration-after-statement
3626 @opindex Wno-declaration-after-statement
3627 Warn when a declaration is found after a statement in a block.  This
3628 construct, known from C++, was introduced with ISO C99 and is by default
3629 allowed in GCC@.  It is not supported by ISO C90 and was not supported by
3630 GCC versions before GCC 3.0.  @xref{Mixed Declarations}.
3631
3632 @item -Wundef
3633 @opindex Wundef
3634 @opindex Wno-undef
3635 Warn if an undefined identifier is evaluated in an @samp{#if} directive.
3636
3637 @item -Wno-endif-labels
3638 @opindex Wno-endif-labels
3639 @opindex Wendif-labels
3640 Do not warn whenever an @samp{#else} or an @samp{#endif} are followed by text.
3641
3642 @item -Wshadow
3643 @opindex Wshadow
3644 @opindex Wno-shadow
3645 Warn whenever a local variable shadows another local variable, parameter or
3646 global variable or whenever a built-in function is shadowed.
3647
3648 @item -Wlarger-than=@var{len}
3649 @opindex Wlarger-than=@var{len}
3650 @opindex Wlarger-than-@var{len}
3651 Warn whenever an object of larger than @var{len} bytes is defined.
3652
3653 @item -Wframe-larger-than=@var{len}
3654 @opindex Wframe-larger-than
3655 Warn if the size of a function frame is larger than @var{len} bytes.
3656 The computation done to determine the stack frame size is approximate
3657 and not conservative.
3658 The actual requirements may be somewhat greater than @var{len}
3659 even if you do not get a warning.  In addition, any space allocated
3660 via @code{alloca}, variable-length arrays, or related constructs
3661 is not included by the compiler when determining
3662 whether or not to issue a warning.
3663
3664 @item -Wunsafe-loop-optimizations
3665 @opindex Wunsafe-loop-optimizations
3666 @opindex Wno-unsafe-loop-optimizations
3667 Warn if the loop cannot be optimized because the compiler could not
3668 assume anything on the bounds of the loop indices.  With
3669 @option{-funsafe-loop-optimizations} warn if the compiler made
3670 such assumptions.
3671
3672 @item -Wno-pedantic-ms-format @r{(MinGW targets only)}
3673 @opindex Wno-pedantic-ms-format
3674 @opindex Wpedantic-ms-format
3675 Disables the warnings about non-ISO @code{printf} / @code{scanf} format
3676 width specifiers @code{I32}, @code{I64}, and @code{I} used on Windows targets
3677 depending on the MS runtime, when you are using the options @option{-Wformat}
3678 and @option{-pedantic} without gnu-extensions.
3679
3680 @item -Wpointer-arith
3681 @opindex Wpointer-arith
3682 @opindex Wno-pointer-arith
3683 Warn about anything that depends on the ``size of'' a function type or
3684 of @code{void}.  GNU C assigns these types a size of 1, for
3685 convenience in calculations with @code{void *} pointers and pointers
3686 to functions.  In C++, warn also when an arithmetic operation involves
3687 @code{NULL}.  This warning is also enabled by @option{-pedantic}.
3688
3689 @item -Wtype-limits
3690 @opindex Wtype-limits
3691 @opindex Wno-type-limits
3692 Warn if a comparison is always true or always false due to the limited
3693 range of the data type, but do not warn for constant expressions.  For
3694 example, warn if an unsigned variable is compared against zero with
3695 @samp{<} or @samp{>=}.  This warning is also enabled by
3696 @option{-Wextra}.
3697
3698 @item -Wbad-function-cast @r{(C and Objective-C only)}
3699 @opindex Wbad-function-cast
3700 @opindex Wno-bad-function-cast
3701 Warn whenever a function call is cast to a non-matching type.
3702 For example, warn if @code{int malloc()} is cast to @code{anything *}.
3703
3704 @item -Wc++-compat @r{(C and Objective-C only)}
3705 Warn about ISO C constructs that are outside of the common subset of
3706 ISO C and ISO C++, e.g.@: request for implicit conversion from
3707 @code{void *} to a pointer to non-@code{void} type.
3708
3709 @item -Wc++0x-compat @r{(C++ and Objective-C++ only)}
3710 Warn about C++ constructs whose meaning differs between ISO C++ 1998 and
3711 ISO C++ 200x, e.g., identifiers in ISO C++ 1998 that will become keywords
3712 in ISO C++ 200x.  This warning is enabled by @option{-Wall}.
3713
3714 @item -Wcast-qual
3715 @opindex Wcast-qual
3716 @opindex Wno-cast-qual
3717 Warn whenever a pointer is cast so as to remove a type qualifier from
3718 the target type.  For example, warn if a @code{const char *} is cast
3719 to an ordinary @code{char *}.
3720
3721 Also warn when making a cast which introduces a type qualifier in an
3722 unsafe way.  For example, casting @code{char **} to @code{const char **}
3723 is unsafe, as in this example:
3724
3725 @smallexample
3726   /* p is char ** value.  */
3727   const char **q = (const char **) p;
3728   /* Assignment of readonly string to const char * is OK.  */
3729   *q = "string";
3730   /* Now char** pointer points to read-only memory.  */
3731   **p = 'b';
3732 @end smallexample
3733
3734 @item -Wcast-align
3735 @opindex Wcast-align
3736 @opindex Wno-cast-align
3737 Warn whenever a pointer is cast such that the required alignment of the
3738 target is increased.  For example, warn if a @code{char *} is cast to
3739 an @code{int *} on machines where integers can only be accessed at
3740 two- or four-byte boundaries.
3741
3742 @item -Wwrite-strings
3743 @opindex Wwrite-strings
3744 @opindex Wno-write-strings
3745 When compiling C, give string constants the type @code{const
3746 char[@var{length}]} so that copying the address of one into a
3747 non-@code{const} @code{char *} pointer will get a warning.  These
3748 warnings will help you find at compile time code that can try to write
3749 into a string constant, but only if you have been very careful about
3750 using @code{const} in declarations and prototypes.  Otherwise, it will
3751 just be a nuisance. This is why we did not make @option{-Wall} request
3752 these warnings.
3753
3754 When compiling C++, warn about the deprecated conversion from string
3755 literals to @code{char *}.  This warning is enabled by default for C++
3756 programs.
3757
3758 @item -Wclobbered
3759 @opindex Wclobbered
3760 @opindex Wno-clobbered
3761 Warn for variables that might be changed by @samp{longjmp} or
3762 @samp{vfork}.  This warning is also enabled by @option{-Wextra}.
3763
3764 @item -Wconversion
3765 @opindex Wconversion
3766 @opindex Wno-conversion
3767 Warn for implicit conversions that may alter a value. This includes
3768 conversions between real and integer, like @code{abs (x)} when
3769 @code{x} is @code{double}; conversions between signed and unsigned,
3770 like @code{unsigned ui = -1}; and conversions to smaller types, like
3771 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
3772 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
3773 changed by the conversion like in @code{abs (2.0)}.  Warnings about
3774 conversions between signed and unsigned integers can be disabled by
3775 using @option{-Wno-sign-conversion}.
3776
3777 For C++, also warn for conversions between @code{NULL} and non-pointer
3778 types; confusing overload resolution for user-defined conversions; and
3779 conversions that will never use a type conversion operator:
3780 conversions to @code{void}, the same type, a base class or a reference
3781 to them. Warnings about conversions between signed and unsigned
3782 integers are disabled by default in C++ unless
3783 @option{-Wsign-conversion} is explicitly enabled.
3784
3785 @item -Wempty-body
3786 @opindex Wempty-body
3787 @opindex Wno-empty-body
3788 Warn if an empty body occurs in an @samp{if}, @samp{else} or @samp{do
3789 while} statement.  This warning is also enabled by @option{-Wextra}.
3790
3791 @item -Wenum-compare
3792 @opindex Wenum-compare
3793 @opindex Wno-enum-compare
3794 Warn about a comparison between values of different enum types. In C++
3795 this warning is enabled by default.  In C this warning is enabled by
3796 @option{-Wall}.
3797
3798 @item -Wsign-compare
3799 @opindex Wsign-compare
3800 @opindex Wno-sign-compare
3801 @cindex warning for comparison of signed and unsigned values
3802 @cindex comparison of signed and unsigned values, warning
3803 @cindex signed and unsigned values, comparison warning
3804 Warn when a comparison between signed and unsigned values could produce
3805 an incorrect result when the signed value is converted to unsigned.
3806 This warning is also enabled by @option{-Wextra}; to get the other warnings
3807 of @option{-Wextra} without this warning, use @samp{-Wextra -Wno-sign-compare}.
3808
3809 @item -Wsign-conversion
3810 @opindex Wsign-conversion
3811 @opindex Wno-sign-conversion
3812 Warn for implicit conversions that may change the sign of an integer
3813 value, like assigning a signed integer expression to an unsigned
3814 integer variable. An explicit cast silences the warning. In C, this
3815 option is enabled also by @option{-Wconversion}.
3816
3817 @item -Waddress
3818 @opindex Waddress
3819 @opindex Wno-address
3820 Warn about suspicious uses of memory addresses. These include using
3821 the address of a function in a conditional expression, such as
3822 @code{void func(void); if (func)}, and comparisons against the memory
3823 address of a string literal, such as @code{if (x == "abc")}.  Such
3824 uses typically indicate a programmer error: the address of a function
3825 always evaluates to true, so their use in a conditional usually
3826 indicate that the programmer forgot the parentheses in a function
3827 call; and comparisons against string literals result in unspecified
3828 behavior and are not portable in C, so they usually indicate that the
3829 programmer intended to use @code{strcmp}.  This warning is enabled by
3830 @option{-Wall}.
3831
3832 @item -Wlogical-op
3833 @opindex Wlogical-op
3834 @opindex Wno-logical-op
3835 Warn about suspicious uses of logical operators in expressions.
3836 This includes using logical operators in contexts where a
3837 bit-wise operator is likely to be expected.
3838
3839 @item -Waggregate-return
3840 @opindex Waggregate-return
3841 @opindex Wno-aggregate-return
3842 Warn if any functions that return structures or unions are defined or
3843 called.  (In languages where you can return an array, this also elicits
3844 a warning.)
3845
3846 @item -Wno-attributes
3847 @opindex Wno-attributes
3848 @opindex Wattributes
3849 Do not warn if an unexpected @code{__attribute__} is used, such as
3850 unrecognized attributes, function attributes applied to variables,
3851 etc.  This will not stop errors for incorrect use of supported
3852 attributes.
3853
3854 @item -Wno-builtin-macro-redefined
3855 @opindex Wno-builtin-macro-redefined
3856 @opindex Wbuiltin-macro-redefined
3857 Do not warn if certain built-in macros are redefined.  This suppresses
3858 warnings for redefinition of @code{__TIMESTAMP__}, @code{__TIME__},
3859 @code{__DATE__}, @code{__FILE__}, and @code{__BASE_FILE__}.
3860
3861 @item -Wstrict-prototypes @r{(C and Objective-C only)}
3862 @opindex Wstrict-prototypes
3863 @opindex Wno-strict-prototypes
3864 Warn if a function is declared or defined without specifying the
3865 argument types.  (An old-style function definition is permitted without
3866 a warning if preceded by a declaration which specifies the argument
3867 types.)
3868
3869 @item -Wold-style-declaration @r{(C and Objective-C only)}
3870 @opindex Wold-style-declaration
3871 @opindex Wno-old-style-declaration
3872 Warn for obsolescent usages, according to the C Standard, in a
3873 declaration. For example, warn if storage-class specifiers like
3874 @code{static} are not the first things in a declaration.  This warning
3875 is also enabled by @option{-Wextra}.
3876
3877 @item -Wold-style-definition @r{(C and Objective-C only)}
3878 @opindex Wold-style-definition
3879 @opindex Wno-old-style-definition
3880 Warn if an old-style function definition is used.  A warning is given
3881 even if there is a previous prototype.
3882
3883 @item -Wmissing-parameter-type @r{(C and Objective-C only)}
3884 @opindex Wmissing-parameter-type
3885 @opindex Wno-missing-parameter-type
3886 A function parameter is declared without a type specifier in K&R-style
3887 functions:
3888
3889 @smallexample
3890 void foo(bar) @{ @}
3891 @end smallexample
3892
3893 This warning is also enabled by @option{-Wextra}.
3894
3895 @item -Wmissing-prototypes @r{(C and Objective-C only)}
3896 @opindex Wmissing-prototypes
3897 @opindex Wno-missing-prototypes
3898 Warn if a global function is defined without a previous prototype
3899 declaration.  This warning is issued even if the definition itself
3900 provides a prototype.  The aim is to detect global functions that fail
3901 to be declared in header files.
3902
3903 @item -Wmissing-declarations
3904 @opindex Wmissing-declarations
3905 @opindex Wno-missing-declarations
3906 Warn if a global function is defined without a previous declaration.
3907 Do so even if the definition itself provides a prototype.
3908 Use this option to detect global functions that are not declared in
3909 header files.  In C++, no warnings are issued for function templates,
3910 or for inline functions, or for functions in anonymous namespaces.
3911
3912 @item -Wmissing-field-initializers
3913 @opindex Wmissing-field-initializers
3914 @opindex Wno-missing-field-initializers
3915 @opindex W
3916 @opindex Wextra
3917 @opindex Wno-extra
3918 Warn if a structure's initializer has some fields missing.  For
3919 example, the following code would cause such a warning, because
3920 @code{x.h} is implicitly zero:
3921
3922 @smallexample
3923 struct s @{ int f, g, h; @};
3924 struct s x = @{ 3, 4 @};
3925 @end smallexample
3926
3927 This option does not warn about designated initializers, so the following
3928 modification would not trigger a warning:
3929
3930 @smallexample
3931 struct s @{ int f, g, h; @};
3932 struct s x = @{ .f = 3, .g = 4 @};
3933 @end smallexample
3934
3935 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
3936 warnings without this one, use @samp{-Wextra -Wno-missing-field-initializers}.
3937
3938 @item -Wmissing-noreturn
3939 @opindex Wmissing-noreturn
3940 @opindex Wno-missing-noreturn
3941 Warn about functions which might be candidates for attribute @code{noreturn}.
3942 Note these are only possible candidates, not absolute ones.  Care should
3943 be taken to manually verify functions actually do not ever return before
3944 adding the @code{noreturn} attribute, otherwise subtle code generation
3945 bugs could be introduced.  You will not get a warning for @code{main} in
3946 hosted C environments.
3947
3948 @item -Wmissing-format-attribute
3949 @opindex Wmissing-format-attribute
3950 @opindex Wno-missing-format-attribute
3951 @opindex Wformat
3952 @opindex Wno-format
3953 Warn about function pointers which might be candidates for @code{format}
3954 attributes.  Note these are only possible candidates, not absolute ones.
3955 GCC will guess that function pointers with @code{format} attributes that
3956 are used in assignment, initialization, parameter passing or return
3957 statements should have a corresponding @code{format} attribute in the
3958 resulting type.  I.e.@: the left-hand side of the assignment or
3959 initialization, the type of the parameter variable, or the return type
3960 of the containing function respectively should also have a @code{format}
3961 attribute to avoid the warning.
3962
3963 GCC will also warn about function definitions which might be
3964 candidates for @code{format} attributes.  Again, these are only
3965 possible candidates.  GCC will guess that @code{format} attributes
3966 might be appropriate for any function that calls a function like
3967 @code{vprintf} or @code{vscanf}, but this might not always be the
3968 case, and some functions for which @code{format} attributes are
3969 appropriate may not be detected.
3970
3971 @item -Wno-multichar
3972 @opindex Wno-multichar
3973 @opindex Wmultichar
3974 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
3975 Usually they indicate a typo in the user's code, as they have
3976 implementation-defined values, and should not be used in portable code.
3977
3978 @item -Wnormalized=<none|id|nfc|nfkc>
3979 @opindex Wnormalized=
3980 @cindex NFC
3981 @cindex NFKC
3982 @cindex character set, input normalization
3983 In ISO C and ISO C++, two identifiers are different if they are
3984 different sequences of characters.  However, sometimes when characters
3985 outside the basic ASCII character set are used, you can have two
3986 different character sequences that look the same.  To avoid confusion,
3987 the ISO 10646 standard sets out some @dfn{normalization rules} which
3988 when applied ensure that two sequences that look the same are turned into
3989 the same sequence.  GCC can warn you if you are using identifiers which
3990 have not been normalized; this option controls that warning.
3991
3992 There are four levels of warning that GCC supports.  The default is
3993 @option{-Wnormalized=nfc}, which warns about any identifier which is
3994 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
3995 recommended form for most uses.
3996
3997 Unfortunately, there are some characters which ISO C and ISO C++ allow
3998 in identifiers that when turned into NFC aren't allowable as
3999 identifiers.  That is, there's no way to use these symbols in portable
4000 ISO C or C++ and have all your identifiers in NFC@.
4001 @option{-Wnormalized=id} suppresses the warning for these characters.
4002 It is hoped that future versions of the standards involved will correct
4003 this, which is why this option is not the default.
4004
4005 You can switch the warning off for all characters by writing
4006 @option{-Wnormalized=none}.  You would only want to do this if you
4007 were using some other normalization scheme (like ``D''), because
4008 otherwise you can easily create bugs that are literally impossible to see.
4009
4010 Some characters in ISO 10646 have distinct meanings but look identical
4011 in some fonts or display methodologies, especially once formatting has
4012 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
4013 LETTER N'', will display just like a regular @code{n} which has been
4014 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
4015 normalization scheme to convert all these into a standard form as
4016 well, and GCC will warn if your code is not in NFKC if you use
4017 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
4018 about every identifier that contains the letter O because it might be
4019 confused with the digit 0, and so is not the default, but may be
4020 useful as a local coding convention if the programming environment is
4021 unable to be fixed to display these characters distinctly.
4022
4023 @item -Wno-deprecated
4024 @opindex Wno-deprecated
4025 @opindex Wdeprecated
4026 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
4027
4028 @item -Wno-deprecated-declarations
4029 @opindex Wno-deprecated-declarations
4030 @opindex Wdeprecated-declarations
4031 Do not warn about uses of functions (@pxref{Function Attributes}),
4032 variables (@pxref{Variable Attributes}), and types (@pxref{Type
4033 Attributes}) marked as deprecated by using the @code{deprecated}
4034 attribute.
4035
4036 @item -Wno-overflow
4037 @opindex Wno-overflow
4038 @opindex Woverflow
4039 Do not warn about compile-time overflow in constant expressions.
4040
4041 @item -Woverride-init @r{(C and Objective-C only)}
4042 @opindex Woverride-init
4043 @opindex Wno-override-init
4044 @opindex W
4045 @opindex Wextra
4046 @opindex Wno-extra
4047 Warn if an initialized field without side effects is overridden when
4048 using designated initializers (@pxref{Designated Inits, , Designated
4049 Initializers}).
4050
4051 This warning is included in @option{-Wextra}.  To get other
4052 @option{-Wextra} warnings without this one, use @samp{-Wextra
4053 -Wno-override-init}.
4054
4055 @item -Wpacked
4056 @opindex Wpacked
4057 @opindex Wno-packed
4058 Warn if a structure is given the packed attribute, but the packed
4059 attribute has no effect on the layout or size of the structure.
4060 Such structures may be mis-aligned for little benefit.  For
4061 instance, in this code, the variable @code{f.x} in @code{struct bar}
4062 will be misaligned even though @code{struct bar} does not itself
4063 have the packed attribute:
4064
4065 @smallexample
4066 @group
4067 struct foo @{
4068   int x;
4069   char a, b, c, d;
4070 @} __attribute__((packed));
4071 struct bar @{
4072   char z;
4073   struct foo f;
4074 @};
4075 @end group
4076 @end smallexample
4077
4078 @item -Wpacked-bitfield-compat
4079 @opindex Wpacked-bitfield-compat
4080 @opindex Wno-packed-bitfield-compat
4081 The 4.1, 4.2 and 4.3 series of GCC ignore the @code{packed} attribute
4082 on bit-fields of type @code{char}.  This has been fixed in GCC 4.4 but
4083 the change can lead to differences in the structure layout.  GCC
4084 informs you when the offset of such a field has changed in GCC 4.4.
4085 For example there is no longer a 4-bit padding between field @code{a}
4086 and @code{b} in this structure:
4087
4088 @smallexample
4089 struct foo
4090 @{
4091   char a:4;
4092   char b:8;
4093 @} __attribute__ ((packed));
4094 @end smallexample
4095
4096 This warning is enabled by default.  Use
4097 @option{-Wno-packed-bitfield-compat} to disable this warning.
4098
4099 @item -Wpadded
4100 @opindex Wpadded
4101 @opindex Wno-padded
4102 Warn if padding is included in a structure, either to align an element
4103 of the structure or to align the whole structure.  Sometimes when this
4104 happens it is possible to rearrange the fields of the structure to
4105 reduce the padding and so make the structure smaller.
4106
4107 @item -Wredundant-decls
4108 @opindex Wredundant-decls
4109 @opindex Wno-redundant-decls
4110 Warn if anything is declared more than once in the same scope, even in
4111 cases where multiple declaration is valid and changes nothing.
4112
4113 @item -Wnested-externs @r{(C and Objective-C only)}
4114 @opindex Wnested-externs
4115 @opindex Wno-nested-externs
4116 Warn if an @code{extern} declaration is encountered within a function.
4117
4118 @item -Wunreachable-code
4119 @opindex Wunreachable-code
4120 @opindex Wno-unreachable-code
4121 Warn if the compiler detects that code will never be executed.
4122
4123 This option is intended to warn when the compiler detects that at
4124 least a whole line of source code will never be executed, because
4125 some condition is never satisfied or because it is after a
4126 procedure that never returns.
4127
4128 It is possible for this option to produce a warning even though there
4129 are circumstances under which part of the affected line can be executed,
4130 so care should be taken when removing apparently-unreachable code.
4131
4132 For instance, when a function is inlined, a warning may mean that the
4133 line is unreachable in only one inlined copy of the function.
4134
4135 This option is not made part of @option{-Wall} because in a debugging
4136 version of a program there is often substantial code which checks
4137 correct functioning of the program and is, hopefully, unreachable
4138 because the program does work.  Another common use of unreachable
4139 code is to provide behavior which is selectable at compile-time.
4140
4141 @item -Winline
4142 @opindex Winline
4143 @opindex Wno-inline
4144 Warn if a function can not be inlined and it was declared as inline.
4145 Even with this option, the compiler will not warn about failures to
4146 inline functions declared in system headers.
4147
4148 The compiler uses a variety of heuristics to determine whether or not
4149 to inline a function.  For example, the compiler takes into account
4150 the size of the function being inlined and the amount of inlining
4151 that has already been done in the current function.  Therefore,
4152 seemingly insignificant changes in the source program can cause the
4153 warnings produced by @option{-Winline} to appear or disappear.
4154
4155 @item -Wno-invalid-offsetof @r{(C++ and Objective-C++ only)}
4156 @opindex Wno-invalid-offsetof
4157 @opindex Winvalid-offsetof
4158 Suppress warnings from applying the @samp{offsetof} macro to a non-POD
4159 type.  According to the 1998 ISO C++ standard, applying @samp{offsetof}
4160 to a non-POD type is undefined.  In existing C++ implementations,
4161 however, @samp{offsetof} typically gives meaningful results even when
4162 applied to certain kinds of non-POD types. (Such as a simple
4163 @samp{struct} that fails to be a POD type only by virtue of having a
4164 constructor.)  This flag is for users who are aware that they are
4165 writing nonportable code and who have deliberately chosen to ignore the
4166 warning about it.
4167
4168 The restrictions on @samp{offsetof} may be relaxed in a future version
4169 of the C++ standard.
4170
4171 @item -Wno-int-to-pointer-cast @r{(C and Objective-C only)}
4172 @opindex Wno-int-to-pointer-cast
4173 @opindex Wint-to-pointer-cast
4174 Suppress warnings from casts to pointer type of an integer of a
4175 different size.
4176
4177 @item -Wno-pointer-to-int-cast @r{(C and Objective-C only)}
4178 @opindex Wno-pointer-to-int-cast
4179 @opindex Wpointer-to-int-cast
4180 Suppress warnings from casts from a pointer to an integer type of a
4181 different size.
4182
4183 @item -Winvalid-pch
4184 @opindex Winvalid-pch
4185 @opindex Wno-invalid-pch
4186 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
4187 the search path but can't be used.
4188
4189 @item -Wlong-long
4190 @opindex Wlong-long
4191 @opindex Wno-long-long
4192 Warn if @samp{long long} type is used.  This is enabled by either
4193 @option{-pedantic} or @option{-Wtraditional} in ISO C90 and C++98
4194 modes.  To inhibit the warning messages, use @option{-Wno-long-long}.
4195
4196 @item -Wvariadic-macros
4197 @opindex Wvariadic-macros
4198 @opindex Wno-variadic-macros
4199 Warn if variadic macros are used in pedantic ISO C90 mode, or the GNU
4200 alternate syntax when in pedantic ISO C99 mode.  This is default.
4201 To inhibit the warning messages, use @option{-Wno-variadic-macros}.
4202
4203 @item -Wvla
4204 @opindex Wvla
4205 @opindex Wno-vla
4206 Warn if variable length array is used in the code.
4207 @option{-Wno-vla} will prevent the @option{-pedantic} warning of
4208 the variable length array.
4209
4210 @item -Wvolatile-register-var
4211 @opindex Wvolatile-register-var
4212 @opindex Wno-volatile-register-var
4213 Warn if a register variable is declared volatile.  The volatile
4214 modifier does not inhibit all optimizations that may eliminate reads
4215 and/or writes to register variables.  This warning is enabled by
4216 @option{-Wall}.
4217
4218 @item -Wdisabled-optimization
4219 @opindex Wdisabled-optimization
4220 @opindex Wno-disabled-optimization
4221 Warn if a requested optimization pass is disabled.  This warning does
4222 not generally indicate that there is anything wrong with your code; it
4223 merely indicates that GCC's optimizers were unable to handle the code
4224 effectively.  Often, the problem is that your code is too big or too
4225 complex; GCC will refuse to optimize programs when the optimization
4226 itself is likely to take inordinate amounts of time.
4227
4228 @item -Wpointer-sign @r{(C and Objective-C only)}
4229 @opindex Wpointer-sign
4230 @opindex Wno-pointer-sign
4231 Warn for pointer argument passing or assignment with different signedness.
4232 This option is only supported for C and Objective-C@.  It is implied by
4233 @option{-Wall} and by @option{-pedantic}, which can be disabled with
4234 @option{-Wno-pointer-sign}.
4235
4236 @item -Wstack-protector
4237 @opindex Wstack-protector
4238 @opindex Wno-stack-protector
4239 This option is only active when @option{-fstack-protector} is active.  It
4240 warns about functions that will not be protected against stack smashing.
4241
4242 @item -Wno-mudflap
4243 @opindex Wno-mudflap
4244 Suppress warnings about constructs that cannot be instrumented by
4245 @option{-fmudflap}.
4246
4247 @item -Woverlength-strings
4248 @opindex Woverlength-strings
4249 @opindex Wno-overlength-strings
4250 Warn about string constants which are longer than the ``minimum
4251 maximum'' length specified in the C standard.  Modern compilers
4252 generally allow string constants which are much longer than the
4253 standard's minimum limit, but very portable programs should avoid
4254 using longer strings.
4255
4256 The limit applies @emph{after} string constant concatenation, and does
4257 not count the trailing NUL@.  In C89, the limit was 509 characters; in
4258 C99, it was raised to 4095.  C++98 does not specify a normative
4259 minimum maximum, so we do not diagnose overlength strings in C++@.
4260
4261 This option is implied by @option{-pedantic}, and can be disabled with
4262 @option{-Wno-overlength-strings}.
4263
4264 @item -Wunsuffixed-float-constants
4265 @opindex Wunsuffixed-float-constants
4266
4267 GCC will issue a warning for any floating constant that does not have
4268 a suffix.  When used together with @option{-Wsystem-headers} it will
4269 warn about such constants in system header files.  This can be useful
4270 when preparing code to use with the @code{FLOAT_CONST_DECIMAL64} pragma
4271 from the decimal floating-point extension to C99.
4272 @end table
4273
4274 @node Debugging Options
4275 @section Options for Debugging Your Program or GCC
4276 @cindex options, debugging
4277 @cindex debugging information options
4278
4279 GCC has various special options that are used for debugging
4280 either your program or GCC:
4281
4282 @table @gcctabopt
4283 @item -g
4284 @opindex g
4285 Produce debugging information in the operating system's native format
4286 (stabs, COFF, XCOFF, or DWARF 2)@.  GDB can work with this debugging
4287 information.
4288
4289 On most systems that use stabs format, @option{-g} enables use of extra
4290 debugging information that only GDB can use; this extra information
4291 makes debugging work better in GDB but will probably make other debuggers
4292 crash or
4293 refuse to read the program.  If you want to control for certain whether
4294 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
4295 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
4296
4297 GCC allows you to use @option{-g} with
4298 @option{-O}.  The shortcuts taken by optimized code may occasionally
4299 produce surprising results: some variables you declared may not exist
4300 at all; flow of control may briefly move where you did not expect it;
4301 some statements may not be executed because they compute constant
4302 results or their values were already at hand; some statements may
4303 execute in different places because they were moved out of loops.
4304
4305 Nevertheless it proves possible to debug optimized output.  This makes
4306 it reasonable to use the optimizer for programs that might have bugs.
4307
4308 The following options are useful when GCC is generated with the
4309 capability for more than one debugging format.
4310
4311 @item -ggdb
4312 @opindex ggdb
4313 Produce debugging information for use by GDB@.  This means to use the
4314 most expressive format available (DWARF 2, stabs, or the native format
4315 if neither of those are supported), including GDB extensions if at all
4316 possible.
4317
4318 @item -gstabs
4319 @opindex gstabs
4320 Produce debugging information in stabs format (if that is supported),
4321 without GDB extensions.  This is the format used by DBX on most BSD
4322 systems.  On MIPS, Alpha and System V Release 4 systems this option
4323 produces stabs debugging output which is not understood by DBX or SDB@.
4324 On System V Release 4 systems this option requires the GNU assembler.
4325
4326 @item -feliminate-unused-debug-symbols
4327 @opindex feliminate-unused-debug-symbols
4328 Produce debugging information in stabs format (if that is supported),
4329 for only symbols that are actually used.
4330
4331 @item -femit-class-debug-always
4332 Instead of emitting debugging information for a C++ class in only one
4333 object file, emit it in all object files using the class.  This option
4334 should be used only with debuggers that are unable to handle the way GCC
4335 normally emits debugging information for classes because using this
4336 option will increase the size of debugging information by as much as a
4337 factor of two.
4338
4339 @item -gstabs+
4340 @opindex gstabs+
4341 Produce debugging information in stabs format (if that is supported),
4342 using GNU extensions understood only by the GNU debugger (GDB)@.  The
4343 use of these extensions is likely to make other debuggers crash or
4344 refuse to read the program.
4345
4346 @item -gcoff
4347 @opindex gcoff
4348 Produce debugging information in COFF format (if that is supported).
4349 This is the format used by SDB on most System V systems prior to
4350 System V Release 4.
4351
4352 @item -gxcoff
4353 @opindex gxcoff
4354 Produce debugging information in XCOFF format (if that is supported).
4355 This is the format used by the DBX debugger on IBM RS/6000 systems.
4356
4357 @item -gxcoff+
4358 @opindex gxcoff+
4359 Produce debugging information in XCOFF format (if that is supported),
4360 using GNU extensions understood only by the GNU debugger (GDB)@.  The
4361 use of these extensions is likely to make other debuggers crash or
4362 refuse to read the program, and may cause assemblers other than the GNU
4363 assembler (GAS) to fail with an error.
4364
4365 @item -gdwarf-@var{version}
4366 @opindex gdwarf-@var{version}
4367 Produce debugging information in DWARF format (if that is
4368 supported).  This is the format used by DBX on IRIX 6.  The value
4369 of @var{version} may be either 2 or 3; the default version is 2.
4370
4371 Note that with DWARF version 2 some ports require, and will always
4372 use, some non-conflicting DWARF 3 extensions in the unwind tables.
4373
4374 @item -gvms
4375 @opindex gvms
4376 Produce debugging information in VMS debug format (if that is
4377 supported).  This is the format used by DEBUG on VMS systems.
4378
4379 @item -g@var{level}
4380 @itemx -ggdb@var{level}
4381 @itemx -gstabs@var{level}
4382 @itemx -gcoff@var{level}
4383 @itemx -gxcoff@var{level}
4384 @itemx -gvms@var{level}
4385 Request debugging information and also use @var{level} to specify how
4386 much information.  The default level is 2.
4387
4388 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
4389 @option{-g}.
4390
4391 Level 1 produces minimal information, enough for making backtraces in
4392 parts of the program that you don't plan to debug.  This includes
4393 descriptions of functions and external variables, but no information
4394 about local variables and no line numbers.
4395
4396 Level 3 includes extra information, such as all the macro definitions
4397 present in the program.  Some debuggers support macro expansion when
4398 you use @option{-g3}.
4399
4400 @option{-gdwarf-2} does not accept a concatenated debug level, because
4401 GCC used to support an option @option{-gdwarf} that meant to generate
4402 debug information in version 1 of the DWARF format (which is very
4403 different from version 2), and it would have been too confusing.  That
4404 debug format is long obsolete, but the option cannot be changed now.
4405 Instead use an additional @option{-g@var{level}} option to change the
4406 debug level for DWARF.
4407
4408 @item -gtoggle
4409 @opindex gtoggle
4410 Turn off generation of debug info, if leaving out this option would have
4411 generated it, or turn it on at level 2 otherwise.  The position of this
4412 argument in the command line does not matter, it takes effect after all
4413 other options are processed, and it does so only once, no matter how
4414 many times it is given.  This is mainly intended to be used with
4415 @option{-fcompare-debug}.
4416
4417 @item -fdump-final-insns=@var{file}
4418 @opindex fdump-final-insns=
4419 Dump the final internal representation (RTL) to @var{file}.
4420
4421 @item -fcompare-debug@r{[}=@var{opts}@r{]}
4422 @opindex fcompare-debug
4423 @opindex fno-compare-debug
4424 If no error occurs during compilation, run the compiler a second time,
4425 adding @var{opts} and @option{-fcompare-debug-second} to the arguments
4426 passed to the second compilation.  Dump the final internal
4427 representation in both compilations, and print an error if they differ.
4428
4429 If the equal sign is omitted, the default @option{-gtoggle} is used.
4430
4431 The environment variable @env{GCC_COMPARE_DEBUG}, if defined, non-empty
4432 and nonzero, implicitly enables @option{-fcompare-debug}.  If
4433 @env{GCC_COMPARE_DEBUG} is defined to a string starting with a dash,
4434 then it is used for @var{opts}, otherwise the default @option{-gtoggle}
4435 is used.
4436
4437 @option{-fcompare-debug=}, with the equal sign but without @var{opts},
4438 is equivalent to @option{-fno-compare-debug}, which disables the dumping
4439 of the final representation and the second compilation, preventing even
4440 @env{GCC_COMPARE_DEBUG} from taking effect.
4441
4442 To verify full coverage during @option{-fcompare-debug} testing, set
4443 @env{GCC_COMPARE_DEBUG} to say @samp{-fcompare-debug-not-overridden},
4444 which GCC will reject as an invalid option in any actual compilation
4445 (rather than preprocessing, assembly or linking).  To get just a
4446 warning, setting @env{GCC_COMPARE_DEBUG} to @samp{-w%n-fcompare-debug
4447 not overridden} will do.
4448
4449 @item -fcompare-debug-second
4450 @opindex fcompare-debug-second
4451 This option is implicitly passed to the compiler for the second
4452 compilation requested by @option{-fcompare-debug}, along with options to
4453 silence warnings, and omitting other options that would cause
4454 side-effect compiler outputs to files or to the standard output.  Dump
4455 files and preserved temporary files are renamed so as to contain the
4456 @code{.gk} additional extension during the second compilation, to avoid
4457 overwriting those generated by the first.
4458
4459 When this option is passed to the compiler driver, it causes the
4460 @emph{first} compilation to be skipped, which makes it useful for little
4461 other than debugging the compiler proper.
4462
4463 @item -feliminate-dwarf2-dups
4464 @opindex feliminate-dwarf2-dups
4465 Compress DWARF2 debugging information by eliminating duplicated
4466 information about each symbol.  This option only makes sense when
4467 generating DWARF2 debugging information with @option{-gdwarf-2}.
4468
4469 @item -femit-struct-debug-baseonly
4470 Emit debug information for struct-like types
4471 only when the base name of the compilation source file
4472 matches the base name of file in which the struct was defined.
4473
4474 This option substantially reduces the size of debugging information,
4475 but at significant potential loss in type information to the debugger.
4476 See @option{-femit-struct-debug-reduced} for a less aggressive option.
4477 See @option{-femit-struct-debug-detailed} for more detailed control.
4478
4479 This option works only with DWARF 2.
4480
4481 @item -femit-struct-debug-reduced
4482 Emit debug information for struct-like types
4483 only when the base name of the compilation source file
4484 matches the base name of file in which the type was defined,
4485 unless the struct is a template or defined in a system header.
4486
4487 This option significantly reduces the size of debugging information,
4488 with some potential loss in type information to the debugger.
4489 See @option{-femit-struct-debug-baseonly} for a more aggressive option.
4490 See @option{-femit-struct-debug-detailed} for more detailed control.
4491
4492 This option works only with DWARF 2.
4493
4494 @item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
4495 Specify the struct-like types
4496 for which the compiler will generate debug information.
4497 The intent is to reduce duplicate struct debug information
4498 between different object files within the same program.
4499
4500 This option is a detailed version of
4501 @option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
4502 which will serve for most needs.
4503
4504 A specification has the syntax
4505 [@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
4506
4507 The optional first word limits the specification to
4508 structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
4509 A struct type is used directly when it is the type of a variable, member.
4510 Indirect uses arise through pointers to structs.
4511 That is, when use of an incomplete struct would be legal, the use is indirect.
4512 An example is
4513 @samp{struct one direct; struct two * indirect;}.
4514
4515 The optional second word limits the specification to
4516 ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
4517 Generic structs are a bit complicated to explain.
4518 For C++, these are non-explicit specializations of template classes,
4519 or non-template classes within the above.
4520 Other programming languages have generics,
4521 but @samp{-femit-struct-debug-detailed} does not yet implement them.
4522
4523 The third word specifies the source files for those
4524 structs for which the compiler will emit debug information.
4525 The values @samp{none} and @samp{any} have the normal meaning.
4526 The value @samp{base} means that
4527 the base of name of the file in which the type declaration appears
4528 must match the base of the name of the main compilation file.
4529 In practice, this means that
4530 types declared in @file{foo.c} and @file{foo.h} will have debug information,
4531 but types declared in other header will not.
4532 The value @samp{sys} means those types satisfying @samp{base}
4533 or declared in system or compiler headers.
4534
4535 You may need to experiment to determine the best settings for your application.
4536
4537 The default is @samp{-femit-struct-debug-detailed=all}.
4538
4539 This option works only with DWARF 2.
4540
4541 @item -fno-merge-debug-strings
4542 @opindex fmerge-debug-strings
4543 @opindex fno-merge-debug-strings
4544 Direct the linker to not merge together strings in the debugging
4545 information which are identical in different object files.  Merging is
4546 not supported by all assemblers or linkers.  Merging decreases the size
4547 of the debug information in the output file at the cost of increasing
4548 link processing time.  Merging is enabled by default.
4549
4550 @item -fdebug-prefix-map=@var{old}=@var{new}
4551 @opindex fdebug-prefix-map
4552 When compiling files in directory @file{@var{old}}, record debugging
4553 information describing them as in @file{@var{new}} instead.
4554
4555 @item -fno-dwarf2-cfi-asm
4556 @opindex fdwarf2-cfi-asm
4557 @opindex fno-dwarf2-cfi-asm
4558 Emit DWARF 2 unwind info as compiler generated @code{.eh_frame} section
4559 instead of using GAS @code{.cfi_*} directives.
4560
4561 @cindex @command{prof}
4562 @item -p
4563 @opindex p
4564 Generate extra code to write profile information suitable for the
4565 analysis program @command{prof}.  You must use this option when compiling
4566 the source files you want data about, and you must also use it when
4567 linking.
4568
4569 @cindex @command{gprof}
4570 @item -pg
4571 @opindex pg
4572 Generate extra code to write profile information suitable for the
4573 analysis program @command{gprof}.  You must use this option when compiling
4574 the source files you want data about, and you must also use it when
4575 linking.
4576
4577 @item -Q
4578 @opindex Q
4579 Makes the compiler print out each function name as it is compiled, and
4580 print some statistics about each pass when it finishes.
4581
4582 @item -ftime-report
4583 @opindex ftime-report
4584 Makes the compiler print some statistics about the time consumed by each
4585 pass when it finishes.
4586
4587 @item -fmem-report
4588 @opindex fmem-report
4589 Makes the compiler print some statistics about permanent memory
4590 allocation when it finishes.
4591
4592 @item -fpre-ipa-mem-report
4593 @opindex fpre-ipa-mem-report
4594 @item -fpost-ipa-mem-report
4595 @opindex fpost-ipa-mem-report
4596 Makes the compiler print some statistics about permanent memory
4597 allocation before or after interprocedural optimization.
4598
4599 @item -fprofile-arcs
4600 @opindex fprofile-arcs
4601 Add code so that program flow @dfn{arcs} are instrumented.  During
4602 execution the program records how many times each branch and call is
4603 executed and how many times it is taken or returns.  When the compiled
4604 program exits it saves this data to a file called
4605 @file{@var{auxname}.gcda} for each source file.  The data may be used for
4606 profile-directed optimizations (@option{-fbranch-probabilities}), or for
4607 test coverage analysis (@option{-ftest-coverage}).  Each object file's
4608 @var{auxname} is generated from the name of the output file, if
4609 explicitly specified and it is not the final executable, otherwise it is
4610 the basename of the source file.  In both cases any suffix is removed
4611 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
4612 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
4613 @xref{Cross-profiling}.
4614
4615 @cindex @command{gcov}
4616 @item --coverage
4617 @opindex coverage
4618
4619 This option is used to compile and link code instrumented for coverage
4620 analysis.  The option is a synonym for @option{-fprofile-arcs}
4621 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
4622 linking).  See the documentation for those options for more details.
4623
4624 @itemize
4625
4626 @item
4627 Compile the source files with @option{-fprofile-arcs} plus optimization
4628 and code generation options.  For test coverage analysis, use the
4629 additional @option{-ftest-coverage} option.  You do not need to profile
4630 every source file in a program.
4631
4632 @item
4633 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
4634 (the latter implies the former).
4635
4636 @item
4637 Run the program on a representative workload to generate the arc profile
4638 information.  This may be repeated any number of times.  You can run
4639 concurrent instances of your program, and provided that the file system
4640 supports locking, the data files will be correctly updated.  Also
4641 @code{fork} calls are detected and correctly handled (double counting
4642 will not happen).
4643
4644 @item
4645 For profile-directed optimizations, compile the source files again with
4646 the same optimization and code generation options plus
4647 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
4648 Control Optimization}).
4649
4650 @item
4651 For test coverage analysis, use @command{gcov} to produce human readable
4652 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
4653 @command{gcov} documentation for further information.
4654
4655 @end itemize
4656
4657 With @option{-fprofile-arcs}, for each function of your program GCC
4658 creates a program flow graph, then finds a spanning tree for the graph.
4659 Only arcs that are not on the spanning tree have to be instrumented: the
4660 compiler adds code to count the number of times that these arcs are
4661 executed.  When an arc is the only exit or only entrance to a block, the
4662 instrumentation code can be added to the block; otherwise, a new basic
4663 block must be created to hold the instrumentation code.
4664
4665 @need 2000
4666 @item -ftest-coverage
4667 @opindex ftest-coverage
4668 Produce a notes file that the @command{gcov} code-coverage utility
4669 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
4670 show program coverage.  Each source file's note file is called
4671 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
4672 above for a description of @var{auxname} and instructions on how to
4673 generate test coverage data.  Coverage data will match the source files
4674 more closely, if you do not optimize.
4675
4676 @item -fdbg-cnt-list
4677 @opindex fdbg-cnt-list
4678 Print the name and the counter upperbound for all debug counters.
4679
4680 @item -fdbg-cnt=@var{counter-value-list}
4681 @opindex fdbg-cnt
4682 Set the internal debug counter upperbound. @var{counter-value-list} 
4683 is a comma-separated list of @var{name}:@var{value} pairs
4684 which sets the upperbound of each debug counter @var{name} to @var{value}.
4685 All debug counters have the initial upperbound of @var{UINT_MAX},
4686 thus dbg_cnt() returns true always unless the upperbound is set by this option.
4687 e.g. With -fdbg-cnt=dce:10,tail_call:0
4688 dbg_cnt(dce) will return true only for first 10 invocations
4689 and dbg_cnt(tail_call) will return false always.
4690
4691 @item -d@var{letters}
4692 @itemx -fdump-rtl-@var{pass}
4693 @opindex d
4694 Says to make debugging dumps during compilation at times specified by
4695 @var{letters}.  This is used for debugging the RTL-based passes of the
4696 compiler.  The file names for most of the dumps are made by appending
4697 a pass number and a word to the @var{dumpname}, and the files are
4698 created in the directory of the output file.  @var{dumpname} is
4699 generated from the name of the output file, if explicitly specified
4700 and it is not an executable, otherwise it is the basename of the
4701 source file. These switches may have different effects when
4702 @option{-E} is used for preprocessing.
4703
4704 Debug dumps can be enabled with a @option{-fdump-rtl} switch or some
4705 @option{-d} option @var{letters}.  Here are the possible
4706 letters for use in @var{pass} and @var{letters}, and their meanings:
4707
4708 @table @gcctabopt
4709
4710 @item -fdump-rtl-alignments
4711 @opindex fdump-rtl-alignments
4712 Dump after branch alignments have been computed.
4713
4714 @item -fdump-rtl-asmcons
4715 @opindex fdump-rtl-asmcons
4716 Dump after fixing rtl statements that have unsatisfied in/out constraints.
4717
4718 @item -fdump-rtl-auto_inc_dec
4719 @opindex fdump-rtl-auto_inc_dec
4720 Dump after auto-inc-dec discovery.  This pass is only run on
4721 architectures that have auto inc or auto dec instructions.
4722
4723 @item -fdump-rtl-barriers
4724 @opindex fdump-rtl-barriers
4725 Dump after cleaning up the barrier instructions.
4726
4727 @item -fdump-rtl-bbpart
4728 @opindex fdump-rtl-bbpart
4729 Dump after partitioning hot and cold basic blocks.
4730
4731 @item -fdump-rtl-bbro
4732 @opindex fdump-rtl-bbro
4733 Dump after block reordering.
4734
4735 @item -fdump-rtl-btl1
4736 @itemx -fdump-rtl-btl2
4737 @opindex fdump-rtl-btl2
4738 @opindex fdump-rtl-btl2
4739 @option{-fdump-rtl-btl1} and @option{-fdump-rtl-btl2} enable dumping
4740 after the two branch
4741 target load optimization passes.
4742
4743 @item -fdump-rtl-bypass
4744 @opindex fdump-rtl-bypass
4745 Dump after jump bypassing and control flow optimizations.
4746
4747 @item -fdump-rtl-combine
4748 @opindex fdump-rtl-combine
4749 Dump after the RTL instruction combination pass.
4750
4751 @item -fdump-rtl-compgotos
4752 @opindex fdump-rtl-compgotos
4753 Dump after duplicating the computed gotos.
4754
4755 @item -fdump-rtl-ce1
4756 @itemx -fdump-rtl-ce2
4757 @itemx -fdump-rtl-ce3
4758 @opindex fdump-rtl-ce1
4759 @opindex fdump-rtl-ce2
4760 @opindex fdump-rtl-ce3
4761 @option{-fdump-rtl-ce1}, @option{-fdump-rtl-ce2}, and
4762 @option{-fdump-rtl-ce3} enable dumping after the three
4763 if conversion passes. 
4764
4765 @itemx -fdump-rtl-cprop_hardreg
4766 @opindex fdump-rtl-cprop_hardreg
4767 Dump after hard register copy propagation.
4768
4769 @itemx -fdump-rtl-csa
4770 @opindex fdump-rtl-csa
4771 Dump after combining stack adjustments.
4772
4773 @item -fdump-rtl-cse1
4774 @itemx -fdump-rtl-cse2
4775 @opindex fdump-rtl-cse1
4776 @opindex fdump-rtl-cse2
4777 @option{-fdump-rtl-cse1} and @option{-fdump-rtl-cse2} enable dumping after
4778 the two common sub-expression elimination passes.
4779
4780 @itemx -fdump-rtl-dce
4781 @opindex fdump-rtl-dce
4782 Dump after the standalone dead code elimination passes.
4783
4784 @itemx -fdump-rtl-dbr
4785 @opindex fdump-rtl-dbr
4786 Dump after delayed branch scheduling.
4787
4788 @item -fdump-rtl-dce1
4789 @itemx -fdump-rtl-dce2
4790 @opindex fdump-rtl-dce1
4791 @opindex fdump-rtl-dce2
4792 @option{-fdump-rtl-dce1} and @option{-fdump-rtl-dce2} enable dumping after
4793 the two dead store elimination passes.
4794
4795 @item -fdump-rtl-eh
4796 @opindex fdump-rtl-eh
4797 Dump after finalization of EH handling code.
4798
4799 @item -fdump-rtl-eh_ranges
4800 @opindex fdump-rtl-eh_ranges
4801 Dump after conversion of EH handling range regions.
4802
4803 @item -fdump-rtl-expand
4804 @opindex fdump-rtl-expand
4805 Dump after RTL generation.
4806
4807 @item -fdump-rtl-fwprop1
4808 @itemx -fdump-rtl-fwprop2
4809 @opindex fdump-rtl-fwprop1
4810 @opindex fdump-rtl-fwprop2
4811 @option{-fdump-rtl-fwprop1} and @option{-fdump-rtl-fwprop2} enable
4812 dumping after the two forward propagation passes.
4813
4814 @item -fdump-rtl-gcse1
4815 @itemx -fdump-rtl-gcse2
4816 @opindex fdump-rtl-gcse1
4817 @opindex fdump-rtl-gcse2
4818 @option{-fdump-rtl-gcse1} and @option{-fdump-rtl-gcse2} enable dumping
4819 after global common subexpression elimination.
4820
4821 @item -fdump-rtl-init-regs
4822 @opindex fdump-rtl-init-regs
4823 Dump after the initialization of the registers.
4824
4825 @item -fdump-rtl-initvals
4826 @opindex fdump-rtl-initvals
4827 Dump after the computation of the initial value sets.
4828
4829 @itemx -fdump-rtl-into_cfglayout
4830 @opindex fdump-rtl-into_cfglayout
4831 Dump after converting to cfglayout mode.
4832
4833 @item -fdump-rtl-ira
4834 @opindex fdump-rtl-ira
4835 Dump after iterated register allocation.
4836
4837 @item -fdump-rtl-jump
4838 @opindex fdump-rtl-jump
4839 Dump after the second jump optimization.
4840
4841 @item -fdump-rtl-loop2
4842 @opindex fdump-rtl-loop2
4843 @option{-fdump-rtl-loop2} enables dumping after the rtl
4844 loop optimization passes.
4845
4846 @item -fdump-rtl-mach
4847 @opindex fdump-rtl-mach
4848 Dump after performing the machine dependent reorganization pass, if that
4849 pass exists.
4850
4851 @item -fdump-rtl-mode_sw
4852 @opindex fdump-rtl-mode_sw
4853 Dump after removing redundant mode switches.
4854
4855 @item -fdump-rtl-rnreg
4856 @opindex fdump-rtl-rnreg
4857 Dump after register renumbering.
4858
4859 @itemx -fdump-rtl-outof_cfglayout
4860 @opindex fdump-rtl-outof_cfglayout
4861 Dump after converting from cfglayout mode.
4862
4863 @item -fdump-rtl-peephole2
4864 @opindex fdump-rtl-peephole2
4865 Dump after the peephole pass.
4866
4867 @item -fdump-rtl-postreload
4868 @opindex fdump-rtl-postreload
4869 Dump after post-reload optimizations.
4870
4871 @itemx -fdump-rtl-pro_and_epilogue
4872 @opindex fdump-rtl-pro_and_epilogue
4873 Dump after generating the function pro and epilogues.
4874
4875 @item -fdump-rtl-regmove
4876 @opindex fdump-rtl-regmove
4877 Dump after the register move pass.
4878
4879 @item -fdump-rtl-sched1
4880 @itemx -fdump-rtl-sched2
4881 @opindex fdump-rtl-sched1
4882 @opindex fdump-rtl-sched2
4883 @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2} enable dumping
4884 after the basic block scheduling passes.
4885
4886 @item -fdump-rtl-see
4887 @opindex fdump-rtl-see
4888 Dump after sign extension elimination.
4889
4890 @item -fdump-rtl-seqabstr
4891 @opindex fdump-rtl-seqabstr
4892 Dump after common sequence discovery. 
4893
4894 @item -fdump-rtl-shorten
4895 @opindex fdump-rtl-shorten
4896 Dump after shortening branches.
4897
4898 @item -fdump-rtl-sibling
4899 @opindex fdump-rtl-sibling
4900 Dump after sibling call optimizations.
4901
4902 @item -fdump-rtl-split1
4903 @itemx -fdump-rtl-split2
4904 @itemx -fdump-rtl-split3
4905 @itemx -fdump-rtl-split4
4906 @itemx -fdump-rtl-split5
4907 @opindex fdump-rtl-split1
4908 @opindex fdump-rtl-split2
4909 @opindex fdump-rtl-split3
4910 @opindex fdump-rtl-split4
4911 @opindex fdump-rtl-split5
4912 @option{-fdump-rtl-split1}, @option{-fdump-rtl-split2},
4913 @option{-fdump-rtl-split3}, @option{-fdump-rtl-split4} and
4914 @option{-fdump-rtl-split5} enable dumping after five rounds of
4915 instruction splitting.
4916
4917 @item -fdump-rtl-sms
4918 @opindex fdump-rtl-sms
4919 Dump after modulo scheduling.  This pass is only run on some
4920 architectures.
4921
4922 @item -fdump-rtl-stack
4923 @opindex fdump-rtl-stack
4924 Dump after conversion from GCC's "flat register file" registers to the
4925 x87's stack-like registers.  This pass is only run on x86 variants.
4926
4927 @item -fdump-rtl-subreg1
4928 @itemx -fdump-rtl-subreg2
4929 @opindex fdump-rtl-subreg1
4930 @opindex fdump-rtl-subreg2
4931 @option{-fdump-rtl-subreg1} and @option{-fdump-rtl-subreg2} enable dumping after
4932 the two subreg expansion passes.
4933
4934 @item -fdump-rtl-unshare
4935 @opindex fdump-rtl-unshare
4936 Dump after all rtl has been unshared.
4937
4938 @item -fdump-rtl-vartrack
4939 @opindex fdump-rtl-vartrack
4940 Dump after variable tracking.
4941
4942 @item -fdump-rtl-vregs
4943 @opindex fdump-rtl-vregs
4944 Dump after converting virtual registers to hard registers.
4945
4946 @item -fdump-rtl-web
4947 @opindex fdump-rtl-web
4948 Dump after live range splitting.
4949
4950 @item -fdump-rtl-regclass
4951 @itemx -fdump-rtl-subregs_of_mode_init
4952 @itemx -fdump-rtl-subregs_of_mode_finish
4953 @itemx -fdump-rtl-dfinit
4954 @itemx -fdump-rtl-dfinish
4955 @opindex fdump-rtl-regclass
4956 @opindex fdump-rtl-subregs_of_mode_init
4957 @opindex fdump-rtl-subregs_of_mode_finish
4958 @opindex fdump-rtl-dfinit
4959 @opindex fdump-rtl-dfinish
4960 These dumps are defined but always produce empty files.
4961
4962 @item -fdump-rtl-all
4963 @opindex fdump-rtl-all
4964 Produce all the dumps listed above.
4965
4966 @item -dA
4967 @opindex dA
4968 Annotate the assembler output with miscellaneous debugging information.
4969
4970 @item -dD
4971 @opindex dD
4972 Dump all macro definitions, at the end of preprocessing, in addition to
4973 normal output.
4974
4975 @item -dH
4976 @opindex dH
4977 Produce a core dump whenever an error occurs.
4978
4979 @item -dm
4980 @opindex dm
4981 Print statistics on memory usage, at the end of the run, to
4982 standard error.
4983
4984 @item -dp
4985 @opindex dp
4986 Annotate the assembler output with a comment indicating which
4987 pattern and alternative was used.  The length of each instruction is
4988 also printed.
4989
4990 @item -dP
4991 @opindex dP
4992 Dump the RTL in the assembler output as a comment before each instruction.
4993 Also turns on @option{-dp} annotation.
4994
4995 @item -dv
4996 @opindex dv
4997 For each of the other indicated dump files (@option{-fdump-rtl-@var{pass}}),
4998 dump a representation of the control flow graph suitable for viewing with VCG
4999 to @file{@var{file}.@var{pass}.vcg}.
5000
5001 @item -dx
5002 @opindex dx
5003 Just generate RTL for a function instead of compiling it.  Usually used
5004 with @option{-fdump-rtl-expand}.
5005
5006 @item -dy
5007 @opindex dy
5008 Dump debugging information during parsing, to standard error.
5009 @end table
5010
5011 @item -fdump-noaddr
5012 @opindex fdump-noaddr
5013 When doing debugging dumps, suppress address output.  This makes it more
5014 feasible to use diff on debugging dumps for compiler invocations with
5015 different compiler binaries and/or different
5016 text / bss / data / heap / stack / dso start locations.
5017
5018 @item -fdump-unnumbered
5019 @opindex fdump-unnumbered
5020 When doing debugging dumps, suppress instruction numbers and address output.
5021 This makes it more feasible to use diff on debugging dumps for compiler
5022 invocations with different options, in particular with and without
5023 @option{-g}.
5024
5025 @item -fdump-unnumbered-links
5026 @opindex fdump-unnumbered-links
5027 When doing debugging dumps (see @option{-d} option above), suppress
5028 instruction numbers for the links to the previous and next instructions
5029 in a sequence.
5030
5031 @item -fdump-translation-unit @r{(C++ only)}
5032 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
5033 @opindex fdump-translation-unit
5034 Dump a representation of the tree structure for the entire translation
5035 unit to a file.  The file name is made by appending @file{.tu} to the
5036 source file name, and the file is created in the same directory as the
5037 output file.  If the @samp{-@var{options}} form is used, @var{options}
5038 controls the details of the dump as described for the
5039 @option{-fdump-tree} options.
5040
5041 @item -fdump-class-hierarchy @r{(C++ only)}
5042 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
5043 @opindex fdump-class-hierarchy
5044 Dump a representation of each class's hierarchy and virtual function
5045 table layout to a file.  The file name is made by appending
5046 @file{.class} to the source file name, and the file is created in the
5047 same directory as the output file.  If the @samp{-@var{options}} form
5048 is used, @var{options} controls the details of the dump as described
5049 for the @option{-fdump-tree} options.
5050
5051 @item -fdump-ipa-@var{switch}
5052 @opindex fdump-ipa
5053 Control the dumping at various stages of inter-procedural analysis
5054 language tree to a file.  The file name is generated by appending a
5055 switch specific suffix to the source file name, and the file is created
5056 in the same directory as the output file.  The following dumps are
5057 possible:
5058
5059 @table @samp
5060 @item all
5061 Enables all inter-procedural analysis dumps.
5062
5063 @item cgraph
5064 Dumps information about call-graph optimization, unused function removal,
5065 and inlining decisions.
5066
5067 @item inline
5068 Dump after function inlining.
5069
5070 @end table
5071
5072 @item -fdump-statistics-@var{option}
5073 @opindex fdump-statistics
5074 Enable and control dumping of pass statistics in a separate file.  The
5075 file name is generated by appending a suffix ending in
5076 @samp{.statistics} to the source file name, and the file is created in
5077 the same directory as the output file.  If the @samp{-@var{option}}
5078 form is used, @samp{-stats} will cause counters to be summed over the
5079 whole compilation unit while @samp{-details} will dump every event as
5080 the passes generate them.  The default with no option is to sum
5081 counters for each function compiled.
5082
5083 @item -fdump-tree-@var{switch}
5084 @itemx -fdump-tree-@var{switch}-@var{options}
5085 @opindex fdump-tree
5086 Control the dumping at various stages of processing the intermediate
5087 language tree to a file.  The file name is generated by appending a
5088 switch specific suffix to the source file name, and the file is
5089 created in the same directory as the output file.  If the
5090 @samp{-@var{options}} form is used, @var{options} is a list of
5091 @samp{-} separated options that control the details of the dump.  Not
5092 all options are applicable to all dumps, those which are not
5093 meaningful will be ignored.  The following options are available
5094
5095 @table @samp
5096 @item address
5097 Print the address of each node.  Usually this is not meaningful as it
5098 changes according to the environment and source file.  Its primary use
5099 is for tying up a dump file with a debug environment.
5100 @item asmname
5101 If @code{DECL_ASSEMBLER_NAME} has been set for a given decl, use that
5102 in the dump instead of @code{DECL_NAME}.  Its primary use is ease of
5103 use working backward from mangled names in the assembly file.
5104 @item slim
5105 Inhibit dumping of members of a scope or body of a function merely
5106 because that scope has been reached.  Only dump such items when they
5107 are directly reachable by some other path.  When dumping pretty-printed
5108 trees, this option inhibits dumping the bodies of control structures.
5109 @item raw
5110 Print a raw representation of the tree.  By default, trees are
5111 pretty-printed into a C-like representation.
5112 @item details
5113 Enable more detailed dumps (not honored by every dump option).
5114 @item stats
5115 Enable dumping various statistics about the pass (not honored by every dump
5116 option).
5117 @item blocks
5118 Enable showing basic block boundaries (disabled in raw dumps).
5119 @item vops
5120 Enable showing virtual operands for every statement.
5121 @item lineno
5122 Enable showing line numbers for statements.
5123 @item uid
5124 Enable showing the unique ID (@code{DECL_UID}) for each variable.
5125 @item verbose
5126 Enable showing the tree dump for each statement.
5127 @item all
5128 Turn on all options, except @option{raw}, @option{slim}, @option{verbose}
5129 and @option{lineno}.
5130 @end table
5131
5132 The following tree dumps are possible:
5133 @table @samp
5134
5135 @item original
5136 @opindex fdump-tree-original
5137 Dump before any tree based optimization, to @file{@var{file}.original}.
5138
5139 @item optimized
5140 @opindex fdump-tree-optimized
5141 Dump after all tree based optimization, to @file{@var{file}.optimized}.
5142
5143 @item gimple
5144 @opindex fdump-tree-gimple
5145 Dump each function before and after the gimplification pass to a file.  The
5146 file name is made by appending @file{.gimple} to the source file name.
5147
5148 @item cfg
5149 @opindex fdump-tree-cfg
5150 Dump the control flow graph of each function to a file.  The file name is
5151 made by appending @file{.cfg} to the source file name.
5152
5153 @item vcg
5154 @opindex fdump-tree-vcg
5155 Dump the control flow graph of each function to a file in VCG format.  The
5156 file name is made by appending @file{.vcg} to the source file name.  Note
5157 that if the file contains more than one function, the generated file cannot
5158 be used directly by VCG@.  You will need to cut and paste each function's
5159 graph into its own separate file first.
5160
5161 @item ch
5162 @opindex fdump-tree-ch
5163 Dump each function after copying loop headers.  The file name is made by
5164 appending @file{.ch} to the source file name.
5165
5166 @item ssa
5167 @opindex fdump-tree-ssa
5168 Dump SSA related information to a file.  The file name is made by appending
5169 @file{.ssa} to the source file name.
5170
5171 @item alias
5172 @opindex fdump-tree-alias
5173 Dump aliasing information for each function.  The file name is made by
5174 appending @file{.alias} to the source file name.
5175
5176 @item ccp
5177 @opindex fdump-tree-ccp
5178 Dump each function after CCP@.  The file name is made by appending
5179 @file{.ccp} to the source file name.
5180
5181 @item storeccp
5182 @opindex fdump-tree-storeccp
5183 Dump each function after STORE-CCP@.  The file name is made by appending
5184 @file{.storeccp} to the source file name.
5185
5186 @item pre
5187 @opindex fdump-tree-pre
5188 Dump trees after partial redundancy elimination.  The file name is made
5189 by appending @file{.pre} to the source file name.
5190
5191 @item fre
5192 @opindex fdump-tree-fre
5193 Dump trees after full redundancy elimination.  The file name is made
5194 by appending @file{.fre} to the source file name.
5195
5196 @item copyprop
5197 @opindex fdump-tree-copyprop
5198 Dump trees after copy propagation.  The file name is made
5199 by appending @file{.copyprop} to the source file name.
5200
5201 @item store_copyprop
5202 @opindex fdump-tree-store_copyprop
5203 Dump trees after store copy-propagation.  The file name is made
5204 by appending @file{.store_copyprop} to the source file name.
5205
5206 @item dce
5207 @opindex fdump-tree-dce
5208 Dump each function after dead code elimination.  The file name is made by
5209 appending @file{.dce} to the source file name.
5210
5211 @item mudflap
5212 @opindex fdump-tree-mudflap
5213 Dump each function after adding mudflap instrumentation.  The file name is
5214 made by appending @file{.mudflap} to the source file name.
5215
5216 @item sra
5217 @opindex fdump-tree-sra
5218 Dump each function after performing scalar replacement of aggregates.  The
5219 file name is made by appending @file{.sra} to the source file name.
5220
5221 @item sink
5222 @opindex fdump-tree-sink
5223 Dump each function after performing code sinking.  The file name is made
5224 by appending @file{.sink} to the source file name.
5225
5226 @item dom
5227 @opindex fdump-tree-dom
5228 Dump each function after applying dominator tree optimizations.  The file
5229 name is made by appending @file{.dom} to the source file name.
5230
5231 @item dse
5232 @opindex fdump-tree-dse
5233 Dump each function after applying dead store elimination.  The file
5234 name is made by appending @file{.dse} to the source file name.
5235
5236 @item phiopt
5237 @opindex fdump-tree-phiopt
5238 Dump each function after optimizing PHI nodes into straightline code.  The file
5239 name is made by appending @file{.phiopt} to the source file name.
5240
5241 @item forwprop
5242 @opindex fdump-tree-forwprop
5243 Dump each function after forward propagating single use variables.  The file
5244 name is made by appending @file{.forwprop} to the source file name.
5245
5246 @item copyrename
5247 @opindex fdump-tree-copyrename
5248 Dump each function after applying the copy rename optimization.  The file
5249 name is made by appending @file{.copyrename} to the source file name.
5250
5251 @item nrv
5252 @opindex fdump-tree-nrv
5253 Dump each function after applying the named return value optimization on
5254 generic trees.  The file name is made by appending @file{.nrv} to the source
5255 file name.
5256
5257 @item vect
5258 @opindex fdump-tree-vect
5259 Dump each function after applying vectorization of loops.  The file name is
5260 made by appending @file{.vect} to the source file name.
5261
5262 @item vrp
5263 @opindex fdump-tree-vrp
5264 Dump each function after Value Range Propagation (VRP).  The file name
5265 is made by appending @file{.vrp} to the source file name.
5266
5267 @item all
5268 @opindex fdump-tree-all
5269 Enable all the available tree dumps with the flags provided in this option.
5270 @end table
5271
5272 @item -ftree-vectorizer-verbose=@var{n}
5273 @opindex ftree-vectorizer-verbose
5274 This option controls the amount of debugging output the vectorizer prints.
5275 This information is written to standard error, unless
5276 @option{-fdump-tree-all} or @option{-fdump-tree-vect} is specified,
5277 in which case it is output to the usual dump listing file, @file{.vect}.
5278 For @var{n}=0 no diagnostic information is reported.
5279 If @var{n}=1 the vectorizer reports each loop that got vectorized,
5280 and the total number of loops that got vectorized.
5281 If @var{n}=2 the vectorizer also reports non-vectorized loops that passed
5282 the first analysis phase (vect_analyze_loop_form) - i.e.@: countable,
5283 inner-most, single-bb, single-entry/exit loops.  This is the same verbosity
5284 level that @option{-fdump-tree-vect-stats} uses.
5285 Higher verbosity levels mean either more information dumped for each
5286 reported loop, or same amount of information reported for more loops:
5287 If @var{n}=3, alignment related information is added to the reports.
5288 If @var{n}=4, data-references related information (e.g.@: memory dependences,
5289 memory access-patterns) is added to the reports.
5290 If @var{n}=5, the vectorizer reports also non-vectorized inner-most loops
5291 that did not pass the first analysis phase (i.e., may not be countable, or
5292 may have complicated control-flow).
5293 If @var{n}=6, the vectorizer reports also non-vectorized nested loops.
5294 For @var{n}=7, all the information the vectorizer generates during its
5295 analysis and transformation is reported.  This is the same verbosity level
5296 that @option{-fdump-tree-vect-details} uses.
5297
5298 @item -frandom-seed=@var{string}
5299 @opindex frandom-seed
5300 This option provides a seed that GCC uses when it would otherwise use
5301 random numbers.  It is used to generate certain symbol names
5302 that have to be different in every compiled file.  It is also used to
5303 place unique stamps in coverage data files and the object files that
5304 produce them.  You can use the @option{-frandom-seed} option to produce
5305 reproducibly identical object files.
5306
5307 The @var{string} should be different for every file you compile.
5308
5309 @item -fsched-verbose=@var{n}
5310 @opindex fsched-verbose
5311 On targets that use instruction scheduling, this option controls the
5312 amount of debugging output the scheduler prints.  This information is
5313 written to standard error, unless @option{-fdump-rtl-sched1} or
5314 @option{-fdump-rtl-sched2} is specified, in which case it is output
5315 to the usual dump listing file, @file{.sched} or @file{.sched2}
5316 respectively.  However for @var{n} greater than nine, the output is
5317 always printed to standard error.
5318
5319 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
5320 same information as @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2}.
5321 For @var{n} greater than one, it also output basic block probabilities,
5322 detailed ready list information and unit/insn info.  For @var{n} greater
5323 than two, it includes RTL at abort point, control-flow and regions info.
5324 And for @var{n} over four, @option{-fsched-verbose} also includes
5325 dependence info.
5326
5327 @item -save-temps
5328 @itemx -save-temps=cwd
5329 @opindex save-temps
5330 Store the usual ``temporary'' intermediate files permanently; place them
5331 in the current directory and name them based on the source file.  Thus,
5332 compiling @file{foo.c} with @samp{-c -save-temps} would produce files
5333 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
5334 preprocessed @file{foo.i} output file even though the compiler now
5335 normally uses an integrated preprocessor.
5336
5337 When used in combination with the @option{-x} command line option,
5338 @option{-save-temps} is sensible enough to avoid over writing an
5339 input source file with the same extension as an intermediate file.
5340 The corresponding intermediate file may be obtained by renaming the
5341 source file before using @option{-save-temps}.
5342
5343 If you invoke GCC in parallel, compiling several different source
5344 files that share a common base name in different subdirectories or the
5345 same source file compiled for multiple output destinations, it is
5346 likely that the different parallel compilers will interfere with each
5347 other, and overwrite the temporary files.  For instance:
5348
5349 @smallexample
5350 gcc -save-temps -o outdir1/foo.o indir1/foo.c&
5351 gcc -save-temps -o outdir2/foo.o indir2/foo.c&
5352 @end smallexample
5353
5354 may result in @file{foo.i} and @file{foo.o} being written to
5355 simultaneously by both compilers.
5356
5357 @item -save-temps=obj
5358 @opindex save-temps=obj
5359 Store the usual ``temporary'' intermediate files permanently.  If the
5360 @option{-o} option is used, the temporary files are based on the
5361 object file.  If the @option{-o} option is not used, the
5362 @option{-save-temps=obj} switch behaves like @option{-save-temps}.
5363
5364 For example:
5365
5366 @smallexample
5367 gcc -save-temps=obj -c foo.c
5368 gcc -save-temps=obj -c bar.c -o dir/xbar.o
5369 gcc -save-temps=obj foobar.c -o dir2/yfoobar
5370 @end smallexample
5371
5372 would create @file{foo.i}, @file{foo.s}, @file{dir/xbar.i},
5373 @file{dir/xbar.s}, @file{dir2/yfoobar.i}, @file{dir2/yfoobar.s}, and
5374 @file{dir2/yfoobar.o}.
5375
5376 @item -time@r{[}=@var{file}@r{]}
5377 @opindex time
5378 Report the CPU time taken by each subprocess in the compilation
5379 sequence.  For C source files, this is the compiler proper and assembler
5380 (plus the linker if linking is done).
5381
5382 Without the specification of an output file, the output looks like this:
5383
5384 @smallexample
5385 # cc1 0.12 0.01
5386 # as 0.00 0.01
5387 @end smallexample
5388
5389 The first number on each line is the ``user time'', that is time spent
5390 executing the program itself.  The second number is ``system time'',
5391 time spent executing operating system routines on behalf of the program.
5392 Both numbers are in seconds.
5393
5394 With the specification of an output file, the output is appended to the
5395 named file, and it looks like this:
5396
5397 @smallexample
5398 0.12 0.01 cc1 @var{options}
5399 0.00 0.01 as @var{options}
5400 @end smallexample
5401
5402 The ``user time'' and the ``system time'' are moved before the program
5403 name, and the options passed to the program are displayed, so that one
5404 can later tell what file was being compiled, and with which options.
5405
5406 @item -fvar-tracking
5407 @opindex fvar-tracking
5408 Run variable tracking pass.  It computes where variables are stored at each
5409 position in code.  Better debugging information is then generated
5410 (if the debugging information format supports this information).
5411
5412 It is enabled by default when compiling with optimization (@option{-Os},
5413 @option{-O}, @option{-O2}, @dots{}), debugging information (@option{-g}) and
5414 the debug info format supports it.
5415
5416 @item -print-file-name=@var{library}
5417 @opindex print-file-name
5418 Print the full absolute name of the library file @var{library} that
5419 would be used when linking---and don't do anything else.  With this
5420 option, GCC does not compile or link anything; it just prints the
5421 file name.
5422
5423 @item -print-multi-directory
5424 @opindex print-multi-directory
5425 Print the directory name corresponding to the multilib selected by any
5426 other switches present in the command line.  This directory is supposed
5427 to exist in @env{GCC_EXEC_PREFIX}.
5428
5429 @item -print-multi-lib
5430 @opindex print-multi-lib
5431 Print the mapping from multilib directory names to compiler switches
5432 that enable them.  The directory name is separated from the switches by
5433 @samp{;}, and each switch starts with an @samp{@@} instead of the
5434 @samp{-}, without spaces between multiple switches.  This is supposed to
5435 ease shell-processing.
5436
5437 @item -print-prog-name=@var{program}
5438 @opindex print-prog-name
5439 Like @option{-print-file-name}, but searches for a program such as @samp{cpp}.
5440
5441 @item -print-libgcc-file-name
5442 @opindex print-libgcc-file-name
5443 Same as @option{-print-file-name=libgcc.a}.
5444
5445 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
5446 but you do want to link with @file{libgcc.a}.  You can do
5447
5448 @smallexample
5449 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
5450 @end smallexample
5451
5452 @item -print-search-dirs
5453 @opindex print-search-dirs
5454 Print the name of the configured installation directory and a list of
5455 program and library directories @command{gcc} will search---and don't do anything else.
5456
5457 This is useful when @command{gcc} prints the error message
5458 @samp{installation problem, cannot exec cpp0: No such file or directory}.
5459 To resolve this you either need to put @file{cpp0} and the other compiler
5460 components where @command{gcc} expects to find them, or you can set the environment
5461 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
5462 Don't forget the trailing @samp{/}.
5463 @xref{Environment Variables}.
5464
5465 @item -print-sysroot
5466 @opindex print-sysroot
5467 Print the target sysroot directory that will be used during
5468 compilation.  This is the target sysroot specified either at configure
5469 time or using the @option{--sysroot} option, possibly with an extra
5470 suffix that depends on compilation options.  If no target sysroot is
5471 specified, the option prints nothing.
5472
5473 @item -print-sysroot-headers-suffix
5474 @opindex print-sysroot-headers-suffix
5475 Print the suffix added to the target sysroot when searching for
5476 headers, or give an error if the compiler is not configured with such
5477 a suffix---and don't do anything else.
5478
5479 @item -dumpmachine
5480 @opindex dumpmachine
5481 Print the compiler's target machine (for example,
5482 @samp{i686-pc-linux-gnu})---and don't do anything else.
5483
5484 @item -dumpversion
5485 @opindex dumpversion
5486 Print the compiler version (for example, @samp{3.0})---and don't do
5487 anything else.
5488
5489 @item -dumpspecs
5490 @opindex dumpspecs
5491 Print the compiler's built-in specs---and don't do anything else.  (This
5492 is used when GCC itself is being built.)  @xref{Spec Files}.
5493
5494 @item -feliminate-unused-debug-types
5495 @opindex feliminate-unused-debug-types
5496 Normally, when producing DWARF2 output, GCC will emit debugging
5497 information for all types declared in a compilation
5498 unit, regardless of whether or not they are actually used
5499 in that compilation unit.  Sometimes this is useful, such as
5500 if, in the debugger, you want to cast a value to a type that is
5501 not actually used in your program (but is declared).  More often,
5502 however, this results in a significant amount of wasted space.
5503 With this option, GCC will avoid producing debug symbol output
5504 for types that are nowhere used in the source file being compiled.
5505 @end table
5506
5507 @node Optimize Options
5508 @section Options That Control Optimization
5509 @cindex optimize options
5510 @cindex options, optimization
5511
5512 These options control various sorts of optimizations.
5513
5514 Without any optimization option, the compiler's goal is to reduce the
5515 cost of compilation and to make debugging produce the expected
5516 results.  Statements are independent: if you stop the program with a
5517 breakpoint between statements, you can then assign a new value to any
5518 variable or change the program counter to any other statement in the
5519 function and get exactly the results you would expect from the source
5520 code.
5521
5522 Turning on optimization flags makes the compiler attempt to improve
5523 the performance and/or code size at the expense of compilation time
5524 and possibly the ability to debug the program.
5525
5526 The compiler performs optimization based on the knowledge it has of the
5527 program.  Compiling multiple files at once to a single output file mode allows
5528 the compiler to use information gained from all of the files when compiling
5529 each of them.
5530
5531 Not all optimizations are controlled directly by a flag.  Only
5532 optimizations that have a flag are listed in this section.
5533
5534 Depending on the target and how GCC was configured, a slightly different 
5535 set of optimizations may be enabled at each @option{-O} level than 
5536 those listed here.  You can invoke GCC with @samp{-Q --help=optimizers} 
5537 to find out the exact set of optimizations that are enabled at each level.
5538 @xref{Overall Options}, for examples.
5539
5540 @table @gcctabopt
5541 @item -O
5542 @itemx -O1
5543 @opindex O
5544 @opindex O1
5545 Optimize.  Optimizing compilation takes somewhat more time, and a lot
5546 more memory for a large function.
5547
5548 With @option{-O}, the compiler tries to reduce code size and execution
5549 time, without performing any optimizations that take a great deal of
5550 compilation time.
5551
5552 @option{-O} turns on the following optimization flags:
5553 @gccoptlist{
5554 -fauto-inc-dec @gol
5555 -fcprop-registers @gol
5556 -fdce @gol
5557 -fdefer-pop @gol
5558 -fdelayed-branch @gol
5559 -fdse @gol
5560 -fguess-branch-probability @gol
5561 -fif-conversion2 @gol
5562 -fif-conversion @gol
5563 -finline-small-functions @gol
5564 -fipa-pure-const @gol
5565 -fipa-reference @gol
5566 -fmerge-constants
5567 -fsplit-wide-types @gol
5568 -ftree-builtin-call-dce @gol
5569 -ftree-ccp @gol
5570 -ftree-ch @gol
5571 -ftree-copyrename @gol
5572 -ftree-dce @gol
5573 -ftree-dominator-opts @gol
5574 -ftree-dse @gol
5575 -ftree-forwprop @gol
5576 -ftree-fre @gol
5577 -ftree-phiprop @gol
5578 -ftree-sra @gol
5579 -ftree-pta @gol
5580 -ftree-ter @gol
5581 -funit-at-a-time}
5582
5583 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
5584 where doing so does not interfere with debugging.
5585
5586 @item -O2
5587 @opindex O2
5588 Optimize even more.  GCC performs nearly all supported optimizations
5589 that do not involve a space-speed tradeoff.
5590 As compared to @option{-O}, this option increases both compilation time
5591 and the performance of the generated code.
5592
5593 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
5594 also turns on the following optimization flags:
5595 @gccoptlist{-fthread-jumps @gol
5596 -falign-functions  -falign-jumps @gol
5597 -falign-loops  -falign-labels @gol
5598 -fcaller-saves @gol
5599 -fcrossjumping @gol
5600 -fcse-follow-jumps  -fcse-skip-blocks @gol
5601 -fdelete-null-pointer-checks @gol
5602 -fexpensive-optimizations @gol
5603 -fgcse  -fgcse-lm  @gol
5604 -findirect-inlining @gol
5605 -foptimize-sibling-calls @gol
5606 -fpeephole2 @gol
5607 -fregmove @gol
5608 -freorder-blocks  -freorder-functions @gol
5609 -frerun-cse-after-loop  @gol
5610 -fsched-interblock  -fsched-spec @gol
5611 -fschedule-insns  -fschedule-insns2 @gol
5612 -fstrict-aliasing -fstrict-overflow @gol
5613 -ftree-switch-conversion @gol
5614 -ftree-pre @gol
5615 -ftree-vrp}
5616
5617 Please note the warning under @option{-fgcse} about
5618 invoking @option{-O2} on programs that use computed gotos.
5619
5620 @item -O3
5621 @opindex O3
5622 Optimize yet more.  @option{-O3} turns on all optimizations specified
5623 by @option{-O2} and also turns on the @option{-finline-functions},
5624 @option{-funswitch-loops}, @option{-fpredictive-commoning},
5625 @option{-fgcse-after-reload} and @option{-ftree-vectorize} options.
5626
5627 @item -O0
5628 @opindex O0
5629 Reduce compilation time and make debugging produce the expected
5630 results.  This is the default.
5631
5632 @item -Os
5633 @opindex Os
5634 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
5635 do not typically increase code size.  It also performs further
5636 optimizations designed to reduce code size.
5637
5638 @option{-Os} disables the following optimization flags:
5639 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
5640 -falign-labels  -freorder-blocks  -freorder-blocks-and-partition @gol
5641 -fprefetch-loop-arrays  -ftree-vect-loop-version}
5642
5643 If you use multiple @option{-O} options, with or without level numbers,
5644 the last such option is the one that is effective.
5645 @end table
5646
5647 Options of the form @option{-f@var{flag}} specify machine-independent
5648 flags.  Most flags have both positive and negative forms; the negative
5649 form of @option{-ffoo} would be @option{-fno-foo}.  In the table
5650 below, only one of the forms is listed---the one you typically will
5651 use.  You can figure out the other form by either removing @samp{no-}
5652 or adding it.
5653
5654 The following options control specific optimizations.  They are either
5655 activated by @option{-O} options or are related to ones that are.  You
5656 can use the following flags in the rare cases when ``fine-tuning'' of
5657 optimizations to be performed is desired.
5658
5659 @table @gcctabopt
5660 @item -fno-default-inline
5661 @opindex fno-default-inline
5662 Do not make member functions inline by default merely because they are
5663 defined inside the class scope (C++ only).  Otherwise, when you specify
5664 @w{@option{-O}}, member functions defined inside class scope are compiled
5665 inline by default; i.e., you don't need to add @samp{inline} in front of
5666 the member function name.
5667
5668 @item -fno-defer-pop
5669 @opindex fno-defer-pop
5670 Always pop the arguments to each function call as soon as that function
5671 returns.  For machines which must pop arguments after a function call,
5672 the compiler normally lets arguments accumulate on the stack for several
5673 function calls and pops them all at once.
5674
5675 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5676
5677 @item -fforward-propagate
5678 @opindex fforward-propagate
5679 Perform a forward propagation pass on RTL@.  The pass tries to combine two
5680 instructions and checks if the result can be simplified.  If loop unrolling
5681 is active, two passes are performed and the second is scheduled after
5682 loop unrolling.
5683
5684 This option is enabled by default at optimization levels @option{-O},
5685 @option{-O2}, @option{-O3}, @option{-Os}.
5686
5687 @item -fomit-frame-pointer
5688 @opindex fomit-frame-pointer
5689 Don't keep the frame pointer in a register for functions that
5690 don't need one.  This avoids the instructions to save, set up and
5691 restore frame pointers; it also makes an extra register available
5692 in many functions.  @strong{It also makes debugging impossible on
5693 some machines.}
5694
5695 On some machines, such as the VAX, this flag has no effect, because
5696 the standard calling sequence automatically handles the frame pointer
5697 and nothing is saved by pretending it doesn't exist.  The
5698 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
5699 whether a target machine supports this flag.  @xref{Registers,,Register
5700 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
5701
5702 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5703
5704 @item -foptimize-sibling-calls
5705 @opindex foptimize-sibling-calls
5706 Optimize sibling and tail recursive calls.
5707
5708 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5709
5710 @item -fno-inline
5711 @opindex fno-inline
5712 Don't pay attention to the @code{inline} keyword.  Normally this option
5713 is used to keep the compiler from expanding any functions inline.
5714 Note that if you are not optimizing, no functions can be expanded inline.
5715
5716 @item -finline-small-functions
5717 @opindex finline-small-functions
5718 Integrate functions into their callers when their body is smaller than expected
5719 function call code (so overall size of program gets smaller).  The compiler
5720 heuristically decides which functions are simple enough to be worth integrating
5721 in this way.
5722
5723 Enabled at level @option{-O2}.
5724
5725 @item -findirect-inlining
5726 @opindex findirect-inlining
5727 Inline also indirect calls that are discovered to be known at compile
5728 time thanks to previous inlining.  This option has any effect only
5729 when inlining itself is turned on by the @option{-finline-functions}
5730 or @option{-finline-small-functions} options.
5731
5732 Enabled at level @option{-O2}.
5733
5734 @item -finline-functions
5735 @opindex finline-functions
5736 Integrate all simple functions into their callers.  The compiler
5737 heuristically decides which functions are simple enough to be worth
5738 integrating in this way.
5739
5740 If all calls to a given function are integrated, and the function is
5741 declared @code{static}, then the function is normally not output as
5742 assembler code in its own right.
5743
5744 Enabled at level @option{-O3}.
5745
5746 @item -finline-functions-called-once
5747 @opindex finline-functions-called-once
5748 Consider all @code{static} functions called once for inlining into their
5749 caller even if they are not marked @code{inline}.  If a call to a given
5750 function is integrated, then the function is not output as assembler code
5751 in its own right.
5752
5753 Enabled at levels @option{-O1}, @option{-O2}, @option{-O3} and @option{-Os}.
5754
5755 @item -fearly-inlining
5756 @opindex fearly-inlining
5757 Inline functions marked by @code{always_inline} and functions whose body seems
5758 smaller than the function call overhead early before doing
5759 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
5760 makes profiling significantly cheaper and usually inlining faster on programs
5761 having large chains of nested wrapper functions.
5762
5763 Enabled by default.
5764
5765 @item -finline-limit=@var{n}
5766 @opindex finline-limit
5767 By default, GCC limits the size of functions that can be inlined.  This flag
5768 allows coarse control of this limit.  @var{n} is the size of functions that
5769 can be inlined in number of pseudo instructions.
5770
5771 Inlining is actually controlled by a number of parameters, which may be
5772 specified individually by using @option{--param @var{name}=@var{value}}.
5773 The @option{-finline-limit=@var{n}} option sets some of these parameters
5774 as follows:
5775
5776 @table @gcctabopt
5777 @item max-inline-insns-single
5778 is set to @var{n}/2.
5779 @item max-inline-insns-auto
5780 is set to @var{n}/2.
5781 @end table
5782
5783 See below for a documentation of the individual
5784 parameters controlling inlining and for the defaults of these parameters.
5785
5786 @emph{Note:} there may be no value to @option{-finline-limit} that results
5787 in default behavior.
5788
5789 @emph{Note:} pseudo instruction represents, in this particular context, an
5790 abstract measurement of function's size.  In no way does it represent a count
5791 of assembly instructions and as such its exact meaning might change from one
5792 release to an another.
5793
5794 @item -fkeep-inline-functions
5795 @opindex fkeep-inline-functions
5796 In C, emit @code{static} functions that are declared @code{inline}
5797 into the object file, even if the function has been inlined into all
5798 of its callers.  This switch does not affect functions using the
5799 @code{extern inline} extension in GNU C89@.  In C++, emit any and all
5800 inline functions into the object file.
5801
5802 @item -fkeep-static-consts
5803 @opindex fkeep-static-consts
5804 Emit variables declared @code{static const} when optimization isn't turned
5805 on, even if the variables aren't referenced.
5806
5807 GCC enables this option by default.  If you want to force the compiler to
5808 check if the variable was referenced, regardless of whether or not
5809 optimization is turned on, use the @option{-fno-keep-static-consts} option.
5810
5811 @item -fmerge-constants
5812 @opindex fmerge-constants
5813 Attempt to merge identical constants (string constants and floating point
5814 constants) across compilation units.
5815
5816 This option is the default for optimized compilation if the assembler and
5817 linker support it.  Use @option{-fno-merge-constants} to inhibit this
5818 behavior.
5819
5820 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5821
5822 @item -fmerge-all-constants
5823 @opindex fmerge-all-constants
5824 Attempt to merge identical constants and identical variables.
5825
5826 This option implies @option{-fmerge-constants}.  In addition to
5827 @option{-fmerge-constants} this considers e.g.@: even constant initialized
5828 arrays or initialized constant variables with integral or floating point
5829 types.  Languages like C or C++ require each variable, including multiple
5830 instances of the same variable in recursive calls, to have distinct locations,
5831 so using this option will result in non-conforming
5832 behavior.
5833
5834 @item -fmodulo-sched
5835 @opindex fmodulo-sched
5836 Perform swing modulo scheduling immediately before the first scheduling
5837 pass.  This pass looks at innermost loops and reorders their
5838 instructions by overlapping different iterations.
5839
5840 @item -fmodulo-sched-allow-regmoves
5841 @opindex fmodulo-sched-allow-regmoves
5842 Perform more aggressive SMS based modulo scheduling with register moves
5843 allowed.  By setting this flag certain anti-dependences edges will be
5844 deleted which will trigger the generation of reg-moves based on the
5845 life-range analysis.  This option is effective only with
5846 @option{-fmodulo-sched} enabled.
5847
5848 @item -fno-branch-count-reg
5849 @opindex fno-branch-count-reg
5850 Do not use ``decrement and branch'' instructions on a count register,
5851 but instead generate a sequence of instructions that decrement a
5852 register, compare it against zero, then branch based upon the result.
5853 This option is only meaningful on architectures that support such
5854 instructions, which include x86, PowerPC, IA-64 and S/390.
5855
5856 The default is @option{-fbranch-count-reg}.
5857
5858 @item -fno-function-cse
5859 @opindex fno-function-cse
5860 Do not put function addresses in registers; make each instruction that
5861 calls a constant function contain the function's address explicitly.
5862
5863 This option results in less efficient code, but some strange hacks
5864 that alter the assembler output may be confused by the optimizations
5865 performed when this option is not used.
5866
5867 The default is @option{-ffunction-cse}
5868
5869 @item -fno-zero-initialized-in-bss
5870 @opindex fno-zero-initialized-in-bss
5871 If the target supports a BSS section, GCC by default puts variables that
5872 are initialized to zero into BSS@.  This can save space in the resulting
5873 code.
5874
5875 This option turns off this behavior because some programs explicitly
5876 rely on variables going to the data section.  E.g., so that the
5877 resulting executable can find the beginning of that section and/or make
5878 assumptions based on that.
5879
5880 The default is @option{-fzero-initialized-in-bss}.
5881
5882 @item -fmudflap -fmudflapth -fmudflapir
5883 @opindex fmudflap
5884 @opindex fmudflapth
5885 @opindex fmudflapir
5886 @cindex bounds checking
5887 @cindex mudflap
5888 For front-ends that support it (C and C++), instrument all risky
5889 pointer/array dereferencing operations, some standard library
5890 string/heap functions, and some other associated constructs with
5891 range/validity tests.  Modules so instrumented should be immune to
5892 buffer overflows, invalid heap use, and some other classes of C/C++
5893 programming errors.  The instrumentation relies on a separate runtime
5894 library (@file{libmudflap}), which will be linked into a program if
5895 @option{-fmudflap} is given at link time.  Run-time behavior of the
5896 instrumented program is controlled by the @env{MUDFLAP_OPTIONS}
5897 environment variable.  See @code{env MUDFLAP_OPTIONS=-help a.out}
5898 for its options.
5899
5900 Use @option{-fmudflapth} instead of @option{-fmudflap} to compile and to
5901 link if your program is multi-threaded.  Use @option{-fmudflapir}, in
5902 addition to @option{-fmudflap} or @option{-fmudflapth}, if
5903 instrumentation should ignore pointer reads.  This produces less
5904 instrumentation (and therefore faster execution) and still provides
5905 some protection against outright memory corrupting writes, but allows
5906 erroneously read data to propagate within a program.
5907
5908 @item -fthread-jumps
5909 @opindex fthread-jumps
5910 Perform optimizations where we check to see if a jump branches to a
5911 location where another comparison subsumed by the first is found.  If
5912 so, the first branch is redirected to either the destination of the
5913 second branch or a point immediately following it, depending on whether
5914 the condition is known to be true or false.
5915
5916 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5917
5918 @item -fsplit-wide-types
5919 @opindex fsplit-wide-types
5920 When using a type that occupies multiple registers, such as @code{long
5921 long} on a 32-bit system, split the registers apart and allocate them
5922 independently.  This normally generates better code for those types,
5923 but may make debugging more difficult.
5924
5925 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
5926 @option{-Os}.
5927
5928 @item -fcse-follow-jumps
5929 @opindex fcse-follow-jumps
5930 In common subexpression elimination (CSE), scan through jump instructions
5931 when the target of the jump is not reached by any other path.  For
5932 example, when CSE encounters an @code{if} statement with an
5933 @code{else} clause, CSE will follow the jump when the condition
5934 tested is false.
5935
5936 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5937
5938 @item -fcse-skip-blocks
5939 @opindex fcse-skip-blocks
5940 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
5941 follow jumps which conditionally skip over blocks.  When CSE
5942 encounters a simple @code{if} statement with no else clause,
5943 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
5944 body of the @code{if}.
5945
5946 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5947
5948 @item -frerun-cse-after-loop
5949 @opindex frerun-cse-after-loop
5950 Re-run common subexpression elimination after loop optimizations has been
5951 performed.
5952
5953 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5954
5955 @item -fgcse
5956 @opindex fgcse
5957 Perform a global common subexpression elimination pass.
5958 This pass also performs global constant and copy propagation.
5959
5960 @emph{Note:} When compiling a program using computed gotos, a GCC
5961 extension, you may get better runtime performance if you disable
5962 the global common subexpression elimination pass by adding
5963 @option{-fno-gcse} to the command line.
5964
5965 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5966
5967 @item -fgcse-lm
5968 @opindex fgcse-lm
5969 When @option{-fgcse-lm} is enabled, global common subexpression elimination will
5970 attempt to move loads which are only killed by stores into themselves.  This
5971 allows a loop containing a load/store sequence to be changed to a load outside
5972 the loop, and a copy/store within the loop.
5973
5974 Enabled by default when gcse is enabled.
5975
5976 @item -fgcse-sm
5977 @opindex fgcse-sm
5978 When @option{-fgcse-sm} is enabled, a store motion pass is run after
5979 global common subexpression elimination.  This pass will attempt to move
5980 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
5981 loops containing a load/store sequence can be changed to a load before
5982 the loop and a store after the loop.
5983
5984 Not enabled at any optimization level.
5985
5986 @item -fgcse-las
5987 @opindex fgcse-las
5988 When @option{-fgcse-las} is enabled, the global common subexpression
5989 elimination pass eliminates redundant loads that come after stores to the
5990 same memory location (both partial and full redundancies).
5991
5992 Not enabled at any optimization level.
5993
5994 @item -fgcse-after-reload
5995 @opindex fgcse-after-reload
5996 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
5997 pass is performed after reload.  The purpose of this pass is to cleanup
5998 redundant spilling.
5999
6000 @item -funsafe-loop-optimizations
6001 @opindex funsafe-loop-optimizations
6002 If given, the loop optimizer will assume that loop indices do not
6003 overflow, and that the loops with nontrivial exit condition are not
6004 infinite.  This enables a wider range of loop optimizations even if
6005 the loop optimizer itself cannot prove that these assumptions are valid.
6006 Using @option{-Wunsafe-loop-optimizations}, the compiler will warn you
6007 if it finds this kind of loop.
6008
6009 @item -fcrossjumping
6010 @opindex fcrossjumping
6011 Perform cross-jumping transformation.  This transformation unifies equivalent code and save code size.  The
6012 resulting code may or may not perform better than without cross-jumping.
6013
6014 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6015
6016 @item -fauto-inc-dec
6017 @opindex fauto-inc-dec
6018 Combine increments or decrements of addresses with memory accesses.
6019 This pass is always skipped on architectures that do not have
6020 instructions to support this.  Enabled by default at @option{-O} and
6021 higher on architectures that support this.
6022
6023 @item -fdce
6024 @opindex fdce
6025 Perform dead code elimination (DCE) on RTL@.
6026 Enabled by default at @option{-O} and higher.
6027
6028 @item -fdse
6029 @opindex fdse
6030 Perform dead store elimination (DSE) on RTL@.
6031 Enabled by default at @option{-O} and higher.
6032
6033 @item -fif-conversion
6034 @opindex fif-conversion
6035 Attempt to transform conditional jumps into branch-less equivalents.  This
6036 include use of conditional moves, min, max, set flags and abs instructions, and
6037 some tricks doable by standard arithmetics.  The use of conditional execution
6038 on chips where it is available is controlled by @code{if-conversion2}.
6039
6040 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6041
6042 @item -fif-conversion2
6043 @opindex fif-conversion2
6044 Use conditional execution (where available) to transform conditional jumps into
6045 branch-less equivalents.
6046
6047 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6048
6049 @item -fdelete-null-pointer-checks
6050 @opindex fdelete-null-pointer-checks
6051 Assume that programs cannot safely dereference null pointers, and that
6052 no code or data element resides there.  This enables simple constant
6053 folding optimizations at all optimization levels.  In addition, other
6054 optimization passes in GCC use this flag to control global dataflow
6055 analyses that eliminate useless checks for null pointers; these assume
6056 that if a pointer is checked after it has already been dereferenced,
6057 it cannot be null.
6058
6059 Note however that in some environments this assumption is not true.
6060 Use @option{-fno-delete-null-pointer-checks} to disable this optimization
6061 for programs which depend on that behavior.
6062
6063 Some targets, especially embedded ones, disable this option at all levels.
6064 Otherwise it is enabled at all levels: @option{-O0}, @option{-O1},
6065 @option{-O2}, @option{-O3}, @option{-Os}.  Passes that use the information
6066 are enabled independently at different optimization levels.
6067
6068 @item -fexpensive-optimizations
6069 @opindex fexpensive-optimizations
6070 Perform a number of minor optimizations that are relatively expensive.
6071
6072 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6073
6074 @item -foptimize-register-move
6075 @itemx -fregmove
6076 @opindex foptimize-register-move
6077 @opindex fregmove
6078 Attempt to reassign register numbers in move instructions and as
6079 operands of other simple instructions in order to maximize the amount of
6080 register tying.  This is especially helpful on machines with two-operand
6081 instructions.
6082
6083 Note @option{-fregmove} and @option{-foptimize-register-move} are the same
6084 optimization.
6085
6086 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6087
6088 @item -fira-algorithm=@var{algorithm}
6089 Use specified coloring algorithm for the integrated register
6090 allocator.  The @var{algorithm} argument should be @code{priority} or
6091 @code{CB}.  The first algorithm specifies Chow's priority coloring,
6092 the second one specifies Chaitin-Briggs coloring.  The second
6093 algorithm can be unimplemented for some architectures.  If it is
6094 implemented, it is the default because Chaitin-Briggs coloring as a
6095 rule generates a better code.
6096
6097 @item -fira-region=@var{region}
6098 Use specified regions for the integrated register allocator.  The
6099 @var{region} argument should be one of @code{all}, @code{mixed}, or
6100 @code{one}.  The first value means using all loops as register
6101 allocation regions, the second value which is the default means using
6102 all loops except for loops with small register pressure as the
6103 regions, and third one means using all function as a single region.
6104 The first value can give best result for machines with small size and
6105 irregular register set, the third one results in faster and generates
6106 decent code and the smallest size code, and the default value usually
6107 give the best results in most cases and for most architectures.
6108
6109 @item -fira-coalesce
6110 @opindex fira-coalesce
6111 Do optimistic register coalescing.  This option might be profitable for
6112 architectures with big regular register files.
6113
6114 @item -fno-ira-share-save-slots
6115 @opindex fno-ira-share-save-slots
6116 Switch off sharing stack slots used for saving call used hard
6117 registers living through a call.  Each hard register will get a
6118 separate stack slot and as a result function stack frame will be
6119 bigger.
6120
6121 @item -fno-ira-share-spill-slots
6122 @opindex fno-ira-share-spill-slots
6123 Switch off sharing stack slots allocated for pseudo-registers.  Each
6124 pseudo-register which did not get a hard register will get a separate
6125 stack slot and as a result function stack frame will be bigger.
6126
6127 @item -fira-verbose=@var{n}
6128 @opindex fira-verbose
6129 Set up how verbose dump file for the integrated register allocator
6130 will be.  Default value is 5.  If the value is greater or equal to 10,
6131 the dump file will be stderr as if the value were @var{n} minus 10.
6132
6133 @item -fdelayed-branch
6134 @opindex fdelayed-branch
6135 If supported for the target machine, attempt to reorder instructions
6136 to exploit instruction slots available after delayed branch
6137 instructions.
6138
6139 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6140
6141 @item -fschedule-insns
6142 @opindex fschedule-insns
6143 If supported for the target machine, attempt to reorder instructions to
6144 eliminate execution stalls due to required data being unavailable.  This
6145 helps machines that have slow floating point or memory load instructions
6146 by allowing other instructions to be issued until the result of the load
6147 or floating point instruction is required.
6148
6149 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6150
6151 @item -fschedule-insns2
6152 @opindex fschedule-insns2
6153 Similar to @option{-fschedule-insns}, but requests an additional pass of
6154 instruction scheduling after register allocation has been done.  This is
6155 especially useful on machines with a relatively small number of
6156 registers and where memory load instructions take more than one cycle.
6157
6158 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6159
6160 @item -fno-sched-interblock
6161 @opindex fno-sched-interblock
6162 Don't schedule instructions across basic blocks.  This is normally
6163 enabled by default when scheduling before register allocation, i.e.@:
6164 with @option{-fschedule-insns} or at @option{-O2} or higher.
6165
6166 @item -fno-sched-spec
6167 @opindex fno-sched-spec
6168 Don't allow speculative motion of non-load instructions.  This is normally
6169 enabled by default when scheduling before register allocation, i.e.@:
6170 with @option{-fschedule-insns} or at @option{-O2} or higher.
6171
6172 @item -fsched-spec-load
6173 @opindex fsched-spec-load
6174 Allow speculative motion of some load instructions.  This only makes
6175 sense when scheduling before register allocation, i.e.@: with
6176 @option{-fschedule-insns} or at @option{-O2} or higher.
6177
6178 @item -fsched-spec-load-dangerous
6179 @opindex fsched-spec-load-dangerous
6180 Allow speculative motion of more load instructions.  This only makes
6181 sense when scheduling before register allocation, i.e.@: with
6182 @option{-fschedule-insns} or at @option{-O2} or higher.
6183
6184 @item -fsched-stalled-insns
6185 @itemx -fsched-stalled-insns=@var{n}
6186 @opindex fsched-stalled-insns
6187 Define how many insns (if any) can be moved prematurely from the queue
6188 of stalled insns into the ready list, during the second scheduling pass.
6189 @option{-fno-sched-stalled-insns} means that no insns will be moved
6190 prematurely, @option{-fsched-stalled-insns=0} means there is no limit
6191 on how many queued insns can be moved prematurely.
6192 @option{-fsched-stalled-insns} without a value is equivalent to
6193 @option{-fsched-stalled-insns=1}.
6194
6195 @item -fsched-stalled-insns-dep
6196 @itemx -fsched-stalled-insns-dep=@var{n}
6197 @opindex fsched-stalled-insns-dep
6198 Define how many insn groups (cycles) will be examined for a dependency
6199 on a stalled insn that is candidate for premature removal from the queue
6200 of stalled insns.  This has an effect only during the second scheduling pass,
6201 and only if @option{-fsched-stalled-insns} is used.
6202 @option{-fno-sched-stalled-insns-dep} is equivalent to
6203 @option{-fsched-stalled-insns-dep=0}.
6204 @option{-fsched-stalled-insns-dep} without a value is equivalent to
6205 @option{-fsched-stalled-insns-dep=1}.
6206
6207 @item -fsched2-use-superblocks
6208 @opindex fsched2-use-superblocks
6209 When scheduling after register allocation, do use superblock scheduling
6210 algorithm.  Superblock scheduling allows motion across basic block boundaries
6211 resulting on faster schedules.  This option is experimental, as not all machine
6212 descriptions used by GCC model the CPU closely enough to avoid unreliable
6213 results from the algorithm.
6214
6215 This only makes sense when scheduling after register allocation, i.e.@: with
6216 @option{-fschedule-insns2} or at @option{-O2} or higher.
6217
6218 @item -fsched2-use-traces
6219 @opindex fsched2-use-traces
6220 Use @option{-fsched2-use-superblocks} algorithm when scheduling after register
6221 allocation and additionally perform code duplication in order to increase the
6222 size of superblocks using tracer pass.  See @option{-ftracer} for details on
6223 trace formation.
6224
6225 This mode should produce faster but significantly longer programs.  Also
6226 without @option{-fbranch-probabilities} the traces constructed may not
6227 match the reality and hurt the performance.  This only makes
6228 sense when scheduling after register allocation, i.e.@: with
6229 @option{-fschedule-insns2} or at @option{-O2} or higher.
6230
6231 @item -freschedule-modulo-scheduled-loops
6232 @opindex freschedule-modulo-scheduled-loops
6233 The modulo scheduling comes before the traditional scheduling, if a loop
6234 was modulo scheduled we may want to prevent the later scheduling passes
6235 from changing its schedule, we use this option to control that.
6236
6237 @item -fselective-scheduling
6238 @opindex fselective-scheduling
6239 Schedule instructions using selective scheduling algorithm.  Selective
6240 scheduling runs instead of the first scheduler pass.
6241
6242 @item -fselective-scheduling2
6243 @opindex fselective-scheduling2
6244 Schedule instructions using selective scheduling algorithm.  Selective
6245 scheduling runs instead of the second scheduler pass.
6246
6247 @item -fsel-sched-pipelining
6248 @opindex fsel-sched-pipelining
6249 Enable software pipelining of innermost loops during selective scheduling.  
6250 This option has no effect until one of @option{-fselective-scheduling} or 
6251 @option{-fselective-scheduling2} is turned on.
6252
6253 @item -fsel-sched-pipelining-outer-loops
6254 @opindex fsel-sched-pipelining-outer-loops
6255 When pipelining loops during selective scheduling, also pipeline outer loops.
6256 This option has no effect until @option{-fsel-sched-pipelining} is turned on.
6257
6258 @item -fcaller-saves
6259 @opindex fcaller-saves
6260 Enable values to be allocated in registers that will be clobbered by
6261 function calls, by emitting extra instructions to save and restore the
6262 registers around such calls.  Such allocation is done only when it
6263 seems to result in better code than would otherwise be produced.
6264
6265 This option is always enabled by default on certain machines, usually
6266 those which have no call-preserved registers to use instead.
6267
6268 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6269
6270 @item -fconserve-stack
6271 @opindex fconserve-stack
6272 Attempt to minimize stack usage.  The compiler will attempt to use less
6273 stack space, even if that makes the program slower.  This option
6274 implies setting the @option{large-stack-frame} parameter to 100
6275 and the @option{large-stack-frame-growth} parameter to 400.
6276
6277 @item -ftree-reassoc
6278 @opindex ftree-reassoc
6279 Perform reassociation on trees.  This flag is enabled by default
6280 at @option{-O} and higher.
6281
6282 @item -ftree-pre
6283 @opindex ftree-pre
6284 Perform partial redundancy elimination (PRE) on trees.  This flag is
6285 enabled by default at @option{-O2} and @option{-O3}.
6286
6287 @item -ftree-forwprop
6288 @opindex ftree-forwprop
6289 Perform forward propagation on trees.  This flag is enabled by default
6290 at @option{-O} and higher.
6291
6292 @item -ftree-fre
6293 @opindex ftree-fre
6294 Perform full redundancy elimination (FRE) on trees.  The difference
6295 between FRE and PRE is that FRE only considers expressions
6296 that are computed on all paths leading to the redundant computation.
6297 This analysis is faster than PRE, though it exposes fewer redundancies.
6298 This flag is enabled by default at @option{-O} and higher.
6299
6300 @item -ftree-phiprop
6301 @opindex ftree-phiprop
6302 Perform hoisting of loads from conditional pointers on trees.  This
6303 pass is enabled by default at @option{-O} and higher.
6304
6305 @item -ftree-copy-prop
6306 @opindex ftree-copy-prop
6307 Perform copy propagation on trees.  This pass eliminates unnecessary
6308 copy operations.  This flag is enabled by default at @option{-O} and
6309 higher.
6310
6311 @item -fipa-pure-const
6312 @opindex fipa-pure-const
6313 Discover which functions are pure or constant.
6314 Enabled by default at @option{-O} and higher.
6315
6316 @item -fipa-reference
6317 @opindex fipa-reference
6318 Discover which static variables do not escape cannot escape the
6319 compilation unit.
6320 Enabled by default at @option{-O} and higher.
6321
6322 @item -fipa-struct-reorg
6323 @opindex fipa-struct-reorg
6324 Perform structure reorganization optimization, that change C-like structures 
6325 layout in order to better utilize spatial locality.  This transformation is 
6326 affective for programs containing arrays of structures.  Available in two 
6327 compilation modes: profile-based (enabled with @option{-fprofile-generate})
6328 or static (which uses built-in heuristics).  Require @option{-fipa-type-escape}
6329 to provide the safety of this transformation.  It works only in whole program
6330 mode, so it requires @option{-fwhole-program} and @option{-combine} to be
6331 enabled.  Structures considered @samp{cold} by this transformation are not
6332 affected (see @option{--param struct-reorg-cold-struct-ratio=@var{value}}).
6333
6334 With this flag, the program debug info reflects a new structure layout.
6335
6336 @item -fipa-pta
6337 @opindex fipa-pta
6338 Perform interprocedural pointer analysis.  This option is experimental
6339 and does not affect generated code.
6340
6341 @item -fipa-cp
6342 @opindex fipa-cp
6343 Perform interprocedural constant propagation.
6344 This optimization analyzes the program to determine when values passed
6345 to functions are constants and then optimizes accordingly.  
6346 This optimization can substantially increase performance
6347 if the application has constants passed to functions.
6348 This flag is enabled by default at @option{-O2}, @option{-Os} and @option{-O3}.
6349
6350 @item -fipa-cp-clone
6351 @opindex fipa-cp-clone
6352 Perform function cloning to make interprocedural constant propagation stronger.
6353 When enabled, interprocedural constant propagation will perform function cloning
6354 when externally visible function can be called with constant arguments.
6355 Because this optimization can create multiple copies of functions,
6356 it may significantly increase code size
6357 (see @option{--param ipcp-unit-growth=@var{value}}).
6358 This flag is enabled by default at @option{-O3}.
6359
6360 @item -fipa-matrix-reorg
6361 @opindex fipa-matrix-reorg
6362 Perform matrix flattening and transposing.
6363 Matrix flattening tries to replace an @math{m}-dimensional matrix
6364 with its equivalent @math{n}-dimensional matrix, where @math{n < m}.
6365 This reduces the level of indirection needed for accessing the elements
6366 of the matrix. The second optimization is matrix transposing that
6367 attempts to change the order of the matrix's dimensions in order to
6368 improve cache locality.
6369 Both optimizations need the @option{-fwhole-program} flag. 
6370 Transposing is enabled only if profiling information is available.
6371
6372
6373 @item -ftree-sink
6374 @opindex ftree-sink
6375 Perform forward store motion  on trees.  This flag is
6376 enabled by default at @option{-O} and higher.
6377
6378 @item -ftree-ccp
6379 @opindex ftree-ccp
6380 Perform sparse conditional constant propagation (CCP) on trees.  This
6381 pass only operates on local scalar variables and is enabled by default
6382 at @option{-O} and higher.
6383
6384 @item -ftree-switch-conversion
6385 Perform conversion of simple initializations in a switch to
6386 initializations from a scalar array.  This flag is enabled by default
6387 at @option{-O2} and higher.
6388
6389 @item -ftree-dce
6390 @opindex ftree-dce
6391 Perform dead code elimination (DCE) on trees.  This flag is enabled by
6392 default at @option{-O} and higher.
6393
6394 @item -ftree-builtin-call-dce
6395 @opindex ftree-builtin-call-dce
6396 Perform conditional dead code elimination (DCE) for calls to builtin functions 
6397 that may set @code{errno} but are otherwise side-effect free.  This flag is 
6398 enabled by default at @option{-O2} and higher if @option{-Os} is not also 
6399 specified.
6400
6401 @item -ftree-dominator-opts
6402 @opindex ftree-dominator-opts
6403 Perform a variety of simple scalar cleanups (constant/copy
6404 propagation, redundancy elimination, range propagation and expression
6405 simplification) based on a dominator tree traversal.  This also
6406 performs jump threading (to reduce jumps to jumps). This flag is
6407 enabled by default at @option{-O} and higher.
6408
6409 @item -ftree-dse
6410 @opindex ftree-dse
6411 Perform dead store elimination (DSE) on trees.  A dead store is a store into
6412 a memory location which will later be overwritten by another store without
6413 any intervening loads.  In this case the earlier store can be deleted.  This
6414 flag is enabled by default at @option{-O} and higher.
6415
6416 @item -ftree-ch
6417 @opindex ftree-ch
6418 Perform loop header copying on trees.  This is beneficial since it increases
6419 effectiveness of code motion optimizations.  It also saves one jump.  This flag
6420 is enabled by default at @option{-O} and higher.  It is not enabled
6421 for @option{-Os}, since it usually increases code size.
6422
6423 @item -ftree-loop-optimize
6424 @opindex ftree-loop-optimize
6425 Perform loop optimizations on trees.  This flag is enabled by default
6426 at @option{-O} and higher.
6427
6428 @item -ftree-loop-linear
6429 @opindex ftree-loop-linear
6430 Perform linear loop transformations on tree.  This flag can improve cache
6431 performance and allow further loop optimizations to take place.
6432
6433 @item -floop-interchange
6434 Perform loop interchange transformations on loops.  Interchanging two
6435 nested loops switches the inner and outer loops.  For example, given a
6436 loop like:
6437 @smallexample
6438 DO J = 1, M
6439   DO I = 1, N
6440     A(J, I) = A(J, I) * C
6441   ENDDO
6442 ENDDO
6443 @end smallexample
6444 loop interchange will transform the loop as if the user had written:
6445 @smallexample
6446 DO I = 1, N
6447   DO J = 1, M
6448     A(J, I) = A(J, I) * C
6449   ENDDO
6450 ENDDO
6451 @end smallexample
6452 which can be beneficial when @code{N} is larger than the caches,
6453 because in Fortran, the elements of an array are stored in memory
6454 contiguously by column, and the original loop iterates over rows,
6455 potentially creating at each access a cache miss.  This optimization
6456 applies to all the languages supported by GCC and is not limited to
6457 Fortran.  To use this code transformation, GCC has to be configured
6458 with @option{--with-ppl} and @option{--with-cloog} to enable the
6459 Graphite loop transformation infrastructure.
6460
6461 @item -floop-strip-mine
6462 Perform loop strip mining transformations on loops.  Strip mining
6463 splits a loop into two nested loops.  The outer loop has strides 
6464 equal to the strip size and the inner loop has strides of the 
6465 original loop within a strip.  For example, given a loop like:
6466 @smallexample
6467 DO I = 1, N
6468   A(I) = A(I) + C
6469 ENDDO
6470 @end smallexample
6471 loop strip mining will transform the loop as if the user had written:
6472 @smallexample
6473 DO II = 1, N, 4
6474   DO I = II, min (II + 3, N)
6475     A(I) = A(I) + C
6476   ENDDO
6477 ENDDO
6478 @end smallexample
6479 This optimization applies to all the languages supported by GCC and is
6480 not limited to Fortran.  To use this code transformation, GCC has to
6481 be configured with @option{--with-ppl} and @option{--with-cloog} to
6482 enable the Graphite loop transformation infrastructure.
6483
6484 @item -floop-block
6485 Perform loop blocking transformations on loops.  Blocking strip mines
6486 each loop in the loop nest such that the memory accesses of the
6487 element loops fit inside caches.  For example, given a loop like:
6488 @smallexample
6489 DO I = 1, N
6490   DO J = 1, M
6491     A(J, I) = B(I) + C(J)
6492   ENDDO
6493 ENDDO
6494 @end smallexample
6495 loop blocking will transform the loop as if the user had written:
6496 @smallexample
6497 DO II = 1, N, 64
6498   DO JJ = 1, M, 64
6499     DO I = II, min (II + 63, N)
6500       DO J = JJ, min (JJ + 63, M)
6501         A(J, I) = B(I) + C(J)
6502       ENDDO
6503     ENDDO
6504   ENDDO
6505 ENDDO
6506 @end smallexample
6507 which can be beneficial when @code{M} is larger than the caches,
6508 because the innermost loop will iterate over a smaller amount of data
6509 that can be kept in the caches.  This optimization applies to all the
6510 languages supported by GCC and is not limited to Fortran.  To use this
6511 code transformation, GCC has to be configured with @option{--with-ppl}
6512 and @option{--with-cloog} to enable the Graphite loop transformation
6513 infrastructure.
6514
6515 @item -fcheck-data-deps
6516 @opindex fcheck-data-deps
6517 Compare the results of several data dependence analyzers.  This option
6518 is used for debugging the data dependence analyzers.
6519
6520 @item -ftree-loop-distribution
6521 Perform loop distribution.  This flag can improve cache performance on
6522 big loop bodies and allow further loop optimizations, like
6523 parallelization or vectorization, to take place.  For example, the loop
6524 @smallexample
6525 DO I = 1, N
6526   A(I) = B(I) + C
6527   D(I) = E(I) * F
6528 ENDDO
6529 @end smallexample
6530 is transformed to
6531 @smallexample
6532 DO I = 1, N
6533    A(I) = B(I) + C
6534 ENDDO
6535 DO I = 1, N
6536    D(I) = E(I) * F
6537 ENDDO
6538 @end smallexample
6539
6540 @item -ftree-loop-im
6541 @opindex ftree-loop-im
6542 Perform loop invariant motion on trees.  This pass moves only invariants that
6543 would be hard to handle at RTL level (function calls, operations that expand to
6544 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
6545 operands of conditions that are invariant out of the loop, so that we can use
6546 just trivial invariantness analysis in loop unswitching.  The pass also includes
6547 store motion.
6548
6549 @item -ftree-loop-ivcanon
6550 @opindex ftree-loop-ivcanon
6551 Create a canonical counter for number of iterations in the loop for that
6552 determining number of iterations requires complicated analysis.  Later
6553 optimizations then may determine the number easily.  Useful especially
6554 in connection with unrolling.
6555
6556 @item -fivopts
6557 @opindex fivopts
6558 Perform induction variable optimizations (strength reduction, induction
6559 variable merging and induction variable elimination) on trees.
6560
6561 @item -ftree-parallelize-loops=n
6562 @opindex ftree-parallelize-loops
6563 Parallelize loops, i.e., split their iteration space to run in n threads.
6564 This is only possible for loops whose iterations are independent
6565 and can be arbitrarily reordered.  The optimization is only
6566 profitable on multiprocessor machines, for loops that are CPU-intensive,
6567 rather than constrained e.g.@: by memory bandwidth.  This option
6568 implies @option{-pthread}, and thus is only supported on targets
6569 that have support for @option{-pthread}.
6570
6571 @item -ftree-pta
6572 @opindex ftree-pta
6573 Perform function-local points-to analysis on trees.  This flag is
6574 enabled by default at @option{-O} and higher.
6575
6576 @item -ftree-sra
6577 @opindex ftree-sra
6578 Perform scalar replacement of aggregates.  This pass replaces structure
6579 references with scalars to prevent committing structures to memory too
6580 early.  This flag is enabled by default at @option{-O} and higher.
6581
6582 @item -ftree-copyrename
6583 @opindex ftree-copyrename
6584 Perform copy renaming on trees.  This pass attempts to rename compiler
6585 temporaries to other variables at copy locations, usually resulting in
6586 variable names which more closely resemble the original variables.  This flag
6587 is enabled by default at @option{-O} and higher.
6588
6589 @item -ftree-ter
6590 @opindex ftree-ter
6591 Perform temporary expression replacement during the SSA->normal phase.  Single
6592 use/single def temporaries are replaced at their use location with their
6593 defining expression.  This results in non-GIMPLE code, but gives the expanders
6594 much more complex trees to work on resulting in better RTL generation.  This is
6595 enabled by default at @option{-O} and higher.
6596
6597 @item -ftree-vectorize
6598 @opindex ftree-vectorize
6599 Perform loop vectorization on trees. This flag is enabled by default at
6600 @option{-O3}.
6601
6602 @item -ftree-vect-loop-version
6603 @opindex ftree-vect-loop-version
6604 Perform loop versioning when doing loop vectorization on trees.  When a loop
6605 appears to be vectorizable except that data alignment or data dependence cannot
6606 be determined at compile time then vectorized and non-vectorized versions of
6607 the loop are generated along with runtime checks for alignment or dependence
6608 to control which version is executed.  This option is enabled by default
6609 except at level @option{-Os} where it is disabled.
6610
6611 @item -fvect-cost-model
6612 @opindex fvect-cost-model
6613 Enable cost model for vectorization.
6614
6615 @item -ftree-vrp
6616 @opindex ftree-vrp
6617 Perform Value Range Propagation on trees.  This is similar to the
6618 constant propagation pass, but instead of values, ranges of values are
6619 propagated.  This allows the optimizers to remove unnecessary range
6620 checks like array bound checks and null pointer checks.  This is
6621 enabled by default at @option{-O2} and higher.  Null pointer check
6622 elimination is only done if @option{-fdelete-null-pointer-checks} is
6623 enabled.
6624
6625 @item -ftracer
6626 @opindex ftracer
6627 Perform tail duplication to enlarge superblock size.  This transformation
6628 simplifies the control flow of the function allowing other optimizations to do
6629 better job.
6630
6631 @item -funroll-loops
6632 @opindex funroll-loops
6633 Unroll loops whose number of iterations can be determined at compile
6634 time or upon entry to the loop.  @option{-funroll-loops} implies
6635 @option{-frerun-cse-after-loop}.  This option makes code larger,
6636 and may or may not make it run faster.
6637
6638 @item -funroll-all-loops
6639 @opindex funroll-all-loops
6640 Unroll all loops, even if their number of iterations is uncertain when
6641 the loop is entered.  This usually makes programs run more slowly.
6642 @option{-funroll-all-loops} implies the same options as
6643 @option{-funroll-loops},
6644
6645 @item -fsplit-ivs-in-unroller
6646 @opindex fsplit-ivs-in-unroller
6647 Enables expressing of values of induction variables in later iterations
6648 of the unrolled loop using the value in the first iteration.  This breaks
6649 long dependency chains, thus improving efficiency of the scheduling passes.
6650
6651 Combination of @option{-fweb} and CSE is often sufficient to obtain the
6652 same effect.  However in cases the loop body is more complicated than
6653 a single basic block, this is not reliable.  It also does not work at all
6654 on some of the architectures due to restrictions in the CSE pass.
6655
6656 This optimization is enabled by default.
6657
6658 @item -fvariable-expansion-in-unroller
6659 @opindex fvariable-expansion-in-unroller
6660 With this option, the compiler will create multiple copies of some
6661 local variables when unrolling a loop which can result in superior code.
6662
6663 @item -fpredictive-commoning
6664 @opindex fpredictive-commoning
6665 Perform predictive commoning optimization, i.e., reusing computations
6666 (especially memory loads and stores) performed in previous
6667 iterations of loops.
6668
6669 This option is enabled at level @option{-O3}.
6670
6671 @item -fprefetch-loop-arrays
6672 @opindex fprefetch-loop-arrays
6673 If supported by the target machine, generate instructions to prefetch
6674 memory to improve the performance of loops that access large arrays.
6675
6676 This option may generate better or worse code; results are highly
6677 dependent on the structure of loops within the source code.
6678
6679 Disabled at level @option{-Os}.
6680
6681 @item -fno-peephole
6682 @itemx -fno-peephole2
6683 @opindex fno-peephole
6684 @opindex fno-peephole2
6685 Disable any machine-specific peephole optimizations.  The difference
6686 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
6687 are implemented in the compiler; some targets use one, some use the
6688 other, a few use both.
6689
6690 @option{-fpeephole} is enabled by default.
6691 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6692
6693 @item -fno-guess-branch-probability
6694 @opindex fno-guess-branch-probability
6695 Do not guess branch probabilities using heuristics.
6696
6697 GCC will use heuristics to guess branch probabilities if they are
6698 not provided by profiling feedback (@option{-fprofile-arcs}).  These
6699 heuristics are based on the control flow graph.  If some branch probabilities
6700 are specified by @samp{__builtin_expect}, then the heuristics will be
6701 used to guess branch probabilities for the rest of the control flow graph,
6702 taking the @samp{__builtin_expect} info into account.  The interactions
6703 between the heuristics and @samp{__builtin_expect} can be complex, and in
6704 some cases, it may be useful to disable the heuristics so that the effects
6705 of @samp{__builtin_expect} are easier to understand.
6706
6707 The default is @option{-fguess-branch-probability} at levels
6708 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6709
6710 @item -freorder-blocks
6711 @opindex freorder-blocks
6712 Reorder basic blocks in the compiled function in order to reduce number of
6713 taken branches and improve code locality.
6714
6715 Enabled at levels @option{-O2}, @option{-O3}.
6716
6717 @item -freorder-blocks-and-partition
6718 @opindex freorder-blocks-and-partition
6719 In addition to reordering basic blocks in the compiled function, in order
6720 to reduce number of taken branches, partitions hot and cold basic blocks
6721 into separate sections of the assembly and .o files, to improve
6722 paging and cache locality performance.
6723
6724 This optimization is automatically turned off in the presence of
6725 exception handling, for linkonce sections, for functions with a user-defined
6726 section attribute and on any architecture that does not support named
6727 sections.
6728
6729 @item -freorder-functions
6730 @opindex freorder-functions
6731 Reorder functions in the object file in order to
6732 improve code locality.  This is implemented by using special
6733 subsections @code{.text.hot} for most frequently executed functions and
6734 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
6735 the linker so object file format must support named sections and linker must
6736 place them in a reasonable way.
6737
6738 Also profile feedback must be available in to make this option effective.  See
6739 @option{-fprofile-arcs} for details.
6740
6741 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6742
6743 @item -fstrict-aliasing
6744 @opindex fstrict-aliasing
6745 Allows the compiler to assume the strictest aliasing rules applicable to
6746 the language being compiled.  For C (and C++), this activates
6747 optimizations based on the type of expressions.  In particular, an
6748 object of one type is assumed never to reside at the same address as an
6749 object of a different type, unless the types are almost the same.  For
6750 example, an @code{unsigned int} can alias an @code{int}, but not a
6751 @code{void*} or a @code{double}.  A character type may alias any other
6752 type.
6753
6754 @anchor{Type-punning}Pay special attention to code like this:
6755 @smallexample
6756 union a_union @{
6757   int i;
6758   double d;
6759 @};
6760
6761 int f() @{
6762   a_union t;
6763   t.d = 3.0;
6764   return t.i;
6765 @}
6766 @end smallexample
6767 The practice of reading from a different union member than the one most
6768 recently written to (called ``type-punning'') is common.  Even with
6769 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
6770 is accessed through the union type.  So, the code above will work as
6771 expected.  @xref{Structures unions enumerations and bit-fields
6772 implementation}.  However, this code might not:
6773 @smallexample
6774 int f() @{
6775   a_union t;
6776   int* ip;
6777   t.d = 3.0;
6778   ip = &t.i;
6779   return *ip;
6780 @}
6781 @end smallexample
6782
6783 Similarly, access by taking the address, casting the resulting pointer
6784 and dereferencing the result has undefined behavior, even if the cast
6785 uses a union type, e.g.:
6786 @smallexample
6787 int f() @{
6788   double d = 3.0;
6789   return ((union a_union *) &d)->i;
6790 @}
6791 @end smallexample
6792
6793 The @option{-fstrict-aliasing} option is enabled at levels
6794 @option{-O2}, @option{-O3}, @option{-Os}.
6795
6796 @item -fstrict-overflow
6797 @opindex fstrict-overflow
6798 Allow the compiler to assume strict signed overflow rules, depending
6799 on the language being compiled.  For C (and C++) this means that
6800 overflow when doing arithmetic with signed numbers is undefined, which
6801 means that the compiler may assume that it will not happen.  This
6802 permits various optimizations.  For example, the compiler will assume
6803 that an expression like @code{i + 10 > i} will always be true for
6804 signed @code{i}.  This assumption is only valid if signed overflow is
6805 undefined, as the expression is false if @code{i + 10} overflows when
6806 using twos complement arithmetic.  When this option is in effect any
6807 attempt to determine whether an operation on signed numbers will
6808 overflow must be written carefully to not actually involve overflow.
6809
6810 This option also allows the compiler to assume strict pointer
6811 semantics: given a pointer to an object, if adding an offset to that
6812 pointer does not produce a pointer to the same object, the addition is
6813 undefined.  This permits the compiler to conclude that @code{p + u >
6814 p} is always true for a pointer @code{p} and unsigned integer
6815 @code{u}.  This assumption is only valid because pointer wraparound is
6816 undefined, as the expression is false if @code{p + u} overflows using
6817 twos complement arithmetic.
6818
6819 See also the @option{-fwrapv} option.  Using @option{-fwrapv} means
6820 that integer signed overflow is fully defined: it wraps.  When
6821 @option{-fwrapv} is used, there is no difference between
6822 @option{-fstrict-overflow} and @option{-fno-strict-overflow} for
6823 integers.  With @option{-fwrapv} certain types of overflow are
6824 permitted.  For example, if the compiler gets an overflow when doing
6825 arithmetic on constants, the overflowed value can still be used with
6826 @option{-fwrapv}, but not otherwise.
6827
6828 The @option{-fstrict-overflow} option is enabled at levels
6829 @option{-O2}, @option{-O3}, @option{-Os}.
6830
6831 @item -falign-functions
6832 @itemx -falign-functions=@var{n}
6833 @opindex falign-functions
6834 Align the start of functions to the next power-of-two greater than
6835 @var{n}, skipping up to @var{n} bytes.  For instance,
6836 @option{-falign-functions=32} aligns functions to the next 32-byte
6837 boundary, but @option{-falign-functions=24} would align to the next
6838 32-byte boundary only if this can be done by skipping 23 bytes or less.
6839
6840 @option{-fno-align-functions} and @option{-falign-functions=1} are
6841 equivalent and mean that functions will not be aligned.
6842
6843 Some assemblers only support this flag when @var{n} is a power of two;
6844 in that case, it is rounded up.
6845
6846 If @var{n} is not specified or is zero, use a machine-dependent default.
6847
6848 Enabled at levels @option{-O2}, @option{-O3}.
6849
6850 @item -falign-labels
6851 @itemx -falign-labels=@var{n}
6852 @opindex falign-labels
6853 Align all branch targets to a power-of-two boundary, skipping up to
6854 @var{n} bytes like @option{-falign-functions}.  This option can easily
6855 make code slower, because it must insert dummy operations for when the
6856 branch target is reached in the usual flow of the code.
6857
6858 @option{-fno-align-labels} and @option{-falign-labels=1} are
6859 equivalent and mean that labels will not be aligned.
6860
6861 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
6862 are greater than this value, then their values are used instead.
6863
6864 If @var{n} is not specified or is zero, use a machine-dependent default
6865 which is very likely to be @samp{1}, meaning no alignment.
6866
6867 Enabled at levels @option{-O2}, @option{-O3}.
6868
6869 @item -falign-loops
6870 @itemx -falign-loops=@var{n}
6871 @opindex falign-loops
6872 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
6873 like @option{-falign-functions}.  The hope is that the loop will be
6874 executed many times, which will make up for any execution of the dummy
6875 operations.
6876
6877 @option{-fno-align-loops} and @option{-falign-loops=1} are
6878 equivalent and mean that loops will not be aligned.
6879
6880 If @var{n} is not specified or is zero, use a machine-dependent default.
6881
6882 Enabled at levels @option{-O2}, @option{-O3}.
6883
6884 @item -falign-jumps
6885 @itemx -falign-jumps=@var{n}
6886 @opindex falign-jumps
6887 Align branch targets to a power-of-two boundary, for branch targets
6888 where the targets can only be reached by jumping, skipping up to @var{n}
6889 bytes like @option{-falign-functions}.  In this case, no dummy operations
6890 need be executed.
6891
6892 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
6893 equivalent and mean that loops will not be aligned.
6894
6895 If @var{n} is not specified or is zero, use a machine-dependent default.
6896
6897 Enabled at levels @option{-O2}, @option{-O3}.
6898
6899 @item -funit-at-a-time
6900 @opindex funit-at-a-time
6901 This option is left for compatibility reasons. @option{-funit-at-a-time}
6902 has no effect, while @option{-fno-unit-at-a-time} implies
6903 @option{-fno-toplevel-reorder} and @option{-fno-section-anchors}.
6904
6905 Enabled by default.
6906
6907 @item -fno-toplevel-reorder
6908 @opindex fno-toplevel-reorder
6909 Do not reorder top-level functions, variables, and @code{asm}
6910 statements.  Output them in the same order that they appear in the
6911 input file.  When this option is used, unreferenced static variables
6912 will not be removed.  This option is intended to support existing code
6913 which relies on a particular ordering.  For new code, it is better to
6914 use attributes.
6915
6916 Enabled at level @option{-O0}.  When disabled explicitly, it also imply
6917 @option{-fno-section-anchors} that is otherwise enabled at @option{-O0} on some
6918 targets.
6919
6920 @item -fweb
6921 @opindex fweb
6922 Constructs webs as commonly used for register allocation purposes and assign
6923 each web individual pseudo register.  This allows the register allocation pass
6924 to operate on pseudos directly, but also strengthens several other optimization
6925 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
6926 however, make debugging impossible, since variables will no longer stay in a
6927 ``home register''.
6928
6929 Enabled by default with @option{-funroll-loops}.
6930
6931 @item -fwhole-program
6932 @opindex fwhole-program
6933 Assume that the current compilation unit represents the whole program being
6934 compiled.  All public functions and variables with the exception of @code{main}
6935 and those merged by attribute @code{externally_visible} become static functions
6936 and in effect are optimized more aggressively by interprocedural optimizers.
6937 While this option is equivalent to proper use of the @code{static} keyword for
6938 programs consisting of a single file, in combination with option
6939 @option{--combine} this flag can be used to compile many smaller scale C
6940 programs since the functions and variables become local for the whole combined
6941 compilation unit, not for the single source file itself.
6942
6943 This option implies @option{-fwhole-file} for Fortran programs.
6944
6945 @item -fcprop-registers
6946 @opindex fcprop-registers
6947 After register allocation and post-register allocation instruction splitting,
6948 we perform a copy-propagation pass to try to reduce scheduling dependencies
6949 and occasionally eliminate the copy.
6950
6951 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6952
6953 @item -fprofile-correction
6954 @opindex fprofile-correction
6955 Profiles collected using an instrumented binary for multi-threaded programs may
6956 be inconsistent due to missed counter updates. When this option is specified,
6957 GCC will use heuristics to correct or smooth out such inconsistencies. By
6958 default, GCC will emit an error message when an inconsistent profile is detected.
6959
6960 @item -fprofile-dir=@var{path}
6961 @opindex fprofile-dir
6962
6963 Set the directory to search the profile data files in to @var{path}.
6964 This option affects only the profile data generated by
6965 @option{-fprofile-generate}, @option{-ftest-coverage}, @option{-fprofile-arcs}
6966 and used by @option{-fprofile-use} and @option{-fbranch-probabilities} 
6967 and its related options.
6968 By default, GCC will use the current directory as @var{path}
6969 thus the profile data file will appear in the same directory as the object file.
6970
6971 @item -fprofile-generate
6972 @itemx -fprofile-generate=@var{path}
6973 @opindex fprofile-generate
6974
6975 Enable options usually used for instrumenting application to produce
6976 profile useful for later recompilation with profile feedback based
6977 optimization.  You must use @option{-fprofile-generate} both when
6978 compiling and when linking your program.
6979
6980 The following options are enabled: @code{-fprofile-arcs}, @code{-fprofile-values}, @code{-fvpt}.
6981
6982 If @var{path} is specified, GCC will look at the @var{path} to find
6983 the profile feedback data files. See @option{-fprofile-dir}.
6984
6985 @item -fprofile-use
6986 @itemx -fprofile-use=@var{path}
6987 @opindex fprofile-use
6988 Enable profile feedback directed optimizations, and optimizations
6989 generally profitable only with profile feedback available.
6990
6991 The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt},
6992 @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}
6993
6994 By default, GCC emits an error message if the feedback profiles do not
6995 match the source code.  This error can be turned into a warning by using
6996 @option{-Wcoverage-mismatch}.  Note this may result in poorly optimized
6997 code.
6998
6999 If @var{path} is specified, GCC will look at the @var{path} to find
7000 the profile feedback data files. See @option{-fprofile-dir}.
7001 @end table
7002
7003 The following options control compiler behavior regarding floating
7004 point arithmetic.  These options trade off between speed and
7005 correctness.  All must be specifically enabled.
7006
7007 @table @gcctabopt
7008 @item -ffloat-store
7009 @opindex ffloat-store
7010 Do not store floating point variables in registers, and inhibit other
7011 options that might change whether a floating point value is taken from a
7012 register or memory.
7013
7014 @cindex floating point precision
7015 This option prevents undesirable excess precision on machines such as
7016 the 68000 where the floating registers (of the 68881) keep more
7017 precision than a @code{double} is supposed to have.  Similarly for the
7018 x86 architecture.  For most programs, the excess precision does only
7019 good, but a few programs rely on the precise definition of IEEE floating
7020 point.  Use @option{-ffloat-store} for such programs, after modifying
7021 them to store all pertinent intermediate computations into variables.
7022
7023 @item -fexcess-precision=@var{style}
7024 @opindex fexcess-precision
7025 This option allows further control over excess precision on machines
7026 where floating-point registers have more precision than the IEEE
7027 @code{float} and @code{double} types and the processor does not
7028 support operations rounding to those types.  By default,
7029 @option{-fexcess-precision=fast} is in effect; this means that
7030 operations are carried out in the precision of the registers and that
7031 it is unpredictable when rounding to the types specified in the source
7032 code takes place.  When compiling C, if
7033 @option{-fexcess-precision=standard} is specified then excess
7034 precision will follow the rules specified in ISO C99; in particular,
7035 both casts and assignments cause values to be rounded to their
7036 semantic types (whereas @option{-ffloat-store} only affects
7037 assignments).  This option is enabled by default for C if a strict
7038 conformance option such as @option{-std=c99} is used.
7039
7040 @opindex mfpmath
7041 @option{-fexcess-precision=standard} is not implemented for languages
7042 other than C, and has no effect if
7043 @option{-funsafe-math-optimizations} or @option{-ffast-math} is
7044 specified.  On the x86, it also has no effect if @option{-mfpmath=sse}
7045 or @option{-mfpmath=sse+387} is specified; in the former case, IEEE
7046 semantics apply without excess precision, and in the latter, rounding
7047 is unpredictable.
7048
7049 @item -ffast-math
7050 @opindex ffast-math
7051 Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations},
7052 @option{-ffinite-math-only}, @option{-fno-rounding-math},
7053 @option{-fno-signaling-nans} and @option{-fcx-limited-range}.
7054
7055 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
7056
7057 This option is not turned on by any @option{-O} option since
7058 it can result in incorrect output for programs which depend on
7059 an exact implementation of IEEE or ISO rules/specifications for
7060 math functions. It may, however, yield faster code for programs
7061 that do not require the guarantees of these specifications.
7062
7063 @item -fno-math-errno
7064 @opindex fno-math-errno
7065 Do not set ERRNO after calling math functions that are executed
7066 with a single instruction, e.g., sqrt.  A program that relies on
7067 IEEE exceptions for math error handling may want to use this flag
7068 for speed while maintaining IEEE arithmetic compatibility.
7069
7070 This option is not turned on by any @option{-O} option since
7071 it can result in incorrect output for programs which depend on
7072 an exact implementation of IEEE or ISO rules/specifications for
7073 math functions. It may, however, yield faster code for programs
7074 that do not require the guarantees of these specifications.
7075
7076 The default is @option{-fmath-errno}.
7077
7078 On Darwin systems, the math library never sets @code{errno}.  There is
7079 therefore no reason for the compiler to consider the possibility that
7080 it might, and @option{-fno-math-errno} is the default.
7081
7082 @item -funsafe-math-optimizations
7083 @opindex funsafe-math-optimizations
7084
7085 Allow optimizations for floating-point arithmetic that (a) assume
7086 that arguments and results are valid and (b) may violate IEEE or
7087 ANSI standards.  When used at link-time, it may include libraries
7088 or startup files that change the default FPU control word or other
7089 similar optimizations.
7090
7091 This option is not turned on by any @option{-O} option since
7092 it can result in incorrect output for programs which depend on
7093 an exact implementation of IEEE or ISO rules/specifications for
7094 math functions. It may, however, yield faster code for programs
7095 that do not require the guarantees of these specifications.
7096 Enables @option{-fno-signed-zeros}, @option{-fno-trapping-math},
7097 @option{-fassociative-math} and @option{-freciprocal-math}.
7098
7099 The default is @option{-fno-unsafe-math-optimizations}.
7100
7101 @item -fassociative-math
7102 @opindex fassociative-math
7103
7104 Allow re-association of operands in series of floating-point operations.
7105 This violates the ISO C and C++ language standard by possibly changing
7106 computation result.  NOTE: re-ordering may change the sign of zero as
7107 well as ignore NaNs and inhibit or create underflow or overflow (and
7108 thus cannot be used on a code which relies on rounding behavior like
7109 @code{(x + 2**52) - 2**52)}.  May also reorder floating-point comparisons
7110 and thus may not be used when ordered comparisons are required.
7111 This option requires that both @option{-fno-signed-zeros} and
7112 @option{-fno-trapping-math} be in effect.  Moreover, it doesn't make
7113 much sense with @option{-frounding-math}.
7114
7115 The default is @option{-fno-associative-math}.
7116
7117 @item -freciprocal-math
7118 @opindex freciprocal-math
7119
7120 Allow the reciprocal of a value to be used instead of dividing by
7121 the value if this enables optimizations.  For example @code{x / y}
7122 can be replaced with @code{x * (1/y)} which is useful if @code{(1/y)}
7123 is subject to common subexpression elimination.  Note that this loses
7124 precision and increases the number of flops operating on the value.
7125
7126 The default is @option{-fno-reciprocal-math}.
7127
7128 @item -ffinite-math-only
7129 @opindex ffinite-math-only
7130 Allow optimizations for floating-point arithmetic that assume
7131 that arguments and results are not NaNs or +-Infs.
7132
7133 This option is not turned on by any @option{-O} option since
7134 it can result in incorrect output for programs which depend on
7135 an exact implementation of IEEE or ISO rules/specifications for
7136 math functions. It may, however, yield faster code for programs
7137 that do not require the guarantees of these specifications.
7138
7139 The default is @option{-fno-finite-math-only}.
7140
7141 @item -fno-signed-zeros
7142 @opindex fno-signed-zeros
7143 Allow optimizations for floating point arithmetic that ignore the
7144 signedness of zero.  IEEE arithmetic specifies the behavior of
7145 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
7146 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
7147 This option implies that the sign of a zero result isn't significant.
7148
7149 The default is @option{-fsigned-zeros}.
7150
7151 @item -fno-trapping-math
7152 @opindex fno-trapping-math
7153 Compile code assuming that floating-point operations cannot generate
7154 user-visible traps.  These traps include division by zero, overflow,
7155 underflow, inexact result and invalid operation.  This option requires
7156 that @option{-fno-signaling-nans} be in effect.  Setting this option may
7157 allow faster code if one relies on ``non-stop'' IEEE arithmetic, for example.
7158
7159 This option should never be turned on by any @option{-O} option since
7160 it can result in incorrect output for programs which depend on
7161 an exact implementation of IEEE or ISO rules/specifications for
7162 math functions.
7163
7164 The default is @option{-ftrapping-math}.
7165
7166 @item -frounding-math
7167 @opindex frounding-math
7168 Disable transformations and optimizations that assume default floating
7169 point rounding behavior.  This is round-to-zero for all floating point
7170 to integer conversions, and round-to-nearest for all other arithmetic
7171 truncations.  This option should be specified for programs that change
7172 the FP rounding mode dynamically, or that may be executed with a
7173 non-default rounding mode.  This option disables constant folding of
7174 floating point expressions at compile-time (which may be affected by
7175 rounding mode) and arithmetic transformations that are unsafe in the
7176 presence of sign-dependent rounding modes.
7177
7178 The default is @option{-fno-rounding-math}.
7179
7180 This option is experimental and does not currently guarantee to
7181 disable all GCC optimizations that are affected by rounding mode.
7182 Future versions of GCC may provide finer control of this setting
7183 using C99's @code{FENV_ACCESS} pragma.  This command line option
7184 will be used to specify the default state for @code{FENV_ACCESS}.
7185
7186 @item -fsignaling-nans
7187 @opindex fsignaling-nans
7188 Compile code assuming that IEEE signaling NaNs may generate user-visible
7189 traps during floating-point operations.  Setting this option disables
7190 optimizations that may change the number of exceptions visible with
7191 signaling NaNs.  This option implies @option{-ftrapping-math}.
7192
7193 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
7194 be defined.
7195
7196 The default is @option{-fno-signaling-nans}.
7197
7198 This option is experimental and does not currently guarantee to
7199 disable all GCC optimizations that affect signaling NaN behavior.
7200
7201 @item -fsingle-precision-constant
7202 @opindex fsingle-precision-constant
7203 Treat floating point constant as single precision constant instead of
7204 implicitly converting it to double precision constant.
7205
7206 @item -fcx-limited-range
7207 @opindex fcx-limited-range
7208 When enabled, this option states that a range reduction step is not
7209 needed when performing complex division.  Also, there is no checking
7210 whether the result of a complex multiplication or division is @code{NaN
7211 + I*NaN}, with an attempt to rescue the situation in that case.  The
7212 default is @option{-fno-cx-limited-range}, but is enabled by
7213 @option{-ffast-math}.
7214
7215 This option controls the default setting of the ISO C99
7216 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
7217 all languages.
7218
7219 @item -fcx-fortran-rules
7220 @opindex fcx-fortran-rules
7221 Complex multiplication and division follow Fortran rules.  Range
7222 reduction is done as part of complex division, but there is no checking
7223 whether the result of a complex multiplication or division is @code{NaN
7224 + I*NaN}, with an attempt to rescue the situation in that case.
7225
7226 The default is @option{-fno-cx-fortran-rules}.
7227
7228 @end table
7229
7230 The following options control optimizations that may improve
7231 performance, but are not enabled by any @option{-O} options.  This
7232 section includes experimental options that may produce broken code.
7233
7234 @table @gcctabopt
7235 @item -fbranch-probabilities
7236 @opindex fbranch-probabilities
7237 After running a program compiled with @option{-fprofile-arcs}
7238 (@pxref{Debugging Options,, Options for Debugging Your Program or
7239 @command{gcc}}), you can compile it a second time using
7240 @option{-fbranch-probabilities}, to improve optimizations based on
7241 the number of times each branch was taken.  When the program
7242 compiled with @option{-fprofile-arcs} exits it saves arc execution
7243 counts to a file called @file{@var{sourcename}.gcda} for each source
7244 file.  The information in this data file is very dependent on the
7245 structure of the generated code, so you must use the same source code
7246 and the same optimization options for both compilations.
7247
7248 With @option{-fbranch-probabilities}, GCC puts a
7249 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
7250 These can be used to improve optimization.  Currently, they are only
7251 used in one place: in @file{reorg.c}, instead of guessing which path a
7252 branch is mostly to take, the @samp{REG_BR_PROB} values are used to
7253 exactly determine which path is taken more often.
7254
7255 @item -fprofile-values
7256 @opindex fprofile-values
7257 If combined with @option{-fprofile-arcs}, it adds code so that some
7258 data about values of expressions in the program is gathered.
7259
7260 With @option{-fbranch-probabilities}, it reads back the data gathered
7261 from profiling values of expressions and adds @samp{REG_VALUE_PROFILE}
7262 notes to instructions for their later usage in optimizations.
7263
7264 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
7265
7266 @item -fvpt
7267 @opindex fvpt
7268 If combined with @option{-fprofile-arcs}, it instructs the compiler to add
7269 a code to gather information about values of expressions.
7270
7271 With @option{-fbranch-probabilities}, it reads back the data gathered
7272 and actually performs the optimizations based on them.
7273 Currently the optimizations include specialization of division operation
7274 using the knowledge about the value of the denominator.
7275
7276 @item -frename-registers
7277 @opindex frename-registers
7278 Attempt to avoid false dependencies in scheduled code by making use
7279 of registers left over after register allocation.  This optimization
7280 will most benefit processors with lots of registers.  Depending on the
7281 debug information format adopted by the target, however, it can
7282 make debugging impossible, since variables will no longer stay in
7283 a ``home register''.
7284
7285 Enabled by default with @option{-funroll-loops}.
7286
7287 @item -ftracer
7288 @opindex ftracer
7289 Perform tail duplication to enlarge superblock size.  This transformation
7290 simplifies the control flow of the function allowing other optimizations to do
7291 better job.
7292
7293 Enabled with @option{-fprofile-use}.
7294
7295 @item -funroll-loops
7296 @opindex funroll-loops
7297 Unroll loops whose number of iterations can be determined at compile time or
7298 upon entry to the loop.  @option{-funroll-loops} implies
7299 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
7300 It also turns on complete loop peeling (i.e.@: complete removal of loops with
7301 small constant number of iterations).  This option makes code larger, and may
7302 or may not make it run faster.
7303
7304 Enabled with @option{-fprofile-use}.
7305
7306 @item -funroll-all-loops
7307 @opindex funroll-all-loops
7308 Unroll all loops, even if their number of iterations is uncertain when
7309 the loop is entered.  This usually makes programs run more slowly.
7310 @option{-funroll-all-loops} implies the same options as
7311 @option{-funroll-loops}.
7312
7313 @item -fpeel-loops
7314 @opindex fpeel-loops
7315 Peels the loops for that there is enough information that they do not
7316 roll much (from profile feedback).  It also turns on complete loop peeling
7317 (i.e.@: complete removal of loops with small constant number of iterations).
7318
7319 Enabled with @option{-fprofile-use}.
7320
7321 @item -fmove-loop-invariants
7322 @opindex fmove-loop-invariants
7323 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
7324 at level @option{-O1}
7325
7326 @item -funswitch-loops
7327 @opindex funswitch-loops
7328 Move branches with loop invariant conditions out of the loop, with duplicates
7329 of the loop on both branches (modified according to result of the condition).
7330
7331 @item -ffunction-sections
7332 @itemx -fdata-sections
7333 @opindex ffunction-sections
7334 @opindex fdata-sections
7335 Place each function or data item into its own section in the output
7336 file if the target supports arbitrary sections.  The name of the
7337 function or the name of the data item determines the section's name
7338 in the output file.
7339
7340 Use these options on systems where the linker can perform optimizations
7341 to improve locality of reference in the instruction space.  Most systems
7342 using the ELF object format and SPARC processors running Solaris 2 have
7343 linkers with such optimizations.  AIX may have these optimizations in
7344 the future.
7345
7346 Only use these options when there are significant benefits from doing
7347 so.  When you specify these options, the assembler and linker will
7348 create larger object and executable files and will also be slower.
7349 You will not be able to use @code{gprof} on all systems if you
7350 specify this option and you may have problems with debugging if
7351 you specify both this option and @option{-g}.
7352
7353 @item -fbranch-target-load-optimize
7354 @opindex fbranch-target-load-optimize
7355 Perform branch target register load optimization before prologue / epilogue
7356 threading.
7357 The use of target registers can typically be exposed only during reload,
7358 thus hoisting loads out of loops and doing inter-block scheduling needs
7359 a separate optimization pass.
7360
7361 @item -fbranch-target-load-optimize2
7362 @opindex fbranch-target-load-optimize2
7363 Perform branch target register load optimization after prologue / epilogue
7364 threading.
7365
7366 @item -fbtr-bb-exclusive
7367 @opindex fbtr-bb-exclusive
7368 When performing branch target register load optimization, don't reuse
7369 branch target registers in within any basic block.
7370
7371 @item -fstack-protector
7372 @opindex fstack-protector
7373 Emit extra code to check for buffer overflows, such as stack smashing
7374 attacks.  This is done by adding a guard variable to functions with
7375 vulnerable objects.  This includes functions that call alloca, and
7376 functions with buffers larger than 8 bytes.  The guards are initialized
7377 when a function is entered and then checked when the function exits.
7378 If a guard check fails, an error message is printed and the program exits.
7379
7380 @item -fstack-protector-all
7381 @opindex fstack-protector-all
7382 Like @option{-fstack-protector} except that all functions are protected.
7383
7384 @item -fsection-anchors
7385 @opindex fsection-anchors
7386 Try to reduce the number of symbolic address calculations by using
7387 shared ``anchor'' symbols to address nearby objects.  This transformation
7388 can help to reduce the number of GOT entries and GOT accesses on some
7389 targets.
7390
7391 For example, the implementation of the following function @code{foo}:
7392
7393 @smallexample
7394 static int a, b, c;
7395 int foo (void) @{ return a + b + c; @}
7396 @end smallexample
7397
7398 would usually calculate the addresses of all three variables, but if you
7399 compile it with @option{-fsection-anchors}, it will access the variables
7400 from a common anchor point instead.  The effect is similar to the
7401 following pseudocode (which isn't valid C):
7402
7403 @smallexample
7404 int foo (void)
7405 @{
7406   register int *xr = &x;
7407   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
7408 @}
7409 @end smallexample
7410
7411 Not all targets support this option.
7412
7413 @item --param @var{name}=@var{value}
7414 @opindex param
7415 In some places, GCC uses various constants to control the amount of
7416 optimization that is done.  For example, GCC will not inline functions
7417 that contain more that a certain number of instructions.  You can
7418 control some of these constants on the command-line using the
7419 @option{--param} option.
7420
7421 The names of specific parameters, and the meaning of the values, are
7422 tied to the internals of the compiler, and are subject to change
7423 without notice in future releases.
7424
7425 In each case, the @var{value} is an integer.  The allowable choices for
7426 @var{name} are given in the following table:
7427
7428 @table @gcctabopt
7429 @item struct-reorg-cold-struct-ratio
7430 The threshold ratio (as a percentage) between a structure frequency
7431 and the frequency of the hottest structure in the program.  This parameter
7432 is used by struct-reorg optimization enabled by @option{-fipa-struct-reorg}.
7433 We say that if the ratio of a structure frequency, calculated by profiling, 
7434 to the hottest structure frequency in the program is less than this 
7435 parameter, then structure reorganization is not applied to this structure.
7436 The default is 10.
7437
7438 @item predictable-branch-cost-outcome
7439 When branch is predicted to be taken with probability lower than this threshold
7440 (in percent), then it is considered well predictable. The default is 10.
7441
7442 @item max-crossjump-edges
7443 The maximum number of incoming edges to consider for crossjumping.
7444 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
7445 the number of edges incoming to each block.  Increasing values mean
7446 more aggressive optimization, making the compile time increase with
7447 probably small improvement in executable size.
7448
7449 @item min-crossjump-insns
7450 The minimum number of instructions which must be matched at the end
7451 of two blocks before crossjumping will be performed on them.  This
7452 value is ignored in the case where all instructions in the block being
7453 crossjumped from are matched.  The default value is 5.
7454
7455 @item max-grow-copy-bb-insns
7456 The maximum code size expansion factor when copying basic blocks
7457 instead of jumping.  The expansion is relative to a jump instruction.
7458 The default value is 8.
7459
7460 @item max-goto-duplication-insns
7461 The maximum number of instructions to duplicate to a block that jumps
7462 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
7463 passes, GCC factors computed gotos early in the compilation process,
7464 and unfactors them as late as possible.  Only computed jumps at the
7465 end of a basic blocks with no more than max-goto-duplication-insns are
7466 unfactored.  The default value is 8.
7467
7468 @item max-delay-slot-insn-search
7469 The maximum number of instructions to consider when looking for an
7470 instruction to fill a delay slot.  If more than this arbitrary number of
7471 instructions is searched, the time savings from filling the delay slot
7472 will be minimal so stop searching.  Increasing values mean more
7473 aggressive optimization, making the compile time increase with probably
7474 small improvement in executable run time.
7475
7476 @item max-delay-slot-live-search
7477 When trying to fill delay slots, the maximum number of instructions to
7478 consider when searching for a block with valid live register
7479 information.  Increasing this arbitrarily chosen value means more
7480 aggressive optimization, increasing the compile time.  This parameter
7481 should be removed when the delay slot code is rewritten to maintain the
7482 control-flow graph.
7483
7484 @item max-gcse-memory
7485 The approximate maximum amount of memory that will be allocated in
7486 order to perform the global common subexpression elimination
7487 optimization.  If more memory than specified is required, the
7488 optimization will not be done.
7489
7490 @item max-pending-list-length
7491 The maximum number of pending dependencies scheduling will allow
7492 before flushing the current state and starting over.  Large functions
7493 with few branches or calls can create excessively large lists which
7494 needlessly consume memory and resources.
7495
7496 @item max-inline-insns-single
7497 Several parameters control the tree inliner used in gcc.
7498 This number sets the maximum number of instructions (counted in GCC's
7499 internal representation) in a single function that the tree inliner
7500 will consider for inlining.  This only affects functions declared
7501 inline and methods implemented in a class declaration (C++).
7502 The default value is 300.
7503
7504 @item max-inline-insns-auto
7505 When you use @option{-finline-functions} (included in @option{-O3}),
7506 a lot of functions that would otherwise not be considered for inlining
7507 by the compiler will be investigated.  To those functions, a different
7508 (more restrictive) limit compared to functions declared inline can
7509 be applied.
7510 The default value is 60.
7511
7512 @item large-function-insns
7513 The limit specifying really large functions.  For functions larger than this
7514 limit after inlining, inlining is constrained by
7515 @option{--param large-function-growth}.  This parameter is useful primarily
7516 to avoid extreme compilation time caused by non-linear algorithms used by the
7517 backend.
7518 The default value is 2700.
7519
7520 @item large-function-growth
7521 Specifies maximal growth of large function caused by inlining in percents.
7522 The default value is 100 which limits large function growth to 2.0 times
7523 the original size.
7524
7525 @item large-unit-insns
7526 The limit specifying large translation unit.  Growth caused by inlining of
7527 units larger than this limit is limited by @option{--param inline-unit-growth}.
7528 For small units this might be too tight (consider unit consisting of function A
7529 that is inline and B that just calls A three time.  If B is small relative to
7530 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
7531 large units consisting of small inlineable functions however the overall unit
7532 growth limit is needed to avoid exponential explosion of code size.  Thus for
7533 smaller units, the size is increased to @option{--param large-unit-insns}
7534 before applying @option{--param inline-unit-growth}.  The default is 10000
7535
7536 @item inline-unit-growth
7537 Specifies maximal overall growth of the compilation unit caused by inlining.
7538 The default value is 30 which limits unit growth to 1.3 times the original
7539 size.
7540
7541 @item ipcp-unit-growth
7542 Specifies maximal overall growth of the compilation unit caused by
7543 interprocedural constant propagation.  The default value is 10 which limits
7544 unit growth to 1.1 times the original size.
7545
7546 @item large-stack-frame
7547 The limit specifying large stack frames.  While inlining the algorithm is trying
7548 to not grow past this limit too much.  Default value is 256 bytes.
7549
7550 @item large-stack-frame-growth
7551 Specifies maximal growth of large stack frames caused by inlining in percents.
7552 The default value is 1000 which limits large stack frame growth to 11 times
7553 the original size.
7554
7555 @item max-inline-insns-recursive
7556 @itemx max-inline-insns-recursive-auto
7557 Specifies maximum number of instructions out-of-line copy of self recursive inline
7558 function can grow into by performing recursive inlining.
7559
7560 For functions declared inline @option{--param max-inline-insns-recursive} is
7561 taken into account.  For function not declared inline, recursive inlining
7562 happens only when @option{-finline-functions} (included in @option{-O3}) is
7563 enabled and @option{--param max-inline-insns-recursive-auto} is used.  The
7564 default value is 450.
7565
7566 @item max-inline-recursive-depth
7567 @itemx max-inline-recursive-depth-auto
7568 Specifies maximum recursion depth used by the recursive inlining.
7569
7570 For functions declared inline @option{--param max-inline-recursive-depth} is
7571 taken into account.  For function not declared inline, recursive inlining
7572 happens only when @option{-finline-functions} (included in @option{-O3}) is
7573 enabled and @option{--param max-inline-recursive-depth-auto} is used.  The
7574 default value is 8.
7575
7576 @item min-inline-recursive-probability
7577 Recursive inlining is profitable only for function having deep recursion
7578 in average and can hurt for function having little recursion depth by
7579 increasing the prologue size or complexity of function body to other
7580 optimizers.
7581
7582 When profile feedback is available (see @option{-fprofile-generate}) the actual
7583 recursion depth can be guessed from probability that function will recurse via
7584 given call expression.  This parameter limits inlining only to call expression
7585 whose probability exceeds given threshold (in percents).  The default value is
7586 10.
7587
7588 @item early-inlining-insns
7589 Specify growth that early inliner can make.  In effect it increases amount of
7590 inlining for code having large abstraction penalty.  The default value is 12.
7591
7592 @item max-early-inliner-iterations
7593 @itemx max-early-inliner-iterations
7594 Limit of iterations of early inliner.  This basically bounds number of nested
7595 indirect calls early inliner can resolve.  Deeper chains are still handled by
7596 late inlining.
7597
7598 @item min-vect-loop-bound
7599 The minimum number of iterations under which a loop will not get vectorized
7600 when @option{-ftree-vectorize} is used.  The number of iterations after
7601 vectorization needs to be greater than the value specified by this option
7602 to allow vectorization.  The default value is 0.
7603
7604 @item max-unrolled-insns
7605 The maximum number of instructions that a loop should have if that loop
7606 is unrolled, and if the loop is unrolled, it determines how many times
7607 the loop code is unrolled.
7608
7609 @item max-average-unrolled-insns
7610 The maximum number of instructions biased by probabilities of their execution
7611 that a loop should have if that loop is unrolled, and if the loop is unrolled,
7612 it determines how many times the loop code is unrolled.
7613
7614 @item max-unroll-times
7615 The maximum number of unrollings of a single loop.
7616
7617 @item max-peeled-insns
7618 The maximum number of instructions that a loop should have if that loop
7619 is peeled, and if the loop is peeled, it determines how many times
7620 the loop code is peeled.
7621
7622 @item max-peel-times
7623 The maximum number of peelings of a single loop.
7624
7625 @item max-completely-peeled-insns
7626 The maximum number of insns of a completely peeled loop.
7627
7628 @item max-completely-peel-times
7629 The maximum number of iterations of a loop to be suitable for complete peeling.
7630
7631 @item max-unswitch-insns
7632 The maximum number of insns of an unswitched loop.
7633
7634 @item max-unswitch-level
7635 The maximum number of branches unswitched in a single loop.
7636
7637 @item lim-expensive
7638 The minimum cost of an expensive expression in the loop invariant motion.
7639
7640 @item iv-consider-all-candidates-bound
7641 Bound on number of candidates for induction variables below that
7642 all candidates are considered for each use in induction variable
7643 optimizations.  Only the most relevant candidates are considered
7644 if there are more candidates, to avoid quadratic time complexity.
7645
7646 @item iv-max-considered-uses
7647 The induction variable optimizations give up on loops that contain more
7648 induction variable uses.
7649
7650 @item iv-always-prune-cand-set-bound
7651 If number of candidates in the set is smaller than this value,
7652 we always try to remove unnecessary ivs from the set during its
7653 optimization when a new iv is added to the set.
7654
7655 @item scev-max-expr-size
7656 Bound on size of expressions used in the scalar evolutions analyzer.
7657 Large expressions slow the analyzer.
7658
7659 @item omega-max-vars
7660 The maximum number of variables in an Omega constraint system.
7661 The default value is 128.
7662
7663 @item omega-max-geqs
7664 The maximum number of inequalities in an Omega constraint system.
7665 The default value is 256.
7666
7667 @item omega-max-eqs
7668 The maximum number of equalities in an Omega constraint system.
7669 The default value is 128.
7670
7671 @item omega-max-wild-cards
7672 The maximum number of wildcard variables that the Omega solver will
7673 be able to insert.  The default value is 18.
7674
7675 @item omega-hash-table-size
7676 The size of the hash table in the Omega solver.  The default value is
7677 550.
7678
7679 @item omega-max-keys
7680 The maximal number of keys used by the Omega solver.  The default
7681 value is 500.
7682
7683 @item omega-eliminate-redundant-constraints
7684 When set to 1, use expensive methods to eliminate all redundant
7685 constraints.  The default value is 0.
7686
7687 @item vect-max-version-for-alignment-checks
7688 The maximum number of runtime checks that can be performed when
7689 doing loop versioning for alignment in the vectorizer.  See option
7690 ftree-vect-loop-version for more information.
7691
7692 @item vect-max-version-for-alias-checks
7693 The maximum number of runtime checks that can be performed when
7694 doing loop versioning for alias in the vectorizer.  See option
7695 ftree-vect-loop-version for more information.
7696
7697 @item max-iterations-to-track
7698
7699 The maximum number of iterations of a loop the brute force algorithm
7700 for analysis of # of iterations of the loop tries to evaluate.
7701
7702 @item hot-bb-count-fraction
7703 Select fraction of the maximal count of repetitions of basic block in program
7704 given basic block needs to have to be considered hot.
7705
7706 @item hot-bb-frequency-fraction
7707 Select fraction of the maximal frequency of executions of basic block in
7708 function given basic block needs to have to be considered hot
7709
7710 @item max-predicted-iterations
7711 The maximum number of loop iterations we predict statically.  This is useful
7712 in cases where function contain single loop with known bound and other loop
7713 with unknown.  We predict the known number of iterations correctly, while
7714 the unknown number of iterations average to roughly 10.  This means that the
7715 loop without bounds would appear artificially cold relative to the other one.
7716
7717 @item align-threshold
7718
7719 Select fraction of the maximal frequency of executions of basic block in
7720 function given basic block will get aligned.
7721
7722 @item align-loop-iterations
7723
7724 A loop expected to iterate at lest the selected number of iterations will get
7725 aligned.
7726
7727 @item tracer-dynamic-coverage
7728 @itemx tracer-dynamic-coverage-feedback
7729
7730 This value is used to limit superblock formation once the given percentage of
7731 executed instructions is covered.  This limits unnecessary code size
7732 expansion.
7733
7734 The @option{tracer-dynamic-coverage-feedback} is used only when profile
7735 feedback is available.  The real profiles (as opposed to statically estimated
7736 ones) are much less balanced allowing the threshold to be larger value.
7737
7738 @item tracer-max-code-growth
7739 Stop tail duplication once code growth has reached given percentage.  This is
7740 rather hokey argument, as most of the duplicates will be eliminated later in
7741 cross jumping, so it may be set to much higher values than is the desired code
7742 growth.
7743
7744 @item tracer-min-branch-ratio
7745
7746 Stop reverse growth when the reverse probability of best edge is less than this
7747 threshold (in percent).
7748
7749 @item tracer-min-branch-ratio
7750 @itemx tracer-min-branch-ratio-feedback
7751
7752 Stop forward growth if the best edge do have probability lower than this
7753 threshold.
7754
7755 Similarly to @option{tracer-dynamic-coverage} two values are present, one for
7756 compilation for profile feedback and one for compilation without.  The value
7757 for compilation with profile feedback needs to be more conservative (higher) in
7758 order to make tracer effective.
7759
7760 @item max-cse-path-length
7761
7762 Maximum number of basic blocks on path that cse considers.  The default is 10.
7763
7764 @item max-cse-insns
7765 The maximum instructions CSE process before flushing. The default is 1000.
7766
7767 @item ggc-min-expand
7768
7769 GCC uses a garbage collector to manage its own memory allocation.  This
7770 parameter specifies the minimum percentage by which the garbage
7771 collector's heap should be allowed to expand between collections.
7772 Tuning this may improve compilation speed; it has no effect on code
7773 generation.
7774
7775 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
7776 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of "RAM" is
7777 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
7778 GCC is not able to calculate RAM on a particular platform, the lower
7779 bound of 30% is used.  Setting this parameter and
7780 @option{ggc-min-heapsize} to zero causes a full collection to occur at
7781 every opportunity.  This is extremely slow, but can be useful for
7782 debugging.
7783
7784 @item ggc-min-heapsize
7785
7786 Minimum size of the garbage collector's heap before it begins bothering
7787 to collect garbage.  The first collection occurs after the heap expands
7788 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
7789 tuning this may improve compilation speed, and has no effect on code
7790 generation.
7791
7792 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit which
7793 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
7794 with a lower bound of 4096 (four megabytes) and an upper bound of
7795 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
7796 particular platform, the lower bound is used.  Setting this parameter
7797 very large effectively disables garbage collection.  Setting this
7798 parameter and @option{ggc-min-expand} to zero causes a full collection
7799 to occur at every opportunity.
7800
7801 @item max-reload-search-insns
7802 The maximum number of instruction reload should look backward for equivalent
7803 register.  Increasing values mean more aggressive optimization, making the
7804 compile time increase with probably slightly better performance.  The default
7805 value is 100.
7806
7807 @item max-cselib-memory-locations
7808 The maximum number of memory locations cselib should take into account.
7809 Increasing values mean more aggressive optimization, making the compile time
7810 increase with probably slightly better performance.  The default value is 500.
7811
7812 @item reorder-blocks-duplicate
7813 @itemx reorder-blocks-duplicate-feedback
7814
7815 Used by basic block reordering pass to decide whether to use unconditional
7816 branch or duplicate the code on its destination.  Code is duplicated when its
7817 estimated size is smaller than this value multiplied by the estimated size of
7818 unconditional jump in the hot spots of the program.
7819
7820 The @option{reorder-block-duplicate-feedback} is used only when profile
7821 feedback is available and may be set to higher values than
7822 @option{reorder-block-duplicate} since information about the hot spots is more
7823 accurate.
7824
7825 @item max-sched-ready-insns
7826 The maximum number of instructions ready to be issued the scheduler should
7827 consider at any given time during the first scheduling pass.  Increasing
7828 values mean more thorough searches, making the compilation time increase
7829 with probably little benefit.  The default value is 100.
7830
7831 @item max-sched-region-blocks
7832 The maximum number of blocks in a region to be considered for
7833 interblock scheduling.  The default value is 10.
7834
7835 @item max-pipeline-region-blocks
7836 The maximum number of blocks in a region to be considered for
7837 pipelining in the selective scheduler.  The default value is 15.
7838
7839 @item max-sched-region-insns
7840 The maximum number of insns in a region to be considered for
7841 interblock scheduling.  The default value is 100.
7842
7843 @item max-pipeline-region-insns
7844 The maximum number of insns in a region to be considered for
7845 pipelining in the selective scheduler.  The default value is 200.
7846
7847 @item min-spec-prob
7848 The minimum probability (in percents) of reaching a source block
7849 for interblock speculative scheduling.  The default value is 40.
7850
7851 @item max-sched-extend-regions-iters
7852 The maximum number of iterations through CFG to extend regions.
7853 0 - disable region extension,
7854 N - do at most N iterations.
7855 The default value is 0.
7856
7857 @item max-sched-insn-conflict-delay
7858 The maximum conflict delay for an insn to be considered for speculative motion.
7859 The default value is 3.
7860
7861 @item sched-spec-prob-cutoff
7862 The minimal probability of speculation success (in percents), so that
7863 speculative insn will be scheduled.
7864 The default value is 40.
7865
7866 @item sched-mem-true-dep-cost
7867 Minimal distance (in CPU cycles) between store and load targeting same
7868 memory locations.  The default value is 1.
7869
7870 @item selsched-max-lookahead
7871 The maximum size of the lookahead window of selective scheduling.  It is a
7872 depth of search for available instructions.
7873 The default value is 50.
7874
7875 @item selsched-max-sched-times
7876 The maximum number of times that an instruction will be scheduled during 
7877 selective scheduling.  This is the limit on the number of iterations 
7878 through which the instruction may be pipelined.  The default value is 2.
7879
7880 @item selsched-max-insns-to-rename
7881 The maximum number of best instructions in the ready list that are considered
7882 for renaming in the selective scheduler.  The default value is 2.
7883
7884 @item max-last-value-rtl
7885 The maximum size measured as number of RTLs that can be recorded in an expression
7886 in combiner for a pseudo register as last known value of that register.  The default
7887 is 10000.
7888
7889 @item integer-share-limit
7890 Small integer constants can use a shared data structure, reducing the
7891 compiler's memory usage and increasing its speed.  This sets the maximum
7892 value of a shared integer constant.  The default value is 256.
7893
7894 @item min-virtual-mappings
7895 Specifies the minimum number of virtual mappings in the incremental
7896 SSA updater that should be registered to trigger the virtual mappings
7897 heuristic defined by virtual-mappings-ratio.  The default value is
7898 100.
7899
7900 @item virtual-mappings-ratio
7901 If the number of virtual mappings is virtual-mappings-ratio bigger
7902 than the number of virtual symbols to be updated, then the incremental
7903 SSA updater switches to a full update for those symbols.  The default
7904 ratio is 3.
7905
7906 @item ssp-buffer-size
7907 The minimum size of buffers (i.e.@: arrays) that will receive stack smashing
7908 protection when @option{-fstack-protection} is used.
7909
7910 @item max-jump-thread-duplication-stmts
7911 Maximum number of statements allowed in a block that needs to be
7912 duplicated when threading jumps.
7913
7914 @item max-fields-for-field-sensitive
7915 Maximum number of fields in a structure we will treat in
7916 a field sensitive manner during pointer analysis.  The default is zero
7917 for -O0, and -O1 and 100 for -Os, -O2, and -O3.
7918
7919 @item prefetch-latency
7920 Estimate on average number of instructions that are executed before
7921 prefetch finishes.  The distance we prefetch ahead is proportional
7922 to this constant.  Increasing this number may also lead to less
7923 streams being prefetched (see @option{simultaneous-prefetches}).
7924
7925 @item simultaneous-prefetches
7926 Maximum number of prefetches that can run at the same time.
7927
7928 @item l1-cache-line-size
7929 The size of cache line in L1 cache, in bytes.
7930
7931 @item l1-cache-size
7932 The size of L1 cache, in kilobytes.
7933
7934 @item l2-cache-size
7935 The size of L2 cache, in kilobytes.
7936
7937 @item min-insn-to-prefetch-ratio
7938 The minimum ratio between the number of instructions and the 
7939 number of prefetches to enable prefetching in a loop with an 
7940 unknown trip count.
7941
7942 @item prefetch-min-insn-to-mem-ratio
7943 The minimum ratio between the number of instructions and the 
7944 number of memory references to enable prefetching in a loop.
7945
7946 @item use-canonical-types
7947 Whether the compiler should use the ``canonical'' type system.  By
7948 default, this should always be 1, which uses a more efficient internal
7949 mechanism for comparing types in C++ and Objective-C++.  However, if
7950 bugs in the canonical type system are causing compilation failures,
7951 set this value to 0 to disable canonical types.
7952
7953 @item switch-conversion-max-branch-ratio
7954 Switch initialization conversion will refuse to create arrays that are
7955 bigger than @option{switch-conversion-max-branch-ratio} times the number of
7956 branches in the switch.
7957
7958 @item max-partial-antic-length
7959 Maximum length of the partial antic set computed during the tree
7960 partial redundancy elimination optimization (@option{-ftree-pre}) when
7961 optimizing at @option{-O3} and above.  For some sorts of source code
7962 the enhanced partial redundancy elimination optimization can run away,
7963 consuming all of the memory available on the host machine.  This
7964 parameter sets a limit on the length of the sets that are computed,
7965 which prevents the runaway behavior.  Setting a value of 0 for
7966 this parameter will allow an unlimited set length.
7967
7968 @item sccvn-max-scc-size
7969 Maximum size of a strongly connected component (SCC) during SCCVN
7970 processing.  If this limit is hit, SCCVN processing for the whole
7971 function will not be done and optimizations depending on it will
7972 be disabled.  The default maximum SCC size is 10000.
7973
7974 @item ira-max-loops-num
7975 IRA uses a regional register allocation by default.  If a function
7976 contains loops more than number given by the parameter, only at most
7977 given number of the most frequently executed loops will form regions
7978 for the regional register allocation.  The default value of the
7979 parameter is 100.
7980
7981 @item ira-max-conflict-table-size
7982 Although IRA uses a sophisticated algorithm of compression conflict
7983 table, the table can be still big for huge functions.  If the conflict
7984 table for a function could be more than size in MB given by the
7985 parameter, the conflict table is not built and faster, simpler, and
7986 lower quality register allocation algorithm will be used.  The
7987 algorithm do not use pseudo-register conflicts.  The default value of
7988 the parameter is 2000.
7989
7990 @item loop-invariant-max-bbs-in-loop
7991 Loop invariant motion can be very expensive, both in compile time and
7992 in amount of needed compile time memory, with very large loops.  Loops
7993 with more basic blocks than this parameter won't have loop invariant
7994 motion optimization performed on them.  The default value of the
7995 parameter is 1000 for -O1 and 10000 for -O2 and above.
7996
7997 @end table
7998 @end table
7999
8000 @node Preprocessor Options
8001 @section Options Controlling the Preprocessor
8002 @cindex preprocessor options
8003 @cindex options, preprocessor
8004
8005 These options control the C preprocessor, which is run on each C source
8006 file before actual compilation.
8007
8008 If you use the @option{-E} option, nothing is done except preprocessing.
8009 Some of these options make sense only together with @option{-E} because
8010 they cause the preprocessor output to be unsuitable for actual
8011 compilation.
8012
8013 @table @gcctabopt
8014 @item -Wp,@var{option}
8015 @opindex Wp
8016 You can use @option{-Wp,@var{option}} to bypass the compiler driver
8017 and pass @var{option} directly through to the preprocessor.  If
8018 @var{option} contains commas, it is split into multiple options at the
8019 commas.  However, many options are modified, translated or interpreted
8020 by the compiler driver before being passed to the preprocessor, and
8021 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
8022 interface is undocumented and subject to change, so whenever possible
8023 you should avoid using @option{-Wp} and let the driver handle the
8024 options instead.
8025
8026 @item -Xpreprocessor @var{option}
8027 @opindex Xpreprocessor
8028 Pass @var{option} as an option to the preprocessor.  You can use this to
8029 supply system-specific preprocessor options which GCC does not know how to
8030 recognize.
8031
8032 If you want to pass an option that takes an argument, you must use
8033 @option{-Xpreprocessor} twice, once for the option and once for the argument.
8034 @end table
8035
8036 @include cppopts.texi
8037
8038 @node Assembler Options
8039 @section Passing Options to the Assembler
8040
8041 @c prevent bad page break with this line
8042 You can pass options to the assembler.
8043
8044 @table @gcctabopt
8045 @item -Wa,@var{option}
8046 @opindex Wa
8047 Pass @var{option} as an option to the assembler.  If @var{option}
8048 contains commas, it is split into multiple options at the commas.
8049
8050 @item -Xassembler @var{option}
8051 @opindex Xassembler
8052 Pass @var{option} as an option to the assembler.  You can use this to
8053 supply system-specific assembler options which GCC does not know how to
8054 recognize.
8055
8056 If you want to pass an option that takes an argument, you must use
8057 @option{-Xassembler} twice, once for the option and once for the argument.
8058
8059 @end table
8060
8061 @node Link Options
8062 @section Options for Linking
8063 @cindex link options
8064 @cindex options, linking
8065
8066 These options come into play when the compiler links object files into
8067 an executable output file.  They are meaningless if the compiler is
8068 not doing a link step.
8069
8070 @table @gcctabopt
8071 @cindex file names
8072 @item @var{object-file-name}
8073 A file name that does not end in a special recognized suffix is
8074 considered to name an object file or library.  (Object files are
8075 distinguished from libraries by the linker according to the file
8076 contents.)  If linking is done, these object files are used as input
8077 to the linker.
8078
8079 @item -c
8080 @itemx -S
8081 @itemx -E
8082 @opindex c
8083 @opindex S
8084 @opindex E
8085 If any of these options is used, then the linker is not run, and
8086 object file names should not be used as arguments.  @xref{Overall
8087 Options}.
8088
8089 @cindex Libraries
8090 @item -l@var{library}
8091 @itemx -l @var{library}
8092 @opindex l
8093 Search the library named @var{library} when linking.  (The second
8094 alternative with the library as a separate argument is only for
8095 POSIX compliance and is not recommended.)
8096
8097 It makes a difference where in the command you write this option; the
8098 linker searches and processes libraries and object files in the order they
8099 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
8100 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
8101 to functions in @samp{z}, those functions may not be loaded.
8102
8103 The linker searches a standard list of directories for the library,
8104 which is actually a file named @file{lib@var{library}.a}.  The linker
8105 then uses this file as if it had been specified precisely by name.
8106
8107 The directories searched include several standard system directories
8108 plus any that you specify with @option{-L}.
8109
8110 Normally the files found this way are library files---archive files
8111 whose members are object files.  The linker handles an archive file by
8112 scanning through it for members which define symbols that have so far
8113 been referenced but not defined.  But if the file that is found is an
8114 ordinary object file, it is linked in the usual fashion.  The only
8115 difference between using an @option{-l} option and specifying a file name
8116 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
8117 and searches several directories.
8118
8119 @item -lobjc
8120 @opindex lobjc
8121 You need this special case of the @option{-l} option in order to
8122 link an Objective-C or Objective-C++ program.
8123
8124 @item -nostartfiles
8125 @opindex nostartfiles
8126 Do not use the standard system startup files when linking.
8127 The standard system libraries are used normally, unless @option{-nostdlib}
8128 or @option{-nodefaultlibs} is used.
8129
8130 @item -nodefaultlibs
8131 @opindex nodefaultlibs
8132 Do not use the standard system libraries when linking.
8133 Only the libraries you specify will be passed to the linker, options
8134 specifying linkage of the system libraries, such as @code{-static-libgcc}
8135 or @code{-shared-libgcc}, will be ignored.
8136 The standard startup files are used normally, unless @option{-nostartfiles}
8137 is used.  The compiler may generate calls to @code{memcmp},
8138 @code{memset}, @code{memcpy} and @code{memmove}.
8139 These entries are usually resolved by entries in
8140 libc.  These entry points should be supplied through some other
8141 mechanism when this option is specified.
8142
8143 @item -nostdlib
8144 @opindex nostdlib
8145 Do not use the standard system startup files or libraries when linking.
8146 No startup files and only the libraries you specify will be passed to
8147 the linker, options specifying linkage of the system libraries, such as
8148 @code{-static-libgcc} or @code{-shared-libgcc}, will be ignored.
8149 The compiler may generate calls to @code{memcmp}, @code{memset},
8150 @code{memcpy} and @code{memmove}.
8151 These entries are usually resolved by entries in
8152 libc.  These entry points should be supplied through some other
8153 mechanism when this option is specified.
8154
8155 @cindex @option{-lgcc}, use with @option{-nostdlib}
8156 @cindex @option{-nostdlib} and unresolved references
8157 @cindex unresolved references and @option{-nostdlib}
8158 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
8159 @cindex @option{-nodefaultlibs} and unresolved references
8160 @cindex unresolved references and @option{-nodefaultlibs}
8161 One of the standard libraries bypassed by @option{-nostdlib} and
8162 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
8163 that GCC uses to overcome shortcomings of particular machines, or special
8164 needs for some languages.
8165 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
8166 Collection (GCC) Internals},
8167 for more discussion of @file{libgcc.a}.)
8168 In most cases, you need @file{libgcc.a} even when you want to avoid
8169 other standard libraries.  In other words, when you specify @option{-nostdlib}
8170 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
8171 This ensures that you have no unresolved references to internal GCC
8172 library subroutines.  (For example, @samp{__main}, used to ensure C++
8173 constructors will be called; @pxref{Collect2,,@code{collect2}, gccint,
8174 GNU Compiler Collection (GCC) Internals}.)
8175
8176 @item -pie
8177 @opindex pie
8178 Produce a position independent executable on targets which support it.
8179 For predictable results, you must also specify the same set of options
8180 that were used to generate code (@option{-fpie}, @option{-fPIE},
8181 or model suboptions) when you specify this option.
8182
8183 @item -rdynamic
8184 @opindex rdynamic
8185 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
8186 that support it. This instructs the linker to add all symbols, not
8187 only used ones, to the dynamic symbol table. This option is needed
8188 for some uses of @code{dlopen} or to allow obtaining backtraces
8189 from within a program.
8190
8191 @item -s
8192 @opindex s
8193 Remove all symbol table and relocation information from the executable.
8194
8195 @item -static
8196 @opindex static
8197 On systems that support dynamic linking, this prevents linking with the shared
8198 libraries.  On other systems, this option has no effect.
8199
8200 @item -shared
8201 @opindex shared
8202 Produce a shared object which can then be linked with other objects to
8203 form an executable.  Not all systems support this option.  For predictable
8204 results, you must also specify the same set of options that were used to
8205 generate code (@option{-fpic}, @option{-fPIC}, or model suboptions)
8206 when you specify this option.@footnote{On some systems, @samp{gcc -shared}
8207 needs to build supplementary stub code for constructors to work.  On
8208 multi-libbed systems, @samp{gcc -shared} must select the correct support
8209 libraries to link against.  Failing to supply the correct flags may lead
8210 to subtle defects.  Supplying them in cases where they are not necessary
8211 is innocuous.}
8212
8213 @item -shared-libgcc
8214 @itemx -static-libgcc
8215 @opindex shared-libgcc
8216 @opindex static-libgcc
8217 On systems that provide @file{libgcc} as a shared library, these options
8218 force the use of either the shared or static version respectively.
8219 If no shared version of @file{libgcc} was built when the compiler was
8220 configured, these options have no effect.
8221
8222 There are several situations in which an application should use the
8223 shared @file{libgcc} instead of the static version.  The most common
8224 of these is when the application wishes to throw and catch exceptions
8225 across different shared libraries.  In that case, each of the libraries
8226 as well as the application itself should use the shared @file{libgcc}.
8227
8228 Therefore, the G++ and GCJ drivers automatically add
8229 @option{-shared-libgcc} whenever you build a shared library or a main
8230 executable, because C++ and Java programs typically use exceptions, so
8231 this is the right thing to do.
8232
8233 If, instead, you use the GCC driver to create shared libraries, you may
8234 find that they will not always be linked with the shared @file{libgcc}.
8235 If GCC finds, at its configuration time, that you have a non-GNU linker
8236 or a GNU linker that does not support option @option{--eh-frame-hdr},
8237 it will link the shared version of @file{libgcc} into shared libraries
8238 by default.  Otherwise, it will take advantage of the linker and optimize
8239 away the linking with the shared version of @file{libgcc}, linking with
8240 the static version of libgcc by default.  This allows exceptions to
8241 propagate through such shared libraries, without incurring relocation
8242 costs at library load time.
8243
8244 However, if a library or main executable is supposed to throw or catch
8245 exceptions, you must link it using the G++ or GCJ driver, as appropriate
8246 for the languages used in the program, or using the option
8247 @option{-shared-libgcc}, such that it is linked with the shared
8248 @file{libgcc}.
8249
8250 @item -static-libstdc++
8251 When the @command{g++} program is used to link a C++ program, it will
8252 normally automatically link against @option{libstdc++}.  If
8253 @file{libstdc++} is available as a shared library, and the
8254 @option{-static} option is not used, then this will link against the
8255 shared version of @file{libstdc++}.  That is normally fine.  However, it
8256 is sometimes useful to freeze the version of @file{libstdc++} used by
8257 the program without going all the way to a fully static link.  The
8258 @option{-static-libstdc++} option directs the @command{g++} driver to
8259 link @file{libstdc++} statically, without necessarily linking other
8260 libraries statically.
8261
8262 @item -symbolic
8263 @opindex symbolic
8264 Bind references to global symbols when building a shared object.  Warn
8265 about any unresolved references (unless overridden by the link editor
8266 option @samp{-Xlinker -z -Xlinker defs}).  Only a few systems support
8267 this option.
8268
8269 @item -T @var{script}
8270 @opindex T
8271 @cindex linker script
8272 Use @var{script} as the linker script.  This option is supported by most
8273 systems using the GNU linker.  On some targets, such as bare-board
8274 targets without an operating system, the @option{-T} option may be required 
8275 when linking to avoid references to undefined symbols.
8276
8277 @item -Xlinker @var{option}
8278 @opindex Xlinker
8279 Pass @var{option} as an option to the linker.  You can use this to
8280 supply system-specific linker options which GCC does not know how to
8281 recognize.
8282
8283 If you want to pass an option that takes a separate argument, you must use
8284 @option{-Xlinker} twice, once for the option and once for the argument.
8285 For example, to pass @option{-assert definitions}, you must write
8286 @samp{-Xlinker -assert -Xlinker definitions}.  It does not work to write
8287 @option{-Xlinker "-assert definitions"}, because this passes the entire
8288 string as a single argument, which is not what the linker expects.
8289
8290 When using the GNU linker, it is usually more convenient to pass 
8291 arguments to linker options using the @option{@var{option}=@var{value}}
8292 syntax than as separate arguments.  For example, you can specify
8293 @samp{-Xlinker -Map=output.map} rather than
8294 @samp{-Xlinker -Map -Xlinker output.map}.  Other linkers may not support
8295 this syntax for command-line options.
8296
8297 @item -Wl,@var{option}
8298 @opindex Wl
8299 Pass @var{option} as an option to the linker.  If @var{option} contains
8300 commas, it is split into multiple options at the commas.  You can use this
8301 syntax to pass an argument to the option.  
8302 For example, @samp{-Wl,-Map,output.map} passes @samp{-Map output.map} to the
8303 linker.  When using the GNU linker, you can also get the same effect with
8304 @samp{-Wl,-Map=output.map}.
8305
8306 @item -u @var{symbol}
8307 @opindex u
8308 Pretend the symbol @var{symbol} is undefined, to force linking of
8309 library modules to define it.  You can use @option{-u} multiple times with
8310 different symbols to force loading of additional library modules.
8311 @end table
8312
8313 @node Directory Options
8314 @section Options for Directory Search
8315 @cindex directory options
8316 @cindex options, directory search
8317 @cindex search path
8318
8319 These options specify directories to search for header files, for
8320 libraries and for parts of the compiler:
8321
8322 @table @gcctabopt
8323 @item -I@var{dir}
8324 @opindex I
8325 Add the directory @var{dir} to the head of the list of directories to be
8326 searched for header files.  This can be used to override a system header
8327 file, substituting your own version, since these directories are
8328 searched before the system header file directories.  However, you should
8329 not use this option to add directories that contain vendor-supplied
8330 system header files (use @option{-isystem} for that).  If you use more than
8331 one @option{-I} option, the directories are scanned in left-to-right
8332 order; the standard system directories come after.
8333
8334 If a standard system include directory, or a directory specified with
8335 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
8336 option will be ignored.  The directory will still be searched but as a
8337 system directory at its normal position in the system include chain.
8338 This is to ensure that GCC's procedure to fix buggy system headers and
8339 the ordering for the include_next directive are not inadvertently changed.
8340 If you really need to change the search order for system directories,
8341 use the @option{-nostdinc} and/or @option{-isystem} options.
8342
8343 @item -iquote@var{dir}
8344 @opindex iquote
8345 Add the directory @var{dir} to the head of the list of directories to
8346 be searched for header files only for the case of @samp{#include
8347 "@var{file}"}; they are not searched for @samp{#include <@var{file}>},
8348 otherwise just like @option{-I}.
8349
8350 @item -L@var{dir}
8351 @opindex L
8352 Add directory @var{dir} to the list of directories to be searched
8353 for @option{-l}.
8354
8355 @item -B@var{prefix}
8356 @opindex B
8357 This option specifies where to find the executables, libraries,
8358 include files, and data files of the compiler itself.
8359
8360 The compiler driver program runs one or more of the subprograms
8361 @file{cpp}, @file{cc1}, @file{as} and @file{ld}.  It tries
8362 @var{prefix} as a prefix for each program it tries to run, both with and
8363 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
8364
8365 For each subprogram to be run, the compiler driver first tries the
8366 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
8367 was not specified, the driver tries two standard prefixes, which are
8368 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
8369 those results in a file name that is found, the unmodified program
8370 name is searched for using the directories specified in your
8371 @env{PATH} environment variable.
8372
8373 The compiler will check to see if the path provided by the @option{-B}
8374 refers to a directory, and if necessary it will add a directory
8375 separator character at the end of the path.
8376
8377 @option{-B} prefixes that effectively specify directory names also apply
8378 to libraries in the linker, because the compiler translates these
8379 options into @option{-L} options for the linker.  They also apply to
8380 includes files in the preprocessor, because the compiler translates these
8381 options into @option{-isystem} options for the preprocessor.  In this case,
8382 the compiler appends @samp{include} to the prefix.
8383
8384 The run-time support file @file{libgcc.a} can also be searched for using
8385 the @option{-B} prefix, if needed.  If it is not found there, the two
8386 standard prefixes above are tried, and that is all.  The file is left
8387 out of the link if it is not found by those means.
8388
8389 Another way to specify a prefix much like the @option{-B} prefix is to use
8390 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
8391 Variables}.
8392
8393 As a special kludge, if the path provided by @option{-B} is
8394 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
8395 9, then it will be replaced by @file{[dir/]include}.  This is to help
8396 with boot-strapping the compiler.
8397
8398 @item -specs=@var{file}
8399 @opindex specs
8400 Process @var{file} after the compiler reads in the standard @file{specs}
8401 file, in order to override the defaults that the @file{gcc} driver
8402 program uses when determining what switches to pass to @file{cc1},
8403 @file{cc1plus}, @file{as}, @file{ld}, etc.  More than one
8404 @option{-specs=@var{file}} can be specified on the command line, and they
8405 are processed in order, from left to right.
8406
8407 @item --sysroot=@var{dir}
8408 @opindex sysroot
8409 Use @var{dir} as the logical root directory for headers and libraries.
8410 For example, if the compiler would normally search for headers in
8411 @file{/usr/include} and libraries in @file{/usr/lib}, it will instead
8412 search @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
8413
8414 If you use both this option and the @option{-isysroot} option, then
8415 the @option{--sysroot} option will apply to libraries, but the
8416 @option{-isysroot} option will apply to header files.
8417
8418 The GNU linker (beginning with version 2.16) has the necessary support
8419 for this option.  If your linker does not support this option, the
8420 header file aspect of @option{--sysroot} will still work, but the
8421 library aspect will not.
8422
8423 @item -I-
8424 @opindex I-
8425 This option has been deprecated.  Please use @option{-iquote} instead for
8426 @option{-I} directories before the @option{-I-} and remove the @option{-I-}.
8427 Any directories you specify with @option{-I} options before the @option{-I-}
8428 option are searched only for the case of @samp{#include "@var{file}"};
8429 they are not searched for @samp{#include <@var{file}>}.
8430
8431 If additional directories are specified with @option{-I} options after
8432 the @option{-I-}, these directories are searched for all @samp{#include}
8433 directives.  (Ordinarily @emph{all} @option{-I} directories are used
8434 this way.)
8435
8436 In addition, the @option{-I-} option inhibits the use of the current
8437 directory (where the current input file came from) as the first search
8438 directory for @samp{#include "@var{file}"}.  There is no way to
8439 override this effect of @option{-I-}.  With @option{-I.} you can specify
8440 searching the directory which was current when the compiler was
8441 invoked.  That is not exactly the same as what the preprocessor does
8442 by default, but it is often satisfactory.
8443
8444 @option{-I-} does not inhibit the use of the standard system directories
8445 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
8446 independent.
8447 @end table
8448
8449 @c man end
8450
8451 @node Spec Files
8452 @section Specifying subprocesses and the switches to pass to them
8453 @cindex Spec Files
8454
8455 @command{gcc} is a driver program.  It performs its job by invoking a
8456 sequence of other programs to do the work of compiling, assembling and
8457 linking.  GCC interprets its command-line parameters and uses these to
8458 deduce which programs it should invoke, and which command-line options
8459 it ought to place on their command lines.  This behavior is controlled
8460 by @dfn{spec strings}.  In most cases there is one spec string for each
8461 program that GCC can invoke, but a few programs have multiple spec
8462 strings to control their behavior.  The spec strings built into GCC can
8463 be overridden by using the @option{-specs=} command-line switch to specify
8464 a spec file.
8465
8466 @dfn{Spec files} are plaintext files that are used to construct spec
8467 strings.  They consist of a sequence of directives separated by blank
8468 lines.  The type of directive is determined by the first non-whitespace
8469 character on the line and it can be one of the following:
8470
8471 @table @code
8472 @item %@var{command}
8473 Issues a @var{command} to the spec file processor.  The commands that can
8474 appear here are:
8475
8476 @table @code
8477 @item %include <@var{file}>
8478 @cindex %include
8479 Search for @var{file} and insert its text at the current point in the
8480 specs file.
8481
8482 @item %include_noerr <@var{file}>
8483 @cindex %include_noerr
8484 Just like @samp{%include}, but do not generate an error message if the include
8485 file cannot be found.
8486
8487 @item %rename @var{old_name} @var{new_name}
8488 @cindex %rename
8489 Rename the spec string @var{old_name} to @var{new_name}.
8490
8491 @end table
8492
8493 @item *[@var{spec_name}]:
8494 This tells the compiler to create, override or delete the named spec
8495 string.  All lines after this directive up to the next directive or
8496 blank line are considered to be the text for the spec string.  If this
8497 results in an empty string then the spec will be deleted.  (Or, if the
8498 spec did not exist, then nothing will happened.)  Otherwise, if the spec
8499 does not currently exist a new spec will be created.  If the spec does
8500 exist then its contents will be overridden by the text of this
8501 directive, unless the first character of that text is the @samp{+}
8502 character, in which case the text will be appended to the spec.
8503
8504 @item [@var{suffix}]:
8505 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
8506 and up to the next directive or blank line are considered to make up the
8507 spec string for the indicated suffix.  When the compiler encounters an
8508 input file with the named suffix, it will processes the spec string in
8509 order to work out how to compile that file.  For example:
8510
8511 @smallexample
8512 .ZZ:
8513 z-compile -input %i
8514 @end smallexample
8515
8516 This says that any input file whose name ends in @samp{.ZZ} should be
8517 passed to the program @samp{z-compile}, which should be invoked with the
8518 command-line switch @option{-input} and with the result of performing the
8519 @samp{%i} substitution.  (See below.)
8520
8521 As an alternative to providing a spec string, the text that follows a
8522 suffix directive can be one of the following:
8523
8524 @table @code
8525 @item @@@var{language}
8526 This says that the suffix is an alias for a known @var{language}.  This is
8527 similar to using the @option{-x} command-line switch to GCC to specify a
8528 language explicitly.  For example:
8529
8530 @smallexample
8531 .ZZ:
8532 @@c++
8533 @end smallexample
8534
8535 Says that .ZZ files are, in fact, C++ source files.
8536
8537 @item #@var{name}
8538 This causes an error messages saying:
8539
8540 @smallexample
8541 @var{name} compiler not installed on this system.
8542 @end smallexample
8543 @end table
8544
8545 GCC already has an extensive list of suffixes built into it.
8546 This directive will add an entry to the end of the list of suffixes, but
8547 since the list is searched from the end backwards, it is effectively
8548 possible to override earlier entries using this technique.
8549
8550 @end table
8551
8552 GCC has the following spec strings built into it.  Spec files can
8553 override these strings or create their own.  Note that individual
8554 targets can also add their own spec strings to this list.
8555
8556 @smallexample
8557 asm          Options to pass to the assembler
8558 asm_final    Options to pass to the assembler post-processor
8559 cpp          Options to pass to the C preprocessor
8560 cc1          Options to pass to the C compiler
8561 cc1plus      Options to pass to the C++ compiler
8562 endfile      Object files to include at the end of the link
8563 link         Options to pass to the linker
8564 lib          Libraries to include on the command line to the linker
8565 libgcc       Decides which GCC support library to pass to the linker
8566 linker       Sets the name of the linker
8567 predefines   Defines to be passed to the C preprocessor
8568 signed_char  Defines to pass to CPP to say whether @code{char} is signed
8569              by default
8570 startfile    Object files to include at the start of the link
8571 @end smallexample
8572
8573 Here is a small example of a spec file:
8574
8575 @smallexample
8576 %rename lib                 old_lib
8577
8578 *lib:
8579 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
8580 @end smallexample
8581
8582 This example renames the spec called @samp{lib} to @samp{old_lib} and
8583 then overrides the previous definition of @samp{lib} with a new one.
8584 The new definition adds in some extra command-line options before
8585 including the text of the old definition.
8586
8587 @dfn{Spec strings} are a list of command-line options to be passed to their
8588 corresponding program.  In addition, the spec strings can contain
8589 @samp{%}-prefixed sequences to substitute variable text or to
8590 conditionally insert text into the command line.  Using these constructs
8591 it is possible to generate quite complex command lines.
8592
8593 Here is a table of all defined @samp{%}-sequences for spec
8594 strings.  Note that spaces are not generated automatically around the
8595 results of expanding these sequences.  Therefore you can concatenate them
8596 together or combine them with constant text in a single argument.
8597
8598 @table @code
8599 @item %%
8600 Substitute one @samp{%} into the program name or argument.
8601
8602 @item %i
8603 Substitute the name of the input file being processed.
8604
8605 @item %b
8606 Substitute the basename of the input file being processed.
8607 This is the substring up to (and not including) the last period
8608 and not including the directory.
8609
8610 @item %B
8611 This is the same as @samp{%b}, but include the file suffix (text after
8612 the last period).
8613
8614 @item %d
8615 Marks the argument containing or following the @samp{%d} as a
8616 temporary file name, so that that file will be deleted if GCC exits
8617 successfully.  Unlike @samp{%g}, this contributes no text to the
8618 argument.
8619
8620 @item %g@var{suffix}
8621 Substitute a file name that has suffix @var{suffix} and is chosen
8622 once per compilation, and mark the argument in the same way as
8623 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
8624 name is now chosen in a way that is hard to predict even when previously
8625 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
8626 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
8627 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
8628 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
8629 was simply substituted with a file name chosen once per compilation,
8630 without regard to any appended suffix (which was therefore treated
8631 just like ordinary text), making such attacks more likely to succeed.
8632
8633 @item %u@var{suffix}
8634 Like @samp{%g}, but generates a new temporary file name even if
8635 @samp{%u@var{suffix}} was already seen.
8636
8637 @item %U@var{suffix}
8638 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
8639 new one if there is no such last file name.  In the absence of any
8640 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
8641 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
8642 would involve the generation of two distinct file names, one
8643 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
8644 simply substituted with a file name chosen for the previous @samp{%u},
8645 without regard to any appended suffix.
8646
8647 @item %j@var{suffix}
8648 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
8649 writable, and if save-temps is off; otherwise, substitute the name
8650 of a temporary file, just like @samp{%u}.  This temporary file is not
8651 meant for communication between processes, but rather as a junk
8652 disposal mechanism.
8653
8654 @item %|@var{suffix}
8655 @itemx %m@var{suffix}
8656 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
8657 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
8658 all.  These are the two most common ways to instruct a program that it
8659 should read from standard input or write to standard output.  If you
8660 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
8661 construct: see for example @file{f/lang-specs.h}.
8662
8663 @item %.@var{SUFFIX}
8664 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
8665 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
8666 terminated by the next space or %.
8667
8668 @item %w
8669 Marks the argument containing or following the @samp{%w} as the
8670 designated output file of this compilation.  This puts the argument
8671 into the sequence of arguments that @samp{%o} will substitute later.
8672
8673 @item %o
8674 Substitutes the names of all the output files, with spaces
8675 automatically placed around them.  You should write spaces
8676 around the @samp{%o} as well or the results are undefined.
8677 @samp{%o} is for use in the specs for running the linker.
8678 Input files whose names have no recognized suffix are not compiled
8679 at all, but they are included among the output files, so they will
8680 be linked.
8681
8682 @item %O
8683 Substitutes the suffix for object files.  Note that this is
8684 handled specially when it immediately follows @samp{%g, %u, or %U},
8685 because of the need for those to form complete file names.  The
8686 handling is such that @samp{%O} is treated exactly as if it had already
8687 been substituted, except that @samp{%g, %u, and %U} do not currently
8688 support additional @var{suffix} characters following @samp{%O} as they would
8689 following, for example, @samp{.o}.
8690
8691 @item %p
8692 Substitutes the standard macro predefinitions for the
8693 current target machine.  Use this when running @code{cpp}.
8694
8695 @item %P
8696 Like @samp{%p}, but puts @samp{__} before and after the name of each
8697 predefined macro, except for macros that start with @samp{__} or with
8698 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
8699 C@.
8700
8701 @item %I
8702 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
8703 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
8704 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
8705 and @option{-imultilib} as necessary.
8706
8707 @item %s
8708 Current argument is the name of a library or startup file of some sort.
8709 Search for that file in a standard list of directories and substitute
8710 the full name found.
8711
8712 @item %e@var{str}
8713 Print @var{str} as an error message.  @var{str} is terminated by a newline.
8714 Use this when inconsistent options are detected.
8715
8716 @item %(@var{name})
8717 Substitute the contents of spec string @var{name} at this point.
8718
8719 @item %[@var{name}]
8720 Like @samp{%(@dots{})} but put @samp{__} around @option{-D} arguments.
8721
8722 @item %x@{@var{option}@}
8723 Accumulate an option for @samp{%X}.
8724
8725 @item %X
8726 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
8727 spec string.
8728
8729 @item %Y
8730 Output the accumulated assembler options specified by @option{-Wa}.
8731
8732 @item %Z
8733 Output the accumulated preprocessor options specified by @option{-Wp}.
8734
8735 @item %a
8736 Process the @code{asm} spec.  This is used to compute the
8737 switches to be passed to the assembler.
8738
8739 @item %A
8740 Process the @code{asm_final} spec.  This is a spec string for
8741 passing switches to an assembler post-processor, if such a program is
8742 needed.
8743
8744 @item %l
8745 Process the @code{link} spec.  This is the spec for computing the
8746 command line passed to the linker.  Typically it will make use of the
8747 @samp{%L %G %S %D and %E} sequences.
8748
8749 @item %D
8750 Dump out a @option{-L} option for each directory that GCC believes might
8751 contain startup files.  If the target supports multilibs then the
8752 current multilib directory will be prepended to each of these paths.
8753
8754 @item %L
8755 Process the @code{lib} spec.  This is a spec string for deciding which
8756 libraries should be included on the command line to the linker.
8757
8758 @item %G
8759 Process the @code{libgcc} spec.  This is a spec string for deciding
8760 which GCC support library should be included on the command line to the linker.
8761
8762 @item %S
8763 Process the @code{startfile} spec.  This is a spec for deciding which
8764 object files should be the first ones passed to the linker.  Typically
8765 this might be a file named @file{crt0.o}.
8766
8767 @item %E
8768 Process the @code{endfile} spec.  This is a spec string that specifies
8769 the last object files that will be passed to the linker.
8770
8771 @item %C
8772 Process the @code{cpp} spec.  This is used to construct the arguments
8773 to be passed to the C preprocessor.
8774
8775 @item %1
8776 Process the @code{cc1} spec.  This is used to construct the options to be
8777 passed to the actual C compiler (@samp{cc1}).
8778
8779 @item %2
8780 Process the @code{cc1plus} spec.  This is used to construct the options to be
8781 passed to the actual C++ compiler (@samp{cc1plus}).
8782
8783 @item %*
8784 Substitute the variable part of a matched option.  See below.
8785 Note that each comma in the substituted string is replaced by
8786 a single space.
8787
8788 @item %<@code{S}
8789 Remove all occurrences of @code{-S} from the command line.  Note---this
8790 command is position dependent.  @samp{%} commands in the spec string
8791 before this one will see @code{-S}, @samp{%} commands in the spec string
8792 after this one will not.
8793
8794 @item %:@var{function}(@var{args})
8795 Call the named function @var{function}, passing it @var{args}.
8796 @var{args} is first processed as a nested spec string, then split
8797 into an argument vector in the usual fashion.  The function returns
8798 a string which is processed as if it had appeared literally as part
8799 of the current spec.
8800
8801 The following built-in spec functions are provided:
8802
8803 @table @code
8804 @item @code{getenv}
8805 The @code{getenv} spec function takes two arguments: an environment
8806 variable name and a string.  If the environment variable is not
8807 defined, a fatal error is issued.  Otherwise, the return value is the
8808 value of the environment variable concatenated with the string.  For
8809 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
8810
8811 @smallexample
8812 %:getenv(TOPDIR /include)
8813 @end smallexample
8814
8815 expands to @file{/path/to/top/include}.
8816
8817 @item @code{if-exists}
8818 The @code{if-exists} spec function takes one argument, an absolute
8819 pathname to a file.  If the file exists, @code{if-exists} returns the
8820 pathname.  Here is a small example of its usage:
8821
8822 @smallexample
8823 *startfile:
8824 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
8825 @end smallexample
8826
8827 @item @code{if-exists-else}
8828 The @code{if-exists-else} spec function is similar to the @code{if-exists}
8829 spec function, except that it takes two arguments.  The first argument is
8830 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
8831 returns the pathname.  If it does not exist, it returns the second argument.
8832 This way, @code{if-exists-else} can be used to select one file or another,
8833 based on the existence of the first.  Here is a small example of its usage:
8834
8835 @smallexample
8836 *startfile:
8837 crt0%O%s %:if-exists(crti%O%s) \
8838 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
8839 @end smallexample
8840
8841 @item @code{replace-outfile}
8842 The @code{replace-outfile} spec function takes two arguments.  It looks for the
8843 first argument in the outfiles array and replaces it with the second argument.  Here
8844 is a small example of its usage:
8845
8846 @smallexample
8847 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
8848 @end smallexample
8849
8850 @item @code{print-asm-header}
8851 The @code{print-asm-header} function takes no arguments and simply
8852 prints a banner like:
8853
8854 @smallexample
8855 Assembler options
8856 =================
8857
8858 Use "-Wa,OPTION" to pass "OPTION" to the assembler.
8859 @end smallexample
8860
8861 It is used to separate compiler options from assembler options
8862 in the @option{--target-help} output.
8863 @end table
8864
8865 @item %@{@code{S}@}
8866 Substitutes the @code{-S} switch, if that switch was given to GCC@.
8867 If that switch was not specified, this substitutes nothing.  Note that
8868 the leading dash is omitted when specifying this option, and it is
8869 automatically inserted if the substitution is performed.  Thus the spec
8870 string @samp{%@{foo@}} would match the command-line option @option{-foo}
8871 and would output the command line option @option{-foo}.
8872
8873 @item %W@{@code{S}@}
8874 Like %@{@code{S}@} but mark last argument supplied within as a file to be
8875 deleted on failure.
8876
8877 @item %@{@code{S}*@}
8878 Substitutes all the switches specified to GCC whose names start
8879 with @code{-S}, but which also take an argument.  This is used for
8880 switches like @option{-o}, @option{-D}, @option{-I}, etc.
8881 GCC considers @option{-o foo} as being
8882 one switch whose names starts with @samp{o}.  %@{o*@} would substitute this
8883 text, including the space.  Thus two arguments would be generated.
8884
8885 @item %@{@code{S}*&@code{T}*@}
8886 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
8887 (the order of @code{S} and @code{T} in the spec is not significant).
8888 There can be any number of ampersand-separated variables; for each the
8889 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
8890
8891 @item %@{@code{S}:@code{X}@}
8892 Substitutes @code{X}, if the @samp{-S} switch was given to GCC@.
8893
8894 @item %@{!@code{S}:@code{X}@}
8895 Substitutes @code{X}, if the @samp{-S} switch was @emph{not} given to GCC@.
8896
8897 @item %@{@code{S}*:@code{X}@}
8898 Substitutes @code{X} if one or more switches whose names start with
8899 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
8900 once, no matter how many such switches appeared.  However, if @code{%*}
8901 appears somewhere in @code{X}, then @code{X} will be substituted once
8902 for each matching switch, with the @code{%*} replaced by the part of
8903 that switch that matched the @code{*}.
8904
8905 @item %@{.@code{S}:@code{X}@}
8906 Substitutes @code{X}, if processing a file with suffix @code{S}.
8907
8908 @item %@{!.@code{S}:@code{X}@}
8909 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
8910
8911 @item %@{,@code{S}:@code{X}@}
8912 Substitutes @code{X}, if processing a file for language @code{S}.
8913
8914 @item %@{!,@code{S}:@code{X}@}
8915 Substitutes @code{X}, if not processing a file for language @code{S}.
8916
8917 @item %@{@code{S}|@code{P}:@code{X}@}
8918 Substitutes @code{X} if either @code{-S} or @code{-P} was given to
8919 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
8920 @code{*} sequences as well, although they have a stronger binding than
8921 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
8922 alternatives must be starred, and only the first matching alternative
8923 is substituted.
8924
8925 For example, a spec string like this:
8926
8927 @smallexample
8928 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
8929 @end smallexample
8930
8931 will output the following command-line options from the following input
8932 command-line options:
8933
8934 @smallexample
8935 fred.c        -foo -baz
8936 jim.d         -bar -boggle
8937 -d fred.c     -foo -baz -boggle
8938 -d jim.d      -bar -baz -boggle
8939 @end smallexample
8940
8941 @item %@{S:X; T:Y; :D@}
8942
8943 If @code{S} was given to GCC, substitutes @code{X}; else if @code{T} was
8944 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
8945 be as many clauses as you need.  This may be combined with @code{.},
8946 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
8947
8948
8949 @end table
8950
8951 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
8952 construct may contain other nested @samp{%} constructs or spaces, or
8953 even newlines.  They are processed as usual, as described above.
8954 Trailing white space in @code{X} is ignored.  White space may also
8955 appear anywhere on the left side of the colon in these constructs,
8956 except between @code{.} or @code{*} and the corresponding word.
8957
8958 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
8959 handled specifically in these constructs.  If another value of
8960 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
8961 @option{-W} switch is found later in the command line, the earlier
8962 switch value is ignored, except with @{@code{S}*@} where @code{S} is
8963 just one letter, which passes all matching options.
8964
8965 The character @samp{|} at the beginning of the predicate text is used to
8966 indicate that a command should be piped to the following command, but
8967 only if @option{-pipe} is specified.
8968
8969 It is built into GCC which switches take arguments and which do not.
8970 (You might think it would be useful to generalize this to allow each
8971 compiler's spec to say which switches take arguments.  But this cannot
8972 be done in a consistent fashion.  GCC cannot even decide which input
8973 files have been specified without knowing which switches take arguments,
8974 and it must know which input files to compile in order to tell which
8975 compilers to run).
8976
8977 GCC also knows implicitly that arguments starting in @option{-l} are to be
8978 treated as compiler output files, and passed to the linker in their
8979 proper position among the other output files.
8980
8981 @c man begin OPTIONS
8982
8983 @node Target Options
8984 @section Specifying Target Machine and Compiler Version
8985 @cindex target options
8986 @cindex cross compiling
8987 @cindex specifying machine version
8988 @cindex specifying compiler version and target machine
8989 @cindex compiler version, specifying
8990 @cindex target machine, specifying
8991
8992 The usual way to run GCC is to run the executable called @file{gcc}, or
8993 @file{<machine>-gcc} when cross-compiling, or
8994 @file{<machine>-gcc-<version>} to run a version other than the one that
8995 was installed last.  Sometimes this is inconvenient, so GCC provides
8996 options that will switch to another cross-compiler or version.
8997
8998 @table @gcctabopt
8999 @item -b @var{machine}
9000 @opindex b
9001 The argument @var{machine} specifies the target machine for compilation.
9002
9003 The value to use for @var{machine} is the same as was specified as the
9004 machine type when configuring GCC as a cross-compiler.  For
9005 example, if a cross-compiler was configured with @samp{configure
9006 arm-elf}, meaning to compile for an arm processor with elf binaries,
9007 then you would specify @option{-b arm-elf} to run that cross compiler.
9008 Because there are other options beginning with @option{-b}, the
9009 configuration must contain a hyphen, or @option{-b} alone should be one
9010 argument followed by the configuration in the next argument.
9011
9012 @item -V @var{version}
9013 @opindex V
9014 The argument @var{version} specifies which version of GCC to run.
9015 This is useful when multiple versions are installed.  For example,
9016 @var{version} might be @samp{4.0}, meaning to run GCC version 4.0.
9017 @end table
9018
9019 The @option{-V} and @option{-b} options work by running the
9020 @file{<machine>-gcc-<version>} executable, so there's no real reason to
9021 use them if you can just run that directly.
9022
9023 @node Submodel Options
9024 @section Hardware Models and Configurations
9025 @cindex submodel options
9026 @cindex specifying hardware config
9027 @cindex hardware models and configurations, specifying
9028 @cindex machine dependent options
9029
9030 Earlier we discussed the standard option @option{-b} which chooses among
9031 different installed compilers for completely different target
9032 machines, such as VAX vs.@: 68000 vs.@: 80386.
9033
9034 In addition, each of these target machine types can have its own
9035 special options, starting with @samp{-m}, to choose among various
9036 hardware models or configurations---for example, 68010 vs 68020,
9037 floating coprocessor or none.  A single installed version of the
9038 compiler can compile for any model or configuration, according to the
9039 options specified.
9040
9041 Some configurations of the compiler also support additional special
9042 options, usually for compatibility with other compilers on the same
9043 platform.
9044
9045 @c This list is ordered alphanumerically by subsection name.
9046 @c It should be the same order and spelling as these options are listed
9047 @c in Machine Dependent Options
9048
9049 @menu
9050 * ARC Options::
9051 * ARM Options::
9052 * AVR Options::
9053 * Blackfin Options::
9054 * CRIS Options::
9055 * CRX Options::
9056 * Darwin Options::
9057 * DEC Alpha Options::
9058 * DEC Alpha/VMS Options::
9059 * FR30 Options::
9060 * FRV Options::
9061 * GNU/Linux Options::
9062 * H8/300 Options::
9063 * HPPA Options::
9064 * i386 and x86-64 Options::
9065 * i386 and x86-64 Windows Options::
9066 * IA-64 Options::
9067 * M32C Options::
9068 * M32R/D Options::
9069 * M680x0 Options::
9070 * M68hc1x Options::
9071 * MCore Options::
9072 * MIPS Options::
9073 * MMIX Options::
9074 * MN10300 Options::
9075 * PDP-11 Options::
9076 * picoChip Options::
9077 * PowerPC Options::
9078 * RS/6000 and PowerPC Options::
9079 * S/390 and zSeries Options::
9080 * Score Options::
9081 * SH Options::
9082 * SPARC Options::
9083 * SPU Options::
9084 * System V Options::
9085 * V850 Options::
9086 * VAX Options::
9087 * VxWorks Options::
9088 * x86-64 Options::
9089 * Xstormy16 Options::
9090 * Xtensa Options::
9091 * zSeries Options::
9092 @end menu
9093
9094 @node ARC Options
9095 @subsection ARC Options
9096 @cindex ARC Options
9097
9098 These options are defined for ARC implementations:
9099
9100 @table @gcctabopt
9101 @item -EL
9102 @opindex EL
9103 Compile code for little endian mode.  This is the default.
9104
9105 @item -EB
9106 @opindex EB
9107 Compile code for big endian mode.
9108
9109 @item -mmangle-cpu
9110 @opindex mmangle-cpu
9111 Prepend the name of the cpu to all public symbol names.
9112 In multiple-processor systems, there are many ARC variants with different
9113 instruction and register set characteristics.  This flag prevents code
9114 compiled for one cpu to be linked with code compiled for another.
9115 No facility exists for handling variants that are ``almost identical''.
9116 This is an all or nothing option.
9117
9118 @item -mcpu=@var{cpu}
9119 @opindex mcpu
9120 Compile code for ARC variant @var{cpu}.
9121 Which variants are supported depend on the configuration.
9122 All variants support @option{-mcpu=base}, this is the default.
9123
9124 @item -mtext=@var{text-section}
9125 @itemx -mdata=@var{data-section}
9126 @itemx -mrodata=@var{readonly-data-section}
9127 @opindex mtext
9128 @opindex mdata
9129 @opindex mrodata
9130 Put functions, data, and readonly data in @var{text-section},
9131 @var{data-section}, and @var{readonly-data-section} respectively
9132 by default.  This can be overridden with the @code{section} attribute.
9133 @xref{Variable Attributes}.
9134
9135 @item -mfix-cortex-m3-ldrd
9136 @opindex mfix-cortex-m3-ldrd
9137 Some Cortex-M3 cores can cause data corruption when @code{ldrd} instructions
9138 with overlapping destination and base registers are used.  This option avoids
9139 generating these instructions.  This option is enabled by default when
9140 @option{-mcpu=cortex-m3} is specified.
9141
9142 @end table
9143
9144 @node ARM Options
9145 @subsection ARM Options
9146 @cindex ARM options
9147
9148 These @samp{-m} options are defined for Advanced RISC Machines (ARM)
9149 architectures:
9150
9151 @table @gcctabopt
9152 @item -mabi=@var{name}
9153 @opindex mabi
9154 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
9155 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
9156
9157 @item -mapcs-frame
9158 @opindex mapcs-frame
9159 Generate a stack frame that is compliant with the ARM Procedure Call
9160 Standard for all functions, even if this is not strictly necessary for
9161 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
9162 with this option will cause the stack frames not to be generated for
9163 leaf functions.  The default is @option{-mno-apcs-frame}.
9164
9165 @item -mapcs
9166 @opindex mapcs
9167 This is a synonym for @option{-mapcs-frame}.
9168
9169 @ignore
9170 @c not currently implemented
9171 @item -mapcs-stack-check
9172 @opindex mapcs-stack-check
9173 Generate code to check the amount of stack space available upon entry to
9174 every function (that actually uses some stack space).  If there is
9175 insufficient space available then either the function
9176 @samp{__rt_stkovf_split_small} or @samp{__rt_stkovf_split_big} will be
9177 called, depending upon the amount of stack space required.  The run time
9178 system is required to provide these functions.  The default is
9179 @option{-mno-apcs-stack-check}, since this produces smaller code.
9180
9181 @c not currently implemented
9182 @item -mapcs-float
9183 @opindex mapcs-float
9184 Pass floating point arguments using the float point registers.  This is
9185 one of the variants of the APCS@.  This option is recommended if the
9186 target hardware has a floating point unit or if a lot of floating point
9187 arithmetic is going to be performed by the code.  The default is
9188 @option{-mno-apcs-float}, since integer only code is slightly increased in
9189 size if @option{-mapcs-float} is used.
9190
9191 @c not currently implemented
9192 @item -mapcs-reentrant
9193 @opindex mapcs-reentrant
9194 Generate reentrant, position independent code.  The default is
9195 @option{-mno-apcs-reentrant}.
9196 @end ignore
9197
9198 @item -mthumb-interwork
9199 @opindex mthumb-interwork
9200 Generate code which supports calling between the ARM and Thumb
9201 instruction sets.  Without this option the two instruction sets cannot
9202 be reliably used inside one program.  The default is
9203 @option{-mno-thumb-interwork}, since slightly larger code is generated
9204 when @option{-mthumb-interwork} is specified.
9205
9206 @item -mno-sched-prolog
9207 @opindex mno-sched-prolog
9208 Prevent the reordering of instructions in the function prolog, or the
9209 merging of those instruction with the instructions in the function's
9210 body.  This means that all functions will start with a recognizable set
9211 of instructions (or in fact one of a choice from a small set of
9212 different function prologues), and this information can be used to
9213 locate the start if functions inside an executable piece of code.  The
9214 default is @option{-msched-prolog}.
9215
9216 @item -mfloat-abi=@var{name}
9217 @opindex mfloat-abi
9218 Specifies which floating-point ABI to use.  Permissible values
9219 are: @samp{soft}, @samp{softfp} and @samp{hard}.
9220
9221 Specifying @samp{soft} causes GCC to generate output containing 
9222 library calls for floating-point operations.
9223 @samp{softfp} allows the generation of code using hardware floating-point 
9224 instructions, but still uses the soft-float calling conventions.  
9225 @samp{hard} allows generation of floating-point instructions 
9226 and uses FPU-specific calling conventions.
9227
9228 Using @option{-mfloat-abi=hard} with VFP coprocessors is not supported.
9229 Use @option{-mfloat-abi=softfp} with the appropriate @option{-mfpu} option
9230 to allow the compiler to generate code that makes use of the hardware
9231 floating-point capabilities for these CPUs.
9232
9233 The default depends on the specific target configuration.  Note that
9234 the hard-float and soft-float ABIs are not link-compatible; you must
9235 compile your entire program with the same ABI, and link with a
9236 compatible set of libraries.
9237
9238 @item -mhard-float
9239 @opindex mhard-float
9240 Equivalent to @option{-mfloat-abi=hard}.
9241
9242 @item -msoft-float
9243 @opindex msoft-float
9244 Equivalent to @option{-mfloat-abi=soft}.
9245
9246 @item -mlittle-endian
9247 @opindex mlittle-endian
9248 Generate code for a processor running in little-endian mode.  This is
9249 the default for all standard configurations.
9250
9251 @item -mbig-endian
9252 @opindex mbig-endian
9253 Generate code for a processor running in big-endian mode; the default is
9254 to compile code for a little-endian processor.
9255
9256 @item -mwords-little-endian
9257 @opindex mwords-little-endian
9258 This option only applies when generating code for big-endian processors.
9259 Generate code for a little-endian word order but a big-endian byte
9260 order.  That is, a byte order of the form @samp{32107654}.  Note: this
9261 option should only be used if you require compatibility with code for
9262 big-endian ARM processors generated by versions of the compiler prior to
9263 2.8.
9264
9265 @item -mcpu=@var{name}
9266 @opindex mcpu
9267 This specifies the name of the target ARM processor.  GCC uses this name
9268 to determine what kind of instructions it can emit when generating
9269 assembly code.  Permissible names are: @samp{arm2}, @samp{arm250},
9270 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
9271 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
9272 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
9273 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
9274 @samp{arm720},
9275 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
9276 @samp{arm710t}, @samp{arm720t}, @samp{arm740t},
9277 @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
9278 @samp{strongarm1110},
9279 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
9280 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
9281 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
9282 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
9283 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
9284 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
9285 @samp{arm1156t2-s}, @samp{arm1156t2f-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
9286 @samp{cortex-a8}, @samp{cortex-a9},
9287 @samp{cortex-r4}, @samp{cortex-r4f}, @samp{cortex-m3},
9288 @samp{cortex-m1},
9289 @samp{cortex-m0},
9290 @samp{xscale}, @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312}.
9291
9292 @item -mtune=@var{name}
9293 @opindex mtune
9294 This option is very similar to the @option{-mcpu=} option, except that
9295 instead of specifying the actual target processor type, and hence
9296 restricting which instructions can be used, it specifies that GCC should
9297 tune the performance of the code as if the target were of the type
9298 specified in this option, but still choosing the instructions that it
9299 will generate based on the cpu specified by a @option{-mcpu=} option.
9300 For some ARM implementations better performance can be obtained by using
9301 this option.
9302
9303 @item -march=@var{name}
9304 @opindex march
9305 This specifies the name of the target ARM architecture.  GCC uses this
9306 name to determine what kind of instructions it can emit when generating
9307 assembly code.  This option can be used in conjunction with or instead
9308 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
9309 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
9310 @samp{armv5}, @samp{armv5t}, @samp{armv5e}, @samp{armv5te},
9311 @samp{armv6}, @samp{armv6j},
9312 @samp{armv6t2}, @samp{armv6z}, @samp{armv6zk}, @samp{armv6-m},
9313 @samp{armv7}, @samp{armv7-a}, @samp{armv7-r}, @samp{armv7-m},
9314 @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312}.
9315
9316 @item -mfpu=@var{name}
9317 @itemx -mfpe=@var{number}
9318 @itemx -mfp=@var{number}
9319 @opindex mfpu
9320 @opindex mfpe
9321 @opindex mfp
9322 This specifies what floating point hardware (or hardware emulation) is
9323 available on the target.  Permissible names are: @samp{fpa}, @samp{fpe2},
9324 @samp{fpe3}, @samp{maverick}, @samp{vfp}, @samp{vfpv3}, @samp{vfpv3-d16},
9325 @samp{neon}, and @samp{neon-fp16}.  @option{-mfp} and @option{-mfpe}
9326 are synonyms for @option{-mfpu}=@samp{fpe}@var{number}, for compatibility
9327 with older versions of GCC@.
9328
9329 If @option{-msoft-float} is specified this specifies the format of
9330 floating point values.
9331
9332 @item -mfp16-format=@var{name}
9333 @opindex mfp16-format
9334 Specify the format of the @code{__fp16} half-precision floating-point type.
9335 Permissible names are @samp{none}, @samp{ieee}, and @samp{alternative}; 
9336 the default is @samp{none}, in which case the @code{__fp16} type is not 
9337 defined.  @xref{Half-Precision}, for more information.
9338
9339 @item -mstructure-size-boundary=@var{n}
9340 @opindex mstructure-size-boundary
9341 The size of all structures and unions will be rounded up to a multiple
9342 of the number of bits set by this option.  Permissible values are 8, 32
9343 and 64.  The default value varies for different toolchains.  For the COFF
9344 targeted toolchain the default value is 8.  A value of 64 is only allowed
9345 if the underlying ABI supports it.
9346
9347 Specifying the larger number can produce faster, more efficient code, but
9348 can also increase the size of the program.  Different values are potentially
9349 incompatible.  Code compiled with one value cannot necessarily expect to
9350 work with code or libraries compiled with another value, if they exchange
9351 information using structures or unions.
9352
9353 @item -mabort-on-noreturn
9354 @opindex mabort-on-noreturn
9355 Generate a call to the function @code{abort} at the end of a
9356 @code{noreturn} function.  It will be executed if the function tries to
9357 return.
9358
9359 @item -mlong-calls
9360 @itemx -mno-long-calls
9361 @opindex mlong-calls
9362 @opindex mno-long-calls
9363 Tells the compiler to perform function calls by first loading the
9364 address of the function into a register and then performing a subroutine
9365 call on this register.  This switch is needed if the target function
9366 will lie outside of the 64 megabyte addressing range of the offset based
9367 version of subroutine call instruction.
9368
9369 Even if this switch is enabled, not all function calls will be turned
9370 into long calls.  The heuristic is that static functions, functions
9371 which have the @samp{short-call} attribute, functions that are inside
9372 the scope of a @samp{#pragma no_long_calls} directive and functions whose
9373 definitions have already been compiled within the current compilation
9374 unit, will not be turned into long calls.  The exception to this rule is
9375 that weak function definitions, functions with the @samp{long-call}
9376 attribute or the @samp{section} attribute, and functions that are within
9377 the scope of a @samp{#pragma long_calls} directive, will always be
9378 turned into long calls.
9379
9380 This feature is not enabled by default.  Specifying
9381 @option{-mno-long-calls} will restore the default behavior, as will
9382 placing the function calls within the scope of a @samp{#pragma
9383 long_calls_off} directive.  Note these switches have no effect on how
9384 the compiler generates code to handle function calls via function
9385 pointers.
9386
9387 @item -msingle-pic-base
9388 @opindex msingle-pic-base
9389 Treat the register used for PIC addressing as read-only, rather than
9390 loading it in the prologue for each function.  The run-time system is
9391 responsible for initializing this register with an appropriate value
9392 before execution begins.
9393
9394 @item -mpic-register=@var{reg}
9395 @opindex mpic-register
9396 Specify the register to be used for PIC addressing.  The default is R10
9397 unless stack-checking is enabled, when R9 is used.
9398
9399 @item -mcirrus-fix-invalid-insns
9400 @opindex mcirrus-fix-invalid-insns
9401 @opindex mno-cirrus-fix-invalid-insns
9402 Insert NOPs into the instruction stream to in order to work around
9403 problems with invalid Maverick instruction combinations.  This option
9404 is only valid if the @option{-mcpu=ep9312} option has been used to
9405 enable generation of instructions for the Cirrus Maverick floating
9406 point co-processor.  This option is not enabled by default, since the
9407 problem is only present in older Maverick implementations.  The default
9408 can be re-enabled by use of the @option{-mno-cirrus-fix-invalid-insns}
9409 switch.
9410
9411 @item -mpoke-function-name
9412 @opindex mpoke-function-name
9413 Write the name of each function into the text section, directly
9414 preceding the function prologue.  The generated code is similar to this:
9415
9416 @smallexample
9417      t0
9418          .ascii "arm_poke_function_name", 0
9419          .align
9420      t1
9421          .word 0xff000000 + (t1 - t0)
9422      arm_poke_function_name
9423          mov     ip, sp
9424          stmfd   sp!, @{fp, ip, lr, pc@}
9425          sub     fp, ip, #4
9426 @end smallexample
9427
9428 When performing a stack backtrace, code can inspect the value of
9429 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
9430 location @code{pc - 12} and the top 8 bits are set, then we know that
9431 there is a function name embedded immediately preceding this location
9432 and has length @code{((pc[-3]) & 0xff000000)}.
9433
9434 @item -mthumb
9435 @opindex mthumb
9436 Generate code for the Thumb instruction set.  The default is to
9437 use the 32-bit ARM instruction set.
9438 This option automatically enables either 16-bit Thumb-1 or
9439 mixed 16/32-bit Thumb-2 instructions based on the @option{-mcpu=@var{name}}
9440 and @option{-march=@var{name}} options. This option is not passed to the 
9441 assembler. If you want to force assembler files to be interpreted as Thumb code,
9442 either add a @samp{.thumb} directive to the source or pass the @option{-mthumb} 
9443 option directly to the assembler by prefixing it with @option{-Wa}.
9444
9445 @item -mtpcs-frame
9446 @opindex mtpcs-frame
9447 Generate a stack frame that is compliant with the Thumb Procedure Call
9448 Standard for all non-leaf functions.  (A leaf function is one that does
9449 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
9450
9451 @item -mtpcs-leaf-frame
9452 @opindex mtpcs-leaf-frame
9453 Generate a stack frame that is compliant with the Thumb Procedure Call
9454 Standard for all leaf functions.  (A leaf function is one that does
9455 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
9456
9457 @item -mcallee-super-interworking
9458 @opindex mcallee-super-interworking
9459 Gives all externally visible functions in the file being compiled an ARM
9460 instruction set header which switches to Thumb mode before executing the
9461 rest of the function.  This allows these functions to be called from
9462 non-interworking code. This option is not valid in AAPCS configurations
9463 because interworking is enabled by default.
9464
9465 @item -mcaller-super-interworking
9466 @opindex mcaller-super-interworking
9467 Allows calls via function pointers (including virtual functions) to
9468 execute correctly regardless of whether the target code has been
9469 compiled for interworking or not.  There is a small overhead in the cost
9470 of executing a function pointer if this option is enabled. This option 
9471 is not valid in AAPCS configurations because interworking is enabled
9472 by default.
9473
9474 @item -mtp=@var{name}
9475 @opindex mtp
9476 Specify the access model for the thread local storage pointer.  The valid
9477 models are @option{soft}, which generates calls to @code{__aeabi_read_tp},
9478 @option{cp15}, which fetches the thread pointer from @code{cp15} directly
9479 (supported in the arm6k architecture), and @option{auto}, which uses the
9480 best available method for the selected processor.  The default setting is
9481 @option{auto}.
9482
9483 @item -mword-relocations
9484 @opindex mword-relocations
9485 Only generate absolute relocations on word sized values (i.e. R_ARM_ABS32).
9486 This is enabled by default on targets (uClinux, SymbianOS) where the runtime
9487 loader imposes this restriction, and when @option{-fpic} or @option{-fPIC}
9488 is specified.
9489
9490 @end table
9491
9492 @node AVR Options
9493 @subsection AVR Options
9494 @cindex AVR Options
9495
9496 These options are defined for AVR implementations:
9497
9498 @table @gcctabopt
9499 @item -mmcu=@var{mcu}
9500 @opindex mmcu
9501 Specify ATMEL AVR instruction set or MCU type.
9502
9503 Instruction set avr1 is for the minimal AVR core, not supported by the C
9504 compiler, only for assembler programs (MCU types: at90s1200, attiny10,
9505 attiny11, attiny12, attiny15, attiny28).
9506
9507 Instruction set avr2 (default) is for the classic AVR core with up to
9508 8K program memory space (MCU types: at90s2313, at90s2323, attiny22,
9509 at90s2333, at90s2343, at90s4414, at90s4433, at90s4434, at90s8515,
9510 at90c8534, at90s8535).
9511
9512 Instruction set avr3 is for the classic AVR core with up to 128K program
9513 memory space (MCU types: atmega103, atmega603, at43usb320, at76c711).
9514
9515 Instruction set avr4 is for the enhanced AVR core with up to 8K program
9516 memory space (MCU types: atmega8, atmega83, atmega85).
9517
9518 Instruction set avr5 is for the enhanced AVR core with up to 128K program
9519 memory space (MCU types: atmega16, atmega161, atmega163, atmega32, atmega323,
9520 atmega64, atmega128, at43usb355, at94k).
9521
9522 @item -msize
9523 @opindex msize
9524 Output instruction sizes to the asm file.
9525
9526 @item -minit-stack=@var{N}
9527 @opindex minit-stack
9528 Specify the initial stack address, which may be a symbol or numeric value,
9529 @samp{__stack} is the default.
9530
9531 @item -mno-interrupts
9532 @opindex mno-interrupts
9533 Generated code is not compatible with hardware interrupts.
9534 Code size will be smaller.
9535
9536 @item -mcall-prologues
9537 @opindex mcall-prologues
9538 Functions prologues/epilogues expanded as call to appropriate
9539 subroutines.  Code size will be smaller.
9540
9541 @item -mtiny-stack
9542 @opindex mtiny-stack
9543 Change only the low 8 bits of the stack pointer.
9544
9545 @item -mint8
9546 @opindex mint8
9547 Assume int to be 8 bit integer.  This affects the sizes of all types: A
9548 char will be 1 byte, an int will be 1 byte, a long will be 2 bytes
9549 and long long will be 4 bytes.  Please note that this option does not
9550 comply to the C standards, but it will provide you with smaller code
9551 size.
9552 @end table
9553
9554 @node Blackfin Options
9555 @subsection Blackfin Options
9556 @cindex Blackfin Options
9557
9558 @table @gcctabopt
9559 @item -mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]}
9560 @opindex mcpu=
9561 Specifies the name of the target Blackfin processor.  Currently, @var{cpu}
9562 can be one of @samp{bf512}, @samp{bf514}, @samp{bf516}, @samp{bf518},
9563 @samp{bf522}, @samp{bf523}, @samp{bf524}, @samp{bf525}, @samp{bf526},
9564 @samp{bf527}, @samp{bf531}, @samp{bf532}, @samp{bf533},
9565 @samp{bf534}, @samp{bf536}, @samp{bf537}, @samp{bf538}, @samp{bf539},
9566 @samp{bf542}, @samp{bf544}, @samp{bf547}, @samp{bf548}, @samp{bf549},
9567 @samp{bf561}.
9568 The optional @var{sirevision} specifies the silicon revision of the target
9569 Blackfin processor.  Any workarounds available for the targeted silicon revision
9570 will be enabled.  If @var{sirevision} is @samp{none}, no workarounds are enabled.
9571 If @var{sirevision} is @samp{any}, all workarounds for the targeted processor
9572 will be enabled.  The @code{__SILICON_REVISION__} macro is defined to two
9573 hexadecimal digits representing the major and minor numbers in the silicon
9574 revision.  If @var{sirevision} is @samp{none}, the @code{__SILICON_REVISION__}
9575 is not defined.  If @var{sirevision} is @samp{any}, the
9576 @code{__SILICON_REVISION__} is defined to be @code{0xffff}.
9577 If this optional @var{sirevision} is not used, GCC assumes the latest known
9578 silicon revision of the targeted Blackfin processor.
9579
9580 Support for @samp{bf561} is incomplete.  For @samp{bf561},
9581 Only the processor macro is defined.
9582 Without this option, @samp{bf532} is used as the processor by default.
9583 The corresponding predefined processor macros for @var{cpu} is to
9584 be defined.  And for @samp{bfin-elf} toolchain, this causes the hardware BSP
9585 provided by libgloss to be linked in if @option{-msim} is not given.
9586
9587 @item -msim
9588 @opindex msim
9589 Specifies that the program will be run on the simulator.  This causes
9590 the simulator BSP provided by libgloss to be linked in.  This option
9591 has effect only for @samp{bfin-elf} toolchain.
9592 Certain other options, such as @option{-mid-shared-library} and
9593 @option{-mfdpic}, imply @option{-msim}.
9594
9595 @item -momit-leaf-frame-pointer
9596 @opindex momit-leaf-frame-pointer
9597 Don't keep the frame pointer in a register for leaf functions.  This
9598 avoids the instructions to save, set up and restore frame pointers and
9599 makes an extra register available in leaf functions.  The option
9600 @option{-fomit-frame-pointer} removes the frame pointer for all functions
9601 which might make debugging harder.
9602
9603 @item -mspecld-anomaly
9604 @opindex mspecld-anomaly
9605 When enabled, the compiler will ensure that the generated code does not
9606 contain speculative loads after jump instructions. If this option is used,
9607 @code{__WORKAROUND_SPECULATIVE_LOADS} is defined.
9608
9609 @item -mno-specld-anomaly
9610 @opindex mno-specld-anomaly
9611 Don't generate extra code to prevent speculative loads from occurring.
9612
9613 @item -mcsync-anomaly
9614 @opindex mcsync-anomaly
9615 When enabled, the compiler will ensure that the generated code does not
9616 contain CSYNC or SSYNC instructions too soon after conditional branches.
9617 If this option is used, @code{__WORKAROUND_SPECULATIVE_SYNCS} is defined.
9618
9619 @item -mno-csync-anomaly
9620 @opindex mno-csync-anomaly
9621 Don't generate extra code to prevent CSYNC or SSYNC instructions from
9622 occurring too soon after a conditional branch.
9623
9624 @item -mlow-64k
9625 @opindex mlow-64k
9626 When enabled, the compiler is free to take advantage of the knowledge that
9627 the entire program fits into the low 64k of memory.
9628
9629 @item -mno-low-64k
9630 @opindex mno-low-64k
9631 Assume that the program is arbitrarily large.  This is the default.
9632
9633 @item -mstack-check-l1
9634 @opindex mstack-check-l1
9635 Do stack checking using information placed into L1 scratchpad memory by the
9636 uClinux kernel.
9637
9638 @item -mid-shared-library
9639 @opindex mid-shared-library
9640 Generate code that supports shared libraries via the library ID method.
9641 This allows for execute in place and shared libraries in an environment
9642 without virtual memory management.  This option implies @option{-fPIC}.
9643 With a @samp{bfin-elf} target, this option implies @option{-msim}.
9644
9645 @item -mno-id-shared-library
9646 @opindex mno-id-shared-library
9647 Generate code that doesn't assume ID based shared libraries are being used.
9648 This is the default.
9649
9650 @item -mleaf-id-shared-library
9651 @opindex mleaf-id-shared-library
9652 Generate code that supports shared libraries via the library ID method,
9653 but assumes that this library or executable won't link against any other
9654 ID shared libraries.  That allows the compiler to use faster code for jumps
9655 and calls.
9656
9657 @item -mno-leaf-id-shared-library
9658 @opindex mno-leaf-id-shared-library
9659 Do not assume that the code being compiled won't link against any ID shared
9660 libraries.  Slower code will be generated for jump and call insns.
9661
9662 @item -mshared-library-id=n
9663 @opindex mshared-library-id
9664 Specified the identification number of the ID based shared library being
9665 compiled.  Specifying a value of 0 will generate more compact code, specifying
9666 other values will force the allocation of that number to the current
9667 library but is no more space or time efficient than omitting this option.
9668
9669 @item -msep-data
9670 @opindex msep-data
9671 Generate code that allows the data segment to be located in a different
9672 area of memory from the text segment.  This allows for execute in place in
9673 an environment without virtual memory management by eliminating relocations
9674 against the text section.
9675
9676 @item -mno-sep-data
9677 @opindex mno-sep-data
9678 Generate code that assumes that the data segment follows the text segment.
9679 This is the default.
9680
9681 @item -mlong-calls
9682 @itemx -mno-long-calls
9683 @opindex mlong-calls
9684 @opindex mno-long-calls
9685 Tells the compiler to perform function calls by first loading the
9686 address of the function into a register and then performing a subroutine
9687 call on this register.  This switch is needed if the target function
9688 will lie outside of the 24 bit addressing range of the offset based
9689 version of subroutine call instruction.
9690
9691 This feature is not enabled by default.  Specifying
9692 @option{-mno-long-calls} will restore the default behavior.  Note these
9693 switches have no effect on how the compiler generates code to handle
9694 function calls via function pointers.
9695
9696 @item -mfast-fp
9697 @opindex mfast-fp
9698 Link with the fast floating-point library. This library relaxes some of
9699 the IEEE floating-point standard's rules for checking inputs against
9700 Not-a-Number (NAN), in the interest of performance.
9701
9702 @item -minline-plt
9703 @opindex minline-plt
9704 Enable inlining of PLT entries in function calls to functions that are
9705 not known to bind locally.  It has no effect without @option{-mfdpic}.
9706
9707 @item -mmulticore
9708 @opindex mmulticore
9709 Build standalone application for multicore Blackfin processor. Proper
9710 start files and link scripts will be used to support multicore.
9711 This option defines @code{__BFIN_MULTICORE}. It can only be used with
9712 @option{-mcpu=bf561@r{[}-@var{sirevision}@r{]}}. It can be used with
9713 @option{-mcorea} or @option{-mcoreb}. If it's used without
9714 @option{-mcorea} or @option{-mcoreb}, single application/dual core
9715 programming model is used. In this model, the main function of Core B
9716 should be named as coreb_main. If it's used with @option{-mcorea} or
9717 @option{-mcoreb}, one application per core programming model is used.
9718 If this option is not used, single core application programming
9719 model is used.
9720
9721 @item -mcorea
9722 @opindex mcorea
9723 Build standalone application for Core A of BF561 when using
9724 one application per core programming model. Proper start files
9725 and link scripts will be used to support Core A. This option
9726 defines @code{__BFIN_COREA}. It must be used with @option{-mmulticore}.
9727
9728 @item -mcoreb
9729 @opindex mcoreb
9730 Build standalone application for Core B of BF561 when using
9731 one application per core programming model. Proper start files
9732 and link scripts will be used to support Core B. This option
9733 defines @code{__BFIN_COREB}. When this option is used, coreb_main
9734 should be used instead of main. It must be used with
9735 @option{-mmulticore}. 
9736
9737 @item -msdram
9738 @opindex msdram
9739 Build standalone application for SDRAM. Proper start files and
9740 link scripts will be used to put the application into SDRAM.
9741 Loader should initialize SDRAM before loading the application
9742 into SDRAM. This option defines @code{__BFIN_SDRAM}.
9743
9744 @item -micplb
9745 @opindex micplb
9746 Assume that ICPLBs are enabled at runtime.  This has an effect on certain
9747 anomaly workarounds.  For Linux targets, the default is to assume ICPLBs
9748 are enabled; for standalone applications the default is off.
9749 @end table
9750
9751 @node CRIS Options
9752 @subsection CRIS Options
9753 @cindex CRIS Options
9754
9755 These options are defined specifically for the CRIS ports.
9756
9757 @table @gcctabopt
9758 @item -march=@var{architecture-type}
9759 @itemx -mcpu=@var{architecture-type}
9760 @opindex march
9761 @opindex mcpu
9762 Generate code for the specified architecture.  The choices for
9763 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
9764 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
9765 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
9766 @samp{v10}.
9767
9768 @item -mtune=@var{architecture-type}
9769 @opindex mtune
9770 Tune to @var{architecture-type} everything applicable about the generated
9771 code, except for the ABI and the set of available instructions.  The
9772 choices for @var{architecture-type} are the same as for
9773 @option{-march=@var{architecture-type}}.
9774
9775 @item -mmax-stack-frame=@var{n}
9776 @opindex mmax-stack-frame
9777 Warn when the stack frame of a function exceeds @var{n} bytes.
9778
9779 @item -metrax4
9780 @itemx -metrax100
9781 @opindex metrax4
9782 @opindex metrax100
9783 The options @option{-metrax4} and @option{-metrax100} are synonyms for
9784 @option{-march=v3} and @option{-march=v8} respectively.
9785
9786 @item -mmul-bug-workaround
9787 @itemx -mno-mul-bug-workaround
9788 @opindex mmul-bug-workaround
9789 @opindex mno-mul-bug-workaround
9790 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
9791 models where it applies.  This option is active by default.
9792
9793 @item -mpdebug
9794 @opindex mpdebug
9795 Enable CRIS-specific verbose debug-related information in the assembly
9796 code.  This option also has the effect to turn off the @samp{#NO_APP}
9797 formatted-code indicator to the assembler at the beginning of the
9798 assembly file.
9799
9800 @item -mcc-init
9801 @opindex mcc-init
9802 Do not use condition-code results from previous instruction; always emit
9803 compare and test instructions before use of condition codes.
9804
9805 @item -mno-side-effects
9806 @opindex mno-side-effects
9807 Do not emit instructions with side-effects in addressing modes other than
9808 post-increment.
9809
9810 @item -mstack-align
9811 @itemx -mno-stack-align
9812 @itemx -mdata-align
9813 @itemx -mno-data-align
9814 @itemx -mconst-align
9815 @itemx -mno-const-align
9816 @opindex mstack-align
9817 @opindex mno-stack-align
9818 @opindex mdata-align
9819 @opindex mno-data-align
9820 @opindex mconst-align
9821 @opindex mno-const-align
9822 These options (no-options) arranges (eliminate arrangements) for the
9823 stack-frame, individual data and constants to be aligned for the maximum
9824 single data access size for the chosen CPU model.  The default is to
9825 arrange for 32-bit alignment.  ABI details such as structure layout are
9826 not affected by these options.
9827
9828 @item -m32-bit
9829 @itemx -m16-bit
9830 @itemx -m8-bit
9831 @opindex m32-bit
9832 @opindex m16-bit
9833 @opindex m8-bit
9834 Similar to the stack- data- and const-align options above, these options
9835 arrange for stack-frame, writable data and constants to all be 32-bit,
9836 16-bit or 8-bit aligned.  The default is 32-bit alignment.
9837
9838 @item -mno-prologue-epilogue
9839 @itemx -mprologue-epilogue
9840 @opindex mno-prologue-epilogue
9841 @opindex mprologue-epilogue
9842 With @option{-mno-prologue-epilogue}, the normal function prologue and
9843 epilogue that sets up the stack-frame are omitted and no return
9844 instructions or return sequences are generated in the code.  Use this
9845 option only together with visual inspection of the compiled code: no
9846 warnings or errors are generated when call-saved registers must be saved,
9847 or storage for local variable needs to be allocated.
9848
9849 @item -mno-gotplt
9850 @itemx -mgotplt
9851 @opindex mno-gotplt
9852 @opindex mgotplt
9853 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
9854 instruction sequences that load addresses for functions from the PLT part
9855 of the GOT rather than (traditional on other architectures) calls to the
9856 PLT@.  The default is @option{-mgotplt}.
9857
9858 @item -melf
9859 @opindex melf
9860 Legacy no-op option only recognized with the cris-axis-elf and
9861 cris-axis-linux-gnu targets.
9862
9863 @item -mlinux
9864 @opindex mlinux
9865 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
9866
9867 @item -sim
9868 @opindex sim
9869 This option, recognized for the cris-axis-elf arranges
9870 to link with input-output functions from a simulator library.  Code,
9871 initialized data and zero-initialized data are allocated consecutively.
9872
9873 @item -sim2
9874 @opindex sim2
9875 Like @option{-sim}, but pass linker options to locate initialized data at
9876 0x40000000 and zero-initialized data at 0x80000000.
9877 @end table
9878
9879 @node CRX Options
9880 @subsection CRX Options
9881 @cindex CRX Options
9882
9883 These options are defined specifically for the CRX ports.
9884
9885 @table @gcctabopt
9886
9887 @item -mmac
9888 @opindex mmac
9889 Enable the use of multiply-accumulate instructions. Disabled by default.
9890
9891 @item -mpush-args
9892 @opindex mpush-args
9893 Push instructions will be used to pass outgoing arguments when functions
9894 are called. Enabled by default.
9895 @end table
9896
9897 @node Darwin Options
9898 @subsection Darwin Options
9899 @cindex Darwin options
9900
9901 These options are defined for all architectures running the Darwin operating
9902 system.
9903
9904 FSF GCC on Darwin does not create ``fat'' object files; it will create
9905 an object file for the single architecture that it was built to
9906 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
9907 @option{-arch} options are used; it does so by running the compiler or
9908 linker multiple times and joining the results together with
9909 @file{lipo}.
9910
9911 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
9912 @samp{i686}) is determined by the flags that specify the ISA
9913 that GCC is targetting, like @option{-mcpu} or @option{-march}.  The
9914 @option{-force_cpusubtype_ALL} option can be used to override this.
9915
9916 The Darwin tools vary in their behavior when presented with an ISA
9917 mismatch.  The assembler, @file{as}, will only permit instructions to
9918 be used that are valid for the subtype of the file it is generating,
9919 so you cannot put 64-bit instructions in a @samp{ppc750} object file.
9920 The linker for shared libraries, @file{/usr/bin/libtool}, will fail
9921 and print an error if asked to create a shared library with a less
9922 restrictive subtype than its input files (for instance, trying to put
9923 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
9924 for executables, @file{ld}, will quietly give the executable the most
9925 restrictive subtype of any of its input files.
9926
9927 @table @gcctabopt
9928 @item -F@var{dir}
9929 @opindex F
9930 Add the framework directory @var{dir} to the head of the list of
9931 directories to be searched for header files.  These directories are
9932 interleaved with those specified by @option{-I} options and are
9933 scanned in a left-to-right order.
9934
9935 A framework directory is a directory with frameworks in it.  A
9936 framework is a directory with a @samp{"Headers"} and/or
9937 @samp{"PrivateHeaders"} directory contained directly in it that ends
9938 in @samp{".framework"}.  The name of a framework is the name of this
9939 directory excluding the @samp{".framework"}.  Headers associated with
9940 the framework are found in one of those two directories, with
9941 @samp{"Headers"} being searched first.  A subframework is a framework
9942 directory that is in a framework's @samp{"Frameworks"} directory.
9943 Includes of subframework headers can only appear in a header of a
9944 framework that contains the subframework, or in a sibling subframework
9945 header.  Two subframeworks are siblings if they occur in the same
9946 framework.  A subframework should not have the same name as a
9947 framework, a warning will be issued if this is violated.  Currently a
9948 subframework cannot have subframeworks, in the future, the mechanism
9949 may be extended to support this.  The standard frameworks can be found
9950 in @samp{"/System/Library/Frameworks"} and
9951 @samp{"/Library/Frameworks"}.  An example include looks like
9952 @code{#include <Framework/header.h>}, where @samp{Framework} denotes
9953 the name of the framework and header.h is found in the
9954 @samp{"PrivateHeaders"} or @samp{"Headers"} directory.
9955
9956 @item -iframework@var{dir}
9957 @opindex iframework
9958 Like @option{-F} except the directory is a treated as a system
9959 directory.  The main difference between this @option{-iframework} and
9960 @option{-F} is that with @option{-iframework} the compiler does not
9961 warn about constructs contained within header files found via
9962 @var{dir}.  This option is valid only for the C family of languages.
9963
9964 @item -gused
9965 @opindex gused
9966 Emit debugging information for symbols that are used.  For STABS
9967 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
9968 This is by default ON@.
9969
9970 @item -gfull
9971 @opindex gfull
9972 Emit debugging information for all symbols and types.
9973
9974 @item -mmacosx-version-min=@var{version}
9975 The earliest version of MacOS X that this executable will run on
9976 is @var{version}.  Typical values of @var{version} include @code{10.1},
9977 @code{10.2}, and @code{10.3.9}.
9978
9979 If the compiler was built to use the system's headers by default,
9980 then the default for this option is the system version on which the
9981 compiler is running, otherwise the default is to make choices which
9982 are compatible with as many systems and code bases as possible.
9983
9984 @item -mkernel
9985 @opindex mkernel
9986 Enable kernel development mode.  The @option{-mkernel} option sets
9987 @option{-static}, @option{-fno-common}, @option{-fno-cxa-atexit},
9988 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
9989 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
9990 applicable.  This mode also sets @option{-mno-altivec},
9991 @option{-msoft-float}, @option{-fno-builtin} and
9992 @option{-mlong-branch} for PowerPC targets.
9993
9994 @item -mone-byte-bool
9995 @opindex mone-byte-bool
9996 Override the defaults for @samp{bool} so that @samp{sizeof(bool)==1}.
9997 By default @samp{sizeof(bool)} is @samp{4} when compiling for
9998 Darwin/PowerPC and @samp{1} when compiling for Darwin/x86, so this
9999 option has no effect on x86.
10000
10001 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
10002 to generate code that is not binary compatible with code generated
10003 without that switch.  Using this switch may require recompiling all
10004 other modules in a program, including system libraries.  Use this
10005 switch to conform to a non-default data model.
10006
10007 @item -mfix-and-continue
10008 @itemx -ffix-and-continue
10009 @itemx -findirect-data
10010 @opindex mfix-and-continue
10011 @opindex ffix-and-continue
10012 @opindex findirect-data
10013 Generate code suitable for fast turn around development.  Needed to
10014 enable gdb to dynamically load @code{.o} files into already running
10015 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
10016 are provided for backwards compatibility.
10017
10018 @item -all_load
10019 @opindex all_load
10020 Loads all members of static archive libraries.
10021 See man ld(1) for more information.
10022
10023 @item -arch_errors_fatal
10024 @opindex arch_errors_fatal
10025 Cause the errors having to do with files that have the wrong architecture
10026 to be fatal.
10027
10028 @item -bind_at_load
10029 @opindex bind_at_load
10030 Causes the output file to be marked such that the dynamic linker will
10031 bind all undefined references when the file is loaded or launched.
10032
10033 @item -bundle
10034 @opindex bundle
10035 Produce a Mach-o bundle format file.
10036 See man ld(1) for more information.
10037
10038 @item -bundle_loader @var{executable}
10039 @opindex bundle_loader
10040 This option specifies the @var{executable} that will be loading the build
10041 output file being linked.  See man ld(1) for more information.
10042
10043 @item -dynamiclib
10044 @opindex dynamiclib
10045 When passed this option, GCC will produce a dynamic library instead of
10046 an executable when linking, using the Darwin @file{libtool} command.
10047
10048 @item -force_cpusubtype_ALL
10049 @opindex force_cpusubtype_ALL
10050 This causes GCC's output file to have the @var{ALL} subtype, instead of
10051 one controlled by the @option{-mcpu} or @option{-march} option.
10052
10053 @item -allowable_client  @var{client_name}
10054 @itemx -client_name
10055 @itemx -compatibility_version
10056 @itemx -current_version
10057 @itemx -dead_strip
10058 @itemx -dependency-file
10059 @itemx -dylib_file
10060 @itemx -dylinker_install_name
10061 @itemx -dynamic
10062 @itemx -exported_symbols_list
10063 @itemx -filelist
10064 @itemx -flat_namespace
10065 @itemx -force_flat_namespace
10066 @itemx -headerpad_max_install_names
10067 @itemx -image_base
10068 @itemx -init
10069 @itemx -install_name
10070 @itemx -keep_private_externs
10071 @itemx -multi_module
10072 @itemx -multiply_defined
10073 @itemx -multiply_defined_unused
10074 @itemx -noall_load
10075 @itemx -no_dead_strip_inits_and_terms
10076 @itemx -nofixprebinding
10077 @itemx -nomultidefs
10078 @itemx -noprebind
10079 @itemx -noseglinkedit
10080 @itemx -pagezero_size
10081 @itemx -prebind
10082 @itemx -prebind_all_twolevel_modules
10083 @itemx -private_bundle
10084 @itemx -read_only_relocs
10085 @itemx -sectalign
10086 @itemx -sectobjectsymbols
10087 @itemx -whyload
10088 @itemx -seg1addr
10089 @itemx -sectcreate
10090 @itemx -sectobjectsymbols
10091 @itemx -sectorder
10092 @itemx -segaddr
10093 @itemx -segs_read_only_addr
10094 @itemx -segs_read_write_addr
10095 @itemx -seg_addr_table
10096 @itemx -seg_addr_table_filename
10097 @itemx -seglinkedit
10098 @itemx -segprot
10099 @itemx -segs_read_only_addr
10100 @itemx -segs_read_write_addr
10101 @itemx -single_module
10102 @itemx -static
10103 @itemx -sub_library
10104 @itemx -sub_umbrella
10105 @itemx -twolevel_namespace
10106 @itemx -umbrella
10107 @itemx -undefined
10108 @itemx -unexported_symbols_list
10109 @itemx -weak_reference_mismatches
10110 @itemx -whatsloaded
10111 @opindex allowable_client
10112 @opindex client_name
10113 @opindex compatibility_version
10114 @opindex current_version
10115 @opindex dead_strip
10116 @opindex dependency-file
10117 @opindex dylib_file
10118 @opindex dylinker_install_name
10119 @opindex dynamic
10120 @opindex exported_symbols_list
10121 @opindex filelist
10122 @opindex flat_namespace
10123 @opindex force_flat_namespace
10124 @opindex headerpad_max_install_names
10125 @opindex image_base
10126 @opindex init
10127 @opindex install_name
10128 @opindex keep_private_externs
10129 @opindex multi_module
10130 @opindex multiply_defined
10131 @opindex multiply_defined_unused
10132 @opindex noall_load
10133 @opindex no_dead_strip_inits_and_terms
10134 @opindex nofixprebinding
10135 @opindex nomultidefs
10136 @opindex noprebind
10137 @opindex noseglinkedit
10138 @opindex pagezero_size
10139 @opindex prebind
10140 @opindex prebind_all_twolevel_modules
10141 @opindex private_bundle
10142 @opindex read_only_relocs
10143 @opindex sectalign
10144 @opindex sectobjectsymbols
10145 @opindex whyload
10146 @opindex seg1addr
10147 @opindex sectcreate
10148 @opindex sectobjectsymbols
10149 @opindex sectorder
10150 @opindex segaddr
10151 @opindex segs_read_only_addr
10152 @opindex segs_read_write_addr
10153 @opindex seg_addr_table
10154 @opindex seg_addr_table_filename
10155 @opindex seglinkedit
10156 @opindex segprot
10157 @opindex segs_read_only_addr
10158 @opindex segs_read_write_addr
10159 @opindex single_module
10160 @opindex static
10161 @opindex sub_library
10162 @opindex sub_umbrella
10163 @opindex twolevel_namespace
10164 @opindex umbrella
10165 @opindex undefined
10166 @opindex unexported_symbols_list
10167 @opindex weak_reference_mismatches
10168 @opindex whatsloaded
10169 These options are passed to the Darwin linker.  The Darwin linker man page
10170 describes them in detail.
10171 @end table
10172
10173 @node DEC Alpha Options
10174 @subsection DEC Alpha Options
10175
10176 These @samp{-m} options are defined for the DEC Alpha implementations:
10177
10178 @table @gcctabopt
10179 @item -mno-soft-float
10180 @itemx -msoft-float
10181 @opindex mno-soft-float
10182 @opindex msoft-float
10183 Use (do not use) the hardware floating-point instructions for
10184 floating-point operations.  When @option{-msoft-float} is specified,
10185 functions in @file{libgcc.a} will be used to perform floating-point
10186 operations.  Unless they are replaced by routines that emulate the
10187 floating-point operations, or compiled in such a way as to call such
10188 emulations routines, these routines will issue floating-point
10189 operations.   If you are compiling for an Alpha without floating-point
10190 operations, you must ensure that the library is built so as not to call
10191 them.
10192
10193 Note that Alpha implementations without floating-point operations are
10194 required to have floating-point registers.
10195
10196 @item -mfp-reg
10197 @itemx -mno-fp-regs
10198 @opindex mfp-reg
10199 @opindex mno-fp-regs
10200 Generate code that uses (does not use) the floating-point register set.
10201 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
10202 register set is not used, floating point operands are passed in integer
10203 registers as if they were integers and floating-point results are passed
10204 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
10205 so any function with a floating-point argument or return value called by code
10206 compiled with @option{-mno-fp-regs} must also be compiled with that
10207 option.
10208
10209 A typical use of this option is building a kernel that does not use,
10210 and hence need not save and restore, any floating-point registers.
10211
10212 @item -mieee
10213 @opindex mieee
10214 The Alpha architecture implements floating-point hardware optimized for
10215 maximum performance.  It is mostly compliant with the IEEE floating
10216 point standard.  However, for full compliance, software assistance is
10217 required.  This option generates code fully IEEE compliant code
10218 @emph{except} that the @var{inexact-flag} is not maintained (see below).
10219 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
10220 defined during compilation.  The resulting code is less efficient but is
10221 able to correctly support denormalized numbers and exceptional IEEE
10222 values such as not-a-number and plus/minus infinity.  Other Alpha
10223 compilers call this option @option{-ieee_with_no_inexact}.
10224
10225 @item -mieee-with-inexact
10226 @opindex mieee-with-inexact
10227 This is like @option{-mieee} except the generated code also maintains
10228 the IEEE @var{inexact-flag}.  Turning on this option causes the
10229 generated code to implement fully-compliant IEEE math.  In addition to
10230 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
10231 macro.  On some Alpha implementations the resulting code may execute
10232 significantly slower than the code generated by default.  Since there is
10233 very little code that depends on the @var{inexact-flag}, you should
10234 normally not specify this option.  Other Alpha compilers call this
10235 option @option{-ieee_with_inexact}.
10236
10237 @item -mfp-trap-mode=@var{trap-mode}
10238 @opindex mfp-trap-mode
10239 This option controls what floating-point related traps are enabled.
10240 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
10241 The trap mode can be set to one of four values:
10242
10243 @table @samp
10244 @item n
10245 This is the default (normal) setting.  The only traps that are enabled
10246 are the ones that cannot be disabled in software (e.g., division by zero
10247 trap).
10248
10249 @item u
10250 In addition to the traps enabled by @samp{n}, underflow traps are enabled
10251 as well.
10252
10253 @item su
10254 Like @samp{u}, but the instructions are marked to be safe for software
10255 completion (see Alpha architecture manual for details).
10256
10257 @item sui
10258 Like @samp{su}, but inexact traps are enabled as well.
10259 @end table
10260
10261 @item -mfp-rounding-mode=@var{rounding-mode}
10262 @opindex mfp-rounding-mode
10263 Selects the IEEE rounding mode.  Other Alpha compilers call this option
10264 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
10265 of:
10266
10267 @table @samp
10268 @item n
10269 Normal IEEE rounding mode.  Floating point numbers are rounded towards
10270 the nearest machine number or towards the even machine number in case
10271 of a tie.
10272
10273 @item m
10274 Round towards minus infinity.
10275
10276 @item c
10277 Chopped rounding mode.  Floating point numbers are rounded towards zero.
10278
10279 @item d
10280 Dynamic rounding mode.  A field in the floating point control register
10281 (@var{fpcr}, see Alpha architecture reference manual) controls the
10282 rounding mode in effect.  The C library initializes this register for
10283 rounding towards plus infinity.  Thus, unless your program modifies the
10284 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
10285 @end table
10286
10287 @item -mtrap-precision=@var{trap-precision}
10288 @opindex mtrap-precision
10289 In the Alpha architecture, floating point traps are imprecise.  This
10290 means without software assistance it is impossible to recover from a
10291 floating trap and program execution normally needs to be terminated.
10292 GCC can generate code that can assist operating system trap handlers
10293 in determining the exact location that caused a floating point trap.
10294 Depending on the requirements of an application, different levels of
10295 precisions can be selected:
10296
10297 @table @samp
10298 @item p
10299 Program precision.  This option is the default and means a trap handler
10300 can only identify which program caused a floating point exception.
10301
10302 @item f
10303 Function precision.  The trap handler can determine the function that
10304 caused a floating point exception.
10305
10306 @item i
10307 Instruction precision.  The trap handler can determine the exact
10308 instruction that caused a floating point exception.
10309 @end table
10310
10311 Other Alpha compilers provide the equivalent options called
10312 @option{-scope_safe} and @option{-resumption_safe}.
10313
10314 @item -mieee-conformant
10315 @opindex mieee-conformant
10316 This option marks the generated code as IEEE conformant.  You must not
10317 use this option unless you also specify @option{-mtrap-precision=i} and either
10318 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
10319 is to emit the line @samp{.eflag 48} in the function prologue of the
10320 generated assembly file.  Under DEC Unix, this has the effect that
10321 IEEE-conformant math library routines will be linked in.
10322
10323 @item -mbuild-constants
10324 @opindex mbuild-constants
10325 Normally GCC examines a 32- or 64-bit integer constant to
10326 see if it can construct it from smaller constants in two or three
10327 instructions.  If it cannot, it will output the constant as a literal and
10328 generate code to load it from the data segment at runtime.
10329
10330 Use this option to require GCC to construct @emph{all} integer constants
10331 using code, even if it takes more instructions (the maximum is six).
10332
10333 You would typically use this option to build a shared library dynamic
10334 loader.  Itself a shared library, it must relocate itself in memory
10335 before it can find the variables and constants in its own data segment.
10336
10337 @item -malpha-as
10338 @itemx -mgas
10339 @opindex malpha-as
10340 @opindex mgas
10341 Select whether to generate code to be assembled by the vendor-supplied
10342 assembler (@option{-malpha-as}) or by the GNU assembler @option{-mgas}.
10343
10344 @item -mbwx
10345 @itemx -mno-bwx
10346 @itemx -mcix
10347 @itemx -mno-cix
10348 @itemx -mfix
10349 @itemx -mno-fix
10350 @itemx -mmax
10351 @itemx -mno-max
10352 @opindex mbwx
10353 @opindex mno-bwx
10354 @opindex mcix
10355 @opindex mno-cix
10356 @opindex mfix
10357 @opindex mno-fix
10358 @opindex mmax
10359 @opindex mno-max
10360 Indicate whether GCC should generate code to use the optional BWX,
10361 CIX, FIX and MAX instruction sets.  The default is to use the instruction
10362 sets supported by the CPU type specified via @option{-mcpu=} option or that
10363 of the CPU on which GCC was built if none was specified.
10364
10365 @item -mfloat-vax
10366 @itemx -mfloat-ieee
10367 @opindex mfloat-vax
10368 @opindex mfloat-ieee
10369 Generate code that uses (does not use) VAX F and G floating point
10370 arithmetic instead of IEEE single and double precision.
10371
10372 @item -mexplicit-relocs
10373 @itemx -mno-explicit-relocs
10374 @opindex mexplicit-relocs
10375 @opindex mno-explicit-relocs
10376 Older Alpha assemblers provided no way to generate symbol relocations
10377 except via assembler macros.  Use of these macros does not allow
10378 optimal instruction scheduling.  GNU binutils as of version 2.12
10379 supports a new syntax that allows the compiler to explicitly mark
10380 which relocations should apply to which instructions.  This option
10381 is mostly useful for debugging, as GCC detects the capabilities of
10382 the assembler when it is built and sets the default accordingly.
10383
10384 @item -msmall-data
10385 @itemx -mlarge-data
10386 @opindex msmall-data
10387 @opindex mlarge-data
10388 When @option{-mexplicit-relocs} is in effect, static data is
10389 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
10390 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
10391 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
10392 16-bit relocations off of the @code{$gp} register.  This limits the
10393 size of the small data area to 64KB, but allows the variables to be
10394 directly accessed via a single instruction.
10395
10396 The default is @option{-mlarge-data}.  With this option the data area
10397 is limited to just below 2GB@.  Programs that require more than 2GB of
10398 data must use @code{malloc} or @code{mmap} to allocate the data in the
10399 heap instead of in the program's data segment.
10400
10401 When generating code for shared libraries, @option{-fpic} implies
10402 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
10403
10404 @item -msmall-text
10405 @itemx -mlarge-text
10406 @opindex msmall-text
10407 @opindex mlarge-text
10408 When @option{-msmall-text} is used, the compiler assumes that the
10409 code of the entire program (or shared library) fits in 4MB, and is
10410 thus reachable with a branch instruction.  When @option{-msmall-data}
10411 is used, the compiler can assume that all local symbols share the
10412 same @code{$gp} value, and thus reduce the number of instructions
10413 required for a function call from 4 to 1.
10414
10415 The default is @option{-mlarge-text}.
10416
10417 @item -mcpu=@var{cpu_type}
10418 @opindex mcpu
10419 Set the instruction set and instruction scheduling parameters for
10420 machine type @var{cpu_type}.  You can specify either the @samp{EV}
10421 style name or the corresponding chip number.  GCC supports scheduling
10422 parameters for the EV4, EV5 and EV6 family of processors and will
10423 choose the default values for the instruction set from the processor
10424 you specify.  If you do not specify a processor type, GCC will default
10425 to the processor on which the compiler was built.
10426
10427 Supported values for @var{cpu_type} are
10428
10429 @table @samp
10430 @item ev4
10431 @itemx ev45
10432 @itemx 21064
10433 Schedules as an EV4 and has no instruction set extensions.
10434
10435 @item ev5
10436 @itemx 21164
10437 Schedules as an EV5 and has no instruction set extensions.
10438
10439 @item ev56
10440 @itemx 21164a
10441 Schedules as an EV5 and supports the BWX extension.
10442
10443 @item pca56
10444 @itemx 21164pc
10445 @itemx 21164PC
10446 Schedules as an EV5 and supports the BWX and MAX extensions.
10447
10448 @item ev6
10449 @itemx 21264
10450 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
10451
10452 @item ev67
10453 @itemx 21264a
10454 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
10455 @end table
10456
10457 Native Linux/GNU toolchains also support the value @samp{native},
10458 which selects the best architecture option for the host processor.
10459 @option{-mcpu=native} has no effect if GCC does not recognize
10460 the processor.
10461
10462 @item -mtune=@var{cpu_type}
10463 @opindex mtune
10464 Set only the instruction scheduling parameters for machine type
10465 @var{cpu_type}.  The instruction set is not changed.
10466
10467 Native Linux/GNU toolchains also support the value @samp{native},
10468 which selects the best architecture option for the host processor.
10469 @option{-mtune=native} has no effect if GCC does not recognize
10470 the processor.
10471
10472 @item -mmemory-latency=@var{time}
10473 @opindex mmemory-latency
10474 Sets the latency the scheduler should assume for typical memory
10475 references as seen by the application.  This number is highly
10476 dependent on the memory access patterns used by the application
10477 and the size of the external cache on the machine.
10478
10479 Valid options for @var{time} are
10480
10481 @table @samp
10482 @item @var{number}
10483 A decimal number representing clock cycles.
10484
10485 @item L1
10486 @itemx L2
10487 @itemx L3
10488 @itemx main
10489 The compiler contains estimates of the number of clock cycles for
10490 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
10491 (also called Dcache, Scache, and Bcache), as well as to main memory.
10492 Note that L3 is only valid for EV5.
10493
10494 @end table
10495 @end table
10496
10497 @node DEC Alpha/VMS Options
10498 @subsection DEC Alpha/VMS Options
10499
10500 These @samp{-m} options are defined for the DEC Alpha/VMS implementations:
10501
10502 @table @gcctabopt
10503 @item -mvms-return-codes
10504 @opindex mvms-return-codes
10505 Return VMS condition codes from main.  The default is to return POSIX
10506 style condition (e.g.@: error) codes.
10507 @end table
10508
10509 @node FR30 Options
10510 @subsection FR30 Options
10511 @cindex FR30 Options
10512
10513 These options are defined specifically for the FR30 port.
10514
10515 @table @gcctabopt
10516
10517 @item -msmall-model
10518 @opindex msmall-model
10519 Use the small address space model.  This can produce smaller code, but
10520 it does assume that all symbolic values and addresses will fit into a
10521 20-bit range.
10522
10523 @item -mno-lsim
10524 @opindex mno-lsim
10525 Assume that run-time support has been provided and so there is no need
10526 to include the simulator library (@file{libsim.a}) on the linker
10527 command line.
10528
10529 @end table
10530
10531 @node FRV Options
10532 @subsection FRV Options
10533 @cindex FRV Options
10534
10535 @table @gcctabopt
10536 @item -mgpr-32
10537 @opindex mgpr-32
10538
10539 Only use the first 32 general purpose registers.
10540
10541 @item -mgpr-64
10542 @opindex mgpr-64
10543
10544 Use all 64 general purpose registers.
10545
10546 @item -mfpr-32
10547 @opindex mfpr-32
10548
10549 Use only the first 32 floating point registers.
10550
10551 @item -mfpr-64
10552 @opindex mfpr-64
10553
10554 Use all 64 floating point registers
10555
10556 @item -mhard-float
10557 @opindex mhard-float
10558
10559 Use hardware instructions for floating point operations.
10560
10561 @item -msoft-float
10562 @opindex msoft-float
10563
10564 Use library routines for floating point operations.
10565
10566 @item -malloc-cc
10567 @opindex malloc-cc
10568
10569 Dynamically allocate condition code registers.
10570
10571 @item -mfixed-cc
10572 @opindex mfixed-cc
10573
10574 Do not try to dynamically allocate condition code registers, only
10575 use @code{icc0} and @code{fcc0}.
10576
10577 @item -mdword
10578 @opindex mdword
10579
10580 Change ABI to use double word insns.
10581
10582 @item -mno-dword
10583 @opindex mno-dword
10584
10585 Do not use double word instructions.
10586
10587 @item -mdouble
10588 @opindex mdouble
10589
10590 Use floating point double instructions.
10591
10592 @item -mno-double
10593 @opindex mno-double
10594
10595 Do not use floating point double instructions.
10596
10597 @item -mmedia
10598 @opindex mmedia
10599
10600 Use media instructions.
10601
10602 @item -mno-media
10603 @opindex mno-media
10604
10605 Do not use media instructions.
10606
10607 @item -mmuladd
10608 @opindex mmuladd
10609
10610 Use multiply and add/subtract instructions.
10611
10612 @item -mno-muladd
10613 @opindex mno-muladd
10614
10615 Do not use multiply and add/subtract instructions.
10616
10617 @item -mfdpic
10618 @opindex mfdpic
10619
10620 Select the FDPIC ABI, that uses function descriptors to represent
10621 pointers to functions.  Without any PIC/PIE-related options, it
10622 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
10623 assumes GOT entries and small data are within a 12-bit range from the
10624 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
10625 are computed with 32 bits.
10626 With a @samp{bfin-elf} target, this option implies @option{-msim}.
10627
10628 @item -minline-plt
10629 @opindex minline-plt
10630
10631 Enable inlining of PLT entries in function calls to functions that are
10632 not known to bind locally.  It has no effect without @option{-mfdpic}.
10633 It's enabled by default if optimizing for speed and compiling for
10634 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
10635 optimization option such as @option{-O3} or above is present in the
10636 command line.
10637
10638 @item -mTLS
10639 @opindex mTLS
10640
10641 Assume a large TLS segment when generating thread-local code.
10642
10643 @item -mtls
10644 @opindex mtls
10645
10646 Do not assume a large TLS segment when generating thread-local code.
10647
10648 @item -mgprel-ro
10649 @opindex mgprel-ro
10650
10651 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
10652 that is known to be in read-only sections.  It's enabled by default,
10653 except for @option{-fpic} or @option{-fpie}: even though it may help
10654 make the global offset table smaller, it trades 1 instruction for 4.
10655 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
10656 one of which may be shared by multiple symbols, and it avoids the need
10657 for a GOT entry for the referenced symbol, so it's more likely to be a
10658 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
10659
10660 @item -multilib-library-pic
10661 @opindex multilib-library-pic
10662
10663 Link with the (library, not FD) pic libraries.  It's implied by
10664 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
10665 @option{-fpic} without @option{-mfdpic}.  You should never have to use
10666 it explicitly.
10667
10668 @item -mlinked-fp
10669 @opindex mlinked-fp
10670
10671 Follow the EABI requirement of always creating a frame pointer whenever
10672 a stack frame is allocated.  This option is enabled by default and can
10673 be disabled with @option{-mno-linked-fp}.
10674
10675 @item -mlong-calls
10676 @opindex mlong-calls
10677
10678 Use indirect addressing to call functions outside the current
10679 compilation unit.  This allows the functions to be placed anywhere
10680 within the 32-bit address space.
10681
10682 @item -malign-labels
10683 @opindex malign-labels
10684
10685 Try to align labels to an 8-byte boundary by inserting nops into the
10686 previous packet.  This option only has an effect when VLIW packing
10687 is enabled.  It doesn't create new packets; it merely adds nops to
10688 existing ones.
10689
10690 @item -mlibrary-pic
10691 @opindex mlibrary-pic
10692
10693 Generate position-independent EABI code.
10694
10695 @item -macc-4
10696 @opindex macc-4
10697
10698 Use only the first four media accumulator registers.
10699
10700 @item -macc-8
10701 @opindex macc-8
10702
10703 Use all eight media accumulator registers.
10704
10705 @item -mpack
10706 @opindex mpack
10707
10708 Pack VLIW instructions.
10709
10710 @item -mno-pack
10711 @opindex mno-pack
10712
10713 Do not pack VLIW instructions.
10714
10715 @item -mno-eflags
10716 @opindex mno-eflags
10717
10718 Do not mark ABI switches in e_flags.
10719
10720 @item -mcond-move
10721 @opindex mcond-move
10722
10723 Enable the use of conditional-move instructions (default).
10724
10725 This switch is mainly for debugging the compiler and will likely be removed
10726 in a future version.
10727
10728 @item -mno-cond-move
10729 @opindex mno-cond-move
10730
10731 Disable the use of conditional-move instructions.
10732
10733 This switch is mainly for debugging the compiler and will likely be removed
10734 in a future version.
10735
10736 @item -mscc
10737 @opindex mscc
10738
10739 Enable the use of conditional set instructions (default).
10740
10741 This switch is mainly for debugging the compiler and will likely be removed
10742 in a future version.
10743
10744 @item -mno-scc
10745 @opindex mno-scc
10746
10747 Disable the use of conditional set instructions.
10748
10749 This switch is mainly for debugging the compiler and will likely be removed
10750 in a future version.
10751
10752 @item -mcond-exec
10753 @opindex mcond-exec
10754
10755 Enable the use of conditional execution (default).
10756
10757 This switch is mainly for debugging the compiler and will likely be removed
10758 in a future version.
10759
10760 @item -mno-cond-exec
10761 @opindex mno-cond-exec
10762
10763 Disable the use of conditional execution.
10764
10765 This switch is mainly for debugging the compiler and will likely be removed
10766 in a future version.
10767
10768 @item -mvliw-branch
10769 @opindex mvliw-branch
10770
10771 Run a pass to pack branches into VLIW instructions (default).
10772
10773 This switch is mainly for debugging the compiler and will likely be removed
10774 in a future version.
10775
10776 @item -mno-vliw-branch
10777 @opindex mno-vliw-branch
10778
10779 Do not run a pass to pack branches into VLIW instructions.
10780
10781 This switch is mainly for debugging the compiler and will likely be removed
10782 in a future version.
10783
10784 @item -mmulti-cond-exec
10785 @opindex mmulti-cond-exec
10786
10787 Enable optimization of @code{&&} and @code{||} in conditional execution
10788 (default).
10789
10790 This switch is mainly for debugging the compiler and will likely be removed
10791 in a future version.
10792
10793 @item -mno-multi-cond-exec
10794 @opindex mno-multi-cond-exec
10795
10796 Disable optimization of @code{&&} and @code{||} in conditional execution.
10797
10798 This switch is mainly for debugging the compiler and will likely be removed
10799 in a future version.
10800
10801 @item -mnested-cond-exec
10802 @opindex mnested-cond-exec
10803
10804 Enable nested conditional execution optimizations (default).
10805
10806 This switch is mainly for debugging the compiler and will likely be removed
10807 in a future version.
10808
10809 @item -mno-nested-cond-exec
10810 @opindex mno-nested-cond-exec
10811
10812 Disable nested conditional execution optimizations.
10813
10814 This switch is mainly for debugging the compiler and will likely be removed
10815 in a future version.
10816
10817 @item -moptimize-membar
10818 @opindex moptimize-membar
10819
10820 This switch removes redundant @code{membar} instructions from the
10821 compiler generated code.  It is enabled by default.
10822
10823 @item -mno-optimize-membar
10824 @opindex mno-optimize-membar
10825
10826 This switch disables the automatic removal of redundant @code{membar}
10827 instructions from the generated code.
10828
10829 @item -mtomcat-stats
10830 @opindex mtomcat-stats
10831
10832 Cause gas to print out tomcat statistics.
10833
10834 @item -mcpu=@var{cpu}
10835 @opindex mcpu
10836
10837 Select the processor type for which to generate code.  Possible values are
10838 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
10839 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
10840
10841 @end table
10842
10843 @node GNU/Linux Options
10844 @subsection GNU/Linux Options
10845
10846 These @samp{-m} options are defined for GNU/Linux targets:
10847
10848 @table @gcctabopt
10849 @item -mglibc
10850 @opindex mglibc
10851 Use the GNU C library instead of uClibc.  This is the default except
10852 on @samp{*-*-linux-*uclibc*} targets.
10853
10854 @item -muclibc
10855 @opindex muclibc
10856 Use uClibc instead of the GNU C library.  This is the default on
10857 @samp{*-*-linux-*uclibc*} targets.
10858 @end table
10859
10860 @node H8/300 Options
10861 @subsection H8/300 Options
10862
10863 These @samp{-m} options are defined for the H8/300 implementations:
10864
10865 @table @gcctabopt
10866 @item -mrelax
10867 @opindex mrelax
10868 Shorten some address references at link time, when possible; uses the
10869 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
10870 ld, Using ld}, for a fuller description.
10871
10872 @item -mh
10873 @opindex mh
10874 Generate code for the H8/300H@.
10875
10876 @item -ms
10877 @opindex ms
10878 Generate code for the H8S@.
10879
10880 @item -mn
10881 @opindex mn
10882 Generate code for the H8S and H8/300H in the normal mode.  This switch
10883 must be used either with @option{-mh} or @option{-ms}.
10884
10885 @item -ms2600
10886 @opindex ms2600
10887 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
10888
10889 @item -mint32
10890 @opindex mint32
10891 Make @code{int} data 32 bits by default.
10892
10893 @item -malign-300
10894 @opindex malign-300
10895 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
10896 The default for the H8/300H and H8S is to align longs and floats on 4
10897 byte boundaries.
10898 @option{-malign-300} causes them to be aligned on 2 byte boundaries.
10899 This option has no effect on the H8/300.
10900 @end table
10901
10902 @node HPPA Options
10903 @subsection HPPA Options
10904 @cindex HPPA Options
10905
10906 These @samp{-m} options are defined for the HPPA family of computers:
10907
10908 @table @gcctabopt
10909 @item -march=@var{architecture-type}
10910 @opindex march
10911 Generate code for the specified architecture.  The choices for
10912 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
10913 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
10914 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
10915 architecture option for your machine.  Code compiled for lower numbered
10916 architectures will run on higher numbered architectures, but not the
10917 other way around.
10918
10919 @item -mpa-risc-1-0
10920 @itemx -mpa-risc-1-1
10921 @itemx -mpa-risc-2-0
10922 @opindex mpa-risc-1-0
10923 @opindex mpa-risc-1-1
10924 @opindex mpa-risc-2-0
10925 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
10926
10927 @item -mbig-switch
10928 @opindex mbig-switch
10929 Generate code suitable for big switch tables.  Use this option only if
10930 the assembler/linker complain about out of range branches within a switch
10931 table.
10932
10933 @item -mjump-in-delay
10934 @opindex mjump-in-delay
10935 Fill delay slots of function calls with unconditional jump instructions
10936 by modifying the return pointer for the function call to be the target
10937 of the conditional jump.
10938
10939 @item -mdisable-fpregs
10940 @opindex mdisable-fpregs
10941 Prevent floating point registers from being used in any manner.  This is
10942 necessary for compiling kernels which perform lazy context switching of
10943 floating point registers.  If you use this option and attempt to perform
10944 floating point operations, the compiler will abort.
10945
10946 @item -mdisable-indexing
10947 @opindex mdisable-indexing
10948 Prevent the compiler from using indexing address modes.  This avoids some
10949 rather obscure problems when compiling MIG generated code under MACH@.
10950
10951 @item -mno-space-regs
10952 @opindex mno-space-regs
10953 Generate code that assumes the target has no space registers.  This allows
10954 GCC to generate faster indirect calls and use unscaled index address modes.
10955
10956 Such code is suitable for level 0 PA systems and kernels.
10957
10958 @item -mfast-indirect-calls
10959 @opindex mfast-indirect-calls
10960 Generate code that assumes calls never cross space boundaries.  This
10961 allows GCC to emit code which performs faster indirect calls.
10962
10963 This option will not work in the presence of shared libraries or nested
10964 functions.
10965
10966 @item -mfixed-range=@var{register-range}
10967 @opindex mfixed-range
10968 Generate code treating the given register range as fixed registers.
10969 A fixed register is one that the register allocator can not use.  This is
10970 useful when compiling kernel code.  A register range is specified as
10971 two registers separated by a dash.  Multiple register ranges can be
10972 specified separated by a comma.
10973
10974 @item -mlong-load-store
10975 @opindex mlong-load-store
10976 Generate 3-instruction load and store sequences as sometimes required by
10977 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
10978 the HP compilers.
10979
10980 @item -mportable-runtime
10981 @opindex mportable-runtime
10982 Use the portable calling conventions proposed by HP for ELF systems.
10983
10984 @item -mgas
10985 @opindex mgas
10986 Enable the use of assembler directives only GAS understands.
10987
10988 @item -mschedule=@var{cpu-type}
10989 @opindex mschedule
10990 Schedule code according to the constraints for the machine type
10991 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
10992 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
10993 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
10994 proper scheduling option for your machine.  The default scheduling is
10995 @samp{8000}.
10996
10997 @item -mlinker-opt
10998 @opindex mlinker-opt
10999 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
11000 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
11001 linkers in which they give bogus error messages when linking some programs.
11002
11003 @item -msoft-float
11004 @opindex msoft-float
11005 Generate output containing library calls for floating point.
11006 @strong{Warning:} the requisite libraries are not available for all HPPA
11007 targets.  Normally the facilities of the machine's usual C compiler are
11008 used, but this cannot be done directly in cross-compilation.  You must make
11009 your own arrangements to provide suitable library functions for
11010 cross-compilation.
11011
11012 @option{-msoft-float} changes the calling convention in the output file;
11013 therefore, it is only useful if you compile @emph{all} of a program with
11014 this option.  In particular, you need to compile @file{libgcc.a}, the
11015 library that comes with GCC, with @option{-msoft-float} in order for
11016 this to work.
11017
11018 @item -msio
11019 @opindex msio
11020 Generate the predefine, @code{_SIO}, for server IO@.  The default is
11021 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
11022 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
11023 options are available under HP-UX and HI-UX@.
11024
11025 @item -mgnu-ld
11026 @opindex mgnu-ld
11027 Use GNU ld specific options.  This passes @option{-shared} to ld when
11028 building a shared library.  It is the default when GCC is configured,
11029 explicitly or implicitly, with the GNU linker.  This option does not
11030 have any affect on which ld is called, it only changes what parameters
11031 are passed to that ld.  The ld that is called is determined by the
11032 @option{--with-ld} configure option, GCC's program search path, and
11033 finally by the user's @env{PATH}.  The linker used by GCC can be printed
11034 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
11035 on the 64 bit HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
11036
11037 @item -mhp-ld
11038 @opindex mhp-ld
11039 Use HP ld specific options.  This passes @option{-b} to ld when building
11040 a shared library and passes @option{+Accept TypeMismatch} to ld on all
11041 links.  It is the default when GCC is configured, explicitly or
11042 implicitly, with the HP linker.  This option does not have any affect on
11043 which ld is called, it only changes what parameters are passed to that
11044 ld.  The ld that is called is determined by the @option{--with-ld}
11045 configure option, GCC's program search path, and finally by the user's
11046 @env{PATH}.  The linker used by GCC can be printed using @samp{which
11047 `gcc -print-prog-name=ld`}.  This option is only available on the 64 bit
11048 HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
11049
11050 @item -mlong-calls
11051 @opindex mno-long-calls
11052 Generate code that uses long call sequences.  This ensures that a call
11053 is always able to reach linker generated stubs.  The default is to generate
11054 long calls only when the distance from the call site to the beginning
11055 of the function or translation unit, as the case may be, exceeds a
11056 predefined limit set by the branch type being used.  The limits for
11057 normal calls are 7,600,000 and 240,000 bytes, respectively for the
11058 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
11059 240,000 bytes.
11060
11061 Distances are measured from the beginning of functions when using the
11062 @option{-ffunction-sections} option, or when using the @option{-mgas}
11063 and @option{-mno-portable-runtime} options together under HP-UX with
11064 the SOM linker.
11065
11066 It is normally not desirable to use this option as it will degrade
11067 performance.  However, it may be useful in large applications,
11068 particularly when partial linking is used to build the application.
11069
11070 The types of long calls used depends on the capabilities of the
11071 assembler and linker, and the type of code being generated.  The
11072 impact on systems that support long absolute calls, and long pic
11073 symbol-difference or pc-relative calls should be relatively small.
11074 However, an indirect call is used on 32-bit ELF systems in pic code
11075 and it is quite long.
11076
11077 @item -munix=@var{unix-std}
11078 @opindex march
11079 Generate compiler predefines and select a startfile for the specified
11080 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
11081 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
11082 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
11083 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
11084 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
11085 and later.
11086
11087 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
11088 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
11089 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
11090 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
11091 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
11092 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
11093
11094 It is @emph{important} to note that this option changes the interfaces
11095 for various library routines.  It also affects the operational behavior
11096 of the C library.  Thus, @emph{extreme} care is needed in using this
11097 option.
11098
11099 Library code that is intended to operate with more than one UNIX
11100 standard must test, set and restore the variable @var{__xpg4_extended_mask}
11101 as appropriate.  Most GNU software doesn't provide this capability.
11102
11103 @item -nolibdld
11104 @opindex nolibdld
11105 Suppress the generation of link options to search libdld.sl when the
11106 @option{-static} option is specified on HP-UX 10 and later.
11107
11108 @item -static
11109 @opindex static
11110 The HP-UX implementation of setlocale in libc has a dependency on
11111 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
11112 when the @option{-static} option is specified, special link options
11113 are needed to resolve this dependency.
11114
11115 On HP-UX 10 and later, the GCC driver adds the necessary options to
11116 link with libdld.sl when the @option{-static} option is specified.
11117 This causes the resulting binary to be dynamic.  On the 64-bit port,
11118 the linkers generate dynamic binaries by default in any case.  The
11119 @option{-nolibdld} option can be used to prevent the GCC driver from
11120 adding these link options.
11121
11122 @item -threads
11123 @opindex threads
11124 Add support for multithreading with the @dfn{dce thread} library
11125 under HP-UX@.  This option sets flags for both the preprocessor and
11126 linker.
11127 @end table
11128
11129 @node i386 and x86-64 Options
11130 @subsection Intel 386 and AMD x86-64 Options
11131 @cindex i386 Options
11132 @cindex x86-64 Options
11133 @cindex Intel 386 Options
11134 @cindex AMD x86-64 Options
11135
11136 These @samp{-m} options are defined for the i386 and x86-64 family of
11137 computers:
11138
11139 @table @gcctabopt
11140 @item -mtune=@var{cpu-type}
11141 @opindex mtune
11142 Tune to @var{cpu-type} everything applicable about the generated code, except
11143 for the ABI and the set of available instructions.  The choices for
11144 @var{cpu-type} are:
11145 @table @emph
11146 @item generic
11147 Produce code optimized for the most common IA32/AMD64/EM64T processors.
11148 If you know the CPU on which your code will run, then you should use
11149 the corresponding @option{-mtune} option instead of
11150 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
11151 of your application will have, then you should use this option.
11152
11153 As new processors are deployed in the marketplace, the behavior of this
11154 option will change.  Therefore, if you upgrade to a newer version of
11155 GCC, the code generated option will change to reflect the processors
11156 that were most common when that version of GCC was released.
11157
11158 There is no @option{-march=generic} option because @option{-march}
11159 indicates the instruction set the compiler can use, and there is no
11160 generic instruction set applicable to all processors.  In contrast,
11161 @option{-mtune} indicates the processor (or, in this case, collection of
11162 processors) for which the code is optimized.
11163 @item native
11164 This selects the CPU to tune for at compilation time by determining
11165 the processor type of the compiling machine.  Using @option{-mtune=native}
11166 will produce code optimized for the local machine under the constraints
11167 of the selected instruction set.  Using @option{-march=native} will
11168 enable all instruction subsets supported by the local machine (hence
11169 the result might not run on different machines).
11170 @item i386
11171 Original Intel's i386 CPU@.
11172 @item i486
11173 Intel's i486 CPU@.  (No scheduling is implemented for this chip.)
11174 @item i586, pentium
11175 Intel Pentium CPU with no MMX support.
11176 @item pentium-mmx
11177 Intel PentiumMMX CPU based on Pentium core with MMX instruction set support.
11178 @item pentiumpro
11179 Intel PentiumPro CPU@.
11180 @item i686
11181 Same as @code{generic}, but when used as @code{march} option, PentiumPro
11182 instruction set will be used, so the code will run on all i686 family chips.
11183 @item pentium2
11184 Intel Pentium2 CPU based on PentiumPro core with MMX instruction set support.
11185 @item pentium3, pentium3m
11186 Intel Pentium3 CPU based on PentiumPro core with MMX and SSE instruction set
11187 support.
11188 @item pentium-m
11189 Low power version of Intel Pentium3 CPU with MMX, SSE and SSE2 instruction set
11190 support.  Used by Centrino notebooks.
11191 @item pentium4, pentium4m
11192 Intel Pentium4 CPU with MMX, SSE and SSE2 instruction set support.
11193 @item prescott
11194 Improved version of Intel Pentium4 CPU with MMX, SSE, SSE2 and SSE3 instruction
11195 set support.
11196 @item nocona
11197 Improved version of Intel Pentium4 CPU with 64-bit extensions, MMX, SSE,
11198 SSE2 and SSE3 instruction set support.
11199 @item core2
11200 Intel Core2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
11201 instruction set support.
11202 @item atom
11203 Intel Atom CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
11204 instruction set support.
11205 @item k6
11206 AMD K6 CPU with MMX instruction set support.
11207 @item k6-2, k6-3
11208 Improved versions of AMD K6 CPU with MMX and 3dNOW!@: instruction set support.
11209 @item athlon, athlon-tbird
11210 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW!@: and SSE prefetch instructions
11211 support.
11212 @item athlon-4, athlon-xp, athlon-mp
11213 Improved AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW!@: and full SSE
11214 instruction set support.
11215 @item k8, opteron, athlon64, athlon-fx
11216 AMD K8 core based CPUs with x86-64 instruction set support.  (This supersets
11217 MMX, SSE, SSE2, 3dNOW!, enhanced 3dNOW!@: and 64-bit instruction set extensions.)
11218 @item k8-sse3, opteron-sse3, athlon64-sse3
11219 Improved versions of k8, opteron and athlon64 with SSE3 instruction set support.
11220 @item amdfam10, barcelona
11221 AMD Family 10h core based CPUs with x86-64 instruction set support.  (This
11222 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3dNOW!, enhanced 3dNOW!, ABM and 64-bit
11223 instruction set extensions.)
11224 @item winchip-c6
11225 IDT Winchip C6 CPU, dealt in same way as i486 with additional MMX instruction
11226 set support.
11227 @item winchip2
11228 IDT Winchip2 CPU, dealt in same way as i486 with additional MMX and 3dNOW!@:
11229 instruction set support.
11230 @item c3
11231 Via C3 CPU with MMX and 3dNOW!@: instruction set support.  (No scheduling is
11232 implemented for this chip.)
11233 @item c3-2
11234 Via C3-2 CPU with MMX and SSE instruction set support.  (No scheduling is
11235 implemented for this chip.)
11236 @item geode
11237 Embedded AMD CPU with MMX and 3dNOW! instruction set support.
11238 @end table
11239
11240 While picking a specific @var{cpu-type} will schedule things appropriately
11241 for that particular chip, the compiler will not generate any code that
11242 does not run on the i386 without the @option{-march=@var{cpu-type}} option
11243 being used.
11244
11245 @item -march=@var{cpu-type}
11246 @opindex march
11247 Generate instructions for the machine type @var{cpu-type}.  The choices
11248 for @var{cpu-type} are the same as for @option{-mtune}.  Moreover,
11249 specifying @option{-march=@var{cpu-type}} implies @option{-mtune=@var{cpu-type}}.
11250
11251 @item -mcpu=@var{cpu-type}
11252 @opindex mcpu
11253 A deprecated synonym for @option{-mtune}.
11254
11255 @item -mfpmath=@var{unit}
11256 @opindex mfpmath
11257 Generate floating point arithmetics for selected unit @var{unit}.  The choices
11258 for @var{unit} are:
11259
11260 @table @samp
11261 @item 387
11262 Use the standard 387 floating point coprocessor present majority of chips and
11263 emulated otherwise.  Code compiled with this option will run almost everywhere.
11264 The temporary results are computed in 80bit precision instead of precision
11265 specified by the type resulting in slightly different results compared to most
11266 of other chips.  See @option{-ffloat-store} for more detailed description.
11267
11268 This is the default choice for i386 compiler.
11269
11270 @item sse
11271 Use scalar floating point instructions present in the SSE instruction set.
11272 This instruction set is supported by Pentium3 and newer chips, in the AMD line
11273 by Athlon-4, Athlon-xp and Athlon-mp chips.  The earlier version of SSE
11274 instruction set supports only single precision arithmetics, thus the double and
11275 extended precision arithmetics is still done using 387.  Later version, present
11276 only in Pentium4 and the future AMD x86-64 chips supports double precision
11277 arithmetics too.
11278
11279 For the i386 compiler, you need to use @option{-march=@var{cpu-type}}, @option{-msse}
11280 or @option{-msse2} switches to enable SSE extensions and make this option
11281 effective.  For the x86-64 compiler, these extensions are enabled by default.
11282
11283 The resulting code should be considerably faster in the majority of cases and avoid
11284 the numerical instability problems of 387 code, but may break some existing
11285 code that expects temporaries to be 80bit.
11286
11287 This is the default choice for the x86-64 compiler.
11288
11289 @item sse,387
11290 @itemx sse+387
11291 @itemx both
11292 Attempt to utilize both instruction sets at once.  This effectively double the
11293 amount of available registers and on chips with separate execution units for
11294 387 and SSE the execution resources too.  Use this option with care, as it is
11295 still experimental, because the GCC register allocator does not model separate
11296 functional units well resulting in instable performance.
11297 @end table
11298
11299 @item -masm=@var{dialect}
11300 @opindex masm=@var{dialect}
11301 Output asm instructions using selected @var{dialect}.  Supported
11302 choices are @samp{intel} or @samp{att} (the default one).  Darwin does
11303 not support @samp{intel}.
11304
11305 @item -mieee-fp
11306 @itemx -mno-ieee-fp
11307 @opindex mieee-fp
11308 @opindex mno-ieee-fp
11309 Control whether or not the compiler uses IEEE floating point
11310 comparisons.  These handle correctly the case where the result of a
11311 comparison is unordered.
11312
11313 @item -msoft-float
11314 @opindex msoft-float
11315 Generate output containing library calls for floating point.
11316 @strong{Warning:} the requisite libraries are not part of GCC@.
11317 Normally the facilities of the machine's usual C compiler are used, but
11318 this can't be done directly in cross-compilation.  You must make your
11319 own arrangements to provide suitable library functions for
11320 cross-compilation.
11321
11322 On machines where a function returns floating point results in the 80387
11323 register stack, some floating point opcodes may be emitted even if
11324 @option{-msoft-float} is used.
11325
11326 @item -mno-fp-ret-in-387
11327 @opindex mno-fp-ret-in-387
11328 Do not use the FPU registers for return values of functions.
11329
11330 The usual calling convention has functions return values of types
11331 @code{float} and @code{double} in an FPU register, even if there
11332 is no FPU@.  The idea is that the operating system should emulate
11333 an FPU@.
11334
11335 The option @option{-mno-fp-ret-in-387} causes such values to be returned
11336 in ordinary CPU registers instead.
11337
11338 @item -mno-fancy-math-387
11339 @opindex mno-fancy-math-387
11340 Some 387 emulators do not support the @code{sin}, @code{cos} and
11341 @code{sqrt} instructions for the 387.  Specify this option to avoid
11342 generating those instructions.  This option is the default on FreeBSD,
11343 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
11344 indicates that the target cpu will always have an FPU and so the
11345 instruction will not need emulation.  As of revision 2.6.1, these
11346 instructions are not generated unless you also use the
11347 @option{-funsafe-math-optimizations} switch.
11348
11349 @item -malign-double
11350 @itemx -mno-align-double
11351 @opindex malign-double
11352 @opindex mno-align-double
11353 Control whether GCC aligns @code{double}, @code{long double}, and
11354 @code{long long} variables on a two word boundary or a one word
11355 boundary.  Aligning @code{double} variables on a two word boundary will
11356 produce code that runs somewhat faster on a @samp{Pentium} at the
11357 expense of more memory.
11358
11359 On x86-64, @option{-malign-double} is enabled by default.
11360
11361 @strong{Warning:} if you use the @option{-malign-double} switch,
11362 structures containing the above types will be aligned differently than
11363 the published application binary interface specifications for the 386
11364 and will not be binary compatible with structures in code compiled
11365 without that switch.
11366
11367 @item -m96bit-long-double
11368 @itemx -m128bit-long-double
11369 @opindex m96bit-long-double
11370 @opindex m128bit-long-double
11371 These switches control the size of @code{long double} type.  The i386
11372 application binary interface specifies the size to be 96 bits,
11373 so @option{-m96bit-long-double} is the default in 32 bit mode.
11374
11375 Modern architectures (Pentium and newer) would prefer @code{long double}
11376 to be aligned to an 8 or 16 byte boundary.  In arrays or structures
11377 conforming to the ABI, this would not be possible.  So specifying a
11378 @option{-m128bit-long-double} will align @code{long double}
11379 to a 16 byte boundary by padding the @code{long double} with an additional
11380 32 bit zero.
11381
11382 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
11383 its ABI specifies that @code{long double} is to be aligned on 16 byte boundary.
11384
11385 Notice that neither of these options enable any extra precision over the x87
11386 standard of 80 bits for a @code{long double}.
11387
11388 @strong{Warning:} if you override the default value for your target ABI, the
11389 structures and arrays containing @code{long double} variables will change
11390 their size as well as function calling convention for function taking
11391 @code{long double} will be modified.  Hence they will not be binary
11392 compatible with arrays or structures in code compiled without that switch.
11393
11394 @item -mlarge-data-threshold=@var{number}
11395 @opindex mlarge-data-threshold=@var{number}
11396 When @option{-mcmodel=medium} is specified, the data greater than
11397 @var{threshold} are placed in large data section.  This value must be the
11398 same across all object linked into the binary and defaults to 65535.
11399
11400 @item -mrtd
11401 @opindex mrtd
11402 Use a different function-calling convention, in which functions that
11403 take a fixed number of arguments return with the @code{ret} @var{num}
11404 instruction, which pops their arguments while returning.  This saves one
11405 instruction in the caller since there is no need to pop the arguments
11406 there.
11407
11408 You can specify that an individual function is called with this calling
11409 sequence with the function attribute @samp{stdcall}.  You can also
11410 override the @option{-mrtd} option by using the function attribute
11411 @samp{cdecl}.  @xref{Function Attributes}.
11412
11413 @strong{Warning:} this calling convention is incompatible with the one
11414 normally used on Unix, so you cannot use it if you need to call
11415 libraries compiled with the Unix compiler.
11416
11417 Also, you must provide function prototypes for all functions that
11418 take variable numbers of arguments (including @code{printf});
11419 otherwise incorrect code will be generated for calls to those
11420 functions.
11421
11422 In addition, seriously incorrect code will result if you call a
11423 function with too many arguments.  (Normally, extra arguments are
11424 harmlessly ignored.)
11425
11426 @item -mregparm=@var{num}
11427 @opindex mregparm
11428 Control how many registers are used to pass integer arguments.  By
11429 default, no registers are used to pass arguments, and at most 3
11430 registers can be used.  You can control this behavior for a specific
11431 function by using the function attribute @samp{regparm}.
11432 @xref{Function Attributes}.
11433
11434 @strong{Warning:} if you use this switch, and
11435 @var{num} is nonzero, then you must build all modules with the same
11436 value, including any libraries.  This includes the system libraries and
11437 startup modules.
11438
11439 @item -msseregparm
11440 @opindex msseregparm
11441 Use SSE register passing conventions for float and double arguments
11442 and return values.  You can control this behavior for a specific
11443 function by using the function attribute @samp{sseregparm}.
11444 @xref{Function Attributes}.
11445
11446 @strong{Warning:} if you use this switch then you must build all
11447 modules with the same value, including any libraries.  This includes
11448 the system libraries and startup modules.
11449
11450 @item -mpc32
11451 @itemx -mpc64
11452 @itemx -mpc80
11453 @opindex mpc32
11454 @opindex mpc64
11455 @opindex mpc80
11456
11457 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
11458 is specified, the significands of results of floating-point operations are
11459 rounded to 24 bits (single precision); @option{-mpc64} rounds the
11460 significands of results of floating-point operations to 53 bits (double
11461 precision) and @option{-mpc80} rounds the significands of results of
11462 floating-point operations to 64 bits (extended double precision), which is
11463 the default.  When this option is used, floating-point operations in higher
11464 precisions are not available to the programmer without setting the FPU
11465 control word explicitly.
11466
11467 Setting the rounding of floating-point operations to less than the default
11468 80 bits can speed some programs by 2% or more.  Note that some mathematical
11469 libraries assume that extended precision (80 bit) floating-point operations
11470 are enabled by default; routines in such libraries could suffer significant
11471 loss of accuracy, typically through so-called "catastrophic cancellation",
11472 when this option is used to set the precision to less than extended precision. 
11473
11474 @item -mstackrealign
11475 @opindex mstackrealign
11476 Realign the stack at entry.  On the Intel x86, the @option{-mstackrealign}
11477 option will generate an alternate prologue and epilogue that realigns the
11478 runtime stack if necessary.  This supports mixing legacy codes that keep
11479 a 4-byte aligned stack with modern codes that keep a 16-byte stack for
11480 SSE compatibility.  See also the attribute @code{force_align_arg_pointer},
11481 applicable to individual functions.
11482
11483 @item -mpreferred-stack-boundary=@var{num}
11484 @opindex mpreferred-stack-boundary
11485 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
11486 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
11487 the default is 4 (16 bytes or 128 bits).
11488
11489 @item -mincoming-stack-boundary=@var{num}
11490 @opindex mincoming-stack-boundary
11491 Assume the incoming stack is aligned to a 2 raised to @var{num} byte
11492 boundary.  If @option{-mincoming-stack-boundary} is not specified,
11493 the one specified by @option{-mpreferred-stack-boundary} will be used.
11494
11495 On Pentium and PentiumPro, @code{double} and @code{long double} values
11496 should be aligned to an 8 byte boundary (see @option{-malign-double}) or
11497 suffer significant run time performance penalties.  On Pentium III, the
11498 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
11499 properly if it is not 16 byte aligned.
11500
11501 To ensure proper alignment of this values on the stack, the stack boundary
11502 must be as aligned as that required by any value stored on the stack.
11503 Further, every function must be generated such that it keeps the stack
11504 aligned.  Thus calling a function compiled with a higher preferred
11505 stack boundary from a function compiled with a lower preferred stack
11506 boundary will most likely misalign the stack.  It is recommended that
11507 libraries that use callbacks always use the default setting.
11508
11509 This extra alignment does consume extra stack space, and generally
11510 increases code size.  Code that is sensitive to stack space usage, such
11511 as embedded systems and operating system kernels, may want to reduce the
11512 preferred alignment to @option{-mpreferred-stack-boundary=2}.
11513
11514 @item -mmmx
11515 @itemx -mno-mmx
11516 @itemx -msse
11517 @itemx -mno-sse
11518 @itemx -msse2
11519 @itemx -mno-sse2
11520 @itemx -msse3
11521 @itemx -mno-sse3
11522 @itemx -mssse3
11523 @itemx -mno-ssse3
11524 @itemx -msse4.1
11525 @itemx -mno-sse4.1
11526 @itemx -msse4.2
11527 @itemx -mno-sse4.2
11528 @itemx -msse4
11529 @itemx -mno-sse4
11530 @itemx -mavx
11531 @itemx -mno-avx
11532 @itemx -maes
11533 @itemx -mno-aes
11534 @itemx -mpclmul
11535 @itemx -mno-pclmul
11536 @itemx -msse4a
11537 @itemx -mno-sse4a
11538 @itemx -msse5
11539 @itemx -mno-sse5
11540 @itemx -m3dnow
11541 @itemx -mno-3dnow
11542 @itemx -mpopcnt
11543 @itemx -mno-popcnt
11544 @itemx -mabm
11545 @itemx -mno-abm
11546 @opindex mmmx
11547 @opindex mno-mmx
11548 @opindex msse
11549 @opindex mno-sse
11550 @opindex m3dnow
11551 @opindex mno-3dnow
11552 These switches enable or disable the use of instructions in the MMX,
11553 SSE, SSE2, SSE3, SSSE3, SSE4.1, AVX, AES, PCLMUL, SSE4A, SSE5, ABM or
11554 3DNow!@: extended instruction sets.
11555 These extensions are also available as built-in functions: see
11556 @ref{X86 Built-in Functions}, for details of the functions enabled and
11557 disabled by these switches.
11558
11559 To have SSE/SSE2 instructions generated automatically from floating-point
11560 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
11561
11562 GCC depresses SSEx instructions when @option{-mavx} is used. Instead, it
11563 generates new AVX instructions or AVX equivalence for all SSEx instructions
11564 when needed.
11565
11566 These options will enable GCC to use these extended instructions in
11567 generated code, even without @option{-mfpmath=sse}.  Applications which
11568 perform runtime CPU detection must compile separate files for each
11569 supported architecture, using the appropriate flags.  In particular,
11570 the file containing the CPU detection code should be compiled without
11571 these options.
11572
11573 @item -mcld
11574 @opindex mcld
11575 This option instructs GCC to emit a @code{cld} instruction in the prologue
11576 of functions that use string instructions.  String instructions depend on
11577 the DF flag to select between autoincrement or autodecrement mode.  While the
11578 ABI specifies the DF flag to be cleared on function entry, some operating
11579 systems violate this specification by not clearing the DF flag in their
11580 exception dispatchers.  The exception handler can be invoked with the DF flag
11581 set which leads to wrong direction mode, when string instructions are used.
11582 This option can be enabled by default on 32-bit x86 targets by configuring
11583 GCC with the @option{--enable-cld} configure option.  Generation of @code{cld}
11584 instructions can be suppressed with the @option{-mno-cld} compiler option
11585 in this case.
11586
11587 @item -mcx16
11588 @opindex mcx16
11589 This option will enable GCC to use CMPXCHG16B instruction in generated code.
11590 CMPXCHG16B allows for atomic operations on 128-bit double quadword (or oword)
11591 data types.  This is useful for high resolution counters that could be updated
11592 by multiple processors (or cores).  This instruction is generated as part of
11593 atomic built-in functions: see @ref{Atomic Builtins} for details.
11594
11595 @item -msahf
11596 @opindex msahf
11597 This option will enable GCC to use SAHF instruction in generated 64-bit code.
11598 Early Intel CPUs with Intel 64 lacked LAHF and SAHF instructions supported
11599 by AMD64 until introduction of Pentium 4 G1 step in December 2005.  LAHF and
11600 SAHF are load and store instructions, respectively, for certain status flags.
11601 In 64-bit mode, SAHF instruction is used to optimize @code{fmod}, @code{drem}
11602 or @code{remainder} built-in functions: see @ref{Other Builtins} for details.
11603
11604 @item -mmovbe
11605 @opindex mmovbe
11606 This option will enable GCC to use movbe instruction to implement
11607 @code{__builtin_bswap32} and @code{__builtin_bswap64}.
11608
11609 @item -mcrc32
11610 @opindex mcrc32
11611 This option will enable built-in functions, @code{__builtin_ia32_crc32qi},
11612 @code{__builtin_ia32_crc32hi}. @code{__builtin_ia32_crc32si} and
11613 @code{__builtin_ia32_crc32di} to generate the crc32 machine instruction.
11614
11615 @item -mrecip
11616 @opindex mrecip
11617 This option will enable GCC to use RCPSS and RSQRTSS instructions (and their
11618 vectorized variants RCPPS and RSQRTPS) with an additional Newton-Raphson step
11619 to increase precision instead of DIVSS and SQRTSS (and their vectorized
11620 variants) for single precision floating point arguments.  These instructions
11621 are generated only when @option{-funsafe-math-optimizations} is enabled
11622 together with @option{-finite-math-only} and @option{-fno-trapping-math}.
11623 Note that while the throughput of the sequence is higher than the throughput
11624 of the non-reciprocal instruction, the precision of the sequence can be
11625 decreased by up to 2 ulp (i.e. the inverse of 1.0 equals 0.99999994).
11626
11627 @item -mveclibabi=@var{type}
11628 @opindex mveclibabi
11629 Specifies the ABI type to use for vectorizing intrinsics using an
11630 external library.  Supported types are @code{svml} for the Intel short
11631 vector math library and @code{acml} for the AMD math core library style
11632 of interfacing.  GCC will currently emit calls to @code{vmldExp2},
11633 @code{vmldLn2}, @code{vmldLog102}, @code{vmldLog102}, @code{vmldPow2},
11634 @code{vmldTanh2}, @code{vmldTan2}, @code{vmldAtan2}, @code{vmldAtanh2},
11635 @code{vmldCbrt2}, @code{vmldSinh2}, @code{vmldSin2}, @code{vmldAsinh2},
11636 @code{vmldAsin2}, @code{vmldCosh2}, @code{vmldCos2}, @code{vmldAcosh2},
11637 @code{vmldAcos2}, @code{vmlsExp4}, @code{vmlsLn4}, @code{vmlsLog104},
11638 @code{vmlsLog104}, @code{vmlsPow4}, @code{vmlsTanh4}, @code{vmlsTan4},
11639 @code{vmlsAtan4}, @code{vmlsAtanh4}, @code{vmlsCbrt4}, @code{vmlsSinh4},
11640 @code{vmlsSin4}, @code{vmlsAsinh4}, @code{vmlsAsin4}, @code{vmlsCosh4},
11641 @code{vmlsCos4}, @code{vmlsAcosh4} and @code{vmlsAcos4} for corresponding
11642 function type when @option{-mveclibabi=svml} is used and @code{__vrd2_sin},
11643 @code{__vrd2_cos}, @code{__vrd2_exp}, @code{__vrd2_log}, @code{__vrd2_log2},
11644 @code{__vrd2_log10}, @code{__vrs4_sinf}, @code{__vrs4_cosf},
11645 @code{__vrs4_expf}, @code{__vrs4_logf}, @code{__vrs4_log2f},
11646 @code{__vrs4_log10f} and @code{__vrs4_powf} for corresponding function type
11647 when @option{-mveclibabi=acml} is used. Both @option{-ftree-vectorize} and
11648 @option{-funsafe-math-optimizations} have to be enabled. A SVML or ACML ABI
11649 compatible library will have to be specified at link time.
11650
11651 @item -mabi=@var{name}
11652 @opindex mabi
11653 Generate code for the specified calling convention.  Permissible values
11654 are: @samp{sysv} for the ABI used on GNU/Linux and other systems and
11655 @samp{ms} for the Microsoft ABI.  The default is to use the Microsoft
11656 ABI when targeting Windows.  On all other systems, the default is the
11657 SYSV ABI.  You can control this behavior for a specific function by
11658 using the function attribute @samp{ms_abi}/@samp{sysv_abi}.
11659 @xref{Function Attributes}.
11660
11661 @item -mpush-args
11662 @itemx -mno-push-args
11663 @opindex mpush-args
11664 @opindex mno-push-args
11665 Use PUSH operations to store outgoing parameters.  This method is shorter
11666 and usually equally fast as method using SUB/MOV operations and is enabled
11667 by default.  In some cases disabling it may improve performance because of
11668 improved scheduling and reduced dependencies.
11669
11670 @item -maccumulate-outgoing-args
11671 @opindex maccumulate-outgoing-args
11672 If enabled, the maximum amount of space required for outgoing arguments will be
11673 computed in the function prologue.  This is faster on most modern CPUs
11674 because of reduced dependencies, improved scheduling and reduced stack usage
11675 when preferred stack boundary is not equal to 2.  The drawback is a notable
11676 increase in code size.  This switch implies @option{-mno-push-args}.
11677
11678 @item -mthreads
11679 @opindex mthreads
11680 Support thread-safe exception handling on @samp{Mingw32}.  Code that relies
11681 on thread-safe exception handling must compile and link all code with the
11682 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
11683 @option{-D_MT}; when linking, it links in a special thread helper library
11684 @option{-lmingwthrd} which cleans up per thread exception handling data.
11685
11686 @item -mno-align-stringops
11687 @opindex mno-align-stringops
11688 Do not align destination of inlined string operations.  This switch reduces
11689 code size and improves performance in case the destination is already aligned,
11690 but GCC doesn't know about it.
11691
11692 @item -minline-all-stringops
11693 @opindex minline-all-stringops
11694 By default GCC inlines string operations only when destination is known to be
11695 aligned at least to 4 byte boundary.  This enables more inlining, increase code
11696 size, but may improve performance of code that depends on fast memcpy, strlen
11697 and memset for short lengths.
11698
11699 @item -minline-stringops-dynamically
11700 @opindex minline-stringops-dynamically
11701 For string operation of unknown size, inline runtime checks so for small
11702 blocks inline code is used, while for large blocks library call is used.
11703
11704 @item -mstringop-strategy=@var{alg}
11705 @opindex mstringop-strategy=@var{alg}
11706 Overwrite internal decision heuristic about particular algorithm to inline
11707 string operation with.  The allowed values are @code{rep_byte},
11708 @code{rep_4byte}, @code{rep_8byte} for expanding using i386 @code{rep} prefix
11709 of specified size, @code{byte_loop}, @code{loop}, @code{unrolled_loop} for
11710 expanding inline loop, @code{libcall} for always expanding library call.
11711
11712 @item -momit-leaf-frame-pointer
11713 @opindex momit-leaf-frame-pointer
11714 Don't keep the frame pointer in a register for leaf functions.  This
11715 avoids the instructions to save, set up and restore frame pointers and
11716 makes an extra register available in leaf functions.  The option
11717 @option{-fomit-frame-pointer} removes the frame pointer for all functions
11718 which might make debugging harder.
11719
11720 @item -mtls-direct-seg-refs
11721 @itemx -mno-tls-direct-seg-refs
11722 @opindex mtls-direct-seg-refs
11723 Controls whether TLS variables may be accessed with offsets from the
11724 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
11725 or whether the thread base pointer must be added.  Whether or not this
11726 is legal depends on the operating system, and whether it maps the
11727 segment to cover the entire TLS area.
11728
11729 For systems that use GNU libc, the default is on.
11730
11731 @item -mfused-madd
11732 @itemx -mno-fused-madd
11733 @opindex mfused-madd
11734 Enable automatic generation of fused floating point multiply-add instructions
11735 if the ISA supports such instructions.  The -mfused-madd option is on by
11736 default.  The fused multiply-add instructions have a different
11737 rounding behavior compared to executing a multiply followed by an add.
11738
11739 @item -msse2avx
11740 @itemx -mno-sse2avx
11741 @opindex msse2avx
11742 Specify that the assembler should encode SSE instructions with VEX
11743 prefix.  The option @option{-mavx} turns this on by default.
11744 @end table
11745
11746 These @samp{-m} switches are supported in addition to the above
11747 on AMD x86-64 processors in 64-bit environments.
11748
11749 @table @gcctabopt
11750 @item -m32
11751 @itemx -m64
11752 @opindex m32
11753 @opindex m64
11754 Generate code for a 32-bit or 64-bit environment.
11755 The 32-bit environment sets int, long and pointer to 32 bits and
11756 generates code that runs on any i386 system.
11757 The 64-bit environment sets int to 32 bits and long and pointer
11758 to 64 bits and generates code for AMD's x86-64 architecture. For
11759 darwin only the -m64 option turns off the @option{-fno-pic} and
11760 @option{-mdynamic-no-pic} options.
11761
11762 @item -mno-red-zone
11763 @opindex mno-red-zone
11764 Do not use a so called red zone for x86-64 code.  The red zone is mandated
11765 by the x86-64 ABI, it is a 128-byte area beyond the location of the
11766 stack pointer that will not be modified by signal or interrupt handlers
11767 and therefore can be used for temporary data without adjusting the stack
11768 pointer.  The flag @option{-mno-red-zone} disables this red zone.
11769
11770 @item -mcmodel=small
11771 @opindex mcmodel=small
11772 Generate code for the small code model: the program and its symbols must
11773 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
11774 Programs can be statically or dynamically linked.  This is the default
11775 code model.
11776
11777 @item -mcmodel=kernel
11778 @opindex mcmodel=kernel
11779 Generate code for the kernel code model.  The kernel runs in the
11780 negative 2 GB of the address space.
11781 This model has to be used for Linux kernel code.
11782
11783 @item -mcmodel=medium
11784 @opindex mcmodel=medium
11785 Generate code for the medium model: The program is linked in the lower 2
11786 GB of the address space.  Small symbols are also placed there.  Symbols
11787 with sizes larger than @option{-mlarge-data-threshold} are put into
11788 large data or bss sections and can be located above 2GB.  Programs can
11789 be statically or dynamically linked.
11790
11791 @item -mcmodel=large
11792 @opindex mcmodel=large
11793 Generate code for the large model: This model makes no assumptions
11794 about addresses and sizes of sections.
11795 @end table
11796
11797 @node IA-64 Options
11798 @subsection IA-64 Options
11799 @cindex IA-64 Options
11800
11801 These are the @samp{-m} options defined for the Intel IA-64 architecture.
11802
11803 @table @gcctabopt
11804 @item -mbig-endian
11805 @opindex mbig-endian
11806 Generate code for a big endian target.  This is the default for HP-UX@.
11807
11808 @item -mlittle-endian
11809 @opindex mlittle-endian
11810 Generate code for a little endian target.  This is the default for AIX5
11811 and GNU/Linux.
11812
11813 @item -mgnu-as
11814 @itemx -mno-gnu-as
11815 @opindex mgnu-as
11816 @opindex mno-gnu-as
11817 Generate (or don't) code for the GNU assembler.  This is the default.
11818 @c Also, this is the default if the configure option @option{--with-gnu-as}
11819 @c is used.
11820
11821 @item -mgnu-ld
11822 @itemx -mno-gnu-ld
11823 @opindex mgnu-ld
11824 @opindex mno-gnu-ld
11825 Generate (or don't) code for the GNU linker.  This is the default.
11826 @c Also, this is the default if the configure option @option{--with-gnu-ld}
11827 @c is used.
11828
11829 @item -mno-pic
11830 @opindex mno-pic
11831 Generate code that does not use a global pointer register.  The result
11832 is not position independent code, and violates the IA-64 ABI@.
11833
11834 @item -mvolatile-asm-stop
11835 @itemx -mno-volatile-asm-stop
11836 @opindex mvolatile-asm-stop
11837 @opindex mno-volatile-asm-stop
11838 Generate (or don't) a stop bit immediately before and after volatile asm
11839 statements.
11840
11841 @item -mregister-names
11842 @itemx -mno-register-names
11843 @opindex mregister-names
11844 @opindex mno-register-names
11845 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
11846 the stacked registers.  This may make assembler output more readable.
11847
11848 @item -mno-sdata
11849 @itemx -msdata
11850 @opindex mno-sdata
11851 @opindex msdata
11852 Disable (or enable) optimizations that use the small data section.  This may
11853 be useful for working around optimizer bugs.
11854
11855 @item -mconstant-gp
11856 @opindex mconstant-gp
11857 Generate code that uses a single constant global pointer value.  This is
11858 useful when compiling kernel code.
11859
11860 @item -mauto-pic
11861 @opindex mauto-pic
11862 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
11863 This is useful when compiling firmware code.
11864
11865 @item -minline-float-divide-min-latency
11866 @opindex minline-float-divide-min-latency
11867 Generate code for inline divides of floating point values
11868 using the minimum latency algorithm.
11869
11870 @item -minline-float-divide-max-throughput
11871 @opindex minline-float-divide-max-throughput
11872 Generate code for inline divides of floating point values
11873 using the maximum throughput algorithm.
11874
11875 @item -mno-inline-float-divide
11876 @opindex mno-inline-float-divide
11877 Do not generate inline code for divides of floating point values.
11878
11879 @item -minline-int-divide-min-latency
11880 @opindex minline-int-divide-min-latency
11881 Generate code for inline divides of integer values
11882 using the minimum latency algorithm.
11883
11884 @item -minline-int-divide-max-throughput
11885 @opindex minline-int-divide-max-throughput
11886 Generate code for inline divides of integer values
11887 using the maximum throughput algorithm.
11888
11889 @item -mno-inline-int-divide
11890 @opindex mno-inline-int-divide
11891 Do not generate inline code for divides of integer values.
11892
11893 @item -minline-sqrt-min-latency
11894 @opindex minline-sqrt-min-latency
11895 Generate code for inline square roots
11896 using the minimum latency algorithm.
11897
11898 @item -minline-sqrt-max-throughput
11899 @opindex minline-sqrt-max-throughput
11900 Generate code for inline square roots
11901 using the maximum throughput algorithm.
11902
11903 @item -mno-inline-sqrt
11904 @opindex mno-inline-sqrt
11905 Do not generate inline code for sqrt.
11906
11907 @item -mfused-madd
11908 @itemx -mno-fused-madd
11909 @opindex mfused-madd
11910 @opindex mno-fused-madd
11911 Do (don't) generate code that uses the fused multiply/add or multiply/subtract
11912 instructions.    The default is to use these instructions.
11913
11914 @item -mno-dwarf2-asm
11915 @itemx -mdwarf2-asm
11916 @opindex mno-dwarf2-asm
11917 @opindex mdwarf2-asm
11918 Don't (or do) generate assembler code for the DWARF2 line number debugging
11919 info.  This may be useful when not using the GNU assembler.
11920
11921 @item -mearly-stop-bits
11922 @itemx -mno-early-stop-bits
11923 @opindex mearly-stop-bits
11924 @opindex mno-early-stop-bits
11925 Allow stop bits to be placed earlier than immediately preceding the
11926 instruction that triggered the stop bit.  This can improve instruction
11927 scheduling, but does not always do so.
11928
11929 @item -mfixed-range=@var{register-range}
11930 @opindex mfixed-range
11931 Generate code treating the given register range as fixed registers.
11932 A fixed register is one that the register allocator can not use.  This is
11933 useful when compiling kernel code.  A register range is specified as
11934 two registers separated by a dash.  Multiple register ranges can be
11935 specified separated by a comma.
11936
11937 @item -mtls-size=@var{tls-size}
11938 @opindex mtls-size
11939 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
11940 64.
11941
11942 @item -mtune=@var{cpu-type}
11943 @opindex mtune
11944 Tune the instruction scheduling for a particular CPU, Valid values are
11945 itanium, itanium1, merced, itanium2, and mckinley.
11946
11947 @item -milp32
11948 @itemx -mlp64
11949 @opindex milp32
11950 @opindex mlp64
11951 Generate code for a 32-bit or 64-bit environment.
11952 The 32-bit environment sets int, long and pointer to 32 bits.
11953 The 64-bit environment sets int to 32 bits and long and pointer
11954 to 64 bits.  These are HP-UX specific flags.
11955
11956 @item -mno-sched-br-data-spec
11957 @itemx -msched-br-data-spec
11958 @opindex mno-sched-br-data-spec
11959 @opindex msched-br-data-spec
11960 (Dis/En)able data speculative scheduling before reload.
11961 This will result in generation of the ld.a instructions and
11962 the corresponding check instructions (ld.c / chk.a).
11963 The default is 'disable'.
11964
11965 @item -msched-ar-data-spec
11966 @itemx -mno-sched-ar-data-spec
11967 @opindex msched-ar-data-spec
11968 @opindex mno-sched-ar-data-spec
11969 (En/Dis)able data speculative scheduling after reload.
11970 This will result in generation of the ld.a instructions and
11971 the corresponding check instructions (ld.c / chk.a).
11972 The default is 'enable'.
11973
11974 @item -mno-sched-control-spec
11975 @itemx -msched-control-spec
11976 @opindex mno-sched-control-spec
11977 @opindex msched-control-spec
11978 (Dis/En)able control speculative scheduling.  This feature is
11979 available only during region scheduling (i.e.@: before reload).
11980 This will result in generation of the ld.s instructions and
11981 the corresponding check instructions chk.s .
11982 The default is 'disable'.
11983
11984 @item -msched-br-in-data-spec
11985 @itemx -mno-sched-br-in-data-spec
11986 @opindex msched-br-in-data-spec
11987 @opindex mno-sched-br-in-data-spec
11988 (En/Dis)able speculative scheduling of the instructions that
11989 are dependent on the data speculative loads before reload.
11990 This is effective only with @option{-msched-br-data-spec} enabled.
11991 The default is 'enable'.
11992
11993 @item -msched-ar-in-data-spec
11994 @itemx -mno-sched-ar-in-data-spec
11995 @opindex msched-ar-in-data-spec
11996 @opindex mno-sched-ar-in-data-spec
11997 (En/Dis)able speculative scheduling of the instructions that
11998 are dependent on the data speculative loads after reload.
11999 This is effective only with @option{-msched-ar-data-spec} enabled.
12000 The default is 'enable'.
12001
12002 @item -msched-in-control-spec
12003 @itemx -mno-sched-in-control-spec
12004 @opindex msched-in-control-spec
12005 @opindex mno-sched-in-control-spec
12006 (En/Dis)able speculative scheduling of the instructions that
12007 are dependent on the control speculative loads.
12008 This is effective only with @option{-msched-control-spec} enabled.
12009 The default is 'enable'.
12010
12011 @item -mno-sched-prefer-non-data-spec-insns
12012 @itemx -msched-prefer-non-data-spec-insns
12013 @opindex mno-sched-prefer-non-data-spec-insns
12014 @opindex msched-prefer-non-data-spec-insns
12015 If enabled, data speculative instructions will be chosen for schedule
12016 only if there are no other choices at the moment.  This will make
12017 the use of the data speculation much more conservative.
12018 The default is 'disable'.
12019
12020 @item -mno-sched-prefer-non-control-spec-insns
12021 @itemx -msched-prefer-non-control-spec-insns
12022 @opindex mno-sched-prefer-non-control-spec-insns
12023 @opindex msched-prefer-non-control-spec-insns
12024 If enabled, control speculative instructions will be chosen for schedule
12025 only if there are no other choices at the moment.  This will make
12026 the use of the control speculation much more conservative.
12027 The default is 'disable'.
12028
12029 @item -mno-sched-count-spec-in-critical-path
12030 @itemx -msched-count-spec-in-critical-path
12031 @opindex mno-sched-count-spec-in-critical-path
12032 @opindex msched-count-spec-in-critical-path
12033 If enabled, speculative dependencies will be considered during
12034 computation of the instructions priorities.  This will make the use of the
12035 speculation a bit more conservative.
12036 The default is 'disable'.
12037
12038 @item -msched-spec-ldc
12039 @opindex msched-spec-ldc
12040 Use a simple data speculation check.  This option is on by default.
12041
12042 @item -msched-control-spec-ldc
12043 @opindex msched-spec-ldc
12044 Use a simple check for control speculation.  This option is on by default.
12045
12046 @item -msched-stop-bits-after-every-cycle
12047 @opindex msched-stop-bits-after-every-cycle
12048 Place a stop bit after every cycle when scheduling.  This option is on
12049 by default.
12050
12051 @item -msched-fp-mem-deps-zero-cost
12052 @opindex msched-fp-mem-deps-zero-cost
12053 Assume that floating-point stores and loads are not likely to cause a conflict
12054 when placed into the same instruction group.  This option is disabled by
12055 default.
12056
12057 @item -msel-sched-dont-check-control-spec
12058 @opindex msel-sched-dont-check-control-spec
12059 Generate checks for control speculation in selective scheduling.
12060 This flag is disabled by default.
12061
12062 @item -msched-max-memory-insns=@var{max-insns}
12063 @opindex msched-max-memory-insns
12064 Limit on the number of memory insns per instruction group, giving lower
12065 priority to subsequent memory insns attempting to schedule in the same
12066 instruction group. Frequently useful to prevent cache bank conflicts.
12067 The default value is 1.
12068
12069 @item -msched-max-memory-insns-hard-limit
12070 @opindex msched-max-memory-insns-hard-limit
12071 Disallow more than `msched-max-memory-insns' in instruction group.
12072 Otherwise, limit is `soft' meaning that we would prefer non-memory operations
12073 when limit is reached but may still schedule memory operations.
12074
12075 @end table
12076
12077 @node M32C Options
12078 @subsection M32C Options
12079 @cindex M32C options
12080
12081 @table @gcctabopt
12082 @item -mcpu=@var{name}
12083 @opindex mcpu=
12084 Select the CPU for which code is generated.  @var{name} may be one of
12085 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
12086 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
12087 the M32C/80 series.
12088
12089 @item -msim
12090 @opindex msim
12091 Specifies that the program will be run on the simulator.  This causes
12092 an alternate runtime library to be linked in which supports, for
12093 example, file I/O@.  You must not use this option when generating
12094 programs that will run on real hardware; you must provide your own
12095 runtime library for whatever I/O functions are needed.
12096
12097 @item -memregs=@var{number}
12098 @opindex memregs=
12099 Specifies the number of memory-based pseudo-registers GCC will use
12100 during code generation.  These pseudo-registers will be used like real
12101 registers, so there is a tradeoff between GCC's ability to fit the
12102 code into available registers, and the performance penalty of using
12103 memory instead of registers.  Note that all modules in a program must
12104 be compiled with the same value for this option.  Because of that, you
12105 must not use this option with the default runtime libraries gcc
12106 builds.
12107
12108 @end table
12109
12110 @node M32R/D Options
12111 @subsection M32R/D Options
12112 @cindex M32R/D options
12113
12114 These @option{-m} options are defined for Renesas M32R/D architectures:
12115
12116 @table @gcctabopt
12117 @item -m32r2
12118 @opindex m32r2
12119 Generate code for the M32R/2@.
12120
12121 @item -m32rx
12122 @opindex m32rx
12123 Generate code for the M32R/X@.
12124
12125 @item -m32r
12126 @opindex m32r
12127 Generate code for the M32R@.  This is the default.
12128
12129 @item -mmodel=small
12130 @opindex mmodel=small
12131 Assume all objects live in the lower 16MB of memory (so that their addresses
12132 can be loaded with the @code{ld24} instruction), and assume all subroutines
12133 are reachable with the @code{bl} instruction.
12134 This is the default.
12135
12136 The addressability of a particular object can be set with the
12137 @code{model} attribute.
12138
12139 @item -mmodel=medium
12140 @opindex mmodel=medium
12141 Assume objects may be anywhere in the 32-bit address space (the compiler
12142 will generate @code{seth/add3} instructions to load their addresses), and
12143 assume all subroutines are reachable with the @code{bl} instruction.
12144
12145 @item -mmodel=large
12146 @opindex mmodel=large
12147 Assume objects may be anywhere in the 32-bit address space (the compiler
12148 will generate @code{seth/add3} instructions to load their addresses), and
12149 assume subroutines may not be reachable with the @code{bl} instruction
12150 (the compiler will generate the much slower @code{seth/add3/jl}
12151 instruction sequence).
12152
12153 @item -msdata=none
12154 @opindex msdata=none
12155 Disable use of the small data area.  Variables will be put into
12156 one of @samp{.data}, @samp{bss}, or @samp{.rodata} (unless the
12157 @code{section} attribute has been specified).
12158 This is the default.
12159
12160 The small data area consists of sections @samp{.sdata} and @samp{.sbss}.
12161 Objects may be explicitly put in the small data area with the
12162 @code{section} attribute using one of these sections.
12163
12164 @item -msdata=sdata
12165 @opindex msdata=sdata
12166 Put small global and static data in the small data area, but do not
12167 generate special code to reference them.
12168
12169 @item -msdata=use
12170 @opindex msdata=use
12171 Put small global and static data in the small data area, and generate
12172 special instructions to reference them.
12173
12174 @item -G @var{num}
12175 @opindex G
12176 @cindex smaller data references
12177 Put global and static objects less than or equal to @var{num} bytes
12178 into the small data or bss sections instead of the normal data or bss
12179 sections.  The default value of @var{num} is 8.
12180 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
12181 for this option to have any effect.
12182
12183 All modules should be compiled with the same @option{-G @var{num}} value.
12184 Compiling with different values of @var{num} may or may not work; if it
12185 doesn't the linker will give an error message---incorrect code will not be
12186 generated.
12187
12188 @item -mdebug
12189 @opindex mdebug
12190 Makes the M32R specific code in the compiler display some statistics
12191 that might help in debugging programs.
12192
12193 @item -malign-loops
12194 @opindex malign-loops
12195 Align all loops to a 32-byte boundary.
12196
12197 @item -mno-align-loops
12198 @opindex mno-align-loops
12199 Do not enforce a 32-byte alignment for loops.  This is the default.
12200
12201 @item -missue-rate=@var{number}
12202 @opindex missue-rate=@var{number}
12203 Issue @var{number} instructions per cycle.  @var{number} can only be 1
12204 or 2.
12205
12206 @item -mbranch-cost=@var{number}
12207 @opindex mbranch-cost=@var{number}
12208 @var{number} can only be 1 or 2.  If it is 1 then branches will be
12209 preferred over conditional code, if it is 2, then the opposite will
12210 apply.
12211
12212 @item -mflush-trap=@var{number}
12213 @opindex mflush-trap=@var{number}
12214 Specifies the trap number to use to flush the cache.  The default is
12215 12.  Valid numbers are between 0 and 15 inclusive.
12216
12217 @item -mno-flush-trap
12218 @opindex mno-flush-trap
12219 Specifies that the cache cannot be flushed by using a trap.
12220
12221 @item -mflush-func=@var{name}
12222 @opindex mflush-func=@var{name}
12223 Specifies the name of the operating system function to call to flush
12224 the cache.  The default is @emph{_flush_cache}, but a function call
12225 will only be used if a trap is not available.
12226
12227 @item -mno-flush-func
12228 @opindex mno-flush-func
12229 Indicates that there is no OS function for flushing the cache.
12230
12231 @end table
12232
12233 @node M680x0 Options
12234 @subsection M680x0 Options
12235 @cindex M680x0 options
12236
12237 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
12238 The default settings depend on which architecture was selected when
12239 the compiler was configured; the defaults for the most common choices
12240 are given below.
12241
12242 @table @gcctabopt
12243 @item -march=@var{arch}
12244 @opindex march
12245 Generate code for a specific M680x0 or ColdFire instruction set
12246 architecture.  Permissible values of @var{arch} for M680x0
12247 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
12248 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
12249 architectures are selected according to Freescale's ISA classification
12250 and the permissible values are: @samp{isaa}, @samp{isaaplus},
12251 @samp{isab} and @samp{isac}.
12252
12253 gcc defines a macro @samp{__mcf@var{arch}__} whenever it is generating
12254 code for a ColdFire target.  The @var{arch} in this macro is one of the
12255 @option{-march} arguments given above.
12256
12257 When used together, @option{-march} and @option{-mtune} select code
12258 that runs on a family of similar processors but that is optimized
12259 for a particular microarchitecture.
12260
12261 @item -mcpu=@var{cpu}
12262 @opindex mcpu
12263 Generate code for a specific M680x0 or ColdFire processor.
12264 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
12265 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
12266 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
12267 below, which also classifies the CPUs into families:
12268
12269 @multitable @columnfractions 0.20 0.80
12270 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
12271 @item @samp{51} @tab @samp{51} @samp{51ac} @samp{51cn} @samp{51em} @samp{51qe}
12272 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
12273 @item @samp{5206e} @tab @samp{5206e}
12274 @item @samp{5208} @tab @samp{5207} @samp{5208}
12275 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
12276 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
12277 @item @samp{5216} @tab @samp{5214} @samp{5216}
12278 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
12279 @item @samp{5225} @tab @samp{5224} @samp{5225}
12280 @item @samp{52259} @tab @samp{52252} @samp{52254} @samp{52255} @samp{52256} @samp{52258} @samp{52259}
12281 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
12282 @item @samp{5249} @tab @samp{5249}
12283 @item @samp{5250} @tab @samp{5250}
12284 @item @samp{5271} @tab @samp{5270} @samp{5271}
12285 @item @samp{5272} @tab @samp{5272}
12286 @item @samp{5275} @tab @samp{5274} @samp{5275}
12287 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
12288 @item @samp{53017} @tab @samp{53011} @samp{53012} @samp{53013} @samp{53014} @samp{53015} @samp{53016} @samp{53017}
12289 @item @samp{5307} @tab @samp{5307}
12290 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
12291 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
12292 @item @samp{5407} @tab @samp{5407}
12293 @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}
12294 @end multitable
12295
12296 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
12297 @var{arch} is compatible with @var{cpu}.  Other combinations of
12298 @option{-mcpu} and @option{-march} are rejected.
12299
12300 gcc defines the macro @samp{__mcf_cpu_@var{cpu}} when ColdFire target
12301 @var{cpu} is selected.  It also defines @samp{__mcf_family_@var{family}},
12302 where the value of @var{family} is given by the table above.
12303
12304 @item -mtune=@var{tune}
12305 @opindex mtune
12306 Tune the code for a particular microarchitecture, within the
12307 constraints set by @option{-march} and @option{-mcpu}.
12308 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
12309 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
12310 and @samp{cpu32}.  The ColdFire microarchitectures
12311 are: @samp{cfv1}, @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
12312
12313 You can also use @option{-mtune=68020-40} for code that needs
12314 to run relatively well on 68020, 68030 and 68040 targets.
12315 @option{-mtune=68020-60} is similar but includes 68060 targets
12316 as well.  These two options select the same tuning decisions as
12317 @option{-m68020-40} and @option{-m68020-60} respectively.
12318
12319 gcc defines the macros @samp{__mc@var{arch}} and @samp{__mc@var{arch}__}
12320 when tuning for 680x0 architecture @var{arch}.  It also defines
12321 @samp{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
12322 option is used.  If gcc is tuning for a range of architectures,
12323 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
12324 it defines the macros for every architecture in the range.
12325
12326 gcc also defines the macro @samp{__m@var{uarch}__} when tuning for
12327 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
12328 of the arguments given above.
12329
12330 @item -m68000
12331 @itemx -mc68000
12332 @opindex m68000
12333 @opindex mc68000
12334 Generate output for a 68000.  This is the default
12335 when the compiler is configured for 68000-based systems.
12336 It is equivalent to @option{-march=68000}.
12337
12338 Use this option for microcontrollers with a 68000 or EC000 core,
12339 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
12340
12341 @item -m68010
12342 @opindex m68010
12343 Generate output for a 68010.  This is the default
12344 when the compiler is configured for 68010-based systems.
12345 It is equivalent to @option{-march=68010}.
12346
12347 @item -m68020
12348 @itemx -mc68020
12349 @opindex m68020
12350 @opindex mc68020
12351 Generate output for a 68020.  This is the default
12352 when the compiler is configured for 68020-based systems.
12353 It is equivalent to @option{-march=68020}.
12354
12355 @item -m68030
12356 @opindex m68030
12357 Generate output for a 68030.  This is the default when the compiler is
12358 configured for 68030-based systems.  It is equivalent to
12359 @option{-march=68030}.
12360
12361 @item -m68040
12362 @opindex m68040
12363 Generate output for a 68040.  This is the default when the compiler is
12364 configured for 68040-based systems.  It is equivalent to
12365 @option{-march=68040}.
12366
12367 This option inhibits the use of 68881/68882 instructions that have to be
12368 emulated by software on the 68040.  Use this option if your 68040 does not
12369 have code to emulate those instructions.
12370
12371 @item -m68060
12372 @opindex m68060
12373 Generate output for a 68060.  This is the default when the compiler is
12374 configured for 68060-based systems.  It is equivalent to
12375 @option{-march=68060}.
12376
12377 This option inhibits the use of 68020 and 68881/68882 instructions that
12378 have to be emulated by software on the 68060.  Use this option if your 68060
12379 does not have code to emulate those instructions.
12380
12381 @item -mcpu32
12382 @opindex mcpu32
12383 Generate output for a CPU32.  This is the default
12384 when the compiler is configured for CPU32-based systems.
12385 It is equivalent to @option{-march=cpu32}.
12386
12387 Use this option for microcontrollers with a
12388 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
12389 68336, 68340, 68341, 68349 and 68360.
12390
12391 @item -m5200
12392 @opindex m5200
12393 Generate output for a 520X ColdFire CPU@.  This is the default
12394 when the compiler is configured for 520X-based systems.
12395 It is equivalent to @option{-mcpu=5206}, and is now deprecated
12396 in favor of that option.
12397
12398 Use this option for microcontroller with a 5200 core, including
12399 the MCF5202, MCF5203, MCF5204 and MCF5206.
12400
12401 @item -m5206e
12402 @opindex m5206e
12403 Generate output for a 5206e ColdFire CPU@.  The option is now
12404 deprecated in favor of the equivalent @option{-mcpu=5206e}.
12405
12406 @item -m528x
12407 @opindex m528x
12408 Generate output for a member of the ColdFire 528X family.
12409 The option is now deprecated in favor of the equivalent
12410 @option{-mcpu=528x}.
12411
12412 @item -m5307
12413 @opindex m5307
12414 Generate output for a ColdFire 5307 CPU@.  The option is now deprecated
12415 in favor of the equivalent @option{-mcpu=5307}.
12416
12417 @item -m5407
12418 @opindex m5407
12419 Generate output for a ColdFire 5407 CPU@.  The option is now deprecated
12420 in favor of the equivalent @option{-mcpu=5407}.
12421
12422 @item -mcfv4e
12423 @opindex mcfv4e
12424 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
12425 This includes use of hardware floating point instructions.
12426 The option is equivalent to @option{-mcpu=547x}, and is now
12427 deprecated in favor of that option.
12428
12429 @item -m68020-40
12430 @opindex m68020-40
12431 Generate output for a 68040, without using any of the new instructions.
12432 This results in code which can run relatively efficiently on either a
12433 68020/68881 or a 68030 or a 68040.  The generated code does use the
12434 68881 instructions that are emulated on the 68040.
12435
12436 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
12437
12438 @item -m68020-60
12439 @opindex m68020-60
12440 Generate output for a 68060, without using any of the new instructions.
12441 This results in code which can run relatively efficiently on either a
12442 68020/68881 or a 68030 or a 68040.  The generated code does use the
12443 68881 instructions that are emulated on the 68060.
12444
12445 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
12446
12447 @item -mhard-float
12448 @itemx -m68881
12449 @opindex mhard-float
12450 @opindex m68881
12451 Generate floating-point instructions.  This is the default for 68020
12452 and above, and for ColdFire devices that have an FPU@.  It defines the
12453 macro @samp{__HAVE_68881__} on M680x0 targets and @samp{__mcffpu__}
12454 on ColdFire targets.
12455
12456 @item -msoft-float
12457 @opindex msoft-float
12458 Do not generate floating-point instructions; use library calls instead.
12459 This is the default for 68000, 68010, and 68832 targets.  It is also
12460 the default for ColdFire devices that have no FPU.
12461
12462 @item -mdiv
12463 @itemx -mno-div
12464 @opindex mdiv
12465 @opindex mno-div
12466 Generate (do not generate) ColdFire hardware divide and remainder
12467 instructions.  If @option{-march} is used without @option{-mcpu},
12468 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
12469 architectures.  Otherwise, the default is taken from the target CPU
12470 (either the default CPU, or the one specified by @option{-mcpu}).  For
12471 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
12472 @option{-mcpu=5206e}.
12473
12474 gcc defines the macro @samp{__mcfhwdiv__} when this option is enabled.
12475
12476 @item -mshort
12477 @opindex mshort
12478 Consider type @code{int} to be 16 bits wide, like @code{short int}.
12479 Additionally, parameters passed on the stack are also aligned to a
12480 16-bit boundary even on targets whose API mandates promotion to 32-bit.
12481
12482 @item -mno-short
12483 @opindex mno-short
12484 Do not consider type @code{int} to be 16 bits wide.  This is the default.
12485
12486 @item -mnobitfield
12487 @itemx -mno-bitfield
12488 @opindex mnobitfield
12489 @opindex mno-bitfield
12490 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
12491 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
12492
12493 @item -mbitfield
12494 @opindex mbitfield
12495 Do use the bit-field instructions.  The @option{-m68020} option implies
12496 @option{-mbitfield}.  This is the default if you use a configuration
12497 designed for a 68020.
12498
12499 @item -mrtd
12500 @opindex mrtd
12501 Use a different function-calling convention, in which functions
12502 that take a fixed number of arguments return with the @code{rtd}
12503 instruction, which pops their arguments while returning.  This
12504 saves one instruction in the caller since there is no need to pop
12505 the arguments there.
12506
12507 This calling convention is incompatible with the one normally
12508 used on Unix, so you cannot use it if you need to call libraries
12509 compiled with the Unix compiler.
12510
12511 Also, you must provide function prototypes for all functions that
12512 take variable numbers of arguments (including @code{printf});
12513 otherwise incorrect code will be generated for calls to those
12514 functions.
12515
12516 In addition, seriously incorrect code will result if you call a
12517 function with too many arguments.  (Normally, extra arguments are
12518 harmlessly ignored.)
12519
12520 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
12521 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
12522
12523 @item -mno-rtd
12524 @opindex mno-rtd
12525 Do not use the calling conventions selected by @option{-mrtd}.
12526 This is the default.
12527
12528 @item -malign-int
12529 @itemx -mno-align-int
12530 @opindex malign-int
12531 @opindex mno-align-int
12532 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
12533 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
12534 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
12535 Aligning variables on 32-bit boundaries produces code that runs somewhat
12536 faster on processors with 32-bit busses at the expense of more memory.
12537
12538 @strong{Warning:} if you use the @option{-malign-int} switch, GCC will
12539 align structures containing the above types  differently than
12540 most published application binary interface specifications for the m68k.
12541
12542 @item -mpcrel
12543 @opindex mpcrel
12544 Use the pc-relative addressing mode of the 68000 directly, instead of
12545 using a global offset table.  At present, this option implies @option{-fpic},
12546 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
12547 not presently supported with @option{-mpcrel}, though this could be supported for
12548 68020 and higher processors.
12549
12550 @item -mno-strict-align
12551 @itemx -mstrict-align
12552 @opindex mno-strict-align
12553 @opindex mstrict-align
12554 Do not (do) assume that unaligned memory references will be handled by
12555 the system.
12556
12557 @item -msep-data
12558 Generate code that allows the data segment to be located in a different
12559 area of memory from the text segment.  This allows for execute in place in
12560 an environment without virtual memory management.  This option implies
12561 @option{-fPIC}.
12562
12563 @item -mno-sep-data
12564 Generate code that assumes that the data segment follows the text segment.
12565 This is the default.
12566
12567 @item -mid-shared-library
12568 Generate code that supports shared libraries via the library ID method.
12569 This allows for execute in place and shared libraries in an environment
12570 without virtual memory management.  This option implies @option{-fPIC}.
12571
12572 @item -mno-id-shared-library
12573 Generate code that doesn't assume ID based shared libraries are being used.
12574 This is the default.
12575
12576 @item -mshared-library-id=n
12577 Specified the identification number of the ID based shared library being
12578 compiled.  Specifying a value of 0 will generate more compact code, specifying
12579 other values will force the allocation of that number to the current
12580 library but is no more space or time efficient than omitting this option.
12581
12582 @item -mxgot
12583 @itemx -mno-xgot
12584 @opindex mxgot
12585 @opindex mno-xgot
12586 When generating position-independent code for ColdFire, generate code
12587 that works if the GOT has more than 8192 entries.  This code is
12588 larger and slower than code generated without this option.  On M680x0
12589 processors, this option is not needed; @option{-fPIC} suffices.
12590
12591 GCC normally uses a single instruction to load values from the GOT@.
12592 While this is relatively efficient, it only works if the GOT
12593 is smaller than about 64k.  Anything larger causes the linker
12594 to report an error such as:
12595
12596 @cindex relocation truncated to fit (ColdFire)
12597 @smallexample
12598 relocation truncated to fit: R_68K_GOT16O foobar
12599 @end smallexample
12600
12601 If this happens, you should recompile your code with @option{-mxgot}.
12602 It should then work with very large GOTs.  However, code generated with
12603 @option{-mxgot} is less efficient, since it takes 4 instructions to fetch
12604 the value of a global symbol.
12605
12606 Note that some linkers, including newer versions of the GNU linker,
12607 can create multiple GOTs and sort GOT entries.  If you have such a linker,
12608 you should only need to use @option{-mxgot} when compiling a single
12609 object file that accesses more than 8192 GOT entries.  Very few do.
12610
12611 These options have no effect unless GCC is generating
12612 position-independent code.
12613
12614 @end table
12615
12616 @node M68hc1x Options
12617 @subsection M68hc1x Options
12618 @cindex M68hc1x options
12619
12620 These are the @samp{-m} options defined for the 68hc11 and 68hc12
12621 microcontrollers.  The default values for these options depends on
12622 which style of microcontroller was selected when the compiler was configured;
12623 the defaults for the most common choices are given below.
12624
12625 @table @gcctabopt
12626 @item -m6811
12627 @itemx -m68hc11
12628 @opindex m6811
12629 @opindex m68hc11
12630 Generate output for a 68HC11.  This is the default
12631 when the compiler is configured for 68HC11-based systems.
12632
12633 @item -m6812
12634 @itemx -m68hc12
12635 @opindex m6812
12636 @opindex m68hc12
12637 Generate output for a 68HC12.  This is the default
12638 when the compiler is configured for 68HC12-based systems.
12639
12640 @item -m68S12
12641 @itemx -m68hcs12
12642 @opindex m68S12
12643 @opindex m68hcs12
12644 Generate output for a 68HCS12.
12645
12646 @item -mauto-incdec
12647 @opindex mauto-incdec
12648 Enable the use of 68HC12 pre and post auto-increment and auto-decrement
12649 addressing modes.
12650
12651 @item -minmax
12652 @itemx -mnominmax
12653 @opindex minmax
12654 @opindex mnominmax
12655 Enable the use of 68HC12 min and max instructions.
12656
12657 @item -mlong-calls
12658 @itemx -mno-long-calls
12659 @opindex mlong-calls
12660 @opindex mno-long-calls
12661 Treat all calls as being far away (near).  If calls are assumed to be
12662 far away, the compiler will use the @code{call} instruction to
12663 call a function and the @code{rtc} instruction for returning.
12664
12665 @item -mshort
12666 @opindex mshort
12667 Consider type @code{int} to be 16 bits wide, like @code{short int}.
12668
12669 @item -msoft-reg-count=@var{count}
12670 @opindex msoft-reg-count
12671 Specify the number of pseudo-soft registers which are used for the
12672 code generation.  The maximum number is 32.  Using more pseudo-soft
12673 register may or may not result in better code depending on the program.
12674 The default is 4 for 68HC11 and 2 for 68HC12.
12675
12676 @end table
12677
12678 @node MCore Options
12679 @subsection MCore Options
12680 @cindex MCore options
12681
12682 These are the @samp{-m} options defined for the Motorola M*Core
12683 processors.
12684
12685 @table @gcctabopt
12686
12687 @item -mhardlit
12688 @itemx -mno-hardlit
12689 @opindex mhardlit
12690 @opindex mno-hardlit
12691 Inline constants into the code stream if it can be done in two
12692 instructions or less.
12693
12694 @item -mdiv
12695 @itemx -mno-div
12696 @opindex mdiv
12697 @opindex mno-div
12698 Use the divide instruction.  (Enabled by default).
12699
12700 @item -mrelax-immediate
12701 @itemx -mno-relax-immediate
12702 @opindex mrelax-immediate
12703 @opindex mno-relax-immediate
12704 Allow arbitrary sized immediates in bit operations.
12705
12706 @item -mwide-bitfields
12707 @itemx -mno-wide-bitfields
12708 @opindex mwide-bitfields
12709 @opindex mno-wide-bitfields
12710 Always treat bit-fields as int-sized.
12711
12712 @item -m4byte-functions
12713 @itemx -mno-4byte-functions
12714 @opindex m4byte-functions
12715 @opindex mno-4byte-functions
12716 Force all functions to be aligned to a four byte boundary.
12717
12718 @item -mcallgraph-data
12719 @itemx -mno-callgraph-data
12720 @opindex mcallgraph-data
12721 @opindex mno-callgraph-data
12722 Emit callgraph information.
12723
12724 @item -mslow-bytes
12725 @itemx -mno-slow-bytes
12726 @opindex mslow-bytes
12727 @opindex mno-slow-bytes
12728 Prefer word access when reading byte quantities.
12729
12730 @item -mlittle-endian
12731 @itemx -mbig-endian
12732 @opindex mlittle-endian
12733 @opindex mbig-endian
12734 Generate code for a little endian target.
12735
12736 @item -m210
12737 @itemx -m340
12738 @opindex m210
12739 @opindex m340
12740 Generate code for the 210 processor.
12741
12742 @item -mno-lsim
12743 @opindex mno-lsim
12744 Assume that run-time support has been provided and so omit the
12745 simulator library (@file{libsim.a)} from the linker command line.
12746
12747 @item -mstack-increment=@var{size}
12748 @opindex mstack-increment
12749 Set the maximum amount for a single stack increment operation.  Large
12750 values can increase the speed of programs which contain functions
12751 that need a large amount of stack space, but they can also trigger a
12752 segmentation fault if the stack is extended too much.  The default
12753 value is 0x1000.
12754
12755 @end table
12756
12757 @node MIPS Options
12758 @subsection MIPS Options
12759 @cindex MIPS options
12760
12761 @table @gcctabopt
12762
12763 @item -EB
12764 @opindex EB
12765 Generate big-endian code.
12766
12767 @item -EL
12768 @opindex EL
12769 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
12770 configurations.
12771
12772 @item -march=@var{arch}
12773 @opindex march
12774 Generate code that will run on @var{arch}, which can be the name of a
12775 generic MIPS ISA, or the name of a particular processor.
12776 The ISA names are:
12777 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
12778 @samp{mips32}, @samp{mips32r2}, @samp{mips64} and @samp{mips64r2}.
12779 The processor names are:
12780 @samp{4kc}, @samp{4km}, @samp{4kp}, @samp{4ksc},
12781 @samp{4kec}, @samp{4kem}, @samp{4kep}, @samp{4ksd},
12782 @samp{5kc}, @samp{5kf},
12783 @samp{20kc},
12784 @samp{24kc}, @samp{24kf2_1}, @samp{24kf1_1},
12785 @samp{24kec}, @samp{24kef2_1}, @samp{24kef1_1},
12786 @samp{34kc}, @samp{34kf2_1}, @samp{34kf1_1},
12787 @samp{74kc}, @samp{74kf2_1}, @samp{74kf1_1}, @samp{74kf3_2},
12788 @samp{loongson2e}, @samp{loongson2f},
12789 @samp{m4k},
12790 @samp{octeon},
12791 @samp{orion},
12792 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
12793 @samp{r4600}, @samp{r4650}, @samp{r6000}, @samp{r8000},
12794 @samp{rm7000}, @samp{rm9000},
12795 @samp{r10000}, @samp{r12000}, @samp{r14000}, @samp{r16000},
12796 @samp{sb1},
12797 @samp{sr71000},
12798 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
12799 @samp{vr5000}, @samp{vr5400}, @samp{vr5500}
12800 and @samp{xlr}.
12801 The special value @samp{from-abi} selects the
12802 most compatible architecture for the selected ABI (that is,
12803 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
12804
12805 Native Linux/GNU toolchains also support the value @samp{native},
12806 which selects the best architecture option for the host processor.
12807 @option{-march=native} has no effect if GCC does not recognize
12808 the processor.
12809
12810 In processor names, a final @samp{000} can be abbreviated as @samp{k}
12811 (for example, @samp{-march=r2k}).  Prefixes are optional, and
12812 @samp{vr} may be written @samp{r}.
12813
12814 Names of the form @samp{@var{n}f2_1} refer to processors with
12815 FPUs clocked at half the rate of the core, names of the form
12816 @samp{@var{n}f1_1} refer to processors with FPUs clocked at the same
12817 rate as the core, and names of the form @samp{@var{n}f3_2} refer to
12818 processors with FPUs clocked a ratio of 3:2 with respect to the core.
12819 For compatibility reasons, @samp{@var{n}f} is accepted as a synonym
12820 for @samp{@var{n}f2_1} while @samp{@var{n}x} and @samp{@var{b}fx} are
12821 accepted as synonyms for @samp{@var{n}f1_1}.
12822
12823 GCC defines two macros based on the value of this option.  The first
12824 is @samp{_MIPS_ARCH}, which gives the name of target architecture, as
12825 a string.  The second has the form @samp{_MIPS_ARCH_@var{foo}},
12826 where @var{foo} is the capitalized value of @samp{_MIPS_ARCH}@.
12827 For example, @samp{-march=r2000} will set @samp{_MIPS_ARCH}
12828 to @samp{"r2000"} and define the macro @samp{_MIPS_ARCH_R2000}.
12829
12830 Note that the @samp{_MIPS_ARCH} macro uses the processor names given
12831 above.  In other words, it will have the full prefix and will not
12832 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
12833 the macro names the resolved architecture (either @samp{"mips1"} or
12834 @samp{"mips3"}).  It names the default architecture when no
12835 @option{-march} option is given.
12836
12837 @item -mtune=@var{arch}
12838 @opindex mtune
12839 Optimize for @var{arch}.  Among other things, this option controls
12840 the way instructions are scheduled, and the perceived cost of arithmetic
12841 operations.  The list of @var{arch} values is the same as for
12842 @option{-march}.
12843
12844 When this option is not used, GCC will optimize for the processor
12845 specified by @option{-march}.  By using @option{-march} and
12846 @option{-mtune} together, it is possible to generate code that will
12847 run on a family of processors, but optimize the code for one
12848 particular member of that family.
12849
12850 @samp{-mtune} defines the macros @samp{_MIPS_TUNE} and
12851 @samp{_MIPS_TUNE_@var{foo}}, which work in the same way as the
12852 @samp{-march} ones described above.
12853
12854 @item -mips1
12855 @opindex mips1
12856 Equivalent to @samp{-march=mips1}.
12857
12858 @item -mips2
12859 @opindex mips2
12860 Equivalent to @samp{-march=mips2}.
12861
12862 @item -mips3
12863 @opindex mips3
12864 Equivalent to @samp{-march=mips3}.
12865
12866 @item -mips4
12867 @opindex mips4
12868 Equivalent to @samp{-march=mips4}.
12869
12870 @item -mips32
12871 @opindex mips32
12872 Equivalent to @samp{-march=mips32}.
12873
12874 @item -mips32r2
12875 @opindex mips32r2
12876 Equivalent to @samp{-march=mips32r2}.
12877
12878 @item -mips64
12879 @opindex mips64
12880 Equivalent to @samp{-march=mips64}.
12881
12882 @item -mips64r2
12883 @opindex mips64r2
12884 Equivalent to @samp{-march=mips64r2}.
12885
12886 @item -mips16
12887 @itemx -mno-mips16
12888 @opindex mips16
12889 @opindex mno-mips16
12890 Generate (do not generate) MIPS16 code.  If GCC is targetting a
12891 MIPS32 or MIPS64 architecture, it will make use of the MIPS16e ASE@.
12892
12893 MIPS16 code generation can also be controlled on a per-function basis
12894 by means of @code{mips16} and @code{nomips16} attributes.  
12895 @xref{Function Attributes}, for more information.
12896
12897 @item -mflip-mips16
12898 @opindex mflip-mips16
12899 Generate MIPS16 code on alternating functions.  This option is provided
12900 for regression testing of mixed MIPS16/non-MIPS16 code generation, and is
12901 not intended for ordinary use in compiling user code.
12902
12903 @item -minterlink-mips16
12904 @itemx -mno-interlink-mips16
12905 @opindex minterlink-mips16
12906 @opindex mno-interlink-mips16
12907 Require (do not require) that non-MIPS16 code be link-compatible with
12908 MIPS16 code.
12909
12910 For example, non-MIPS16 code cannot jump directly to MIPS16 code;
12911 it must either use a call or an indirect jump.  @option{-minterlink-mips16}
12912 therefore disables direct jumps unless GCC knows that the target of the
12913 jump is not MIPS16.
12914
12915 @item -mabi=32
12916 @itemx -mabi=o64
12917 @itemx -mabi=n32
12918 @itemx -mabi=64
12919 @itemx -mabi=eabi
12920 @opindex mabi=32
12921 @opindex mabi=o64
12922 @opindex mabi=n32
12923 @opindex mabi=64
12924 @opindex mabi=eabi
12925 Generate code for the given ABI@.
12926
12927 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
12928 generates 64-bit code when you select a 64-bit architecture, but you
12929 can use @option{-mgp32} to get 32-bit code instead.
12930
12931 For information about the O64 ABI, see
12932 @w{@uref{http://gcc.gnu.org/projects/mipso64-abi.html}}.
12933
12934 GCC supports a variant of the o32 ABI in which floating-point registers
12935 are 64 rather than 32 bits wide.  You can select this combination with
12936 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @samp{mthc1}
12937 and @samp{mfhc1} instructions and is therefore only supported for
12938 MIPS32R2 processors.
12939
12940 The register assignments for arguments and return values remain the
12941 same, but each scalar value is passed in a single 64-bit register
12942 rather than a pair of 32-bit registers.  For example, scalar
12943 floating-point values are returned in @samp{$f0} only, not a
12944 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
12945 remains the same, but all 64 bits are saved.
12946
12947 @item -mabicalls
12948 @itemx -mno-abicalls
12949 @opindex mabicalls
12950 @opindex mno-abicalls
12951 Generate (do not generate) code that is suitable for SVR4-style
12952 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
12953 systems.
12954
12955 @item -mshared
12956 @itemx -mno-shared
12957 Generate (do not generate) code that is fully position-independent,
12958 and that can therefore be linked into shared libraries.  This option
12959 only affects @option{-mabicalls}.
12960
12961 All @option{-mabicalls} code has traditionally been position-independent,
12962 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
12963 as an extension, the GNU toolchain allows executables to use absolute
12964 accesses for locally-binding symbols.  It can also use shorter GP
12965 initialization sequences and generate direct calls to locally-defined
12966 functions.  This mode is selected by @option{-mno-shared}.
12967
12968 @option{-mno-shared} depends on binutils 2.16 or higher and generates
12969 objects that can only be linked by the GNU linker.  However, the option
12970 does not affect the ABI of the final executable; it only affects the ABI
12971 of relocatable objects.  Using @option{-mno-shared} will generally make
12972 executables both smaller and quicker.
12973
12974 @option{-mshared} is the default.
12975
12976 @item -mplt
12977 @itemx -mno-plt
12978 @opindex mplt
12979 @opindex mno-plt
12980 Assume (do not assume) that the static and dynamic linkers
12981 support PLTs and copy relocations.  This option only affects
12982 @samp{-mno-shared -mabicalls}.  For the n64 ABI, this option
12983 has no effect without @samp{-msym32}.
12984
12985 You can make @option{-mplt} the default by configuring
12986 GCC with @option{--with-mips-plt}.  The default is
12987 @option{-mno-plt} otherwise.
12988
12989 @item -mxgot
12990 @itemx -mno-xgot
12991 @opindex mxgot
12992 @opindex mno-xgot
12993 Lift (do not lift) the usual restrictions on the size of the global
12994 offset table.
12995
12996 GCC normally uses a single instruction to load values from the GOT@.
12997 While this is relatively efficient, it will only work if the GOT
12998 is smaller than about 64k.  Anything larger will cause the linker
12999 to report an error such as:
13000
13001 @cindex relocation truncated to fit (MIPS)
13002 @smallexample
13003 relocation truncated to fit: R_MIPS_GOT16 foobar
13004 @end smallexample
13005
13006 If this happens, you should recompile your code with @option{-mxgot}.
13007 It should then work with very large GOTs, although it will also be
13008 less efficient, since it will take three instructions to fetch the
13009 value of a global symbol.
13010
13011 Note that some linkers can create multiple GOTs.  If you have such a
13012 linker, you should only need to use @option{-mxgot} when a single object
13013 file accesses more than 64k's worth of GOT entries.  Very few do.
13014
13015 These options have no effect unless GCC is generating position
13016 independent code.
13017
13018 @item -mgp32
13019 @opindex mgp32
13020 Assume that general-purpose registers are 32 bits wide.
13021
13022 @item -mgp64
13023 @opindex mgp64
13024 Assume that general-purpose registers are 64 bits wide.
13025
13026 @item -mfp32
13027 @opindex mfp32
13028 Assume that floating-point registers are 32 bits wide.
13029
13030 @item -mfp64
13031 @opindex mfp64
13032 Assume that floating-point registers are 64 bits wide.
13033
13034 @item -mhard-float
13035 @opindex mhard-float
13036 Use floating-point coprocessor instructions.
13037
13038 @item -msoft-float
13039 @opindex msoft-float
13040 Do not use floating-point coprocessor instructions.  Implement
13041 floating-point calculations using library calls instead.
13042
13043 @item -msingle-float
13044 @opindex msingle-float
13045 Assume that the floating-point coprocessor only supports single-precision
13046 operations.
13047
13048 @item -mdouble-float
13049 @opindex mdouble-float
13050 Assume that the floating-point coprocessor supports double-precision
13051 operations.  This is the default.
13052
13053 @item -mllsc
13054 @itemx -mno-llsc
13055 @opindex mllsc
13056 @opindex mno-llsc
13057 Use (do not use) @samp{ll}, @samp{sc}, and @samp{sync} instructions to
13058 implement atomic memory built-in functions.  When neither option is
13059 specified, GCC will use the instructions if the target architecture
13060 supports them.
13061
13062 @option{-mllsc} is useful if the runtime environment can emulate the
13063 instructions and @option{-mno-llsc} can be useful when compiling for
13064 nonstandard ISAs.  You can make either option the default by
13065 configuring GCC with @option{--with-llsc} and @option{--without-llsc}
13066 respectively.  @option{--with-llsc} is the default for some
13067 configurations; see the installation documentation for details.
13068
13069 @item -mdsp
13070 @itemx -mno-dsp
13071 @opindex mdsp
13072 @opindex mno-dsp
13073 Use (do not use) revision 1 of the MIPS DSP ASE@.
13074 @xref{MIPS DSP Built-in Functions}.  This option defines the
13075 preprocessor macro @samp{__mips_dsp}.  It also defines
13076 @samp{__mips_dsp_rev} to 1.
13077
13078 @item -mdspr2
13079 @itemx -mno-dspr2
13080 @opindex mdspr2
13081 @opindex mno-dspr2
13082 Use (do not use) revision 2 of the MIPS DSP ASE@.
13083 @xref{MIPS DSP Built-in Functions}.  This option defines the
13084 preprocessor macros @samp{__mips_dsp} and @samp{__mips_dspr2}.
13085 It also defines @samp{__mips_dsp_rev} to 2.
13086
13087 @item -msmartmips
13088 @itemx -mno-smartmips
13089 @opindex msmartmips
13090 @opindex mno-smartmips
13091 Use (do not use) the MIPS SmartMIPS ASE.
13092
13093 @item -mpaired-single
13094 @itemx -mno-paired-single
13095 @opindex mpaired-single
13096 @opindex mno-paired-single
13097 Use (do not use) paired-single floating-point instructions.
13098 @xref{MIPS Paired-Single Support}.  This option requires
13099 hardware floating-point support to be enabled.
13100
13101 @item -mdmx
13102 @itemx -mno-mdmx
13103 @opindex mdmx
13104 @opindex mno-mdmx
13105 Use (do not use) MIPS Digital Media Extension instructions.
13106 This option can only be used when generating 64-bit code and requires
13107 hardware floating-point support to be enabled.
13108
13109 @item -mips3d
13110 @itemx -mno-mips3d
13111 @opindex mips3d
13112 @opindex mno-mips3d
13113 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
13114 The option @option{-mips3d} implies @option{-mpaired-single}.
13115
13116 @item -mmt
13117 @itemx -mno-mt
13118 @opindex mmt
13119 @opindex mno-mt
13120 Use (do not use) MT Multithreading instructions.
13121
13122 @item -mlong64
13123 @opindex mlong64
13124 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
13125 an explanation of the default and the way that the pointer size is
13126 determined.
13127
13128 @item -mlong32
13129 @opindex mlong32
13130 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
13131
13132 The default size of @code{int}s, @code{long}s and pointers depends on
13133 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
13134 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
13135 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
13136 or the same size as integer registers, whichever is smaller.
13137
13138 @item -msym32
13139 @itemx -mno-sym32
13140 @opindex msym32
13141 @opindex mno-sym32
13142 Assume (do not assume) that all symbols have 32-bit values, regardless
13143 of the selected ABI@.  This option is useful in combination with
13144 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
13145 to generate shorter and faster references to symbolic addresses.
13146
13147 @item -G @var{num}
13148 @opindex G
13149 Put definitions of externally-visible data in a small data section
13150 if that data is no bigger than @var{num} bytes.  GCC can then access
13151 the data more efficiently; see @option{-mgpopt} for details.
13152
13153 The default @option{-G} option depends on the configuration.
13154
13155 @item -mlocal-sdata
13156 @itemx -mno-local-sdata
13157 @opindex mlocal-sdata
13158 @opindex mno-local-sdata
13159 Extend (do not extend) the @option{-G} behavior to local data too,
13160 such as to static variables in C@.  @option{-mlocal-sdata} is the
13161 default for all configurations.
13162
13163 If the linker complains that an application is using too much small data,
13164 you might want to try rebuilding the less performance-critical parts with
13165 @option{-mno-local-sdata}.  You might also want to build large
13166 libraries with @option{-mno-local-sdata}, so that the libraries leave
13167 more room for the main program.
13168
13169 @item -mextern-sdata
13170 @itemx -mno-extern-sdata
13171 @opindex mextern-sdata
13172 @opindex mno-extern-sdata
13173 Assume (do not assume) that externally-defined data will be in
13174 a small data section if that data is within the @option{-G} limit.
13175 @option{-mextern-sdata} is the default for all configurations.
13176
13177 If you compile a module @var{Mod} with @option{-mextern-sdata} @option{-G
13178 @var{num}} @option{-mgpopt}, and @var{Mod} references a variable @var{Var}
13179 that is no bigger than @var{num} bytes, you must make sure that @var{Var}
13180 is placed in a small data section.  If @var{Var} is defined by another
13181 module, you must either compile that module with a high-enough
13182 @option{-G} setting or attach a @code{section} attribute to @var{Var}'s
13183 definition.  If @var{Var} is common, you must link the application
13184 with a high-enough @option{-G} setting.
13185
13186 The easiest way of satisfying these restrictions is to compile
13187 and link every module with the same @option{-G} option.  However,
13188 you may wish to build a library that supports several different
13189 small data limits.  You can do this by compiling the library with
13190 the highest supported @option{-G} setting and additionally using
13191 @option{-mno-extern-sdata} to stop the library from making assumptions
13192 about externally-defined data.
13193
13194 @item -mgpopt
13195 @itemx -mno-gpopt
13196 @opindex mgpopt
13197 @opindex mno-gpopt
13198 Use (do not use) GP-relative accesses for symbols that are known to be
13199 in a small data section; see @option{-G}, @option{-mlocal-sdata} and
13200 @option{-mextern-sdata}.  @option{-mgpopt} is the default for all
13201 configurations.
13202
13203 @option{-mno-gpopt} is useful for cases where the @code{$gp} register
13204 might not hold the value of @code{_gp}.  For example, if the code is
13205 part of a library that might be used in a boot monitor, programs that
13206 call boot monitor routines will pass an unknown value in @code{$gp}.
13207 (In such situations, the boot monitor itself would usually be compiled
13208 with @option{-G0}.)
13209
13210 @option{-mno-gpopt} implies @option{-mno-local-sdata} and
13211 @option{-mno-extern-sdata}.
13212
13213 @item -membedded-data
13214 @itemx -mno-embedded-data
13215 @opindex membedded-data
13216 @opindex mno-embedded-data
13217 Allocate variables to the read-only data section first if possible, then
13218 next in the small data section if possible, otherwise in data.  This gives
13219 slightly slower code than the default, but reduces the amount of RAM required
13220 when executing, and thus may be preferred for some embedded systems.
13221
13222 @item -muninit-const-in-rodata
13223 @itemx -mno-uninit-const-in-rodata
13224 @opindex muninit-const-in-rodata
13225 @opindex mno-uninit-const-in-rodata
13226 Put uninitialized @code{const} variables in the read-only data section.
13227 This option is only meaningful in conjunction with @option{-membedded-data}.
13228
13229 @item -mcode-readable=@var{setting}
13230 @opindex mcode-readable
13231 Specify whether GCC may generate code that reads from executable sections.
13232 There are three possible settings:
13233
13234 @table @gcctabopt
13235 @item -mcode-readable=yes
13236 Instructions may freely access executable sections.  This is the
13237 default setting.
13238
13239 @item -mcode-readable=pcrel
13240 MIPS16 PC-relative load instructions can access executable sections,
13241 but other instructions must not do so.  This option is useful on 4KSc
13242 and 4KSd processors when the code TLBs have the Read Inhibit bit set.
13243 It is also useful on processors that can be configured to have a dual
13244 instruction/data SRAM interface and that, like the M4K, automatically
13245 redirect PC-relative loads to the instruction RAM.
13246
13247 @item -mcode-readable=no
13248 Instructions must not access executable sections.  This option can be
13249 useful on targets that are configured to have a dual instruction/data
13250 SRAM interface but that (unlike the M4K) do not automatically redirect
13251 PC-relative loads to the instruction RAM.
13252 @end table
13253
13254 @item -msplit-addresses
13255 @itemx -mno-split-addresses
13256 @opindex msplit-addresses
13257 @opindex mno-split-addresses
13258 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
13259 relocation operators.  This option has been superseded by
13260 @option{-mexplicit-relocs} but is retained for backwards compatibility.
13261
13262 @item -mexplicit-relocs
13263 @itemx -mno-explicit-relocs
13264 @opindex mexplicit-relocs
13265 @opindex mno-explicit-relocs
13266 Use (do not use) assembler relocation operators when dealing with symbolic
13267 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
13268 is to use assembler macros instead.
13269
13270 @option{-mexplicit-relocs} is the default if GCC was configured
13271 to use an assembler that supports relocation operators.
13272
13273 @item -mcheck-zero-division
13274 @itemx -mno-check-zero-division
13275 @opindex mcheck-zero-division
13276 @opindex mno-check-zero-division
13277 Trap (do not trap) on integer division by zero.
13278
13279 The default is @option{-mcheck-zero-division}.
13280
13281 @item -mdivide-traps
13282 @itemx -mdivide-breaks
13283 @opindex mdivide-traps
13284 @opindex mdivide-breaks
13285 MIPS systems check for division by zero by generating either a
13286 conditional trap or a break instruction.  Using traps results in
13287 smaller code, but is only supported on MIPS II and later.  Also, some
13288 versions of the Linux kernel have a bug that prevents trap from
13289 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
13290 allow conditional traps on architectures that support them and
13291 @option{-mdivide-breaks} to force the use of breaks.
13292
13293 The default is usually @option{-mdivide-traps}, but this can be
13294 overridden at configure time using @option{--with-divide=breaks}.
13295 Divide-by-zero checks can be completely disabled using
13296 @option{-mno-check-zero-division}.
13297
13298 @item -mmemcpy
13299 @itemx -mno-memcpy
13300 @opindex mmemcpy
13301 @opindex mno-memcpy
13302 Force (do not force) the use of @code{memcpy()} for non-trivial block
13303 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
13304 most constant-sized copies.
13305
13306 @item -mlong-calls
13307 @itemx -mno-long-calls
13308 @opindex mlong-calls
13309 @opindex mno-long-calls
13310 Disable (do not disable) use of the @code{jal} instruction.  Calling
13311 functions using @code{jal} is more efficient but requires the caller
13312 and callee to be in the same 256 megabyte segment.
13313
13314 This option has no effect on abicalls code.  The default is
13315 @option{-mno-long-calls}.
13316
13317 @item -mmad
13318 @itemx -mno-mad
13319 @opindex mmad
13320 @opindex mno-mad
13321 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
13322 instructions, as provided by the R4650 ISA@.
13323
13324 @item -mfused-madd
13325 @itemx -mno-fused-madd
13326 @opindex mfused-madd
13327 @opindex mno-fused-madd
13328 Enable (disable) use of the floating point multiply-accumulate
13329 instructions, when they are available.  The default is
13330 @option{-mfused-madd}.
13331
13332 When multiply-accumulate instructions are used, the intermediate
13333 product is calculated to infinite precision and is not subject to
13334 the FCSR Flush to Zero bit.  This may be undesirable in some
13335 circumstances.
13336
13337 @item -nocpp
13338 @opindex nocpp
13339 Tell the MIPS assembler to not run its preprocessor over user
13340 assembler files (with a @samp{.s} suffix) when assembling them.
13341
13342 @item -mfix-r4000
13343 @itemx -mno-fix-r4000
13344 @opindex mfix-r4000
13345 @opindex mno-fix-r4000
13346 Work around certain R4000 CPU errata:
13347 @itemize @minus
13348 @item
13349 A double-word or a variable shift may give an incorrect result if executed
13350 immediately after starting an integer division.
13351 @item
13352 A double-word or a variable shift may give an incorrect result if executed
13353 while an integer multiplication is in progress.
13354 @item
13355 An integer division may give an incorrect result if started in a delay slot
13356 of a taken branch or a jump.
13357 @end itemize
13358
13359 @item -mfix-r4400
13360 @itemx -mno-fix-r4400
13361 @opindex mfix-r4400
13362 @opindex mno-fix-r4400
13363 Work around certain R4400 CPU errata:
13364 @itemize @minus
13365 @item
13366 A double-word or a variable shift may give an incorrect result if executed
13367 immediately after starting an integer division.
13368 @end itemize
13369
13370 @item -mfix-r10000
13371 @itemx -mno-fix-r10000
13372 @opindex mfix-r10000
13373 @opindex mno-fix-r10000
13374 Work around certain R10000 errata:
13375 @itemize @minus
13376 @item
13377 @code{ll}/@code{sc} sequences may not behave atomically on revisions
13378 prior to 3.0.  They may deadlock on revisions 2.6 and earlier.
13379 @end itemize
13380
13381 This option can only be used if the target architecture supports
13382 branch-likely instructions.  @option{-mfix-r10000} is the default when
13383 @option{-march=r10000} is used; @option{-mno-fix-r10000} is the default
13384 otherwise.
13385
13386 @item -mfix-vr4120
13387 @itemx -mno-fix-vr4120
13388 @opindex mfix-vr4120
13389 Work around certain VR4120 errata:
13390 @itemize @minus
13391 @item
13392 @code{dmultu} does not always produce the correct result.
13393 @item
13394 @code{div} and @code{ddiv} do not always produce the correct result if one
13395 of the operands is negative.
13396 @end itemize
13397 The workarounds for the division errata rely on special functions in
13398 @file{libgcc.a}.  At present, these functions are only provided by
13399 the @code{mips64vr*-elf} configurations.
13400
13401 Other VR4120 errata require a nop to be inserted between certain pairs of
13402 instructions.  These errata are handled by the assembler, not by GCC itself.
13403
13404 @item -mfix-vr4130
13405 @opindex mfix-vr4130
13406 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
13407 workarounds are implemented by the assembler rather than by GCC,
13408 although GCC will avoid using @code{mflo} and @code{mfhi} if the
13409 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
13410 instructions are available instead.
13411
13412 @item -mfix-sb1
13413 @itemx -mno-fix-sb1
13414 @opindex mfix-sb1
13415 Work around certain SB-1 CPU core errata.
13416 (This flag currently works around the SB-1 revision 2
13417 ``F1'' and ``F2'' floating point errata.)
13418
13419 @item -mr10k-cache-barrier=@var{setting}
13420 @opindex mr10k-cache-barrier
13421 Specify whether GCC should insert cache barriers to avoid the
13422 side-effects of speculation on R10K processors.
13423
13424 In common with many processors, the R10K tries to predict the outcome
13425 of a conditional branch and speculatively executes instructions from
13426 the ``taken'' branch.  It later aborts these instructions if the
13427 predicted outcome was wrong.  However, on the R10K, even aborted
13428 instructions can have side effects.
13429
13430 This problem only affects kernel stores and, depending on the system,
13431 kernel loads.  As an example, a speculatively-executed store may load
13432 the target memory into cache and mark the cache line as dirty, even if
13433 the store itself is later aborted.  If a DMA operation writes to the
13434 same area of memory before the ``dirty'' line is flushed, the cached
13435 data will overwrite the DMA-ed data.  See the R10K processor manual
13436 for a full description, including other potential problems.
13437
13438 One workaround is to insert cache barrier instructions before every memory
13439 access that might be speculatively executed and that might have side
13440 effects even if aborted.  @option{-mr10k-cache-barrier=@var{setting}}
13441 controls GCC's implementation of this workaround.  It assumes that
13442 aborted accesses to any byte in the following regions will not have
13443 side effects:
13444
13445 @enumerate
13446 @item
13447 the memory occupied by the current function's stack frame;
13448
13449 @item
13450 the memory occupied by an incoming stack argument;
13451
13452 @item
13453 the memory occupied by an object with a link-time-constant address.
13454 @end enumerate
13455
13456 It is the kernel's responsibility to ensure that speculative
13457 accesses to these regions are indeed safe.
13458
13459 If the input program contains a function declaration such as:
13460
13461 @smallexample
13462 void foo (void);
13463 @end smallexample
13464
13465 then the implementation of @code{foo} must allow @code{j foo} and
13466 @code{jal foo} to be executed speculatively.  GCC honors this
13467 restriction for functions it compiles itself.  It expects non-GCC
13468 functions (such as hand-written assembly code) to do the same.
13469
13470 The option has three forms:
13471
13472 @table @gcctabopt
13473 @item -mr10k-cache-barrier=load-store
13474 Insert a cache barrier before a load or store that might be
13475 speculatively executed and that might have side effects even
13476 if aborted.
13477
13478 @item -mr10k-cache-barrier=store
13479 Insert a cache barrier before a store that might be speculatively
13480 executed and that might have side effects even if aborted.
13481
13482 @item -mr10k-cache-barrier=none
13483 Disable the insertion of cache barriers.  This is the default setting.
13484 @end table
13485
13486 @item -mflush-func=@var{func}
13487 @itemx -mno-flush-func
13488 @opindex mflush-func
13489 Specifies the function to call to flush the I and D caches, or to not
13490 call any such function.  If called, the function must take the same
13491 arguments as the common @code{_flush_func()}, that is, the address of the
13492 memory range for which the cache is being flushed, the size of the
13493 memory range, and the number 3 (to flush both caches).  The default
13494 depends on the target GCC was configured for, but commonly is either
13495 @samp{_flush_func} or @samp{__cpu_flush}.
13496
13497 @item mbranch-cost=@var{num}
13498 @opindex mbranch-cost
13499 Set the cost of branches to roughly @var{num} ``simple'' instructions.
13500 This cost is only a heuristic and is not guaranteed to produce
13501 consistent results across releases.  A zero cost redundantly selects
13502 the default, which is based on the @option{-mtune} setting.
13503
13504 @item -mbranch-likely
13505 @itemx -mno-branch-likely
13506 @opindex mbranch-likely
13507 @opindex mno-branch-likely
13508 Enable or disable use of Branch Likely instructions, regardless of the
13509 default for the selected architecture.  By default, Branch Likely
13510 instructions may be generated if they are supported by the selected
13511 architecture.  An exception is for the MIPS32 and MIPS64 architectures
13512 and processors which implement those architectures; for those, Branch
13513 Likely instructions will not be generated by default because the MIPS32
13514 and MIPS64 architectures specifically deprecate their use.
13515
13516 @item -mfp-exceptions
13517 @itemx -mno-fp-exceptions
13518 @opindex mfp-exceptions
13519 Specifies whether FP exceptions are enabled.  This affects how we schedule
13520 FP instructions for some processors.  The default is that FP exceptions are
13521 enabled.
13522
13523 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
13524 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
13525 FP pipe.
13526
13527 @item -mvr4130-align
13528 @itemx -mno-vr4130-align
13529 @opindex mvr4130-align
13530 The VR4130 pipeline is two-way superscalar, but can only issue two
13531 instructions together if the first one is 8-byte aligned.  When this
13532 option is enabled, GCC will align pairs of instructions that it
13533 thinks should execute in parallel.
13534
13535 This option only has an effect when optimizing for the VR4130.
13536 It normally makes code faster, but at the expense of making it bigger.
13537 It is enabled by default at optimization level @option{-O3}.
13538 @end table
13539
13540 @node MMIX Options
13541 @subsection MMIX Options
13542 @cindex MMIX Options
13543
13544 These options are defined for the MMIX:
13545
13546 @table @gcctabopt
13547 @item -mlibfuncs
13548 @itemx -mno-libfuncs
13549 @opindex mlibfuncs
13550 @opindex mno-libfuncs
13551 Specify that intrinsic library functions are being compiled, passing all
13552 values in registers, no matter the size.
13553
13554 @item -mepsilon
13555 @itemx -mno-epsilon
13556 @opindex mepsilon
13557 @opindex mno-epsilon
13558 Generate floating-point comparison instructions that compare with respect
13559 to the @code{rE} epsilon register.
13560
13561 @item -mabi=mmixware
13562 @itemx -mabi=gnu
13563 @opindex mabi=mmixware
13564 @opindex mabi=gnu
13565 Generate code that passes function parameters and return values that (in
13566 the called function) are seen as registers @code{$0} and up, as opposed to
13567 the GNU ABI which uses global registers @code{$231} and up.
13568
13569 @item -mzero-extend
13570 @itemx -mno-zero-extend
13571 @opindex mzero-extend
13572 @opindex mno-zero-extend
13573 When reading data from memory in sizes shorter than 64 bits, use (do not
13574 use) zero-extending load instructions by default, rather than
13575 sign-extending ones.
13576
13577 @item -mknuthdiv
13578 @itemx -mno-knuthdiv
13579 @opindex mknuthdiv
13580 @opindex mno-knuthdiv
13581 Make the result of a division yielding a remainder have the same sign as
13582 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
13583 remainder follows the sign of the dividend.  Both methods are
13584 arithmetically valid, the latter being almost exclusively used.
13585
13586 @item -mtoplevel-symbols
13587 @itemx -mno-toplevel-symbols
13588 @opindex mtoplevel-symbols
13589 @opindex mno-toplevel-symbols
13590 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
13591 code can be used with the @code{PREFIX} assembly directive.
13592
13593 @item -melf
13594 @opindex melf
13595 Generate an executable in the ELF format, rather than the default
13596 @samp{mmo} format used by the @command{mmix} simulator.
13597
13598 @item -mbranch-predict
13599 @itemx -mno-branch-predict
13600 @opindex mbranch-predict
13601 @opindex mno-branch-predict
13602 Use (do not use) the probable-branch instructions, when static branch
13603 prediction indicates a probable branch.
13604
13605 @item -mbase-addresses
13606 @itemx -mno-base-addresses
13607 @opindex mbase-addresses
13608 @opindex mno-base-addresses
13609 Generate (do not generate) code that uses @emph{base addresses}.  Using a
13610 base address automatically generates a request (handled by the assembler
13611 and the linker) for a constant to be set up in a global register.  The
13612 register is used for one or more base address requests within the range 0
13613 to 255 from the value held in the register.  The generally leads to short
13614 and fast code, but the number of different data items that can be
13615 addressed is limited.  This means that a program that uses lots of static
13616 data may require @option{-mno-base-addresses}.
13617
13618 @item -msingle-exit
13619 @itemx -mno-single-exit
13620 @opindex msingle-exit
13621 @opindex mno-single-exit
13622 Force (do not force) generated code to have a single exit point in each
13623 function.
13624 @end table
13625
13626 @node MN10300 Options
13627 @subsection MN10300 Options
13628 @cindex MN10300 options
13629
13630 These @option{-m} options are defined for Matsushita MN10300 architectures:
13631
13632 @table @gcctabopt
13633 @item -mmult-bug
13634 @opindex mmult-bug
13635 Generate code to avoid bugs in the multiply instructions for the MN10300
13636 processors.  This is the default.
13637
13638 @item -mno-mult-bug
13639 @opindex mno-mult-bug
13640 Do not generate code to avoid bugs in the multiply instructions for the
13641 MN10300 processors.
13642
13643 @item -mam33
13644 @opindex mam33
13645 Generate code which uses features specific to the AM33 processor.
13646
13647 @item -mno-am33
13648 @opindex mno-am33
13649 Do not generate code which uses features specific to the AM33 processor.  This
13650 is the default.
13651
13652 @item -mreturn-pointer-on-d0
13653 @opindex mreturn-pointer-on-d0
13654 When generating a function which returns a pointer, return the pointer
13655 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
13656 only in a0, and attempts to call such functions without a prototype
13657 would result in errors.  Note that this option is on by default; use
13658 @option{-mno-return-pointer-on-d0} to disable it.
13659
13660 @item -mno-crt0
13661 @opindex mno-crt0
13662 Do not link in the C run-time initialization object file.
13663
13664 @item -mrelax
13665 @opindex mrelax
13666 Indicate to the linker that it should perform a relaxation optimization pass
13667 to shorten branches, calls and absolute memory addresses.  This option only
13668 has an effect when used on the command line for the final link step.
13669
13670 This option makes symbolic debugging impossible.
13671 @end table
13672
13673 @node PDP-11 Options
13674 @subsection PDP-11 Options
13675 @cindex PDP-11 Options
13676
13677 These options are defined for the PDP-11:
13678
13679 @table @gcctabopt
13680 @item -mfpu
13681 @opindex mfpu
13682 Use hardware FPP floating point.  This is the default.  (FIS floating
13683 point on the PDP-11/40 is not supported.)
13684
13685 @item -msoft-float
13686 @opindex msoft-float
13687 Do not use hardware floating point.
13688
13689 @item -mac0
13690 @opindex mac0
13691 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
13692
13693 @item -mno-ac0
13694 @opindex mno-ac0
13695 Return floating-point results in memory.  This is the default.
13696
13697 @item -m40
13698 @opindex m40
13699 Generate code for a PDP-11/40.
13700
13701 @item -m45
13702 @opindex m45
13703 Generate code for a PDP-11/45.  This is the default.
13704
13705 @item -m10
13706 @opindex m10
13707 Generate code for a PDP-11/10.
13708
13709 @item -mbcopy-builtin
13710 @opindex mbcopy-builtin
13711 Use inline @code{movmemhi} patterns for copying memory.  This is the
13712 default.
13713
13714 @item -mbcopy
13715 @opindex mbcopy
13716 Do not use inline @code{movmemhi} patterns for copying memory.
13717
13718 @item -mint16
13719 @itemx -mno-int32
13720 @opindex mint16
13721 @opindex mno-int32
13722 Use 16-bit @code{int}.  This is the default.
13723
13724 @item -mint32
13725 @itemx -mno-int16
13726 @opindex mint32
13727 @opindex mno-int16
13728 Use 32-bit @code{int}.
13729
13730 @item -mfloat64
13731 @itemx -mno-float32
13732 @opindex mfloat64
13733 @opindex mno-float32
13734 Use 64-bit @code{float}.  This is the default.
13735
13736 @item -mfloat32
13737 @itemx -mno-float64
13738 @opindex mfloat32
13739 @opindex mno-float64
13740 Use 32-bit @code{float}.
13741
13742 @item -mabshi
13743 @opindex mabshi
13744 Use @code{abshi2} pattern.  This is the default.
13745
13746 @item -mno-abshi
13747 @opindex mno-abshi
13748 Do not use @code{abshi2} pattern.
13749
13750 @item -mbranch-expensive
13751 @opindex mbranch-expensive
13752 Pretend that branches are expensive.  This is for experimenting with
13753 code generation only.
13754
13755 @item -mbranch-cheap
13756 @opindex mbranch-cheap
13757 Do not pretend that branches are expensive.  This is the default.
13758
13759 @item -msplit
13760 @opindex msplit
13761 Generate code for a system with split I&D@.
13762
13763 @item -mno-split
13764 @opindex mno-split
13765 Generate code for a system without split I&D@.  This is the default.
13766
13767 @item -munix-asm
13768 @opindex munix-asm
13769 Use Unix assembler syntax.  This is the default when configured for
13770 @samp{pdp11-*-bsd}.
13771
13772 @item -mdec-asm
13773 @opindex mdec-asm
13774 Use DEC assembler syntax.  This is the default when configured for any
13775 PDP-11 target other than @samp{pdp11-*-bsd}.
13776 @end table
13777
13778 @node picoChip Options
13779 @subsection picoChip Options
13780 @cindex picoChip options
13781
13782 These @samp{-m} options are defined for picoChip implementations:
13783
13784 @table @gcctabopt
13785
13786 @item -mae=@var{ae_type}
13787 @opindex mcpu
13788 Set the instruction set, register set, and instruction scheduling
13789 parameters for array element type @var{ae_type}.  Supported values
13790 for @var{ae_type} are @samp{ANY}, @samp{MUL}, and @samp{MAC}.
13791
13792 @option{-mae=ANY} selects a completely generic AE type.  Code
13793 generated with this option will run on any of the other AE types.  The
13794 code will not be as efficient as it would be if compiled for a specific
13795 AE type, and some types of operation (e.g., multiplication) will not
13796 work properly on all types of AE.
13797
13798 @option{-mae=MUL} selects a MUL AE type.  This is the most useful AE type
13799 for compiled code, and is the default.
13800
13801 @option{-mae=MAC} selects a DSP-style MAC AE.  Code compiled with this
13802 option may suffer from poor performance of byte (char) manipulation,
13803 since the DSP AE does not provide hardware support for byte load/stores.
13804
13805 @item -msymbol-as-address
13806 Enable the compiler to directly use a symbol name as an address in a
13807 load/store instruction, without first loading it into a
13808 register.  Typically, the use of this option will generate larger
13809 programs, which run faster than when the option isn't used.  However, the
13810 results vary from program to program, so it is left as a user option,
13811 rather than being permanently enabled.
13812
13813 @item -mno-inefficient-warnings
13814 Disables warnings about the generation of inefficient code.  These
13815 warnings can be generated, for example, when compiling code which
13816 performs byte-level memory operations on the MAC AE type.  The MAC AE has
13817 no hardware support for byte-level memory operations, so all byte
13818 load/stores must be synthesized from word load/store operations.  This is
13819 inefficient and a warning will be generated indicating to the programmer
13820 that they should rewrite the code to avoid byte operations, or to target
13821 an AE type which has the necessary hardware support.  This option enables
13822 the warning to be turned off.
13823
13824 @end table
13825
13826 @node PowerPC Options
13827 @subsection PowerPC Options
13828 @cindex PowerPC options
13829
13830 These are listed under @xref{RS/6000 and PowerPC Options}.
13831
13832 @node RS/6000 and PowerPC Options
13833 @subsection IBM RS/6000 and PowerPC Options
13834 @cindex RS/6000 and PowerPC Options
13835 @cindex IBM RS/6000 and PowerPC Options
13836
13837 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
13838 @table @gcctabopt
13839 @item -mpower
13840 @itemx -mno-power
13841 @itemx -mpower2
13842 @itemx -mno-power2
13843 @itemx -mpowerpc
13844 @itemx -mno-powerpc
13845 @itemx -mpowerpc-gpopt
13846 @itemx -mno-powerpc-gpopt
13847 @itemx -mpowerpc-gfxopt
13848 @itemx -mno-powerpc-gfxopt
13849 @itemx -mpowerpc64
13850 @itemx -mno-powerpc64
13851 @itemx -mmfcrf
13852 @itemx -mno-mfcrf
13853 @itemx -mpopcntb
13854 @itemx -mno-popcntb
13855 @itemx -mfprnd
13856 @itemx -mno-fprnd
13857 @itemx -mcmpb
13858 @itemx -mno-cmpb
13859 @itemx -mmfpgpr
13860 @itemx -mno-mfpgpr
13861 @itemx -mhard-dfp
13862 @itemx -mno-hard-dfp
13863 @opindex mpower
13864 @opindex mno-power
13865 @opindex mpower2
13866 @opindex mno-power2
13867 @opindex mpowerpc
13868 @opindex mno-powerpc
13869 @opindex mpowerpc-gpopt
13870 @opindex mno-powerpc-gpopt
13871 @opindex mpowerpc-gfxopt
13872 @opindex mno-powerpc-gfxopt
13873 @opindex mpowerpc64
13874 @opindex mno-powerpc64
13875 @opindex mmfcrf
13876 @opindex mno-mfcrf
13877 @opindex mpopcntb
13878 @opindex mno-popcntb
13879 @opindex mfprnd
13880 @opindex mno-fprnd
13881 @opindex mcmpb
13882 @opindex mno-cmpb
13883 @opindex mmfpgpr
13884 @opindex mno-mfpgpr
13885 @opindex mhard-dfp
13886 @opindex mno-hard-dfp
13887 GCC supports two related instruction set architectures for the
13888 RS/6000 and PowerPC@.  The @dfn{POWER} instruction set are those
13889 instructions supported by the @samp{rios} chip set used in the original
13890 RS/6000 systems and the @dfn{PowerPC} instruction set is the
13891 architecture of the Freescale MPC5xx, MPC6xx, MPC8xx microprocessors, and
13892 the IBM 4xx, 6xx, and follow-on microprocessors.
13893
13894 Neither architecture is a subset of the other.  However there is a
13895 large common subset of instructions supported by both.  An MQ
13896 register is included in processors supporting the POWER architecture.
13897
13898 You use these options to specify which instructions are available on the
13899 processor you are using.  The default value of these options is
13900 determined when configuring GCC@.  Specifying the
13901 @option{-mcpu=@var{cpu_type}} overrides the specification of these
13902 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
13903 rather than the options listed above.
13904
13905 The @option{-mpower} option allows GCC to generate instructions that
13906 are found only in the POWER architecture and to use the MQ register.
13907 Specifying @option{-mpower2} implies @option{-power} and also allows GCC
13908 to generate instructions that are present in the POWER2 architecture but
13909 not the original POWER architecture.
13910
13911 The @option{-mpowerpc} option allows GCC to generate instructions that
13912 are found only in the 32-bit subset of the PowerPC architecture.
13913 Specifying @option{-mpowerpc-gpopt} implies @option{-mpowerpc} and also allows
13914 GCC to use the optional PowerPC architecture instructions in the
13915 General Purpose group, including floating-point square root.  Specifying
13916 @option{-mpowerpc-gfxopt} implies @option{-mpowerpc} and also allows GCC to
13917 use the optional PowerPC architecture instructions in the Graphics
13918 group, including floating-point select.
13919
13920 The @option{-mmfcrf} option allows GCC to generate the move from
13921 condition register field instruction implemented on the POWER4
13922 processor and other processors that support the PowerPC V2.01
13923 architecture.
13924 The @option{-mpopcntb} option allows GCC to generate the popcount and
13925 double precision FP reciprocal estimate instruction implemented on the
13926 POWER5 processor and other processors that support the PowerPC V2.02
13927 architecture.
13928 The @option{-mfprnd} option allows GCC to generate the FP round to
13929 integer instructions implemented on the POWER5+ processor and other
13930 processors that support the PowerPC V2.03 architecture.
13931 The @option{-mcmpb} option allows GCC to generate the compare bytes
13932 instruction implemented on the POWER6 processor and other processors
13933 that support the PowerPC V2.05 architecture.
13934 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
13935 general purpose register instructions implemented on the POWER6X
13936 processor and other processors that support the extended PowerPC V2.05
13937 architecture.
13938 The @option{-mhard-dfp} option allows GCC to generate the decimal floating
13939 point instructions implemented on some POWER processors.
13940
13941 The @option{-mpowerpc64} option allows GCC to generate the additional
13942 64-bit instructions that are found in the full PowerPC64 architecture
13943 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
13944 @option{-mno-powerpc64}.
13945
13946 If you specify both @option{-mno-power} and @option{-mno-powerpc}, GCC
13947 will use only the instructions in the common subset of both
13948 architectures plus some special AIX common-mode calls, and will not use
13949 the MQ register.  Specifying both @option{-mpower} and @option{-mpowerpc}
13950 permits GCC to use any instruction from either architecture and to
13951 allow use of the MQ register; specify this for the Motorola MPC601.
13952
13953 @item -mnew-mnemonics
13954 @itemx -mold-mnemonics
13955 @opindex mnew-mnemonics
13956 @opindex mold-mnemonics
13957 Select which mnemonics to use in the generated assembler code.  With
13958 @option{-mnew-mnemonics}, GCC uses the assembler mnemonics defined for
13959 the PowerPC architecture.  With @option{-mold-mnemonics} it uses the
13960 assembler mnemonics defined for the POWER architecture.  Instructions
13961 defined in only one architecture have only one mnemonic; GCC uses that
13962 mnemonic irrespective of which of these options is specified.
13963
13964 GCC defaults to the mnemonics appropriate for the architecture in
13965 use.  Specifying @option{-mcpu=@var{cpu_type}} sometimes overrides the
13966 value of these option.  Unless you are building a cross-compiler, you
13967 should normally not specify either @option{-mnew-mnemonics} or
13968 @option{-mold-mnemonics}, but should instead accept the default.
13969
13970 @item -mcpu=@var{cpu_type}
13971 @opindex mcpu
13972 Set architecture type, register usage, choice of mnemonics, and
13973 instruction scheduling parameters for machine type @var{cpu_type}.
13974 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
13975 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{464}, @samp{464fp},
13976 @samp{505}, @samp{601}, @samp{602}, @samp{603}, @samp{603e}, @samp{604},
13977 @samp{604e}, @samp{620}, @samp{630}, @samp{740}, @samp{7400},
13978 @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
13979 @samp{860}, @samp{970}, @samp{8540}, @samp{e300c2}, @samp{e300c3},
13980 @samp{e500mc}, @samp{ec603e}, @samp{G3}, @samp{G4}, @samp{G5},
13981 @samp{power}, @samp{power2}, @samp{power3}, @samp{power4},
13982 @samp{power5}, @samp{power5+}, @samp{power6}, @samp{power6x}, @samp{power7}
13983 @samp{common}, @samp{powerpc}, @samp{powerpc64}, @samp{rios},
13984 @samp{rios1}, @samp{rios2}, @samp{rsc}, and @samp{rs64}.
13985
13986 @option{-mcpu=common} selects a completely generic processor.  Code
13987 generated under this option will run on any POWER or PowerPC processor.
13988 GCC will use only the instructions in the common subset of both
13989 architectures, and will not use the MQ register.  GCC assumes a generic
13990 processor model for scheduling purposes.
13991
13992 @option{-mcpu=power}, @option{-mcpu=power2}, @option{-mcpu=powerpc}, and
13993 @option{-mcpu=powerpc64} specify generic POWER, POWER2, pure 32-bit
13994 PowerPC (i.e., not MPC601), and 64-bit PowerPC architecture machine
13995 types, with an appropriate, generic processor model assumed for
13996 scheduling purposes.
13997
13998 The other options specify a specific processor.  Code generated under
13999 those options will run best on that processor, and may not run at all on
14000 others.
14001
14002 The @option{-mcpu} options automatically enable or disable the
14003 following options:
14004
14005 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
14006 -mnew-mnemonics  -mpopcntb  -mpower  -mpower2  -mpowerpc64 @gol
14007 -mpowerpc-gpopt  -mpowerpc-gfxopt  -msingle-float -mdouble-float @gol
14008 -msimple-fpu -mstring  -mmulhw  -mdlmzb  -mmfpgpr}
14009
14010 The particular options set for any particular CPU will vary between
14011 compiler versions, depending on what setting seems to produce optimal
14012 code for that CPU; it doesn't necessarily reflect the actual hardware's
14013 capabilities.  If you wish to set an individual option to a particular
14014 value, you may specify it after the @option{-mcpu} option, like
14015 @samp{-mcpu=970 -mno-altivec}.
14016
14017 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
14018 not enabled or disabled by the @option{-mcpu} option at present because
14019 AIX does not have full support for these options.  You may still
14020 enable or disable them individually if you're sure it'll work in your
14021 environment.
14022
14023 @item -mtune=@var{cpu_type}
14024 @opindex mtune
14025 Set the instruction scheduling parameters for machine type
14026 @var{cpu_type}, but do not set the architecture type, register usage, or
14027 choice of mnemonics, as @option{-mcpu=@var{cpu_type}} would.  The same
14028 values for @var{cpu_type} are used for @option{-mtune} as for
14029 @option{-mcpu}.  If both are specified, the code generated will use the
14030 architecture, registers, and mnemonics set by @option{-mcpu}, but the
14031 scheduling parameters set by @option{-mtune}.
14032
14033 @item -mswdiv
14034 @itemx -mno-swdiv
14035 @opindex mswdiv
14036 @opindex mno-swdiv
14037 Generate code to compute division as reciprocal estimate and iterative
14038 refinement, creating opportunities for increased throughput.  This
14039 feature requires: optional PowerPC Graphics instruction set for single
14040 precision and FRE instruction for double precision, assuming divides
14041 cannot generate user-visible traps, and the domain values not include
14042 Infinities, denormals or zero denominator.
14043
14044 @item -maltivec
14045 @itemx -mno-altivec
14046 @opindex maltivec
14047 @opindex mno-altivec
14048 Generate code that uses (does not use) AltiVec instructions, and also
14049 enable the use of built-in functions that allow more direct access to
14050 the AltiVec instruction set.  You may also need to set
14051 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
14052 enhancements.
14053
14054 @item -mvrsave
14055 @itemx -mno-vrsave
14056 @opindex mvrsave
14057 @opindex mno-vrsave
14058 Generate VRSAVE instructions when generating AltiVec code.
14059
14060 @item -mgen-cell-microcode
14061 @opindex mgen-cell-microcode
14062 Generate Cell microcode instructions
14063
14064 @item -mwarn-cell-microcode
14065 @opindex mwarn-cell-microcode
14066 Warning when a Cell microcode instruction is going to emitted.  An example
14067 of a Cell microcode instruction is a variable shift.
14068
14069 @item -msecure-plt
14070 @opindex msecure-plt
14071 Generate code that allows ld and ld.so to build executables and shared
14072 libraries with non-exec .plt and .got sections.  This is a PowerPC
14073 32-bit SYSV ABI option.
14074
14075 @item -mbss-plt
14076 @opindex mbss-plt
14077 Generate code that uses a BSS .plt section that ld.so fills in, and
14078 requires .plt and .got sections that are both writable and executable.
14079 This is a PowerPC 32-bit SYSV ABI option.
14080
14081 @item -misel
14082 @itemx -mno-isel
14083 @opindex misel
14084 @opindex mno-isel
14085 This switch enables or disables the generation of ISEL instructions.
14086
14087 @item -misel=@var{yes/no}
14088 This switch has been deprecated.  Use @option{-misel} and
14089 @option{-mno-isel} instead.
14090
14091 @item -mspe
14092 @itemx -mno-spe
14093 @opindex mspe
14094 @opindex mno-spe
14095 This switch enables or disables the generation of SPE simd
14096 instructions.
14097
14098 @item -mpaired
14099 @itemx -mno-paired
14100 @opindex mpaired
14101 @opindex mno-paired
14102 This switch enables or disables the generation of PAIRED simd
14103 instructions.
14104
14105 @item -mspe=@var{yes/no}
14106 This option has been deprecated.  Use @option{-mspe} and
14107 @option{-mno-spe} instead.
14108
14109 @item -mfloat-gprs=@var{yes/single/double/no}
14110 @itemx -mfloat-gprs
14111 @opindex mfloat-gprs
14112 This switch enables or disables the generation of floating point
14113 operations on the general purpose registers for architectures that
14114 support it.
14115
14116 The argument @var{yes} or @var{single} enables the use of
14117 single-precision floating point operations.
14118
14119 The argument @var{double} enables the use of single and
14120 double-precision floating point operations.
14121
14122 The argument @var{no} disables floating point operations on the
14123 general purpose registers.
14124
14125 This option is currently only available on the MPC854x.
14126
14127 @item -m32
14128 @itemx -m64
14129 @opindex m32
14130 @opindex m64
14131 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
14132 targets (including GNU/Linux).  The 32-bit environment sets int, long
14133 and pointer to 32 bits and generates code that runs on any PowerPC
14134 variant.  The 64-bit environment sets int to 32 bits and long and
14135 pointer to 64 bits, and generates code for PowerPC64, as for
14136 @option{-mpowerpc64}.
14137
14138 @item -mfull-toc
14139 @itemx -mno-fp-in-toc
14140 @itemx -mno-sum-in-toc
14141 @itemx -mminimal-toc
14142 @opindex mfull-toc
14143 @opindex mno-fp-in-toc
14144 @opindex mno-sum-in-toc
14145 @opindex mminimal-toc
14146 Modify generation of the TOC (Table Of Contents), which is created for
14147 every executable file.  The @option{-mfull-toc} option is selected by
14148 default.  In that case, GCC will allocate at least one TOC entry for
14149 each unique non-automatic variable reference in your program.  GCC
14150 will also place floating-point constants in the TOC@.  However, only
14151 16,384 entries are available in the TOC@.
14152
14153 If you receive a linker error message that saying you have overflowed
14154 the available TOC space, you can reduce the amount of TOC space used
14155 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
14156 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
14157 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
14158 generate code to calculate the sum of an address and a constant at
14159 run-time instead of putting that sum into the TOC@.  You may specify one
14160 or both of these options.  Each causes GCC to produce very slightly
14161 slower and larger code at the expense of conserving TOC space.
14162
14163 If you still run out of space in the TOC even when you specify both of
14164 these options, specify @option{-mminimal-toc} instead.  This option causes
14165 GCC to make only one TOC entry for every file.  When you specify this
14166 option, GCC will produce code that is slower and larger but which
14167 uses extremely little TOC space.  You may wish to use this option
14168 only on files that contain less frequently executed code.
14169
14170 @item -maix64
14171 @itemx -maix32
14172 @opindex maix64
14173 @opindex maix32
14174 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
14175 @code{long} type, and the infrastructure needed to support them.
14176 Specifying @option{-maix64} implies @option{-mpowerpc64} and
14177 @option{-mpowerpc}, while @option{-maix32} disables the 64-bit ABI and
14178 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
14179
14180 @item -mxl-compat
14181 @itemx -mno-xl-compat
14182 @opindex mxl-compat
14183 @opindex mno-xl-compat
14184 Produce code that conforms more closely to IBM XL compiler semantics
14185 when using AIX-compatible ABI@.  Pass floating-point arguments to
14186 prototyped functions beyond the register save area (RSA) on the stack
14187 in addition to argument FPRs.  Do not assume that most significant
14188 double in 128-bit long double value is properly rounded when comparing
14189 values and converting to double.  Use XL symbol names for long double
14190 support routines.
14191
14192 The AIX calling convention was extended but not initially documented to
14193 handle an obscure K&R C case of calling a function that takes the
14194 address of its arguments with fewer arguments than declared.  IBM XL
14195 compilers access floating point arguments which do not fit in the
14196 RSA from the stack when a subroutine is compiled without
14197 optimization.  Because always storing floating-point arguments on the
14198 stack is inefficient and rarely needed, this option is not enabled by
14199 default and only is necessary when calling subroutines compiled by IBM
14200 XL compilers without optimization.
14201
14202 @item -mpe
14203 @opindex mpe
14204 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
14205 application written to use message passing with special startup code to
14206 enable the application to run.  The system must have PE installed in the
14207 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
14208 must be overridden with the @option{-specs=} option to specify the
14209 appropriate directory location.  The Parallel Environment does not
14210 support threads, so the @option{-mpe} option and the @option{-pthread}
14211 option are incompatible.
14212
14213 @item -malign-natural
14214 @itemx -malign-power
14215 @opindex malign-natural
14216 @opindex malign-power
14217 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
14218 @option{-malign-natural} overrides the ABI-defined alignment of larger
14219 types, such as floating-point doubles, on their natural size-based boundary.
14220 The option @option{-malign-power} instructs GCC to follow the ABI-specified
14221 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
14222
14223 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
14224 is not supported.
14225
14226 @item -msoft-float
14227 @itemx -mhard-float
14228 @opindex msoft-float
14229 @opindex mhard-float
14230 Generate code that does not use (uses) the floating-point register set.
14231 Software floating point emulation is provided if you use the
14232 @option{-msoft-float} option, and pass the option to GCC when linking.
14233
14234 @item -msingle-float
14235 @itemx -mdouble-float
14236 @opindex msingle-float
14237 @opindex mdouble-float
14238 Generate code for single or double-precision floating point operations. 
14239 @option{-mdouble-float} implies @option{-msingle-float}. 
14240
14241 @item -msimple-fpu
14242 @opindex msimple-fpu
14243 Do not generate sqrt and div instructions for hardware floating point unit.
14244
14245 @item -mfpu
14246 @opindex mfpu
14247 Specify type of floating point unit.  Valid values are @var{sp_lite} 
14248 (equivalent to -msingle-float -msimple-fpu), @var{dp_lite} (equivalent
14249 to -mdouble-float -msimple-fpu), @var{sp_full} (equivalent to -msingle-float),
14250 and @var{dp_full} (equivalent to -mdouble-float).
14251
14252 @item -mxilinx-fpu
14253 @opindex mxilinx-fpu
14254 Perform optimizations for floating point unit on Xilinx PPC 405/440.
14255
14256 @item -mmultiple
14257 @itemx -mno-multiple
14258 @opindex mmultiple
14259 @opindex mno-multiple
14260 Generate code that uses (does not use) the load multiple word
14261 instructions and the store multiple word instructions.  These
14262 instructions are generated by default on POWER systems, and not
14263 generated on PowerPC systems.  Do not use @option{-mmultiple} on little
14264 endian PowerPC systems, since those instructions do not work when the
14265 processor is in little endian mode.  The exceptions are PPC740 and
14266 PPC750 which permit the instructions usage in little endian mode.
14267
14268 @item -mstring
14269 @itemx -mno-string
14270 @opindex mstring
14271 @opindex mno-string
14272 Generate code that uses (does not use) the load string instructions
14273 and the store string word instructions to save multiple registers and
14274 do small block moves.  These instructions are generated by default on
14275 POWER systems, and not generated on PowerPC systems.  Do not use
14276 @option{-mstring} on little endian PowerPC systems, since those
14277 instructions do not work when the processor is in little endian mode.
14278 The exceptions are PPC740 and PPC750 which permit the instructions
14279 usage in little endian mode.
14280
14281 @item -mupdate
14282 @itemx -mno-update
14283 @opindex mupdate
14284 @opindex mno-update
14285 Generate code that uses (does not use) the load or store instructions
14286 that update the base register to the address of the calculated memory
14287 location.  These instructions are generated by default.  If you use
14288 @option{-mno-update}, there is a small window between the time that the
14289 stack pointer is updated and the address of the previous frame is
14290 stored, which means code that walks the stack frame across interrupts or
14291 signals may get corrupted data.
14292
14293 @item -mavoid-indexed-addresses
14294 @item -mno-avoid-indexed-addresses
14295 @opindex mavoid-indexed-addresses
14296 @opindex mno-avoid-indexed-addresses
14297 Generate code that tries to avoid (not avoid) the use of indexed load
14298 or store instructions. These instructions can incur a performance
14299 penalty on Power6 processors in certain situations, such as when
14300 stepping through large arrays that cross a 16M boundary.  This option
14301 is enabled by default when targetting Power6 and disabled otherwise.
14302
14303 @item -mfused-madd
14304 @itemx -mno-fused-madd
14305 @opindex mfused-madd
14306 @opindex mno-fused-madd
14307 Generate code that uses (does not use) the floating point multiply and
14308 accumulate instructions.  These instructions are generated by default if
14309 hardware floating is used.
14310
14311 @item -mmulhw
14312 @itemx -mno-mulhw
14313 @opindex mmulhw
14314 @opindex mno-mulhw
14315 Generate code that uses (does not use) the half-word multiply and
14316 multiply-accumulate instructions on the IBM 405, 440 and 464 processors.
14317 These instructions are generated by default when targetting those
14318 processors.
14319
14320 @item -mdlmzb
14321 @itemx -mno-dlmzb
14322 @opindex mdlmzb
14323 @opindex mno-dlmzb
14324 Generate code that uses (does not use) the string-search @samp{dlmzb}
14325 instruction on the IBM 405, 440 and 464 processors.  This instruction is
14326 generated by default when targetting those processors.
14327
14328 @item -mno-bit-align
14329 @itemx -mbit-align
14330 @opindex mno-bit-align
14331 @opindex mbit-align
14332 On System V.4 and embedded PowerPC systems do not (do) force structures
14333 and unions that contain bit-fields to be aligned to the base type of the
14334 bit-field.
14335
14336 For example, by default a structure containing nothing but 8
14337 @code{unsigned} bit-fields of length 1 would be aligned to a 4 byte
14338 boundary and have a size of 4 bytes.  By using @option{-mno-bit-align},
14339 the structure would be aligned to a 1 byte boundary and be one byte in
14340 size.
14341
14342 @item -mno-strict-align
14343 @itemx -mstrict-align
14344 @opindex mno-strict-align
14345 @opindex mstrict-align
14346 On System V.4 and embedded PowerPC systems do not (do) assume that
14347 unaligned memory references will be handled by the system.
14348
14349 @item -mrelocatable
14350 @itemx -mno-relocatable
14351 @opindex mrelocatable
14352 @opindex mno-relocatable
14353 On embedded PowerPC systems generate code that allows (does not allow)
14354 the program to be relocated to a different address at runtime.  If you
14355 use @option{-mrelocatable} on any module, all objects linked together must
14356 be compiled with @option{-mrelocatable} or @option{-mrelocatable-lib}.
14357
14358 @item -mrelocatable-lib
14359 @itemx -mno-relocatable-lib
14360 @opindex mrelocatable-lib
14361 @opindex mno-relocatable-lib
14362 On embedded PowerPC systems generate code that allows (does not allow)
14363 the program to be relocated to a different address at runtime.  Modules
14364 compiled with @option{-mrelocatable-lib} can be linked with either modules
14365 compiled without @option{-mrelocatable} and @option{-mrelocatable-lib} or
14366 with modules compiled with the @option{-mrelocatable} options.
14367
14368 @item -mno-toc
14369 @itemx -mtoc
14370 @opindex mno-toc
14371 @opindex mtoc
14372 On System V.4 and embedded PowerPC systems do not (do) assume that
14373 register 2 contains a pointer to a global area pointing to the addresses
14374 used in the program.
14375
14376 @item -mlittle
14377 @itemx -mlittle-endian
14378 @opindex mlittle
14379 @opindex mlittle-endian
14380 On System V.4 and embedded PowerPC systems compile code for the
14381 processor in little endian mode.  The @option{-mlittle-endian} option is
14382 the same as @option{-mlittle}.
14383
14384 @item -mbig
14385 @itemx -mbig-endian
14386 @opindex mbig
14387 @opindex mbig-endian
14388 On System V.4 and embedded PowerPC systems compile code for the
14389 processor in big endian mode.  The @option{-mbig-endian} option is
14390 the same as @option{-mbig}.
14391
14392 @item -mdynamic-no-pic
14393 @opindex mdynamic-no-pic
14394 On Darwin and Mac OS X systems, compile code so that it is not
14395 relocatable, but that its external references are relocatable.  The
14396 resulting code is suitable for applications, but not shared
14397 libraries.
14398
14399 @item -mprioritize-restricted-insns=@var{priority}
14400 @opindex mprioritize-restricted-insns
14401 This option controls the priority that is assigned to
14402 dispatch-slot restricted instructions during the second scheduling
14403 pass.  The argument @var{priority} takes the value @var{0/1/2} to assign
14404 @var{no/highest/second-highest} priority to dispatch slot restricted
14405 instructions.
14406
14407 @item -msched-costly-dep=@var{dependence_type}
14408 @opindex msched-costly-dep
14409 This option controls which dependences are considered costly
14410 by the target during instruction scheduling.  The argument
14411 @var{dependence_type} takes one of the following values:
14412 @var{no}: no dependence is costly,
14413 @var{all}: all dependences are costly,
14414 @var{true_store_to_load}: a true dependence from store to load is costly,
14415 @var{store_to_load}: any dependence from store to load is costly,
14416 @var{number}: any dependence which latency >= @var{number} is costly.
14417
14418 @item -minsert-sched-nops=@var{scheme}
14419 @opindex minsert-sched-nops
14420 This option controls which nop insertion scheme will be used during
14421 the second scheduling pass.  The argument @var{scheme} takes one of the
14422 following values:
14423 @var{no}: Don't insert nops.
14424 @var{pad}: Pad with nops any dispatch group which has vacant issue slots,
14425 according to the scheduler's grouping.
14426 @var{regroup_exact}: Insert nops to force costly dependent insns into
14427 separate groups.  Insert exactly as many nops as needed to force an insn
14428 to a new group, according to the estimated processor grouping.
14429 @var{number}: Insert nops to force costly dependent insns into
14430 separate groups.  Insert @var{number} nops to force an insn to a new group.
14431
14432 @item -mcall-sysv
14433 @opindex mcall-sysv
14434 On System V.4 and embedded PowerPC systems compile code using calling
14435 conventions that adheres to the March 1995 draft of the System V
14436 Application Binary Interface, PowerPC processor supplement.  This is the
14437 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
14438
14439 @item -mcall-sysv-eabi
14440 @itemx -mcall-eabi
14441 @opindex mcall-sysv-eabi
14442 @opindex mcall-eabi
14443 Specify both @option{-mcall-sysv} and @option{-meabi} options.
14444
14445 @item -mcall-sysv-noeabi
14446 @opindex mcall-sysv-noeabi
14447 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
14448
14449 @item -mcall-aixdesc
14450 @opindex m
14451 On System V.4 and embedded PowerPC systems compile code for the AIX
14452 operating system.
14453
14454 @item -mcall-linux
14455 @opindex mcall-linux
14456 On System V.4 and embedded PowerPC systems compile code for the
14457 Linux-based GNU system.
14458
14459 @item -mcall-gnu
14460 @opindex mcall-gnu
14461 On System V.4 and embedded PowerPC systems compile code for the
14462 Hurd-based GNU system.
14463
14464 @item -mcall-freebsd
14465 @opindex mcall-freebsd
14466 On System V.4 and embedded PowerPC systems compile code for the
14467 FreeBSD operating system.
14468
14469 @item -mcall-netbsd
14470 @opindex mcall-netbsd
14471 On System V.4 and embedded PowerPC systems compile code for the
14472 NetBSD operating system.
14473
14474 @item -mcall-openbsd
14475 @opindex mcall-netbsd
14476 On System V.4 and embedded PowerPC systems compile code for the
14477 OpenBSD operating system.
14478
14479 @item -maix-struct-return
14480 @opindex maix-struct-return
14481 Return all structures in memory (as specified by the AIX ABI)@.
14482
14483 @item -msvr4-struct-return
14484 @opindex msvr4-struct-return
14485 Return structures smaller than 8 bytes in registers (as specified by the
14486 SVR4 ABI)@.
14487
14488 @item -mabi=@var{abi-type}
14489 @opindex mabi
14490 Extend the current ABI with a particular extension, or remove such extension.
14491 Valid values are @var{altivec}, @var{no-altivec}, @var{spe},
14492 @var{no-spe}, @var{ibmlongdouble}, @var{ieeelongdouble}@.
14493
14494 @item -mabi=spe
14495 @opindex mabi=spe
14496 Extend the current ABI with SPE ABI extensions.  This does not change
14497 the default ABI, instead it adds the SPE ABI extensions to the current
14498 ABI@.
14499
14500 @item -mabi=no-spe
14501 @opindex mabi=no-spe
14502 Disable Booke SPE ABI extensions for the current ABI@.
14503
14504 @item -mabi=ibmlongdouble
14505 @opindex mabi=ibmlongdouble
14506 Change the current ABI to use IBM extended precision long double.
14507 This is a PowerPC 32-bit SYSV ABI option.
14508
14509 @item -mabi=ieeelongdouble
14510 @opindex mabi=ieeelongdouble
14511 Change the current ABI to use IEEE extended precision long double.
14512 This is a PowerPC 32-bit Linux ABI option.
14513
14514 @item -mprototype
14515 @itemx -mno-prototype
14516 @opindex mprototype
14517 @opindex mno-prototype
14518 On System V.4 and embedded PowerPC systems assume that all calls to
14519 variable argument functions are properly prototyped.  Otherwise, the
14520 compiler must insert an instruction before every non prototyped call to
14521 set or clear bit 6 of the condition code register (@var{CR}) to
14522 indicate whether floating point values were passed in the floating point
14523 registers in case the function takes a variable arguments.  With
14524 @option{-mprototype}, only calls to prototyped variable argument functions
14525 will set or clear the bit.
14526
14527 @item -msim
14528 @opindex msim
14529 On embedded PowerPC systems, assume that the startup module is called
14530 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
14531 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}
14532 configurations.
14533
14534 @item -mmvme
14535 @opindex mmvme
14536 On embedded PowerPC systems, assume that the startup module is called
14537 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
14538 @file{libc.a}.
14539
14540 @item -mads
14541 @opindex mads
14542 On embedded PowerPC systems, assume that the startup module is called
14543 @file{crt0.o} and the standard C libraries are @file{libads.a} and
14544 @file{libc.a}.
14545
14546 @item -myellowknife
14547 @opindex myellowknife
14548 On embedded PowerPC systems, assume that the startup module is called
14549 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
14550 @file{libc.a}.
14551
14552 @item -mvxworks
14553 @opindex mvxworks
14554 On System V.4 and embedded PowerPC systems, specify that you are
14555 compiling for a VxWorks system.
14556
14557 @item -memb
14558 @opindex memb
14559 On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
14560 header to indicate that @samp{eabi} extended relocations are used.
14561
14562 @item -meabi
14563 @itemx -mno-eabi
14564 @opindex meabi
14565 @opindex mno-eabi
14566 On System V.4 and embedded PowerPC systems do (do not) adhere to the
14567 Embedded Applications Binary Interface (eabi) which is a set of
14568 modifications to the System V.4 specifications.  Selecting @option{-meabi}
14569 means that the stack is aligned to an 8 byte boundary, a function
14570 @code{__eabi} is called to from @code{main} to set up the eabi
14571 environment, and the @option{-msdata} option can use both @code{r2} and
14572 @code{r13} to point to two separate small data areas.  Selecting
14573 @option{-mno-eabi} means that the stack is aligned to a 16 byte boundary,
14574 do not call an initialization function from @code{main}, and the
14575 @option{-msdata} option will only use @code{r13} to point to a single
14576 small data area.  The @option{-meabi} option is on by default if you
14577 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
14578
14579 @item -msdata=eabi
14580 @opindex msdata=eabi
14581 On System V.4 and embedded PowerPC systems, put small initialized
14582 @code{const} global and static data in the @samp{.sdata2} section, which
14583 is pointed to by register @code{r2}.  Put small initialized
14584 non-@code{const} global and static data in the @samp{.sdata} section,
14585 which is pointed to by register @code{r13}.  Put small uninitialized
14586 global and static data in the @samp{.sbss} section, which is adjacent to
14587 the @samp{.sdata} section.  The @option{-msdata=eabi} option is
14588 incompatible with the @option{-mrelocatable} option.  The
14589 @option{-msdata=eabi} option also sets the @option{-memb} option.
14590
14591 @item -msdata=sysv
14592 @opindex msdata=sysv
14593 On System V.4 and embedded PowerPC systems, put small global and static
14594 data in the @samp{.sdata} section, which is pointed to by register
14595 @code{r13}.  Put small uninitialized global and static data in the
14596 @samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
14597 The @option{-msdata=sysv} option is incompatible with the
14598 @option{-mrelocatable} option.
14599
14600 @item -msdata=default
14601 @itemx -msdata
14602 @opindex msdata=default
14603 @opindex msdata
14604 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
14605 compile code the same as @option{-msdata=eabi}, otherwise compile code the
14606 same as @option{-msdata=sysv}.
14607
14608 @item -msdata=data
14609 @opindex msdata=data
14610 On System V.4 and embedded PowerPC systems, put small global
14611 data in the @samp{.sdata} section.  Put small uninitialized global
14612 data in the @samp{.sbss} section.  Do not use register @code{r13}
14613 to address small data however.  This is the default behavior unless
14614 other @option{-msdata} options are used.
14615
14616 @item -msdata=none
14617 @itemx -mno-sdata
14618 @opindex msdata=none
14619 @opindex mno-sdata
14620 On embedded PowerPC systems, put all initialized global and static data
14621 in the @samp{.data} section, and all uninitialized data in the
14622 @samp{.bss} section.
14623
14624 @item -G @var{num}
14625 @opindex G
14626 @cindex smaller data references (PowerPC)
14627 @cindex .sdata/.sdata2 references (PowerPC)
14628 On embedded PowerPC systems, put global and static items less than or
14629 equal to @var{num} bytes into the small data or bss sections instead of
14630 the normal data or bss section.  By default, @var{num} is 8.  The
14631 @option{-G @var{num}} switch is also passed to the linker.
14632 All modules should be compiled with the same @option{-G @var{num}} value.
14633
14634 @item -mregnames
14635 @itemx -mno-regnames
14636 @opindex mregnames
14637 @opindex mno-regnames
14638 On System V.4 and embedded PowerPC systems do (do not) emit register
14639 names in the assembly language output using symbolic forms.
14640
14641 @item -mlongcall
14642 @itemx -mno-longcall
14643 @opindex mlongcall
14644 @opindex mno-longcall
14645 By default assume that all calls are far away so that a longer more
14646 expensive calling sequence is required.  This is required for calls
14647 further than 32 megabytes (33,554,432 bytes) from the current location.
14648 A short call will be generated if the compiler knows
14649 the call cannot be that far away.  This setting can be overridden by
14650 the @code{shortcall} function attribute, or by @code{#pragma
14651 longcall(0)}.
14652
14653 Some linkers are capable of detecting out-of-range calls and generating
14654 glue code on the fly.  On these systems, long calls are unnecessary and
14655 generate slower code.  As of this writing, the AIX linker can do this,
14656 as can the GNU linker for PowerPC/64.  It is planned to add this feature
14657 to the GNU linker for 32-bit PowerPC systems as well.
14658
14659 On Darwin/PPC systems, @code{#pragma longcall} will generate ``jbsr
14660 callee, L42'', plus a ``branch island'' (glue code).  The two target
14661 addresses represent the callee and the ``branch island''.  The
14662 Darwin/PPC linker will prefer the first address and generate a ``bl
14663 callee'' if the PPC ``bl'' instruction will reach the callee directly;
14664 otherwise, the linker will generate ``bl L42'' to call the ``branch
14665 island''.  The ``branch island'' is appended to the body of the
14666 calling function; it computes the full 32-bit address of the callee
14667 and jumps to it.
14668
14669 On Mach-O (Darwin) systems, this option directs the compiler emit to
14670 the glue for every direct call, and the Darwin linker decides whether
14671 to use or discard it.
14672
14673 In the future, we may cause GCC to ignore all longcall specifications
14674 when the linker is known to generate glue.
14675
14676 @item -mtls-markers
14677 @itemx -mno-tls-markers
14678 @opindex mtls-markers
14679 @opindex mno-tls-markers
14680 Mark (do not mark) calls to @code{__tls_get_addr} with a relocation
14681 specifying the function argument.  The relocation allows ld to
14682 reliably associate function call with argument setup instructions for
14683 TLS optimization, which in turn allows gcc to better schedule the
14684 sequence.
14685
14686 @item -pthread
14687 @opindex pthread
14688 Adds support for multithreading with the @dfn{pthreads} library.
14689 This option sets flags for both the preprocessor and linker.
14690
14691 @end table
14692
14693 @node S/390 and zSeries Options
14694 @subsection S/390 and zSeries Options
14695 @cindex S/390 and zSeries Options
14696
14697 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
14698
14699 @table @gcctabopt
14700 @item -mhard-float
14701 @itemx -msoft-float
14702 @opindex mhard-float
14703 @opindex msoft-float
14704 Use (do not use) the hardware floating-point instructions and registers
14705 for floating-point operations.  When @option{-msoft-float} is specified,
14706 functions in @file{libgcc.a} will be used to perform floating-point
14707 operations.  When @option{-mhard-float} is specified, the compiler
14708 generates IEEE floating-point instructions.  This is the default.
14709
14710 @item -mhard-dfp
14711 @itemx -mno-hard-dfp
14712 @opindex mhard-dfp
14713 @opindex mno-hard-dfp
14714 Use (do not use) the hardware decimal-floating-point instructions for
14715 decimal-floating-point operations.  When @option{-mno-hard-dfp} is
14716 specified, functions in @file{libgcc.a} will be used to perform
14717 decimal-floating-point operations.  When @option{-mhard-dfp} is
14718 specified, the compiler generates decimal-floating-point hardware
14719 instructions.  This is the default for @option{-march=z9-ec} or higher.
14720
14721 @item -mlong-double-64
14722 @itemx -mlong-double-128
14723 @opindex mlong-double-64
14724 @opindex mlong-double-128
14725 These switches control the size of @code{long double} type. A size
14726 of 64bit makes the @code{long double} type equivalent to the @code{double}
14727 type. This is the default.
14728
14729 @item -mbackchain
14730 @itemx -mno-backchain
14731 @opindex mbackchain
14732 @opindex mno-backchain
14733 Store (do not store) the address of the caller's frame as backchain pointer
14734 into the callee's stack frame.
14735 A backchain may be needed to allow debugging using tools that do not understand
14736 DWARF-2 call frame information.
14737 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
14738 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
14739 the backchain is placed into the topmost word of the 96/160 byte register
14740 save area.
14741
14742 In general, code compiled with @option{-mbackchain} is call-compatible with
14743 code compiled with @option{-mmo-backchain}; however, use of the backchain
14744 for debugging purposes usually requires that the whole binary is built with
14745 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
14746 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
14747 to build a linux kernel use @option{-msoft-float}.
14748
14749 The default is to not maintain the backchain.
14750
14751 @item -mpacked-stack
14752 @itemx -mno-packed-stack
14753 @opindex mpacked-stack
14754 @opindex mno-packed-stack
14755 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
14756 specified, the compiler uses the all fields of the 96/160 byte register save
14757 area only for their default purpose; unused fields still take up stack space.
14758 When @option{-mpacked-stack} is specified, register save slots are densely
14759 packed at the top of the register save area; unused space is reused for other
14760 purposes, allowing for more efficient use of the available stack space.
14761 However, when @option{-mbackchain} is also in effect, the topmost word of
14762 the save area is always used to store the backchain, and the return address
14763 register is always saved two words below the backchain.
14764
14765 As long as the stack frame backchain is not used, code generated with
14766 @option{-mpacked-stack} is call-compatible with code generated with
14767 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
14768 S/390 or zSeries generated code that uses the stack frame backchain at run
14769 time, not just for debugging purposes.  Such code is not call-compatible
14770 with code compiled with @option{-mpacked-stack}.  Also, note that the
14771 combination of @option{-mbackchain},
14772 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
14773 to build a linux kernel use @option{-msoft-float}.
14774
14775 The default is to not use the packed stack layout.
14776
14777 @item -msmall-exec
14778 @itemx -mno-small-exec
14779 @opindex msmall-exec
14780 @opindex mno-small-exec
14781 Generate (or do not generate) code using the @code{bras} instruction
14782 to do subroutine calls.
14783 This only works reliably if the total executable size does not
14784 exceed 64k.  The default is to use the @code{basr} instruction instead,
14785 which does not have this limitation.
14786
14787 @item -m64
14788 @itemx -m31
14789 @opindex m64
14790 @opindex m31
14791 When @option{-m31} is specified, generate code compliant to the
14792 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
14793 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
14794 particular to generate 64-bit instructions.  For the @samp{s390}
14795 targets, the default is @option{-m31}, while the @samp{s390x}
14796 targets default to @option{-m64}.
14797
14798 @item -mzarch
14799 @itemx -mesa
14800 @opindex mzarch
14801 @opindex mesa
14802 When @option{-mzarch} is specified, generate code using the
14803 instructions available on z/Architecture.
14804 When @option{-mesa} is specified, generate code using the
14805 instructions available on ESA/390.  Note that @option{-mesa} is
14806 not possible with @option{-m64}.
14807 When generating code compliant to the GNU/Linux for S/390 ABI,
14808 the default is @option{-mesa}.  When generating code compliant
14809 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
14810
14811 @item -mmvcle
14812 @itemx -mno-mvcle
14813 @opindex mmvcle
14814 @opindex mno-mvcle
14815 Generate (or do not generate) code using the @code{mvcle} instruction
14816 to perform block moves.  When @option{-mno-mvcle} is specified,
14817 use a @code{mvc} loop instead.  This is the default unless optimizing for
14818 size.
14819
14820 @item -mdebug
14821 @itemx -mno-debug
14822 @opindex mdebug
14823 @opindex mno-debug
14824 Print (or do not print) additional debug information when compiling.
14825 The default is to not print debug information.
14826
14827 @item -march=@var{cpu-type}
14828 @opindex march
14829 Generate code that will run on @var{cpu-type}, which is the name of a system
14830 representing a certain processor type.  Possible values for
14831 @var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, @samp{z990},
14832 @samp{z9-109}, @samp{z9-ec} and @samp{z10}.
14833 When generating code using the instructions available on z/Architecture,
14834 the default is @option{-march=z900}.  Otherwise, the default is
14835 @option{-march=g5}.
14836
14837 @item -mtune=@var{cpu-type}
14838 @opindex mtune
14839 Tune to @var{cpu-type} everything applicable about the generated code,
14840 except for the ABI and the set of available instructions.
14841 The list of @var{cpu-type} values is the same as for @option{-march}.
14842 The default is the value used for @option{-march}.
14843
14844 @item -mtpf-trace
14845 @itemx -mno-tpf-trace
14846 @opindex mtpf-trace
14847 @opindex mno-tpf-trace
14848 Generate code that adds (does not add) in TPF OS specific branches to trace
14849 routines in the operating system.  This option is off by default, even
14850 when compiling for the TPF OS@.
14851
14852 @item -mfused-madd
14853 @itemx -mno-fused-madd
14854 @opindex mfused-madd
14855 @opindex mno-fused-madd
14856 Generate code that uses (does not use) the floating point multiply and
14857 accumulate instructions.  These instructions are generated by default if
14858 hardware floating point is used.
14859
14860 @item -mwarn-framesize=@var{framesize}
14861 @opindex mwarn-framesize
14862 Emit a warning if the current function exceeds the given frame size.  Because
14863 this is a compile time check it doesn't need to be a real problem when the program
14864 runs.  It is intended to identify functions which most probably cause
14865 a stack overflow.  It is useful to be used in an environment with limited stack
14866 size e.g.@: the linux kernel.
14867
14868 @item -mwarn-dynamicstack
14869 @opindex mwarn-dynamicstack
14870 Emit a warning if the function calls alloca or uses dynamically
14871 sized arrays.  This is generally a bad idea with a limited stack size.
14872
14873 @item -mstack-guard=@var{stack-guard}
14874 @itemx -mstack-size=@var{stack-size}
14875 @opindex mstack-guard
14876 @opindex mstack-size
14877 If these options are provided the s390 back end emits additional instructions in
14878 the function prologue which trigger a trap if the stack size is @var{stack-guard}
14879 bytes above the @var{stack-size} (remember that the stack on s390 grows downward).
14880 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
14881 the frame size of the compiled function is chosen.
14882 These options are intended to be used to help debugging stack overflow problems.
14883 The additionally emitted code causes only little overhead and hence can also be
14884 used in production like systems without greater performance degradation.  The given
14885 values have to be exact powers of 2 and @var{stack-size} has to be greater than
14886 @var{stack-guard} without exceeding 64k.
14887 In order to be efficient the extra code makes the assumption that the stack starts
14888 at an address aligned to the value given by @var{stack-size}.
14889 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
14890 @end table
14891
14892 @node Score Options
14893 @subsection Score Options
14894 @cindex Score Options
14895
14896 These options are defined for Score implementations:
14897
14898 @table @gcctabopt
14899 @item -meb
14900 @opindex meb
14901 Compile code for big endian mode.  This is the default.
14902
14903 @item -mel
14904 @opindex mel
14905 Compile code for little endian mode. 
14906
14907 @item -mnhwloop
14908 @opindex mnhwloop
14909 Disable generate bcnz instruction.
14910
14911 @item -muls
14912 @opindex muls
14913 Enable generate unaligned load and store instruction.
14914
14915 @item -mmac
14916 @opindex mmac
14917 Enable the use of multiply-accumulate instructions. Disabled by default. 
14918
14919 @item -mscore5
14920 @opindex mscore5
14921 Specify the SCORE5 as the target architecture.
14922
14923 @item -mscore5u
14924 @opindex mscore5u
14925 Specify the SCORE5U of the target architecture.
14926
14927 @item -mscore7
14928 @opindex mscore7
14929 Specify the SCORE7 as the target architecture. This is the default.
14930
14931 @item -mscore7d
14932 @opindex mscore7d
14933 Specify the SCORE7D as the target architecture.
14934 @end table
14935
14936 @node SH Options
14937 @subsection SH Options
14938
14939 These @samp{-m} options are defined for the SH implementations:
14940
14941 @table @gcctabopt
14942 @item -m1
14943 @opindex m1
14944 Generate code for the SH1.
14945
14946 @item -m2
14947 @opindex m2
14948 Generate code for the SH2.
14949
14950 @item -m2e
14951 Generate code for the SH2e.
14952
14953 @item -m2a-nofpu
14954 @opindex m2a-nofpu
14955 Generate code for the SH2a without FPU, or for a SH2a-FPU in such a way
14956 that the floating-point unit is not used.
14957
14958 @item -m2a-single-only
14959 @opindex m2a-single-only
14960 Generate code for the SH2a-FPU, in such a way that no double-precision
14961 floating point operations are used.
14962
14963 @item -m2a-single
14964 @opindex m2a-single
14965 Generate code for the SH2a-FPU assuming the floating-point unit is in
14966 single-precision mode by default.
14967
14968 @item -m2a
14969 @opindex m2a
14970 Generate code for the SH2a-FPU assuming the floating-point unit is in
14971 double-precision mode by default.
14972
14973 @item -m3
14974 @opindex m3
14975 Generate code for the SH3.
14976
14977 @item -m3e
14978 @opindex m3e
14979 Generate code for the SH3e.
14980
14981 @item -m4-nofpu
14982 @opindex m4-nofpu
14983 Generate code for the SH4 without a floating-point unit.
14984
14985 @item -m4-single-only
14986 @opindex m4-single-only
14987 Generate code for the SH4 with a floating-point unit that only
14988 supports single-precision arithmetic.
14989
14990 @item -m4-single
14991 @opindex m4-single
14992 Generate code for the SH4 assuming the floating-point unit is in
14993 single-precision mode by default.
14994
14995 @item -m4
14996 @opindex m4
14997 Generate code for the SH4.
14998
14999 @item -m4a-nofpu
15000 @opindex m4a-nofpu
15001 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
15002 floating-point unit is not used.
15003
15004 @item -m4a-single-only
15005 @opindex m4a-single-only
15006 Generate code for the SH4a, in such a way that no double-precision
15007 floating point operations are used.
15008
15009 @item -m4a-single
15010 @opindex m4a-single
15011 Generate code for the SH4a assuming the floating-point unit is in
15012 single-precision mode by default.
15013
15014 @item -m4a
15015 @opindex m4a
15016 Generate code for the SH4a.
15017
15018 @item -m4al
15019 @opindex m4al
15020 Same as @option{-m4a-nofpu}, except that it implicitly passes
15021 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
15022 instructions at the moment.
15023
15024 @item -mb
15025 @opindex mb
15026 Compile code for the processor in big endian mode.
15027
15028 @item -ml
15029 @opindex ml
15030 Compile code for the processor in little endian mode.
15031
15032 @item -mdalign
15033 @opindex mdalign
15034 Align doubles at 64-bit boundaries.  Note that this changes the calling
15035 conventions, and thus some functions from the standard C library will
15036 not work unless you recompile it first with @option{-mdalign}.
15037
15038 @item -mrelax
15039 @opindex mrelax
15040 Shorten some address references at link time, when possible; uses the
15041 linker option @option{-relax}.
15042
15043 @item -mbigtable
15044 @opindex mbigtable
15045 Use 32-bit offsets in @code{switch} tables.  The default is to use
15046 16-bit offsets.
15047
15048 @item -mbitops
15049 @opindex mbitops
15050 Enable the use of bit manipulation instructions on SH2A.
15051
15052 @item -mfmovd
15053 @opindex mfmovd
15054 Enable the use of the instruction @code{fmovd}.
15055
15056 @item -mhitachi
15057 @opindex mhitachi
15058 Comply with the calling conventions defined by Renesas.
15059
15060 @item -mrenesas
15061 @opindex mhitachi
15062 Comply with the calling conventions defined by Renesas.
15063
15064 @item -mno-renesas
15065 @opindex mhitachi
15066 Comply with the calling conventions defined for GCC before the Renesas
15067 conventions were available.  This option is the default for all
15068 targets of the SH toolchain except for @samp{sh-symbianelf}.
15069
15070 @item -mnomacsave
15071 @opindex mnomacsave
15072 Mark the @code{MAC} register as call-clobbered, even if
15073 @option{-mhitachi} is given.
15074
15075 @item -mieee
15076 @opindex mieee
15077 Increase IEEE-compliance of floating-point code.
15078 At the moment, this is equivalent to @option{-fno-finite-math-only}.
15079 When generating 16 bit SH opcodes, getting IEEE-conforming results for
15080 comparisons of NANs / infinities incurs extra overhead in every
15081 floating point comparison, therefore the default is set to
15082 @option{-ffinite-math-only}.
15083
15084 @item -minline-ic_invalidate
15085 @opindex minline-ic_invalidate
15086 Inline code to invalidate instruction cache entries after setting up
15087 nested function trampolines.
15088 This option has no effect if -musermode is in effect and the selected
15089 code generation option (e.g. -m4) does not allow the use of the icbi
15090 instruction.
15091 If the selected code generation option does not allow the use of the icbi
15092 instruction, and -musermode is not in effect, the inlined code will
15093 manipulate the instruction cache address array directly with an associative
15094 write.  This not only requires privileged mode, but it will also
15095 fail if the cache line had been mapped via the TLB and has become unmapped.
15096
15097 @item -misize
15098 @opindex misize
15099 Dump instruction size and location in the assembly code.
15100
15101 @item -mpadstruct
15102 @opindex mpadstruct
15103 This option is deprecated.  It pads structures to multiple of 4 bytes,
15104 which is incompatible with the SH ABI@.
15105
15106 @item -mspace
15107 @opindex mspace
15108 Optimize for space instead of speed.  Implied by @option{-Os}.
15109
15110 @item -mprefergot
15111 @opindex mprefergot
15112 When generating position-independent code, emit function calls using
15113 the Global Offset Table instead of the Procedure Linkage Table.
15114
15115 @item -musermode
15116 @opindex musermode
15117 Don't generate privileged mode only code; implies -mno-inline-ic_invalidate
15118 if the inlined code would not work in user mode.
15119 This is the default when the target is @code{sh-*-linux*}.
15120
15121 @item -multcost=@var{number}
15122 @opindex multcost=@var{number}
15123 Set the cost to assume for a multiply insn.
15124
15125 @item -mdiv=@var{strategy}
15126 @opindex mdiv=@var{strategy}
15127 Set the division strategy to use for SHmedia code.  @var{strategy} must be
15128 one of: call, call2, fp, inv, inv:minlat, inv20u, inv20l, inv:call,
15129 inv:call2, inv:fp .
15130 "fp" performs the operation in floating point.  This has a very high latency,
15131 but needs only a few instructions, so it might be a good choice if
15132 your code has enough easily exploitable ILP to allow the compiler to
15133 schedule the floating point instructions together with other instructions.
15134 Division by zero causes a floating point exception.
15135 "inv" uses integer operations to calculate the inverse of the divisor,
15136 and then multiplies the dividend with the inverse.  This strategy allows
15137 cse and hoisting of the inverse calculation.  Division by zero calculates
15138 an unspecified result, but does not trap.
15139 "inv:minlat" is a variant of "inv" where if no cse / hoisting opportunities
15140 have been found, or if the entire operation has been hoisted to the same
15141 place, the last stages of the inverse calculation are intertwined with the
15142 final multiply to reduce the overall latency, at the expense of using a few
15143 more instructions, and thus offering fewer scheduling opportunities with
15144 other code.
15145 "call" calls a library function that usually implements the inv:minlat
15146 strategy.
15147 This gives high code density for m5-*media-nofpu compilations.
15148 "call2" uses a different entry point of the same library function, where it
15149 assumes that a pointer to a lookup table has already been set up, which
15150 exposes the pointer load to cse / code hoisting optimizations.
15151 "inv:call", "inv:call2" and "inv:fp" all use the "inv" algorithm for initial
15152 code generation, but if the code stays unoptimized, revert to the "call",
15153 "call2", or "fp" strategies, respectively.  Note that the
15154 potentially-trapping side effect of division by zero is carried by a
15155 separate instruction, so it is possible that all the integer instructions
15156 are hoisted out, but the marker for the side effect stays where it is.
15157 A recombination to fp operations or a call is not possible in that case.
15158 "inv20u" and "inv20l" are variants of the "inv:minlat" strategy.  In the case
15159 that the inverse calculation was nor separated from the multiply, they speed
15160 up division where the dividend fits into 20 bits (plus sign where applicable),
15161 by inserting a test to skip a number of operations in this case; this test
15162 slows down the case of larger dividends.  inv20u assumes the case of a such
15163 a small dividend to be unlikely, and inv20l assumes it to be likely.
15164
15165 @item -mdivsi3_libfunc=@var{name}
15166 @opindex mdivsi3_libfunc=@var{name}
15167 Set the name of the library function used for 32 bit signed division to
15168 @var{name}.  This only affect the name used in the call and inv:call
15169 division strategies, and the compiler will still expect the same
15170 sets of input/output/clobbered registers as if this option was not present.
15171
15172 @item -mfixed-range=@var{register-range}
15173 @opindex mfixed-range
15174 Generate code treating the given register range as fixed registers.
15175 A fixed register is one that the register allocator can not use.  This is
15176 useful when compiling kernel code.  A register range is specified as
15177 two registers separated by a dash.  Multiple register ranges can be
15178 specified separated by a comma.
15179
15180 @item -madjust-unroll
15181 @opindex madjust-unroll
15182 Throttle unrolling to avoid thrashing target registers.
15183 This option only has an effect if the gcc code base supports the
15184 TARGET_ADJUST_UNROLL_MAX target hook.
15185
15186 @item -mindexed-addressing
15187 @opindex mindexed-addressing
15188 Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
15189 This is only safe if the hardware and/or OS implement 32 bit wrap-around
15190 semantics for the indexed addressing mode.  The architecture allows the
15191 implementation of processors with 64 bit MMU, which the OS could use to
15192 get 32 bit addressing, but since no current hardware implementation supports
15193 this or any other way to make the indexed addressing mode safe to use in
15194 the 32 bit ABI, the default is -mno-indexed-addressing.
15195
15196 @item -mgettrcost=@var{number}
15197 @opindex mgettrcost=@var{number}
15198 Set the cost assumed for the gettr instruction to @var{number}.
15199 The default is 2 if @option{-mpt-fixed} is in effect, 100 otherwise.
15200
15201 @item -mpt-fixed
15202 @opindex mpt-fixed
15203 Assume pt* instructions won't trap.  This will generally generate better
15204 scheduled code, but is unsafe on current hardware.  The current architecture
15205 definition says that ptabs and ptrel trap when the target anded with 3 is 3.
15206 This has the unintentional effect of making it unsafe to schedule ptabs /
15207 ptrel before a branch, or hoist it out of a loop.  For example,
15208 __do_global_ctors, a part of libgcc that runs constructors at program
15209 startup, calls functions in a list which is delimited by @minus{}1.  With the
15210 -mpt-fixed option, the ptabs will be done before testing against @minus{}1.
15211 That means that all the constructors will be run a bit quicker, but when
15212 the loop comes to the end of the list, the program crashes because ptabs
15213 loads @minus{}1 into a target register.  Since this option is unsafe for any
15214 hardware implementing the current architecture specification, the default
15215 is -mno-pt-fixed.  Unless the user specifies a specific cost with
15216 @option{-mgettrcost}, -mno-pt-fixed also implies @option{-mgettrcost=100};
15217 this deters register allocation using target registers for storing
15218 ordinary integers.
15219
15220 @item -minvalid-symbols
15221 @opindex minvalid-symbols
15222 Assume symbols might be invalid.  Ordinary function symbols generated by
15223 the compiler will always be valid to load with movi/shori/ptabs or
15224 movi/shori/ptrel, but with assembler and/or linker tricks it is possible
15225 to generate symbols that will cause ptabs / ptrel to trap.
15226 This option is only meaningful when @option{-mno-pt-fixed} is in effect.
15227 It will then prevent cross-basic-block cse, hoisting and most scheduling
15228 of symbol loads.  The default is @option{-mno-invalid-symbols}.
15229 @end table
15230
15231 @node SPARC Options
15232 @subsection SPARC Options
15233 @cindex SPARC options
15234
15235 These @samp{-m} options are supported on the SPARC:
15236
15237 @table @gcctabopt
15238 @item -mno-app-regs
15239 @itemx -mapp-regs
15240 @opindex mno-app-regs
15241 @opindex mapp-regs
15242 Specify @option{-mapp-regs} to generate output using the global registers
15243 2 through 4, which the SPARC SVR4 ABI reserves for applications.  This
15244 is the default.
15245
15246 To be fully SVR4 ABI compliant at the cost of some performance loss,
15247 specify @option{-mno-app-regs}.  You should compile libraries and system
15248 software with this option.
15249
15250 @item -mfpu
15251 @itemx -mhard-float
15252 @opindex mfpu
15253 @opindex mhard-float
15254 Generate output containing floating point instructions.  This is the
15255 default.
15256
15257 @item -mno-fpu
15258 @itemx -msoft-float
15259 @opindex mno-fpu
15260 @opindex msoft-float
15261 Generate output containing library calls for floating point.
15262 @strong{Warning:} the requisite libraries are not available for all SPARC
15263 targets.  Normally the facilities of the machine's usual C compiler are
15264 used, but this cannot be done directly in cross-compilation.  You must make
15265 your own arrangements to provide suitable library functions for
15266 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
15267 @samp{sparclite-*-*} do provide software floating point support.
15268
15269 @option{-msoft-float} changes the calling convention in the output file;
15270 therefore, it is only useful if you compile @emph{all} of a program with
15271 this option.  In particular, you need to compile @file{libgcc.a}, the
15272 library that comes with GCC, with @option{-msoft-float} in order for
15273 this to work.
15274
15275 @item -mhard-quad-float
15276 @opindex mhard-quad-float
15277 Generate output containing quad-word (long double) floating point
15278 instructions.
15279
15280 @item -msoft-quad-float
15281 @opindex msoft-quad-float
15282 Generate output containing library calls for quad-word (long double)
15283 floating point instructions.  The functions called are those specified
15284 in the SPARC ABI@.  This is the default.
15285
15286 As of this writing, there are no SPARC implementations that have hardware
15287 support for the quad-word floating point instructions.  They all invoke
15288 a trap handler for one of these instructions, and then the trap handler
15289 emulates the effect of the instruction.  Because of the trap handler overhead,
15290 this is much slower than calling the ABI library routines.  Thus the
15291 @option{-msoft-quad-float} option is the default.
15292
15293 @item -mno-unaligned-doubles
15294 @itemx -munaligned-doubles
15295 @opindex mno-unaligned-doubles
15296 @opindex munaligned-doubles
15297 Assume that doubles have 8 byte alignment.  This is the default.
15298
15299 With @option{-munaligned-doubles}, GCC assumes that doubles have 8 byte
15300 alignment only if they are contained in another type, or if they have an
15301 absolute address.  Otherwise, it assumes they have 4 byte alignment.
15302 Specifying this option avoids some rare compatibility problems with code
15303 generated by other compilers.  It is not the default because it results
15304 in a performance loss, especially for floating point code.
15305
15306 @item -mno-faster-structs
15307 @itemx -mfaster-structs
15308 @opindex mno-faster-structs
15309 @opindex mfaster-structs
15310 With @option{-mfaster-structs}, the compiler assumes that structures
15311 should have 8 byte alignment.  This enables the use of pairs of
15312 @code{ldd} and @code{std} instructions for copies in structure
15313 assignment, in place of twice as many @code{ld} and @code{st} pairs.
15314 However, the use of this changed alignment directly violates the SPARC
15315 ABI@.  Thus, it's intended only for use on targets where the developer
15316 acknowledges that their resulting code will not be directly in line with
15317 the rules of the ABI@.
15318
15319 @item -mimpure-text
15320 @opindex mimpure-text
15321 @option{-mimpure-text}, used in addition to @option{-shared}, tells
15322 the compiler to not pass @option{-z text} to the linker when linking a
15323 shared object.  Using this option, you can link position-dependent
15324 code into a shared object.
15325
15326 @option{-mimpure-text} suppresses the ``relocations remain against
15327 allocatable but non-writable sections'' linker error message.
15328 However, the necessary relocations will trigger copy-on-write, and the
15329 shared object is not actually shared across processes.  Instead of
15330 using @option{-mimpure-text}, you should compile all source code with
15331 @option{-fpic} or @option{-fPIC}.
15332
15333 This option is only available on SunOS and Solaris.
15334
15335 @item -mcpu=@var{cpu_type}
15336 @opindex mcpu
15337 Set the instruction set, register set, and instruction scheduling parameters
15338 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
15339 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{sparclite},
15340 @samp{f930}, @samp{f934}, @samp{hypersparc}, @samp{sparclite86x},
15341 @samp{sparclet}, @samp{tsc701}, @samp{v9}, @samp{ultrasparc},
15342 @samp{ultrasparc3}, @samp{niagara} and @samp{niagara2}.
15343
15344 Default instruction scheduling parameters are used for values that select
15345 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
15346 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
15347
15348 Here is a list of each supported architecture and their supported
15349 implementations.
15350
15351 @smallexample
15352     v7:             cypress
15353     v8:             supersparc, hypersparc
15354     sparclite:      f930, f934, sparclite86x
15355     sparclet:       tsc701
15356     v9:             ultrasparc, ultrasparc3, niagara, niagara2
15357 @end smallexample
15358
15359 By default (unless configured otherwise), GCC generates code for the V7
15360 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
15361 additionally optimizes it for the Cypress CY7C602 chip, as used in the
15362 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
15363 SPARCStation 1, 2, IPX etc.
15364
15365 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
15366 architecture.  The only difference from V7 code is that the compiler emits
15367 the integer multiply and integer divide instructions which exist in SPARC-V8
15368 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
15369 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
15370 2000 series.
15371
15372 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
15373 the SPARC architecture.  This adds the integer multiply, integer divide step
15374 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
15375 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
15376 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
15377 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
15378 MB86934 chip, which is the more recent SPARClite with FPU@.
15379
15380 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
15381 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
15382 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
15383 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
15384 optimizes it for the TEMIC SPARClet chip.
15385
15386 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
15387 architecture.  This adds 64-bit integer and floating-point move instructions,
15388 3 additional floating-point condition code registers and conditional move
15389 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
15390 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
15391 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
15392 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
15393 @option{-mcpu=niagara}, the compiler additionally optimizes it for
15394 Sun UltraSPARC T1 chips.  With @option{-mcpu=niagara2}, the compiler
15395 additionally optimizes it for Sun UltraSPARC T2 chips.
15396
15397 @item -mtune=@var{cpu_type}
15398 @opindex mtune
15399 Set the instruction scheduling parameters for machine type
15400 @var{cpu_type}, but do not set the instruction set or register set that the
15401 option @option{-mcpu=@var{cpu_type}} would.
15402
15403 The same values for @option{-mcpu=@var{cpu_type}} can be used for
15404 @option{-mtune=@var{cpu_type}}, but the only useful values are those
15405 that select a particular cpu implementation.  Those are @samp{cypress},
15406 @samp{supersparc}, @samp{hypersparc}, @samp{f930}, @samp{f934},
15407 @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc},
15408 @samp{ultrasparc3}, @samp{niagara}, and @samp{niagara2}.
15409
15410 @item -mv8plus
15411 @itemx -mno-v8plus
15412 @opindex mv8plus
15413 @opindex mno-v8plus
15414 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
15415 difference from the V8 ABI is that the global and out registers are
15416 considered 64-bit wide.  This is enabled by default on Solaris in 32-bit
15417 mode for all SPARC-V9 processors.
15418
15419 @item -mvis
15420 @itemx -mno-vis
15421 @opindex mvis
15422 @opindex mno-vis
15423 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
15424 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
15425 @end table
15426
15427 These @samp{-m} options are supported in addition to the above
15428 on SPARC-V9 processors in 64-bit environments:
15429
15430 @table @gcctabopt
15431 @item -mlittle-endian
15432 @opindex mlittle-endian
15433 Generate code for a processor running in little-endian mode.  It is only
15434 available for a few configurations and most notably not on Solaris and Linux.
15435
15436 @item -m32
15437 @itemx -m64
15438 @opindex m32
15439 @opindex m64
15440 Generate code for a 32-bit or 64-bit environment.
15441 The 32-bit environment sets int, long and pointer to 32 bits.
15442 The 64-bit environment sets int to 32 bits and long and pointer
15443 to 64 bits.
15444
15445 @item -mcmodel=medlow
15446 @opindex mcmodel=medlow
15447 Generate code for the Medium/Low code model: 64-bit addresses, programs
15448 must be linked in the low 32 bits of memory.  Programs can be statically
15449 or dynamically linked.
15450
15451 @item -mcmodel=medmid
15452 @opindex mcmodel=medmid
15453 Generate code for the Medium/Middle code model: 64-bit addresses, programs
15454 must be linked in the low 44 bits of memory, the text and data segments must
15455 be less than 2GB in size and the data segment must be located within 2GB of
15456 the text segment.
15457
15458 @item -mcmodel=medany
15459 @opindex mcmodel=medany
15460 Generate code for the Medium/Anywhere code model: 64-bit addresses, programs
15461 may be linked anywhere in memory, the text and data segments must be less
15462 than 2GB in size and the data segment must be located within 2GB of the
15463 text segment.
15464
15465 @item -mcmodel=embmedany
15466 @opindex mcmodel=embmedany
15467 Generate code for the Medium/Anywhere code model for embedded systems:
15468 64-bit addresses, the text and data segments must be less than 2GB in
15469 size, both starting anywhere in memory (determined at link time).  The
15470 global register %g4 points to the base of the data segment.  Programs
15471 are statically linked and PIC is not supported.
15472
15473 @item -mstack-bias
15474 @itemx -mno-stack-bias
15475 @opindex mstack-bias
15476 @opindex mno-stack-bias
15477 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
15478 frame pointer if present, are offset by @minus{}2047 which must be added back
15479 when making stack frame references.  This is the default in 64-bit mode.
15480 Otherwise, assume no such offset is present.
15481 @end table
15482
15483 These switches are supported in addition to the above on Solaris:
15484
15485 @table @gcctabopt
15486 @item -threads
15487 @opindex threads
15488 Add support for multithreading using the Solaris threads library.  This
15489 option sets flags for both the preprocessor and linker.  This option does
15490 not affect the thread safety of object code produced by the compiler or
15491 that of libraries supplied with it.
15492
15493 @item -pthreads
15494 @opindex pthreads
15495 Add support for multithreading using the POSIX threads library.  This
15496 option sets flags for both the preprocessor and linker.  This option does
15497 not affect the thread safety of object code produced  by the compiler or
15498 that of libraries supplied with it.
15499
15500 @item -pthread
15501 @opindex pthread
15502 This is a synonym for @option{-pthreads}.
15503 @end table
15504
15505 @node SPU Options
15506 @subsection SPU Options
15507 @cindex SPU options
15508
15509 These @samp{-m} options are supported on the SPU:
15510
15511 @table @gcctabopt
15512 @item -mwarn-reloc
15513 @itemx -merror-reloc
15514 @opindex mwarn-reloc
15515 @opindex merror-reloc
15516
15517 The loader for SPU does not handle dynamic relocations.  By default, GCC
15518 will give an error when it generates code that requires a dynamic
15519 relocation.  @option{-mno-error-reloc} disables the error,
15520 @option{-mwarn-reloc} will generate a warning instead.
15521
15522 @item -msafe-dma
15523 @itemx -munsafe-dma
15524 @opindex msafe-dma
15525 @opindex munsafe-dma
15526
15527 Instructions which initiate or test completion of DMA must not be
15528 reordered with respect to loads and stores of the memory which is being
15529 accessed.  Users typically address this problem using the volatile
15530 keyword, but that can lead to inefficient code in places where the
15531 memory is known to not change.  Rather than mark the memory as volatile
15532 we treat the DMA instructions as potentially effecting all memory.  With
15533 @option{-munsafe-dma} users must use the volatile keyword to protect
15534 memory accesses.
15535
15536 @item -mbranch-hints
15537 @opindex mbranch-hints
15538
15539 By default, GCC will generate a branch hint instruction to avoid
15540 pipeline stalls for always taken or probably taken branches.  A hint
15541 will not be generated closer than 8 instructions away from its branch.
15542 There is little reason to disable them, except for debugging purposes,
15543 or to make an object a little bit smaller.
15544
15545 @item -msmall-mem
15546 @itemx -mlarge-mem
15547 @opindex msmall-mem
15548 @opindex mlarge-mem
15549
15550 By default, GCC generates code assuming that addresses are never larger
15551 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
15552 a full 32 bit address.
15553
15554 @item -mstdmain
15555 @opindex mstdmain
15556
15557 By default, GCC links against startup code that assumes the SPU-style
15558 main function interface (which has an unconventional parameter list).
15559 With @option{-mstdmain}, GCC will link your program against startup
15560 code that assumes a C99-style interface to @code{main}, including a
15561 local copy of @code{argv} strings.
15562
15563 @item -mfixed-range=@var{register-range}
15564 @opindex mfixed-range
15565 Generate code treating the given register range as fixed registers.
15566 A fixed register is one that the register allocator can not use.  This is
15567 useful when compiling kernel code.  A register range is specified as
15568 two registers separated by a dash.  Multiple register ranges can be
15569 specified separated by a comma.
15570
15571 @item -mdual-nops
15572 @itemx -mdual-nops=@var{n}
15573 @opindex mdual-nops
15574 By default, GCC will insert nops to increase dual issue when it expects
15575 it to increase performance.  @var{n} can be a value from 0 to 10.  A
15576 smaller @var{n} will insert fewer nops.  10 is the default, 0 is the
15577 same as @option{-mno-dual-nops}.  Disabled with @option{-Os}.
15578
15579 @item -mhint-max-nops=@var{n}
15580 @opindex mhint-max-nops
15581 Maximum number of nops to insert for a branch hint.  A branch hint must
15582 be at least 8 instructions away from the branch it is effecting.  GCC
15583 will insert up to @var{n} nops to enforce this, otherwise it will not
15584 generate the branch hint.
15585
15586 @item -mhint-max-distance=@var{n}
15587 @opindex mhint-max-distance
15588 The encoding of the branch hint instruction limits the hint to be within
15589 256 instructions of the branch it is effecting.  By default, GCC makes
15590 sure it is within 125. 
15591
15592 @item -msafe-hints
15593 @opindex msafe-hints
15594 Work around a hardware bug which causes the SPU to stall indefinitely.
15595 By default, GCC will insert the @code{hbrp} instruction to make sure
15596 this stall won't happen.
15597
15598 @end table
15599
15600 @node System V Options
15601 @subsection Options for System V
15602
15603 These additional options are available on System V Release 4 for
15604 compatibility with other compilers on those systems:
15605
15606 @table @gcctabopt
15607 @item -G
15608 @opindex G
15609 Create a shared object.
15610 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
15611
15612 @item -Qy
15613 @opindex Qy
15614 Identify the versions of each tool used by the compiler, in a
15615 @code{.ident} assembler directive in the output.
15616
15617 @item -Qn
15618 @opindex Qn
15619 Refrain from adding @code{.ident} directives to the output file (this is
15620 the default).
15621
15622 @item -YP,@var{dirs}
15623 @opindex YP
15624 Search the directories @var{dirs}, and no others, for libraries
15625 specified with @option{-l}.
15626
15627 @item -Ym,@var{dir}
15628 @opindex Ym
15629 Look in the directory @var{dir} to find the M4 preprocessor.
15630 The assembler uses this option.
15631 @c This is supposed to go with a -Yd for predefined M4 macro files, but
15632 @c the generic assembler that comes with Solaris takes just -Ym.
15633 @end table
15634
15635 @node V850 Options
15636 @subsection V850 Options
15637 @cindex V850 Options
15638
15639 These @samp{-m} options are defined for V850 implementations:
15640
15641 @table @gcctabopt
15642 @item -mlong-calls
15643 @itemx -mno-long-calls
15644 @opindex mlong-calls
15645 @opindex mno-long-calls
15646 Treat all calls as being far away (near).  If calls are assumed to be
15647 far away, the compiler will always load the functions address up into a
15648 register, and call indirect through the pointer.
15649
15650 @item -mno-ep
15651 @itemx -mep
15652 @opindex mno-ep
15653 @opindex mep
15654 Do not optimize (do optimize) basic blocks that use the same index
15655 pointer 4 or more times to copy pointer into the @code{ep} register, and
15656 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
15657 option is on by default if you optimize.
15658
15659 @item -mno-prolog-function
15660 @itemx -mprolog-function
15661 @opindex mno-prolog-function
15662 @opindex mprolog-function
15663 Do not use (do use) external functions to save and restore registers
15664 at the prologue and epilogue of a function.  The external functions
15665 are slower, but use less code space if more than one function saves
15666 the same number of registers.  The @option{-mprolog-function} option
15667 is on by default if you optimize.
15668
15669 @item -mspace
15670 @opindex mspace
15671 Try to make the code as small as possible.  At present, this just turns
15672 on the @option{-mep} and @option{-mprolog-function} options.
15673
15674 @item -mtda=@var{n}
15675 @opindex mtda
15676 Put static or global variables whose size is @var{n} bytes or less into
15677 the tiny data area that register @code{ep} points to.  The tiny data
15678 area can hold up to 256 bytes in total (128 bytes for byte references).
15679
15680 @item -msda=@var{n}
15681 @opindex msda
15682 Put static or global variables whose size is @var{n} bytes or less into
15683 the small data area that register @code{gp} points to.  The small data
15684 area can hold up to 64 kilobytes.
15685
15686 @item -mzda=@var{n}
15687 @opindex mzda
15688 Put static or global variables whose size is @var{n} bytes or less into
15689 the first 32 kilobytes of memory.
15690
15691 @item -mv850
15692 @opindex mv850
15693 Specify that the target processor is the V850.
15694
15695 @item -mbig-switch
15696 @opindex mbig-switch
15697 Generate code suitable for big switch tables.  Use this option only if
15698 the assembler/linker complain about out of range branches within a switch
15699 table.
15700
15701 @item -mapp-regs
15702 @opindex mapp-regs
15703 This option will cause r2 and r5 to be used in the code generated by
15704 the compiler.  This setting is the default.
15705
15706 @item -mno-app-regs
15707 @opindex mno-app-regs
15708 This option will cause r2 and r5 to be treated as fixed registers.
15709
15710 @item -mv850e1
15711 @opindex mv850e1
15712 Specify that the target processor is the V850E1.  The preprocessor
15713 constants @samp{__v850e1__} and @samp{__v850e__} will be defined if
15714 this option is used.
15715
15716 @item -mv850e
15717 @opindex mv850e
15718 Specify that the target processor is the V850E@.  The preprocessor
15719 constant @samp{__v850e__} will be defined if this option is used.
15720
15721 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
15722 are defined then a default target processor will be chosen and the
15723 relevant @samp{__v850*__} preprocessor constant will be defined.
15724
15725 The preprocessor constants @samp{__v850} and @samp{__v851__} are always
15726 defined, regardless of which processor variant is the target.
15727
15728 @item -mdisable-callt
15729 @opindex mdisable-callt
15730 This option will suppress generation of the CALLT instruction for the
15731 v850e and v850e1 flavors of the v850 architecture.  The default is
15732 @option{-mno-disable-callt} which allows the CALLT instruction to be used.
15733
15734 @end table
15735
15736 @node VAX Options
15737 @subsection VAX Options
15738 @cindex VAX options
15739
15740 These @samp{-m} options are defined for the VAX:
15741
15742 @table @gcctabopt
15743 @item -munix
15744 @opindex munix
15745 Do not output certain jump instructions (@code{aobleq} and so on)
15746 that the Unix assembler for the VAX cannot handle across long
15747 ranges.
15748
15749 @item -mgnu
15750 @opindex mgnu
15751 Do output those jump instructions, on the assumption that you
15752 will assemble with the GNU assembler.
15753
15754 @item -mg
15755 @opindex mg
15756 Output code for g-format floating point numbers instead of d-format.
15757 @end table
15758
15759 @node VxWorks Options
15760 @subsection VxWorks Options
15761 @cindex VxWorks Options
15762
15763 The options in this section are defined for all VxWorks targets.
15764 Options specific to the target hardware are listed with the other
15765 options for that target.
15766
15767 @table @gcctabopt
15768 @item -mrtp
15769 @opindex mrtp
15770 GCC can generate code for both VxWorks kernels and real time processes
15771 (RTPs).  This option switches from the former to the latter.  It also
15772 defines the preprocessor macro @code{__RTP__}.
15773
15774 @item -non-static
15775 @opindex non-static
15776 Link an RTP executable against shared libraries rather than static
15777 libraries.  The options @option{-static} and @option{-shared} can
15778 also be used for RTPs (@pxref{Link Options}); @option{-static}
15779 is the default.
15780
15781 @item -Bstatic
15782 @itemx -Bdynamic
15783 @opindex Bstatic
15784 @opindex Bdynamic
15785 These options are passed down to the linker.  They are defined for
15786 compatibility with Diab.
15787
15788 @item -Xbind-lazy
15789 @opindex Xbind-lazy
15790 Enable lazy binding of function calls.  This option is equivalent to
15791 @option{-Wl,-z,now} and is defined for compatibility with Diab.
15792
15793 @item -Xbind-now
15794 @opindex Xbind-now
15795 Disable lazy binding of function calls.  This option is the default and
15796 is defined for compatibility with Diab.
15797 @end table
15798
15799 @node x86-64 Options
15800 @subsection x86-64 Options
15801 @cindex x86-64 options
15802
15803 These are listed under @xref{i386 and x86-64 Options}.
15804
15805 @node i386 and x86-64 Windows Options
15806 @subsection i386 and x86-64 Windows Options
15807 @cindex i386 and x86-64 Windows Options
15808
15809 These additional options are available for Windows targets:
15810
15811 @table @gcctabopt
15812 @item -mconsole
15813 @opindex mconsole
15814 This option is available for Cygwin and MinGW targets.  It
15815 specifies that a console application is to be generated, by
15816 instructing the linker to set the PE header subsystem type
15817 required for console applications.
15818 This is the default behavior for Cygwin and MinGW targets.
15819
15820 @item -mcygwin
15821 @opindex mcygwin
15822 This option is available for Cygwin targets.  It specifies that
15823 the Cygwin internal interface is to be used for predefined
15824 preprocessor macros, C runtime libraries and related linker
15825 paths and options.  For Cygwin targets this is the default behavior.
15826 This option is deprecated and will be removed in a future release.
15827
15828 @item -mno-cygwin
15829 @opindex mno-cygwin
15830 This option is available for Cygwin targets.  It specifies that
15831 the MinGW internal interface is to be used instead of Cygwin's, by
15832 setting MinGW-related predefined macros and linker paths and default
15833 library options.
15834 This option is deprecated and will be removed in a future release.
15835
15836 @item -mdll
15837 @opindex mdll
15838 This option is available for Cygwin and MinGW targets.  It
15839 specifies that a DLL - a dynamic link library - is to be
15840 generated, enabling the selection of the required runtime
15841 startup object and entry point.
15842
15843 @item -mnop-fun-dllimport
15844 @opindex mnop-fun-dllimport
15845 This option is available for Cygwin and MinGW targets.  It
15846 specifies that the dllimport attribute should be ignored.
15847
15848 @item -mthread
15849 @opindex mthread
15850 This option is available for MinGW targets. It specifies
15851 that MinGW-specific thread support is to be used.
15852
15853 @item -municode
15854 @opindex municode
15855 This option is available for mingw-w64 targets.  It specifies
15856 that the UNICODE macro is getting pre-defined and that the
15857 unicode capable runtime startup code is choosen.
15858
15859 @item -mwin32
15860 @opindex mwin32
15861 This option is available for Cygwin and MinGW targets.  It
15862 specifies that the typical Windows pre-defined macros are to
15863 be set in the pre-processor, but does not influence the choice
15864 of runtime library/startup code.
15865
15866 @item -mwindows
15867 @opindex mwindows
15868 This option is available for Cygwin and MinGW targets.  It
15869 specifies that a GUI application is to be generated by
15870 instructing the linker to set the PE header subsystem type
15871 appropriately.
15872
15873 @item -mpe-aligned-commons
15874 @opindex mpe-aligned-commons
15875 This option is available for Cygwin and MinGW targets.  It
15876 specifies that the GNU extension to the PE file format that 
15877 permits the correct alignment of COMMON variables should be
15878 used when generating code.  It will be enabled by default if
15879 GCC detects that the target assembler found during configuration
15880 supports the feature.
15881 @end table
15882
15883 See also under @ref{i386 and x86-64 Options} for standard options.
15884
15885 @node Xstormy16 Options
15886 @subsection Xstormy16 Options
15887 @cindex Xstormy16 Options
15888
15889 These options are defined for Xstormy16:
15890
15891 @table @gcctabopt
15892 @item -msim
15893 @opindex msim
15894 Choose startup files and linker script suitable for the simulator.
15895 @end table
15896
15897 @node Xtensa Options
15898 @subsection Xtensa Options
15899 @cindex Xtensa Options
15900
15901 These options are supported for Xtensa targets:
15902
15903 @table @gcctabopt
15904 @item -mconst16
15905 @itemx -mno-const16
15906 @opindex mconst16
15907 @opindex mno-const16
15908 Enable or disable use of @code{CONST16} instructions for loading
15909 constant values.  The @code{CONST16} instruction is currently not a
15910 standard option from Tensilica.  When enabled, @code{CONST16}
15911 instructions are always used in place of the standard @code{L32R}
15912 instructions.  The use of @code{CONST16} is enabled by default only if
15913 the @code{L32R} instruction is not available.
15914
15915 @item -mfused-madd
15916 @itemx -mno-fused-madd
15917 @opindex mfused-madd
15918 @opindex mno-fused-madd
15919 Enable or disable use of fused multiply/add and multiply/subtract
15920 instructions in the floating-point option.  This has no effect if the
15921 floating-point option is not also enabled.  Disabling fused multiply/add
15922 and multiply/subtract instructions forces the compiler to use separate
15923 instructions for the multiply and add/subtract operations.  This may be
15924 desirable in some cases where strict IEEE 754-compliant results are
15925 required: the fused multiply add/subtract instructions do not round the
15926 intermediate result, thereby producing results with @emph{more} bits of
15927 precision than specified by the IEEE standard.  Disabling fused multiply
15928 add/subtract instructions also ensures that the program output is not
15929 sensitive to the compiler's ability to combine multiply and add/subtract
15930 operations.
15931
15932 @item -mserialize-volatile
15933 @itemx -mno-serialize-volatile
15934 @opindex mserialize-volatile
15935 @opindex mno-serialize-volatile
15936 When this option is enabled, GCC inserts @code{MEMW} instructions before
15937 @code{volatile} memory references to guarantee sequential consistency.
15938 The default is @option{-mserialize-volatile}.  Use
15939 @option{-mno-serialize-volatile} to omit the @code{MEMW} instructions.
15940
15941 @item -mtext-section-literals
15942 @itemx -mno-text-section-literals
15943 @opindex mtext-section-literals
15944 @opindex mno-text-section-literals
15945 Control the treatment of literal pools.  The default is
15946 @option{-mno-text-section-literals}, which places literals in a separate
15947 section in the output file.  This allows the literal pool to be placed
15948 in a data RAM/ROM, and it also allows the linker to combine literal
15949 pools from separate object files to remove redundant literals and
15950 improve code size.  With @option{-mtext-section-literals}, the literals
15951 are interspersed in the text section in order to keep them as close as
15952 possible to their references.  This may be necessary for large assembly
15953 files.
15954
15955 @item -mtarget-align
15956 @itemx -mno-target-align
15957 @opindex mtarget-align
15958 @opindex mno-target-align
15959 When this option is enabled, GCC instructs the assembler to
15960 automatically align instructions to reduce branch penalties at the
15961 expense of some code density.  The assembler attempts to widen density
15962 instructions to align branch targets and the instructions following call
15963 instructions.  If there are not enough preceding safe density
15964 instructions to align a target, no widening will be performed.  The
15965 default is @option{-mtarget-align}.  These options do not affect the
15966 treatment of auto-aligned instructions like @code{LOOP}, which the
15967 assembler will always align, either by widening density instructions or
15968 by inserting no-op instructions.
15969
15970 @item -mlongcalls
15971 @itemx -mno-longcalls
15972 @opindex mlongcalls
15973 @opindex mno-longcalls
15974 When this option is enabled, GCC instructs the assembler to translate
15975 direct calls to indirect calls unless it can determine that the target
15976 of a direct call is in the range allowed by the call instruction.  This
15977 translation typically occurs for calls to functions in other source
15978 files.  Specifically, the assembler translates a direct @code{CALL}
15979 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
15980 The default is @option{-mno-longcalls}.  This option should be used in
15981 programs where the call target can potentially be out of range.  This
15982 option is implemented in the assembler, not the compiler, so the
15983 assembly code generated by GCC will still show direct call
15984 instructions---look at the disassembled object code to see the actual
15985 instructions.  Note that the assembler will use an indirect call for
15986 every cross-file call, not just those that really will be out of range.
15987 @end table
15988
15989 @node zSeries Options
15990 @subsection zSeries Options
15991 @cindex zSeries options
15992
15993 These are listed under @xref{S/390 and zSeries Options}.
15994
15995 @node Code Gen Options
15996 @section Options for Code Generation Conventions
15997 @cindex code generation conventions
15998 @cindex options, code generation
15999 @cindex run-time options
16000
16001 These machine-independent options control the interface conventions
16002 used in code generation.
16003
16004 Most of them have both positive and negative forms; the negative form
16005 of @option{-ffoo} would be @option{-fno-foo}.  In the table below, only
16006 one of the forms is listed---the one which is not the default.  You
16007 can figure out the other form by either removing @samp{no-} or adding
16008 it.
16009
16010 @table @gcctabopt
16011 @item -fbounds-check
16012 @opindex fbounds-check
16013 For front-ends that support it, generate additional code to check that
16014 indices used to access arrays are within the declared range.  This is
16015 currently only supported by the Java and Fortran front-ends, where
16016 this option defaults to true and false respectively.
16017
16018 @item -ftrapv
16019 @opindex ftrapv
16020 This option generates traps for signed overflow on addition, subtraction,
16021 multiplication operations.
16022
16023 @item -fwrapv
16024 @opindex fwrapv
16025 This option instructs the compiler to assume that signed arithmetic
16026 overflow of addition, subtraction and multiplication wraps around
16027 using twos-complement representation.  This flag enables some optimizations
16028 and disables others.  This option is enabled by default for the Java
16029 front-end, as required by the Java language specification.
16030
16031 @item -fexceptions
16032 @opindex fexceptions
16033 Enable exception handling.  Generates extra code needed to propagate
16034 exceptions.  For some targets, this implies GCC will generate frame
16035 unwind information for all functions, which can produce significant data
16036 size overhead, although it does not affect execution.  If you do not
16037 specify this option, GCC will enable it by default for languages like
16038 C++ which normally require exception handling, and disable it for
16039 languages like C that do not normally require it.  However, you may need
16040 to enable this option when compiling C code that needs to interoperate
16041 properly with exception handlers written in C++.  You may also wish to
16042 disable this option if you are compiling older C++ programs that don't
16043 use exception handling.
16044
16045 @item -fnon-call-exceptions
16046 @opindex fnon-call-exceptions
16047 Generate code that allows trapping instructions to throw exceptions.
16048 Note that this requires platform-specific runtime support that does
16049 not exist everywhere.  Moreover, it only allows @emph{trapping}
16050 instructions to throw exceptions, i.e.@: memory references or floating
16051 point instructions.  It does not allow exceptions to be thrown from
16052 arbitrary signal handlers such as @code{SIGALRM}.
16053
16054 @item -funwind-tables
16055 @opindex funwind-tables
16056 Similar to @option{-fexceptions}, except that it will just generate any needed
16057 static data, but will not affect the generated code in any other way.
16058 You will normally not enable this option; instead, a language processor
16059 that needs this handling would enable it on your behalf.
16060
16061 @item -fasynchronous-unwind-tables
16062 @opindex fasynchronous-unwind-tables
16063 Generate unwind table in dwarf2 format, if supported by target machine.  The
16064 table is exact at each instruction boundary, so it can be used for stack
16065 unwinding from asynchronous events (such as debugger or garbage collector).
16066
16067 @item -fpcc-struct-return
16068 @opindex fpcc-struct-return
16069 Return ``short'' @code{struct} and @code{union} values in memory like
16070 longer ones, rather than in registers.  This convention is less
16071 efficient, but it has the advantage of allowing intercallability between
16072 GCC-compiled files and files compiled with other compilers, particularly
16073 the Portable C Compiler (pcc).
16074
16075 The precise convention for returning structures in memory depends
16076 on the target configuration macros.
16077
16078 Short structures and unions are those whose size and alignment match
16079 that of some integer type.
16080
16081 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
16082 switch is not binary compatible with code compiled with the
16083 @option{-freg-struct-return} switch.
16084 Use it to conform to a non-default application binary interface.
16085
16086 @item -freg-struct-return
16087 @opindex freg-struct-return
16088 Return @code{struct} and @code{union} values in registers when possible.
16089 This is more efficient for small structures than
16090 @option{-fpcc-struct-return}.
16091
16092 If you specify neither @option{-fpcc-struct-return} nor
16093 @option{-freg-struct-return}, GCC defaults to whichever convention is
16094 standard for the target.  If there is no standard convention, GCC
16095 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
16096 the principal compiler.  In those cases, we can choose the standard, and
16097 we chose the more efficient register return alternative.
16098
16099 @strong{Warning:} code compiled with the @option{-freg-struct-return}
16100 switch is not binary compatible with code compiled with the
16101 @option{-fpcc-struct-return} switch.
16102 Use it to conform to a non-default application binary interface.
16103
16104 @item -fshort-enums
16105 @opindex fshort-enums
16106 Allocate to an @code{enum} type only as many bytes as it needs for the
16107 declared range of possible values.  Specifically, the @code{enum} type
16108 will be equivalent to the smallest integer type which has enough room.
16109
16110 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
16111 code that is not binary compatible with code generated without that switch.
16112 Use it to conform to a non-default application binary interface.
16113
16114 @item -fshort-double
16115 @opindex fshort-double
16116 Use the same size for @code{double} as for @code{float}.
16117
16118 @strong{Warning:} the @option{-fshort-double} switch causes GCC to generate
16119 code that is not binary compatible with code generated without that switch.
16120 Use it to conform to a non-default application binary interface.
16121
16122 @item -fshort-wchar
16123 @opindex fshort-wchar
16124 Override the underlying type for @samp{wchar_t} to be @samp{short
16125 unsigned int} instead of the default for the target.  This option is
16126 useful for building programs to run under WINE@.
16127
16128 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
16129 code that is not binary compatible with code generated without that switch.
16130 Use it to conform to a non-default application binary interface.
16131
16132 @item -fno-common
16133 @opindex fno-common
16134 In C code, controls the placement of uninitialized global variables.
16135 Unix C compilers have traditionally permitted multiple definitions of
16136 such variables in different compilation units by placing the variables
16137 in a common block.  
16138 This is the behavior specified by @option{-fcommon}, and is the default 
16139 for GCC on most targets.  
16140 On the other hand, this behavior is not required by ISO C, and on some
16141 targets may carry a speed or code size penalty on variable references.
16142 The @option{-fno-common} option specifies that the compiler should place 
16143 uninitialized global variables in the data section of the object file,
16144 rather than generating them as common blocks.
16145 This has the effect that if the same variable is declared 
16146 (without @code{extern}) in two different compilations,
16147 you will get a multiple-definition error when you link them.
16148 In this case, you must compile with @option{-fcommon} instead.  
16149 Compiling with @option{-fno-common} is useful on targets for which 
16150 it provides better performance, or if you wish to verify that the
16151 program will work on other systems which always treat uninitialized
16152 variable declarations this way.
16153
16154 @item -fno-ident
16155 @opindex fno-ident
16156 Ignore the @samp{#ident} directive.
16157
16158 @item -finhibit-size-directive
16159 @opindex finhibit-size-directive
16160 Don't output a @code{.size} assembler directive, or anything else that
16161 would cause trouble if the function is split in the middle, and the
16162 two halves are placed at locations far apart in memory.  This option is
16163 used when compiling @file{crtstuff.c}; you should not need to use it
16164 for anything else.
16165
16166 @item -fverbose-asm
16167 @opindex fverbose-asm
16168 Put extra commentary information in the generated assembly code to
16169 make it more readable.  This option is generally only of use to those
16170 who actually need to read the generated assembly code (perhaps while
16171 debugging the compiler itself).
16172
16173 @option{-fno-verbose-asm}, the default, causes the
16174 extra information to be omitted and is useful when comparing two assembler
16175 files.
16176
16177 @item -frecord-gcc-switches
16178 @opindex frecord-gcc-switches
16179 This switch causes the command line that was used to invoke the
16180 compiler to be recorded into the object file that is being created.
16181 This switch is only implemented on some targets and the exact format
16182 of the recording is target and binary file format dependent, but it
16183 usually takes the form of a section containing ASCII text.  This
16184 switch is related to the @option{-fverbose-asm} switch, but that
16185 switch only records information in the assembler output file as
16186 comments, so it never reaches the object file.
16187
16188 @item -fpic
16189 @opindex fpic
16190 @cindex global offset table
16191 @cindex PIC
16192 Generate position-independent code (PIC) suitable for use in a shared
16193 library, if supported for the target machine.  Such code accesses all
16194 constant addresses through a global offset table (GOT)@.  The dynamic
16195 loader resolves the GOT entries when the program starts (the dynamic
16196 loader is not part of GCC; it is part of the operating system).  If
16197 the GOT size for the linked executable exceeds a machine-specific
16198 maximum size, you get an error message from the linker indicating that
16199 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
16200 instead.  (These maximums are 8k on the SPARC and 32k
16201 on the m68k and RS/6000.  The 386 has no such limit.)
16202
16203 Position-independent code requires special support, and therefore works
16204 only on certain machines.  For the 386, GCC supports PIC for System V
16205 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
16206 position-independent.
16207
16208 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
16209 are defined to 1.
16210
16211 @item -fPIC
16212 @opindex fPIC
16213 If supported for the target machine, emit position-independent code,
16214 suitable for dynamic linking and avoiding any limit on the size of the
16215 global offset table.  This option makes a difference on the m68k,
16216 PowerPC and SPARC@.
16217
16218 Position-independent code requires special support, and therefore works
16219 only on certain machines.
16220
16221 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
16222 are defined to 2.
16223
16224 @item -fpie
16225 @itemx -fPIE
16226 @opindex fpie
16227 @opindex fPIE
16228 These options are similar to @option{-fpic} and @option{-fPIC}, but
16229 generated position independent code can be only linked into executables.
16230 Usually these options are used when @option{-pie} GCC option will be
16231 used during linking.
16232
16233 @option{-fpie} and @option{-fPIE} both define the macros
16234 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
16235 for @option{-fpie} and 2 for @option{-fPIE}.
16236
16237 @item -fno-jump-tables
16238 @opindex fno-jump-tables
16239 Do not use jump tables for switch statements even where it would be
16240 more efficient than other code generation strategies.  This option is
16241 of use in conjunction with @option{-fpic} or @option{-fPIC} for
16242 building code which forms part of a dynamic linker and cannot
16243 reference the address of a jump table.  On some targets, jump tables
16244 do not require a GOT and this option is not needed.
16245
16246 @item -ffixed-@var{reg}
16247 @opindex ffixed
16248 Treat the register named @var{reg} as a fixed register; generated code
16249 should never refer to it (except perhaps as a stack pointer, frame
16250 pointer or in some other fixed role).
16251
16252 @var{reg} must be the name of a register.  The register names accepted
16253 are machine-specific and are defined in the @code{REGISTER_NAMES}
16254 macro in the machine description macro file.
16255
16256 This flag does not have a negative form, because it specifies a
16257 three-way choice.
16258
16259 @item -fcall-used-@var{reg}
16260 @opindex fcall-used
16261 Treat the register named @var{reg} as an allocable register that is
16262 clobbered by function calls.  It may be allocated for temporaries or
16263 variables that do not live across a call.  Functions compiled this way
16264 will not save and restore the register @var{reg}.
16265
16266 It is an error to used this flag with the frame pointer or stack pointer.
16267 Use of this flag for other registers that have fixed pervasive roles in
16268 the machine's execution model will produce disastrous results.
16269
16270 This flag does not have a negative form, because it specifies a
16271 three-way choice.
16272
16273 @item -fcall-saved-@var{reg}
16274 @opindex fcall-saved
16275 Treat the register named @var{reg} as an allocable register saved by
16276 functions.  It may be allocated even for temporaries or variables that
16277 live across a call.  Functions compiled this way will save and restore
16278 the register @var{reg} if they use it.
16279
16280 It is an error to used this flag with the frame pointer or stack pointer.
16281 Use of this flag for other registers that have fixed pervasive roles in
16282 the machine's execution model will produce disastrous results.
16283
16284 A different sort of disaster will result from the use of this flag for
16285 a register in which function values may be returned.
16286
16287 This flag does not have a negative form, because it specifies a
16288 three-way choice.
16289
16290 @item -fpack-struct[=@var{n}]
16291 @opindex fpack-struct
16292 Without a value specified, pack all structure members together without
16293 holes.  When a value is specified (which must be a small power of two), pack
16294 structure members according to this value, representing the maximum
16295 alignment (that is, objects with default alignment requirements larger than
16296 this will be output potentially unaligned at the next fitting location.
16297
16298 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
16299 code that is not binary compatible with code generated without that switch.
16300 Additionally, it makes the code suboptimal.
16301 Use it to conform to a non-default application binary interface.
16302
16303 @item -finstrument-functions
16304 @opindex finstrument-functions
16305 Generate instrumentation calls for entry and exit to functions.  Just
16306 after function entry and just before function exit, the following
16307 profiling functions will be called with the address of the current
16308 function and its call site.  (On some platforms,
16309 @code{__builtin_return_address} does not work beyond the current
16310 function, so the call site information may not be available to the
16311 profiling functions otherwise.)
16312
16313 @smallexample
16314 void __cyg_profile_func_enter (void *this_fn,
16315                                void *call_site);
16316 void __cyg_profile_func_exit  (void *this_fn,
16317                                void *call_site);
16318 @end smallexample
16319
16320 The first argument is the address of the start of the current function,
16321 which may be looked up exactly in the symbol table.
16322
16323 This instrumentation is also done for functions expanded inline in other
16324 functions.  The profiling calls will indicate where, conceptually, the
16325 inline function is entered and exited.  This means that addressable
16326 versions of such functions must be available.  If all your uses of a
16327 function are expanded inline, this may mean an additional expansion of
16328 code size.  If you use @samp{extern inline} in your C code, an
16329 addressable version of such functions must be provided.  (This is
16330 normally the case anyways, but if you get lucky and the optimizer always
16331 expands the functions inline, you might have gotten away without
16332 providing static copies.)
16333
16334 A function may be given the attribute @code{no_instrument_function}, in
16335 which case this instrumentation will not be done.  This can be used, for
16336 example, for the profiling functions listed above, high-priority
16337 interrupt routines, and any functions from which the profiling functions
16338 cannot safely be called (perhaps signal handlers, if the profiling
16339 routines generate output or allocate memory).
16340
16341 @item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
16342 @opindex finstrument-functions-exclude-file-list
16343
16344 Set the list of functions that are excluded from instrumentation (see
16345 the description of @code{-finstrument-functions}).  If the file that
16346 contains a function definition matches with one of @var{file}, then
16347 that function is not instrumented.  The match is done on substrings:
16348 if the @var{file} parameter is a substring of the file name, it is
16349 considered to be a match.
16350
16351 For example,
16352 @code{-finstrument-functions-exclude-file-list=/bits/stl,include/sys}
16353 will exclude any inline function defined in files whose pathnames
16354 contain @code{/bits/stl} or @code{include/sys}.
16355
16356 If, for some reason, you want to include letter @code{','} in one of
16357 @var{sym}, write @code{'\,'}. For example,
16358 @code{-finstrument-functions-exclude-file-list='\,\,tmp'}
16359 (note the single quote surrounding the option).
16360
16361 @item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{}
16362 @opindex finstrument-functions-exclude-function-list
16363
16364 This is similar to @code{-finstrument-functions-exclude-file-list},
16365 but this option sets the list of function names to be excluded from
16366 instrumentation.  The function name to be matched is its user-visible
16367 name, such as @code{vector<int> blah(const vector<int> &)}, not the
16368 internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}).  The
16369 match is done on substrings: if the @var{sym} parameter is a substring
16370 of the function name, it is considered to be a match.  For C99 and C++
16371 extended identifiers, the function name must be given in UTF-8, not
16372 using universal character names.
16373
16374 @item -fstack-check
16375 @opindex fstack-check
16376 Generate code to verify that you do not go beyond the boundary of the
16377 stack.  You should specify this flag if you are running in an
16378 environment with multiple threads, but only rarely need to specify it in
16379 a single-threaded environment since stack overflow is automatically
16380 detected on nearly all systems if there is only one stack.
16381
16382 Note that this switch does not actually cause checking to be done; the
16383 operating system or the language runtime must do that.  The switch causes
16384 generation of code to ensure that they see the stack being extended.
16385
16386 You can additionally specify a string parameter: @code{no} means no
16387 checking, @code{generic} means force the use of old-style checking,
16388 @code{specific} means use the best checking method and is equivalent
16389 to bare @option{-fstack-check}.
16390
16391 Old-style checking is a generic mechanism that requires no specific
16392 target support in the compiler but comes with the following drawbacks:
16393
16394 @enumerate
16395 @item
16396 Modified allocation strategy for large objects: they will always be
16397 allocated dynamically if their size exceeds a fixed threshold.
16398
16399 @item
16400 Fixed limit on the size of the static frame of functions: when it is
16401 topped by a particular function, stack checking is not reliable and
16402 a warning is issued by the compiler.
16403
16404 @item
16405 Inefficiency: because of both the modified allocation strategy and the
16406 generic implementation, the performances of the code are hampered.
16407 @end enumerate
16408
16409 Note that old-style stack checking is also the fallback method for
16410 @code{specific} if no target support has been added in the compiler.
16411
16412 @item -fstack-limit-register=@var{reg}
16413 @itemx -fstack-limit-symbol=@var{sym}
16414 @itemx -fno-stack-limit
16415 @opindex fstack-limit-register
16416 @opindex fstack-limit-symbol
16417 @opindex fno-stack-limit
16418 Generate code to ensure that the stack does not grow beyond a certain value,
16419 either the value of a register or the address of a symbol.  If the stack
16420 would grow beyond the value, a signal is raised.  For most targets,
16421 the signal is raised before the stack overruns the boundary, so
16422 it is possible to catch the signal without taking special precautions.
16423
16424 For instance, if the stack starts at absolute address @samp{0x80000000}
16425 and grows downwards, you can use the flags
16426 @option{-fstack-limit-symbol=__stack_limit} and
16427 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
16428 of 128KB@.  Note that this may only work with the GNU linker.
16429
16430 @cindex aliasing of parameters
16431 @cindex parameters, aliased
16432 @item -fargument-alias
16433 @itemx -fargument-noalias
16434 @itemx -fargument-noalias-global
16435 @itemx -fargument-noalias-anything
16436 @opindex fargument-alias
16437 @opindex fargument-noalias
16438 @opindex fargument-noalias-global
16439 @opindex fargument-noalias-anything
16440 Specify the possible relationships among parameters and between
16441 parameters and global data.
16442
16443 @option{-fargument-alias} specifies that arguments (parameters) may
16444 alias each other and may alias global storage.@*
16445 @option{-fargument-noalias} specifies that arguments do not alias
16446 each other, but may alias global storage.@*
16447 @option{-fargument-noalias-global} specifies that arguments do not
16448 alias each other and do not alias global storage.
16449 @option{-fargument-noalias-anything} specifies that arguments do not
16450 alias any other storage.
16451
16452 Each language will automatically use whatever option is required by
16453 the language standard.  You should not need to use these options yourself.
16454
16455 @item -fleading-underscore
16456 @opindex fleading-underscore
16457 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
16458 change the way C symbols are represented in the object file.  One use
16459 is to help link with legacy assembly code.
16460
16461 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
16462 generate code that is not binary compatible with code generated without that
16463 switch.  Use it to conform to a non-default application binary interface.
16464 Not all targets provide complete support for this switch.
16465
16466 @item -ftls-model=@var{model}
16467 @opindex ftls-model
16468 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
16469 The @var{model} argument should be one of @code{global-dynamic},
16470 @code{local-dynamic}, @code{initial-exec} or @code{local-exec}.
16471
16472 The default without @option{-fpic} is @code{initial-exec}; with
16473 @option{-fpic} the default is @code{global-dynamic}.
16474
16475 @item -fvisibility=@var{default|internal|hidden|protected}
16476 @opindex fvisibility
16477 Set the default ELF image symbol visibility to the specified option---all
16478 symbols will be marked with this unless overridden within the code.
16479 Using this feature can very substantially improve linking and
16480 load times of shared object libraries, produce more optimized
16481 code, provide near-perfect API export and prevent symbol clashes.
16482 It is @strong{strongly} recommended that you use this in any shared objects
16483 you distribute.
16484
16485 Despite the nomenclature, @code{default} always means public ie;
16486 available to be linked against from outside the shared object.
16487 @code{protected} and @code{internal} are pretty useless in real-world
16488 usage so the only other commonly used option will be @code{hidden}.
16489 The default if @option{-fvisibility} isn't specified is
16490 @code{default}, i.e., make every
16491 symbol public---this causes the same behavior as previous versions of
16492 GCC@.
16493
16494 A good explanation of the benefits offered by ensuring ELF
16495 symbols have the correct visibility is given by ``How To Write
16496 Shared Libraries'' by Ulrich Drepper (which can be found at
16497 @w{@uref{http://people.redhat.com/~drepper/}})---however a superior
16498 solution made possible by this option to marking things hidden when
16499 the default is public is to make the default hidden and mark things
16500 public.  This is the norm with DLL's on Windows and with @option{-fvisibility=hidden}
16501 and @code{__attribute__ ((visibility("default")))} instead of
16502 @code{__declspec(dllexport)} you get almost identical semantics with
16503 identical syntax.  This is a great boon to those working with
16504 cross-platform projects.
16505
16506 For those adding visibility support to existing code, you may find
16507 @samp{#pragma GCC visibility} of use.  This works by you enclosing
16508 the declarations you wish to set visibility for with (for example)
16509 @samp{#pragma GCC visibility push(hidden)} and
16510 @samp{#pragma GCC visibility pop}.
16511 Bear in mind that symbol visibility should be viewed @strong{as
16512 part of the API interface contract} and thus all new code should
16513 always specify visibility when it is not the default ie; declarations
16514 only for use within the local DSO should @strong{always} be marked explicitly
16515 as hidden as so to avoid PLT indirection overheads---making this
16516 abundantly clear also aids readability and self-documentation of the code.
16517 Note that due to ISO C++ specification requirements, operator new and
16518 operator delete must always be of default visibility.
16519
16520 Be aware that headers from outside your project, in particular system
16521 headers and headers from any other library you use, may not be
16522 expecting to be compiled with visibility other than the default.  You
16523 may need to explicitly say @samp{#pragma GCC visibility push(default)}
16524 before including any such headers.
16525
16526 @samp{extern} declarations are not affected by @samp{-fvisibility}, so
16527 a lot of code can be recompiled with @samp{-fvisibility=hidden} with
16528 no modifications.  However, this means that calls to @samp{extern}
16529 functions with no explicit visibility will use the PLT, so it is more
16530 effective to use @samp{__attribute ((visibility))} and/or
16531 @samp{#pragma GCC visibility} to tell the compiler which @samp{extern}
16532 declarations should be treated as hidden.
16533
16534 Note that @samp{-fvisibility} does affect C++ vague linkage
16535 entities. This means that, for instance, an exception class that will
16536 be thrown between DSOs must be explicitly marked with default
16537 visibility so that the @samp{type_info} nodes will be unified between
16538 the DSOs.
16539
16540 An overview of these techniques, their benefits and how to use them
16541 is at @w{@uref{http://gcc.gnu.org/wiki/Visibility}}.
16542
16543 @end table
16544
16545 @c man end
16546
16547 @node Environment Variables
16548 @section Environment Variables Affecting GCC
16549 @cindex environment variables
16550
16551 @c man begin ENVIRONMENT
16552 This section describes several environment variables that affect how GCC
16553 operates.  Some of them work by specifying directories or prefixes to use
16554 when searching for various kinds of files.  Some are used to specify other
16555 aspects of the compilation environment.
16556
16557 Note that you can also specify places to search using options such as
16558 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
16559 take precedence over places specified using environment variables, which
16560 in turn take precedence over those specified by the configuration of GCC@.
16561 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
16562 GNU Compiler Collection (GCC) Internals}.
16563
16564 @table @env
16565 @item LANG
16566 @itemx LC_CTYPE
16567 @c @itemx LC_COLLATE
16568 @itemx LC_MESSAGES
16569 @c @itemx LC_MONETARY
16570 @c @itemx LC_NUMERIC
16571 @c @itemx LC_TIME
16572 @itemx LC_ALL
16573 @findex LANG
16574 @findex LC_CTYPE
16575 @c @findex LC_COLLATE
16576 @findex LC_MESSAGES
16577 @c @findex LC_MONETARY
16578 @c @findex LC_NUMERIC
16579 @c @findex LC_TIME
16580 @findex LC_ALL
16581 @cindex locale
16582 These environment variables control the way that GCC uses
16583 localization information that allow GCC to work with different
16584 national conventions.  GCC inspects the locale categories
16585 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
16586 so.  These locale categories can be set to any value supported by your
16587 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
16588 Kingdom encoded in UTF-8.
16589
16590 The @env{LC_CTYPE} environment variable specifies character
16591 classification.  GCC uses it to determine the character boundaries in
16592 a string; this is needed for some multibyte encodings that contain quote
16593 and escape characters that would otherwise be interpreted as a string
16594 end or escape.
16595
16596 The @env{LC_MESSAGES} environment variable specifies the language to
16597 use in diagnostic messages.
16598
16599 If the @env{LC_ALL} environment variable is set, it overrides the value
16600 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
16601 and @env{LC_MESSAGES} default to the value of the @env{LANG}
16602 environment variable.  If none of these variables are set, GCC
16603 defaults to traditional C English behavior.
16604
16605 @item TMPDIR
16606 @findex TMPDIR
16607 If @env{TMPDIR} is set, it specifies the directory to use for temporary
16608 files.  GCC uses temporary files to hold the output of one stage of
16609 compilation which is to be used as input to the next stage: for example,
16610 the output of the preprocessor, which is the input to the compiler
16611 proper.
16612
16613 @item GCC_EXEC_PREFIX
16614 @findex GCC_EXEC_PREFIX
16615 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
16616 names of the subprograms executed by the compiler.  No slash is added
16617 when this prefix is combined with the name of a subprogram, but you can
16618 specify a prefix that ends with a slash if you wish.
16619
16620 If @env{GCC_EXEC_PREFIX} is not set, GCC will attempt to figure out
16621 an appropriate prefix to use based on the pathname it was invoked with.
16622
16623 If GCC cannot find the subprogram using the specified prefix, it
16624 tries looking in the usual places for the subprogram.
16625
16626 The default value of @env{GCC_EXEC_PREFIX} is
16627 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
16628 the installed compiler. In many cases @var{prefix} is the value
16629 of @code{prefix} when you ran the @file{configure} script.
16630
16631 Other prefixes specified with @option{-B} take precedence over this prefix.
16632
16633 This prefix is also used for finding files such as @file{crt0.o} that are
16634 used for linking.
16635
16636 In addition, the prefix is used in an unusual way in finding the
16637 directories to search for header files.  For each of the standard
16638 directories whose name normally begins with @samp{/usr/local/lib/gcc}
16639 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
16640 replacing that beginning with the specified prefix to produce an
16641 alternate directory name.  Thus, with @option{-Bfoo/}, GCC will search
16642 @file{foo/bar} where it would normally search @file{/usr/local/lib/bar}.
16643 These alternate directories are searched first; the standard directories
16644 come next. If a standard directory begins with the configured
16645 @var{prefix} then the value of @var{prefix} is replaced by
16646 @env{GCC_EXEC_PREFIX} when looking for header files.
16647
16648 @item COMPILER_PATH
16649 @findex COMPILER_PATH
16650 The value of @env{COMPILER_PATH} is a colon-separated list of
16651 directories, much like @env{PATH}.  GCC tries the directories thus
16652 specified when searching for subprograms, if it can't find the
16653 subprograms using @env{GCC_EXEC_PREFIX}.
16654
16655 @item LIBRARY_PATH
16656 @findex LIBRARY_PATH
16657 The value of @env{LIBRARY_PATH} is a colon-separated list of
16658 directories, much like @env{PATH}.  When configured as a native compiler,
16659 GCC tries the directories thus specified when searching for special
16660 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
16661 using GCC also uses these directories when searching for ordinary
16662 libraries for the @option{-l} option (but directories specified with
16663 @option{-L} come first).
16664
16665 @item LANG
16666 @findex LANG
16667 @cindex locale definition
16668 This variable is used to pass locale information to the compiler.  One way in
16669 which this information is used is to determine the character set to be used
16670 when character literals, string literals and comments are parsed in C and C++.
16671 When the compiler is configured to allow multibyte characters,
16672 the following values for @env{LANG} are recognized:
16673
16674 @table @samp
16675 @item C-JIS
16676 Recognize JIS characters.
16677 @item C-SJIS
16678 Recognize SJIS characters.
16679 @item C-EUCJP
16680 Recognize EUCJP characters.
16681 @end table
16682
16683 If @env{LANG} is not defined, or if it has some other value, then the
16684 compiler will use mblen and mbtowc as defined by the default locale to
16685 recognize and translate multibyte characters.
16686 @end table
16687
16688 @noindent
16689 Some additional environments variables affect the behavior of the
16690 preprocessor.
16691
16692 @include cppenv.texi
16693
16694 @c man end
16695
16696 @node Precompiled Headers
16697 @section Using Precompiled Headers
16698 @cindex precompiled headers
16699 @cindex speed of compilation
16700
16701 Often large projects have many header files that are included in every
16702 source file.  The time the compiler takes to process these header files
16703 over and over again can account for nearly all of the time required to
16704 build the project.  To make builds faster, GCC allows users to
16705 `precompile' a header file; then, if builds can use the precompiled
16706 header file they will be much faster.
16707
16708 To create a precompiled header file, simply compile it as you would any
16709 other file, if necessary using the @option{-x} option to make the driver
16710 treat it as a C or C++ header file.  You will probably want to use a
16711 tool like @command{make} to keep the precompiled header up-to-date when
16712 the headers it contains change.
16713
16714 A precompiled header file will be searched for when @code{#include} is
16715 seen in the compilation.  As it searches for the included file
16716 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
16717 compiler looks for a precompiled header in each directory just before it
16718 looks for the include file in that directory.  The name searched for is
16719 the name specified in the @code{#include} with @samp{.gch} appended.  If
16720 the precompiled header file can't be used, it is ignored.
16721
16722 For instance, if you have @code{#include "all.h"}, and you have
16723 @file{all.h.gch} in the same directory as @file{all.h}, then the
16724 precompiled header file will be used if possible, and the original
16725 header will be used otherwise.
16726
16727 Alternatively, you might decide to put the precompiled header file in a
16728 directory and use @option{-I} to ensure that directory is searched
16729 before (or instead of) the directory containing the original header.
16730 Then, if you want to check that the precompiled header file is always
16731 used, you can put a file of the same name as the original header in this
16732 directory containing an @code{#error} command.
16733
16734 This also works with @option{-include}.  So yet another way to use
16735 precompiled headers, good for projects not designed with precompiled
16736 header files in mind, is to simply take most of the header files used by
16737 a project, include them from another header file, precompile that header
16738 file, and @option{-include} the precompiled header.  If the header files
16739 have guards against multiple inclusion, they will be skipped because
16740 they've already been included (in the precompiled header).
16741
16742 If you need to precompile the same header file for different
16743 languages, targets, or compiler options, you can instead make a
16744 @emph{directory} named like @file{all.h.gch}, and put each precompiled
16745 header in the directory, perhaps using @option{-o}.  It doesn't matter
16746 what you call the files in the directory, every precompiled header in
16747 the directory will be considered.  The first precompiled header
16748 encountered in the directory that is valid for this compilation will
16749 be used; they're searched in no particular order.
16750
16751 There are many other possibilities, limited only by your imagination,
16752 good sense, and the constraints of your build system.
16753
16754 A precompiled header file can be used only when these conditions apply:
16755
16756 @itemize
16757 @item
16758 Only one precompiled header can be used in a particular compilation.
16759
16760 @item
16761 A precompiled header can't be used once the first C token is seen.  You
16762 can have preprocessor directives before a precompiled header; you can
16763 even include a precompiled header from inside another header, so long as
16764 there are no C tokens before the @code{#include}.
16765
16766 @item
16767 The precompiled header file must be produced for the same language as
16768 the current compilation.  You can't use a C precompiled header for a C++
16769 compilation.
16770
16771 @item
16772 The precompiled header file must have been produced by the same compiler
16773 binary as the current compilation is using.
16774
16775 @item
16776 Any macros defined before the precompiled header is included must
16777 either be defined in the same way as when the precompiled header was
16778 generated, or must not affect the precompiled header, which usually
16779 means that they don't appear in the precompiled header at all.
16780
16781 The @option{-D} option is one way to define a macro before a
16782 precompiled header is included; using a @code{#define} can also do it.
16783 There are also some options that define macros implicitly, like
16784 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
16785 defined this way.
16786
16787 @item If debugging information is output when using the precompiled
16788 header, using @option{-g} or similar, the same kind of debugging information
16789 must have been output when building the precompiled header.  However,
16790 a precompiled header built using @option{-g} can be used in a compilation
16791 when no debugging information is being output.
16792
16793 @item The same @option{-m} options must generally be used when building
16794 and using the precompiled header.  @xref{Submodel Options},
16795 for any cases where this rule is relaxed.
16796
16797 @item Each of the following options must be the same when building and using
16798 the precompiled header:
16799
16800 @gccoptlist{-fexceptions}
16801
16802 @item
16803 Some other command-line options starting with @option{-f},
16804 @option{-p}, or @option{-O} must be defined in the same way as when
16805 the precompiled header was generated.  At present, it's not clear
16806 which options are safe to change and which are not; the safest choice
16807 is to use exactly the same options when generating and using the
16808 precompiled header.  The following are known to be safe:
16809
16810 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
16811 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
16812 -fsched-verbose=<number>  -fschedule-insns  -fvisibility= @gol
16813 -pedantic-errors}
16814
16815 @end itemize
16816
16817 For all of these except the last, the compiler will automatically
16818 ignore the precompiled header if the conditions aren't met.  If you
16819 find an option combination that doesn't work and doesn't cause the
16820 precompiled header to be ignored, please consider filing a bug report,
16821 see @ref{Bugs}.
16822
16823 If you do use differing options when generating and using the
16824 precompiled header, the actual behavior will be a mixture of the
16825 behavior for the options.  For instance, if you use @option{-g} to
16826 generate the precompiled header but not when using it, you may or may
16827 not get debugging information for routines in the precompiled header.