OSDN Git Service

* doc/invoke.texi (max_gcse_passes): Remove documentation.
[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}}
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} -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 -Wunused  -Wunused-function  -Wunused-label  -Wunused-parameter @gol
263 -Wunused-value  -Wunused-variable @gol
264 -Wvariadic-macros -Wvla @gol
265 -Wvolatile-register-var  -Wwrite-strings}
266
267 @item C and Objective-C-only Warning Options
268 @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
269 -Wmissing-parameter-type  -Wmissing-prototypes  -Wnested-externs @gol
270 -Wold-style-declaration  -Wold-style-definition @gol
271 -Wstrict-prototypes  -Wtraditional  -Wtraditional-conversion @gol
272 -Wdeclaration-after-statement -Wpointer-sign}
273
274 @item Debugging Options
275 @xref{Debugging Options,,Options for Debugging Your Program or GCC}.
276 @gccoptlist{-d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
277 -fdbg-cnt-list -fdbg-cnt=@var{counter-value-list} @gol
278 -fdump-noaddr -fdump-unnumbered @gol
279 -fdump-translation-unit@r{[}-@var{n}@r{]} @gol
280 -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
281 -fdump-ipa-all -fdump-ipa-cgraph -fdump-ipa-inline @gol
282 -fdump-statistics @gol
283 -fdump-tree-all @gol
284 -fdump-tree-original@r{[}-@var{n}@r{]}  @gol
285 -fdump-tree-optimized@r{[}-@var{n}@r{]} @gol
286 -fdump-tree-cfg -fdump-tree-vcg -fdump-tree-alias @gol
287 -fdump-tree-ch @gol
288 -fdump-tree-ssa@r{[}-@var{n}@r{]} -fdump-tree-pre@r{[}-@var{n}@r{]} @gol
289 -fdump-tree-ccp@r{[}-@var{n}@r{]} -fdump-tree-dce@r{[}-@var{n}@r{]} @gol
290 -fdump-tree-gimple@r{[}-raw@r{]} -fdump-tree-mudflap@r{[}-@var{n}@r{]} @gol
291 -fdump-tree-dom@r{[}-@var{n}@r{]} @gol
292 -fdump-tree-dse@r{[}-@var{n}@r{]} @gol
293 -fdump-tree-phiopt@r{[}-@var{n}@r{]} @gol
294 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
295 -fdump-tree-copyrename@r{[}-@var{n}@r{]} @gol
296 -fdump-tree-nrv -fdump-tree-vect @gol
297 -fdump-tree-sink @gol
298 -fdump-tree-sra@r{[}-@var{n}@r{]} @gol
299 -fdump-tree-fre@r{[}-@var{n}@r{]} @gol
300 -fdump-tree-vrp@r{[}-@var{n}@r{]} @gol
301 -ftree-vectorizer-verbose=@var{n} @gol
302 -fdump-tree-storeccp@r{[}-@var{n}@r{]} @gol
303 -feliminate-dwarf2-dups -feliminate-unused-debug-types @gol
304 -feliminate-unused-debug-symbols -femit-class-debug-always @gol
305 -fmem-report -fpre-ipa-mem-report -fpost-ipa-mem-report -fprofile-arcs @gol
306 -frandom-seed=@var{string} -fsched-verbose=@var{n} @gol
307 -fsel-sched-verbose -fsel-sched-dump-cfg -fsel-sched-pipelining-verbose @gol
308 -ftest-coverage  -ftime-report -fvar-tracking @gol
309 -g  -g@var{level}  -gcoff -gdwarf-2 @gol
310 -ggdb  -gstabs  -gstabs+  -gvms  -gxcoff  -gxcoff+ @gol
311 -fno-merge-debug-strings -fno-dwarf2-cfi-asm @gol
312 -fdebug-prefix-map=@var{old}=@var{new} @gol
313 -femit-struct-debug-baseonly -femit-struct-debug-reduced @gol
314 -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol
315 -p  -pg  -print-file-name=@var{library}  -print-libgcc-file-name @gol
316 -print-multi-directory  -print-multi-lib @gol
317 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
318 -print-sysroot -print-sysroot-headers-suffix @gol
319 -save-temps -save-temps=cwd -save-temps=obj -time}
320
321 @item Optimization Options
322 @xref{Optimize Options,,Options that Control Optimization}.
323 @gccoptlist{
324 -falign-functions[=@var{n}] -falign-jumps[=@var{n}] @gol
325 -falign-labels[=@var{n}] -falign-loops[=@var{n}] -fassociative-math @gol
326 -fauto-inc-dec -fbranch-probabilities -fbranch-target-load-optimize @gol
327 -fbranch-target-load-optimize2 -fbtr-bb-exclusive -fcaller-saves @gol
328 -fcheck-data-deps -fconserve-stack -fcprop-registers -fcrossjumping @gol
329 -fcse-follow-jumps -fcse-skip-blocks -fcx-fortran-rules -fcx-limited-range @gol
330 -fdata-sections -fdce -fdce @gol
331 -fdelayed-branch -fdelete-null-pointer-checks -fdse -fdse @gol
332 -fearly-inlining -fexpensive-optimizations -ffast-math @gol
333 -ffinite-math-only -ffloat-store -fexcess-precision=@var{style} @gol
334 -fforward-propagate -ffunction-sections @gol
335 -fgcse -fgcse-after-reload -fgcse-las -fgcse-lm @gol
336 -fgcse-sm -fif-conversion -fif-conversion2 -findirect-inlining @gol
337 -finline-functions -finline-functions-called-once -finline-limit=@var{n} @gol
338 -finline-small-functions -fipa-cp -fipa-cp-clone -fipa-matrix-reorg -fipa-pta @gol 
339 -fipa-pure-const -fipa-reference -fipa-struct-reorg @gol
340 -fipa-type-escape -fira-algorithm=@var{algorithm} @gol
341 -fira-region=@var{region} -fira-coalesce -fno-ira-share-save-slots @gol
342 -fno-ira-share-spill-slots -fira-verbose=@var{n} @gol
343 -fivopts -fkeep-inline-functions -fkeep-static-consts @gol
344 -floop-block -floop-interchange -floop-strip-mine @gol
345 -fmerge-all-constants -fmerge-constants -fmodulo-sched @gol
346 -fmodulo-sched-allow-regmoves -fmove-loop-invariants -fmudflap @gol
347 -fmudflapir -fmudflapth -fno-branch-count-reg -fno-default-inline @gol
348 -fno-defer-pop -fno-function-cse -fno-guess-branch-probability @gol
349 -fno-inline -fno-math-errno -fno-peephole -fno-peephole2 @gol
350 -fno-sched-interblock -fno-sched-spec -fno-signed-zeros @gol
351 -fno-toplevel-reorder -fno-trapping-math -fno-zero-initialized-in-bss @gol
352 -fomit-frame-pointer -foptimize-register-move -foptimize-sibling-calls @gol
353 -fpeel-loops -fpredictive-commoning -fprefetch-loop-arrays @gol
354 -fprofile-correction -fprofile-dir=@var{path} -fprofile-generate @gol
355 -fprofile-generate=@var{path} @gol
356 -fprofile-use -fprofile-use=@var{path} -fprofile-values @gol
357 -freciprocal-math -fregmove -frename-registers -freorder-blocks @gol
358 -freorder-blocks-and-partition -freorder-functions @gol
359 -frerun-cse-after-loop -freschedule-modulo-scheduled-loops @gol
360 -frounding-math -fsched2-use-superblocks @gol
361 -fsched2-use-traces -fsched-spec-load -fsched-spec-load-dangerous @gol
362 -fsched-stalled-insns-dep[=@var{n}] -fsched-stalled-insns[=@var{n}] @gol
363 -fschedule-insns -fschedule-insns2 -fsection-anchors -fsee @gol
364 -fselective-scheduling -fselective-scheduling2 @gol
365 -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops @gol
366 -fsignaling-nans -fsingle-precision-constant -fsplit-ivs-in-unroller @gol
367 -fsplit-wide-types -fstack-protector -fstack-protector-all @gol
368 -fstrict-aliasing -fstrict-overflow -fthread-jumps -ftracer @gol
369 -ftree-builtin-call-dce -ftree-ccp -ftree-ch -ftree-copy-prop @gol
370 -ftree-copyrename -ftree-dce @gol
371 -ftree-dominator-opts -ftree-dse -ftree-fre -ftree-loop-im @gol
372 -ftree-loop-distribution @gol
373 -ftree-loop-ivcanon -ftree-loop-linear -ftree-loop-optimize @gol
374 -ftree-parallelize-loops=@var{n} -ftree-pre -ftree-reassoc @gol
375 -ftree-sink -ftree-sra -ftree-switch-conversion @gol
376 -ftree-ter -ftree-vect-loop-version -ftree-vectorize -ftree-vrp @gol
377 -funit-at-a-time -funroll-all-loops -funroll-loops @gol
378 -funsafe-loop-optimizations -funsafe-math-optimizations -funswitch-loops @gol
379 -fvariable-expansion-in-unroller -fvect-cost-model -fvpt -fweb @gol
380 -fwhole-program @gol
381 --param @var{name}=@var{value}
382 -O  -O0  -O1  -O2  -O3  -Os}
383
384 @item Preprocessor Options
385 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
386 @gccoptlist{-A@var{question}=@var{answer} @gol
387 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
388 -C  -dD  -dI  -dM  -dN @gol
389 -D@var{macro}@r{[}=@var{defn}@r{]}  -E  -H @gol
390 -idirafter @var{dir} @gol
391 -include @var{file}  -imacros @var{file} @gol
392 -iprefix @var{file}  -iwithprefix @var{dir} @gol
393 -iwithprefixbefore @var{dir}  -isystem @var{dir} @gol
394 -imultilib @var{dir} -isysroot @var{dir} @gol
395 -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  @gol
396 -P  -fworking-directory  -remap @gol
397 -trigraphs  -undef  -U@var{macro}  -Wp,@var{option} @gol
398 -Xpreprocessor @var{option}}
399
400 @item Assembler Option
401 @xref{Assembler Options,,Passing Options to the Assembler}.
402 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
403
404 @item Linker Options
405 @xref{Link Options,,Options for Linking}.
406 @gccoptlist{@var{object-file-name}  -l@var{library} @gol
407 -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic @gol
408 -s  -static  -static-libgcc  -shared  -shared-libgcc  -symbolic @gol
409 -T @var{script}  -Wl,@var{option}  -Xlinker @var{option} @gol
410 -u @var{symbol}}
411
412 @item Directory Options
413 @xref{Directory Options,,Options for Directory Search}.
414 @gccoptlist{-B@var{prefix}  -I@var{dir}  -iquote@var{dir}  -L@var{dir}
415 -specs=@var{file}  -I- --sysroot=@var{dir}}
416
417 @item Target Options
418 @c I wrote this xref this way to avoid overfull hbox. -- rms
419 @xref{Target Options}.
420 @gccoptlist{-V @var{version}  -b @var{machine}}
421
422 @item Machine Dependent Options
423 @xref{Submodel Options,,Hardware Models and Configurations}.
424 @c This list is ordered alphanumerically by subsection name.
425 @c Try and put the significant identifier (CPU or system) first,
426 @c so users have a clue at guessing where the ones they want will be.
427
428 @emph{ARC Options}
429 @gccoptlist{-EB  -EL @gol
430 -mmangle-cpu  -mcpu=@var{cpu}  -mtext=@var{text-section} @gol
431 -mdata=@var{data-section}  -mrodata=@var{readonly-data-section}}
432
433 @emph{ARM Options}
434 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
435 -mabi=@var{name} @gol
436 -mapcs-stack-check  -mno-apcs-stack-check @gol
437 -mapcs-float  -mno-apcs-float @gol
438 -mapcs-reentrant  -mno-apcs-reentrant @gol
439 -msched-prolog  -mno-sched-prolog @gol
440 -mlittle-endian  -mbig-endian  -mwords-little-endian @gol
441 -mfloat-abi=@var{name}  -msoft-float  -mhard-float  -mfpe @gol
442 -mthumb-interwork  -mno-thumb-interwork @gol
443 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
444 -mstructure-size-boundary=@var{n} @gol
445 -mabort-on-noreturn @gol
446 -mlong-calls  -mno-long-calls @gol
447 -msingle-pic-base  -mno-single-pic-base @gol
448 -mpic-register=@var{reg} @gol
449 -mnop-fun-dllimport @gol
450 -mcirrus-fix-invalid-insns -mno-cirrus-fix-invalid-insns @gol
451 -mpoke-function-name @gol
452 -mthumb  -marm @gol
453 -mtpcs-frame  -mtpcs-leaf-frame @gol
454 -mcaller-super-interworking  -mcallee-super-interworking @gol
455 -mtp=@var{name} @gol
456 -mword-relocations @gol
457 -mfix-cortex-m3-ldrd}
458
459 @emph{AVR Options}
460 @gccoptlist{-mmcu=@var{mcu}  -msize  -minit-stack=@var{n}  -mno-interrupts @gol
461 -mcall-prologues  -mtiny-stack  -mint8}
462
463 @emph{Blackfin Options}
464 @gccoptlist{-mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]} @gol
465 -msim -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
466 -mspecld-anomaly  -mno-specld-anomaly  -mcsync-anomaly  -mno-csync-anomaly @gol
467 -mlow-64k -mno-low64k  -mstack-check-l1  -mid-shared-library @gol
468 -mno-id-shared-library  -mshared-library-id=@var{n} @gol
469 -mleaf-id-shared-library  -mno-leaf-id-shared-library @gol
470 -msep-data  -mno-sep-data  -mlong-calls  -mno-long-calls @gol
471 -mfast-fp -minline-plt -mmulticore  -mcorea  -mcoreb  -msdram @gol
472 -micplb}
473
474 @emph{CRIS Options}
475 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
476 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
477 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
478 -mstack-align  -mdata-align  -mconst-align @gol
479 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
480 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
481 -mmul-bug-workaround  -mno-mul-bug-workaround}
482
483 @emph{CRX Options}
484 @gccoptlist{-mmac -mpush-args}
485
486 @emph{Darwin Options}
487 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
488 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
489 -client_name  -compatibility_version  -current_version @gol
490 -dead_strip @gol
491 -dependency-file  -dylib_file  -dylinker_install_name @gol
492 -dynamic  -dynamiclib  -exported_symbols_list @gol
493 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
494 -force_flat_namespace  -headerpad_max_install_names @gol
495 -iframework @gol
496 -image_base  -init  -install_name  -keep_private_externs @gol
497 -multi_module  -multiply_defined  -multiply_defined_unused @gol
498 -noall_load   -no_dead_strip_inits_and_terms @gol
499 -nofixprebinding -nomultidefs  -noprebind  -noseglinkedit @gol
500 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
501 -private_bundle  -read_only_relocs  -sectalign @gol
502 -sectobjectsymbols  -whyload  -seg1addr @gol
503 -sectcreate  -sectobjectsymbols  -sectorder @gol
504 -segaddr -segs_read_only_addr -segs_read_write_addr @gol
505 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
506 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
507 -single_module  -static  -sub_library  -sub_umbrella @gol
508 -twolevel_namespace  -umbrella  -undefined @gol
509 -unexported_symbols_list  -weak_reference_mismatches @gol
510 -whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} @gol
511 -mkernel -mone-byte-bool}
512
513 @emph{DEC Alpha Options}
514 @gccoptlist{-mno-fp-regs  -msoft-float  -malpha-as  -mgas @gol
515 -mieee  -mieee-with-inexact  -mieee-conformant @gol
516 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
517 -mtrap-precision=@var{mode}  -mbuild-constants @gol
518 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
519 -mbwx  -mmax  -mfix  -mcix @gol
520 -mfloat-vax  -mfloat-ieee @gol
521 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
522 -msmall-text  -mlarge-text @gol
523 -mmemory-latency=@var{time}}
524
525 @emph{DEC Alpha/VMS Options}
526 @gccoptlist{-mvms-return-codes}
527
528 @emph{FR30 Options}
529 @gccoptlist{-msmall-model -mno-lsim}
530
531 @emph{FRV Options}
532 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
533 -mhard-float  -msoft-float @gol
534 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
535 -mdouble  -mno-double @gol
536 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
537 -mfdpic  -minline-plt -mgprel-ro  -multilib-library-pic @gol
538 -mlinked-fp  -mlong-calls  -malign-labels @gol
539 -mlibrary-pic  -macc-4  -macc-8 @gol
540 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
541 -moptimize-membar -mno-optimize-membar @gol
542 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
543 -mvliw-branch  -mno-vliw-branch @gol
544 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
545 -mno-nested-cond-exec  -mtomcat-stats @gol
546 -mTLS -mtls @gol
547 -mcpu=@var{cpu}}
548
549 @emph{GNU/Linux Options}
550 @gccoptlist{-muclibc}
551
552 @emph{H8/300 Options}
553 @gccoptlist{-mrelax  -mh  -ms  -mn  -mint32  -malign-300}
554
555 @emph{HPPA Options}
556 @gccoptlist{-march=@var{architecture-type} @gol
557 -mbig-switch  -mdisable-fpregs  -mdisable-indexing @gol
558 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
559 -mfixed-range=@var{register-range} @gol
560 -mjump-in-delay -mlinker-opt -mlong-calls @gol
561 -mlong-load-store  -mno-big-switch  -mno-disable-fpregs @gol
562 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
563 -mno-jump-in-delay  -mno-long-load-store @gol
564 -mno-portable-runtime  -mno-soft-float @gol
565 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
566 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
567 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
568 -munix=@var{unix-std}  -nolibdld  -static  -threads}
569
570 @emph{i386 and x86-64 Options}
571 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
572 -mfpmath=@var{unit} @gol
573 -masm=@var{dialect}  -mno-fancy-math-387 @gol
574 -mno-fp-ret-in-387  -msoft-float @gol
575 -mno-wide-multiply  -mrtd  -malign-double @gol
576 -mpreferred-stack-boundary=@var{num}
577 -mincoming-stack-boundary=@var{num}
578 -mcld -mcx16 -msahf -mrecip @gol
579 -mmmx  -msse  -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -msse4 -mavx @gol
580 -maes -mpclmul @gol
581 -msse4a -m3dnow -mpopcnt -mabm -msse5 @gol
582 -mthreads  -mno-align-stringops  -minline-all-stringops @gol
583 -minline-stringops-dynamically -mstringop-strategy=@var{alg} @gol
584 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
585 -m96bit-long-double  -mregparm=@var{num}  -msseregparm @gol
586 -mveclibabi=@var{type} -mpc32 -mpc64 -mpc80 -mstackrealign @gol
587 -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs @gol
588 -mcmodel=@var{code-model} -mabi=@var{name} @gol
589 -m32  -m64 -mlarge-data-threshold=@var{num} @gol
590 -mfused-madd -mno-fused-madd -msse2avx}
591
592 @emph{IA-64 Options}
593 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
594 -mvolatile-asm-stop  -mregister-names  -mno-sdata @gol
595 -mconstant-gp  -mauto-pic  -minline-float-divide-min-latency @gol
596 -minline-float-divide-max-throughput @gol
597 -minline-int-divide-min-latency @gol
598 -minline-int-divide-max-throughput  @gol
599 -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
600 -mno-dwarf2-asm -mearly-stop-bits @gol
601 -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
602 -mtune=@var{cpu-type} -mt -pthread -milp32 -mlp64 @gol
603 -mno-sched-br-data-spec -msched-ar-data-spec -mno-sched-control-spec @gol
604 -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec @gol
605 -msched-ldc -mno-sched-control-ldc -mno-sched-spec-verbose @gol
606 -mno-sched-prefer-non-data-spec-insns @gol
607 -mno-sched-prefer-non-control-spec-insns @gol
608 -mno-sched-count-spec-in-critical-path}
609
610 @emph{M32R/D Options}
611 @gccoptlist{-m32r2 -m32rx -m32r @gol
612 -mdebug @gol
613 -malign-loops -mno-align-loops @gol
614 -missue-rate=@var{number} @gol
615 -mbranch-cost=@var{number} @gol
616 -mmodel=@var{code-size-model-type} @gol
617 -msdata=@var{sdata-type} @gol
618 -mno-flush-func -mflush-func=@var{name} @gol
619 -mno-flush-trap -mflush-trap=@var{number} @gol
620 -G @var{num}}
621
622 @emph{M32C Options}
623 @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
624
625 @emph{M680x0 Options}
626 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu}  -mtune=@var{tune}
627 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
628 -m68060  -mcpu32  -m5200  -m5206e  -m528x  -m5307  -m5407 @gol
629 -mcfv4e  -mbitfield  -mno-bitfield  -mc68000  -mc68020 @gol
630 -mnobitfield  -mrtd  -mno-rtd  -mdiv  -mno-div  -mshort @gol
631 -mno-short  -mhard-float  -m68881  -msoft-float  -mpcrel @gol
632 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
633 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library @gol
634 -mxgot -mno-xgot}
635
636 @emph{M68hc1x Options}
637 @gccoptlist{-m6811  -m6812  -m68hc11  -m68hc12   -m68hcs12 @gol
638 -mauto-incdec  -minmax  -mlong-calls  -mshort @gol
639 -msoft-reg-count=@var{count}}
640
641 @emph{MCore Options}
642 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
643 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
644 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
645 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
646 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
647
648 @emph{MIPS Options}
649 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
650 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2 @gol
651 -mips64  -mips64r2 @gol
652 -mips16  -mno-mips16  -mflip-mips16 @gol
653 -minterlink-mips16  -mno-interlink-mips16 @gol
654 -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
655 -mshared  -mno-shared  -mplt  -mno-plt  -mxgot  -mno-xgot @gol
656 -mgp32  -mgp64  -mfp32  -mfp64  -mhard-float  -msoft-float @gol
657 -msingle-float  -mdouble-float  -mdsp  -mno-dsp  -mdspr2  -mno-dspr2 @gol
658 -mfpu=@var{fpu-type} @gol
659 -msmartmips  -mno-smartmips @gol
660 -mpaired-single  -mno-paired-single  -mdmx  -mno-mdmx @gol
661 -mips3d  -mno-mips3d  -mmt  -mno-mt  -mllsc  -mno-llsc @gol
662 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
663 -G@var{num}  -mlocal-sdata  -mno-local-sdata @gol
664 -mextern-sdata  -mno-extern-sdata  -mgpopt  -mno-gopt @gol
665 -membedded-data  -mno-embedded-data @gol
666 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
667 -mcode-readable=@var{setting} @gol
668 -msplit-addresses  -mno-split-addresses @gol
669 -mexplicit-relocs  -mno-explicit-relocs @gol
670 -mcheck-zero-division  -mno-check-zero-division @gol
671 -mdivide-traps  -mdivide-breaks @gol
672 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
673 -mmad  -mno-mad  -mfused-madd  -mno-fused-madd  -nocpp @gol
674 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
675 -mfix-r10000 -mno-fix-r10000  -mfix-vr4120  -mno-fix-vr4120 @gol
676 -mfix-vr4130  -mno-fix-vr4130  -mfix-sb1  -mno-fix-sb1 @gol
677 -mflush-func=@var{func}  -mno-flush-func @gol
678 -mbranch-cost=@var{num}  -mbranch-likely  -mno-branch-likely @gol
679 -mfp-exceptions -mno-fp-exceptions @gol
680 -mvr4130-align -mno-vr4130-align}
681
682 @emph{MMIX Options}
683 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
684 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
685 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
686 -mno-base-addresses  -msingle-exit  -mno-single-exit}
687
688 @emph{MN10300 Options}
689 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
690 -mam33  -mno-am33 @gol
691 -mam33-2  -mno-am33-2 @gol
692 -mreturn-pointer-on-d0 @gol
693 -mno-crt0  -mrelax}
694
695 @emph{PDP-11 Options}
696 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
697 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
698 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
699 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
700 -mbranch-expensive  -mbranch-cheap @gol
701 -msplit  -mno-split  -munix-asm  -mdec-asm}
702
703 @emph{picoChip Options}
704 @gccoptlist{-mae=@var{ae_type} -mvliw-lookahead=@var{N}
705 -msymbol-as-address -mno-inefficient-warnings}
706
707 @emph{PowerPC Options}
708 See RS/6000 and PowerPC Options.
709
710 @emph{RS/6000 and PowerPC Options}
711 @gccoptlist{-mcpu=@var{cpu-type} @gol
712 -mtune=@var{cpu-type} @gol
713 -mpower  -mno-power  -mpower2  -mno-power2 @gol
714 -mpowerpc  -mpowerpc64  -mno-powerpc @gol
715 -maltivec  -mno-altivec @gol
716 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
717 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
718 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb  -mfprnd  -mno-fprnd @gol
719 -mcmpb -mno-cmpb -mmfpgpr -mno-mfpgpr -mhard-dfp -mno-hard-dfp @gol
720 -mnew-mnemonics  -mold-mnemonics @gol
721 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
722 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
723 -malign-power  -malign-natural @gol
724 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
725 -msingle-float -mdouble-float -msimple-fpu @gol
726 -mstring  -mno-string  -mupdate  -mno-update @gol
727 -mavoid-indexed-addresses  -mno-avoid-indexed-addresses @gol
728 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
729 -mstrict-align  -mno-strict-align  -mrelocatable @gol
730 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
731 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
732 -mdynamic-no-pic  -maltivec  -mswdiv @gol
733 -mprioritize-restricted-insns=@var{priority} @gol
734 -msched-costly-dep=@var{dependence_type} @gol
735 -minsert-sched-nops=@var{scheme} @gol
736 -mcall-sysv  -mcall-netbsd @gol
737 -maix-struct-return  -msvr4-struct-return @gol
738 -mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
739 -misel -mno-isel @gol
740 -misel=yes  -misel=no @gol
741 -mspe -mno-spe @gol
742 -mspe=yes  -mspe=no @gol
743 -mpaired @gol
744 -mgen-cell-microcode -mwarn-cell-microcode @gol
745 -mvrsave -mno-vrsave @gol
746 -mmulhw -mno-mulhw @gol
747 -mdlmzb -mno-dlmzb @gol
748 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
749 -mprototype  -mno-prototype @gol
750 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
751 -msdata=@var{opt}  -mvxworks  -G @var{num}  -pthread}
752
753 @emph{S/390 and zSeries Options}
754 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
755 -mhard-float  -msoft-float  -mhard-dfp -mno-hard-dfp @gol
756 -mlong-double-64 -mlong-double-128 @gol
757 -mbackchain  -mno-backchain -mpacked-stack  -mno-packed-stack @gol
758 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
759 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
760 -mtpf-trace -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
761 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size -mstack-guard}
762
763 @emph{Score Options}
764 @gccoptlist{-meb -mel @gol
765 -mnhwloop @gol
766 -muls @gol
767 -mmac @gol
768 -mscore5 -mscore5u -mscore7 -mscore7d}
769
770 @emph{SH Options}
771 @gccoptlist{-m1  -m2  -m2e  -m3  -m3e @gol
772 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
773 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol
774 -m5-64media  -m5-64media-nofpu @gol
775 -m5-32media  -m5-32media-nofpu @gol
776 -m5-compact  -m5-compact-nofpu @gol
777 -mb  -ml  -mdalign  -mrelax @gol
778 -mbigtable  -mfmovd  -mhitachi -mrenesas -mno-renesas -mnomacsave @gol
779 -mieee  -mbitops  -misize  -minline-ic_invalidate -mpadstruct  -mspace @gol
780 -mprefergot  -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
781 -mdivsi3_libfunc=@var{name} -mfixed-range=@var{register-range} @gol
782 -madjust-unroll -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol
783 -minvalid-symbols}
784
785 @emph{SPARC Options}
786 @gccoptlist{-mcpu=@var{cpu-type} @gol
787 -mtune=@var{cpu-type} @gol
788 -mcmodel=@var{code-model} @gol
789 -m32  -m64  -mapp-regs  -mno-app-regs @gol
790 -mfaster-structs  -mno-faster-structs @gol
791 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
792 -mhard-quad-float  -msoft-quad-float @gol
793 -mimpure-text  -mno-impure-text  -mlittle-endian @gol
794 -mstack-bias  -mno-stack-bias @gol
795 -munaligned-doubles  -mno-unaligned-doubles @gol
796 -mv8plus  -mno-v8plus  -mvis  -mno-vis
797 -threads -pthreads -pthread}
798
799 @emph{SPU Options}
800 @gccoptlist{-mwarn-reloc -merror-reloc @gol
801 -msafe-dma -munsafe-dma @gol
802 -mbranch-hints @gol
803 -msmall-mem -mlarge-mem -mstdmain @gol
804 -mfixed-range=@var{register-range}}
805
806 @emph{System V Options}
807 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
808
809 @emph{V850 Options}
810 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
811 -mprolog-function  -mno-prolog-function  -mspace @gol
812 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
813 -mapp-regs  -mno-app-regs @gol
814 -mdisable-callt  -mno-disable-callt @gol
815 -mv850e1 @gol
816 -mv850e @gol
817 -mv850  -mbig-switch}
818
819 @emph{VAX Options}
820 @gccoptlist{-mg  -mgnu  -munix}
821
822 @emph{VxWorks Options}
823 @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
824 -Xbind-lazy  -Xbind-now}
825
826 @emph{x86-64 Options}
827 See i386 and x86-64 Options.
828
829 @emph{i386 and x86-64 Windows Options}
830 @gccoptlist{-mconsole -mcygwin -mno-cygwin -mdll
831 -mnop-fun-dllimport -mthread -mwin32 -mwindows}
832
833 @emph{Xstormy16 Options}
834 @gccoptlist{-msim}
835
836 @emph{Xtensa Options}
837 @gccoptlist{-mconst16 -mno-const16 @gol
838 -mfused-madd  -mno-fused-madd @gol
839 -mserialize-volatile  -mno-serialize-volatile @gol
840 -mtext-section-literals  -mno-text-section-literals @gol
841 -mtarget-align  -mno-target-align @gol
842 -mlongcalls  -mno-longcalls}
843
844 @emph{zSeries Options}
845 See S/390 and zSeries Options.
846
847 @item Code Generation Options
848 @xref{Code Gen Options,,Options for Code Generation Conventions}.
849 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
850 -ffixed-@var{reg}  -fexceptions @gol
851 -fnon-call-exceptions  -funwind-tables @gol
852 -fasynchronous-unwind-tables @gol
853 -finhibit-size-directive  -finstrument-functions @gol
854 -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol
855 -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{} @gol
856 -fno-common  -fno-ident @gol
857 -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE @gol
858 -fno-jump-tables @gol
859 -frecord-gcc-switches @gol
860 -freg-struct-return  -fshort-enums @gol
861 -fshort-double  -fshort-wchar @gol
862 -fverbose-asm  -fpack-struct[=@var{n}]  -fstack-check @gol
863 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
864 -fno-stack-limit  -fargument-alias  -fargument-noalias @gol
865 -fargument-noalias-global  -fargument-noalias-anything @gol
866 -fleading-underscore  -ftls-model=@var{model} @gol
867 -ftrapv  -fwrapv  -fbounds-check @gol
868 -fvisibility}
869 @end table
870
871 @menu
872 * Overall Options::     Controlling the kind of output:
873                         an executable, object files, assembler files,
874                         or preprocessed source.
875 * C Dialect Options::   Controlling the variant of C language compiled.
876 * C++ Dialect Options:: Variations on C++.
877 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
878                         and Objective-C++.
879 * Language Independent Options:: Controlling how diagnostics should be
880                         formatted.
881 * Warning Options::     How picky should the compiler be?
882 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
883 * Optimize Options::    How much optimization?
884 * Preprocessor Options:: Controlling header files and macro definitions.
885                          Also, getting dependency information for Make.
886 * Assembler Options::   Passing options to the assembler.
887 * Link Options::        Specifying libraries and so on.
888 * Directory Options::   Where to find header files and libraries.
889                         Where to find the compiler executable files.
890 * Spec Files::          How to pass switches to sub-processes.
891 * Target Options::      Running a cross-compiler, or an old version of GCC.
892 @end menu
893
894 @node Overall Options
895 @section Options Controlling the Kind of Output
896
897 Compilation can involve up to four stages: preprocessing, compilation
898 proper, assembly and linking, always in that order.  GCC is capable of
899 preprocessing and compiling several files either into several
900 assembler input files, or into one assembler input file; then each
901 assembler input file produces an object file, and linking combines all
902 the object files (those newly compiled, and those specified as input)
903 into an executable file.
904
905 @cindex file name suffix
906 For any given input file, the file name suffix determines what kind of
907 compilation is done:
908
909 @table @gcctabopt
910 @item @var{file}.c
911 C source code which must be preprocessed.
912
913 @item @var{file}.i
914 C source code which should not be preprocessed.
915
916 @item @var{file}.ii
917 C++ source code which should not be preprocessed.
918
919 @item @var{file}.m
920 Objective-C source code.  Note that you must link with the @file{libobjc}
921 library to make an Objective-C program work.
922
923 @item @var{file}.mi
924 Objective-C source code which should not be preprocessed.
925
926 @item @var{file}.mm
927 @itemx @var{file}.M
928 Objective-C++ source code.  Note that you must link with the @file{libobjc}
929 library to make an Objective-C++ program work.  Note that @samp{.M} refers
930 to a literal capital M@.
931
932 @item @var{file}.mii
933 Objective-C++ source code which should not be preprocessed.
934
935 @item @var{file}.h
936 C, C++, Objective-C or Objective-C++ header file to be turned into a
937 precompiled header.
938
939 @item @var{file}.cc
940 @itemx @var{file}.cp
941 @itemx @var{file}.cxx
942 @itemx @var{file}.cpp
943 @itemx @var{file}.CPP
944 @itemx @var{file}.c++
945 @itemx @var{file}.C
946 C++ source code which must be preprocessed.  Note that in @samp{.cxx},
947 the last two letters must both be literally @samp{x}.  Likewise,
948 @samp{.C} refers to a literal capital C@.
949
950 @item @var{file}.mm
951 @itemx @var{file}.M
952 Objective-C++ source code which must be preprocessed.
953
954 @item @var{file}.mii
955 Objective-C++ source code which should not be preprocessed.
956
957 @item @var{file}.hh
958 @itemx @var{file}.H
959 @itemx @var{file}.hp
960 @itemx @var{file}.hxx
961 @itemx @var{file}.hpp
962 @itemx @var{file}.HPP
963 @itemx @var{file}.h++
964 @itemx @var{file}.tcc
965 C++ header file to be turned into a precompiled header.
966
967 @item @var{file}.f
968 @itemx @var{file}.for
969 @itemx @var{file}.ftn
970 Fixed form Fortran source code which should not be preprocessed.
971
972 @item @var{file}.F
973 @itemx @var{file}.FOR
974 @itemx @var{file}.fpp
975 @itemx @var{file}.FPP
976 @itemx @var{file}.FTN
977 Fixed form Fortran source code which must be preprocessed (with the traditional
978 preprocessor).
979
980 @item @var{file}.f90
981 @itemx @var{file}.f95
982 @itemx @var{file}.f03
983 @itemx @var{file}.f08
984 Free form Fortran source code which should not be preprocessed.
985
986 @item @var{file}.F90
987 @itemx @var{file}.F95
988 @itemx @var{file}.F03
989 @itemx @var{file}.F08
990 Free form Fortran source code which must be preprocessed (with the
991 traditional preprocessor).
992
993 @c FIXME: Descriptions of Java file types.
994 @c @var{file}.java
995 @c @var{file}.class
996 @c @var{file}.zip
997 @c @var{file}.jar
998
999 @item @var{file}.ads
1000 Ada source code file which contains a library unit declaration (a
1001 declaration of a package, subprogram, or generic, or a generic
1002 instantiation), or a library unit renaming declaration (a package,
1003 generic, or subprogram renaming declaration).  Such files are also
1004 called @dfn{specs}.
1005
1006 @item @var{file}.adb
1007 Ada source code file containing a library unit body (a subprogram or
1008 package body).  Such files are also called @dfn{bodies}.
1009
1010 @c GCC also knows about some suffixes for languages not yet included:
1011 @c Pascal:
1012 @c @var{file}.p
1013 @c @var{file}.pas
1014 @c Ratfor:
1015 @c @var{file}.r
1016
1017 @item @var{file}.s
1018 Assembler code.
1019
1020 @item @var{file}.S
1021 @itemx @var{file}.sx
1022 Assembler code which must be preprocessed.
1023
1024 @item @var{other}
1025 An object file to be fed straight into linking.
1026 Any file name with no recognized suffix is treated this way.
1027 @end table
1028
1029 @opindex x
1030 You can specify the input language explicitly with the @option{-x} option:
1031
1032 @table @gcctabopt
1033 @item -x @var{language}
1034 Specify explicitly the @var{language} for the following input files
1035 (rather than letting the compiler choose a default based on the file
1036 name suffix).  This option applies to all following input files until
1037 the next @option{-x} option.  Possible values for @var{language} are:
1038 @smallexample
1039 c  c-header  c-cpp-output
1040 c++  c++-header  c++-cpp-output
1041 objective-c  objective-c-header  objective-c-cpp-output
1042 objective-c++ objective-c++-header objective-c++-cpp-output
1043 assembler  assembler-with-cpp
1044 ada
1045 f77  f77-cpp-input f95  f95-cpp-input
1046 java
1047 @end smallexample
1048
1049 @item -x none
1050 Turn off any specification of a language, so that subsequent files are
1051 handled according to their file name suffixes (as they are if @option{-x}
1052 has not been used at all).
1053
1054 @item -pass-exit-codes
1055 @opindex pass-exit-codes
1056 Normally the @command{gcc} program will exit with the code of 1 if any
1057 phase of the compiler returns a non-success return code.  If you specify
1058 @option{-pass-exit-codes}, the @command{gcc} program will instead return with
1059 numerically highest error produced by any phase that returned an error
1060 indication.  The C, C++, and Fortran frontends return 4, if an internal
1061 compiler error is encountered.
1062 @end table
1063
1064 If you only want some of the stages of compilation, you can use
1065 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
1066 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
1067 @command{gcc} is to stop.  Note that some combinations (for example,
1068 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
1069
1070 @table @gcctabopt
1071 @item -c
1072 @opindex c
1073 Compile or assemble the source files, but do not link.  The linking
1074 stage simply is not done.  The ultimate output is in the form of an
1075 object file for each source file.
1076
1077 By default, the object file name for a source file is made by replacing
1078 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1079
1080 Unrecognized input files, not requiring compilation or assembly, are
1081 ignored.
1082
1083 @item -S
1084 @opindex S
1085 Stop after the stage of compilation proper; do not assemble.  The output
1086 is in the form of an assembler code file for each non-assembler input
1087 file specified.
1088
1089 By default, the assembler file name for a source file is made by
1090 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1091
1092 Input files that don't require compilation are ignored.
1093
1094 @item -E
1095 @opindex E
1096 Stop after the preprocessing stage; do not run the compiler proper.  The
1097 output is in the form of preprocessed source code, which is sent to the
1098 standard output.
1099
1100 Input files which don't require preprocessing are ignored.
1101
1102 @cindex output file option
1103 @item -o @var{file}
1104 @opindex o
1105 Place output in file @var{file}.  This applies regardless to whatever
1106 sort of output is being produced, whether it be an executable file,
1107 an object file, an assembler file or preprocessed C code.
1108
1109 If @option{-o} is not specified, the default is to put an executable
1110 file in @file{a.out}, the object file for
1111 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1112 assembler file in @file{@var{source}.s}, a precompiled header file in
1113 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1114 standard output.
1115
1116 @item -v
1117 @opindex v
1118 Print (on standard error output) the commands executed to run the stages
1119 of compilation.  Also print the version number of the compiler driver
1120 program and of the preprocessor and the compiler proper.
1121
1122 @item -###
1123 @opindex ###
1124 Like @option{-v} except the commands are not executed and all command
1125 arguments are quoted.  This is useful for shell scripts to capture the
1126 driver-generated command lines.
1127
1128 @item -pipe
1129 @opindex pipe
1130 Use pipes rather than temporary files for communication between the
1131 various stages of compilation.  This fails to work on some systems where
1132 the assembler is unable to read from a pipe; but the GNU assembler has
1133 no trouble.
1134
1135 @item -combine
1136 @opindex combine
1137 If you are compiling multiple source files, this option tells the driver
1138 to pass all the source files to the compiler at once (for those
1139 languages for which the compiler can handle this).  This will allow
1140 intermodule analysis (IMA) to be performed by the compiler.  Currently the only
1141 language for which this is supported is C@.  If you pass source files for
1142 multiple languages to the driver, using this option, the driver will invoke
1143 the compiler(s) that support IMA once each, passing each compiler all the
1144 source files appropriate for it.  For those languages that do not support
1145 IMA this option will be ignored, and the compiler will be invoked once for
1146 each source file in that language.  If you use this option in conjunction
1147 with @option{-save-temps}, the compiler will generate multiple
1148 pre-processed files
1149 (one for each source file), but only one (combined) @file{.o} or
1150 @file{.s} file.
1151
1152 @item --help
1153 @opindex help
1154 Print (on the standard output) a description of the command line options
1155 understood by @command{gcc}.  If the @option{-v} option is also specified
1156 then @option{--help} will also be passed on to the various processes
1157 invoked by @command{gcc}, so that they can display the command line options
1158 they accept.  If the @option{-Wextra} option has also been specified
1159 (prior to the @option{--help} option), then command line options which
1160 have no documentation associated with them will also be displayed.
1161
1162 @item --target-help
1163 @opindex target-help
1164 Print (on the standard output) a description of target-specific command
1165 line options for each tool.  For some targets extra target-specific
1166 information may also be printed.
1167
1168 @item --help=@{@var{class}@r{|[}^@r{]}@var{qualifier}@}@r{[},@dots{}@r{]}
1169 Print (on the standard output) a description of the command line
1170 options understood by the compiler that fit into all specified classes
1171 and qualifiers.  These are the supported classes:
1172
1173 @table @asis
1174 @item @samp{optimizers}
1175 This will display all of the optimization options supported by the
1176 compiler.
1177
1178 @item @samp{warnings}
1179 This will display all of the options controlling warning messages
1180 produced by the compiler.
1181
1182 @item @samp{target}
1183 This will display target-specific options.  Unlike the
1184 @option{--target-help} option however, target-specific options of the
1185 linker and assembler will not be displayed.  This is because those
1186 tools do not currently support the extended @option{--help=} syntax.
1187
1188 @item @samp{params}
1189 This will display the values recognized by the @option{--param}
1190 option.
1191
1192 @item @var{language}
1193 This will display the options supported for @var{language}, where 
1194 @var{language} is the name of one of the languages supported in this 
1195 version of GCC.
1196
1197 @item @samp{common}
1198 This will display the options that are common to all languages.
1199 @end table
1200
1201 These are the supported qualifiers:
1202
1203 @table @asis
1204 @item @samp{undocumented}
1205 Display only those options which are undocumented.
1206
1207 @item @samp{joined}
1208 Display options which take an argument that appears after an equal
1209 sign in the same continuous piece of text, such as:
1210 @samp{--help=target}.
1211
1212 @item @samp{separate}
1213 Display options which take an argument that appears as a separate word
1214 following the original option, such as: @samp{-o output-file}.
1215 @end table
1216
1217 Thus for example to display all the undocumented target-specific
1218 switches supported by the compiler the following can be used:
1219
1220 @smallexample
1221 --help=target,undocumented
1222 @end smallexample
1223
1224 The sense of a qualifier can be inverted by prefixing it with the
1225 @samp{^} character, so for example to display all binary warning
1226 options (i.e., ones that are either on or off and that do not take an
1227 argument), which have a description the following can be used:
1228
1229 @smallexample
1230 --help=warnings,^joined,^undocumented
1231 @end smallexample
1232
1233 The argument to @option{--help=} should not consist solely of inverted
1234 qualifiers.
1235
1236 Combining several classes is possible, although this usually
1237 restricts the output by so much that there is nothing to display.  One
1238 case where it does work however is when one of the classes is
1239 @var{target}.  So for example to display all the target-specific
1240 optimization options the following can be used:
1241
1242 @smallexample
1243 --help=target,optimizers
1244 @end smallexample
1245
1246 The @option{--help=} option can be repeated on the command line.  Each
1247 successive use will display its requested class of options, skipping
1248 those that have already been displayed.
1249
1250 If the @option{-Q} option appears on the command line before the
1251 @option{--help=} option, then the descriptive text displayed by
1252 @option{--help=} is changed.  Instead of describing the displayed
1253 options, an indication is given as to whether the option is enabled,
1254 disabled or set to a specific value (assuming that the compiler
1255 knows this at the point where the @option{--help=} option is used).
1256
1257 Here is a truncated example from the ARM port of @command{gcc}:
1258
1259 @smallexample
1260   % gcc -Q -mabi=2 --help=target -c
1261   The following options are target specific:
1262   -mabi=                                2
1263   -mabort-on-noreturn                   [disabled]
1264   -mapcs                                [disabled]
1265 @end smallexample
1266
1267 The output is sensitive to the effects of previous command line
1268 options, so for example it is possible to find out which optimizations
1269 are enabled at @option{-O2} by using:
1270
1271 @smallexample
1272 -Q -O2 --help=optimizers
1273 @end smallexample
1274
1275 Alternatively you can discover which binary optimizations are enabled
1276 by @option{-O3} by using:
1277
1278 @smallexample
1279 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1280 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1281 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1282 @end smallexample
1283
1284 @item --version
1285 @opindex version
1286 Display the version number and copyrights of the invoked GCC@.
1287
1288 @item -wrapper
1289 @opindex wrapper
1290 Invoke all subcommands under a wrapper program. It takes a single
1291 comma separated list as an argument, which will be used to invoke
1292 the wrapper:
1293
1294 @smallexample
1295 gcc -c t.c -wrapper gdb,--args
1296 @end smallexample
1297
1298 This will invoke all subprograms of gcc under "gdb --args",
1299 thus cc1 invocation will be "gdb --args cc1 ...".
1300
1301 @include @value{srcdir}/../libiberty/at-file.texi
1302 @end table
1303
1304 @node Invoking G++
1305 @section Compiling C++ Programs
1306
1307 @cindex suffixes for C++ source
1308 @cindex C++ source file suffixes
1309 C++ source files conventionally use one of the suffixes @samp{.C},
1310 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1311 @samp{.cxx}; C++ header files often use @samp{.hh}, @samp{.hpp},
1312 @samp{.H}, or (for shared template code) @samp{.tcc}; and
1313 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1314 files with these names and compiles them as C++ programs even if you
1315 call the compiler the same way as for compiling C programs (usually
1316 with the name @command{gcc}).
1317
1318 @findex g++
1319 @findex c++
1320 However, the use of @command{gcc} does not add the C++ library.
1321 @command{g++} is a program that calls GCC and treats @samp{.c},
1322 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1323 files unless @option{-x} is used, and automatically specifies linking
1324 against the C++ library.  This program is also useful when
1325 precompiling a C header file with a @samp{.h} extension for use in C++
1326 compilations.  On many systems, @command{g++} is also installed with
1327 the name @command{c++}.
1328
1329 @cindex invoking @command{g++}
1330 When you compile C++ programs, you may specify many of the same
1331 command-line options that you use for compiling programs in any
1332 language; or command-line options meaningful for C and related
1333 languages; or options that are meaningful only for C++ programs.
1334 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1335 explanations of options for languages related to C@.
1336 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1337 explanations of options that are meaningful only for C++ programs.
1338
1339 @node C Dialect Options
1340 @section Options Controlling C Dialect
1341 @cindex dialect options
1342 @cindex language dialect options
1343 @cindex options, dialect
1344
1345 The following options control the dialect of C (or languages derived
1346 from C, such as C++, Objective-C and Objective-C++) that the compiler
1347 accepts:
1348
1349 @table @gcctabopt
1350 @cindex ANSI support
1351 @cindex ISO support
1352 @item -ansi
1353 @opindex ansi
1354 In C mode, this is equivalent to @samp{-std=c89}. In C++ mode, it is
1355 equivalent to @samp{-std=c++98}.
1356
1357 This turns off certain features of GCC that are incompatible with ISO
1358 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1359 such as the @code{asm} and @code{typeof} keywords, and
1360 predefined macros such as @code{unix} and @code{vax} that identify the
1361 type of system you are using.  It also enables the undesirable and
1362 rarely used ISO trigraph feature.  For the C compiler,
1363 it disables recognition of C++ style @samp{//} comments as well as
1364 the @code{inline} keyword.
1365
1366 The alternate keywords @code{__asm__}, @code{__extension__},
1367 @code{__inline__} and @code{__typeof__} continue to work despite
1368 @option{-ansi}.  You would not want to use them in an ISO C program, of
1369 course, but it is useful to put them in header files that might be included
1370 in compilations done with @option{-ansi}.  Alternate predefined macros
1371 such as @code{__unix__} and @code{__vax__} are also available, with or
1372 without @option{-ansi}.
1373
1374 The @option{-ansi} option does not cause non-ISO programs to be
1375 rejected gratuitously.  For that, @option{-pedantic} is required in
1376 addition to @option{-ansi}.  @xref{Warning Options}.
1377
1378 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1379 option is used.  Some header files may notice this macro and refrain
1380 from declaring certain functions or defining certain macros that the
1381 ISO standard doesn't call for; this is to avoid interfering with any
1382 programs that might use these names for other things.
1383
1384 Functions that would normally be built in but do not have semantics
1385 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1386 functions when @option{-ansi} is used.  @xref{Other Builtins,,Other
1387 built-in functions provided by GCC}, for details of the functions
1388 affected.
1389
1390 @item -std=
1391 @opindex std
1392 Determine the language standard. @xref{Standards,,Language Standards
1393 Supported by GCC}, for details of these standard versions.  This option
1394 is currently only supported when compiling C or C++. 
1395
1396 The compiler can accept several base standards, such as @samp{c89} or
1397 @samp{c++98}, and GNU dialects of those standards, such as
1398 @samp{gnu89} or @samp{gnu++98}.  By specifying a base standard, the
1399 compiler will accept all programs following that standard and those
1400 using GNU extensions that do not contradict it.  For example,
1401 @samp{-std=c89} turns off certain features of GCC that are
1402 incompatible with ISO C90, such as the @code{asm} and @code{typeof}
1403 keywords, but not other GNU extensions that do not have a meaning in
1404 ISO C90, such as omitting the middle term of a @code{?:}
1405 expression. On the other hand, by specifying a GNU dialect of a
1406 standard, all features the compiler support are enabled, even when
1407 those features change the meaning of the base standard and some
1408 strict-conforming programs may be rejected.  The particular standard
1409 is used by @option{-pedantic} to identify which features are GNU
1410 extensions given that version of the standard. For example
1411 @samp{-std=gnu89 -pedantic} would warn about C++ style @samp{//}
1412 comments, while @samp{-std=gnu99 -pedantic} would not.
1413
1414 A value for this option must be provided; possible values are
1415
1416 @table @samp
1417 @item c89
1418 @itemx iso9899:1990
1419 Support all ISO C90 programs (certain GNU extensions that conflict
1420 with ISO C90 are disabled). Same as @option{-ansi} for C code.
1421
1422 @item iso9899:199409
1423 ISO C90 as modified in amendment 1.
1424
1425 @item c99
1426 @itemx c9x
1427 @itemx iso9899:1999
1428 @itemx iso9899:199x
1429 ISO C99.  Note that this standard is not yet fully supported; see
1430 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1431 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1432
1433 @item gnu89
1434 GNU dialect of ISO C90 (including some C99 features). This
1435 is the default for C code.
1436
1437 @item gnu99
1438 @itemx gnu9x
1439 GNU dialect of ISO C99.  When ISO C99 is fully implemented in GCC,
1440 this will become the default.  The name @samp{gnu9x} is deprecated.
1441
1442 @item c++98
1443 The 1998 ISO C++ standard plus amendments. Same as @option{-ansi} for
1444 C++ code.
1445
1446 @item gnu++98
1447 GNU dialect of @option{-std=c++98}.  This is the default for
1448 C++ code.
1449
1450 @item c++0x
1451 The working draft of the upcoming ISO C++0x standard. This option
1452 enables experimental features that are likely to be included in
1453 C++0x. The working draft is constantly changing, and any feature that is
1454 enabled by this flag may be removed from future versions of GCC if it is
1455 not part of the C++0x standard.
1456
1457 @item gnu++0x
1458 GNU dialect of @option{-std=c++0x}. This option enables
1459 experimental features that may be removed in future versions of GCC.
1460 @end table
1461
1462 @item -fgnu89-inline
1463 @opindex fgnu89-inline
1464 The option @option{-fgnu89-inline} tells GCC to use the traditional
1465 GNU semantics for @code{inline} functions when in C99 mode.
1466 @xref{Inline,,An Inline Function is As Fast As a Macro}.  This option
1467 is accepted and ignored by GCC versions 4.1.3 up to but not including
1468 4.3.  In GCC versions 4.3 and later it changes the behavior of GCC in
1469 C99 mode.  Using this option is roughly equivalent to adding the
1470 @code{gnu_inline} function attribute to all inline functions
1471 (@pxref{Function Attributes}).
1472
1473 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
1474 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
1475 specifies the default behavior).  This option was first supported in
1476 GCC 4.3.  This option is not supported in C89 or gnu89 mode.
1477
1478 The preprocessor macros @code{__GNUC_GNU_INLINE__} and
1479 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
1480 in effect for @code{inline} functions.  @xref{Common Predefined
1481 Macros,,,cpp,The C Preprocessor}.
1482
1483 @item -aux-info @var{filename}
1484 @opindex aux-info
1485 Output to the given filename prototyped declarations for all functions
1486 declared and/or defined in a translation unit, including those in header
1487 files.  This option is silently ignored in any language other than C@.
1488
1489 Besides declarations, the file indicates, in comments, the origin of
1490 each declaration (source file and line), whether the declaration was
1491 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1492 @samp{O} for old, respectively, in the first character after the line
1493 number and the colon), and whether it came from a declaration or a
1494 definition (@samp{C} or @samp{F}, respectively, in the following
1495 character).  In the case of function definitions, a K&R-style list of
1496 arguments followed by their declarations is also provided, inside
1497 comments, after the declaration.
1498
1499 @item -fno-asm
1500 @opindex fno-asm
1501 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1502 keyword, so that code can use these words as identifiers.  You can use
1503 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1504 instead.  @option{-ansi} implies @option{-fno-asm}.
1505
1506 In C++, this switch only affects the @code{typeof} keyword, since
1507 @code{asm} and @code{inline} are standard keywords.  You may want to
1508 use the @option{-fno-gnu-keywords} flag instead, which has the same
1509 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1510 switch only affects the @code{asm} and @code{typeof} keywords, since
1511 @code{inline} is a standard keyword in ISO C99.
1512
1513 @item -fno-builtin
1514 @itemx -fno-builtin-@var{function}
1515 @opindex fno-builtin
1516 @cindex built-in functions
1517 Don't recognize built-in functions that do not begin with
1518 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1519 functions provided by GCC}, for details of the functions affected,
1520 including those which are not built-in functions when @option{-ansi} or
1521 @option{-std} options for strict ISO C conformance are used because they
1522 do not have an ISO standard meaning.
1523
1524 GCC normally generates special code to handle certain built-in functions
1525 more efficiently; for instance, calls to @code{alloca} may become single
1526 instructions that adjust the stack directly, and calls to @code{memcpy}
1527 may become inline copy loops.  The resulting code is often both smaller
1528 and faster, but since the function calls no longer appear as such, you
1529 cannot set a breakpoint on those calls, nor can you change the behavior
1530 of the functions by linking with a different library.  In addition,
1531 when a function is recognized as a built-in function, GCC may use
1532 information about that function to warn about problems with calls to
1533 that function, or to generate more efficient code, even if the
1534 resulting code still contains calls to that function.  For example,
1535 warnings are given with @option{-Wformat} for bad calls to
1536 @code{printf}, when @code{printf} is built in, and @code{strlen} is
1537 known not to modify global memory.
1538
1539 With the @option{-fno-builtin-@var{function}} option
1540 only the built-in function @var{function} is
1541 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1542 function is named that is not built-in in this version of GCC, this
1543 option is ignored.  There is no corresponding
1544 @option{-fbuiltin-@var{function}} option; if you wish to enable
1545 built-in functions selectively when using @option{-fno-builtin} or
1546 @option{-ffreestanding}, you may define macros such as:
1547
1548 @smallexample
1549 #define abs(n)          __builtin_abs ((n))
1550 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1551 @end smallexample
1552
1553 @item -fhosted
1554 @opindex fhosted
1555 @cindex hosted environment
1556
1557 Assert that compilation takes place in a hosted environment.  This implies
1558 @option{-fbuiltin}.  A hosted environment is one in which the
1559 entire standard library is available, and in which @code{main} has a return
1560 type of @code{int}.  Examples are nearly everything except a kernel.
1561 This is equivalent to @option{-fno-freestanding}.
1562
1563 @item -ffreestanding
1564 @opindex ffreestanding
1565 @cindex hosted environment
1566
1567 Assert that compilation takes place in a freestanding environment.  This
1568 implies @option{-fno-builtin}.  A freestanding environment
1569 is one in which the standard library may not exist, and program startup may
1570 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1571 This is equivalent to @option{-fno-hosted}.
1572
1573 @xref{Standards,,Language Standards Supported by GCC}, for details of
1574 freestanding and hosted environments.
1575
1576 @item -fopenmp
1577 @opindex fopenmp
1578 @cindex openmp parallel
1579 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
1580 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
1581 compiler generates parallel code according to the OpenMP Application
1582 Program Interface v2.5 @w{@uref{http://www.openmp.org/}}.  This option
1583 implies @option{-pthread}, and thus is only supported on targets that
1584 have support for @option{-pthread}.
1585
1586 @item -fms-extensions
1587 @opindex fms-extensions
1588 Accept some non-standard constructs used in Microsoft header files.
1589
1590 Some cases of unnamed fields in structures and unions are only
1591 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
1592 fields within structs/unions}, for details.
1593
1594 @item -trigraphs
1595 @opindex trigraphs
1596 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
1597 options for strict ISO C conformance) implies @option{-trigraphs}.
1598
1599 @item -no-integrated-cpp
1600 @opindex no-integrated-cpp
1601 Performs a compilation in two passes: preprocessing and compiling.  This
1602 option allows a user supplied "cc1", "cc1plus", or "cc1obj" via the
1603 @option{-B} option.  The user supplied compilation step can then add in
1604 an additional preprocessing step after normal preprocessing but before
1605 compiling.  The default is to use the integrated cpp (internal cpp)
1606
1607 The semantics of this option will change if "cc1", "cc1plus", and
1608 "cc1obj" are merged.
1609
1610 @cindex traditional C language
1611 @cindex C language, traditional
1612 @item -traditional
1613 @itemx -traditional-cpp
1614 @opindex traditional-cpp
1615 @opindex traditional
1616 Formerly, these options caused GCC to attempt to emulate a pre-standard
1617 C compiler.  They are now only supported with the @option{-E} switch.
1618 The preprocessor continues to support a pre-standard mode.  See the GNU
1619 CPP manual for details.
1620
1621 @item -fcond-mismatch
1622 @opindex fcond-mismatch
1623 Allow conditional expressions with mismatched types in the second and
1624 third arguments.  The value of such an expression is void.  This option
1625 is not supported for C++.
1626
1627 @item -flax-vector-conversions
1628 @opindex flax-vector-conversions
1629 Allow implicit conversions between vectors with differing numbers of
1630 elements and/or incompatible element types.  This option should not be
1631 used for new code.
1632
1633 @item -funsigned-char
1634 @opindex funsigned-char
1635 Let the type @code{char} be unsigned, like @code{unsigned char}.
1636
1637 Each kind of machine has a default for what @code{char} should
1638 be.  It is either like @code{unsigned char} by default or like
1639 @code{signed char} by default.
1640
1641 Ideally, a portable program should always use @code{signed char} or
1642 @code{unsigned char} when it depends on the signedness of an object.
1643 But many programs have been written to use plain @code{char} and
1644 expect it to be signed, or expect it to be unsigned, depending on the
1645 machines they were written for.  This option, and its inverse, let you
1646 make such a program work with the opposite default.
1647
1648 The type @code{char} is always a distinct type from each of
1649 @code{signed char} or @code{unsigned char}, even though its behavior
1650 is always just like one of those two.
1651
1652 @item -fsigned-char
1653 @opindex fsigned-char
1654 Let the type @code{char} be signed, like @code{signed char}.
1655
1656 Note that this is equivalent to @option{-fno-unsigned-char}, which is
1657 the negative form of @option{-funsigned-char}.  Likewise, the option
1658 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
1659
1660 @item -fsigned-bitfields
1661 @itemx -funsigned-bitfields
1662 @itemx -fno-signed-bitfields
1663 @itemx -fno-unsigned-bitfields
1664 @opindex fsigned-bitfields
1665 @opindex funsigned-bitfields
1666 @opindex fno-signed-bitfields
1667 @opindex fno-unsigned-bitfields
1668 These options control whether a bit-field is signed or unsigned, when the
1669 declaration does not use either @code{signed} or @code{unsigned}.  By
1670 default, such a bit-field is signed, because this is consistent: the
1671 basic integer types such as @code{int} are signed types.
1672 @end table
1673
1674 @node C++ Dialect Options
1675 @section Options Controlling C++ Dialect
1676
1677 @cindex compiler options, C++
1678 @cindex C++ options, command line
1679 @cindex options, C++
1680 This section describes the command-line options that are only meaningful
1681 for C++ programs; but you can also use most of the GNU compiler options
1682 regardless of what language your program is in.  For example, you
1683 might compile a file @code{firstClass.C} like this:
1684
1685 @smallexample
1686 g++ -g -frepo -O -c firstClass.C
1687 @end smallexample
1688
1689 @noindent
1690 In this example, only @option{-frepo} is an option meant
1691 only for C++ programs; you can use the other options with any
1692 language supported by GCC@.
1693
1694 Here is a list of options that are @emph{only} for compiling C++ programs:
1695
1696 @table @gcctabopt
1697
1698 @item -fabi-version=@var{n}
1699 @opindex fabi-version
1700 Use version @var{n} of the C++ ABI@.  Version 2 is the version of the
1701 C++ ABI that first appeared in G++ 3.4.  Version 1 is the version of
1702 the C++ ABI that first appeared in G++ 3.2.  Version 0 will always be
1703 the version that conforms most closely to the C++ ABI specification.
1704 Therefore, the ABI obtained using version 0 will change as ABI bugs
1705 are fixed.
1706
1707 The default is version 2.
1708
1709 @item -fno-access-control
1710 @opindex fno-access-control
1711 Turn off all access checking.  This switch is mainly useful for working
1712 around bugs in the access control code.
1713
1714 @item -fcheck-new
1715 @opindex fcheck-new
1716 Check that the pointer returned by @code{operator new} is non-null
1717 before attempting to modify the storage allocated.  This check is
1718 normally unnecessary because the C++ standard specifies that
1719 @code{operator new} will only return @code{0} if it is declared
1720 @samp{throw()}, in which case the compiler will always check the
1721 return value even without this option.  In all other cases, when
1722 @code{operator new} has a non-empty exception specification, memory
1723 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
1724 @samp{new (nothrow)}.
1725
1726 @item -fconserve-space
1727 @opindex fconserve-space
1728 Put uninitialized or runtime-initialized global variables into the
1729 common segment, as C does.  This saves space in the executable at the
1730 cost of not diagnosing duplicate definitions.  If you compile with this
1731 flag and your program mysteriously crashes after @code{main()} has
1732 completed, you may have an object that is being destroyed twice because
1733 two definitions were merged.
1734
1735 This option is no longer useful on most targets, now that support has
1736 been added for putting variables into BSS without making them common.
1737
1738 @item -ffriend-injection
1739 @opindex ffriend-injection
1740 Inject friend functions into the enclosing namespace, so that they are
1741 visible outside the scope of the class in which they are declared.
1742 Friend functions were documented to work this way in the old Annotated
1743 C++ Reference Manual, and versions of G++ before 4.1 always worked
1744 that way.  However, in ISO C++ a friend function which is not declared
1745 in an enclosing scope can only be found using argument dependent
1746 lookup.  This option causes friends to be injected as they were in
1747 earlier releases.
1748
1749 This option is for compatibility, and may be removed in a future
1750 release of G++.
1751
1752 @item -fno-elide-constructors
1753 @opindex fno-elide-constructors
1754 The C++ standard allows an implementation to omit creating a temporary
1755 which is only used to initialize another object of the same type.
1756 Specifying this option disables that optimization, and forces G++ to
1757 call the copy constructor in all cases.
1758
1759 @item -fno-enforce-eh-specs
1760 @opindex fno-enforce-eh-specs
1761 Don't generate code to check for violation of exception specifications
1762 at runtime.  This option violates the C++ standard, but may be useful
1763 for reducing code size in production builds, much like defining
1764 @samp{NDEBUG}.  This does not give user code permission to throw
1765 exceptions in violation of the exception specifications; the compiler
1766 will still optimize based on the specifications, so throwing an
1767 unexpected exception will result in undefined behavior.
1768
1769 @item -ffor-scope
1770 @itemx -fno-for-scope
1771 @opindex ffor-scope
1772 @opindex fno-for-scope
1773 If @option{-ffor-scope} is specified, the scope of variables declared in
1774 a @i{for-init-statement} is limited to the @samp{for} loop itself,
1775 as specified by the C++ standard.
1776 If @option{-fno-for-scope} is specified, the scope of variables declared in
1777 a @i{for-init-statement} extends to the end of the enclosing scope,
1778 as was the case in old versions of G++, and other (traditional)
1779 implementations of C++.
1780
1781 The default if neither flag is given to follow the standard,
1782 but to allow and give a warning for old-style code that would
1783 otherwise be invalid, or have different behavior.
1784
1785 @item -fno-gnu-keywords
1786 @opindex fno-gnu-keywords
1787 Do not recognize @code{typeof} as a keyword, so that code can use this
1788 word as an identifier.  You can use the keyword @code{__typeof__} instead.
1789 @option{-ansi} implies @option{-fno-gnu-keywords}.
1790
1791 @item -fno-implicit-templates
1792 @opindex fno-implicit-templates
1793 Never emit code for non-inline templates which are instantiated
1794 implicitly (i.e.@: by use); only emit code for explicit instantiations.
1795 @xref{Template Instantiation}, for more information.
1796
1797 @item -fno-implicit-inline-templates
1798 @opindex fno-implicit-inline-templates
1799 Don't emit code for implicit instantiations of inline templates, either.
1800 The default is to handle inlines differently so that compiles with and
1801 without optimization will need the same set of explicit instantiations.
1802
1803 @item -fno-implement-inlines
1804 @opindex fno-implement-inlines
1805 To save space, do not emit out-of-line copies of inline functions
1806 controlled by @samp{#pragma implementation}.  This will cause linker
1807 errors if these functions are not inlined everywhere they are called.
1808
1809 @item -fms-extensions
1810 @opindex fms-extensions
1811 Disable pedantic warnings about constructs used in MFC, such as implicit
1812 int and getting a pointer to member function via non-standard syntax.
1813
1814 @item -fno-nonansi-builtins
1815 @opindex fno-nonansi-builtins
1816 Disable built-in declarations of functions that are not mandated by
1817 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
1818 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
1819
1820 @item -fno-operator-names
1821 @opindex fno-operator-names
1822 Do not treat the operator name keywords @code{and}, @code{bitand},
1823 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
1824 synonyms as keywords.
1825
1826 @item -fno-optional-diags
1827 @opindex fno-optional-diags
1828 Disable diagnostics that the standard says a compiler does not need to
1829 issue.  Currently, the only such diagnostic issued by G++ is the one for
1830 a name having multiple meanings within a class.
1831
1832 @item -fpermissive
1833 @opindex fpermissive
1834 Downgrade some diagnostics about nonconformant code from errors to
1835 warnings.  Thus, using @option{-fpermissive} will allow some
1836 nonconforming code to compile.
1837
1838 @item -fno-pretty-templates
1839 @opindex fno-pretty-templates
1840 When an error message refers to a specialization of a function
1841 template, the compiler will normally print the signature of the
1842 template followed by the template arguments and any typedefs or
1843 typenames in the signature (e.g. @code{void f(T) [with T = int]}
1844 rather than @code{void f(int)}) so that it's clear which template is
1845 involved.  When an error message refers to a specialization of a class
1846 template, the compiler will omit any template arguments which match
1847 the default template arguments for that template.  If either of these
1848 behaviors make it harder to understand the error message rather than
1849 easier, using @option{-fno-pretty-templates} will disable them.
1850
1851 @item -frepo
1852 @opindex frepo
1853 Enable automatic template instantiation at link time.  This option also
1854 implies @option{-fno-implicit-templates}.  @xref{Template
1855 Instantiation}, for more information.
1856
1857 @item -fno-rtti
1858 @opindex fno-rtti
1859 Disable generation of information about every class with virtual
1860 functions for use by the C++ runtime type identification features
1861 (@samp{dynamic_cast} and @samp{typeid}).  If you don't use those parts
1862 of the language, you can save some space by using this flag.  Note that
1863 exception handling uses the same information, but it will generate it as
1864 needed. The @samp{dynamic_cast} operator can still be used for casts that
1865 do not require runtime type information, i.e.@: casts to @code{void *} or to
1866 unambiguous base classes.
1867
1868 @item -fstats
1869 @opindex fstats
1870 Emit statistics about front-end processing at the end of the compilation.
1871 This information is generally only useful to the G++ development team.
1872
1873 @item -ftemplate-depth-@var{n}
1874 @opindex ftemplate-depth
1875 Set the maximum instantiation depth for template classes to @var{n}.
1876 A limit on the template instantiation depth is needed to detect
1877 endless recursions during template class instantiation.  ANSI/ISO C++
1878 conforming programs must not rely on a maximum depth greater than 17.
1879
1880 @item -fno-threadsafe-statics
1881 @opindex fno-threadsafe-statics
1882 Do not emit the extra code to use the routines specified in the C++
1883 ABI for thread-safe initialization of local statics.  You can use this
1884 option to reduce code size slightly in code that doesn't need to be
1885 thread-safe.
1886
1887 @item -fuse-cxa-atexit
1888 @opindex fuse-cxa-atexit
1889 Register destructors for objects with static storage duration with the
1890 @code{__cxa_atexit} function rather than the @code{atexit} function.
1891 This option is required for fully standards-compliant handling of static
1892 destructors, but will only work if your C library supports
1893 @code{__cxa_atexit}.
1894
1895 @item -fno-use-cxa-get-exception-ptr
1896 @opindex fno-use-cxa-get-exception-ptr
1897 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
1898 will cause @code{std::uncaught_exception} to be incorrect, but is necessary
1899 if the runtime routine is not available.
1900
1901 @item -fvisibility-inlines-hidden
1902 @opindex fvisibility-inlines-hidden
1903 This switch declares that the user does not attempt to compare
1904 pointers to inline methods where the addresses of the two functions
1905 were taken in different shared objects.
1906
1907 The effect of this is that GCC may, effectively, mark inline methods with
1908 @code{__attribute__ ((visibility ("hidden")))} so that they do not
1909 appear in the export table of a DSO and do not require a PLT indirection
1910 when used within the DSO@.  Enabling this option can have a dramatic effect
1911 on load and link times of a DSO as it massively reduces the size of the
1912 dynamic export table when the library makes heavy use of templates.
1913
1914 The behavior of this switch is not quite the same as marking the
1915 methods as hidden directly, because it does not affect static variables
1916 local to the function or cause the compiler to deduce that
1917 the function is defined in only one shared object.
1918
1919 You may mark a method as having a visibility explicitly to negate the
1920 effect of the switch for that method.  For example, if you do want to
1921 compare pointers to a particular inline method, you might mark it as
1922 having default visibility.  Marking the enclosing class with explicit
1923 visibility will have no effect.
1924
1925 Explicitly instantiated inline methods are unaffected by this option
1926 as their linkage might otherwise cross a shared library boundary.
1927 @xref{Template Instantiation}.
1928
1929 @item -fvisibility-ms-compat
1930 @opindex fvisibility-ms-compat
1931 This flag attempts to use visibility settings to make GCC's C++
1932 linkage model compatible with that of Microsoft Visual Studio.
1933
1934 The flag makes these changes to GCC's linkage model:
1935
1936 @enumerate
1937 @item
1938 It sets the default visibility to @code{hidden}, like
1939 @option{-fvisibility=hidden}.
1940
1941 @item
1942 Types, but not their members, are not hidden by default.
1943
1944 @item
1945 The One Definition Rule is relaxed for types without explicit
1946 visibility specifications which are defined in more than one different
1947 shared object: those declarations are permitted if they would have
1948 been permitted when this option was not used.
1949 @end enumerate
1950
1951 In new code it is better to use @option{-fvisibility=hidden} and
1952 export those classes which are intended to be externally visible.
1953 Unfortunately it is possible for code to rely, perhaps accidentally,
1954 on the Visual Studio behavior.
1955
1956 Among the consequences of these changes are that static data members
1957 of the same type with the same name but defined in different shared
1958 objects will be different, so changing one will not change the other;
1959 and that pointers to function members defined in different shared
1960 objects may not compare equal.  When this flag is given, it is a
1961 violation of the ODR to define types with the same name differently.
1962
1963 @item -fno-weak
1964 @opindex fno-weak
1965 Do not use weak symbol support, even if it is provided by the linker.
1966 By default, G++ will use weak symbols if they are available.  This
1967 option exists only for testing, and should not be used by end-users;
1968 it will result in inferior code and has no benefits.  This option may
1969 be removed in a future release of G++.
1970
1971 @item -nostdinc++
1972 @opindex nostdinc++
1973 Do not search for header files in the standard directories specific to
1974 C++, but do still search the other standard directories.  (This option
1975 is used when building the C++ library.)
1976 @end table
1977
1978 In addition, these optimization, warning, and code generation options
1979 have meanings only for C++ programs:
1980
1981 @table @gcctabopt
1982 @item -fno-default-inline
1983 @opindex fno-default-inline
1984 Do not assume @samp{inline} for functions defined inside a class scope.
1985 @xref{Optimize Options,,Options That Control Optimization}.  Note that these
1986 functions will have linkage like inline functions; they just won't be
1987 inlined by default.
1988
1989 @item -Wabi @r{(C, Objective-C, C++ and Objective-C++ only)}
1990 @opindex Wabi
1991 @opindex Wno-abi
1992 Warn when G++ generates code that is probably not compatible with the
1993 vendor-neutral C++ ABI@.  Although an effort has been made to warn about
1994 all such cases, there are probably some cases that are not warned about,
1995 even though G++ is generating incompatible code.  There may also be
1996 cases where warnings are emitted even though the code that is generated
1997 will be compatible.
1998
1999 You should rewrite your code to avoid these warnings if you are
2000 concerned about the fact that code generated by G++ may not be binary
2001 compatible with code generated by other compilers.
2002
2003 The known incompatibilities at this point include:
2004
2005 @itemize @bullet
2006
2007 @item
2008 Incorrect handling of tail-padding for bit-fields.  G++ may attempt to
2009 pack data into the same byte as a base class.  For example:
2010
2011 @smallexample
2012 struct A @{ virtual void f(); int f1 : 1; @};
2013 struct B : public A @{ int f2 : 1; @};
2014 @end smallexample
2015
2016 @noindent
2017 In this case, G++ will place @code{B::f2} into the same byte
2018 as@code{A::f1}; other compilers will not.  You can avoid this problem
2019 by explicitly padding @code{A} so that its size is a multiple of the
2020 byte size on your platform; that will cause G++ and other compilers to
2021 layout @code{B} identically.
2022
2023 @item
2024 Incorrect handling of tail-padding for virtual bases.  G++ does not use
2025 tail padding when laying out virtual bases.  For example:
2026
2027 @smallexample
2028 struct A @{ virtual void f(); char c1; @};
2029 struct B @{ B(); char c2; @};
2030 struct C : public A, public virtual B @{@};
2031 @end smallexample
2032
2033 @noindent
2034 In this case, G++ will not place @code{B} into the tail-padding for
2035 @code{A}; other compilers will.  You can avoid this problem by
2036 explicitly padding @code{A} so that its size is a multiple of its
2037 alignment (ignoring virtual base classes); that will cause G++ and other
2038 compilers to layout @code{C} identically.
2039
2040 @item
2041 Incorrect handling of bit-fields with declared widths greater than that
2042 of their underlying types, when the bit-fields appear in a union.  For
2043 example:
2044
2045 @smallexample
2046 union U @{ int i : 4096; @};
2047 @end smallexample
2048
2049 @noindent
2050 Assuming that an @code{int} does not have 4096 bits, G++ will make the
2051 union too small by the number of bits in an @code{int}.
2052
2053 @item
2054 Empty classes can be placed at incorrect offsets.  For example:
2055
2056 @smallexample
2057 struct A @{@};
2058
2059 struct B @{
2060   A a;
2061   virtual void f ();
2062 @};
2063
2064 struct C : public B, public A @{@};
2065 @end smallexample
2066
2067 @noindent
2068 G++ will place the @code{A} base class of @code{C} at a nonzero offset;
2069 it should be placed at offset zero.  G++ mistakenly believes that the
2070 @code{A} data member of @code{B} is already at offset zero.
2071
2072 @item
2073 Names of template functions whose types involve @code{typename} or
2074 template template parameters can be mangled incorrectly.
2075
2076 @smallexample
2077 template <typename Q>
2078 void f(typename Q::X) @{@}
2079
2080 template <template <typename> class Q>
2081 void f(typename Q<int>::X) @{@}
2082 @end smallexample
2083
2084 @noindent
2085 Instantiations of these templates may be mangled incorrectly.
2086
2087 @end itemize
2088
2089 It also warns psABI related changes.  The known psABI changes at this
2090 point include:
2091
2092 @itemize @bullet
2093
2094 @item
2095 For SYSV/x86-64, when passing union with long double, it is changed to
2096 pass in memory as specified in psABI.  For example:
2097
2098 @smallexample
2099 union U @{
2100   long double ld;
2101   int i;
2102 @};
2103 @end smallexample
2104
2105 @noindent
2106 @code{union U} will always be passed in memory.
2107
2108 @end itemize
2109
2110 @item -Wctor-dtor-privacy @r{(C++ and Objective-C++ only)}
2111 @opindex Wctor-dtor-privacy
2112 @opindex Wno-ctor-dtor-privacy
2113 Warn when a class seems unusable because all the constructors or
2114 destructors in that class are private, and it has neither friends nor
2115 public static member functions.
2116
2117 @item -Wnon-virtual-dtor @r{(C++ and Objective-C++ only)}
2118 @opindex Wnon-virtual-dtor
2119 @opindex Wno-non-virtual-dtor
2120 Warn when a class has virtual functions and accessible non-virtual
2121 destructor, in which case it would be possible but unsafe to delete
2122 an instance of a derived class through a pointer to the base class.
2123 This warning is also enabled if -Weffc++ is specified.
2124
2125 @item -Wreorder @r{(C++ and Objective-C++ only)}
2126 @opindex Wreorder
2127 @opindex Wno-reorder
2128 @cindex reordering, warning
2129 @cindex warning for reordering of member initializers
2130 Warn when the order of member initializers given in the code does not
2131 match the order in which they must be executed.  For instance:
2132
2133 @smallexample
2134 struct A @{
2135   int i;
2136   int j;
2137   A(): j (0), i (1) @{ @}
2138 @};
2139 @end smallexample
2140
2141 The compiler will rearrange the member initializers for @samp{i}
2142 and @samp{j} to match the declaration order of the members, emitting
2143 a warning to that effect.  This warning is enabled by @option{-Wall}.
2144 @end table
2145
2146 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
2147
2148 @table @gcctabopt
2149 @item -Weffc++ @r{(C++ and Objective-C++ only)}
2150 @opindex Weffc++
2151 @opindex Wno-effc++
2152 Warn about violations of the following style guidelines from Scott Meyers'
2153 @cite{Effective C++} book:
2154
2155 @itemize @bullet
2156 @item
2157 Item 11:  Define a copy constructor and an assignment operator for classes
2158 with dynamically allocated memory.
2159
2160 @item
2161 Item 12:  Prefer initialization to assignment in constructors.
2162
2163 @item
2164 Item 14:  Make destructors virtual in base classes.
2165
2166 @item
2167 Item 15:  Have @code{operator=} return a reference to @code{*this}.
2168
2169 @item
2170 Item 23:  Don't try to return a reference when you must return an object.
2171
2172 @end itemize
2173
2174 Also warn about violations of the following style guidelines from
2175 Scott Meyers' @cite{More Effective C++} book:
2176
2177 @itemize @bullet
2178 @item
2179 Item 6:  Distinguish between prefix and postfix forms of increment and
2180 decrement operators.
2181
2182 @item
2183 Item 7:  Never overload @code{&&}, @code{||}, or @code{,}.
2184
2185 @end itemize
2186
2187 When selecting this option, be aware that the standard library
2188 headers do not obey all of these guidelines; use @samp{grep -v}
2189 to filter out those warnings.
2190
2191 @item -Wstrict-null-sentinel @r{(C++ and Objective-C++ only)}
2192 @opindex Wstrict-null-sentinel
2193 @opindex Wno-strict-null-sentinel
2194 Warn also about the use of an uncasted @code{NULL} as sentinel.  When
2195 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
2196 to @code{__null}.  Although it is a null pointer constant not a null pointer,
2197 it is guaranteed to be of the same size as a pointer.  But this use is
2198 not portable across different compilers.
2199
2200 @item -Wno-non-template-friend @r{(C++ and Objective-C++ only)}
2201 @opindex Wno-non-template-friend
2202 @opindex Wnon-template-friend
2203 Disable warnings when non-templatized friend functions are declared
2204 within a template.  Since the advent of explicit template specification
2205 support in G++, if the name of the friend is an unqualified-id (i.e.,
2206 @samp{friend foo(int)}), the C++ language specification demands that the
2207 friend declare or define an ordinary, nontemplate function.  (Section
2208 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
2209 could be interpreted as a particular specialization of a templatized
2210 function.  Because this non-conforming behavior is no longer the default
2211 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
2212 check existing code for potential trouble spots and is on by default.
2213 This new compiler behavior can be turned off with
2214 @option{-Wno-non-template-friend} which keeps the conformant compiler code
2215 but disables the helpful warning.
2216
2217 @item -Wold-style-cast @r{(C++ and Objective-C++ only)}
2218 @opindex Wold-style-cast
2219 @opindex Wno-old-style-cast
2220 Warn if an old-style (C-style) cast to a non-void type is used within
2221 a C++ program.  The new-style casts (@samp{dynamic_cast},
2222 @samp{static_cast}, @samp{reinterpret_cast}, and @samp{const_cast}) are
2223 less vulnerable to unintended effects and much easier to search for.
2224
2225 @item -Woverloaded-virtual @r{(C++ and Objective-C++ only)}
2226 @opindex Woverloaded-virtual
2227 @opindex Wno-overloaded-virtual
2228 @cindex overloaded virtual fn, warning
2229 @cindex warning for overloaded virtual fn
2230 Warn when a function declaration hides virtual functions from a
2231 base class.  For example, in:
2232
2233 @smallexample
2234 struct A @{
2235   virtual void f();
2236 @};
2237
2238 struct B: public A @{
2239   void f(int);
2240 @};
2241 @end smallexample
2242
2243 the @code{A} class version of @code{f} is hidden in @code{B}, and code
2244 like:
2245
2246 @smallexample
2247 B* b;
2248 b->f();
2249 @end smallexample
2250
2251 will fail to compile.
2252
2253 @item -Wno-pmf-conversions @r{(C++ and Objective-C++ only)}
2254 @opindex Wno-pmf-conversions
2255 @opindex Wpmf-conversions
2256 Disable the diagnostic for converting a bound pointer to member function
2257 to a plain pointer.
2258
2259 @item -Wsign-promo @r{(C++ and Objective-C++ only)}
2260 @opindex Wsign-promo
2261 @opindex Wno-sign-promo
2262 Warn when overload resolution chooses a promotion from unsigned or
2263 enumerated type to a signed type, over a conversion to an unsigned type of
2264 the same size.  Previous versions of G++ would try to preserve
2265 unsignedness, but the standard mandates the current behavior.
2266
2267 @smallexample
2268 struct A @{
2269   operator int ();
2270   A& operator = (int);
2271 @};
2272
2273 main ()
2274 @{
2275   A a,b;
2276   a = b;
2277 @}
2278 @end smallexample
2279
2280 In this example, G++ will synthesize a default @samp{A& operator =
2281 (const A&);}, while cfront will use the user-defined @samp{operator =}.
2282 @end table
2283
2284 @node Objective-C and Objective-C++ Dialect Options
2285 @section Options Controlling Objective-C and Objective-C++ Dialects
2286
2287 @cindex compiler options, Objective-C and Objective-C++
2288 @cindex Objective-C and Objective-C++ options, command line
2289 @cindex options, Objective-C and Objective-C++
2290 (NOTE: This manual does not describe the Objective-C and Objective-C++
2291 languages themselves.  See @xref{Standards,,Language Standards
2292 Supported by GCC}, for references.)
2293
2294 This section describes the command-line options that are only meaningful
2295 for Objective-C and Objective-C++ programs, but you can also use most of
2296 the language-independent GNU compiler options.
2297 For example, you might compile a file @code{some_class.m} like this:
2298
2299 @smallexample
2300 gcc -g -fgnu-runtime -O -c some_class.m
2301 @end smallexample
2302
2303 @noindent
2304 In this example, @option{-fgnu-runtime} is an option meant only for
2305 Objective-C and Objective-C++ programs; you can use the other options with
2306 any language supported by GCC@.
2307
2308 Note that since Objective-C is an extension of the C language, Objective-C
2309 compilations may also use options specific to the C front-end (e.g.,
2310 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
2311 C++-specific options (e.g., @option{-Wabi}).
2312
2313 Here is a list of options that are @emph{only} for compiling Objective-C
2314 and Objective-C++ programs:
2315
2316 @table @gcctabopt
2317 @item -fconstant-string-class=@var{class-name}
2318 @opindex fconstant-string-class
2319 Use @var{class-name} as the name of the class to instantiate for each
2320 literal string specified with the syntax @code{@@"@dots{}"}.  The default
2321 class name is @code{NXConstantString} if the GNU runtime is being used, and
2322 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
2323 @option{-fconstant-cfstrings} option, if also present, will override the
2324 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
2325 to be laid out as constant CoreFoundation strings.
2326
2327 @item -fgnu-runtime
2328 @opindex fgnu-runtime
2329 Generate object code compatible with the standard GNU Objective-C
2330 runtime.  This is the default for most types of systems.
2331
2332 @item -fnext-runtime
2333 @opindex fnext-runtime
2334 Generate output compatible with the NeXT runtime.  This is the default
2335 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
2336 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
2337 used.
2338
2339 @item -fno-nil-receivers
2340 @opindex fno-nil-receivers
2341 Assume that all Objective-C message dispatches (e.g.,
2342 @code{[receiver message:arg]}) in this translation unit ensure that the receiver
2343 is not @code{nil}.  This allows for more efficient entry points in the runtime
2344 to be used.  Currently, this option is only available in conjunction with
2345 the NeXT runtime on Mac OS X 10.3 and later.
2346
2347 @item -fobjc-call-cxx-cdtors
2348 @opindex fobjc-call-cxx-cdtors
2349 For each Objective-C class, check if any of its instance variables is a
2350 C++ object with a non-trivial default constructor.  If so, synthesize a
2351 special @code{- (id) .cxx_construct} instance method that will run
2352 non-trivial default constructors on any such instance variables, in order,
2353 and then return @code{self}.  Similarly, check if any instance variable
2354 is a C++ object with a non-trivial destructor, and if so, synthesize a
2355 special @code{- (void) .cxx_destruct} method that will run
2356 all such default destructors, in reverse order.
2357
2358 The @code{- (id) .cxx_construct} and/or @code{- (void) .cxx_destruct} methods
2359 thusly generated will only operate on instance variables declared in the
2360 current Objective-C class, and not those inherited from superclasses.  It
2361 is the responsibility of the Objective-C runtime to invoke all such methods
2362 in an object's inheritance hierarchy.  The @code{- (id) .cxx_construct} methods
2363 will be invoked by the runtime immediately after a new object
2364 instance is allocated; the @code{- (void) .cxx_destruct} methods will
2365 be invoked immediately before the runtime deallocates an object instance.
2366
2367 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
2368 support for invoking the @code{- (id) .cxx_construct} and
2369 @code{- (void) .cxx_destruct} methods.
2370
2371 @item -fobjc-direct-dispatch
2372 @opindex fobjc-direct-dispatch
2373 Allow fast jumps to the message dispatcher.  On Darwin this is
2374 accomplished via the comm page.
2375
2376 @item -fobjc-exceptions
2377 @opindex fobjc-exceptions
2378 Enable syntactic support for structured exception handling in Objective-C,
2379 similar to what is offered by C++ and Java.  This option is
2380 unavailable in conjunction with the NeXT runtime on Mac OS X 10.2 and
2381 earlier.
2382
2383 @smallexample
2384   @@try @{
2385     @dots{}
2386        @@throw expr;
2387     @dots{}
2388   @}
2389   @@catch (AnObjCClass *exc) @{
2390     @dots{}
2391       @@throw expr;
2392     @dots{}
2393       @@throw;
2394     @dots{}
2395   @}
2396   @@catch (AnotherClass *exc) @{
2397     @dots{}
2398   @}
2399   @@catch (id allOthers) @{
2400     @dots{}
2401   @}
2402   @@finally @{
2403     @dots{}
2404       @@throw expr;
2405     @dots{}
2406   @}
2407 @end smallexample
2408
2409 The @code{@@throw} statement may appear anywhere in an Objective-C or
2410 Objective-C++ program; when used inside of a @code{@@catch} block, the
2411 @code{@@throw} may appear without an argument (as shown above), in which case
2412 the object caught by the @code{@@catch} will be rethrown.
2413
2414 Note that only (pointers to) Objective-C objects may be thrown and
2415 caught using this scheme.  When an object is thrown, it will be caught
2416 by the nearest @code{@@catch} clause capable of handling objects of that type,
2417 analogously to how @code{catch} blocks work in C++ and Java.  A
2418 @code{@@catch(id @dots{})} clause (as shown above) may also be provided to catch
2419 any and all Objective-C exceptions not caught by previous @code{@@catch}
2420 clauses (if any).
2421
2422 The @code{@@finally} clause, if present, will be executed upon exit from the
2423 immediately preceding @code{@@try @dots{} @@catch} section.  This will happen
2424 regardless of whether any exceptions are thrown, caught or rethrown
2425 inside the @code{@@try @dots{} @@catch} section, analogously to the behavior
2426 of the @code{finally} clause in Java.
2427
2428 There are several caveats to using the new exception mechanism:
2429
2430 @itemize @bullet
2431 @item
2432 Although currently designed to be binary compatible with @code{NS_HANDLER}-style
2433 idioms provided by the @code{NSException} class, the new
2434 exceptions can only be used on Mac OS X 10.3 (Panther) and later
2435 systems, due to additional functionality needed in the (NeXT) Objective-C
2436 runtime.
2437
2438 @item
2439 As mentioned above, the new exceptions do not support handling
2440 types other than Objective-C objects.   Furthermore, when used from
2441 Objective-C++, the Objective-C exception model does not interoperate with C++
2442 exceptions at this time.  This means you cannot @code{@@throw} an exception
2443 from Objective-C and @code{catch} it in C++, or vice versa
2444 (i.e., @code{throw @dots{} @@catch}).
2445 @end itemize
2446
2447 The @option{-fobjc-exceptions} switch also enables the use of synchronization
2448 blocks for thread-safe execution:
2449
2450 @smallexample
2451   @@synchronized (ObjCClass *guard) @{
2452     @dots{}
2453   @}
2454 @end smallexample
2455
2456 Upon entering the @code{@@synchronized} block, a thread of execution shall
2457 first check whether a lock has been placed on the corresponding @code{guard}
2458 object by another thread.  If it has, the current thread shall wait until
2459 the other thread relinquishes its lock.  Once @code{guard} becomes available,
2460 the current thread will place its own lock on it, execute the code contained in
2461 the @code{@@synchronized} block, and finally relinquish the lock (thereby
2462 making @code{guard} available to other threads).
2463
2464 Unlike Java, Objective-C does not allow for entire methods to be marked
2465 @code{@@synchronized}.  Note that throwing exceptions out of
2466 @code{@@synchronized} blocks is allowed, and will cause the guarding object
2467 to be unlocked properly.
2468
2469 @item -fobjc-gc
2470 @opindex fobjc-gc
2471 Enable garbage collection (GC) in Objective-C and Objective-C++ programs.
2472
2473 @item -freplace-objc-classes
2474 @opindex freplace-objc-classes
2475 Emit a special marker instructing @command{ld(1)} not to statically link in
2476 the resulting object file, and allow @command{dyld(1)} to load it in at
2477 run time instead.  This is used in conjunction with the Fix-and-Continue
2478 debugging mode, where the object file in question may be recompiled and
2479 dynamically reloaded in the course of program execution, without the need
2480 to restart the program itself.  Currently, Fix-and-Continue functionality
2481 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
2482 and later.
2483
2484 @item -fzero-link
2485 @opindex fzero-link
2486 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
2487 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
2488 compile time) with static class references that get initialized at load time,
2489 which improves run-time performance.  Specifying the @option{-fzero-link} flag
2490 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
2491 to be retained.  This is useful in Zero-Link debugging mode, since it allows
2492 for individual class implementations to be modified during program execution.
2493
2494 @item -gen-decls
2495 @opindex gen-decls
2496 Dump interface declarations for all classes seen in the source file to a
2497 file named @file{@var{sourcename}.decl}.
2498
2499 @item -Wassign-intercept @r{(Objective-C and Objective-C++ only)}
2500 @opindex Wassign-intercept
2501 @opindex Wno-assign-intercept
2502 Warn whenever an Objective-C assignment is being intercepted by the
2503 garbage collector.
2504
2505 @item -Wno-protocol @r{(Objective-C and Objective-C++ only)}
2506 @opindex Wno-protocol
2507 @opindex Wprotocol
2508 If a class is declared to implement a protocol, a warning is issued for
2509 every method in the protocol that is not implemented by the class.  The
2510 default behavior is to issue a warning for every method not explicitly
2511 implemented in the class, even if a method implementation is inherited
2512 from the superclass.  If you use the @option{-Wno-protocol} option, then
2513 methods inherited from the superclass are considered to be implemented,
2514 and no warning is issued for them.
2515
2516 @item -Wselector @r{(Objective-C and Objective-C++ only)}
2517 @opindex Wselector
2518 @opindex Wno-selector
2519 Warn if multiple methods of different types for the same selector are
2520 found during compilation.  The check is performed on the list of methods
2521 in the final stage of compilation.  Additionally, a check is performed
2522 for each selector appearing in a @code{@@selector(@dots{})}
2523 expression, and a corresponding method for that selector has been found
2524 during compilation.  Because these checks scan the method table only at
2525 the end of compilation, these warnings are not produced if the final
2526 stage of compilation is not reached, for example because an error is
2527 found during compilation, or because the @option{-fsyntax-only} option is
2528 being used.
2529
2530 @item -Wstrict-selector-match @r{(Objective-C and Objective-C++ only)}
2531 @opindex Wstrict-selector-match
2532 @opindex Wno-strict-selector-match
2533 Warn if multiple methods with differing argument and/or return types are
2534 found for a given selector when attempting to send a message using this
2535 selector to a receiver of type @code{id} or @code{Class}.  When this flag
2536 is off (which is the default behavior), the compiler will omit such warnings
2537 if any differences found are confined to types which share the same size
2538 and alignment.
2539
2540 @item -Wundeclared-selector @r{(Objective-C and Objective-C++ only)}
2541 @opindex Wundeclared-selector
2542 @opindex Wno-undeclared-selector
2543 Warn if a @code{@@selector(@dots{})} expression referring to an
2544 undeclared selector is found.  A selector is considered undeclared if no
2545 method with that name has been declared before the
2546 @code{@@selector(@dots{})} expression, either explicitly in an
2547 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
2548 an @code{@@implementation} section.  This option always performs its
2549 checks as soon as a @code{@@selector(@dots{})} expression is found,
2550 while @option{-Wselector} only performs its checks in the final stage of
2551 compilation.  This also enforces the coding style convention
2552 that methods and selectors must be declared before being used.
2553
2554 @item -print-objc-runtime-info
2555 @opindex print-objc-runtime-info
2556 Generate C header describing the largest structure that is passed by
2557 value, if any.
2558
2559 @end table
2560
2561 @node Language Independent Options
2562 @section Options to Control Diagnostic Messages Formatting
2563 @cindex options to control diagnostics formatting
2564 @cindex diagnostic messages
2565 @cindex message formatting
2566
2567 Traditionally, diagnostic messages have been formatted irrespective of
2568 the output device's aspect (e.g.@: its width, @dots{}).  The options described
2569 below can be used to control the diagnostic messages formatting
2570 algorithm, e.g.@: how many characters per line, how often source location
2571 information should be reported.  Right now, only the C++ front end can
2572 honor these options.  However it is expected, in the near future, that
2573 the remaining front ends would be able to digest them correctly.
2574
2575 @table @gcctabopt
2576 @item -fmessage-length=@var{n}
2577 @opindex fmessage-length
2578 Try to format error messages so that they fit on lines of about @var{n}
2579 characters.  The default is 72 characters for @command{g++} and 0 for the rest of
2580 the front ends supported by GCC@.  If @var{n} is zero, then no
2581 line-wrapping will be done; each error message will appear on a single
2582 line.
2583
2584 @opindex fdiagnostics-show-location
2585 @item -fdiagnostics-show-location=once
2586 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
2587 reporter to emit @emph{once} source location information; that is, in
2588 case the message is too long to fit on a single physical line and has to
2589 be wrapped, the source location won't be emitted (as prefix) again,
2590 over and over, in subsequent continuation lines.  This is the default
2591 behavior.
2592
2593 @item -fdiagnostics-show-location=every-line
2594 Only meaningful in line-wrapping mode.  Instructs the diagnostic
2595 messages reporter to emit the same source location information (as
2596 prefix) for physical lines that result from the process of breaking
2597 a message which is too long to fit on a single line.
2598
2599 @item -fdiagnostics-show-option
2600 @opindex fdiagnostics-show-option
2601 This option instructs the diagnostic machinery to add text to each
2602 diagnostic emitted, which indicates which command line option directly
2603 controls that diagnostic, when such an option is known to the
2604 diagnostic machinery.
2605
2606 @item -Wcoverage-mismatch
2607 @opindex Wcoverage-mismatch
2608 Warn if feedback profiles do not match when using the
2609 @option{-fprofile-use} option.
2610 If a source file was changed between @option{-fprofile-gen} and
2611 @option{-fprofile-use}, the files with the profile feedback can fail
2612 to match the source file and GCC can not use the profile feedback
2613 information.  By default, GCC emits an error message in this case.
2614 The option @option{-Wcoverage-mismatch} emits a warning instead of an
2615 error.  GCC does not use appropriate feedback profiles, so using this
2616 option can result in poorly optimized code.  This option is useful
2617 only in the case of very minor changes such as bug fixes to an
2618 existing code-base.
2619
2620 @end table
2621
2622 @node Warning Options
2623 @section Options to Request or Suppress Warnings
2624 @cindex options to control warnings
2625 @cindex warning messages
2626 @cindex messages, warning
2627 @cindex suppressing warnings
2628
2629 Warnings are diagnostic messages that report constructions which
2630 are not inherently erroneous but which are risky or suggest there
2631 may have been an error.
2632
2633 The following language-independent options do not enable specific
2634 warnings but control the kinds of diagnostics produced by GCC.
2635
2636 @table @gcctabopt
2637 @cindex syntax checking
2638 @item -fsyntax-only
2639 @opindex fsyntax-only
2640 Check the code for syntax errors, but don't do anything beyond that.
2641
2642 @item -w
2643 @opindex w
2644 Inhibit all warning messages.
2645
2646 @item -Werror
2647 @opindex Werror
2648 @opindex Wno-error
2649 Make all warnings into errors.
2650
2651 @item -Werror=
2652 @opindex Werror=
2653 @opindex Wno-error=
2654 Make the specified warning into an error.  The specifier for a warning
2655 is appended, for example @option{-Werror=switch} turns the warnings
2656 controlled by @option{-Wswitch} into errors.  This switch takes a
2657 negative form, to be used to negate @option{-Werror} for specific
2658 warnings, for example @option{-Wno-error=switch} makes
2659 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
2660 is in effect.  You can use the @option{-fdiagnostics-show-option}
2661 option to have each controllable warning amended with the option which
2662 controls it, to determine what to use with this option.
2663
2664 Note that specifying @option{-Werror=}@var{foo} automatically implies
2665 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
2666 imply anything.
2667
2668 @item -Wfatal-errors
2669 @opindex Wfatal-errors
2670 @opindex Wno-fatal-errors
2671 This option causes the compiler to abort compilation on the first error
2672 occurred rather than trying to keep going and printing further error
2673 messages.
2674
2675 @end table
2676
2677 You can request many specific warnings with options beginning
2678 @samp{-W}, for example @option{-Wimplicit} to request warnings on
2679 implicit declarations.  Each of these specific warning options also
2680 has a negative form beginning @samp{-Wno-} to turn off warnings; for
2681 example, @option{-Wno-implicit}.  This manual lists only one of the
2682 two forms, whichever is not the default.  For further,
2683 language-specific options also refer to @ref{C++ Dialect Options} and
2684 @ref{Objective-C and Objective-C++ Dialect Options}.
2685
2686 @table @gcctabopt
2687 @item -pedantic
2688 @opindex pedantic
2689 Issue all the warnings demanded by strict ISO C and ISO C++;
2690 reject all programs that use forbidden extensions, and some other
2691 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
2692 version of the ISO C standard specified by any @option{-std} option used.
2693
2694 Valid ISO C and ISO C++ programs should compile properly with or without
2695 this option (though a rare few will require @option{-ansi} or a
2696 @option{-std} option specifying the required version of ISO C)@.  However,
2697 without this option, certain GNU extensions and traditional C and C++
2698 features are supported as well.  With this option, they are rejected.
2699
2700 @option{-pedantic} does not cause warning messages for use of the
2701 alternate keywords whose names begin and end with @samp{__}.  Pedantic
2702 warnings are also disabled in the expression that follows
2703 @code{__extension__}.  However, only system header files should use
2704 these escape routes; application programs should avoid them.
2705 @xref{Alternate Keywords}.
2706
2707 Some users try to use @option{-pedantic} to check programs for strict ISO
2708 C conformance.  They soon find that it does not do quite what they want:
2709 it finds some non-ISO practices, but not all---only those for which
2710 ISO C @emph{requires} a diagnostic, and some others for which
2711 diagnostics have been added.
2712
2713 A feature to report any failure to conform to ISO C might be useful in
2714 some instances, but would require considerable additional work and would
2715 be quite different from @option{-pedantic}.  We don't have plans to
2716 support such a feature in the near future.
2717
2718 Where the standard specified with @option{-std} represents a GNU
2719 extended dialect of C, such as @samp{gnu89} or @samp{gnu99}, there is a
2720 corresponding @dfn{base standard}, the version of ISO C on which the GNU
2721 extended dialect is based.  Warnings from @option{-pedantic} are given
2722 where they are required by the base standard.  (It would not make sense
2723 for such warnings to be given only for features not in the specified GNU
2724 C dialect, since by definition the GNU dialects of C include all
2725 features the compiler supports with the given option, and there would be
2726 nothing to warn about.)
2727
2728 @item -pedantic-errors
2729 @opindex pedantic-errors
2730 Like @option{-pedantic}, except that errors are produced rather than
2731 warnings.
2732
2733 @item -Wall
2734 @opindex Wall
2735 @opindex Wno-all
2736 This enables all the warnings about constructions that some users
2737 consider questionable, and that are easy to avoid (or modify to
2738 prevent the warning), even in conjunction with macros.  This also
2739 enables some language-specific warnings described in @ref{C++ Dialect
2740 Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
2741
2742 @option{-Wall} turns on the following warning flags:
2743
2744 @gccoptlist{-Waddress   @gol
2745 -Warray-bounds @r{(only with} @option{-O2}@r{)}  @gol
2746 -Wc++0x-compat  @gol
2747 -Wchar-subscripts  @gol
2748 -Wimplicit-int  @gol
2749 -Wimplicit-function-declaration  @gol
2750 -Wcomment  @gol
2751 -Wformat   @gol
2752 -Wmain @r{(only for C/ObjC and unless} @option{-ffreestanding}@r{)}  @gol
2753 -Wmissing-braces  @gol
2754 -Wnonnull  @gol
2755 -Wparentheses  @gol
2756 -Wpointer-sign  @gol
2757 -Wreorder   @gol
2758 -Wreturn-type  @gol
2759 -Wsequence-point  @gol
2760 -Wsign-compare @r{(only in C++)}  @gol
2761 -Wstrict-aliasing  @gol
2762 -Wstrict-overflow=1  @gol
2763 -Wswitch  @gol
2764 -Wtrigraphs  @gol
2765 -Wuninitialized  @gol
2766 -Wunknown-pragmas  @gol
2767 -Wunused-function  @gol
2768 -Wunused-label     @gol
2769 -Wunused-value     @gol
2770 -Wunused-variable  @gol
2771 -Wvolatile-register-var @gol
2772 }
2773
2774 Note that some warning flags are not implied by @option{-Wall}.  Some of
2775 them warn about constructions that users generally do not consider
2776 questionable, but which occasionally you might wish to check for;
2777 others warn about constructions that are necessary or hard to avoid in
2778 some cases, and there is no simple way to modify the code to suppress
2779 the warning. Some of them are enabled by @option{-Wextra} but many of
2780 them must be enabled individually.
2781
2782 @item -Wextra
2783 @opindex W
2784 @opindex Wextra
2785 @opindex Wno-extra
2786 This enables some extra warning flags that are not enabled by
2787 @option{-Wall}. (This option used to be called @option{-W}.  The older
2788 name is still supported, but the newer name is more descriptive.)
2789
2790 @gccoptlist{-Wclobbered  @gol
2791 -Wempty-body  @gol
2792 -Wignored-qualifiers @gol
2793 -Wmissing-field-initializers  @gol
2794 -Wmissing-parameter-type @r{(C only)}  @gol
2795 -Wold-style-declaration @r{(C only)}  @gol
2796 -Woverride-init  @gol
2797 -Wsign-compare  @gol
2798 -Wtype-limits  @gol
2799 -Wuninitialized  @gol
2800 -Wunused-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)}  @gol
2801 }
2802
2803 The option @option{-Wextra} also prints warning messages for the
2804 following cases:
2805
2806 @itemize @bullet
2807
2808 @item
2809 A pointer is compared against integer zero with @samp{<}, @samp{<=},
2810 @samp{>}, or @samp{>=}.
2811
2812 @item 
2813 (C++ only) An enumerator and a non-enumerator both appear in a
2814 conditional expression.
2815
2816 @item 
2817 (C++ only) Ambiguous virtual bases.
2818
2819 @item 
2820 (C++ only) Subscripting an array which has been declared @samp{register}.
2821
2822 @item 
2823 (C++ only) Taking the address of a variable which has been declared
2824 @samp{register}.
2825
2826 @item 
2827 (C++ only) A base class is not initialized in a derived class' copy
2828 constructor.
2829
2830 @end itemize
2831
2832 @item -Wchar-subscripts
2833 @opindex Wchar-subscripts
2834 @opindex Wno-char-subscripts
2835 Warn if an array subscript has type @code{char}.  This is a common cause
2836 of error, as programmers often forget that this type is signed on some
2837 machines.
2838 This warning is enabled by @option{-Wall}.
2839
2840 @item -Wcomment
2841 @opindex Wcomment
2842 @opindex Wno-comment
2843 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
2844 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
2845 This warning is enabled by @option{-Wall}.
2846
2847 @item -Wformat
2848 @opindex Wformat
2849 @opindex Wno-format
2850 @opindex ffreestanding
2851 @opindex fno-builtin
2852 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
2853 the arguments supplied have types appropriate to the format string
2854 specified, and that the conversions specified in the format string make
2855 sense.  This includes standard functions, and others specified by format
2856 attributes (@pxref{Function Attributes}), in the @code{printf},
2857 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
2858 not in the C standard) families (or other target-specific families).
2859 Which functions are checked without format attributes having been
2860 specified depends on the standard version selected, and such checks of
2861 functions without the attribute specified are disabled by
2862 @option{-ffreestanding} or @option{-fno-builtin}.
2863
2864 The formats are checked against the format features supported by GNU
2865 libc version 2.2.  These include all ISO C90 and C99 features, as well
2866 as features from the Single Unix Specification and some BSD and GNU
2867 extensions.  Other library implementations may not support all these
2868 features; GCC does not support warning about features that go beyond a
2869 particular library's limitations.  However, if @option{-pedantic} is used
2870 with @option{-Wformat}, warnings will be given about format features not
2871 in the selected standard version (but not for @code{strfmon} formats,
2872 since those are not in any version of the C standard).  @xref{C Dialect
2873 Options,,Options Controlling C Dialect}.
2874
2875 Since @option{-Wformat} also checks for null format arguments for
2876 several functions, @option{-Wformat} also implies @option{-Wnonnull}.
2877
2878 @option{-Wformat} is included in @option{-Wall}.  For more control over some
2879 aspects of format checking, the options @option{-Wformat-y2k},
2880 @option{-Wno-format-extra-args}, @option{-Wno-format-zero-length},
2881 @option{-Wformat-nonliteral}, @option{-Wformat-security}, and
2882 @option{-Wformat=2} are available, but are not included in @option{-Wall}.
2883
2884 @item -Wformat-y2k
2885 @opindex Wformat-y2k
2886 @opindex Wno-format-y2k
2887 If @option{-Wformat} is specified, also warn about @code{strftime}
2888 formats which may yield only a two-digit year.
2889
2890 @item -Wno-format-contains-nul
2891 @opindex Wno-format-contains-nul
2892 @opindex Wformat-contains-nul
2893 If @option{-Wformat} is specified, do not warn about format strings that
2894 contain NUL bytes.
2895
2896 @item -Wno-format-extra-args
2897 @opindex Wno-format-extra-args
2898 @opindex Wformat-extra-args
2899 If @option{-Wformat} is specified, do not warn about excess arguments to a
2900 @code{printf} or @code{scanf} format function.  The C standard specifies
2901 that such arguments are ignored.
2902
2903 Where the unused arguments lie between used arguments that are
2904 specified with @samp{$} operand number specifications, normally
2905 warnings are still given, since the implementation could not know what
2906 type to pass to @code{va_arg} to skip the unused arguments.  However,
2907 in the case of @code{scanf} formats, this option will suppress the
2908 warning if the unused arguments are all pointers, since the Single
2909 Unix Specification says that such unused arguments are allowed.
2910
2911 @item -Wno-format-zero-length @r{(C and Objective-C only)}
2912 @opindex Wno-format-zero-length
2913 @opindex Wformat-zero-length
2914 If @option{-Wformat} is specified, do not warn about zero-length formats.
2915 The C standard specifies that zero-length formats are allowed.
2916
2917 @item -Wformat-nonliteral
2918 @opindex Wformat-nonliteral
2919 @opindex Wno-format-nonliteral
2920 If @option{-Wformat} is specified, also warn if the format string is not a
2921 string literal and so cannot be checked, unless the format function
2922 takes its format arguments as a @code{va_list}.
2923
2924 @item -Wformat-security
2925 @opindex Wformat-security
2926 @opindex Wno-format-security
2927 If @option{-Wformat} is specified, also warn about uses of format
2928 functions that represent possible security problems.  At present, this
2929 warns about calls to @code{printf} and @code{scanf} functions where the
2930 format string is not a string literal and there are no format arguments,
2931 as in @code{printf (foo);}.  This may be a security hole if the format
2932 string came from untrusted input and contains @samp{%n}.  (This is
2933 currently a subset of what @option{-Wformat-nonliteral} warns about, but
2934 in future warnings may be added to @option{-Wformat-security} that are not
2935 included in @option{-Wformat-nonliteral}.)
2936
2937 @item -Wformat=2
2938 @opindex Wformat=2
2939 @opindex Wno-format=2
2940 Enable @option{-Wformat} plus format checks not included in
2941 @option{-Wformat}.  Currently equivalent to @samp{-Wformat
2942 -Wformat-nonliteral -Wformat-security -Wformat-y2k}.
2943
2944 @item -Wnonnull @r{(C and Objective-C only)}
2945 @opindex Wnonnull
2946 @opindex Wno-nonnull
2947 Warn about passing a null pointer for arguments marked as
2948 requiring a non-null value by the @code{nonnull} function attribute.
2949
2950 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
2951 can be disabled with the @option{-Wno-nonnull} option.
2952
2953 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
2954 @opindex Winit-self
2955 @opindex Wno-init-self
2956 Warn about uninitialized variables which are initialized with themselves.
2957 Note this option can only be used with the @option{-Wuninitialized} option.
2958
2959 For example, GCC will warn about @code{i} being uninitialized in the
2960 following snippet only when @option{-Winit-self} has been specified:
2961 @smallexample
2962 @group
2963 int f()
2964 @{
2965   int i = i;
2966   return i;
2967 @}
2968 @end group
2969 @end smallexample
2970
2971 @item -Wimplicit-int @r{(C and Objective-C only)}
2972 @opindex Wimplicit-int
2973 @opindex Wno-implicit-int
2974 Warn when a declaration does not specify a type.
2975 This warning is enabled by @option{-Wall}.
2976
2977 @item -Wimplicit-function-declaration @r{(C and Objective-C only)}
2978 @opindex Wimplicit-function-declaration
2979 @opindex Wno-implicit-function-declaration
2980 Give a warning whenever a function is used before being declared. In
2981 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
2982 enabled by default and it is made into an error by
2983 @option{-pedantic-errors}. This warning is also enabled by
2984 @option{-Wall}.
2985
2986 @item -Wimplicit
2987 @opindex Wimplicit
2988 @opindex Wno-implicit
2989 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
2990 This warning is enabled by @option{-Wall}.
2991
2992 @item -Wignored-qualifiers @r{(C and C++ only)}
2993 @opindex Wignored-qualifiers
2994 @opindex Wno-ignored-qualifiers
2995 Warn if the return type of a function has a type qualifier
2996 such as @code{const}.  For ISO C such a type qualifier has no effect,
2997 since the value returned by a function is not an lvalue.
2998 For C++, the warning is only emitted for scalar types or @code{void}.
2999 ISO C prohibits qualified @code{void} return types on function
3000 definitions, so such return types always receive a warning
3001 even without this option.
3002
3003 This warning is also enabled by @option{-Wextra}.
3004
3005 @item -Wmain
3006 @opindex Wmain
3007 @opindex Wno-main
3008 Warn if the type of @samp{main} is suspicious.  @samp{main} should be
3009 a function with external linkage, returning int, taking either zero
3010 arguments, two, or three arguments of appropriate types.  This warning
3011 is enabled by default in C++ and is enabled by either @option{-Wall}
3012 or @option{-pedantic}.
3013
3014 @item -Wmissing-braces
3015 @opindex Wmissing-braces
3016 @opindex Wno-missing-braces
3017 Warn if an aggregate or union initializer is not fully bracketed.  In
3018 the following example, the initializer for @samp{a} is not fully
3019 bracketed, but that for @samp{b} is fully bracketed.
3020
3021 @smallexample
3022 int a[2][2] = @{ 0, 1, 2, 3 @};
3023 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
3024 @end smallexample
3025
3026 This warning is enabled by @option{-Wall}.
3027
3028 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
3029 @opindex Wmissing-include-dirs
3030 @opindex Wno-missing-include-dirs
3031 Warn if a user-supplied include directory does not exist.
3032
3033 @item -Wparentheses
3034 @opindex Wparentheses
3035 @opindex Wno-parentheses
3036 Warn if parentheses are omitted in certain contexts, such
3037 as when there is an assignment in a context where a truth value
3038 is expected, or when operators are nested whose precedence people
3039 often get confused about.
3040
3041 Also warn if a comparison like @samp{x<=y<=z} appears; this is
3042 equivalent to @samp{(x<=y ? 1 : 0) <= z}, which is a different
3043 interpretation from that of ordinary mathematical notation.
3044
3045 Also warn about constructions where there may be confusion to which
3046 @code{if} statement an @code{else} branch belongs.  Here is an example of
3047 such a case:
3048
3049 @smallexample
3050 @group
3051 @{
3052   if (a)
3053     if (b)
3054       foo ();
3055   else
3056     bar ();
3057 @}
3058 @end group
3059 @end smallexample
3060
3061 In C/C++, every @code{else} branch belongs to the innermost possible
3062 @code{if} statement, which in this example is @code{if (b)}.  This is
3063 often not what the programmer expected, as illustrated in the above
3064 example by indentation the programmer chose.  When there is the
3065 potential for this confusion, GCC will issue a warning when this flag
3066 is specified.  To eliminate the warning, add explicit braces around
3067 the innermost @code{if} statement so there is no way the @code{else}
3068 could belong to the enclosing @code{if}.  The resulting code would
3069 look like this:
3070
3071 @smallexample
3072 @group
3073 @{
3074   if (a)
3075     @{
3076       if (b)
3077         foo ();
3078       else
3079         bar ();
3080     @}
3081 @}
3082 @end group
3083 @end smallexample
3084
3085 This warning is enabled by @option{-Wall}.
3086
3087 @item -Wsequence-point
3088 @opindex Wsequence-point
3089 @opindex Wno-sequence-point
3090 Warn about code that may have undefined semantics because of violations
3091 of sequence point rules in the C and C++ standards.
3092
3093 The C and C++ standards defines the order in which expressions in a C/C++
3094 program are evaluated in terms of @dfn{sequence points}, which represent
3095 a partial ordering between the execution of parts of the program: those
3096 executed before the sequence point, and those executed after it.  These
3097 occur after the evaluation of a full expression (one which is not part
3098 of a larger expression), after the evaluation of the first operand of a
3099 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
3100 function is called (but after the evaluation of its arguments and the
3101 expression denoting the called function), and in certain other places.
3102 Other than as expressed by the sequence point rules, the order of
3103 evaluation of subexpressions of an expression is not specified.  All
3104 these rules describe only a partial order rather than a total order,
3105 since, for example, if two functions are called within one expression
3106 with no sequence point between them, the order in which the functions
3107 are called is not specified.  However, the standards committee have
3108 ruled that function calls do not overlap.
3109
3110 It is not specified when between sequence points modifications to the
3111 values of objects take effect.  Programs whose behavior depends on this
3112 have undefined behavior; the C and C++ standards specify that ``Between
3113 the previous and next sequence point an object shall have its stored
3114 value modified at most once by the evaluation of an expression.
3115 Furthermore, the prior value shall be read only to determine the value
3116 to be stored.''.  If a program breaks these rules, the results on any
3117 particular implementation are entirely unpredictable.
3118
3119 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
3120 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
3121 diagnosed by this option, and it may give an occasional false positive
3122 result, but in general it has been found fairly effective at detecting
3123 this sort of problem in programs.
3124
3125 The standard is worded confusingly, therefore there is some debate
3126 over the precise meaning of the sequence point rules in subtle cases.
3127 Links to discussions of the problem, including proposed formal
3128 definitions, may be found on the GCC readings page, at
3129 @w{@uref{http://gcc.gnu.org/readings.html}}.
3130
3131 This warning is enabled by @option{-Wall} for C and C++.
3132
3133 @item -Wreturn-type
3134 @opindex Wreturn-type
3135 @opindex Wno-return-type
3136 Warn whenever a function is defined with a return-type that defaults
3137 to @code{int}.  Also warn about any @code{return} statement with no
3138 return-value in a function whose return-type is not @code{void}
3139 (falling off the end of the function body is considered returning
3140 without a value), and about a @code{return} statement with a
3141 expression in a function whose return-type is @code{void}.
3142
3143 For C++, a function without return type always produces a diagnostic
3144 message, even when @option{-Wno-return-type} is specified.  The only
3145 exceptions are @samp{main} and functions defined in system headers.
3146
3147 This warning is enabled by @option{-Wall}.
3148
3149 @item -Wswitch
3150 @opindex Wswitch
3151 @opindex Wno-switch
3152 Warn whenever a @code{switch} statement has an index of enumerated type
3153 and lacks a @code{case} for one or more of the named codes of that
3154 enumeration.  (The presence of a @code{default} label prevents this
3155 warning.)  @code{case} labels outside the enumeration range also
3156 provoke warnings when this option is used.
3157 This warning is enabled by @option{-Wall}.
3158
3159 @item -Wswitch-default
3160 @opindex Wswitch-default
3161 @opindex Wno-switch-default
3162 Warn whenever a @code{switch} statement does not have a @code{default}
3163 case.
3164
3165 @item -Wswitch-enum
3166 @opindex Wswitch-enum
3167 @opindex Wno-switch-enum
3168 Warn whenever a @code{switch} statement has an index of enumerated type
3169 and lacks a @code{case} for one or more of the named codes of that
3170 enumeration.  @code{case} labels outside the enumeration range also
3171 provoke warnings when this option is used.
3172
3173 @item -Wsync-nand @r{(C and C++ only)}
3174 @opindex Wsync-nand
3175 @opindex Wno-sync-nand
3176 Warn when @code{__sync_fetch_and_nand} and @code{__sync_nand_and_fetch}
3177 built-in functions are used.  These functions changed semantics in GCC 4.4.
3178
3179 @item -Wtrigraphs
3180 @opindex Wtrigraphs
3181 @opindex Wno-trigraphs
3182 Warn if any trigraphs are encountered that might change the meaning of
3183 the program (trigraphs within comments are not warned about).
3184 This warning is enabled by @option{-Wall}.
3185
3186 @item -Wunused-function
3187 @opindex Wunused-function
3188 @opindex Wno-unused-function
3189 Warn whenever a static function is declared but not defined or a
3190 non-inline static function is unused.
3191 This warning is enabled by @option{-Wall}.
3192
3193 @item -Wunused-label
3194 @opindex Wunused-label
3195 @opindex Wno-unused-label
3196 Warn whenever a label is declared but not used.
3197 This warning is enabled by @option{-Wall}.
3198
3199 To suppress this warning use the @samp{unused} attribute
3200 (@pxref{Variable Attributes}).
3201
3202 @item -Wunused-parameter
3203 @opindex Wunused-parameter
3204 @opindex Wno-unused-parameter
3205 Warn whenever a function parameter is unused aside from its declaration.
3206
3207 To suppress this warning use the @samp{unused} attribute
3208 (@pxref{Variable Attributes}).
3209
3210 @item -Wunused-variable
3211 @opindex Wunused-variable
3212 @opindex Wno-unused-variable
3213 Warn whenever a local variable or non-constant static variable is unused
3214 aside from its declaration.
3215 This warning is enabled by @option{-Wall}.
3216
3217 To suppress this warning use the @samp{unused} attribute
3218 (@pxref{Variable Attributes}).
3219
3220 @item -Wunused-value
3221 @opindex Wunused-value
3222 @opindex Wno-unused-value
3223 Warn whenever a statement computes a result that is explicitly not
3224 used. To suppress this warning cast the unused expression to
3225 @samp{void}. This includes an expression-statement or the left-hand
3226 side of a comma expression that contains no side effects. For example,
3227 an expression such as @samp{x[i,j]} will cause a warning, while
3228 @samp{x[(void)i,j]} will not.
3229
3230 This warning is enabled by @option{-Wall}.
3231
3232 @item -Wunused
3233 @opindex Wunused
3234 @opindex Wno-unused
3235 All the above @option{-Wunused} options combined.
3236
3237 In order to get a warning about an unused function parameter, you must
3238 either specify @samp{-Wextra -Wunused} (note that @samp{-Wall} implies
3239 @samp{-Wunused}), or separately specify @option{-Wunused-parameter}.
3240
3241 @item -Wuninitialized
3242 @opindex Wuninitialized
3243 @opindex Wno-uninitialized
3244 Warn if an automatic variable is used without first being initialized
3245 or if a variable may be clobbered by a @code{setjmp} call. In C++,
3246 warn if a non-static reference or non-static @samp{const} member
3247 appears in a class without constructors.
3248
3249 If you want to warn about code which uses the uninitialized value of the
3250 variable in its own initializer, use the @option{-Winit-self} option.
3251
3252 These warnings occur for individual uninitialized or clobbered
3253 elements of structure, union or array variables as well as for
3254 variables which are uninitialized or clobbered as a whole.  They do
3255 not occur for variables or elements declared @code{volatile}.  Because
3256 these warnings depend on optimization, the exact variables or elements
3257 for which there are warnings will depend on the precise optimization
3258 options and version of GCC used.
3259
3260 Note that there may be no warning about a variable that is used only
3261 to compute a value that itself is never used, because such
3262 computations may be deleted by data flow analysis before the warnings
3263 are printed.
3264
3265 These warnings are made optional because GCC is not smart
3266 enough to see all the reasons why the code might be correct
3267 despite appearing to have an error.  Here is one example of how
3268 this can happen:
3269
3270 @smallexample
3271 @group
3272 @{
3273   int x;
3274   switch (y)
3275     @{
3276     case 1: x = 1;
3277       break;
3278     case 2: x = 4;
3279       break;
3280     case 3: x = 5;
3281     @}
3282   foo (x);
3283 @}
3284 @end group
3285 @end smallexample
3286
3287 @noindent
3288 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
3289 always initialized, but GCC doesn't know this.  Here is
3290 another common case:
3291
3292 @smallexample
3293 @{
3294   int save_y;
3295   if (change_y) save_y = y, y = new_y;
3296   @dots{}
3297   if (change_y) y = save_y;
3298 @}
3299 @end smallexample
3300
3301 @noindent
3302 This has no bug because @code{save_y} is used only if it is set.
3303
3304 @cindex @code{longjmp} warnings
3305 This option also warns when a non-volatile automatic variable might be
3306 changed by a call to @code{longjmp}.  These warnings as well are possible
3307 only in optimizing compilation.
3308
3309 The compiler sees only the calls to @code{setjmp}.  It cannot know
3310 where @code{longjmp} will be called; in fact, a signal handler could
3311 call it at any point in the code.  As a result, you may get a warning
3312 even when there is in fact no problem because @code{longjmp} cannot
3313 in fact be called at the place which would cause a problem.
3314
3315 Some spurious warnings can be avoided if you declare all the functions
3316 you use that never return as @code{noreturn}.  @xref{Function
3317 Attributes}.
3318
3319 This warning is enabled by @option{-Wall} or @option{-Wextra}.
3320
3321 @item -Wunknown-pragmas
3322 @opindex Wunknown-pragmas
3323 @opindex Wno-unknown-pragmas
3324 @cindex warning for unknown pragmas
3325 @cindex unknown pragmas, warning
3326 @cindex pragmas, warning of unknown
3327 Warn when a #pragma directive is encountered which is not understood by
3328 GCC@.  If this command line option is used, warnings will even be issued
3329 for unknown pragmas in system header files.  This is not the case if
3330 the warnings were only enabled by the @option{-Wall} command line option.
3331
3332 @item -Wno-pragmas
3333 @opindex Wno-pragmas
3334 @opindex Wpragmas
3335 Do not warn about misuses of pragmas, such as incorrect parameters,
3336 invalid syntax, or conflicts between pragmas.  See also
3337 @samp{-Wunknown-pragmas}.
3338
3339 @item -Wstrict-aliasing
3340 @opindex Wstrict-aliasing
3341 @opindex Wno-strict-aliasing
3342 This option is only active when @option{-fstrict-aliasing} is active.
3343 It warns about code which might break the strict aliasing rules that the
3344 compiler is using for optimization.  The warning does not catch all
3345 cases, but does attempt to catch the more common pitfalls.  It is
3346 included in @option{-Wall}.
3347 It is equivalent to @option{-Wstrict-aliasing=3}
3348
3349 @item -Wstrict-aliasing=n
3350 @opindex Wstrict-aliasing=n
3351 @opindex Wno-strict-aliasing=n
3352 This option is only active when @option{-fstrict-aliasing} is active.
3353 It warns about code which might break the strict aliasing rules that the
3354 compiler is using for optimization.
3355 Higher levels correspond to higher accuracy (fewer false positives).
3356 Higher levels also correspond to more effort, similar to the way -O works.
3357 @option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=n},
3358 with n=3.
3359
3360 Level 1: Most aggressive, quick, least accurate.
3361 Possibly useful when higher levels
3362 do not warn but -fstrict-aliasing still breaks the code, as it has very few 
3363 false negatives.  However, it has many false positives.
3364 Warns for all pointer conversions between possibly incompatible types, 
3365 even if never dereferenced.  Runs in the frontend only.
3366
3367 Level 2: Aggressive, quick, not too precise.
3368 May still have many false positives (not as many as level 1 though),
3369 and few false negatives (but possibly more than level 1).
3370 Unlike level 1, it only warns when an address is taken.  Warns about
3371 incomplete types.  Runs in the frontend only.
3372
3373 Level 3 (default for @option{-Wstrict-aliasing}): 
3374 Should have very few false positives and few false 
3375 negatives.  Slightly slower than levels 1 or 2 when optimization is enabled.
3376 Takes care of the common punn+dereference pattern in the frontend:
3377 @code{*(int*)&some_float}.
3378 If optimization is enabled, it also runs in the backend, where it deals 
3379 with multiple statement cases using flow-sensitive points-to information.
3380 Only warns when the converted pointer is dereferenced.
3381 Does not warn about incomplete types.
3382
3383 @item -Wstrict-overflow
3384 @itemx -Wstrict-overflow=@var{n}
3385 @opindex Wstrict-overflow
3386 @opindex Wno-strict-overflow
3387 This option is only active when @option{-fstrict-overflow} is active.
3388 It warns about cases where the compiler optimizes based on the
3389 assumption that signed overflow does not occur.  Note that it does not
3390 warn about all cases where the code might overflow: it only warns
3391 about cases where the compiler implements some optimization.  Thus
3392 this warning depends on the optimization level.
3393
3394 An optimization which assumes that signed overflow does not occur is
3395 perfectly safe if the values of the variables involved are such that
3396 overflow never does, in fact, occur.  Therefore this warning can
3397 easily give a false positive: a warning about code which is not
3398 actually a problem.  To help focus on important issues, several
3399 warning levels are defined.  No warnings are issued for the use of
3400 undefined signed overflow when estimating how many iterations a loop
3401 will require, in particular when determining whether a loop will be
3402 executed at all.
3403
3404 @table @gcctabopt
3405 @item -Wstrict-overflow=1
3406 Warn about cases which are both questionable and easy to avoid.  For
3407 example: @code{x + 1 > x}; with @option{-fstrict-overflow}, the
3408 compiler will simplify this to @code{1}.  This level of
3409 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
3410 are not, and must be explicitly requested.
3411
3412 @item -Wstrict-overflow=2
3413 Also warn about other cases where a comparison is simplified to a
3414 constant.  For example: @code{abs (x) >= 0}.  This can only be
3415 simplified when @option{-fstrict-overflow} is in effect, because
3416 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
3417 zero.  @option{-Wstrict-overflow} (with no level) is the same as
3418 @option{-Wstrict-overflow=2}.
3419
3420 @item -Wstrict-overflow=3
3421 Also warn about other cases where a comparison is simplified.  For
3422 example: @code{x + 1 > 1} will be simplified to @code{x > 0}.
3423
3424 @item -Wstrict-overflow=4
3425 Also warn about other simplifications not covered by the above cases.
3426 For example: @code{(x * 10) / 5} will be simplified to @code{x * 2}.
3427
3428 @item -Wstrict-overflow=5
3429 Also warn about cases where the compiler reduces the magnitude of a
3430 constant involved in a comparison.  For example: @code{x + 2 > y} will
3431 be simplified to @code{x + 1 >= y}.  This is reported only at the
3432 highest warning level because this simplification applies to many
3433 comparisons, so this warning level will give a very large number of
3434 false positives.
3435 @end table
3436
3437 @item -Warray-bounds
3438 @opindex Wno-array-bounds
3439 @opindex Warray-bounds
3440 This option is only active when @option{-ftree-vrp} is active
3441 (default for -O2 and above). It warns about subscripts to arrays
3442 that are always out of bounds. This warning is enabled by @option{-Wall}.
3443
3444 @item -Wno-div-by-zero
3445 @opindex Wno-div-by-zero
3446 @opindex Wdiv-by-zero
3447 Do not warn about compile-time integer division by zero.  Floating point
3448 division by zero is not warned about, as it can be a legitimate way of
3449 obtaining infinities and NaNs.
3450
3451 @item -Wsystem-headers
3452 @opindex Wsystem-headers
3453 @opindex Wno-system-headers
3454 @cindex warnings from system headers
3455 @cindex system headers, warnings from
3456 Print warning messages for constructs found in system header files.
3457 Warnings from system headers are normally suppressed, on the assumption
3458 that they usually do not indicate real problems and would only make the
3459 compiler output harder to read.  Using this command line option tells
3460 GCC to emit warnings from system headers as if they occurred in user
3461 code.  However, note that using @option{-Wall} in conjunction with this
3462 option will @emph{not} warn about unknown pragmas in system
3463 headers---for that, @option{-Wunknown-pragmas} must also be used.
3464
3465 @item -Wfloat-equal
3466 @opindex Wfloat-equal
3467 @opindex Wno-float-equal
3468 Warn if floating point values are used in equality comparisons.
3469
3470 The idea behind this is that sometimes it is convenient (for the
3471 programmer) to consider floating-point values as approximations to
3472 infinitely precise real numbers.  If you are doing this, then you need
3473 to compute (by analyzing the code, or in some other way) the maximum or
3474 likely maximum error that the computation introduces, and allow for it
3475 when performing comparisons (and when producing output, but that's a
3476 different problem).  In particular, instead of testing for equality, you
3477 would check to see whether the two values have ranges that overlap; and
3478 this is done with the relational operators, so equality comparisons are
3479 probably mistaken.
3480
3481 @item -Wtraditional @r{(C and Objective-C only)}
3482 @opindex Wtraditional
3483 @opindex Wno-traditional
3484 Warn about certain constructs that behave differently in traditional and
3485 ISO C@.  Also warn about ISO C constructs that have no traditional C
3486 equivalent, and/or problematic constructs which should be avoided.
3487
3488 @itemize @bullet
3489 @item
3490 Macro parameters that appear within string literals in the macro body.
3491 In traditional C macro replacement takes place within string literals,
3492 but does not in ISO C@.
3493
3494 @item
3495 In traditional C, some preprocessor directives did not exist.
3496 Traditional preprocessors would only consider a line to be a directive
3497 if the @samp{#} appeared in column 1 on the line.  Therefore
3498 @option{-Wtraditional} warns about directives that traditional C
3499 understands but would ignore because the @samp{#} does not appear as the
3500 first character on the line.  It also suggests you hide directives like
3501 @samp{#pragma} not understood by traditional C by indenting them.  Some
3502 traditional implementations would not recognize @samp{#elif}, so it
3503 suggests avoiding it altogether.
3504
3505 @item
3506 A function-like macro that appears without arguments.
3507
3508 @item
3509 The unary plus operator.
3510
3511 @item
3512 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating point
3513 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
3514 constants.)  Note, these suffixes appear in macros defined in the system
3515 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
3516 Use of these macros in user code might normally lead to spurious
3517 warnings, however GCC's integrated preprocessor has enough context to
3518 avoid warning in these cases.
3519
3520 @item
3521 A function declared external in one block and then used after the end of
3522 the block.
3523
3524 @item
3525 A @code{switch} statement has an operand of type @code{long}.
3526
3527 @item
3528 A non-@code{static} function declaration follows a @code{static} one.
3529 This construct is not accepted by some traditional C compilers.
3530
3531 @item
3532 The ISO type of an integer constant has a different width or
3533 signedness from its traditional type.  This warning is only issued if
3534 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
3535 typically represent bit patterns, are not warned about.
3536
3537 @item
3538 Usage of ISO string concatenation is detected.
3539
3540 @item
3541 Initialization of automatic aggregates.
3542
3543 @item
3544 Identifier conflicts with labels.  Traditional C lacks a separate
3545 namespace for labels.
3546
3547 @item
3548 Initialization of unions.  If the initializer is zero, the warning is
3549 omitted.  This is done under the assumption that the zero initializer in
3550 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
3551 initializer warnings and relies on default initialization to zero in the
3552 traditional C case.
3553
3554 @item
3555 Conversions by prototypes between fixed/floating point values and vice
3556 versa.  The absence of these prototypes when compiling with traditional
3557 C would cause serious problems.  This is a subset of the possible
3558 conversion warnings, for the full set use @option{-Wtraditional-conversion}.
3559
3560 @item
3561 Use of ISO C style function definitions.  This warning intentionally is
3562 @emph{not} issued for prototype declarations or variadic functions
3563 because these ISO C features will appear in your code when using
3564 libiberty's traditional C compatibility macros, @code{PARAMS} and
3565 @code{VPARAMS}.  This warning is also bypassed for nested functions
3566 because that feature is already a GCC extension and thus not relevant to
3567 traditional C compatibility.
3568 @end itemize
3569
3570 @item -Wtraditional-conversion @r{(C and Objective-C only)}
3571 @opindex Wtraditional-conversion
3572 @opindex Wno-traditional-conversion
3573 Warn if a prototype causes a type conversion that is different from what
3574 would happen to the same argument in the absence of a prototype.  This
3575 includes conversions of fixed point to floating and vice versa, and
3576 conversions changing the width or signedness of a fixed point argument
3577 except when the same as the default promotion.
3578
3579 @item -Wdeclaration-after-statement @r{(C and Objective-C only)}
3580 @opindex Wdeclaration-after-statement
3581 @opindex Wno-declaration-after-statement
3582 Warn when a declaration is found after a statement in a block.  This
3583 construct, known from C++, was introduced with ISO C99 and is by default
3584 allowed in GCC@.  It is not supported by ISO C90 and was not supported by
3585 GCC versions before GCC 3.0.  @xref{Mixed Declarations}.
3586
3587 @item -Wundef
3588 @opindex Wundef
3589 @opindex Wno-undef
3590 Warn if an undefined identifier is evaluated in an @samp{#if} directive.
3591
3592 @item -Wno-endif-labels
3593 @opindex Wno-endif-labels
3594 @opindex Wendif-labels
3595 Do not warn whenever an @samp{#else} or an @samp{#endif} are followed by text.
3596
3597 @item -Wshadow
3598 @opindex Wshadow
3599 @opindex Wno-shadow
3600 Warn whenever a local variable shadows another local variable, parameter or
3601 global variable or whenever a built-in function is shadowed.
3602
3603 @item -Wlarger-than=@var{len}
3604 @opindex Wlarger-than=@var{len}
3605 @opindex Wlarger-than-@var{len}
3606 Warn whenever an object of larger than @var{len} bytes is defined.
3607
3608 @item -Wframe-larger-than=@var{len}
3609 @opindex Wframe-larger-than
3610 Warn if the size of a function frame is larger than @var{len} bytes.
3611 The computation done to determine the stack frame size is approximate
3612 and not conservative.
3613 The actual requirements may be somewhat greater than @var{len}
3614 even if you do not get a warning.  In addition, any space allocated
3615 via @code{alloca}, variable-length arrays, or related constructs
3616 is not included by the compiler when determining
3617 whether or not to issue a warning.
3618
3619 @item -Wunsafe-loop-optimizations
3620 @opindex Wunsafe-loop-optimizations
3621 @opindex Wno-unsafe-loop-optimizations
3622 Warn if the loop cannot be optimized because the compiler could not
3623 assume anything on the bounds of the loop indices.  With
3624 @option{-funsafe-loop-optimizations} warn if the compiler made
3625 such assumptions.
3626
3627 @item -Wno-pedantic-ms-format @r{(MinGW targets only)}
3628 @opindex Wno-pedantic-ms-format
3629 @opindex Wpedantic-ms-format
3630 Disables the warnings about non-ISO @code{printf} / @code{scanf} format
3631 width specifiers @code{I32}, @code{I64}, and @code{I} used on Windows targets
3632 depending on the MS runtime, when you are using the options @option{-Wformat}
3633 and @option{-pedantic} without gnu-extensions.
3634
3635 @item -Wpointer-arith
3636 @opindex Wpointer-arith
3637 @opindex Wno-pointer-arith
3638 Warn about anything that depends on the ``size of'' a function type or
3639 of @code{void}.  GNU C assigns these types a size of 1, for
3640 convenience in calculations with @code{void *} pointers and pointers
3641 to functions.  In C++, warn also when an arithmetic operation involves
3642 @code{NULL}.  This warning is also enabled by @option{-pedantic}.
3643
3644 @item -Wtype-limits
3645 @opindex Wtype-limits
3646 @opindex Wno-type-limits
3647 Warn if a comparison is always true or always false due to the limited
3648 range of the data type, but do not warn for constant expressions.  For
3649 example, warn if an unsigned variable is compared against zero with
3650 @samp{<} or @samp{>=}.  This warning is also enabled by
3651 @option{-Wextra}.
3652
3653 @item -Wbad-function-cast @r{(C and Objective-C only)}
3654 @opindex Wbad-function-cast
3655 @opindex Wno-bad-function-cast
3656 Warn whenever a function call is cast to a non-matching type.
3657 For example, warn if @code{int malloc()} is cast to @code{anything *}.
3658
3659 @item -Wc++-compat @r{(C and Objective-C only)}
3660 Warn about ISO C constructs that are outside of the common subset of
3661 ISO C and ISO C++, e.g.@: request for implicit conversion from
3662 @code{void *} to a pointer to non-@code{void} type.
3663
3664 @item -Wc++0x-compat @r{(C++ and Objective-C++ only)}
3665 Warn about C++ constructs whose meaning differs between ISO C++ 1998 and
3666 ISO C++ 200x, e.g., identifiers in ISO C++ 1998 that will become keywords
3667 in ISO C++ 200x.  This warning is enabled by @option{-Wall}.
3668
3669 @item -Wcast-qual
3670 @opindex Wcast-qual
3671 @opindex Wno-cast-qual
3672 Warn whenever a pointer is cast so as to remove a type qualifier from
3673 the target type.  For example, warn if a @code{const char *} is cast
3674 to an ordinary @code{char *}.
3675
3676 @item -Wcast-align
3677 @opindex Wcast-align
3678 @opindex Wno-cast-align
3679 Warn whenever a pointer is cast such that the required alignment of the
3680 target is increased.  For example, warn if a @code{char *} is cast to
3681 an @code{int *} on machines where integers can only be accessed at
3682 two- or four-byte boundaries.
3683
3684 @item -Wwrite-strings
3685 @opindex Wwrite-strings
3686 @opindex Wno-write-strings
3687 When compiling C, give string constants the type @code{const
3688 char[@var{length}]} so that copying the address of one into a
3689 non-@code{const} @code{char *} pointer will get a warning.  These
3690 warnings will help you find at compile time code that can try to write
3691 into a string constant, but only if you have been very careful about
3692 using @code{const} in declarations and prototypes.  Otherwise, it will
3693 just be a nuisance. This is why we did not make @option{-Wall} request
3694 these warnings.
3695
3696 When compiling C++, warn about the deprecated conversion from string
3697 literals to @code{char *}.  This warning is enabled by default for C++
3698 programs.
3699
3700 @item -Wclobbered
3701 @opindex Wclobbered
3702 @opindex Wno-clobbered
3703 Warn for variables that might be changed by @samp{longjmp} or
3704 @samp{vfork}.  This warning is also enabled by @option{-Wextra}.
3705
3706 @item -Wconversion
3707 @opindex Wconversion
3708 @opindex Wno-conversion
3709 Warn for implicit conversions that may alter a value. This includes
3710 conversions between real and integer, like @code{abs (x)} when
3711 @code{x} is @code{double}; conversions between signed and unsigned,
3712 like @code{unsigned ui = -1}; and conversions to smaller types, like
3713 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
3714 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
3715 changed by the conversion like in @code{abs (2.0)}.  Warnings about
3716 conversions between signed and unsigned integers can be disabled by
3717 using @option{-Wno-sign-conversion}.
3718
3719 For C++, also warn for conversions between @code{NULL} and non-pointer
3720 types; confusing overload resolution for user-defined conversions; and
3721 conversions that will never use a type conversion operator:
3722 conversions to @code{void}, the same type, a base class or a reference
3723 to them. Warnings about conversions between signed and unsigned
3724 integers are disabled by default in C++ unless
3725 @option{-Wsign-conversion} is explicitly enabled.
3726
3727 @item -Wempty-body
3728 @opindex Wempty-body
3729 @opindex Wno-empty-body
3730 Warn if an empty body occurs in an @samp{if}, @samp{else} or @samp{do
3731 while} statement.  This warning is also enabled by @option{-Wextra}.
3732
3733 @item -Wenum-compare @r{(C++ and Objective-C++ only)}
3734 @opindex Wenum-compare
3735 @opindex Wno-enum-compare
3736 Warn about a comparison between values of different enum types. This
3737 warning is enabled by default.
3738
3739 @item -Wsign-compare
3740 @opindex Wsign-compare
3741 @opindex Wno-sign-compare
3742 @cindex warning for comparison of signed and unsigned values
3743 @cindex comparison of signed and unsigned values, warning
3744 @cindex signed and unsigned values, comparison warning
3745 Warn when a comparison between signed and unsigned values could produce
3746 an incorrect result when the signed value is converted to unsigned.
3747 This warning is also enabled by @option{-Wextra}; to get the other warnings
3748 of @option{-Wextra} without this warning, use @samp{-Wextra -Wno-sign-compare}.
3749
3750 @item -Wsign-conversion
3751 @opindex Wsign-conversion
3752 @opindex Wno-sign-conversion
3753 Warn for implicit conversions that may change the sign of an integer
3754 value, like assigning a signed integer expression to an unsigned
3755 integer variable. An explicit cast silences the warning. In C, this
3756 option is enabled also by @option{-Wconversion}.
3757
3758 @item -Waddress
3759 @opindex Waddress
3760 @opindex Wno-address
3761 Warn about suspicious uses of memory addresses. These include using
3762 the address of a function in a conditional expression, such as
3763 @code{void func(void); if (func)}, and comparisons against the memory
3764 address of a string literal, such as @code{if (x == "abc")}.  Such
3765 uses typically indicate a programmer error: the address of a function
3766 always evaluates to true, so their use in a conditional usually
3767 indicate that the programmer forgot the parentheses in a function
3768 call; and comparisons against string literals result in unspecified
3769 behavior and are not portable in C, so they usually indicate that the
3770 programmer intended to use @code{strcmp}.  This warning is enabled by
3771 @option{-Wall}.
3772
3773 @item -Wlogical-op
3774 @opindex Wlogical-op
3775 @opindex Wno-logical-op
3776 Warn about suspicious uses of logical operators in expressions.
3777 This includes using logical operators in contexts where a
3778 bit-wise operator is likely to be expected.
3779
3780 @item -Waggregate-return
3781 @opindex Waggregate-return
3782 @opindex Wno-aggregate-return
3783 Warn if any functions that return structures or unions are defined or
3784 called.  (In languages where you can return an array, this also elicits
3785 a warning.)
3786
3787 @item -Wno-attributes
3788 @opindex Wno-attributes
3789 @opindex Wattributes
3790 Do not warn if an unexpected @code{__attribute__} is used, such as
3791 unrecognized attributes, function attributes applied to variables,
3792 etc.  This will not stop errors for incorrect use of supported
3793 attributes.
3794
3795 @item -Wno-builtin-macro-redefined
3796 @opindex Wno-builtin-macro-redefined
3797 @opindex Wbuiltin-macro-redefined
3798 Do not warn if certain built-in macros are redefined.  This suppresses
3799 warnings for redefinition of @code{__TIMESTAMP__}, @code{__TIME__},
3800 @code{__DATE__}, @code{__FILE__}, and @code{__BASE_FILE__}.
3801
3802 @item -Wstrict-prototypes @r{(C and Objective-C only)}
3803 @opindex Wstrict-prototypes
3804 @opindex Wno-strict-prototypes
3805 Warn if a function is declared or defined without specifying the
3806 argument types.  (An old-style function definition is permitted without
3807 a warning if preceded by a declaration which specifies the argument
3808 types.)
3809
3810 @item -Wold-style-declaration @r{(C and Objective-C only)}
3811 @opindex Wold-style-declaration
3812 @opindex Wno-old-style-declaration
3813 Warn for obsolescent usages, according to the C Standard, in a
3814 declaration. For example, warn if storage-class specifiers like
3815 @code{static} are not the first things in a declaration.  This warning
3816 is also enabled by @option{-Wextra}.
3817
3818 @item -Wold-style-definition @r{(C and Objective-C only)}
3819 @opindex Wold-style-definition
3820 @opindex Wno-old-style-definition
3821 Warn if an old-style function definition is used.  A warning is given
3822 even if there is a previous prototype.
3823
3824 @item -Wmissing-parameter-type @r{(C and Objective-C only)}
3825 @opindex Wmissing-parameter-type
3826 @opindex Wno-missing-parameter-type
3827 A function parameter is declared without a type specifier in K&R-style
3828 functions:
3829
3830 @smallexample
3831 void foo(bar) @{ @}
3832 @end smallexample
3833
3834 This warning is also enabled by @option{-Wextra}.
3835
3836 @item -Wmissing-prototypes @r{(C and Objective-C only)}
3837 @opindex Wmissing-prototypes
3838 @opindex Wno-missing-prototypes
3839 Warn if a global function is defined without a previous prototype
3840 declaration.  This warning is issued even if the definition itself
3841 provides a prototype.  The aim is to detect global functions that fail
3842 to be declared in header files.
3843
3844 @item -Wmissing-declarations
3845 @opindex Wmissing-declarations
3846 @opindex Wno-missing-declarations
3847 Warn if a global function is defined without a previous declaration.
3848 Do so even if the definition itself provides a prototype.
3849 Use this option to detect global functions that are not declared in
3850 header files.  In C++, no warnings are issued for function templates,
3851 or for inline functions, or for functions in anonymous namespaces.
3852
3853 @item -Wmissing-field-initializers
3854 @opindex Wmissing-field-initializers
3855 @opindex Wno-missing-field-initializers
3856 @opindex W
3857 @opindex Wextra
3858 @opindex Wno-extra
3859 Warn if a structure's initializer has some fields missing.  For
3860 example, the following code would cause such a warning, because
3861 @code{x.h} is implicitly zero:
3862
3863 @smallexample
3864 struct s @{ int f, g, h; @};
3865 struct s x = @{ 3, 4 @};
3866 @end smallexample
3867
3868 This option does not warn about designated initializers, so the following
3869 modification would not trigger a warning:
3870
3871 @smallexample
3872 struct s @{ int f, g, h; @};
3873 struct s x = @{ .f = 3, .g = 4 @};
3874 @end smallexample
3875
3876 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
3877 warnings without this one, use @samp{-Wextra -Wno-missing-field-initializers}.
3878
3879 @item -Wmissing-noreturn
3880 @opindex Wmissing-noreturn
3881 @opindex Wno-missing-noreturn
3882 Warn about functions which might be candidates for attribute @code{noreturn}.
3883 Note these are only possible candidates, not absolute ones.  Care should
3884 be taken to manually verify functions actually do not ever return before
3885 adding the @code{noreturn} attribute, otherwise subtle code generation
3886 bugs could be introduced.  You will not get a warning for @code{main} in
3887 hosted C environments.
3888
3889 @item -Wmissing-format-attribute
3890 @opindex Wmissing-format-attribute
3891 @opindex Wno-missing-format-attribute
3892 @opindex Wformat
3893 @opindex Wno-format
3894 Warn about function pointers which might be candidates for @code{format}
3895 attributes.  Note these are only possible candidates, not absolute ones.
3896 GCC will guess that function pointers with @code{format} attributes that
3897 are used in assignment, initialization, parameter passing or return
3898 statements should have a corresponding @code{format} attribute in the
3899 resulting type.  I.e.@: the left-hand side of the assignment or
3900 initialization, the type of the parameter variable, or the return type
3901 of the containing function respectively should also have a @code{format}
3902 attribute to avoid the warning.
3903
3904 GCC will also warn about function definitions which might be
3905 candidates for @code{format} attributes.  Again, these are only
3906 possible candidates.  GCC will guess that @code{format} attributes
3907 might be appropriate for any function that calls a function like
3908 @code{vprintf} or @code{vscanf}, but this might not always be the
3909 case, and some functions for which @code{format} attributes are
3910 appropriate may not be detected.
3911
3912 @item -Wno-multichar
3913 @opindex Wno-multichar
3914 @opindex Wmultichar
3915 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
3916 Usually they indicate a typo in the user's code, as they have
3917 implementation-defined values, and should not be used in portable code.
3918
3919 @item -Wnormalized=<none|id|nfc|nfkc>
3920 @opindex Wnormalized=
3921 @cindex NFC
3922 @cindex NFKC
3923 @cindex character set, input normalization
3924 In ISO C and ISO C++, two identifiers are different if they are
3925 different sequences of characters.  However, sometimes when characters
3926 outside the basic ASCII character set are used, you can have two
3927 different character sequences that look the same.  To avoid confusion,
3928 the ISO 10646 standard sets out some @dfn{normalization rules} which
3929 when applied ensure that two sequences that look the same are turned into
3930 the same sequence.  GCC can warn you if you are using identifiers which
3931 have not been normalized; this option controls that warning.
3932
3933 There are four levels of warning that GCC supports.  The default is
3934 @option{-Wnormalized=nfc}, which warns about any identifier which is
3935 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
3936 recommended form for most uses.
3937
3938 Unfortunately, there are some characters which ISO C and ISO C++ allow
3939 in identifiers that when turned into NFC aren't allowable as
3940 identifiers.  That is, there's no way to use these symbols in portable
3941 ISO C or C++ and have all your identifiers in NFC@.
3942 @option{-Wnormalized=id} suppresses the warning for these characters.
3943 It is hoped that future versions of the standards involved will correct
3944 this, which is why this option is not the default.
3945
3946 You can switch the warning off for all characters by writing
3947 @option{-Wnormalized=none}.  You would only want to do this if you
3948 were using some other normalization scheme (like ``D''), because
3949 otherwise you can easily create bugs that are literally impossible to see.
3950
3951 Some characters in ISO 10646 have distinct meanings but look identical
3952 in some fonts or display methodologies, especially once formatting has
3953 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
3954 LETTER N'', will display just like a regular @code{n} which has been
3955 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
3956 normalization scheme to convert all these into a standard form as
3957 well, and GCC will warn if your code is not in NFKC if you use
3958 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
3959 about every identifier that contains the letter O because it might be
3960 confused with the digit 0, and so is not the default, but may be
3961 useful as a local coding convention if the programming environment is
3962 unable to be fixed to display these characters distinctly.
3963
3964 @item -Wno-deprecated
3965 @opindex Wno-deprecated
3966 @opindex Wdeprecated
3967 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
3968
3969 @item -Wno-deprecated-declarations
3970 @opindex Wno-deprecated-declarations
3971 @opindex Wdeprecated-declarations
3972 Do not warn about uses of functions (@pxref{Function Attributes}),
3973 variables (@pxref{Variable Attributes}), and types (@pxref{Type
3974 Attributes}) marked as deprecated by using the @code{deprecated}
3975 attribute.
3976
3977 @item -Wno-overflow
3978 @opindex Wno-overflow
3979 @opindex Woverflow
3980 Do not warn about compile-time overflow in constant expressions.
3981
3982 @item -Woverride-init @r{(C and Objective-C only)}
3983 @opindex Woverride-init
3984 @opindex Wno-override-init
3985 @opindex W
3986 @opindex Wextra
3987 @opindex Wno-extra
3988 Warn if an initialized field without side effects is overridden when
3989 using designated initializers (@pxref{Designated Inits, , Designated
3990 Initializers}).
3991
3992 This warning is included in @option{-Wextra}.  To get other
3993 @option{-Wextra} warnings without this one, use @samp{-Wextra
3994 -Wno-override-init}.
3995
3996 @item -Wpacked
3997 @opindex Wpacked
3998 @opindex Wno-packed
3999 Warn if a structure is given the packed attribute, but the packed
4000 attribute has no effect on the layout or size of the structure.
4001 Such structures may be mis-aligned for little benefit.  For
4002 instance, in this code, the variable @code{f.x} in @code{struct bar}
4003 will be misaligned even though @code{struct bar} does not itself
4004 have the packed attribute:
4005
4006 @smallexample
4007 @group
4008 struct foo @{
4009   int x;
4010   char a, b, c, d;
4011 @} __attribute__((packed));
4012 struct bar @{
4013   char z;
4014   struct foo f;
4015 @};
4016 @end group
4017 @end smallexample
4018
4019 @item -Wpacked-bitfield-compat
4020 @opindex Wpacked-bitfield-compat
4021 @opindex Wno-packed-bitfield-compat
4022 The 4.1, 4.2 and 4.3 series of GCC ignore the @code{packed} attribute
4023 on bit-fields of type @code{char}.  This has been fixed in GCC 4.4 but
4024 the change can lead to differences in the structure layout.  GCC
4025 informs you when the offset of such a field has changed in GCC 4.4.
4026 For example there is no longer a 4-bit padding between field @code{a}
4027 and @code{b} in this structure:
4028
4029 @smallexample
4030 struct foo
4031 @{
4032   char a:4;
4033   char b:8;
4034 @} __attribute__ ((packed));
4035 @end smallexample
4036
4037 This warning is enabled by default.  Use
4038 @option{-Wno-packed-bitfield-compat} to disable this warning.
4039
4040 @item -Wpadded
4041 @opindex Wpadded
4042 @opindex Wno-padded
4043 Warn if padding is included in a structure, either to align an element
4044 of the structure or to align the whole structure.  Sometimes when this
4045 happens it is possible to rearrange the fields of the structure to
4046 reduce the padding and so make the structure smaller.
4047
4048 @item -Wredundant-decls
4049 @opindex Wredundant-decls
4050 @opindex Wno-redundant-decls
4051 Warn if anything is declared more than once in the same scope, even in
4052 cases where multiple declaration is valid and changes nothing.
4053
4054 @item -Wnested-externs @r{(C and Objective-C only)}
4055 @opindex Wnested-externs
4056 @opindex Wno-nested-externs
4057 Warn if an @code{extern} declaration is encountered within a function.
4058
4059 @item -Wunreachable-code
4060 @opindex Wunreachable-code
4061 @opindex Wno-unreachable-code
4062 Warn if the compiler detects that code will never be executed.
4063
4064 This option is intended to warn when the compiler detects that at
4065 least a whole line of source code will never be executed, because
4066 some condition is never satisfied or because it is after a
4067 procedure that never returns.
4068
4069 It is possible for this option to produce a warning even though there
4070 are circumstances under which part of the affected line can be executed,
4071 so care should be taken when removing apparently-unreachable code.
4072
4073 For instance, when a function is inlined, a warning may mean that the
4074 line is unreachable in only one inlined copy of the function.
4075
4076 This option is not made part of @option{-Wall} because in a debugging
4077 version of a program there is often substantial code which checks
4078 correct functioning of the program and is, hopefully, unreachable
4079 because the program does work.  Another common use of unreachable
4080 code is to provide behavior which is selectable at compile-time.
4081
4082 @item -Winline
4083 @opindex Winline
4084 @opindex Wno-inline
4085 Warn if a function can not be inlined and it was declared as inline.
4086 Even with this option, the compiler will not warn about failures to
4087 inline functions declared in system headers.
4088
4089 The compiler uses a variety of heuristics to determine whether or not
4090 to inline a function.  For example, the compiler takes into account
4091 the size of the function being inlined and the amount of inlining
4092 that has already been done in the current function.  Therefore,
4093 seemingly insignificant changes in the source program can cause the
4094 warnings produced by @option{-Winline} to appear or disappear.
4095
4096 @item -Wno-invalid-offsetof @r{(C++ and Objective-C++ only)}
4097 @opindex Wno-invalid-offsetof
4098 @opindex Winvalid-offsetof
4099 Suppress warnings from applying the @samp{offsetof} macro to a non-POD
4100 type.  According to the 1998 ISO C++ standard, applying @samp{offsetof}
4101 to a non-POD type is undefined.  In existing C++ implementations,
4102 however, @samp{offsetof} typically gives meaningful results even when
4103 applied to certain kinds of non-POD types. (Such as a simple
4104 @samp{struct} that fails to be a POD type only by virtue of having a
4105 constructor.)  This flag is for users who are aware that they are
4106 writing nonportable code and who have deliberately chosen to ignore the
4107 warning about it.
4108
4109 The restrictions on @samp{offsetof} may be relaxed in a future version
4110 of the C++ standard.
4111
4112 @item -Wno-int-to-pointer-cast @r{(C and Objective-C only)}
4113 @opindex Wno-int-to-pointer-cast
4114 @opindex Wint-to-pointer-cast
4115 Suppress warnings from casts to pointer type of an integer of a
4116 different size.
4117
4118 @item -Wno-pointer-to-int-cast @r{(C and Objective-C only)}
4119 @opindex Wno-pointer-to-int-cast
4120 @opindex Wpointer-to-int-cast
4121 Suppress warnings from casts from a pointer to an integer type of a
4122 different size.
4123
4124 @item -Winvalid-pch
4125 @opindex Winvalid-pch
4126 @opindex Wno-invalid-pch
4127 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
4128 the search path but can't be used.
4129
4130 @item -Wlong-long
4131 @opindex Wlong-long
4132 @opindex Wno-long-long
4133 Warn if @samp{long long} type is used.  This is default.  To inhibit
4134 the warning messages, use @option{-Wno-long-long}.  Flags
4135 @option{-Wlong-long} and @option{-Wno-long-long} are taken into account
4136 only when @option{-pedantic} flag is used.
4137
4138 @item -Wvariadic-macros
4139 @opindex Wvariadic-macros
4140 @opindex Wno-variadic-macros
4141 Warn if variadic macros are used in pedantic ISO C90 mode, or the GNU
4142 alternate syntax when in pedantic ISO C99 mode.  This is default.
4143 To inhibit the warning messages, use @option{-Wno-variadic-macros}.
4144
4145 @item -Wvla
4146 @opindex Wvla
4147 @opindex Wno-vla
4148 Warn if variable length array is used in the code.
4149 @option{-Wno-vla} will prevent the @option{-pedantic} warning of
4150 the variable length array.
4151
4152 @item -Wvolatile-register-var
4153 @opindex Wvolatile-register-var
4154 @opindex Wno-volatile-register-var
4155 Warn if a register variable is declared volatile.  The volatile
4156 modifier does not inhibit all optimizations that may eliminate reads
4157 and/or writes to register variables.  This warning is enabled by
4158 @option{-Wall}.
4159
4160 @item -Wdisabled-optimization
4161 @opindex Wdisabled-optimization
4162 @opindex Wno-disabled-optimization
4163 Warn if a requested optimization pass is disabled.  This warning does
4164 not generally indicate that there is anything wrong with your code; it
4165 merely indicates that GCC's optimizers were unable to handle the code
4166 effectively.  Often, the problem is that your code is too big or too
4167 complex; GCC will refuse to optimize programs when the optimization
4168 itself is likely to take inordinate amounts of time.
4169
4170 @item -Wpointer-sign @r{(C and Objective-C only)}
4171 @opindex Wpointer-sign
4172 @opindex Wno-pointer-sign
4173 Warn for pointer argument passing or assignment with different signedness.
4174 This option is only supported for C and Objective-C@.  It is implied by
4175 @option{-Wall} and by @option{-pedantic}, which can be disabled with
4176 @option{-Wno-pointer-sign}.
4177
4178 @item -Wstack-protector
4179 @opindex Wstack-protector
4180 @opindex Wno-stack-protector
4181 This option is only active when @option{-fstack-protector} is active.  It
4182 warns about functions that will not be protected against stack smashing.
4183
4184 @item -Wno-mudflap
4185 @opindex Wno-mudflap
4186 Suppress warnings about constructs that cannot be instrumented by
4187 @option{-fmudflap}.
4188
4189 @item -Woverlength-strings
4190 @opindex Woverlength-strings
4191 @opindex Wno-overlength-strings
4192 Warn about string constants which are longer than the ``minimum
4193 maximum'' length specified in the C standard.  Modern compilers
4194 generally allow string constants which are much longer than the
4195 standard's minimum limit, but very portable programs should avoid
4196 using longer strings.
4197
4198 The limit applies @emph{after} string constant concatenation, and does
4199 not count the trailing NUL@.  In C89, the limit was 509 characters; in
4200 C99, it was raised to 4095.  C++98 does not specify a normative
4201 minimum maximum, so we do not diagnose overlength strings in C++@.
4202
4203 This option is implied by @option{-pedantic}, and can be disabled with
4204 @option{-Wno-overlength-strings}.
4205 @end table
4206
4207 @node Debugging Options
4208 @section Options for Debugging Your Program or GCC
4209 @cindex options, debugging
4210 @cindex debugging information options
4211
4212 GCC has various special options that are used for debugging
4213 either your program or GCC:
4214
4215 @table @gcctabopt
4216 @item -g
4217 @opindex g
4218 Produce debugging information in the operating system's native format
4219 (stabs, COFF, XCOFF, or DWARF 2)@.  GDB can work with this debugging
4220 information.
4221
4222 On most systems that use stabs format, @option{-g} enables use of extra
4223 debugging information that only GDB can use; this extra information
4224 makes debugging work better in GDB but will probably make other debuggers
4225 crash or
4226 refuse to read the program.  If you want to control for certain whether
4227 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
4228 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
4229
4230 GCC allows you to use @option{-g} with
4231 @option{-O}.  The shortcuts taken by optimized code may occasionally
4232 produce surprising results: some variables you declared may not exist
4233 at all; flow of control may briefly move where you did not expect it;
4234 some statements may not be executed because they compute constant
4235 results or their values were already at hand; some statements may
4236 execute in different places because they were moved out of loops.
4237
4238 Nevertheless it proves possible to debug optimized output.  This makes
4239 it reasonable to use the optimizer for programs that might have bugs.
4240
4241 The following options are useful when GCC is generated with the
4242 capability for more than one debugging format.
4243
4244 @item -ggdb
4245 @opindex ggdb
4246 Produce debugging information for use by GDB@.  This means to use the
4247 most expressive format available (DWARF 2, stabs, or the native format
4248 if neither of those are supported), including GDB extensions if at all
4249 possible.
4250
4251 @item -gstabs
4252 @opindex gstabs
4253 Produce debugging information in stabs format (if that is supported),
4254 without GDB extensions.  This is the format used by DBX on most BSD
4255 systems.  On MIPS, Alpha and System V Release 4 systems this option
4256 produces stabs debugging output which is not understood by DBX or SDB@.
4257 On System V Release 4 systems this option requires the GNU assembler.
4258
4259 @item -feliminate-unused-debug-symbols
4260 @opindex feliminate-unused-debug-symbols
4261 Produce debugging information in stabs format (if that is supported),
4262 for only symbols that are actually used.
4263
4264 @item -femit-class-debug-always
4265 Instead of emitting debugging information for a C++ class in only one
4266 object file, emit it in all object files using the class.  This option
4267 should be used only with debuggers that are unable to handle the way GCC
4268 normally emits debugging information for classes because using this
4269 option will increase the size of debugging information by as much as a
4270 factor of two.
4271
4272 @item -gstabs+
4273 @opindex gstabs+
4274 Produce debugging information in stabs format (if that is supported),
4275 using GNU extensions understood only by the GNU debugger (GDB)@.  The
4276 use of these extensions is likely to make other debuggers crash or
4277 refuse to read the program.
4278
4279 @item -gcoff
4280 @opindex gcoff
4281 Produce debugging information in COFF format (if that is supported).
4282 This is the format used by SDB on most System V systems prior to
4283 System V Release 4.
4284
4285 @item -gxcoff
4286 @opindex gxcoff
4287 Produce debugging information in XCOFF format (if that is supported).
4288 This is the format used by the DBX debugger on IBM RS/6000 systems.
4289
4290 @item -gxcoff+
4291 @opindex gxcoff+
4292 Produce debugging information in XCOFF format (if that is supported),
4293 using GNU extensions understood only by the GNU debugger (GDB)@.  The
4294 use of these extensions is likely to make other debuggers crash or
4295 refuse to read the program, and may cause assemblers other than the GNU
4296 assembler (GAS) to fail with an error.
4297
4298 @item -gdwarf-2
4299 @opindex gdwarf-2
4300 Produce debugging information in DWARF version 2 format (if that is
4301 supported).  This is the format used by DBX on IRIX 6.  With this
4302 option, GCC uses features of DWARF version 3 when they are useful;
4303 version 3 is upward compatible with version 2, but may still cause
4304 problems for older debuggers.
4305
4306 @item -gvms
4307 @opindex gvms
4308 Produce debugging information in VMS debug format (if that is
4309 supported).  This is the format used by DEBUG on VMS systems.
4310
4311 @item -g@var{level}
4312 @itemx -ggdb@var{level}
4313 @itemx -gstabs@var{level}
4314 @itemx -gcoff@var{level}
4315 @itemx -gxcoff@var{level}
4316 @itemx -gvms@var{level}
4317 Request debugging information and also use @var{level} to specify how
4318 much information.  The default level is 2.
4319
4320 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
4321 @option{-g}.
4322
4323 Level 1 produces minimal information, enough for making backtraces in
4324 parts of the program that you don't plan to debug.  This includes
4325 descriptions of functions and external variables, but no information
4326 about local variables and no line numbers.
4327
4328 Level 3 includes extra information, such as all the macro definitions
4329 present in the program.  Some debuggers support macro expansion when
4330 you use @option{-g3}.
4331
4332 @option{-gdwarf-2} does not accept a concatenated debug level, because
4333 GCC used to support an option @option{-gdwarf} that meant to generate
4334 debug information in version 1 of the DWARF format (which is very
4335 different from version 2), and it would have been too confusing.  That
4336 debug format is long obsolete, but the option cannot be changed now.
4337 Instead use an additional @option{-g@var{level}} option to change the
4338 debug level for DWARF2.
4339
4340 @item -feliminate-dwarf2-dups
4341 @opindex feliminate-dwarf2-dups
4342 Compress DWARF2 debugging information by eliminating duplicated
4343 information about each symbol.  This option only makes sense when
4344 generating DWARF2 debugging information with @option{-gdwarf-2}.
4345
4346 @item -femit-struct-debug-baseonly
4347 Emit debug information for struct-like types
4348 only when the base name of the compilation source file
4349 matches the base name of file in which the struct was defined.
4350
4351 This option substantially reduces the size of debugging information,
4352 but at significant potential loss in type information to the debugger.
4353 See @option{-femit-struct-debug-reduced} for a less aggressive option.
4354 See @option{-femit-struct-debug-detailed} for more detailed control.
4355
4356 This option works only with DWARF 2.
4357
4358 @item -femit-struct-debug-reduced
4359 Emit debug information for struct-like types
4360 only when the base name of the compilation source file
4361 matches the base name of file in which the type was defined,
4362 unless the struct is a template or defined in a system header.
4363
4364 This option significantly reduces the size of debugging information,
4365 with some potential loss in type information to the debugger.
4366 See @option{-femit-struct-debug-baseonly} for a more aggressive option.
4367 See @option{-femit-struct-debug-detailed} for more detailed control.
4368
4369 This option works only with DWARF 2.
4370
4371 @item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
4372 Specify the struct-like types
4373 for which the compiler will generate debug information.
4374 The intent is to reduce duplicate struct debug information
4375 between different object files within the same program.
4376
4377 This option is a detailed version of
4378 @option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
4379 which will serve for most needs.
4380
4381 A specification has the syntax
4382 [@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
4383
4384 The optional first word limits the specification to
4385 structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
4386 A struct type is used directly when it is the type of a variable, member.
4387 Indirect uses arise through pointers to structs.
4388 That is, when use of an incomplete struct would be legal, the use is indirect.
4389 An example is
4390 @samp{struct one direct; struct two * indirect;}.
4391
4392 The optional second word limits the specification to
4393 ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
4394 Generic structs are a bit complicated to explain.
4395 For C++, these are non-explicit specializations of template classes,
4396 or non-template classes within the above.
4397 Other programming languages have generics,
4398 but @samp{-femit-struct-debug-detailed} does not yet implement them.
4399
4400 The third word specifies the source files for those
4401 structs for which the compiler will emit debug information.
4402 The values @samp{none} and @samp{any} have the normal meaning.
4403 The value @samp{base} means that
4404 the base of name of the file in which the type declaration appears
4405 must match the base of the name of the main compilation file.
4406 In practice, this means that
4407 types declared in @file{foo.c} and @file{foo.h} will have debug information,
4408 but types declared in other header will not.
4409 The value @samp{sys} means those types satisfying @samp{base}
4410 or declared in system or compiler headers.
4411
4412 You may need to experiment to determine the best settings for your application.
4413
4414 The default is @samp{-femit-struct-debug-detailed=all}.
4415
4416 This option works only with DWARF 2.
4417
4418 @item -fno-merge-debug-strings
4419 @opindex fmerge-debug-strings
4420 @opindex fno-merge-debug-strings
4421 Direct the linker to not merge together strings in the debugging
4422 information which are identical in different object files.  Merging is
4423 not supported by all assemblers or linkers.  Merging decreases the size
4424 of the debug information in the output file at the cost of increasing
4425 link processing time.  Merging is enabled by default.
4426
4427 @item -fdebug-prefix-map=@var{old}=@var{new}
4428 @opindex fdebug-prefix-map
4429 When compiling files in directory @file{@var{old}}, record debugging
4430 information describing them as in @file{@var{new}} instead.
4431
4432 @item -fno-dwarf2-cfi-asm
4433 @opindex fdwarf2-cfi-asm
4434 @opindex fno-dwarf2-cfi-asm
4435 Emit DWARF 2 unwind info as compiler generated @code{.eh_frame} section
4436 instead of using GAS @code{.cfi_*} directives.
4437
4438 @cindex @command{prof}
4439 @item -p
4440 @opindex p
4441 Generate extra code to write profile information suitable for the
4442 analysis program @command{prof}.  You must use this option when compiling
4443 the source files you want data about, and you must also use it when
4444 linking.
4445
4446 @cindex @command{gprof}
4447 @item -pg
4448 @opindex pg
4449 Generate extra code to write profile information suitable for the
4450 analysis program @command{gprof}.  You must use this option when compiling
4451 the source files you want data about, and you must also use it when
4452 linking.
4453
4454 @item -Q
4455 @opindex Q
4456 Makes the compiler print out each function name as it is compiled, and
4457 print some statistics about each pass when it finishes.
4458
4459 @item -ftime-report
4460 @opindex ftime-report
4461 Makes the compiler print some statistics about the time consumed by each
4462 pass when it finishes.
4463
4464 @item -fmem-report
4465 @opindex fmem-report
4466 Makes the compiler print some statistics about permanent memory
4467 allocation when it finishes.
4468
4469 @item -fpre-ipa-mem-report
4470 @opindex fpre-ipa-mem-report
4471 @item -fpost-ipa-mem-report
4472 @opindex fpost-ipa-mem-report
4473 Makes the compiler print some statistics about permanent memory
4474 allocation before or after interprocedural optimization.
4475
4476 @item -fprofile-arcs
4477 @opindex fprofile-arcs
4478 Add code so that program flow @dfn{arcs} are instrumented.  During
4479 execution the program records how many times each branch and call is
4480 executed and how many times it is taken or returns.  When the compiled
4481 program exits it saves this data to a file called
4482 @file{@var{auxname}.gcda} for each source file.  The data may be used for
4483 profile-directed optimizations (@option{-fbranch-probabilities}), or for
4484 test coverage analysis (@option{-ftest-coverage}).  Each object file's
4485 @var{auxname} is generated from the name of the output file, if
4486 explicitly specified and it is not the final executable, otherwise it is
4487 the basename of the source file.  In both cases any suffix is removed
4488 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
4489 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
4490 @xref{Cross-profiling}.
4491
4492 @cindex @command{gcov}
4493 @item --coverage
4494 @opindex coverage
4495
4496 This option is used to compile and link code instrumented for coverage
4497 analysis.  The option is a synonym for @option{-fprofile-arcs}
4498 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
4499 linking).  See the documentation for those options for more details.
4500
4501 @itemize
4502
4503 @item
4504 Compile the source files with @option{-fprofile-arcs} plus optimization
4505 and code generation options.  For test coverage analysis, use the
4506 additional @option{-ftest-coverage} option.  You do not need to profile
4507 every source file in a program.
4508
4509 @item
4510 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
4511 (the latter implies the former).
4512
4513 @item
4514 Run the program on a representative workload to generate the arc profile
4515 information.  This may be repeated any number of times.  You can run
4516 concurrent instances of your program, and provided that the file system
4517 supports locking, the data files will be correctly updated.  Also
4518 @code{fork} calls are detected and correctly handled (double counting
4519 will not happen).
4520
4521 @item
4522 For profile-directed optimizations, compile the source files again with
4523 the same optimization and code generation options plus
4524 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
4525 Control Optimization}).
4526
4527 @item
4528 For test coverage analysis, use @command{gcov} to produce human readable
4529 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
4530 @command{gcov} documentation for further information.
4531
4532 @end itemize
4533
4534 With @option{-fprofile-arcs}, for each function of your program GCC
4535 creates a program flow graph, then finds a spanning tree for the graph.
4536 Only arcs that are not on the spanning tree have to be instrumented: the
4537 compiler adds code to count the number of times that these arcs are
4538 executed.  When an arc is the only exit or only entrance to a block, the
4539 instrumentation code can be added to the block; otherwise, a new basic
4540 block must be created to hold the instrumentation code.
4541
4542 @need 2000
4543 @item -ftest-coverage
4544 @opindex ftest-coverage
4545 Produce a notes file that the @command{gcov} code-coverage utility
4546 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
4547 show program coverage.  Each source file's note file is called
4548 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
4549 above for a description of @var{auxname} and instructions on how to
4550 generate test coverage data.  Coverage data will match the source files
4551 more closely, if you do not optimize.
4552
4553 @item -fdbg-cnt-list
4554 @opindex fdbg-cnt-list
4555 Print the name and the counter upperbound for all debug counters.
4556
4557 @item -fdbg-cnt=@var{counter-value-list}
4558 @opindex fdbg-cnt
4559 Set the internal debug counter upperbound. @var{counter-value-list} 
4560 is a comma-separated list of @var{name}:@var{value} pairs
4561 which sets the upperbound of each debug counter @var{name} to @var{value}.
4562 All debug counters have the initial upperbound of @var{UINT_MAX},
4563 thus dbg_cnt() returns true always unless the upperbound is set by this option.
4564 e.g. With -fdbg-cnt=dce:10,tail_call:0
4565 dbg_cnt(dce) will return true only for first 10 invocations
4566 and dbg_cnt(tail_call) will return false always.
4567
4568 @item -d@var{letters}
4569 @itemx -fdump-rtl-@var{pass}
4570 @opindex d
4571 Says to make debugging dumps during compilation at times specified by
4572 @var{letters}.    This is used for debugging the RTL-based passes of the
4573 compiler.  The file names for most of the dumps are made by appending a
4574 pass number and a word to the @var{dumpname}.  @var{dumpname} is generated
4575 from the name of the output file, if explicitly specified and it is not
4576 an executable, otherwise it is the basename of the source file. These
4577 switches may have different effects when @option{-E} is used for
4578 preprocessing.
4579
4580 Debug dumps can be enabled with a @option{-fdump-rtl} switch or some
4581 @option{-d} option @var{letters}.  Here are the possible
4582 letters for use in @var{pass} and @var{letters}, and their meanings:
4583
4584 @table @gcctabopt
4585
4586 @item -fdump-rtl-alignments
4587 @opindex fdump-rtl-alignments
4588 Dump after branch alignments have been computed.
4589
4590 @item -fdump-rtl-asmcons
4591 @opindex fdump-rtl-asmcons
4592 Dump after fixing rtl statements that have unsatisfied in/out constraints.
4593
4594 @item -fdump-rtl-auto_inc_dec
4595 @opindex fdump-rtl-auto_inc_dec
4596 Dump after auto-inc-dec discovery.  This pass is only run on
4597 architectures that have auto inc or auto dec instructions.
4598
4599 @item -fdump-rtl-barriers
4600 @opindex fdump-rtl-barriers
4601 Dump after cleaning up the barrier instructions.
4602
4603 @item -fdump-rtl-bbpart
4604 @opindex fdump-rtl-bbpart
4605 Dump after partitioning hot and cold basic blocks.
4606
4607 @item -fdump-rtl-bbro
4608 @opindex fdump-rtl-bbro
4609 Dump after block reordering.
4610
4611 @item -fdump-rtl-btl1
4612 @itemx -fdump-rtl-btl2
4613 @opindex fdump-rtl-btl2
4614 @opindex fdump-rtl-btl2
4615 @option{-fdump-rtl-btl1} and @option{-fdump-rtl-btl2} enable dumping
4616 after the two branch
4617 target load optimization passes.
4618
4619 @item -fdump-rtl-bypass
4620 @opindex fdump-rtl-bypass
4621 Dump after jump bypassing and control flow optimizations.
4622
4623 @item -fdump-rtl-combine
4624 @opindex fdump-rtl-combine
4625 Dump after the RTL instruction combination pass.
4626
4627 @item -fdump-rtl-compgotos
4628 @opindex fdump-rtl-compgotos
4629 Dump after duplicating the computed gotos.
4630
4631 @item -fdump-rtl-ce1
4632 @itemx -fdump-rtl-ce2
4633 @itemx -fdump-rtl-ce3
4634 @opindex fdump-rtl-ce1
4635 @opindex fdump-rtl-ce2
4636 @opindex fdump-rtl-ce3
4637 @option{-fdump-rtl-ce1}, @option{-fdump-rtl-ce2}, and
4638 @option{-fdump-rtl-ce3} enable dumping after the three
4639 if conversion passes. 
4640
4641 @itemx -fdump-rtl-cprop_hardreg
4642 @opindex fdump-rtl-cprop_hardreg
4643 Dump after hard register copy propagation.
4644
4645 @itemx -fdump-rtl-csa
4646 @opindex fdump-rtl-csa
4647 Dump after combining stack adjustments.
4648
4649 @item -fdump-rtl-cse1
4650 @itemx -fdump-rtl-cse2
4651 @opindex fdump-rtl-cse1
4652 @opindex fdump-rtl-cse2
4653 @option{-fdump-rtl-cse1} and @option{-fdump-rtl-cse2} enable dumping after
4654 the two common sub-expression elimination passes.
4655
4656 @itemx -fdump-rtl-dce
4657 @opindex fdump-rtl-dce
4658 Dump after the standalone dead code elimination passes.
4659
4660 @itemx -fdump-rtl-dbr
4661 @opindex fdump-rtl-dbr
4662 Dump after delayed branch scheduling.
4663
4664 @item -fdump-rtl-dce1
4665 @itemx -fdump-rtl-dce2
4666 @opindex fdump-rtl-dce1
4667 @opindex fdump-rtl-dce2
4668 @option{-fdump-rtl-dce1} and @option{-fdump-rtl-dce2} enable dumping after
4669 the two dead store elimination passes.
4670
4671 @item -fdump-rtl-eh
4672 @opindex fdump-rtl-eh
4673 Dump after finalization of EH handling code.
4674
4675 @item -fdump-rtl-eh_ranges
4676 @opindex fdump-rtl-eh_ranges
4677 Dump after conversion of EH handling range regions.
4678
4679 @item -fdump-rtl-expand
4680 @opindex fdump-rtl-expand
4681 Dump after RTL generation.
4682
4683 @item -fdump-rtl-fwprop1
4684 @itemx -fdump-rtl-fwprop2
4685 @opindex fdump-rtl-fwprop1
4686 @opindex fdump-rtl-fwprop2
4687 @option{-fdump-rtl-fwprop1} and @option{-fdump-rtl-fwprop2} enable
4688 dumping after the two forward propagation passes.
4689
4690 @item -fdump-rtl-gcse1
4691 @itemx -fdump-rtl-gcse2
4692 @opindex fdump-rtl-gcse1
4693 @opindex fdump-rtl-gcse2
4694 @option{-fdump-rtl-gcse1} and @option{-fdump-rtl-gcse2} enable dumping
4695 after global common subexpression elimination.
4696
4697 @item -fdump-rtl-init-regs
4698 @opindex fdump-rtl-init-regs
4699 Dump after the initialization of the registers.
4700
4701 @item -fdump-rtl-initvals
4702 @opindex fdump-rtl-initvals
4703 Dump after the computation of the initial value sets.
4704
4705 @itemx -fdump-rtl-into_cfglayout
4706 @opindex fdump-rtl-into_cfglayout
4707 Dump after converting to cfglayout mode.
4708
4709 @item -fdump-rtl-ira
4710 @opindex fdump-rtl-ira
4711 Dump after iterated register allocation.
4712
4713 @item -fdump-rtl-jump
4714 @opindex fdump-rtl-jump
4715 Dump after the second jump optimization.
4716
4717 @item -fdump-rtl-loop2
4718 @opindex fdump-rtl-loop2
4719 @option{-fdump-rtl-loop2} enables dumping after the rtl
4720 loop optimization passes.
4721
4722 @item -fdump-rtl-mach
4723 @opindex fdump-rtl-mach
4724 Dump after performing the machine dependent reorganization pass, if that
4725 pass exists.
4726
4727 @item -fdump-rtl-mode_sw
4728 @opindex fdump-rtl-mode_sw
4729 Dump after removing redundant mode switches.
4730
4731 @item -fdump-rtl-rnreg
4732 @opindex fdump-rtl-rnreg
4733 Dump after register renumbering.
4734
4735 @itemx -fdump-rtl-outof_cfglayout
4736 @opindex fdump-rtl-outof_cfglayout
4737 Dump after converting from cfglayout mode.
4738
4739 @item -fdump-rtl-peephole2
4740 @opindex fdump-rtl-peephole2
4741 Dump after the peephole pass.
4742
4743 @item -fdump-rtl-postreload
4744 @opindex fdump-rtl-postreload
4745 Dump after post-reload optimizations.
4746
4747 @itemx -fdump-rtl-pro_and_epilogue
4748 @opindex fdump-rtl-pro_and_epilogue
4749 Dump after generating the function pro and epilogues.
4750
4751 @item -fdump-rtl-regmove
4752 @opindex fdump-rtl-regmove
4753 Dump after the register move pass.
4754
4755 @item -fdump-rtl-sched1
4756 @itemx -fdump-rtl-sched2
4757 @opindex fdump-rtl-sched1
4758 @opindex fdump-rtl-sched2
4759 @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2} enable dumping
4760 after the basic block scheduling passes.
4761
4762 @item -fdump-rtl-see
4763 @opindex fdump-rtl-see
4764 Dump after sign extension elimination.
4765
4766 @item -fdump-rtl-seqabstr
4767 @opindex fdump-rtl-seqabstr
4768 Dump after common sequence discovery. 
4769
4770 @item -fdump-rtl-shorten
4771 @opindex fdump-rtl-shorten
4772 Dump after shortening branches.
4773
4774 @item -fdump-rtl-sibling
4775 @opindex fdump-rtl-sibling
4776 Dump after sibling call optimizations.
4777
4778 @item -fdump-rtl-split1
4779 @itemx -fdump-rtl-split2
4780 @itemx -fdump-rtl-split3
4781 @itemx -fdump-rtl-split4
4782 @itemx -fdump-rtl-split5
4783 @opindex fdump-rtl-split1
4784 @opindex fdump-rtl-split2
4785 @opindex fdump-rtl-split3
4786 @opindex fdump-rtl-split4
4787 @opindex fdump-rtl-split5
4788 @option{-fdump-rtl-split1}, @option{-fdump-rtl-split2},
4789 @option{-fdump-rtl-split3}, @option{-fdump-rtl-split4} and
4790 @option{-fdump-rtl-split5} enable dumping after five rounds of
4791 instruction splitting.
4792
4793 @item -fdump-rtl-sms
4794 @opindex fdump-rtl-sms
4795 Dump after modulo scheduling.  This pass is only run on some
4796 architectures.
4797
4798 @item -fdump-rtl-stack
4799 @opindex fdump-rtl-stack
4800 Dump after conversion from GCC's "flat register file" registers to the
4801 x87's stack-like registers.  This pass is only run on x86 variants.
4802
4803 @item -fdump-rtl-subreg1
4804 @itemx -fdump-rtl-subreg2
4805 @opindex fdump-rtl-subreg1
4806 @opindex fdump-rtl-subreg2
4807 @option{-fdump-rtl-subreg1} and @option{-fdump-rtl-subreg2} enable dumping after
4808 the two subreg expansion passes.
4809
4810 @item -fdump-rtl-unshare
4811 @opindex fdump-rtl-unshare
4812 Dump after all rtl has been unshared.
4813
4814 @item -fdump-rtl-vartrack
4815 @opindex fdump-rtl-vartrack
4816 Dump after variable tracking.
4817
4818 @item -fdump-rtl-vregs
4819 @opindex fdump-rtl-vregs
4820 Dump after converting virtual registers to hard registers.
4821
4822 @item -fdump-rtl-web
4823 @opindex fdump-rtl-web
4824 Dump after live range splitting.
4825
4826 @item -fdump-rtl-regclass
4827 @itemx -fdump-rtl-subregs_of_mode_init
4828 @itemx -fdump-rtl-subregs_of_mode_finish
4829 @itemx -fdump-rtl-dfinit
4830 @itemx -fdump-rtl-dfinish
4831 @opindex fdump-rtl-regclass
4832 @opindex fdump-rtl-subregs_of_mode_init
4833 @opindex fdump-rtl-subregs_of_mode_finish
4834 @opindex fdump-rtl-dfinit
4835 @opindex fdump-rtl-dfinish
4836 These dumps are defined but always produce empty files.
4837
4838 @item -fdump-rtl-all
4839 @opindex fdump-rtl-all
4840 Produce all the dumps listed above.
4841
4842 @item -dA
4843 @opindex dA
4844 Annotate the assembler output with miscellaneous debugging information.
4845
4846 @item -dD
4847 @opindex dD
4848 Dump all macro definitions, at the end of preprocessing, in addition to
4849 normal output.
4850
4851 @item -dH
4852 @opindex dH
4853 Produce a core dump whenever an error occurs.
4854
4855 @item -dm
4856 @opindex dm
4857 Print statistics on memory usage, at the end of the run, to
4858 standard error.
4859
4860 @item -dp
4861 @opindex dp
4862 Annotate the assembler output with a comment indicating which
4863 pattern and alternative was used.  The length of each instruction is
4864 also printed.
4865
4866 @item -dP
4867 @opindex dP
4868 Dump the RTL in the assembler output as a comment before each instruction.
4869 Also turns on @option{-dp} annotation.
4870
4871 @item -dv
4872 @opindex dv
4873 For each of the other indicated dump files (@option{-fdump-rtl-@var{pass}}),
4874 dump a representation of the control flow graph suitable for viewing with VCG
4875 to @file{@var{file}.@var{pass}.vcg}.
4876
4877 @item -dx
4878 @opindex dx
4879 Just generate RTL for a function instead of compiling it.  Usually used
4880 with @option{-fdump-rtl-expand}.
4881
4882 @item -dy
4883 @opindex dy
4884 Dump debugging information during parsing, to standard error.
4885 @end table
4886
4887 @item -fdump-noaddr
4888 @opindex fdump-noaddr
4889 When doing debugging dumps, suppress address output.  This makes it more
4890 feasible to use diff on debugging dumps for compiler invocations with
4891 different compiler binaries and/or different
4892 text / bss / data / heap / stack / dso start locations.
4893
4894 @item -fdump-unnumbered
4895 @opindex fdump-unnumbered
4896 When doing debugging dumps, suppress instruction numbers and address output.
4897 This makes it more feasible to use diff on debugging dumps for compiler
4898 invocations with different options, in particular with and without
4899 @option{-g}.
4900
4901 @item -fdump-translation-unit @r{(C++ only)}
4902 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
4903 @opindex fdump-translation-unit
4904 Dump a representation of the tree structure for the entire translation
4905 unit to a file.  The file name is made by appending @file{.tu} to the
4906 source file name.  If the @samp{-@var{options}} form is used, @var{options}
4907 controls the details of the dump as described for the
4908 @option{-fdump-tree} options.
4909
4910 @item -fdump-class-hierarchy @r{(C++ only)}
4911 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
4912 @opindex fdump-class-hierarchy
4913 Dump a representation of each class's hierarchy and virtual function
4914 table layout to a file.  The file name is made by appending @file{.class}
4915 to the source file name.  If the @samp{-@var{options}} form is used,
4916 @var{options} controls the details of the dump as described for the
4917 @option{-fdump-tree} options.
4918
4919 @item -fdump-ipa-@var{switch}
4920 @opindex fdump-ipa
4921 Control the dumping at various stages of inter-procedural analysis
4922 language tree to a file.  The file name is generated by appending a switch
4923 specific suffix to the source file name.  The following dumps are possible:
4924
4925 @table @samp
4926 @item all
4927 Enables all inter-procedural analysis dumps.
4928
4929 @item cgraph
4930 Dumps information about call-graph optimization, unused function removal,
4931 and inlining decisions.
4932
4933 @item inline
4934 Dump after function inlining.
4935
4936 @end table
4937
4938 @item -fdump-statistics-@var{option}
4939 @opindex -fdump-statistics
4940 Enable and control dumping of pass statistics in a separate file.  The
4941 file name is generated by appending a suffix ending in @samp{.statistics}
4942 to the source file name.  If the @samp{-@var{option}} form is used,
4943 @samp{-stats} will cause counters to be summed over the whole compilation unit
4944 while @samp{-details} will dump every event as the passes generate them.
4945 The default with no option is to sum counters for each function compiled.
4946
4947 @item -fdump-tree-@var{switch}
4948 @itemx -fdump-tree-@var{switch}-@var{options}
4949 @opindex fdump-tree
4950 Control the dumping at various stages of processing the intermediate
4951 language tree to a file.  The file name is generated by appending a switch
4952 specific suffix to the source file name.  If the @samp{-@var{options}}
4953 form is used, @var{options} is a list of @samp{-} separated options that
4954 control the details of the dump.  Not all options are applicable to all
4955 dumps, those which are not meaningful will be ignored.  The following
4956 options are available
4957
4958 @table @samp
4959 @item address
4960 Print the address of each node.  Usually this is not meaningful as it
4961 changes according to the environment and source file.  Its primary use
4962 is for tying up a dump file with a debug environment.
4963 @item slim
4964 Inhibit dumping of members of a scope or body of a function merely
4965 because that scope has been reached.  Only dump such items when they
4966 are directly reachable by some other path.  When dumping pretty-printed
4967 trees, this option inhibits dumping the bodies of control structures.
4968 @item raw
4969 Print a raw representation of the tree.  By default, trees are
4970 pretty-printed into a C-like representation.
4971 @item details
4972 Enable more detailed dumps (not honored by every dump option).
4973 @item stats
4974 Enable dumping various statistics about the pass (not honored by every dump
4975 option).
4976 @item blocks
4977 Enable showing basic block boundaries (disabled in raw dumps).
4978 @item vops
4979 Enable showing virtual operands for every statement.
4980 @item lineno
4981 Enable showing line numbers for statements.
4982 @item uid
4983 Enable showing the unique ID (@code{DECL_UID}) for each variable.
4984 @item verbose
4985 Enable showing the tree dump for each statement.
4986 @item all
4987 Turn on all options, except @option{raw}, @option{slim}, @option{verbose}
4988 and @option{lineno}.
4989 @end table
4990
4991 The following tree dumps are possible:
4992 @table @samp
4993
4994 @item original
4995 Dump before any tree based optimization, to @file{@var{file}.original}.
4996
4997 @item optimized
4998 Dump after all tree based optimization, to @file{@var{file}.optimized}.
4999
5000 @item gimple
5001 @opindex fdump-tree-gimple
5002 Dump each function before and after the gimplification pass to a file.  The
5003 file name is made by appending @file{.gimple} to the source file name.
5004
5005 @item cfg
5006 @opindex fdump-tree-cfg
5007 Dump the control flow graph of each function to a file.  The file name is
5008 made by appending @file{.cfg} to the source file name.
5009
5010 @item vcg
5011 @opindex fdump-tree-vcg
5012 Dump the control flow graph of each function to a file in VCG format.  The
5013 file name is made by appending @file{.vcg} to the source file name.  Note
5014 that if the file contains more than one function, the generated file cannot
5015 be used directly by VCG@.  You will need to cut and paste each function's
5016 graph into its own separate file first.
5017
5018 @item ch
5019 @opindex fdump-tree-ch
5020 Dump each function after copying loop headers.  The file name is made by
5021 appending @file{.ch} to the source file name.
5022
5023 @item ssa
5024 @opindex fdump-tree-ssa
5025 Dump SSA related information to a file.  The file name is made by appending
5026 @file{.ssa} to the source file name.
5027
5028 @item alias
5029 @opindex fdump-tree-alias
5030 Dump aliasing information for each function.  The file name is made by
5031 appending @file{.alias} to the source file name.
5032
5033 @item ccp
5034 @opindex fdump-tree-ccp
5035 Dump each function after CCP@.  The file name is made by appending
5036 @file{.ccp} to the source file name.
5037
5038 @item storeccp
5039 @opindex fdump-tree-storeccp
5040 Dump each function after STORE-CCP@.  The file name is made by appending
5041 @file{.storeccp} to the source file name.
5042
5043 @item pre
5044 @opindex fdump-tree-pre
5045 Dump trees after partial redundancy elimination.  The file name is made
5046 by appending @file{.pre} to the source file name.
5047
5048 @item fre
5049 @opindex fdump-tree-fre
5050 Dump trees after full redundancy elimination.  The file name is made
5051 by appending @file{.fre} to the source file name.
5052
5053 @item copyprop
5054 @opindex fdump-tree-copyprop
5055 Dump trees after copy propagation.  The file name is made
5056 by appending @file{.copyprop} to the source file name.
5057
5058 @item store_copyprop
5059 @opindex fdump-tree-store_copyprop
5060 Dump trees after store copy-propagation.  The file name is made
5061 by appending @file{.store_copyprop} to the source file name.
5062
5063 @item dce
5064 @opindex fdump-tree-dce
5065 Dump each function after dead code elimination.  The file name is made by
5066 appending @file{.dce} to the source file name.
5067
5068 @item mudflap
5069 @opindex fdump-tree-mudflap
5070 Dump each function after adding mudflap instrumentation.  The file name is
5071 made by appending @file{.mudflap} to the source file name.
5072
5073 @item sra
5074 @opindex fdump-tree-sra
5075 Dump each function after performing scalar replacement of aggregates.  The
5076 file name is made by appending @file{.sra} to the source file name.
5077
5078 @item sink
5079 @opindex fdump-tree-sink
5080 Dump each function after performing code sinking.  The file name is made
5081 by appending @file{.sink} to the source file name.
5082
5083 @item dom
5084 @opindex fdump-tree-dom
5085 Dump each function after applying dominator tree optimizations.  The file
5086 name is made by appending @file{.dom} to the source file name.
5087
5088 @item dse
5089 @opindex fdump-tree-dse
5090 Dump each function after applying dead store elimination.  The file
5091 name is made by appending @file{.dse} to the source file name.
5092
5093 @item phiopt
5094 @opindex fdump-tree-phiopt
5095 Dump each function after optimizing PHI nodes into straightline code.  The file
5096 name is made by appending @file{.phiopt} to the source file name.
5097
5098 @item forwprop
5099 @opindex fdump-tree-forwprop
5100 Dump each function after forward propagating single use variables.  The file
5101 name is made by appending @file{.forwprop} to the source file name.
5102
5103 @item copyrename
5104 @opindex fdump-tree-copyrename
5105 Dump each function after applying the copy rename optimization.  The file
5106 name is made by appending @file{.copyrename} to the source file name.
5107
5108 @item nrv
5109 @opindex fdump-tree-nrv
5110 Dump each function after applying the named return value optimization on
5111 generic trees.  The file name is made by appending @file{.nrv} to the source
5112 file name.
5113
5114 @item vect
5115 @opindex fdump-tree-vect
5116 Dump each function after applying vectorization of loops.  The file name is
5117 made by appending @file{.vect} to the source file name.
5118
5119 @item vrp
5120 @opindex fdump-tree-vrp
5121 Dump each function after Value Range Propagation (VRP).  The file name
5122 is made by appending @file{.vrp} to the source file name.
5123
5124 @item all
5125 @opindex fdump-tree-all
5126 Enable all the available tree dumps with the flags provided in this option.
5127 @end table
5128
5129 @item -ftree-vectorizer-verbose=@var{n}
5130 @opindex ftree-vectorizer-verbose
5131 This option controls the amount of debugging output the vectorizer prints.
5132 This information is written to standard error, unless
5133 @option{-fdump-tree-all} or @option{-fdump-tree-vect} is specified,
5134 in which case it is output to the usual dump listing file, @file{.vect}.
5135 For @var{n}=0 no diagnostic information is reported.
5136 If @var{n}=1 the vectorizer reports each loop that got vectorized,
5137 and the total number of loops that got vectorized.
5138 If @var{n}=2 the vectorizer also reports non-vectorized loops that passed
5139 the first analysis phase (vect_analyze_loop_form) - i.e.@: countable,
5140 inner-most, single-bb, single-entry/exit loops.  This is the same verbosity
5141 level that @option{-fdump-tree-vect-stats} uses.
5142 Higher verbosity levels mean either more information dumped for each
5143 reported loop, or same amount of information reported for more loops:
5144 If @var{n}=3, alignment related information is added to the reports.
5145 If @var{n}=4, data-references related information (e.g.@: memory dependences,
5146 memory access-patterns) is added to the reports.
5147 If @var{n}=5, the vectorizer reports also non-vectorized inner-most loops
5148 that did not pass the first analysis phase (i.e., may not be countable, or
5149 may have complicated control-flow).
5150 If @var{n}=6, the vectorizer reports also non-vectorized nested loops.
5151 For @var{n}=7, all the information the vectorizer generates during its
5152 analysis and transformation is reported.  This is the same verbosity level
5153 that @option{-fdump-tree-vect-details} uses.
5154
5155 @item -frandom-seed=@var{string}
5156 @opindex frandom-string
5157 This option provides a seed that GCC uses when it would otherwise use
5158 random numbers.  It is used to generate certain symbol names
5159 that have to be different in every compiled file.  It is also used to
5160 place unique stamps in coverage data files and the object files that
5161 produce them.  You can use the @option{-frandom-seed} option to produce
5162 reproducibly identical object files.
5163
5164 The @var{string} should be different for every file you compile.
5165
5166 @item -fsched-verbose=@var{n}
5167 @opindex fsched-verbose
5168 On targets that use instruction scheduling, this option controls the
5169 amount of debugging output the scheduler prints.  This information is
5170 written to standard error, unless @option{-fdump-rtl-sched1} or
5171 @option{-fdump-rtl-sched2} is specified, in which case it is output
5172 to the usual dump listing file, @file{.sched} or @file{.sched2}
5173 respectively.  However for @var{n} greater than nine, the output is
5174 always printed to standard error.
5175
5176 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
5177 same information as @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2}.
5178 For @var{n} greater than one, it also output basic block probabilities,
5179 detailed ready list information and unit/insn info.  For @var{n} greater
5180 than two, it includes RTL at abort point, control-flow and regions info.
5181 And for @var{n} over four, @option{-fsched-verbose} also includes
5182 dependence info.
5183
5184 @item -save-temps
5185 @itemx -save-temps=cwd
5186 @opindex save-temps
5187 Store the usual ``temporary'' intermediate files permanently; place them
5188 in the current directory and name them based on the source file.  Thus,
5189 compiling @file{foo.c} with @samp{-c -save-temps} would produce files
5190 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
5191 preprocessed @file{foo.i} output file even though the compiler now
5192 normally uses an integrated preprocessor.
5193
5194 When used in combination with the @option{-x} command line option,
5195 @option{-save-temps} is sensible enough to avoid over writing an
5196 input source file with the same extension as an intermediate file.
5197 The corresponding intermediate file may be obtained by renaming the
5198 source file before using @option{-save-temps}.
5199
5200 If you invoke GCC in parallel, compiling several different source
5201 files that share a common base name in different subdirectories or the
5202 same source file compiled for multiple output destinations, it is
5203 likely that the different parallel compilers will interfere with each
5204 other, and overwrite the temporary files.  For instance:
5205
5206 @smallexample
5207 gcc -save-temps -o outdir1/foo.o indir1/foo.c&
5208 gcc -save-temps -o outdir2/foo.o indir2/foo.c&
5209 @end smallexample
5210
5211 may result in @file{foo.i} and @file{foo.o} being written to
5212 simultaneously by both compilers.
5213
5214 @item -save-temps=obj
5215 @opindex save-temps=obj
5216 Store the usual ``temporary'' intermediate files permanently.  If the
5217 @option{-o} option is used, the temporary files are based on the
5218 object file.  If the @option{-o} option is not used, the
5219 @option{-save-temps=obj} switch behaves like @option{-save-temps}.
5220
5221 For example:
5222
5223 @smallexample
5224 gcc -save-temps=obj -c foo.c
5225 gcc -save-temps=obj -c bar.c -o dir/xbar.o
5226 gcc -save-temps=obj foobar.c -o dir2/yfoobar
5227 @end smallexample
5228
5229 would create @file{foo.i}, @file{foo.s}, @file{dir/xbar.i},
5230 @file{dir/xbar.s}, @file{dir2/yfoobar.i}, @file{dir2/yfoobar.s}, and
5231 @file{dir2/yfoobar.o}.
5232
5233 @item -time
5234 @opindex time
5235 Report the CPU time taken by each subprocess in the compilation
5236 sequence.  For C source files, this is the compiler proper and assembler
5237 (plus the linker if linking is done).  The output looks like this:
5238
5239 @smallexample
5240 # cc1 0.12 0.01
5241 # as 0.00 0.01
5242 @end smallexample
5243
5244 The first number on each line is the ``user time'', that is time spent
5245 executing the program itself.  The second number is ``system time'',
5246 time spent executing operating system routines on behalf of the program.
5247 Both numbers are in seconds.
5248
5249 @item -fvar-tracking
5250 @opindex fvar-tracking
5251 Run variable tracking pass.  It computes where variables are stored at each
5252 position in code.  Better debugging information is then generated
5253 (if the debugging information format supports this information).
5254
5255 It is enabled by default when compiling with optimization (@option{-Os},
5256 @option{-O}, @option{-O2}, @dots{}), debugging information (@option{-g}) and
5257 the debug info format supports it.
5258
5259 @item -print-file-name=@var{library}
5260 @opindex print-file-name
5261 Print the full absolute name of the library file @var{library} that
5262 would be used when linking---and don't do anything else.  With this
5263 option, GCC does not compile or link anything; it just prints the
5264 file name.
5265
5266 @item -print-multi-directory
5267 @opindex print-multi-directory
5268 Print the directory name corresponding to the multilib selected by any
5269 other switches present in the command line.  This directory is supposed
5270 to exist in @env{GCC_EXEC_PREFIX}.
5271
5272 @item -print-multi-lib
5273 @opindex print-multi-lib
5274 Print the mapping from multilib directory names to compiler switches
5275 that enable them.  The directory name is separated from the switches by
5276 @samp{;}, and each switch starts with an @samp{@@} instead of the
5277 @samp{-}, without spaces between multiple switches.  This is supposed to
5278 ease shell-processing.
5279
5280 @item -print-prog-name=@var{program}
5281 @opindex print-prog-name
5282 Like @option{-print-file-name}, but searches for a program such as @samp{cpp}.
5283
5284 @item -print-libgcc-file-name
5285 @opindex print-libgcc-file-name
5286 Same as @option{-print-file-name=libgcc.a}.
5287
5288 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
5289 but you do want to link with @file{libgcc.a}.  You can do
5290
5291 @smallexample
5292 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
5293 @end smallexample
5294
5295 @item -print-search-dirs
5296 @opindex print-search-dirs
5297 Print the name of the configured installation directory and a list of
5298 program and library directories @command{gcc} will search---and don't do anything else.
5299
5300 This is useful when @command{gcc} prints the error message
5301 @samp{installation problem, cannot exec cpp0: No such file or directory}.
5302 To resolve this you either need to put @file{cpp0} and the other compiler
5303 components where @command{gcc} expects to find them, or you can set the environment
5304 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
5305 Don't forget the trailing @samp{/}.
5306 @xref{Environment Variables}.
5307
5308 @item -print-sysroot
5309 @opindex print-sysroot
5310 Print the target sysroot directory that will be used during
5311 compilation.  This is the target sysroot specified either at configure
5312 time or using the @option{--sysroot} option, possibly with an extra
5313 suffix that depends on compilation options.  If no target sysroot is
5314 specified, the option prints nothing.
5315
5316 @item -print-sysroot-headers-suffix
5317 @opindex print-sysroot-headers-suffix
5318 Print the suffix added to the target sysroot when searching for
5319 headers, or give an error if the compiler is not configured with such
5320 a suffix---and don't do anything else.
5321
5322 @item -dumpmachine
5323 @opindex dumpmachine
5324 Print the compiler's target machine (for example,
5325 @samp{i686-pc-linux-gnu})---and don't do anything else.
5326
5327 @item -dumpversion
5328 @opindex dumpversion
5329 Print the compiler version (for example, @samp{3.0})---and don't do
5330 anything else.
5331
5332 @item -dumpspecs
5333 @opindex dumpspecs
5334 Print the compiler's built-in specs---and don't do anything else.  (This
5335 is used when GCC itself is being built.)  @xref{Spec Files}.
5336
5337 @item -feliminate-unused-debug-types
5338 @opindex feliminate-unused-debug-types
5339 Normally, when producing DWARF2 output, GCC will emit debugging
5340 information for all types declared in a compilation
5341 unit, regardless of whether or not they are actually used
5342 in that compilation unit.  Sometimes this is useful, such as
5343 if, in the debugger, you want to cast a value to a type that is
5344 not actually used in your program (but is declared).  More often,
5345 however, this results in a significant amount of wasted space.
5346 With this option, GCC will avoid producing debug symbol output
5347 for types that are nowhere used in the source file being compiled.
5348 @end table
5349
5350 @node Optimize Options
5351 @section Options That Control Optimization
5352 @cindex optimize options
5353 @cindex options, optimization
5354
5355 These options control various sorts of optimizations.
5356
5357 Without any optimization option, the compiler's goal is to reduce the
5358 cost of compilation and to make debugging produce the expected
5359 results.  Statements are independent: if you stop the program with a
5360 breakpoint between statements, you can then assign a new value to any
5361 variable or change the program counter to any other statement in the
5362 function and get exactly the results you would expect from the source
5363 code.
5364
5365 Turning on optimization flags makes the compiler attempt to improve
5366 the performance and/or code size at the expense of compilation time
5367 and possibly the ability to debug the program.
5368
5369 The compiler performs optimization based on the knowledge it has of the
5370 program.  Compiling multiple files at once to a single output file mode allows
5371 the compiler to use information gained from all of the files when compiling
5372 each of them.
5373
5374 Not all optimizations are controlled directly by a flag.  Only
5375 optimizations that have a flag are listed in this section.
5376
5377 Depending on the target and how GCC was configured, a slightly different 
5378 set of optimizations may be enabled at each @option{-O} level than 
5379 those listed here.  You can invoke GCC with @samp{-Q --help=optimizers} 
5380 to find out the exact set of optimizations that are enabled at each level.
5381 @xref{Overall Options}, for examples.
5382
5383 @table @gcctabopt
5384 @item -O
5385 @itemx -O1
5386 @opindex O
5387 @opindex O1
5388 Optimize.  Optimizing compilation takes somewhat more time, and a lot
5389 more memory for a large function.
5390
5391 With @option{-O}, the compiler tries to reduce code size and execution
5392 time, without performing any optimizations that take a great deal of
5393 compilation time.
5394
5395 @option{-O} turns on the following optimization flags:
5396 @gccoptlist{
5397 -fauto-inc-dec @gol
5398 -fcprop-registers @gol
5399 -fdce @gol
5400 -fdefer-pop @gol
5401 -fdelayed-branch @gol
5402 -fdse @gol
5403 -fguess-branch-probability @gol
5404 -fif-conversion2 @gol
5405 -fif-conversion @gol
5406 -finline-small-functions @gol
5407 -fipa-pure-const @gol
5408 -fipa-reference @gol
5409 -fmerge-constants
5410 -fsplit-wide-types @gol
5411 -ftree-builtin-call-dce @gol
5412 -ftree-ccp @gol
5413 -ftree-ch @gol
5414 -ftree-copyrename @gol
5415 -ftree-dce @gol
5416 -ftree-dominator-opts @gol
5417 -ftree-dse @gol
5418 -ftree-fre @gol
5419 -ftree-sra @gol
5420 -ftree-ter @gol
5421 -funit-at-a-time}
5422
5423 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
5424 where doing so does not interfere with debugging.
5425
5426 @item -O2
5427 @opindex O2
5428 Optimize even more.  GCC performs nearly all supported optimizations
5429 that do not involve a space-speed tradeoff.
5430 As compared to @option{-O}, this option increases both compilation time
5431 and the performance of the generated code.
5432
5433 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
5434 also turns on the following optimization flags:
5435 @gccoptlist{-fthread-jumps @gol
5436 -falign-functions  -falign-jumps @gol
5437 -falign-loops  -falign-labels @gol
5438 -fcaller-saves @gol
5439 -fcrossjumping @gol
5440 -fcse-follow-jumps  -fcse-skip-blocks @gol
5441 -fdelete-null-pointer-checks @gol
5442 -fexpensive-optimizations @gol
5443 -fgcse  -fgcse-lm  @gol
5444 -findirect-inlining @gol
5445 -foptimize-sibling-calls @gol
5446 -fpeephole2 @gol
5447 -fregmove @gol
5448 -freorder-blocks  -freorder-functions @gol
5449 -frerun-cse-after-loop  @gol
5450 -fsched-interblock  -fsched-spec @gol
5451 -fschedule-insns  -fschedule-insns2 @gol
5452 -fstrict-aliasing -fstrict-overflow @gol
5453 -ftree-switch-conversion @gol
5454 -ftree-pre @gol
5455 -ftree-vrp}
5456
5457 Please note the warning under @option{-fgcse} about
5458 invoking @option{-O2} on programs that use computed gotos.
5459
5460 @item -O3
5461 @opindex O3
5462 Optimize yet more.  @option{-O3} turns on all optimizations specified
5463 by @option{-O2} and also turns on the @option{-finline-functions},
5464 @option{-funswitch-loops}, @option{-fpredictive-commoning},
5465 @option{-fgcse-after-reload} and @option{-ftree-vectorize} options.
5466
5467 @item -O0
5468 @opindex O0
5469 Reduce compilation time and make debugging produce the expected
5470 results.  This is the default.
5471
5472 @item -Os
5473 @opindex Os
5474 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
5475 do not typically increase code size.  It also performs further
5476 optimizations designed to reduce code size.
5477
5478 @option{-Os} disables the following optimization flags:
5479 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
5480 -falign-labels  -freorder-blocks  -freorder-blocks-and-partition @gol
5481 -fprefetch-loop-arrays  -ftree-vect-loop-version}
5482
5483 If you use multiple @option{-O} options, with or without level numbers,
5484 the last such option is the one that is effective.
5485 @end table
5486
5487 Options of the form @option{-f@var{flag}} specify machine-independent
5488 flags.  Most flags have both positive and negative forms; the negative
5489 form of @option{-ffoo} would be @option{-fno-foo}.  In the table
5490 below, only one of the forms is listed---the one you typically will
5491 use.  You can figure out the other form by either removing @samp{no-}
5492 or adding it.
5493
5494 The following options control specific optimizations.  They are either
5495 activated by @option{-O} options or are related to ones that are.  You
5496 can use the following flags in the rare cases when ``fine-tuning'' of
5497 optimizations to be performed is desired.
5498
5499 @table @gcctabopt
5500 @item -fno-default-inline
5501 @opindex fno-default-inline
5502 Do not make member functions inline by default merely because they are
5503 defined inside the class scope (C++ only).  Otherwise, when you specify
5504 @w{@option{-O}}, member functions defined inside class scope are compiled
5505 inline by default; i.e., you don't need to add @samp{inline} in front of
5506 the member function name.
5507
5508 @item -fno-defer-pop
5509 @opindex fno-defer-pop
5510 Always pop the arguments to each function call as soon as that function
5511 returns.  For machines which must pop arguments after a function call,
5512 the compiler normally lets arguments accumulate on the stack for several
5513 function calls and pops them all at once.
5514
5515 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5516
5517 @item -fforward-propagate
5518 @opindex fforward-propagate
5519 Perform a forward propagation pass on RTL@.  The pass tries to combine two
5520 instructions and checks if the result can be simplified.  If loop unrolling
5521 is active, two passes are performed and the second is scheduled after
5522 loop unrolling.
5523
5524 This option is enabled by default at optimization levels @option{-O2},
5525 @option{-O3}, @option{-Os}.
5526
5527 @item -fomit-frame-pointer
5528 @opindex fomit-frame-pointer
5529 Don't keep the frame pointer in a register for functions that
5530 don't need one.  This avoids the instructions to save, set up and
5531 restore frame pointers; it also makes an extra register available
5532 in many functions.  @strong{It also makes debugging impossible on
5533 some machines.}
5534
5535 On some machines, such as the VAX, this flag has no effect, because
5536 the standard calling sequence automatically handles the frame pointer
5537 and nothing is saved by pretending it doesn't exist.  The
5538 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
5539 whether a target machine supports this flag.  @xref{Registers,,Register
5540 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
5541
5542 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5543
5544 @item -foptimize-sibling-calls
5545 @opindex foptimize-sibling-calls
5546 Optimize sibling and tail recursive calls.
5547
5548 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5549
5550 @item -fno-inline
5551 @opindex fno-inline
5552 Don't pay attention to the @code{inline} keyword.  Normally this option
5553 is used to keep the compiler from expanding any functions inline.
5554 Note that if you are not optimizing, no functions can be expanded inline.
5555
5556 @item -finline-small-functions
5557 @opindex finline-small-functions
5558 Integrate functions into their callers when their body is smaller than expected
5559 function call code (so overall size of program gets smaller).  The compiler
5560 heuristically decides which functions are simple enough to be worth integrating
5561 in this way.
5562
5563 Enabled at level @option{-O2}.
5564
5565 @item -findirect-inlining
5566 @opindex findirect-inlining
5567 Inline also indirect calls that are discovered to be known at compile
5568 time thanks to previous inlining.  This option has any effect only
5569 when inlining itself is turned on by the @option{-finline-functions}
5570 or @option{-finline-small-functions} options.
5571
5572 Enabled at level @option{-O2}.
5573
5574 @item -finline-functions
5575 @opindex finline-functions
5576 Integrate all simple functions into their callers.  The compiler
5577 heuristically decides which functions are simple enough to be worth
5578 integrating in this way.
5579
5580 If all calls to a given function are integrated, and the function is
5581 declared @code{static}, then the function is normally not output as
5582 assembler code in its own right.
5583
5584 Enabled at level @option{-O3}.
5585
5586 @item -finline-functions-called-once
5587 @opindex finline-functions-called-once
5588 Consider all @code{static} functions called once for inlining into their
5589 caller even if they are not marked @code{inline}.  If a call to a given
5590 function is integrated, then the function is not output as assembler code
5591 in its own right.
5592
5593 Enabled at levels @option{-O1}, @option{-O2}, @option{-O3} and @option{-Os}.
5594
5595 @item -fearly-inlining
5596 @opindex fearly-inlining
5597 Inline functions marked by @code{always_inline} and functions whose body seems
5598 smaller than the function call overhead early before doing
5599 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
5600 makes profiling significantly cheaper and usually inlining faster on programs
5601 having large chains of nested wrapper functions.
5602
5603 Enabled by default.
5604
5605 @item -finline-limit=@var{n}
5606 @opindex finline-limit
5607 By default, GCC limits the size of functions that can be inlined.  This flag
5608 allows coarse control of this limit.  @var{n} is the size of functions that
5609 can be inlined in number of pseudo instructions.
5610
5611 Inlining is actually controlled by a number of parameters, which may be
5612 specified individually by using @option{--param @var{name}=@var{value}}.
5613 The @option{-finline-limit=@var{n}} option sets some of these parameters
5614 as follows:
5615
5616 @table @gcctabopt
5617 @item max-inline-insns-single
5618 is set to @var{n}/2.
5619 @item max-inline-insns-auto
5620 is set to @var{n}/2.
5621 @end table
5622
5623 See below for a documentation of the individual
5624 parameters controlling inlining and for the defaults of these parameters.
5625
5626 @emph{Note:} there may be no value to @option{-finline-limit} that results
5627 in default behavior.
5628
5629 @emph{Note:} pseudo instruction represents, in this particular context, an
5630 abstract measurement of function's size.  In no way does it represent a count
5631 of assembly instructions and as such its exact meaning might change from one
5632 release to an another.
5633
5634 @item -fkeep-inline-functions
5635 @opindex fkeep-inline-functions
5636 In C, emit @code{static} functions that are declared @code{inline}
5637 into the object file, even if the function has been inlined into all
5638 of its callers.  This switch does not affect functions using the
5639 @code{extern inline} extension in GNU C89@.  In C++, emit any and all
5640 inline functions into the object file.
5641
5642 @item -fkeep-static-consts
5643 @opindex fkeep-static-consts
5644 Emit variables declared @code{static const} when optimization isn't turned
5645 on, even if the variables aren't referenced.
5646
5647 GCC enables this option by default.  If you want to force the compiler to
5648 check if the variable was referenced, regardless of whether or not
5649 optimization is turned on, use the @option{-fno-keep-static-consts} option.
5650
5651 @item -fmerge-constants
5652 @opindex fmerge-constants
5653 Attempt to merge identical constants (string constants and floating point
5654 constants) across compilation units.
5655
5656 This option is the default for optimized compilation if the assembler and
5657 linker support it.  Use @option{-fno-merge-constants} to inhibit this
5658 behavior.
5659
5660 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5661
5662 @item -fmerge-all-constants
5663 @opindex fmerge-all-constants
5664 Attempt to merge identical constants and identical variables.
5665
5666 This option implies @option{-fmerge-constants}.  In addition to
5667 @option{-fmerge-constants} this considers e.g.@: even constant initialized
5668 arrays or initialized constant variables with integral or floating point
5669 types.  Languages like C or C++ require each variable, including multiple
5670 instances of the same variable in recursive calls, to have distinct locations,
5671 so using this option will result in non-conforming
5672 behavior.
5673
5674 @item -fmodulo-sched
5675 @opindex fmodulo-sched
5676 Perform swing modulo scheduling immediately before the first scheduling
5677 pass.  This pass looks at innermost loops and reorders their
5678 instructions by overlapping different iterations.
5679
5680 @item -fmodulo-sched-allow-regmoves
5681 @opindex fmodulo-sched-allow-regmoves
5682 Perform more aggressive SMS based modulo scheduling with register moves
5683 allowed.  By setting this flag certain anti-dependences edges will be
5684 deleted which will trigger the generation of reg-moves based on the
5685 life-range analysis.  This option is effective only with
5686 @option{-fmodulo-sched} enabled.
5687
5688 @item -fno-branch-count-reg
5689 @opindex fno-branch-count-reg
5690 Do not use ``decrement and branch'' instructions on a count register,
5691 but instead generate a sequence of instructions that decrement a
5692 register, compare it against zero, then branch based upon the result.
5693 This option is only meaningful on architectures that support such
5694 instructions, which include x86, PowerPC, IA-64 and S/390.
5695
5696 The default is @option{-fbranch-count-reg}.
5697
5698 @item -fno-function-cse
5699 @opindex fno-function-cse
5700 Do not put function addresses in registers; make each instruction that
5701 calls a constant function contain the function's address explicitly.
5702
5703 This option results in less efficient code, but some strange hacks
5704 that alter the assembler output may be confused by the optimizations
5705 performed when this option is not used.
5706
5707 The default is @option{-ffunction-cse}
5708
5709 @item -fno-zero-initialized-in-bss
5710 @opindex fno-zero-initialized-in-bss
5711 If the target supports a BSS section, GCC by default puts variables that
5712 are initialized to zero into BSS@.  This can save space in the resulting
5713 code.
5714
5715 This option turns off this behavior because some programs explicitly
5716 rely on variables going to the data section.  E.g., so that the
5717 resulting executable can find the beginning of that section and/or make
5718 assumptions based on that.
5719
5720 The default is @option{-fzero-initialized-in-bss}.
5721
5722 @item -fmudflap -fmudflapth -fmudflapir
5723 @opindex fmudflap
5724 @opindex fmudflapth
5725 @opindex fmudflapir
5726 @cindex bounds checking
5727 @cindex mudflap
5728 For front-ends that support it (C and C++), instrument all risky
5729 pointer/array dereferencing operations, some standard library
5730 string/heap functions, and some other associated constructs with
5731 range/validity tests.  Modules so instrumented should be immune to
5732 buffer overflows, invalid heap use, and some other classes of C/C++
5733 programming errors.  The instrumentation relies on a separate runtime
5734 library (@file{libmudflap}), which will be linked into a program if
5735 @option{-fmudflap} is given at link time.  Run-time behavior of the
5736 instrumented program is controlled by the @env{MUDFLAP_OPTIONS}
5737 environment variable.  See @code{env MUDFLAP_OPTIONS=-help a.out}
5738 for its options.
5739
5740 Use @option{-fmudflapth} instead of @option{-fmudflap} to compile and to
5741 link if your program is multi-threaded.  Use @option{-fmudflapir}, in
5742 addition to @option{-fmudflap} or @option{-fmudflapth}, if
5743 instrumentation should ignore pointer reads.  This produces less
5744 instrumentation (and therefore faster execution) and still provides
5745 some protection against outright memory corrupting writes, but allows
5746 erroneously read data to propagate within a program.
5747
5748 @item -fthread-jumps
5749 @opindex fthread-jumps
5750 Perform optimizations where we check to see if a jump branches to a
5751 location where another comparison subsumed by the first is found.  If
5752 so, the first branch is redirected to either the destination of the
5753 second branch or a point immediately following it, depending on whether
5754 the condition is known to be true or false.
5755
5756 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5757
5758 @item -fsplit-wide-types
5759 @opindex fsplit-wide-types
5760 When using a type that occupies multiple registers, such as @code{long
5761 long} on a 32-bit system, split the registers apart and allocate them
5762 independently.  This normally generates better code for those types,
5763 but may make debugging more difficult.
5764
5765 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
5766 @option{-Os}.
5767
5768 @item -fcse-follow-jumps
5769 @opindex fcse-follow-jumps
5770 In common subexpression elimination (CSE), scan through jump instructions
5771 when the target of the jump is not reached by any other path.  For
5772 example, when CSE encounters an @code{if} statement with an
5773 @code{else} clause, CSE will follow the jump when the condition
5774 tested is false.
5775
5776 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5777
5778 @item -fcse-skip-blocks
5779 @opindex fcse-skip-blocks
5780 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
5781 follow jumps which conditionally skip over blocks.  When CSE
5782 encounters a simple @code{if} statement with no else clause,
5783 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
5784 body of the @code{if}.
5785
5786 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5787
5788 @item -frerun-cse-after-loop
5789 @opindex frerun-cse-after-loop
5790 Re-run common subexpression elimination after loop optimizations has been
5791 performed.
5792
5793 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5794
5795 @item -fgcse
5796 @opindex fgcse
5797 Perform a global common subexpression elimination pass.
5798 This pass also performs global constant and copy propagation.
5799
5800 @emph{Note:} When compiling a program using computed gotos, a GCC
5801 extension, you may get better runtime performance if you disable
5802 the global common subexpression elimination pass by adding
5803 @option{-fno-gcse} to the command line.
5804
5805 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5806
5807 @item -fgcse-lm
5808 @opindex fgcse-lm
5809 When @option{-fgcse-lm} is enabled, global common subexpression elimination will
5810 attempt to move loads which are only killed by stores into themselves.  This
5811 allows a loop containing a load/store sequence to be changed to a load outside
5812 the loop, and a copy/store within the loop.
5813
5814 Enabled by default when gcse is enabled.
5815
5816 @item -fgcse-sm
5817 @opindex fgcse-sm
5818 When @option{-fgcse-sm} is enabled, a store motion pass is run after
5819 global common subexpression elimination.  This pass will attempt to move
5820 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
5821 loops containing a load/store sequence can be changed to a load before
5822 the loop and a store after the loop.
5823
5824 Not enabled at any optimization level.
5825
5826 @item -fgcse-las
5827 @opindex fgcse-las
5828 When @option{-fgcse-las} is enabled, the global common subexpression
5829 elimination pass eliminates redundant loads that come after stores to the
5830 same memory location (both partial and full redundancies).
5831
5832 Not enabled at any optimization level.
5833
5834 @item -fgcse-after-reload
5835 @opindex fgcse-after-reload
5836 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
5837 pass is performed after reload.  The purpose of this pass is to cleanup
5838 redundant spilling.
5839
5840 @item -funsafe-loop-optimizations
5841 @opindex funsafe-loop-optimizations
5842 If given, the loop optimizer will assume that loop indices do not
5843 overflow, and that the loops with nontrivial exit condition are not
5844 infinite.  This enables a wider range of loop optimizations even if
5845 the loop optimizer itself cannot prove that these assumptions are valid.
5846 Using @option{-Wunsafe-loop-optimizations}, the compiler will warn you
5847 if it finds this kind of loop.
5848
5849 @item -fcrossjumping
5850 @opindex fcrossjumping
5851 Perform cross-jumping transformation.  This transformation unifies equivalent code and save code size.  The
5852 resulting code may or may not perform better than without cross-jumping.
5853
5854 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5855
5856 @item -fauto-inc-dec
5857 @opindex fauto-inc-dec
5858 Combine increments or decrements of addresses with memory accesses.
5859 This pass is always skipped on architectures that do not have
5860 instructions to support this.  Enabled by default at @option{-O} and
5861 higher on architectures that support this.
5862
5863 @item -fdce
5864 @opindex fdce
5865 Perform dead code elimination (DCE) on RTL@.
5866 Enabled by default at @option{-O} and higher.
5867
5868 @item -fdse
5869 @opindex fdse
5870 Perform dead store elimination (DSE) on RTL@.
5871 Enabled by default at @option{-O} and higher.
5872
5873 @item -fif-conversion
5874 @opindex fif-conversion
5875 Attempt to transform conditional jumps into branch-less equivalents.  This
5876 include use of conditional moves, min, max, set flags and abs instructions, and
5877 some tricks doable by standard arithmetics.  The use of conditional execution
5878 on chips where it is available is controlled by @code{if-conversion2}.
5879
5880 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5881
5882 @item -fif-conversion2
5883 @opindex fif-conversion2
5884 Use conditional execution (where available) to transform conditional jumps into
5885 branch-less equivalents.
5886
5887 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5888
5889 @item -fdelete-null-pointer-checks
5890 @opindex fdelete-null-pointer-checks
5891 Assume that programs cannot safely dereference null pointers, and that
5892 no code or data element resides there.  This enables simple constant
5893 folding optimizations at all optimization levels.  In addition, other
5894 optimization passes in GCC use this flag to control global dataflow
5895 analyses that eliminate useless checks for null pointers; these assume
5896 that if a pointer is checked after it has already been dereferenced,
5897 it cannot be null.
5898
5899 Note however that in some environments this assumption is not true.
5900 Use @option{-fno-delete-null-pointer-checks} to disable this optimization
5901 for programs which depend on that behavior.
5902
5903 Some targets, especially embedded ones, disable this option at all levels.
5904 Otherwise it is enabled at all levels: @option{-O0}, @option{-O1},
5905 @option{-O2}, @option{-O3}, @option{-Os}.  Passes that use the information
5906 are enabled independently at different optimization levels.
5907
5908 @item -fexpensive-optimizations
5909 @opindex fexpensive-optimizations
5910 Perform a number of minor optimizations that are relatively expensive.
5911
5912 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5913
5914 @item -foptimize-register-move
5915 @itemx -fregmove
5916 @opindex foptimize-register-move
5917 @opindex fregmove
5918 Attempt to reassign register numbers in move instructions and as
5919 operands of other simple instructions in order to maximize the amount of
5920 register tying.  This is especially helpful on machines with two-operand
5921 instructions.
5922
5923 Note @option{-fregmove} and @option{-foptimize-register-move} are the same
5924 optimization.
5925
5926 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5927
5928 @item -fira-algorithm=@var{algorithm}
5929 Use specified coloring algorithm for the integrated register
5930 allocator.  The @var{algorithm} argument should be @code{priority} or
5931 @code{CB}.  The first algorithm specifies Chow's priority coloring,
5932 the second one specifies Chaitin-Briggs coloring.  The second
5933 algorithm can be unimplemented for some architectures.  If it is
5934 implemented, it is the default because Chaitin-Briggs coloring as a
5935 rule generates a better code.
5936
5937 @item -fira-region=@var{region}
5938 Use specified regions for the integrated register allocator.  The
5939 @var{region} argument should be one of @code{all}, @code{mixed}, or
5940 @code{one}.  The first value means using all loops as register
5941 allocation regions, the second value which is the default means using
5942 all loops except for loops with small register pressure as the
5943 regions, and third one means using all function as a single region.
5944 The first value can give best result for machines with small size and
5945 irregular register set, the third one results in faster and generates
5946 decent code and the smallest size code, and the default value usually
5947 give the best results in most cases and for most architectures.
5948
5949 @item -fira-coalesce
5950 @opindex fira-coalesce
5951 Do optimistic register coalescing.  This option might be profitable for
5952 architectures with big regular register files.
5953
5954 @item -fno-ira-share-save-slots
5955 @opindex fno-ira-share-save-slots
5956 Switch off sharing stack slots used for saving call used hard
5957 registers living through a call.  Each hard register will get a
5958 separate stack slot and as a result function stack frame will be
5959 bigger.
5960
5961 @item -fno-ira-share-spill-slots
5962 @opindex fno-ira-share-spill-slots
5963 Switch off sharing stack slots allocated for pseudo-registers.  Each
5964 pseudo-register which did not get a hard register will get a separate
5965 stack slot and as a result function stack frame will be bigger.
5966
5967 @item -fira-verbose=@var{n}
5968 @opindex fira-verbose
5969 Set up how verbose dump file for the integrated register allocator
5970 will be.  Default value is 5.  If the value is greater or equal to 10,
5971 the dump file will be stderr as if the value were @var{n} minus 10.
5972
5973 @item -fdelayed-branch
5974 @opindex fdelayed-branch
5975 If supported for the target machine, attempt to reorder instructions
5976 to exploit instruction slots available after delayed branch
5977 instructions.
5978
5979 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5980
5981 @item -fschedule-insns
5982 @opindex fschedule-insns
5983 If supported for the target machine, attempt to reorder instructions to
5984 eliminate execution stalls due to required data being unavailable.  This
5985 helps machines that have slow floating point or memory load instructions
5986 by allowing other instructions to be issued until the result of the load
5987 or floating point instruction is required.
5988
5989 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5990
5991 @item -fschedule-insns2
5992 @opindex fschedule-insns2
5993 Similar to @option{-fschedule-insns}, but requests an additional pass of
5994 instruction scheduling after register allocation has been done.  This is
5995 especially useful on machines with a relatively small number of
5996 registers and where memory load instructions take more than one cycle.
5997
5998 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5999
6000 @item -fno-sched-interblock
6001 @opindex fno-sched-interblock
6002 Don't schedule instructions across basic blocks.  This is normally
6003 enabled by default when scheduling before register allocation, i.e.@:
6004 with @option{-fschedule-insns} or at @option{-O2} or higher.
6005
6006 @item -fno-sched-spec
6007 @opindex fno-sched-spec
6008 Don't allow speculative motion of non-load instructions.  This is normally
6009 enabled by default when scheduling before register allocation, i.e.@:
6010 with @option{-fschedule-insns} or at @option{-O2} or higher.
6011
6012 @item -fsched-spec-load
6013 @opindex fsched-spec-load
6014 Allow speculative motion of some load instructions.  This only makes
6015 sense when scheduling before register allocation, i.e.@: with
6016 @option{-fschedule-insns} or at @option{-O2} or higher.
6017
6018 @item -fsched-spec-load-dangerous
6019 @opindex fsched-spec-load-dangerous
6020 Allow speculative motion of more load instructions.  This only makes
6021 sense when scheduling before register allocation, i.e.@: with
6022 @option{-fschedule-insns} or at @option{-O2} or higher.
6023
6024 @item -fsched-stalled-insns
6025 @itemx -fsched-stalled-insns=@var{n}
6026 @opindex fsched-stalled-insns
6027 Define how many insns (if any) can be moved prematurely from the queue
6028 of stalled insns into the ready list, during the second scheduling pass.
6029 @option{-fno-sched-stalled-insns} means that no insns will be moved
6030 prematurely, @option{-fsched-stalled-insns=0} means there is no limit
6031 on how many queued insns can be moved prematurely.
6032 @option{-fsched-stalled-insns} without a value is equivalent to
6033 @option{-fsched-stalled-insns=1}.
6034
6035 @item -fsched-stalled-insns-dep
6036 @itemx -fsched-stalled-insns-dep=@var{n}
6037 @opindex fsched-stalled-insns-dep
6038 Define how many insn groups (cycles) will be examined for a dependency
6039 on a stalled insn that is candidate for premature removal from the queue
6040 of stalled insns.  This has an effect only during the second scheduling pass,
6041 and only if @option{-fsched-stalled-insns} is used.
6042 @option{-fno-sched-stalled-insns-dep} is equivalent to
6043 @option{-fsched-stalled-insns-dep=0}.
6044 @option{-fsched-stalled-insns-dep} without a value is equivalent to
6045 @option{-fsched-stalled-insns-dep=1}.
6046
6047 @item -fsched2-use-superblocks
6048 @opindex fsched2-use-superblocks
6049 When scheduling after register allocation, do use superblock scheduling
6050 algorithm.  Superblock scheduling allows motion across basic block boundaries
6051 resulting on faster schedules.  This option is experimental, as not all machine
6052 descriptions used by GCC model the CPU closely enough to avoid unreliable
6053 results from the algorithm.
6054
6055 This only makes sense when scheduling after register allocation, i.e.@: with
6056 @option{-fschedule-insns2} or at @option{-O2} or higher.
6057
6058 @item -fsched2-use-traces
6059 @opindex fsched2-use-traces
6060 Use @option{-fsched2-use-superblocks} algorithm when scheduling after register
6061 allocation and additionally perform code duplication in order to increase the
6062 size of superblocks using tracer pass.  See @option{-ftracer} for details on
6063 trace formation.
6064
6065 This mode should produce faster but significantly longer programs.  Also
6066 without @option{-fbranch-probabilities} the traces constructed may not
6067 match the reality and hurt the performance.  This only makes
6068 sense when scheduling after register allocation, i.e.@: with
6069 @option{-fschedule-insns2} or at @option{-O2} or higher.
6070
6071 @item -fsee
6072 @opindex fsee
6073 Eliminate redundant sign extension instructions and move the non-redundant
6074 ones to optimal placement using lazy code motion (LCM).
6075
6076 @item -freschedule-modulo-scheduled-loops
6077 @opindex freschedule-modulo-scheduled-loops
6078 The modulo scheduling comes before the traditional scheduling, if a loop
6079 was modulo scheduled we may want to prevent the later scheduling passes
6080 from changing its schedule, we use this option to control that.
6081
6082 @item -fselective-scheduling
6083 @opindex fselective-scheduling
6084 Schedule instructions using selective scheduling algorithm.  Selective
6085 scheduling runs instead of the first scheduler pass.
6086
6087 @item -fselective-scheduling2
6088 @opindex fselective-scheduling2
6089 Schedule instructions using selective scheduling algorithm.  Selective
6090 scheduling runs instead of the second scheduler pass.
6091
6092 @item -fsel-sched-pipelining
6093 @opindex fsel-sched-pipelining
6094 Enable software pipelining of innermost loops during selective scheduling.  
6095 This option has no effect until one of @option{-fselective-scheduling} or 
6096 @option{-fselective-scheduling2} is turned on.
6097
6098 @item -fsel-sched-pipelining-outer-loops
6099 @opindex fsel-sched-pipelining-outer-loops
6100 When pipelining loops during selective scheduling, also pipeline outer loops.
6101 This option has no effect until @option{-fsel-sched-pipelining} is turned on.
6102
6103 @item -fcaller-saves
6104 @opindex fcaller-saves
6105 Enable values to be allocated in registers that will be clobbered by
6106 function calls, by emitting extra instructions to save and restore the
6107 registers around such calls.  Such allocation is done only when it
6108 seems to result in better code than would otherwise be produced.
6109
6110 This option is always enabled by default on certain machines, usually
6111 those which have no call-preserved registers to use instead.
6112
6113 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6114
6115 @item -fconserve-stack
6116 @opindex fconserve-stack
6117 Attempt to minimize stack usage.  The compiler will attempt to use less
6118 stack space, even if that makes the program slower.  This option
6119 implies setting the @option{large-stack-frame} parameter to 100
6120 and the @option{large-stack-frame-growth} parameter to 400.
6121
6122 @item -ftree-reassoc
6123 @opindex ftree-reassoc
6124 Perform reassociation on trees.  This flag is enabled by default
6125 at @option{-O} and higher.
6126
6127 @item -ftree-pre
6128 @opindex ftree-pre
6129 Perform partial redundancy elimination (PRE) on trees.  This flag is
6130 enabled by default at @option{-O2} and @option{-O3}.
6131
6132 @item -ftree-fre
6133 @opindex ftree-fre
6134 Perform full redundancy elimination (FRE) on trees.  The difference
6135 between FRE and PRE is that FRE only considers expressions
6136 that are computed on all paths leading to the redundant computation.
6137 This analysis is faster than PRE, though it exposes fewer redundancies.
6138 This flag is enabled by default at @option{-O} and higher.
6139
6140 @item -ftree-copy-prop
6141 @opindex ftree-copy-prop
6142 Perform copy propagation on trees.  This pass eliminates unnecessary
6143 copy operations.  This flag is enabled by default at @option{-O} and
6144 higher.
6145
6146 @item -fipa-pure-const
6147 @opindex fipa-pure-const
6148 Discover which functions are pure or constant.
6149 Enabled by default at @option{-O} and higher.
6150
6151 @item -fipa-reference
6152 @opindex fipa-reference
6153 Discover which static variables do not escape cannot escape the
6154 compilation unit.
6155 Enabled by default at @option{-O} and higher.
6156
6157 @item -fipa-struct-reorg
6158 @opindex fipa-struct-reorg
6159 Perform structure reorganization optimization, that change C-like structures 
6160 layout in order to better utilize spatial locality.  This transformation is 
6161 affective for programs containing arrays of structures.  Available in two 
6162 compilation modes: profile-based (enabled with @option{-fprofile-generate})
6163 or static (which uses built-in heuristics).  Require @option{-fipa-type-escape}
6164 to provide the safety of this transformation.  It works only in whole program
6165 mode, so it requires @option{-fwhole-program} and @option{-combine} to be
6166 enabled.  Structures considered @samp{cold} by this transformation are not
6167 affected (see @option{--param struct-reorg-cold-struct-ratio=@var{value}}).
6168
6169 With this flag, the program debug info reflects a new structure layout.
6170
6171 @item -fipa-pta
6172 @opindex fipa-pta
6173 Perform interprocedural pointer analysis.  This option is experimental
6174 and does not affect generated code.
6175
6176 @item -fipa-cp
6177 @opindex fipa-cp
6178 Perform interprocedural constant propagation.
6179 This optimization analyzes the program to determine when values passed
6180 to functions are constants and then optimizes accordingly.  
6181 This optimization can substantially increase performance
6182 if the application has constants passed to functions.
6183 This flag is enabled by default at @option{-O2}, @option{-Os} and @option{-O3}.
6184
6185 @item -fipa-cp-clone
6186 @opindex fipa-cp-clone
6187 Perform function cloning to make interprocedural constant propagation stronger.
6188 When enabled, interprocedural constant propagation will perform function cloning
6189 when externally visible function can be called with constant arguments.
6190 Because this optimization can create multiple copies of functions,
6191 it may significantly increase code size
6192 (see @option{--param ipcp-unit-growth=@var{value}}).
6193 This flag is enabled by default at @option{-O3}.
6194
6195 @item -fipa-matrix-reorg
6196 @opindex fipa-matrix-reorg
6197 Perform matrix flattening and transposing.
6198 Matrix flattening tries to replace a m-dimensional matrix 
6199 with its equivalent n-dimensional matrix, where n < m.
6200 This reduces the level of indirection needed for accessing the elements
6201 of the matrix. The second optimization is matrix transposing that
6202 attempts to change the order of the matrix's dimensions in order to
6203 improve cache locality.
6204 Both optimizations need the @option{-fwhole-program} flag. 
6205 Transposing is enabled only if profiling information is available.
6206
6207
6208 @item -ftree-sink
6209 @opindex ftree-sink
6210 Perform forward store motion  on trees.  This flag is
6211 enabled by default at @option{-O} and higher.
6212
6213 @item -ftree-ccp
6214 @opindex ftree-ccp
6215 Perform sparse conditional constant propagation (CCP) on trees.  This
6216 pass only operates on local scalar variables and is enabled by default
6217 at @option{-O} and higher.
6218
6219 @item -ftree-switch-conversion
6220 Perform conversion of simple initializations in a switch to
6221 initializations from a scalar array.  This flag is enabled by default
6222 at @option{-O2} and higher.
6223
6224 @item -ftree-dce
6225 @opindex ftree-dce
6226 Perform dead code elimination (DCE) on trees.  This flag is enabled by
6227 default at @option{-O} and higher.
6228
6229 @item -ftree-builtin-call-dce
6230 @opindex ftree-builtin-call-dce
6231 Perform conditional dead code elimination (DCE) for calls to builtin functions 
6232 that may set @code{errno} but are otherwise side-effect free.  This flag is 
6233 enabled by default at @option{-O2} and higher if @option{-Os} is not also 
6234 specified.
6235
6236 @item -ftree-dominator-opts
6237 @opindex ftree-dominator-opts
6238 Perform a variety of simple scalar cleanups (constant/copy
6239 propagation, redundancy elimination, range propagation and expression
6240 simplification) based on a dominator tree traversal.  This also
6241 performs jump threading (to reduce jumps to jumps). This flag is
6242 enabled by default at @option{-O} and higher.
6243
6244 @item -ftree-dse
6245 @opindex ftree-dse
6246 Perform dead store elimination (DSE) on trees.  A dead store is a store into
6247 a memory location which will later be overwritten by another store without
6248 any intervening loads.  In this case the earlier store can be deleted.  This
6249 flag is enabled by default at @option{-O} and higher.
6250
6251 @item -ftree-ch
6252 @opindex ftree-ch
6253 Perform loop header copying on trees.  This is beneficial since it increases
6254 effectiveness of code motion optimizations.  It also saves one jump.  This flag
6255 is enabled by default at @option{-O} and higher.  It is not enabled
6256 for @option{-Os}, since it usually increases code size.
6257
6258 @item -ftree-loop-optimize
6259 @opindex ftree-loop-optimize
6260 Perform loop optimizations on trees.  This flag is enabled by default
6261 at @option{-O} and higher.
6262
6263 @item -ftree-loop-linear
6264 @opindex ftree-loop-linear
6265 Perform linear loop transformations on tree.  This flag can improve cache
6266 performance and allow further loop optimizations to take place.
6267
6268 @item -floop-interchange
6269 Perform loop interchange transformations on loops.  Interchanging two
6270 nested loops switches the inner and outer loops.  For example, given a
6271 loop like:
6272 @smallexample
6273 DO J = 1, M
6274   DO I = 1, N
6275     A(J, I) = A(J, I) * C
6276   ENDDO
6277 ENDDO
6278 @end smallexample
6279 loop interchange will transform the loop as if the user had written:
6280 @smallexample
6281 DO I = 1, N
6282   DO J = 1, M
6283     A(J, I) = A(J, I) * C
6284   ENDDO
6285 ENDDO
6286 @end smallexample
6287 which can be beneficial when @code{N} is larger than the caches,
6288 because in Fortran, the elements of an array are stored in memory
6289 contiguously by column, and the original loop iterates over rows,
6290 potentially creating at each access a cache miss.  This optimization
6291 applies to all the languages supported by GCC and is not limited to
6292 Fortran.  To use this code transformation, GCC has to be configured
6293 with @option{--with-ppl} and @option{--with-cloog} to enable the
6294 Graphite loop transformation infrastructure.
6295
6296 @item -floop-strip-mine
6297 Perform loop strip mining transformations on loops.  Strip mining
6298 splits a loop into two nested loops.  The outer loop has strides 
6299 equal to the strip size and the inner loop has strides of the 
6300 original loop within a strip.  For example, given a loop like:
6301 @smallexample
6302 DO I = 1, N
6303   A(I) = A(I) + C
6304 ENDDO
6305 @end smallexample
6306 loop strip mining will transform the loop as if the user had written:
6307 @smallexample
6308 DO II = 1, N, 4
6309   DO I = II, min (II + 3, N)
6310     A(I) = A(I) + C
6311   ENDDO
6312 ENDDO
6313 @end smallexample
6314 This optimization applies to all the languages supported by GCC and is
6315 not limited to Fortran.  To use this code transformation, GCC has to
6316 be configured with @option{--with-ppl} and @option{--with-cloog} to
6317 enable the Graphite loop transformation infrastructure.
6318
6319 @item -floop-block
6320 Perform loop blocking transformations on loops.  Blocking strip mines
6321 each loop in the loop nest such that the memory accesses of the
6322 element loops fit inside caches.  For example, given a loop like:
6323 @smallexample
6324 DO I = 1, N
6325   DO J = 1, M
6326     A(J, I) = B(I) + C(J)
6327   ENDDO
6328 ENDDO
6329 @end smallexample
6330 loop blocking will transform the loop as if the user had written:
6331 @smallexample
6332 DO II = 1, N, 64
6333   DO JJ = 1, M, 64
6334     DO I = II, min (II + 63, N)
6335       DO J = JJ, min (JJ + 63, M)
6336         A(J, I) = B(I) + C(J)
6337       ENDDO
6338     ENDDO
6339   ENDDO
6340 ENDDO
6341 @end smallexample
6342 which can be beneficial when @code{M} is larger than the caches,
6343 because the innermost loop will iterate over a smaller amount of data
6344 that can be kept in the caches.  This optimization applies to all the
6345 languages supported by GCC and is not limited to Fortran.  To use this
6346 code transformation, GCC has to be configured with @option{--with-ppl}
6347 and @option{--with-cloog} to enable the Graphite loop transformation
6348 infrastructure.
6349
6350 @item -fcheck-data-deps
6351 @opindex fcheck-data-deps
6352 Compare the results of several data dependence analyzers.  This option
6353 is used for debugging the data dependence analyzers.
6354
6355 @item -ftree-loop-distribution
6356 Perform loop distribution.  This flag can improve cache performance on
6357 big loop bodies and allow further loop optimizations, like
6358 parallelization or vectorization, to take place.  For example, the loop
6359 @smallexample
6360 DO I = 1, N
6361   A(I) = B(I) + C
6362   D(I) = E(I) * F
6363 ENDDO
6364 @end smallexample
6365 is transformed to
6366 @smallexample
6367 DO I = 1, N
6368    A(I) = B(I) + C
6369 ENDDO
6370 DO I = 1, N
6371    D(I) = E(I) * F
6372 ENDDO
6373 @end smallexample
6374
6375 @item -ftree-loop-im
6376 @opindex ftree-loop-im
6377 Perform loop invariant motion on trees.  This pass moves only invariants that
6378 would be hard to handle at RTL level (function calls, operations that expand to
6379 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
6380 operands of conditions that are invariant out of the loop, so that we can use
6381 just trivial invariantness analysis in loop unswitching.  The pass also includes
6382 store motion.
6383
6384 @item -ftree-loop-ivcanon
6385 @opindex ftree-loop-ivcanon
6386 Create a canonical counter for number of iterations in the loop for that
6387 determining number of iterations requires complicated analysis.  Later
6388 optimizations then may determine the number easily.  Useful especially
6389 in connection with unrolling.
6390
6391 @item -fivopts
6392 @opindex fivopts
6393 Perform induction variable optimizations (strength reduction, induction
6394 variable merging and induction variable elimination) on trees.
6395
6396 @item -ftree-parallelize-loops=n
6397 @opindex ftree-parallelize-loops
6398 Parallelize loops, i.e., split their iteration space to run in n threads.
6399 This is only possible for loops whose iterations are independent
6400 and can be arbitrarily reordered.  The optimization is only
6401 profitable on multiprocessor machines, for loops that are CPU-intensive,
6402 rather than constrained e.g.@: by memory bandwidth.  This option
6403 implies @option{-pthread}, and thus is only supported on targets
6404 that have support for @option{-pthread}.
6405
6406 @item -ftree-sra
6407 @opindex ftree-sra
6408 Perform scalar replacement of aggregates.  This pass replaces structure
6409 references with scalars to prevent committing structures to memory too
6410 early.  This flag is enabled by default at @option{-O} and higher.
6411
6412 @item -ftree-copyrename
6413 @opindex ftree-copyrename
6414 Perform copy renaming on trees.  This pass attempts to rename compiler
6415 temporaries to other variables at copy locations, usually resulting in
6416 variable names which more closely resemble the original variables.  This flag
6417 is enabled by default at @option{-O} and higher.
6418
6419 @item -ftree-ter
6420 @opindex ftree-ter
6421 Perform temporary expression replacement during the SSA->normal phase.  Single
6422 use/single def temporaries are replaced at their use location with their
6423 defining expression.  This results in non-GIMPLE code, but gives the expanders
6424 much more complex trees to work on resulting in better RTL generation.  This is
6425 enabled by default at @option{-O} and higher.
6426
6427 @item -ftree-vectorize
6428 @opindex ftree-vectorize
6429 Perform loop vectorization on trees. This flag is enabled by default at
6430 @option{-O3}.
6431
6432 @item -ftree-vect-loop-version
6433 @opindex ftree-vect-loop-version
6434 Perform loop versioning when doing loop vectorization on trees.  When a loop
6435 appears to be vectorizable except that data alignment or data dependence cannot
6436 be determined at compile time then vectorized and non-vectorized versions of
6437 the loop are generated along with runtime checks for alignment or dependence
6438 to control which version is executed.  This option is enabled by default
6439 except at level @option{-Os} where it is disabled.
6440
6441 @item -fvect-cost-model
6442 @opindex fvect-cost-model
6443 Enable cost model for vectorization.
6444
6445 @item -ftree-vrp
6446 @opindex ftree-vrp
6447 Perform Value Range Propagation on trees.  This is similar to the
6448 constant propagation pass, but instead of values, ranges of values are
6449 propagated.  This allows the optimizers to remove unnecessary range
6450 checks like array bound checks and null pointer checks.  This is
6451 enabled by default at @option{-O2} and higher.  Null pointer check
6452 elimination is only done if @option{-fdelete-null-pointer-checks} is
6453 enabled.
6454
6455 @item -ftracer
6456 @opindex ftracer
6457 Perform tail duplication to enlarge superblock size.  This transformation
6458 simplifies the control flow of the function allowing other optimizations to do
6459 better job.
6460
6461 @item -funroll-loops
6462 @opindex funroll-loops
6463 Unroll loops whose number of iterations can be determined at compile
6464 time or upon entry to the loop.  @option{-funroll-loops} implies
6465 @option{-frerun-cse-after-loop}.  This option makes code larger,
6466 and may or may not make it run faster.
6467
6468 @item -funroll-all-loops
6469 @opindex funroll-all-loops
6470 Unroll all loops, even if their number of iterations is uncertain when
6471 the loop is entered.  This usually makes programs run more slowly.
6472 @option{-funroll-all-loops} implies the same options as
6473 @option{-funroll-loops},
6474
6475 @item -fsplit-ivs-in-unroller
6476 @opindex fsplit-ivs-in-unroller
6477 Enables expressing of values of induction variables in later iterations
6478 of the unrolled loop using the value in the first iteration.  This breaks
6479 long dependency chains, thus improving efficiency of the scheduling passes.
6480
6481 Combination of @option{-fweb} and CSE is often sufficient to obtain the
6482 same effect.  However in cases the loop body is more complicated than
6483 a single basic block, this is not reliable.  It also does not work at all
6484 on some of the architectures due to restrictions in the CSE pass.
6485
6486 This optimization is enabled by default.
6487
6488 @item -fvariable-expansion-in-unroller
6489 @opindex fvariable-expansion-in-unroller
6490 With this option, the compiler will create multiple copies of some
6491 local variables when unrolling a loop which can result in superior code.
6492
6493 @item -fpredictive-commoning
6494 @opindex fpredictive-commoning
6495 Perform predictive commoning optimization, i.e., reusing computations
6496 (especially memory loads and stores) performed in previous
6497 iterations of loops.
6498
6499 This option is enabled at level @option{-O3}.
6500
6501 @item -fprefetch-loop-arrays
6502 @opindex fprefetch-loop-arrays
6503 If supported by the target machine, generate instructions to prefetch
6504 memory to improve the performance of loops that access large arrays.
6505
6506 This option may generate better or worse code; results are highly
6507 dependent on the structure of loops within the source code.
6508
6509 Disabled at level @option{-Os}.
6510
6511 @item -fno-peephole
6512 @itemx -fno-peephole2
6513 @opindex fno-peephole
6514 @opindex fno-peephole2
6515 Disable any machine-specific peephole optimizations.  The difference
6516 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
6517 are implemented in the compiler; some targets use one, some use the
6518 other, a few use both.
6519
6520 @option{-fpeephole} is enabled by default.
6521 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6522
6523 @item -fno-guess-branch-probability
6524 @opindex fno-guess-branch-probability
6525 Do not guess branch probabilities using heuristics.
6526
6527 GCC will use heuristics to guess branch probabilities if they are
6528 not provided by profiling feedback (@option{-fprofile-arcs}).  These
6529 heuristics are based on the control flow graph.  If some branch probabilities
6530 are specified by @samp{__builtin_expect}, then the heuristics will be
6531 used to guess branch probabilities for the rest of the control flow graph,
6532 taking the @samp{__builtin_expect} info into account.  The interactions
6533 between the heuristics and @samp{__builtin_expect} can be complex, and in
6534 some cases, it may be useful to disable the heuristics so that the effects
6535 of @samp{__builtin_expect} are easier to understand.
6536
6537 The default is @option{-fguess-branch-probability} at levels
6538 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6539
6540 @item -freorder-blocks
6541 @opindex freorder-blocks
6542 Reorder basic blocks in the compiled function in order to reduce number of
6543 taken branches and improve code locality.
6544
6545 Enabled at levels @option{-O2}, @option{-O3}.
6546
6547 @item -freorder-blocks-and-partition
6548 @opindex freorder-blocks-and-partition
6549 In addition to reordering basic blocks in the compiled function, in order
6550 to reduce number of taken branches, partitions hot and cold basic blocks
6551 into separate sections of the assembly and .o files, to improve
6552 paging and cache locality performance.
6553
6554 This optimization is automatically turned off in the presence of
6555 exception handling, for linkonce sections, for functions with a user-defined
6556 section attribute and on any architecture that does not support named
6557 sections.
6558
6559 @item -freorder-functions
6560 @opindex freorder-functions
6561 Reorder functions in the object file in order to
6562 improve code locality.  This is implemented by using special
6563 subsections @code{.text.hot} for most frequently executed functions and
6564 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
6565 the linker so object file format must support named sections and linker must
6566 place them in a reasonable way.
6567
6568 Also profile feedback must be available in to make this option effective.  See
6569 @option{-fprofile-arcs} for details.
6570
6571 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6572
6573 @item -fstrict-aliasing
6574 @opindex fstrict-aliasing
6575 Allows the compiler to assume the strictest aliasing rules applicable to
6576 the language being compiled.  For C (and C++), this activates
6577 optimizations based on the type of expressions.  In particular, an
6578 object of one type is assumed never to reside at the same address as an
6579 object of a different type, unless the types are almost the same.  For
6580 example, an @code{unsigned int} can alias an @code{int}, but not a
6581 @code{void*} or a @code{double}.  A character type may alias any other
6582 type.
6583
6584 @anchor{Type-punning}Pay special attention to code like this:
6585 @smallexample
6586 union a_union @{
6587   int i;
6588   double d;
6589 @};
6590
6591 int f() @{
6592   a_union t;
6593   t.d = 3.0;
6594   return t.i;
6595 @}
6596 @end smallexample
6597 The practice of reading from a different union member than the one most
6598 recently written to (called ``type-punning'') is common.  Even with
6599 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
6600 is accessed through the union type.  So, the code above will work as
6601 expected.  @xref{Structures unions enumerations and bit-fields
6602 implementation}.  However, this code might not:
6603 @smallexample
6604 int f() @{
6605   a_union t;
6606   int* ip;
6607   t.d = 3.0;
6608   ip = &t.i;
6609   return *ip;
6610 @}
6611 @end smallexample
6612
6613 Similarly, access by taking the address, casting the resulting pointer
6614 and dereferencing the result has undefined behavior, even if the cast
6615 uses a union type, e.g.:
6616 @smallexample
6617 int f() @{
6618   double d = 3.0;
6619   return ((union a_union *) &d)->i;
6620 @}
6621 @end smallexample
6622
6623 The @option{-fstrict-aliasing} option is enabled at levels
6624 @option{-O2}, @option{-O3}, @option{-Os}.
6625
6626 @item -fstrict-overflow
6627 @opindex fstrict-overflow
6628 Allow the compiler to assume strict signed overflow rules, depending
6629 on the language being compiled.  For C (and C++) this means that
6630 overflow when doing arithmetic with signed numbers is undefined, which
6631 means that the compiler may assume that it will not happen.  This
6632 permits various optimizations.  For example, the compiler will assume
6633 that an expression like @code{i + 10 > i} will always be true for
6634 signed @code{i}.  This assumption is only valid if signed overflow is
6635 undefined, as the expression is false if @code{i + 10} overflows when
6636 using twos complement arithmetic.  When this option is in effect any
6637 attempt to determine whether an operation on signed numbers will
6638 overflow must be written carefully to not actually involve overflow.
6639
6640 This option also allows the compiler to assume strict pointer
6641 semantics: given a pointer to an object, if adding an offset to that
6642 pointer does not produce a pointer to the same object, the addition is
6643 undefined.  This permits the compiler to conclude that @code{p + u >
6644 p} is always true for a pointer @code{p} and unsigned integer
6645 @code{u}.  This assumption is only valid because pointer wraparound is
6646 undefined, as the expression is false if @code{p + u} overflows using
6647 twos complement arithmetic.
6648
6649 See also the @option{-fwrapv} option.  Using @option{-fwrapv} means
6650 that integer signed overflow is fully defined: it wraps.  When
6651 @option{-fwrapv} is used, there is no difference between
6652 @option{-fstrict-overflow} and @option{-fno-strict-overflow} for
6653 integers.  With @option{-fwrapv} certain types of overflow are
6654 permitted.  For example, if the compiler gets an overflow when doing
6655 arithmetic on constants, the overflowed value can still be used with
6656 @option{-fwrapv}, but not otherwise.
6657
6658 The @option{-fstrict-overflow} option is enabled at levels
6659 @option{-O2}, @option{-O3}, @option{-Os}.
6660
6661 @item -falign-functions
6662 @itemx -falign-functions=@var{n}
6663 @opindex falign-functions
6664 Align the start of functions to the next power-of-two greater than
6665 @var{n}, skipping up to @var{n} bytes.  For instance,
6666 @option{-falign-functions=32} aligns functions to the next 32-byte
6667 boundary, but @option{-falign-functions=24} would align to the next
6668 32-byte boundary only if this can be done by skipping 23 bytes or less.
6669
6670 @option{-fno-align-functions} and @option{-falign-functions=1} are
6671 equivalent and mean that functions will not be aligned.
6672
6673 Some assemblers only support this flag when @var{n} is a power of two;
6674 in that case, it is rounded up.
6675
6676 If @var{n} is not specified or is zero, use a machine-dependent default.
6677
6678 Enabled at levels @option{-O2}, @option{-O3}.
6679
6680 @item -falign-labels
6681 @itemx -falign-labels=@var{n}
6682 @opindex falign-labels
6683 Align all branch targets to a power-of-two boundary, skipping up to
6684 @var{n} bytes like @option{-falign-functions}.  This option can easily
6685 make code slower, because it must insert dummy operations for when the
6686 branch target is reached in the usual flow of the code.
6687
6688 @option{-fno-align-labels} and @option{-falign-labels=1} are
6689 equivalent and mean that labels will not be aligned.
6690
6691 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
6692 are greater than this value, then their values are used instead.
6693
6694 If @var{n} is not specified or is zero, use a machine-dependent default
6695 which is very likely to be @samp{1}, meaning no alignment.
6696
6697 Enabled at levels @option{-O2}, @option{-O3}.
6698
6699 @item -falign-loops
6700 @itemx -falign-loops=@var{n}
6701 @opindex falign-loops
6702 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
6703 like @option{-falign-functions}.  The hope is that the loop will be
6704 executed many times, which will make up for any execution of the dummy
6705 operations.
6706
6707 @option{-fno-align-loops} and @option{-falign-loops=1} are
6708 equivalent and mean that loops will not be aligned.
6709
6710 If @var{n} is not specified or is zero, use a machine-dependent default.
6711
6712 Enabled at levels @option{-O2}, @option{-O3}.
6713
6714 @item -falign-jumps
6715 @itemx -falign-jumps=@var{n}
6716 @opindex falign-jumps
6717 Align branch targets to a power-of-two boundary, for branch targets
6718 where the targets can only be reached by jumping, skipping up to @var{n}
6719 bytes like @option{-falign-functions}.  In this case, no dummy operations
6720 need be executed.
6721
6722 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
6723 equivalent and mean that loops will not be aligned.
6724
6725 If @var{n} is not specified or is zero, use a machine-dependent default.
6726
6727 Enabled at levels @option{-O2}, @option{-O3}.
6728
6729 @item -funit-at-a-time
6730 @opindex funit-at-a-time
6731 This option is left for compatibility reasons. @option{-funit-at-a-time}
6732 has no effect, while @option{-fno-unit-at-a-time} implies
6733 @option{-fno-toplevel-reorder} and @option{-fno-section-anchors}.
6734
6735 Enabled by default.
6736
6737 @item -fno-toplevel-reorder
6738 @opindex fno-toplevel-reorder
6739 Do not reorder top-level functions, variables, and @code{asm}
6740 statements.  Output them in the same order that they appear in the
6741 input file.  When this option is used, unreferenced static variables
6742 will not be removed.  This option is intended to support existing code
6743 which relies on a particular ordering.  For new code, it is better to
6744 use attributes.
6745
6746 Enabled at level @option{-O0}.  When disabled explicitly, it also imply
6747 @option{-fno-section-anchors} that is otherwise enabled at @option{-O0} on some
6748 targets.
6749
6750 @item -fweb
6751 @opindex fweb
6752 Constructs webs as commonly used for register allocation purposes and assign
6753 each web individual pseudo register.  This allows the register allocation pass
6754 to operate on pseudos directly, but also strengthens several other optimization
6755 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
6756 however, make debugging impossible, since variables will no longer stay in a
6757 ``home register''.
6758
6759 Enabled by default with @option{-funroll-loops}.
6760
6761 @item -fwhole-program
6762 @opindex fwhole-program
6763 Assume that the current compilation unit represents whole program being
6764 compiled.  All public functions and variables with the exception of @code{main}
6765 and those merged by attribute @code{externally_visible} become static functions
6766 and in a affect gets more aggressively optimized by interprocedural optimizers.
6767 While this option is equivalent to proper use of @code{static} keyword for
6768 programs consisting of single file, in combination with option
6769 @option{--combine} this flag can be used to compile most of smaller scale C
6770 programs since the functions and variables become local for the whole combined
6771 compilation unit, not for the single source file itself.
6772
6773 This option is not supported for Fortran programs.
6774
6775 @item -fcprop-registers
6776 @opindex fcprop-registers
6777 After register allocation and post-register allocation instruction splitting,
6778 we perform a copy-propagation pass to try to reduce scheduling dependencies
6779 and occasionally eliminate the copy.
6780
6781 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6782
6783 @item -fprofile-correction
6784 @opindex fprofile-correction
6785 Profiles collected using an instrumented binary for multi-threaded programs may
6786 be inconsistent due to missed counter updates. When this option is specified,
6787 GCC will use heuristics to correct or smooth out such inconsistencies. By
6788 default, GCC will emit an error message when an inconsistent profile is detected.
6789
6790 @item -fprofile-dir=@var{path}
6791 @opindex fprofile-dir
6792
6793 Set the directory to search the profile data files in to @var{path}.
6794 This option affects only the profile data generated by
6795 @option{-fprofile-generate}, @option{-ftest-coverage}, @option{-fprofile-arcs}
6796 and used by @option{-fprofile-use} and @option{-fbranch-probabilities} 
6797 and its related options.
6798 By default, GCC will use the current directory as @var{path}
6799 thus the profile data file will appear in the same directory as the object file.
6800
6801 @item -fprofile-generate
6802 @itemx -fprofile-generate=@var{path}
6803 @opindex fprofile-generate
6804
6805 Enable options usually used for instrumenting application to produce
6806 profile useful for later recompilation with profile feedback based
6807 optimization.  You must use @option{-fprofile-generate} both when
6808 compiling and when linking your program.
6809
6810 The following options are enabled: @code{-fprofile-arcs}, @code{-fprofile-values}, @code{-fvpt}.
6811
6812 If @var{path} is specified, GCC will look at the @var{path} to find
6813 the profile feedback data files. See @option{-fprofile-dir}.
6814
6815 @item -fprofile-use
6816 @itemx -fprofile-use=@var{path}
6817 @opindex fprofile-use
6818 Enable profile feedback directed optimizations, and optimizations
6819 generally profitable only with profile feedback available.
6820
6821 The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt},
6822 @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}
6823
6824 By default, GCC emits an error message if the feedback profiles do not
6825 match the source code.  This error can be turned into a warning by using
6826 @option{-Wcoverage-mismatch}.  Note this may result in poorly optimized
6827 code.
6828
6829 If @var{path} is specified, GCC will look at the @var{path} to find
6830 the profile feedback data files. See @option{-fprofile-dir}.
6831 @end table
6832
6833 The following options control compiler behavior regarding floating
6834 point arithmetic.  These options trade off between speed and
6835 correctness.  All must be specifically enabled.
6836
6837 @table @gcctabopt
6838 @item -ffloat-store
6839 @opindex ffloat-store
6840 Do not store floating point variables in registers, and inhibit other
6841 options that might change whether a floating point value is taken from a
6842 register or memory.
6843
6844 @cindex floating point precision
6845 This option prevents undesirable excess precision on machines such as
6846 the 68000 where the floating registers (of the 68881) keep more
6847 precision than a @code{double} is supposed to have.  Similarly for the
6848 x86 architecture.  For most programs, the excess precision does only
6849 good, but a few programs rely on the precise definition of IEEE floating
6850 point.  Use @option{-ffloat-store} for such programs, after modifying
6851 them to store all pertinent intermediate computations into variables.
6852
6853 @item -fexcess-precision=@var{style}
6854 @opindex fexcess-precision
6855 This option allows further control over excess precision on machines
6856 where floating-point registers have more precision than the IEEE
6857 @code{float} and @code{double} types and the processor does not
6858 support operations rounding to those types.  By default,
6859 @option{-fexcess-precision=fast} is in effect; this means that
6860 operations are carried out in the precision of the registers and that
6861 it is unpredictable when rounding to the types specified in the source
6862 code takes place.  When compiling C, if
6863 @option{-fexcess-precision=standard} is specified then excess
6864 precision will follow the rules specified in ISO C99; in particular,
6865 both casts and assignments cause values to be rounded to their
6866 semantic types (whereas @option{-ffloat-store} only affects
6867 assignments).  This option is enabled by default for C if a strict
6868 conformance option such as @option{-std=c99} is used.
6869
6870 @opindex mfpmath
6871 @option{-fexcess-precision=standard} is not implemented for languages
6872 other than C, and has no effect if
6873 @option{-funsafe-math-optimizations} or @option{-ffast-math} is
6874 specified.  On the x86, it also has no effect if @option{-mfpmath=sse}
6875 or @option{-mfpmath=sse+387} is specified; in the former case, IEEE
6876 semantics apply without excess precision, and in the latter, rounding
6877 is unpredictable.
6878
6879 @item -ffast-math
6880 @opindex ffast-math
6881 Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations},
6882 @option{-ffinite-math-only}, @option{-fno-rounding-math},
6883 @option{-fno-signaling-nans} and @option{-fcx-limited-range}.
6884
6885 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
6886
6887 This option is not turned on by any @option{-O} option since
6888 it can result in incorrect output for programs which depend on
6889 an exact implementation of IEEE or ISO rules/specifications for
6890 math functions. It may, however, yield faster code for programs
6891 that do not require the guarantees of these specifications.
6892
6893 @item -fno-math-errno
6894 @opindex fno-math-errno
6895 Do not set ERRNO after calling math functions that are executed
6896 with a single instruction, e.g., sqrt.  A program that relies on
6897 IEEE exceptions for math error handling may want to use this flag
6898 for speed while maintaining IEEE arithmetic compatibility.
6899
6900 This option is not turned on by any @option{-O} option since
6901 it can result in incorrect output for programs which depend on
6902 an exact implementation of IEEE or ISO rules/specifications for
6903 math functions. It may, however, yield faster code for programs
6904 that do not require the guarantees of these specifications.
6905
6906 The default is @option{-fmath-errno}.
6907
6908 On Darwin systems, the math library never sets @code{errno}.  There is
6909 therefore no reason for the compiler to consider the possibility that
6910 it might, and @option{-fno-math-errno} is the default.
6911
6912 @item -funsafe-math-optimizations
6913 @opindex funsafe-math-optimizations
6914
6915 Allow optimizations for floating-point arithmetic that (a) assume
6916 that arguments and results are valid and (b) may violate IEEE or
6917 ANSI standards.  When used at link-time, it may include libraries
6918 or startup files that change the default FPU control word or other
6919 similar optimizations.
6920
6921 This option is not turned on by any @option{-O} option since
6922 it can result in incorrect output for programs which depend on
6923 an exact implementation of IEEE or ISO rules/specifications for
6924 math functions. It may, however, yield faster code for programs
6925 that do not require the guarantees of these specifications.
6926 Enables @option{-fno-signed-zeros}, @option{-fno-trapping-math},
6927 @option{-fassociative-math} and @option{-freciprocal-math}.
6928
6929 The default is @option{-fno-unsafe-math-optimizations}.
6930
6931 @item -fassociative-math
6932 @opindex fassociative-math
6933
6934 Allow re-association of operands in series of floating-point operations.
6935 This violates the ISO C and C++ language standard by possibly changing
6936 computation result.  NOTE: re-ordering may change the sign of zero as
6937 well as ignore NaNs and inhibit or create underflow or overflow (and
6938 thus cannot be used on a code which relies on rounding behavior like
6939 @code{(x + 2**52) - 2**52)}.  May also reorder floating-point comparisons
6940 and thus may not be used when ordered comparisons are required.
6941 This option requires that both @option{-fno-signed-zeros} and
6942 @option{-fno-trapping-math} be in effect.  Moreover, it doesn't make
6943 much sense with @option{-frounding-math}.
6944
6945 The default is @option{-fno-associative-math}.
6946
6947 @item -freciprocal-math
6948 @opindex freciprocal-math
6949
6950 Allow the reciprocal of a value to be used instead of dividing by
6951 the value if this enables optimizations.  For example @code{x / y}
6952 can be replaced with @code{x * (1/y)} which is useful if @code{(1/y)}
6953 is subject to common subexpression elimination.  Note that this loses
6954 precision and increases the number of flops operating on the value.
6955
6956 The default is @option{-fno-reciprocal-math}.
6957
6958 @item -ffinite-math-only
6959 @opindex ffinite-math-only
6960 Allow optimizations for floating-point arithmetic that assume
6961 that arguments and results are not NaNs or +-Infs.
6962
6963 This option is not turned on by any @option{-O} option since
6964 it can result in incorrect output for programs which depend on
6965 an exact implementation of IEEE or ISO rules/specifications for
6966 math functions. It may, however, yield faster code for programs
6967 that do not require the guarantees of these specifications.
6968
6969 The default is @option{-fno-finite-math-only}.
6970
6971 @item -fno-signed-zeros
6972 @opindex fno-signed-zeros
6973 Allow optimizations for floating point arithmetic that ignore the
6974 signedness of zero.  IEEE arithmetic specifies the behavior of
6975 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
6976 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
6977 This option implies that the sign of a zero result isn't significant.
6978
6979 The default is @option{-fsigned-zeros}.
6980
6981 @item -fno-trapping-math
6982 @opindex fno-trapping-math
6983 Compile code assuming that floating-point operations cannot generate
6984 user-visible traps.  These traps include division by zero, overflow,
6985 underflow, inexact result and invalid operation.  This option requires
6986 that @option{-fno-signaling-nans} be in effect.  Setting this option may
6987 allow faster code if one relies on ``non-stop'' IEEE arithmetic, for example.
6988
6989 This option should never be turned on by any @option{-O} option since
6990 it can result in incorrect output for programs which depend on
6991 an exact implementation of IEEE or ISO rules/specifications for
6992 math functions.
6993
6994 The default is @option{-ftrapping-math}.
6995
6996 @item -frounding-math
6997 @opindex frounding-math
6998 Disable transformations and optimizations that assume default floating
6999 point rounding behavior.  This is round-to-zero for all floating point
7000 to integer conversions, and round-to-nearest for all other arithmetic
7001 truncations.  This option should be specified for programs that change
7002 the FP rounding mode dynamically, or that may be executed with a
7003 non-default rounding mode.  This option disables constant folding of
7004 floating point expressions at compile-time (which may be affected by
7005 rounding mode) and arithmetic transformations that are unsafe in the
7006 presence of sign-dependent rounding modes.
7007
7008 The default is @option{-fno-rounding-math}.
7009
7010 This option is experimental and does not currently guarantee to
7011 disable all GCC optimizations that are affected by rounding mode.
7012 Future versions of GCC may provide finer control of this setting
7013 using C99's @code{FENV_ACCESS} pragma.  This command line option
7014 will be used to specify the default state for @code{FENV_ACCESS}.
7015
7016 @item -fsignaling-nans
7017 @opindex fsignaling-nans
7018 Compile code assuming that IEEE signaling NaNs may generate user-visible
7019 traps during floating-point operations.  Setting this option disables
7020 optimizations that may change the number of exceptions visible with
7021 signaling NaNs.  This option implies @option{-ftrapping-math}.
7022
7023 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
7024 be defined.
7025
7026 The default is @option{-fno-signaling-nans}.
7027
7028 This option is experimental and does not currently guarantee to
7029 disable all GCC optimizations that affect signaling NaN behavior.
7030
7031 @item -fsingle-precision-constant
7032 @opindex fsingle-precision-constant
7033 Treat floating point constant as single precision constant instead of
7034 implicitly converting it to double precision constant.
7035
7036 @item -fcx-limited-range
7037 @opindex fcx-limited-range
7038 When enabled, this option states that a range reduction step is not
7039 needed when performing complex division.  Also, there is no checking
7040 whether the result of a complex multiplication or division is @code{NaN
7041 + I*NaN}, with an attempt to rescue the situation in that case.  The
7042 default is @option{-fno-cx-limited-range}, but is enabled by
7043 @option{-ffast-math}.
7044
7045 This option controls the default setting of the ISO C99
7046 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
7047 all languages.
7048
7049 @item -fcx-fortran-rules
7050 @opindex fcx-fortran-rules
7051 Complex multiplication and division follow Fortran rules.  Range
7052 reduction is done as part of complex division, but there is no checking
7053 whether the result of a complex multiplication or division is @code{NaN
7054 + I*NaN}, with an attempt to rescue the situation in that case.
7055
7056 The default is @option{-fno-cx-fortran-rules}.
7057
7058 @end table
7059
7060 The following options control optimizations that may improve
7061 performance, but are not enabled by any @option{-O} options.  This
7062 section includes experimental options that may produce broken code.
7063
7064 @table @gcctabopt
7065 @item -fbranch-probabilities
7066 @opindex fbranch-probabilities
7067 After running a program compiled with @option{-fprofile-arcs}
7068 (@pxref{Debugging Options,, Options for Debugging Your Program or
7069 @command{gcc}}), you can compile it a second time using
7070 @option{-fbranch-probabilities}, to improve optimizations based on
7071 the number of times each branch was taken.  When the program
7072 compiled with @option{-fprofile-arcs} exits it saves arc execution
7073 counts to a file called @file{@var{sourcename}.gcda} for each source
7074 file.  The information in this data file is very dependent on the
7075 structure of the generated code, so you must use the same source code
7076 and the same optimization options for both compilations.
7077
7078 With @option{-fbranch-probabilities}, GCC puts a
7079 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
7080 These can be used to improve optimization.  Currently, they are only
7081 used in one place: in @file{reorg.c}, instead of guessing which path a
7082 branch is mostly to take, the @samp{REG_BR_PROB} values are used to
7083 exactly determine which path is taken more often.
7084
7085 @item -fprofile-values
7086 @opindex fprofile-values
7087 If combined with @option{-fprofile-arcs}, it adds code so that some
7088 data about values of expressions in the program is gathered.
7089
7090 With @option{-fbranch-probabilities}, it reads back the data gathered
7091 from profiling values of expressions and adds @samp{REG_VALUE_PROFILE}
7092 notes to instructions for their later usage in optimizations.
7093
7094 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
7095
7096 @item -fvpt
7097 @opindex fvpt
7098 If combined with @option{-fprofile-arcs}, it instructs the compiler to add
7099 a code to gather information about values of expressions.
7100
7101 With @option{-fbranch-probabilities}, it reads back the data gathered
7102 and actually performs the optimizations based on them.
7103 Currently the optimizations include specialization of division operation
7104 using the knowledge about the value of the denominator.
7105
7106 @item -frename-registers
7107 @opindex frename-registers
7108 Attempt to avoid false dependencies in scheduled code by making use
7109 of registers left over after register allocation.  This optimization
7110 will most benefit processors with lots of registers.  Depending on the
7111 debug information format adopted by the target, however, it can
7112 make debugging impossible, since variables will no longer stay in
7113 a ``home register''.
7114
7115 Enabled by default with @option{-funroll-loops}.
7116
7117 @item -ftracer
7118 @opindex ftracer
7119 Perform tail duplication to enlarge superblock size.  This transformation
7120 simplifies the control flow of the function allowing other optimizations to do
7121 better job.
7122
7123 Enabled with @option{-fprofile-use}.
7124
7125 @item -funroll-loops
7126 @opindex funroll-loops
7127 Unroll loops whose number of iterations can be determined at compile time or
7128 upon entry to the loop.  @option{-funroll-loops} implies
7129 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
7130 It also turns on complete loop peeling (i.e.@: complete removal of loops with
7131 small constant number of iterations).  This option makes code larger, and may
7132 or may not make it run faster.
7133
7134 Enabled with @option{-fprofile-use}.
7135
7136 @item -funroll-all-loops
7137 @opindex funroll-all-loops
7138 Unroll all loops, even if their number of iterations is uncertain when
7139 the loop is entered.  This usually makes programs run more slowly.
7140 @option{-funroll-all-loops} implies the same options as
7141 @option{-funroll-loops}.
7142
7143 @item -fpeel-loops
7144 @opindex fpeel-loops
7145 Peels the loops for that there is enough information that they do not
7146 roll much (from profile feedback).  It also turns on complete loop peeling
7147 (i.e.@: complete removal of loops with small constant number of iterations).
7148
7149 Enabled with @option{-fprofile-use}.
7150
7151 @item -fmove-loop-invariants
7152 @opindex fmove-loop-invariants
7153 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
7154 at level @option{-O1}
7155
7156 @item -funswitch-loops
7157 @opindex funswitch-loops
7158 Move branches with loop invariant conditions out of the loop, with duplicates
7159 of the loop on both branches (modified according to result of the condition).
7160
7161 @item -ffunction-sections
7162 @itemx -fdata-sections
7163 @opindex ffunction-sections
7164 @opindex fdata-sections
7165 Place each function or data item into its own section in the output
7166 file if the target supports arbitrary sections.  The name of the
7167 function or the name of the data item determines the section's name
7168 in the output file.
7169
7170 Use these options on systems where the linker can perform optimizations
7171 to improve locality of reference in the instruction space.  Most systems
7172 using the ELF object format and SPARC processors running Solaris 2 have
7173 linkers with such optimizations.  AIX may have these optimizations in
7174 the future.
7175
7176 Only use these options when there are significant benefits from doing
7177 so.  When you specify these options, the assembler and linker will
7178 create larger object and executable files and will also be slower.
7179 You will not be able to use @code{gprof} on all systems if you
7180 specify this option and you may have problems with debugging if
7181 you specify both this option and @option{-g}.
7182
7183 @item -fbranch-target-load-optimize
7184 @opindex fbranch-target-load-optimize
7185 Perform branch target register load optimization before prologue / epilogue
7186 threading.
7187 The use of target registers can typically be exposed only during reload,
7188 thus hoisting loads out of loops and doing inter-block scheduling needs
7189 a separate optimization pass.
7190
7191 @item -fbranch-target-load-optimize2
7192 @opindex fbranch-target-load-optimize2
7193 Perform branch target register load optimization after prologue / epilogue
7194 threading.
7195
7196 @item -fbtr-bb-exclusive
7197 @opindex fbtr-bb-exclusive
7198 When performing branch target register load optimization, don't reuse
7199 branch target registers in within any basic block.
7200
7201 @item -fstack-protector
7202 @opindex fstack-protector
7203 Emit extra code to check for buffer overflows, such as stack smashing
7204 attacks.  This is done by adding a guard variable to functions with
7205 vulnerable objects.  This includes functions that call alloca, and
7206 functions with buffers larger than 8 bytes.  The guards are initialized
7207 when a function is entered and then checked when the function exits.
7208 If a guard check fails, an error message is printed and the program exits.
7209
7210 @item -fstack-protector-all
7211 @opindex fstack-protector-all
7212 Like @option{-fstack-protector} except that all functions are protected.
7213
7214 @item -fsection-anchors
7215 @opindex fsection-anchors
7216 Try to reduce the number of symbolic address calculations by using
7217 shared ``anchor'' symbols to address nearby objects.  This transformation
7218 can help to reduce the number of GOT entries and GOT accesses on some
7219 targets.
7220
7221 For example, the implementation of the following function @code{foo}:
7222
7223 @smallexample
7224 static int a, b, c;
7225 int foo (void) @{ return a + b + c; @}
7226 @end smallexample
7227
7228 would usually calculate the addresses of all three variables, but if you
7229 compile it with @option{-fsection-anchors}, it will access the variables
7230 from a common anchor point instead.  The effect is similar to the
7231 following pseudocode (which isn't valid C):
7232
7233 @smallexample
7234 int foo (void)
7235 @{
7236   register int *xr = &x;
7237   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
7238 @}
7239 @end smallexample
7240
7241 Not all targets support this option.
7242
7243 @item --param @var{name}=@var{value}
7244 @opindex param
7245 In some places, GCC uses various constants to control the amount of
7246 optimization that is done.  For example, GCC will not inline functions
7247 that contain more that a certain number of instructions.  You can
7248 control some of these constants on the command-line using the
7249 @option{--param} option.
7250
7251 The names of specific parameters, and the meaning of the values, are
7252 tied to the internals of the compiler, and are subject to change
7253 without notice in future releases.
7254
7255 In each case, the @var{value} is an integer.  The allowable choices for
7256 @var{name} are given in the following table:
7257
7258 @table @gcctabopt
7259 @item sra-max-structure-size
7260 The maximum structure size, in bytes, at which the scalar replacement
7261 of aggregates (SRA) optimization will perform block copies.  The
7262 default value, 0, implies that GCC will select the most appropriate
7263 size itself.
7264
7265 @item sra-field-structure-ratio
7266 The threshold ratio (as a percentage) between instantiated fields and
7267 the complete structure size.  We say that if the ratio of the number
7268 of bytes in instantiated fields to the number of bytes in the complete
7269 structure exceeds this parameter, then block copies are not used.  The
7270 default is 75.
7271
7272 @item struct-reorg-cold-struct-ratio
7273 The threshold ratio (as a percentage) between a structure frequency
7274 and the frequency of the hottest structure in the program.  This parameter
7275 is used by struct-reorg optimization enabled by @option{-fipa-struct-reorg}.
7276 We say that if the ratio of a structure frequency, calculated by profiling, 
7277 to the hottest structure frequency in the program is less than this 
7278 parameter, then structure reorganization is not applied to this structure.
7279 The default is 10.
7280
7281 @item predictable-branch-cost-outcome
7282 When branch is predicted to be taken with probability lower than this threshold
7283 (in percent), then it is considered well predictable. The default is 10.
7284
7285 @item max-crossjump-edges
7286 The maximum number of incoming edges to consider for crossjumping.
7287 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
7288 the number of edges incoming to each block.  Increasing values mean
7289 more aggressive optimization, making the compile time increase with
7290 probably small improvement in executable size.
7291
7292 @item min-crossjump-insns
7293 The minimum number of instructions which must be matched at the end
7294 of two blocks before crossjumping will be performed on them.  This
7295 value is ignored in the case where all instructions in the block being
7296 crossjumped from are matched.  The default value is 5.
7297
7298 @item max-grow-copy-bb-insns
7299 The maximum code size expansion factor when copying basic blocks
7300 instead of jumping.  The expansion is relative to a jump instruction.
7301 The default value is 8.
7302
7303 @item max-goto-duplication-insns
7304 The maximum number of instructions to duplicate to a block that jumps
7305 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
7306 passes, GCC factors computed gotos early in the compilation process,
7307 and unfactors them as late as possible.  Only computed jumps at the
7308 end of a basic blocks with no more than max-goto-duplication-insns are
7309 unfactored.  The default value is 8.
7310
7311 @item max-delay-slot-insn-search
7312 The maximum number of instructions to consider when looking for an
7313 instruction to fill a delay slot.  If more than this arbitrary number of
7314 instructions is searched, the time savings from filling the delay slot
7315 will be minimal so stop searching.  Increasing values mean more
7316 aggressive optimization, making the compile time increase with probably
7317 small improvement in executable run time.
7318
7319 @item max-delay-slot-live-search
7320 When trying to fill delay slots, the maximum number of instructions to
7321 consider when searching for a block with valid live register
7322 information.  Increasing this arbitrarily chosen value means more
7323 aggressive optimization, increasing the compile time.  This parameter
7324 should be removed when the delay slot code is rewritten to maintain the
7325 control-flow graph.
7326
7327 @item max-gcse-memory
7328 The approximate maximum amount of memory that will be allocated in
7329 order to perform the global common subexpression elimination
7330 optimization.  If more memory than specified is required, the
7331 optimization will not be done.
7332
7333 @item max-pending-list-length
7334 The maximum number of pending dependencies scheduling will allow
7335 before flushing the current state and starting over.  Large functions
7336 with few branches or calls can create excessively large lists which
7337 needlessly consume memory and resources.
7338
7339 @item max-inline-insns-single
7340 Several parameters control the tree inliner used in gcc.
7341 This number sets the maximum number of instructions (counted in GCC's
7342 internal representation) in a single function that the tree inliner
7343 will consider for inlining.  This only affects functions declared
7344 inline and methods implemented in a class declaration (C++).
7345 The default value is 450.
7346
7347 @item max-inline-insns-auto
7348 When you use @option{-finline-functions} (included in @option{-O3}),
7349 a lot of functions that would otherwise not be considered for inlining
7350 by the compiler will be investigated.  To those functions, a different
7351 (more restrictive) limit compared to functions declared inline can
7352 be applied.
7353 The default value is 90.
7354
7355 @item large-function-insns
7356 The limit specifying really large functions.  For functions larger than this
7357 limit after inlining, inlining is constrained by
7358 @option{--param large-function-growth}.  This parameter is useful primarily
7359 to avoid extreme compilation time caused by non-linear algorithms used by the
7360 backend.
7361 The default value is 2700.
7362
7363 @item large-function-growth
7364 Specifies maximal growth of large function caused by inlining in percents.
7365 The default value is 100 which limits large function growth to 2.0 times
7366 the original size.
7367
7368 @item large-unit-insns
7369 The limit specifying large translation unit.  Growth caused by inlining of
7370 units larger than this limit is limited by @option{--param inline-unit-growth}.
7371 For small units this might be too tight (consider unit consisting of function A
7372 that is inline and B that just calls A three time.  If B is small relative to
7373 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
7374 large units consisting of small inlineable functions however the overall unit
7375 growth limit is needed to avoid exponential explosion of code size.  Thus for
7376 smaller units, the size is increased to @option{--param large-unit-insns}
7377 before applying @option{--param inline-unit-growth}.  The default is 10000
7378
7379 @item inline-unit-growth
7380 Specifies maximal overall growth of the compilation unit caused by inlining.
7381 The default value is 30 which limits unit growth to 1.3 times the original
7382 size.
7383
7384 @item ipcp-unit-growth
7385 Specifies maximal overall growth of the compilation unit caused by
7386 interprocedural constant propagation.  The default value is 10 which limits
7387 unit growth to 1.1 times the original size.
7388
7389 @item large-stack-frame
7390 The limit specifying large stack frames.  While inlining the algorithm is trying
7391 to not grow past this limit too much.  Default value is 256 bytes.
7392
7393 @item large-stack-frame-growth
7394 Specifies maximal growth of large stack frames caused by inlining in percents.
7395 The default value is 1000 which limits large stack frame growth to 11 times
7396 the original size.
7397
7398 @item max-inline-insns-recursive
7399 @itemx max-inline-insns-recursive-auto
7400 Specifies maximum number of instructions out-of-line copy of self recursive inline
7401 function can grow into by performing recursive inlining.
7402
7403 For functions declared inline @option{--param max-inline-insns-recursive} is
7404 taken into account.  For function not declared inline, recursive inlining
7405 happens only when @option{-finline-functions} (included in @option{-O3}) is
7406 enabled and @option{--param max-inline-insns-recursive-auto} is used.  The
7407 default value is 450.
7408
7409 @item max-inline-recursive-depth
7410 @itemx max-inline-recursive-depth-auto
7411 Specifies maximum recursion depth used by the recursive inlining.
7412
7413 For functions declared inline @option{--param max-inline-recursive-depth} is
7414 taken into account.  For function not declared inline, recursive inlining
7415 happens only when @option{-finline-functions} (included in @option{-O3}) is
7416 enabled and @option{--param max-inline-recursive-depth-auto} is used.  The
7417 default value is 8.
7418
7419 @item min-inline-recursive-probability
7420 Recursive inlining is profitable only for function having deep recursion
7421 in average and can hurt for function having little recursion depth by
7422 increasing the prologue size or complexity of function body to other
7423 optimizers.
7424
7425 When profile feedback is available (see @option{-fprofile-generate}) the actual
7426 recursion depth can be guessed from probability that function will recurse via
7427 given call expression.  This parameter limits inlining only to call expression
7428 whose probability exceeds given threshold (in percents).  The default value is
7429 10.
7430
7431 @item inline-call-cost
7432 Specify cost of call instruction relative to simple arithmetics operations
7433 (having cost of 1).  Increasing this cost disqualifies inlining of non-leaf
7434 functions and at the same time increases size of leaf function that is believed to
7435 reduce function size by being inlined.  In effect it increases amount of
7436 inlining for code having large abstraction penalty (many functions that just
7437 pass the arguments to other functions) and decrease inlining for code with low
7438 abstraction penalty.  The default value is 12.
7439
7440 @item min-vect-loop-bound
7441 The minimum number of iterations under which a loop will not get vectorized
7442 when @option{-ftree-vectorize} is used.  The number of iterations after
7443 vectorization needs to be greater than the value specified by this option
7444 to allow vectorization.  The default value is 0.
7445
7446 @item max-unrolled-insns
7447 The maximum number of instructions that a loop should have if that loop
7448 is unrolled, and if the loop is unrolled, it determines how many times
7449 the loop code is unrolled.
7450
7451 @item max-average-unrolled-insns
7452 The maximum number of instructions biased by probabilities of their execution
7453 that a loop should have if that loop is unrolled, and if the loop is unrolled,
7454 it determines how many times the loop code is unrolled.
7455
7456 @item max-unroll-times
7457 The maximum number of unrollings of a single loop.
7458
7459 @item max-peeled-insns
7460 The maximum number of instructions that a loop should have if that loop
7461 is peeled, and if the loop is peeled, it determines how many times
7462 the loop code is peeled.
7463
7464 @item max-peel-times
7465 The maximum number of peelings of a single loop.
7466
7467 @item max-completely-peeled-insns
7468 The maximum number of insns of a completely peeled loop.
7469
7470 @item max-completely-peel-times
7471 The maximum number of iterations of a loop to be suitable for complete peeling.
7472
7473 @item max-unswitch-insns
7474 The maximum number of insns of an unswitched loop.
7475
7476 @item max-unswitch-level
7477 The maximum number of branches unswitched in a single loop.
7478
7479 @item lim-expensive
7480 The minimum cost of an expensive expression in the loop invariant motion.
7481
7482 @item iv-consider-all-candidates-bound
7483 Bound on number of candidates for induction variables below that
7484 all candidates are considered for each use in induction variable
7485 optimizations.  Only the most relevant candidates are considered
7486 if there are more candidates, to avoid quadratic time complexity.
7487
7488 @item iv-max-considered-uses
7489 The induction variable optimizations give up on loops that contain more
7490 induction variable uses.
7491
7492 @item iv-always-prune-cand-set-bound
7493 If number of candidates in the set is smaller than this value,
7494 we always try to remove unnecessary ivs from the set during its
7495 optimization when a new iv is added to the set.
7496
7497 @item scev-max-expr-size
7498 Bound on size of expressions used in the scalar evolutions analyzer.
7499 Large expressions slow the analyzer.
7500
7501 @item omega-max-vars
7502 The maximum number of variables in an Omega constraint system.
7503 The default value is 128.
7504
7505 @item omega-max-geqs
7506 The maximum number of inequalities in an Omega constraint system.
7507 The default value is 256.
7508
7509 @item omega-max-eqs
7510 The maximum number of equalities in an Omega constraint system.
7511 The default value is 128.
7512
7513 @item omega-max-wild-cards
7514 The maximum number of wildcard variables that the Omega solver will
7515 be able to insert.  The default value is 18.
7516
7517 @item omega-hash-table-size
7518 The size of the hash table in the Omega solver.  The default value is
7519 550.
7520
7521 @item omega-max-keys
7522 The maximal number of keys used by the Omega solver.  The default
7523 value is 500.
7524
7525 @item omega-eliminate-redundant-constraints
7526 When set to 1, use expensive methods to eliminate all redundant
7527 constraints.  The default value is 0.
7528
7529 @item vect-max-version-for-alignment-checks
7530 The maximum number of runtime checks that can be performed when
7531 doing loop versioning for alignment in the vectorizer.  See option
7532 ftree-vect-loop-version for more information.
7533
7534 @item vect-max-version-for-alias-checks
7535 The maximum number of runtime checks that can be performed when
7536 doing loop versioning for alias in the vectorizer.  See option
7537 ftree-vect-loop-version for more information.
7538
7539 @item max-iterations-to-track
7540
7541 The maximum number of iterations of a loop the brute force algorithm
7542 for analysis of # of iterations of the loop tries to evaluate.
7543
7544 @item hot-bb-count-fraction
7545 Select fraction of the maximal count of repetitions of basic block in program
7546 given basic block needs to have to be considered hot.
7547
7548 @item hot-bb-frequency-fraction
7549 Select fraction of the maximal frequency of executions of basic block in
7550 function given basic block needs to have to be considered hot
7551
7552 @item max-predicted-iterations
7553 The maximum number of loop iterations we predict statically.  This is useful
7554 in cases where function contain single loop with known bound and other loop
7555 with unknown.  We predict the known number of iterations correctly, while
7556 the unknown number of iterations average to roughly 10.  This means that the
7557 loop without bounds would appear artificially cold relative to the other one.
7558
7559 @item align-threshold
7560
7561 Select fraction of the maximal frequency of executions of basic block in
7562 function given basic block will get aligned.
7563
7564 @item align-loop-iterations
7565
7566 A loop expected to iterate at lest the selected number of iterations will get
7567 aligned.
7568
7569 @item tracer-dynamic-coverage
7570 @itemx tracer-dynamic-coverage-feedback
7571
7572 This value is used to limit superblock formation once the given percentage of
7573 executed instructions is covered.  This limits unnecessary code size
7574 expansion.
7575
7576 The @option{tracer-dynamic-coverage-feedback} is used only when profile
7577 feedback is available.  The real profiles (as opposed to statically estimated
7578 ones) are much less balanced allowing the threshold to be larger value.
7579
7580 @item tracer-max-code-growth
7581 Stop tail duplication once code growth has reached given percentage.  This is
7582 rather hokey argument, as most of the duplicates will be eliminated later in
7583 cross jumping, so it may be set to much higher values than is the desired code
7584 growth.
7585
7586 @item tracer-min-branch-ratio
7587
7588 Stop reverse growth when the reverse probability of best edge is less than this
7589 threshold (in percent).
7590
7591 @item tracer-min-branch-ratio
7592 @itemx tracer-min-branch-ratio-feedback
7593
7594 Stop forward growth if the best edge do have probability lower than this
7595 threshold.
7596
7597 Similarly to @option{tracer-dynamic-coverage} two values are present, one for
7598 compilation for profile feedback and one for compilation without.  The value
7599 for compilation with profile feedback needs to be more conservative (higher) in
7600 order to make tracer effective.
7601
7602 @item max-cse-path-length
7603
7604 Maximum number of basic blocks on path that cse considers.  The default is 10.
7605
7606 @item max-cse-insns
7607 The maximum instructions CSE process before flushing. The default is 1000.
7608
7609 @item ggc-min-expand
7610
7611 GCC uses a garbage collector to manage its own memory allocation.  This
7612 parameter specifies the minimum percentage by which the garbage
7613 collector's heap should be allowed to expand between collections.
7614 Tuning this may improve compilation speed; it has no effect on code
7615 generation.
7616
7617 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
7618 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of "RAM" is
7619 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
7620 GCC is not able to calculate RAM on a particular platform, the lower
7621 bound of 30% is used.  Setting this parameter and
7622 @option{ggc-min-heapsize} to zero causes a full collection to occur at
7623 every opportunity.  This is extremely slow, but can be useful for
7624 debugging.
7625
7626 @item ggc-min-heapsize
7627
7628 Minimum size of the garbage collector's heap before it begins bothering
7629 to collect garbage.  The first collection occurs after the heap expands
7630 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
7631 tuning this may improve compilation speed, and has no effect on code
7632 generation.
7633
7634 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit which
7635 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
7636 with a lower bound of 4096 (four megabytes) and an upper bound of
7637 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
7638 particular platform, the lower bound is used.  Setting this parameter
7639 very large effectively disables garbage collection.  Setting this
7640 parameter and @option{ggc-min-expand} to zero causes a full collection
7641 to occur at every opportunity.
7642
7643 @item max-reload-search-insns
7644 The maximum number of instruction reload should look backward for equivalent
7645 register.  Increasing values mean more aggressive optimization, making the
7646 compile time increase with probably slightly better performance.  The default
7647 value is 100.
7648
7649 @item max-cselib-memory-locations
7650 The maximum number of memory locations cselib should take into account.
7651 Increasing values mean more aggressive optimization, making the compile time
7652 increase with probably slightly better performance.  The default value is 500.
7653
7654 @item reorder-blocks-duplicate
7655 @itemx reorder-blocks-duplicate-feedback
7656
7657 Used by basic block reordering pass to decide whether to use unconditional
7658 branch or duplicate the code on its destination.  Code is duplicated when its
7659 estimated size is smaller than this value multiplied by the estimated size of
7660 unconditional jump in the hot spots of the program.
7661
7662 The @option{reorder-block-duplicate-feedback} is used only when profile
7663 feedback is available and may be set to higher values than
7664 @option{reorder-block-duplicate} since information about the hot spots is more
7665 accurate.
7666
7667 @item max-sched-ready-insns
7668 The maximum number of instructions ready to be issued the scheduler should
7669 consider at any given time during the first scheduling pass.  Increasing
7670 values mean more thorough searches, making the compilation time increase
7671 with probably little benefit.  The default value is 100.
7672
7673 @item max-sched-region-blocks
7674 The maximum number of blocks in a region to be considered for
7675 interblock scheduling.  The default value is 10.
7676
7677 @item max-pipeline-region-blocks
7678 The maximum number of blocks in a region to be considered for
7679 pipelining in the selective scheduler.  The default value is 15.
7680
7681 @item max-sched-region-insns
7682 The maximum number of insns in a region to be considered for
7683 interblock scheduling.  The default value is 100.
7684
7685 @item max-pipeline-region-insns
7686 The maximum number of insns in a region to be considered for
7687 pipelining in the selective scheduler.  The default value is 200.
7688
7689 @item min-spec-prob
7690 The minimum probability (in percents) of reaching a source block
7691 for interblock speculative scheduling.  The default value is 40.
7692
7693 @item max-sched-extend-regions-iters
7694 The maximum number of iterations through CFG to extend regions.
7695 0 - disable region extension,
7696 N - do at most N iterations.
7697 The default value is 0.
7698
7699 @item max-sched-insn-conflict-delay
7700 The maximum conflict delay for an insn to be considered for speculative motion.
7701 The default value is 3.
7702
7703 @item sched-spec-prob-cutoff
7704 The minimal probability of speculation success (in percents), so that
7705 speculative insn will be scheduled.
7706 The default value is 40.
7707
7708 @item sched-mem-true-dep-cost
7709 Minimal distance (in CPU cycles) between store and load targeting same
7710 memory locations.  The default value is 1.
7711
7712 @item selsched-max-lookahead
7713 The maximum size of the lookahead window of selective scheduling.  It is a
7714 depth of search for available instructions.
7715 The default value is 50.
7716
7717 @item selsched-max-sched-times
7718 The maximum number of times that an instruction will be scheduled during 
7719 selective scheduling.  This is the limit on the number of iterations 
7720 through which the instruction may be pipelined.  The default value is 2.
7721
7722 @item selsched-max-insns-to-rename
7723 The maximum number of best instructions in the ready list that are considered
7724 for renaming in the selective scheduler.  The default value is 2.
7725
7726 @item max-last-value-rtl
7727 The maximum size measured as number of RTLs that can be recorded in an expression
7728 in combiner for a pseudo register as last known value of that register.  The default
7729 is 10000.
7730
7731 @item integer-share-limit
7732 Small integer constants can use a shared data structure, reducing the
7733 compiler's memory usage and increasing its speed.  This sets the maximum
7734 value of a shared integer constant.  The default value is 256.
7735
7736 @item min-virtual-mappings
7737 Specifies the minimum number of virtual mappings in the incremental
7738 SSA updater that should be registered to trigger the virtual mappings
7739 heuristic defined by virtual-mappings-ratio.  The default value is
7740 100.
7741
7742 @item virtual-mappings-ratio
7743 If the number of virtual mappings is virtual-mappings-ratio bigger
7744 than the number of virtual symbols to be updated, then the incremental
7745 SSA updater switches to a full update for those symbols.  The default
7746 ratio is 3.
7747
7748 @item ssp-buffer-size
7749 The minimum size of buffers (i.e.@: arrays) that will receive stack smashing
7750 protection when @option{-fstack-protection} is used.
7751
7752 @item max-jump-thread-duplication-stmts
7753 Maximum number of statements allowed in a block that needs to be
7754 duplicated when threading jumps.
7755
7756 @item max-fields-for-field-sensitive
7757 Maximum number of fields in a structure we will treat in
7758 a field sensitive manner during pointer analysis.  The default is zero
7759 for -O0, and -O1 and 100 for -Os, -O2, and -O3.
7760
7761 @item prefetch-latency
7762 Estimate on average number of instructions that are executed before
7763 prefetch finishes.  The distance we prefetch ahead is proportional
7764 to this constant.  Increasing this number may also lead to less
7765 streams being prefetched (see @option{simultaneous-prefetches}).
7766
7767 @item simultaneous-prefetches
7768 Maximum number of prefetches that can run at the same time.
7769
7770 @item l1-cache-line-size
7771 The size of cache line in L1 cache, in bytes.
7772
7773 @item l1-cache-size
7774 The size of L1 cache, in kilobytes.
7775
7776 @item l2-cache-size
7777 The size of L2 cache, in kilobytes.
7778
7779 @item use-canonical-types
7780 Whether the compiler should use the ``canonical'' type system.  By
7781 default, this should always be 1, which uses a more efficient internal
7782 mechanism for comparing types in C++ and Objective-C++.  However, if
7783 bugs in the canonical type system are causing compilation failures,
7784 set this value to 0 to disable canonical types.
7785
7786 @item switch-conversion-max-branch-ratio
7787 Switch initialization conversion will refuse to create arrays that are
7788 bigger than @option{switch-conversion-max-branch-ratio} times the number of
7789 branches in the switch.
7790
7791 @item max-partial-antic-length
7792 Maximum length of the partial antic set computed during the tree
7793 partial redundancy elimination optimization (@option{-ftree-pre}) when
7794 optimizing at @option{-O3} and above.  For some sorts of source code
7795 the enhanced partial redundancy elimination optimization can run away,
7796 consuming all of the memory available on the host machine.  This
7797 parameter sets a limit on the length of the sets that are computed,
7798 which prevents the runaway behavior.  Setting a value of 0 for
7799 this parameter will allow an unlimited set length.
7800
7801 @item sccvn-max-scc-size
7802 Maximum size of a strongly connected component (SCC) during SCCVN
7803 processing.  If this limit is hit, SCCVN processing for the whole
7804 function will not be done and optimizations depending on it will
7805 be disabled.  The default maximum SCC size is 10000.
7806
7807 @item ira-max-loops-num
7808 IRA uses a regional register allocation by default.  If a function
7809 contains loops more than number given by the parameter, only at most
7810 given number of the most frequently executed loops will form regions
7811 for the regional register allocation.  The default value of the
7812 parameter is 100.
7813
7814 @item ira-max-conflict-table-size
7815 Although IRA uses a sophisticated algorithm of compression conflict
7816 table, the table can be still big for huge functions.  If the conflict
7817 table for a function could be more than size in MB given by the
7818 parameter, the conflict table is not built and faster, simpler, and
7819 lower quality register allocation algorithm will be used.  The
7820 algorithm do not use pseudo-register conflicts.  The default value of
7821 the parameter is 2000.
7822
7823 @item loop-invariant-max-bbs-in-loop
7824 Loop invariant motion can be very expensive, both in compile time and
7825 in amount of needed compile time memory, with very large loops.  Loops
7826 with more basic blocks than this parameter won't have loop invariant
7827 motion optimization performed on them.  The default value of the
7828 parameter is 1000 for -O1 and 10000 for -O2 and above.
7829
7830 @end table
7831 @end table
7832
7833 @node Preprocessor Options
7834 @section Options Controlling the Preprocessor
7835 @cindex preprocessor options
7836 @cindex options, preprocessor
7837
7838 These options control the C preprocessor, which is run on each C source
7839 file before actual compilation.
7840
7841 If you use the @option{-E} option, nothing is done except preprocessing.
7842 Some of these options make sense only together with @option{-E} because
7843 they cause the preprocessor output to be unsuitable for actual
7844 compilation.
7845
7846 @table @gcctabopt
7847 @opindex Wp
7848 You can use @option{-Wp,@var{option}} to bypass the compiler driver
7849 and pass @var{option} directly through to the preprocessor.  If
7850 @var{option} contains commas, it is split into multiple options at the
7851 commas.  However, many options are modified, translated or interpreted
7852 by the compiler driver before being passed to the preprocessor, and
7853 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
7854 interface is undocumented and subject to change, so whenever possible
7855 you should avoid using @option{-Wp} and let the driver handle the
7856 options instead.
7857
7858 @item -Xpreprocessor @var{option}
7859 @opindex preprocessor
7860 Pass @var{option} as an option to the preprocessor.  You can use this to
7861 supply system-specific preprocessor options which GCC does not know how to
7862 recognize.
7863
7864 If you want to pass an option that takes an argument, you must use
7865 @option{-Xpreprocessor} twice, once for the option and once for the argument.
7866 @end table
7867
7868 @include cppopts.texi
7869
7870 @node Assembler Options
7871 @section Passing Options to the Assembler
7872
7873 @c prevent bad page break with this line
7874 You can pass options to the assembler.
7875
7876 @table @gcctabopt
7877 @item -Wa,@var{option}
7878 @opindex Wa
7879 Pass @var{option} as an option to the assembler.  If @var{option}
7880 contains commas, it is split into multiple options at the commas.
7881
7882 @item -Xassembler @var{option}
7883 @opindex Xassembler
7884 Pass @var{option} as an option to the assembler.  You can use this to
7885 supply system-specific assembler options which GCC does not know how to
7886 recognize.
7887
7888 If you want to pass an option that takes an argument, you must use
7889 @option{-Xassembler} twice, once for the option and once for the argument.
7890
7891 @end table
7892
7893 @node Link Options
7894 @section Options for Linking
7895 @cindex link options
7896 @cindex options, linking
7897
7898 These options come into play when the compiler links object files into
7899 an executable output file.  They are meaningless if the compiler is
7900 not doing a link step.
7901
7902 @table @gcctabopt
7903 @cindex file names
7904 @item @var{object-file-name}
7905 A file name that does not end in a special recognized suffix is
7906 considered to name an object file or library.  (Object files are
7907 distinguished from libraries by the linker according to the file
7908 contents.)  If linking is done, these object files are used as input
7909 to the linker.
7910
7911 @item -c
7912 @itemx -S
7913 @itemx -E
7914 @opindex c
7915 @opindex S
7916 @opindex E
7917 If any of these options is used, then the linker is not run, and
7918 object file names should not be used as arguments.  @xref{Overall
7919 Options}.
7920
7921 @cindex Libraries
7922 @item -l@var{library}
7923 @itemx -l @var{library}
7924 @opindex l
7925 Search the library named @var{library} when linking.  (The second
7926 alternative with the library as a separate argument is only for
7927 POSIX compliance and is not recommended.)
7928
7929 It makes a difference where in the command you write this option; the
7930 linker searches and processes libraries and object files in the order they
7931 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
7932 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
7933 to functions in @samp{z}, those functions may not be loaded.
7934
7935 The linker searches a standard list of directories for the library,
7936 which is actually a file named @file{lib@var{library}.a}.  The linker
7937 then uses this file as if it had been specified precisely by name.
7938
7939 The directories searched include several standard system directories
7940 plus any that you specify with @option{-L}.
7941
7942 Normally the files found this way are library files---archive files
7943 whose members are object files.  The linker handles an archive file by
7944 scanning through it for members which define symbols that have so far
7945 been referenced but not defined.  But if the file that is found is an
7946 ordinary object file, it is linked in the usual fashion.  The only
7947 difference between using an @option{-l} option and specifying a file name
7948 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
7949 and searches several directories.
7950
7951 @item -lobjc
7952 @opindex lobjc
7953 You need this special case of the @option{-l} option in order to
7954 link an Objective-C or Objective-C++ program.
7955
7956 @item -nostartfiles
7957 @opindex nostartfiles
7958 Do not use the standard system startup files when linking.
7959 The standard system libraries are used normally, unless @option{-nostdlib}
7960 or @option{-nodefaultlibs} is used.
7961
7962 @item -nodefaultlibs
7963 @opindex nodefaultlibs
7964 Do not use the standard system libraries when linking.
7965 Only the libraries you specify will be passed to the linker.
7966 The standard startup files are used normally, unless @option{-nostartfiles}
7967 is used.  The compiler may generate calls to @code{memcmp},
7968 @code{memset}, @code{memcpy} and @code{memmove}.
7969 These entries are usually resolved by entries in
7970 libc.  These entry points should be supplied through some other
7971 mechanism when this option is specified.
7972
7973 @item -nostdlib
7974 @opindex nostdlib
7975 Do not use the standard system startup files or libraries when linking.
7976 No startup files and only the libraries you specify will be passed to
7977 the linker.  The compiler may generate calls to @code{memcmp}, @code{memset},
7978 @code{memcpy} and @code{memmove}.
7979 These entries are usually resolved by entries in
7980 libc.  These entry points should be supplied through some other
7981 mechanism when this option is specified.
7982
7983 @cindex @option{-lgcc}, use with @option{-nostdlib}
7984 @cindex @option{-nostdlib} and unresolved references
7985 @cindex unresolved references and @option{-nostdlib}
7986 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
7987 @cindex @option{-nodefaultlibs} and unresolved references
7988 @cindex unresolved references and @option{-nodefaultlibs}
7989 One of the standard libraries bypassed by @option{-nostdlib} and
7990 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
7991 that GCC uses to overcome shortcomings of particular machines, or special
7992 needs for some languages.
7993 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
7994 Collection (GCC) Internals},
7995 for more discussion of @file{libgcc.a}.)
7996 In most cases, you need @file{libgcc.a} even when you want to avoid
7997 other standard libraries.  In other words, when you specify @option{-nostdlib}
7998 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
7999 This ensures that you have no unresolved references to internal GCC
8000 library subroutines.  (For example, @samp{__main}, used to ensure C++
8001 constructors will be called; @pxref{Collect2,,@code{collect2}, gccint,
8002 GNU Compiler Collection (GCC) Internals}.)
8003
8004 @item -pie
8005 @opindex pie
8006 Produce a position independent executable on targets which support it.
8007 For predictable results, you must also specify the same set of options
8008 that were used to generate code (@option{-fpie}, @option{-fPIE},
8009 or model suboptions) when you specify this option.
8010
8011 @item -rdynamic
8012 @opindex rdynamic
8013 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
8014 that support it. This instructs the linker to add all symbols, not
8015 only used ones, to the dynamic symbol table. This option is needed
8016 for some uses of @code{dlopen} or to allow obtaining backtraces
8017 from within a program.
8018
8019 @item -s
8020 @opindex s
8021 Remove all symbol table and relocation information from the executable.
8022
8023 @item -static
8024 @opindex static
8025 On systems that support dynamic linking, this prevents linking with the shared
8026 libraries.  On other systems, this option has no effect.
8027
8028 @item -shared
8029 @opindex shared
8030 Produce a shared object which can then be linked with other objects to
8031 form an executable.  Not all systems support this option.  For predictable
8032 results, you must also specify the same set of options that were used to
8033 generate code (@option{-fpic}, @option{-fPIC}, or model suboptions)
8034 when you specify this option.@footnote{On some systems, @samp{gcc -shared}
8035 needs to build supplementary stub code for constructors to work.  On
8036 multi-libbed systems, @samp{gcc -shared} must select the correct support
8037 libraries to link against.  Failing to supply the correct flags may lead
8038 to subtle defects.  Supplying them in cases where they are not necessary
8039 is innocuous.}
8040
8041 @item -shared-libgcc
8042 @itemx -static-libgcc
8043 @opindex shared-libgcc
8044 @opindex static-libgcc
8045 On systems that provide @file{libgcc} as a shared library, these options
8046 force the use of either the shared or static version respectively.
8047 If no shared version of @file{libgcc} was built when the compiler was
8048 configured, these options have no effect.
8049
8050 There are several situations in which an application should use the
8051 shared @file{libgcc} instead of the static version.  The most common
8052 of these is when the application wishes to throw and catch exceptions
8053 across different shared libraries.  In that case, each of the libraries
8054 as well as the application itself should use the shared @file{libgcc}.
8055
8056 Therefore, the G++ and GCJ drivers automatically add
8057 @option{-shared-libgcc} whenever you build a shared library or a main
8058 executable, because C++ and Java programs typically use exceptions, so
8059 this is the right thing to do.
8060
8061 If, instead, you use the GCC driver to create shared libraries, you may
8062 find that they will not always be linked with the shared @file{libgcc}.
8063 If GCC finds, at its configuration time, that you have a non-GNU linker
8064 or a GNU linker that does not support option @option{--eh-frame-hdr},
8065 it will link the shared version of @file{libgcc} into shared libraries
8066 by default.  Otherwise, it will take advantage of the linker and optimize
8067 away the linking with the shared version of @file{libgcc}, linking with
8068 the static version of libgcc by default.  This allows exceptions to
8069 propagate through such shared libraries, without incurring relocation
8070 costs at library load time.
8071
8072 However, if a library or main executable is supposed to throw or catch
8073 exceptions, you must link it using the G++ or GCJ driver, as appropriate
8074 for the languages used in the program, or using the option
8075 @option{-shared-libgcc}, such that it is linked with the shared
8076 @file{libgcc}.
8077
8078 @item -symbolic
8079 @opindex symbolic
8080 Bind references to global symbols when building a shared object.  Warn
8081 about any unresolved references (unless overridden by the link editor
8082 option @samp{-Xlinker -z -Xlinker defs}).  Only a few systems support
8083 this option.
8084
8085 @item -T @var{script}
8086 @opindex T
8087 @cindex linker script
8088 Use @var{script} as the linker script.  This option is supported by most
8089 systems using the GNU linker.  On some targets, such as bare-board
8090 targets without an operating system, the @option{-T} option may be required 
8091 when linking to avoid references to undefined symbols.
8092
8093 @item -Xlinker @var{option}
8094 @opindex Xlinker
8095 Pass @var{option} as an option to the linker.  You can use this to
8096 supply system-specific linker options which GCC does not know how to
8097 recognize.
8098
8099 If you want to pass an option that takes a separate argument, you must use
8100 @option{-Xlinker} twice, once for the option and once for the argument.
8101 For example, to pass @option{-assert definitions}, you must write
8102 @samp{-Xlinker -assert -Xlinker definitions}.  It does not work to write
8103 @option{-Xlinker "-assert definitions"}, because this passes the entire
8104 string as a single argument, which is not what the linker expects.
8105
8106 When using the GNU linker, it is usually more convenient to pass 
8107 arguments to linker options using the @option{@var{option}=@var{value}}
8108 syntax than as separate arguments.  For example, you can specify
8109 @samp{-Xlinker -Map=output.map} rather than
8110 @samp{-Xlinker -Map -Xlinker output.map}.  Other linkers may not support
8111 this syntax for command-line options.
8112
8113 @item -Wl,@var{option}
8114 @opindex Wl
8115 Pass @var{option} as an option to the linker.  If @var{option} contains
8116 commas, it is split into multiple options at the commas.  You can use this
8117 syntax to pass an argument to the option.  
8118 For example, @samp{-Wl,-Map,output.map} passes @samp{-Map output.map} to the
8119 linker.  When using the GNU linker, you can also get the same effect with
8120 @samp{-Wl,-Map=output.map}.
8121
8122 @item -u @var{symbol}
8123 @opindex u
8124 Pretend the symbol @var{symbol} is undefined, to force linking of
8125 library modules to define it.  You can use @option{-u} multiple times with
8126 different symbols to force loading of additional library modules.
8127 @end table
8128
8129 @node Directory Options
8130 @section Options for Directory Search
8131 @cindex directory options
8132 @cindex options, directory search
8133 @cindex search path
8134
8135 These options specify directories to search for header files, for
8136 libraries and for parts of the compiler:
8137
8138 @table @gcctabopt
8139 @item -I@var{dir}
8140 @opindex I
8141 Add the directory @var{dir} to the head of the list of directories to be
8142 searched for header files.  This can be used to override a system header
8143 file, substituting your own version, since these directories are
8144 searched before the system header file directories.  However, you should
8145 not use this option to add directories that contain vendor-supplied
8146 system header files (use @option{-isystem} for that).  If you use more than
8147 one @option{-I} option, the directories are scanned in left-to-right
8148 order; the standard system directories come after.
8149
8150 If a standard system include directory, or a directory specified with
8151 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
8152 option will be ignored.  The directory will still be searched but as a
8153 system directory at its normal position in the system include chain.
8154 This is to ensure that GCC's procedure to fix buggy system headers and
8155 the ordering for the include_next directive are not inadvertently changed.
8156 If you really need to change the search order for system directories,
8157 use the @option{-nostdinc} and/or @option{-isystem} options.
8158
8159 @item -iquote@var{dir}
8160 @opindex iquote
8161 Add the directory @var{dir} to the head of the list of directories to
8162 be searched for header files only for the case of @samp{#include
8163 "@var{file}"}; they are not searched for @samp{#include <@var{file}>},
8164 otherwise just like @option{-I}.
8165
8166 @item -L@var{dir}
8167 @opindex L
8168 Add directory @var{dir} to the list of directories to be searched
8169 for @option{-l}.
8170
8171 @item -B@var{prefix}
8172 @opindex B
8173 This option specifies where to find the executables, libraries,
8174 include files, and data files of the compiler itself.
8175
8176 The compiler driver program runs one or more of the subprograms
8177 @file{cpp}, @file{cc1}, @file{as} and @file{ld}.  It tries
8178 @var{prefix} as a prefix for each program it tries to run, both with and
8179 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
8180
8181 For each subprogram to be run, the compiler driver first tries the
8182 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
8183 was not specified, the driver tries two standard prefixes, which are
8184 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
8185 those results in a file name that is found, the unmodified program
8186 name is searched for using the directories specified in your
8187 @env{PATH} environment variable.
8188
8189 The compiler will check to see if the path provided by the @option{-B}
8190 refers to a directory, and if necessary it will add a directory
8191 separator character at the end of the path.
8192
8193 @option{-B} prefixes that effectively specify directory names also apply
8194 to libraries in the linker, because the compiler translates these
8195 options into @option{-L} options for the linker.  They also apply to
8196 includes files in the preprocessor, because the compiler translates these
8197 options into @option{-isystem} options for the preprocessor.  In this case,
8198 the compiler appends @samp{include} to the prefix.
8199
8200 The run-time support file @file{libgcc.a} can also be searched for using
8201 the @option{-B} prefix, if needed.  If it is not found there, the two
8202 standard prefixes above are tried, and that is all.  The file is left
8203 out of the link if it is not found by those means.
8204
8205 Another way to specify a prefix much like the @option{-B} prefix is to use
8206 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
8207 Variables}.
8208
8209 As a special kludge, if the path provided by @option{-B} is
8210 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
8211 9, then it will be replaced by @file{[dir/]include}.  This is to help
8212 with boot-strapping the compiler.
8213
8214 @item -specs=@var{file}
8215 @opindex specs
8216 Process @var{file} after the compiler reads in the standard @file{specs}
8217 file, in order to override the defaults that the @file{gcc} driver
8218 program uses when determining what switches to pass to @file{cc1},
8219 @file{cc1plus}, @file{as}, @file{ld}, etc.  More than one
8220 @option{-specs=@var{file}} can be specified on the command line, and they
8221 are processed in order, from left to right.
8222
8223 @item --sysroot=@var{dir}
8224 @opindex sysroot
8225 Use @var{dir} as the logical root directory for headers and libraries.
8226 For example, if the compiler would normally search for headers in
8227 @file{/usr/include} and libraries in @file{/usr/lib}, it will instead
8228 search @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
8229
8230 If you use both this option and the @option{-isysroot} option, then
8231 the @option{--sysroot} option will apply to libraries, but the
8232 @option{-isysroot} option will apply to header files.
8233
8234 The GNU linker (beginning with version 2.16) has the necessary support
8235 for this option.  If your linker does not support this option, the
8236 header file aspect of @option{--sysroot} will still work, but the
8237 library aspect will not.
8238
8239 @item -I-
8240 @opindex I-
8241 This option has been deprecated.  Please use @option{-iquote} instead for
8242 @option{-I} directories before the @option{-I-} and remove the @option{-I-}.
8243 Any directories you specify with @option{-I} options before the @option{-I-}
8244 option are searched only for the case of @samp{#include "@var{file}"};
8245 they are not searched for @samp{#include <@var{file}>}.
8246
8247 If additional directories are specified with @option{-I} options after
8248 the @option{-I-}, these directories are searched for all @samp{#include}
8249 directives.  (Ordinarily @emph{all} @option{-I} directories are used
8250 this way.)
8251
8252 In addition, the @option{-I-} option inhibits the use of the current
8253 directory (where the current input file came from) as the first search
8254 directory for @samp{#include "@var{file}"}.  There is no way to
8255 override this effect of @option{-I-}.  With @option{-I.} you can specify
8256 searching the directory which was current when the compiler was
8257 invoked.  That is not exactly the same as what the preprocessor does
8258 by default, but it is often satisfactory.
8259
8260 @option{-I-} does not inhibit the use of the standard system directories
8261 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
8262 independent.
8263 @end table
8264
8265 @c man end
8266
8267 @node Spec Files
8268 @section Specifying subprocesses and the switches to pass to them
8269 @cindex Spec Files
8270
8271 @command{gcc} is a driver program.  It performs its job by invoking a
8272 sequence of other programs to do the work of compiling, assembling and
8273 linking.  GCC interprets its command-line parameters and uses these to
8274 deduce which programs it should invoke, and which command-line options
8275 it ought to place on their command lines.  This behavior is controlled
8276 by @dfn{spec strings}.  In most cases there is one spec string for each
8277 program that GCC can invoke, but a few programs have multiple spec
8278 strings to control their behavior.  The spec strings built into GCC can
8279 be overridden by using the @option{-specs=} command-line switch to specify
8280 a spec file.
8281
8282 @dfn{Spec files} are plaintext files that are used to construct spec
8283 strings.  They consist of a sequence of directives separated by blank
8284 lines.  The type of directive is determined by the first non-whitespace
8285 character on the line and it can be one of the following:
8286
8287 @table @code
8288 @item %@var{command}
8289 Issues a @var{command} to the spec file processor.  The commands that can
8290 appear here are:
8291
8292 @table @code
8293 @item %include <@var{file}>
8294 @cindex %include
8295 Search for @var{file} and insert its text at the current point in the
8296 specs file.
8297
8298 @item %include_noerr <@var{file}>
8299 @cindex %include_noerr
8300 Just like @samp{%include}, but do not generate an error message if the include
8301 file cannot be found.
8302
8303 @item %rename @var{old_name} @var{new_name}
8304 @cindex %rename
8305 Rename the spec string @var{old_name} to @var{new_name}.
8306
8307 @end table
8308
8309 @item *[@var{spec_name}]:
8310 This tells the compiler to create, override or delete the named spec
8311 string.  All lines after this directive up to the next directive or
8312 blank line are considered to be the text for the spec string.  If this
8313 results in an empty string then the spec will be deleted.  (Or, if the
8314 spec did not exist, then nothing will happened.)  Otherwise, if the spec
8315 does not currently exist a new spec will be created.  If the spec does
8316 exist then its contents will be overridden by the text of this
8317 directive, unless the first character of that text is the @samp{+}
8318 character, in which case the text will be appended to the spec.
8319
8320 @item [@var{suffix}]:
8321 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
8322 and up to the next directive or blank line are considered to make up the
8323 spec string for the indicated suffix.  When the compiler encounters an
8324 input file with the named suffix, it will processes the spec string in
8325 order to work out how to compile that file.  For example:
8326
8327 @smallexample
8328 .ZZ:
8329 z-compile -input %i
8330 @end smallexample
8331
8332 This says that any input file whose name ends in @samp{.ZZ} should be
8333 passed to the program @samp{z-compile}, which should be invoked with the
8334 command-line switch @option{-input} and with the result of performing the
8335 @samp{%i} substitution.  (See below.)
8336
8337 As an alternative to providing a spec string, the text that follows a
8338 suffix directive can be one of the following:
8339
8340 @table @code
8341 @item @@@var{language}
8342 This says that the suffix is an alias for a known @var{language}.  This is
8343 similar to using the @option{-x} command-line switch to GCC to specify a
8344 language explicitly.  For example:
8345
8346 @smallexample
8347 .ZZ:
8348 @@c++
8349 @end smallexample
8350
8351 Says that .ZZ files are, in fact, C++ source files.
8352
8353 @item #@var{name}
8354 This causes an error messages saying:
8355
8356 @smallexample
8357 @var{name} compiler not installed on this system.
8358 @end smallexample
8359 @end table
8360
8361 GCC already has an extensive list of suffixes built into it.
8362 This directive will add an entry to the end of the list of suffixes, but
8363 since the list is searched from the end backwards, it is effectively
8364 possible to override earlier entries using this technique.
8365
8366 @end table
8367
8368 GCC has the following spec strings built into it.  Spec files can
8369 override these strings or create their own.  Note that individual
8370 targets can also add their own spec strings to this list.
8371
8372 @smallexample
8373 asm          Options to pass to the assembler
8374 asm_final    Options to pass to the assembler post-processor
8375 cpp          Options to pass to the C preprocessor
8376 cc1          Options to pass to the C compiler
8377 cc1plus      Options to pass to the C++ compiler
8378 endfile      Object files to include at the end of the link
8379 link         Options to pass to the linker
8380 lib          Libraries to include on the command line to the linker
8381 libgcc       Decides which GCC support library to pass to the linker
8382 linker       Sets the name of the linker
8383 predefines   Defines to be passed to the C preprocessor
8384 signed_char  Defines to pass to CPP to say whether @code{char} is signed
8385              by default
8386 startfile    Object files to include at the start of the link
8387 @end smallexample
8388
8389 Here is a small example of a spec file:
8390
8391 @smallexample
8392 %rename lib                 old_lib
8393
8394 *lib:
8395 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
8396 @end smallexample
8397
8398 This example renames the spec called @samp{lib} to @samp{old_lib} and
8399 then overrides the previous definition of @samp{lib} with a new one.
8400 The new definition adds in some extra command-line options before
8401 including the text of the old definition.
8402
8403 @dfn{Spec strings} are a list of command-line options to be passed to their
8404 corresponding program.  In addition, the spec strings can contain
8405 @samp{%}-prefixed sequences to substitute variable text or to
8406 conditionally insert text into the command line.  Using these constructs
8407 it is possible to generate quite complex command lines.
8408
8409 Here is a table of all defined @samp{%}-sequences for spec
8410 strings.  Note that spaces are not generated automatically around the
8411 results of expanding these sequences.  Therefore you can concatenate them
8412 together or combine them with constant text in a single argument.
8413
8414 @table @code
8415 @item %%
8416 Substitute one @samp{%} into the program name or argument.
8417
8418 @item %i
8419 Substitute the name of the input file being processed.
8420
8421 @item %b
8422 Substitute the basename of the input file being processed.
8423 This is the substring up to (and not including) the last period
8424 and not including the directory.
8425
8426 @item %B
8427 This is the same as @samp{%b}, but include the file suffix (text after
8428 the last period).
8429
8430 @item %d
8431 Marks the argument containing or following the @samp{%d} as a
8432 temporary file name, so that that file will be deleted if GCC exits
8433 successfully.  Unlike @samp{%g}, this contributes no text to the
8434 argument.
8435
8436 @item %g@var{suffix}
8437 Substitute a file name that has suffix @var{suffix} and is chosen
8438 once per compilation, and mark the argument in the same way as
8439 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
8440 name is now chosen in a way that is hard to predict even when previously
8441 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
8442 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
8443 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
8444 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
8445 was simply substituted with a file name chosen once per compilation,
8446 without regard to any appended suffix (which was therefore treated
8447 just like ordinary text), making such attacks more likely to succeed.
8448
8449 @item %u@var{suffix}
8450 Like @samp{%g}, but generates a new temporary file name even if
8451 @samp{%u@var{suffix}} was already seen.
8452
8453 @item %U@var{suffix}
8454 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
8455 new one if there is no such last file name.  In the absence of any
8456 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
8457 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
8458 would involve the generation of two distinct file names, one
8459 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
8460 simply substituted with a file name chosen for the previous @samp{%u},
8461 without regard to any appended suffix.
8462
8463 @item %j@var{suffix}
8464 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
8465 writable, and if save-temps is off; otherwise, substitute the name
8466 of a temporary file, just like @samp{%u}.  This temporary file is not
8467 meant for communication between processes, but rather as a junk
8468 disposal mechanism.
8469
8470 @item %|@var{suffix}
8471 @itemx %m@var{suffix}
8472 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
8473 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
8474 all.  These are the two most common ways to instruct a program that it
8475 should read from standard input or write to standard output.  If you
8476 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
8477 construct: see for example @file{f/lang-specs.h}.
8478
8479 @item %.@var{SUFFIX}
8480 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
8481 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
8482 terminated by the next space or %.
8483
8484 @item %w
8485 Marks the argument containing or following the @samp{%w} as the
8486 designated output file of this compilation.  This puts the argument
8487 into the sequence of arguments that @samp{%o} will substitute later.
8488
8489 @item %o
8490 Substitutes the names of all the output files, with spaces
8491 automatically placed around them.  You should write spaces
8492 around the @samp{%o} as well or the results are undefined.
8493 @samp{%o} is for use in the specs for running the linker.
8494 Input files whose names have no recognized suffix are not compiled
8495 at all, but they are included among the output files, so they will
8496 be linked.
8497
8498 @item %O
8499 Substitutes the suffix for object files.  Note that this is
8500 handled specially when it immediately follows @samp{%g, %u, or %U},
8501 because of the need for those to form complete file names.  The
8502 handling is such that @samp{%O} is treated exactly as if it had already
8503 been substituted, except that @samp{%g, %u, and %U} do not currently
8504 support additional @var{suffix} characters following @samp{%O} as they would
8505 following, for example, @samp{.o}.
8506
8507 @item %p
8508 Substitutes the standard macro predefinitions for the
8509 current target machine.  Use this when running @code{cpp}.
8510
8511 @item %P
8512 Like @samp{%p}, but puts @samp{__} before and after the name of each
8513 predefined macro, except for macros that start with @samp{__} or with
8514 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
8515 C@.
8516
8517 @item %I
8518 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
8519 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
8520 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
8521 and @option{-imultilib} as necessary.
8522
8523 @item %s
8524 Current argument is the name of a library or startup file of some sort.
8525 Search for that file in a standard list of directories and substitute
8526 the full name found.
8527
8528 @item %e@var{str}
8529 Print @var{str} as an error message.  @var{str} is terminated by a newline.
8530 Use this when inconsistent options are detected.
8531
8532 @item %(@var{name})
8533 Substitute the contents of spec string @var{name} at this point.
8534
8535 @item %[@var{name}]
8536 Like @samp{%(@dots{})} but put @samp{__} around @option{-D} arguments.
8537
8538 @item %x@{@var{option}@}
8539 Accumulate an option for @samp{%X}.
8540
8541 @item %X
8542 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
8543 spec string.
8544
8545 @item %Y
8546 Output the accumulated assembler options specified by @option{-Wa}.
8547
8548 @item %Z
8549 Output the accumulated preprocessor options specified by @option{-Wp}.
8550
8551 @item %a
8552 Process the @code{asm} spec.  This is used to compute the
8553 switches to be passed to the assembler.
8554
8555 @item %A
8556 Process the @code{asm_final} spec.  This is a spec string for
8557 passing switches to an assembler post-processor, if such a program is
8558 needed.
8559
8560 @item %l
8561 Process the @code{link} spec.  This is the spec for computing the
8562 command line passed to the linker.  Typically it will make use of the
8563 @samp{%L %G %S %D and %E} sequences.
8564
8565 @item %D
8566 Dump out a @option{-L} option for each directory that GCC believes might
8567 contain startup files.  If the target supports multilibs then the
8568 current multilib directory will be prepended to each of these paths.
8569
8570 @item %L
8571 Process the @code{lib} spec.  This is a spec string for deciding which
8572 libraries should be included on the command line to the linker.
8573
8574 @item %G
8575 Process the @code{libgcc} spec.  This is a spec string for deciding
8576 which GCC support library should be included on the command line to the linker.
8577
8578 @item %S
8579 Process the @code{startfile} spec.  This is a spec for deciding which
8580 object files should be the first ones passed to the linker.  Typically
8581 this might be a file named @file{crt0.o}.
8582
8583 @item %E
8584 Process the @code{endfile} spec.  This is a spec string that specifies
8585 the last object files that will be passed to the linker.
8586
8587 @item %C
8588 Process the @code{cpp} spec.  This is used to construct the arguments
8589 to be passed to the C preprocessor.
8590
8591 @item %1
8592 Process the @code{cc1} spec.  This is used to construct the options to be
8593 passed to the actual C compiler (@samp{cc1}).
8594
8595 @item %2
8596 Process the @code{cc1plus} spec.  This is used to construct the options to be
8597 passed to the actual C++ compiler (@samp{cc1plus}).
8598
8599 @item %*
8600 Substitute the variable part of a matched option.  See below.
8601 Note that each comma in the substituted string is replaced by
8602 a single space.
8603
8604 @item %<@code{S}
8605 Remove all occurrences of @code{-S} from the command line.  Note---this
8606 command is position dependent.  @samp{%} commands in the spec string
8607 before this one will see @code{-S}, @samp{%} commands in the spec string
8608 after this one will not.
8609
8610 @item %:@var{function}(@var{args})
8611 Call the named function @var{function}, passing it @var{args}.
8612 @var{args} is first processed as a nested spec string, then split
8613 into an argument vector in the usual fashion.  The function returns
8614 a string which is processed as if it had appeared literally as part
8615 of the current spec.
8616
8617 The following built-in spec functions are provided:
8618
8619 @table @code
8620 @item @code{getenv}
8621 The @code{getenv} spec function takes two arguments: an environment
8622 variable name and a string.  If the environment variable is not
8623 defined, a fatal error is issued.  Otherwise, the return value is the
8624 value of the environment variable concatenated with the string.  For
8625 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
8626
8627 @smallexample
8628 %:getenv(TOPDIR /include)
8629 @end smallexample
8630
8631 expands to @file{/path/to/top/include}.
8632
8633 @item @code{if-exists}
8634 The @code{if-exists} spec function takes one argument, an absolute
8635 pathname to a file.  If the file exists, @code{if-exists} returns the
8636 pathname.  Here is a small example of its usage:
8637
8638 @smallexample
8639 *startfile:
8640 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
8641 @end smallexample
8642
8643 @item @code{if-exists-else}
8644 The @code{if-exists-else} spec function is similar to the @code{if-exists}
8645 spec function, except that it takes two arguments.  The first argument is
8646 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
8647 returns the pathname.  If it does not exist, it returns the second argument.
8648 This way, @code{if-exists-else} can be used to select one file or another,
8649 based on the existence of the first.  Here is a small example of its usage:
8650
8651 @smallexample
8652 *startfile:
8653 crt0%O%s %:if-exists(crti%O%s) \
8654 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
8655 @end smallexample
8656
8657 @item @code{replace-outfile}
8658 The @code{replace-outfile} spec function takes two arguments.  It looks for the
8659 first argument in the outfiles array and replaces it with the second argument.  Here
8660 is a small example of its usage:
8661
8662 @smallexample
8663 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
8664 @end smallexample
8665
8666 @item @code{print-asm-header}
8667 The @code{print-asm-header} function takes no arguments and simply
8668 prints a banner like:
8669
8670 @smallexample
8671 Assembler options
8672 =================
8673
8674 Use "-Wa,OPTION" to pass "OPTION" to the assembler.
8675 @end smallexample
8676
8677 It is used to separate compiler options from assembler options
8678 in the @option{--target-help} output.
8679 @end table
8680
8681 @item %@{@code{S}@}
8682 Substitutes the @code{-S} switch, if that switch was given to GCC@.
8683 If that switch was not specified, this substitutes nothing.  Note that
8684 the leading dash is omitted when specifying this option, and it is
8685 automatically inserted if the substitution is performed.  Thus the spec
8686 string @samp{%@{foo@}} would match the command-line option @option{-foo}
8687 and would output the command line option @option{-foo}.
8688
8689 @item %W@{@code{S}@}
8690 Like %@{@code{S}@} but mark last argument supplied within as a file to be
8691 deleted on failure.
8692
8693 @item %@{@code{S}*@}
8694 Substitutes all the switches specified to GCC whose names start
8695 with @code{-S}, but which also take an argument.  This is used for
8696 switches like @option{-o}, @option{-D}, @option{-I}, etc.
8697 GCC considers @option{-o foo} as being
8698 one switch whose names starts with @samp{o}.  %@{o*@} would substitute this
8699 text, including the space.  Thus two arguments would be generated.
8700
8701 @item %@{@code{S}*&@code{T}*@}
8702 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
8703 (the order of @code{S} and @code{T} in the spec is not significant).
8704 There can be any number of ampersand-separated variables; for each the
8705 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
8706
8707 @item %@{@code{S}:@code{X}@}
8708 Substitutes @code{X}, if the @samp{-S} switch was given to GCC@.
8709
8710 @item %@{!@code{S}:@code{X}@}
8711 Substitutes @code{X}, if the @samp{-S} switch was @emph{not} given to GCC@.
8712
8713 @item %@{@code{S}*:@code{X}@}
8714 Substitutes @code{X} if one or more switches whose names start with
8715 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
8716 once, no matter how many such switches appeared.  However, if @code{%*}
8717 appears somewhere in @code{X}, then @code{X} will be substituted once
8718 for each matching switch, with the @code{%*} replaced by the part of
8719 that switch that matched the @code{*}.
8720
8721 @item %@{.@code{S}:@code{X}@}
8722 Substitutes @code{X}, if processing a file with suffix @code{S}.
8723
8724 @item %@{!.@code{S}:@code{X}@}
8725 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
8726
8727 @item %@{,@code{S}:@code{X}@}
8728 Substitutes @code{X}, if processing a file for language @code{S}.
8729
8730 @item %@{!,@code{S}:@code{X}@}
8731 Substitutes @code{X}, if not processing a file for language @code{S}.
8732
8733 @item %@{@code{S}|@code{P}:@code{X}@}
8734 Substitutes @code{X} if either @code{-S} or @code{-P} was given to
8735 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
8736 @code{*} sequences as well, although they have a stronger binding than
8737 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
8738 alternatives must be starred, and only the first matching alternative
8739 is substituted.
8740
8741 For example, a spec string like this:
8742
8743 @smallexample
8744 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
8745 @end smallexample
8746
8747 will output the following command-line options from the following input
8748 command-line options:
8749
8750 @smallexample
8751 fred.c        -foo -baz
8752 jim.d         -bar -boggle
8753 -d fred.c     -foo -baz -boggle
8754 -d jim.d      -bar -baz -boggle
8755 @end smallexample
8756
8757 @item %@{S:X; T:Y; :D@}
8758
8759 If @code{S} was given to GCC, substitutes @code{X}; else if @code{T} was
8760 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
8761 be as many clauses as you need.  This may be combined with @code{.},
8762 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
8763
8764
8765 @end table
8766
8767 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
8768 construct may contain other nested @samp{%} constructs or spaces, or
8769 even newlines.  They are processed as usual, as described above.
8770 Trailing white space in @code{X} is ignored.  White space may also
8771 appear anywhere on the left side of the colon in these constructs,
8772 except between @code{.} or @code{*} and the corresponding word.
8773
8774 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
8775 handled specifically in these constructs.  If another value of
8776 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
8777 @option{-W} switch is found later in the command line, the earlier
8778 switch value is ignored, except with @{@code{S}*@} where @code{S} is
8779 just one letter, which passes all matching options.
8780
8781 The character @samp{|} at the beginning of the predicate text is used to
8782 indicate that a command should be piped to the following command, but
8783 only if @option{-pipe} is specified.
8784
8785 It is built into GCC which switches take arguments and which do not.
8786 (You might think it would be useful to generalize this to allow each
8787 compiler's spec to say which switches take arguments.  But this cannot
8788 be done in a consistent fashion.  GCC cannot even decide which input
8789 files have been specified without knowing which switches take arguments,
8790 and it must know which input files to compile in order to tell which
8791 compilers to run).
8792
8793 GCC also knows implicitly that arguments starting in @option{-l} are to be
8794 treated as compiler output files, and passed to the linker in their
8795 proper position among the other output files.
8796
8797 @c man begin OPTIONS
8798
8799 @node Target Options
8800 @section Specifying Target Machine and Compiler Version
8801 @cindex target options
8802 @cindex cross compiling
8803 @cindex specifying machine version
8804 @cindex specifying compiler version and target machine
8805 @cindex compiler version, specifying
8806 @cindex target machine, specifying
8807
8808 The usual way to run GCC is to run the executable called @file{gcc}, or
8809 @file{<machine>-gcc} when cross-compiling, or
8810 @file{<machine>-gcc-<version>} to run a version other than the one that
8811 was installed last.  Sometimes this is inconvenient, so GCC provides
8812 options that will switch to another cross-compiler or version.
8813
8814 @table @gcctabopt
8815 @item -b @var{machine}
8816 @opindex b
8817 The argument @var{machine} specifies the target machine for compilation.
8818
8819 The value to use for @var{machine} is the same as was specified as the
8820 machine type when configuring GCC as a cross-compiler.  For
8821 example, if a cross-compiler was configured with @samp{configure
8822 arm-elf}, meaning to compile for an arm processor with elf binaries,
8823 then you would specify @option{-b arm-elf} to run that cross compiler.
8824 Because there are other options beginning with @option{-b}, the
8825 configuration must contain a hyphen, or @option{-b} alone should be one
8826 argument followed by the configuration in the next argument.
8827
8828 @item -V @var{version}
8829 @opindex V
8830 The argument @var{version} specifies which version of GCC to run.
8831 This is useful when multiple versions are installed.  For example,
8832 @var{version} might be @samp{4.0}, meaning to run GCC version 4.0.
8833 @end table
8834
8835 The @option{-V} and @option{-b} options work by running the
8836 @file{<machine>-gcc-<version>} executable, so there's no real reason to
8837 use them if you can just run that directly.
8838
8839 @node Submodel Options
8840 @section Hardware Models and Configurations
8841 @cindex submodel options
8842 @cindex specifying hardware config
8843 @cindex hardware models and configurations, specifying
8844 @cindex machine dependent options
8845
8846 Earlier we discussed the standard option @option{-b} which chooses among
8847 different installed compilers for completely different target
8848 machines, such as VAX vs.@: 68000 vs.@: 80386.
8849
8850 In addition, each of these target machine types can have its own
8851 special options, starting with @samp{-m}, to choose among various
8852 hardware models or configurations---for example, 68010 vs 68020,
8853 floating coprocessor or none.  A single installed version of the
8854 compiler can compile for any model or configuration, according to the
8855 options specified.
8856
8857 Some configurations of the compiler also support additional special
8858 options, usually for compatibility with other compilers on the same
8859 platform.
8860
8861 @c This list is ordered alphanumerically by subsection name.
8862 @c It should be the same order and spelling as these options are listed
8863 @c in Machine Dependent Options
8864
8865 @menu
8866 * ARC Options::
8867 * ARM Options::
8868 * AVR Options::
8869 * Blackfin Options::
8870 * CRIS Options::
8871 * CRX Options::
8872 * Darwin Options::
8873 * DEC Alpha Options::
8874 * DEC Alpha/VMS Options::
8875 * FR30 Options::
8876 * FRV Options::
8877 * GNU/Linux Options::
8878 * H8/300 Options::
8879 * HPPA Options::
8880 * i386 and x86-64 Options::
8881 * i386 and x86-64 Windows Options::
8882 * IA-64 Options::
8883 * M32C Options::
8884 * M32R/D Options::
8885 * M680x0 Options::
8886 * M68hc1x Options::
8887 * MCore Options::
8888 * MIPS Options::
8889 * MMIX Options::
8890 * MN10300 Options::
8891 * PDP-11 Options::
8892 * picoChip Options::
8893 * PowerPC Options::
8894 * RS/6000 and PowerPC Options::
8895 * S/390 and zSeries Options::
8896 * Score Options::
8897 * SH Options::
8898 * SPARC Options::
8899 * SPU Options::
8900 * System V Options::
8901 * V850 Options::
8902 * VAX Options::
8903 * VxWorks Options::
8904 * x86-64 Options::
8905 * Xstormy16 Options::
8906 * Xtensa Options::
8907 * zSeries Options::
8908 @end menu
8909
8910 @node ARC Options
8911 @subsection ARC Options
8912 @cindex ARC Options
8913
8914 These options are defined for ARC implementations:
8915
8916 @table @gcctabopt
8917 @item -EL
8918 @opindex EL
8919 Compile code for little endian mode.  This is the default.
8920
8921 @item -EB
8922 @opindex EB
8923 Compile code for big endian mode.
8924
8925 @item -mmangle-cpu
8926 @opindex mmangle-cpu
8927 Prepend the name of the cpu to all public symbol names.
8928 In multiple-processor systems, there are many ARC variants with different
8929 instruction and register set characteristics.  This flag prevents code
8930 compiled for one cpu to be linked with code compiled for another.
8931 No facility exists for handling variants that are ``almost identical''.
8932 This is an all or nothing option.
8933
8934 @item -mcpu=@var{cpu}
8935 @opindex mcpu
8936 Compile code for ARC variant @var{cpu}.
8937 Which variants are supported depend on the configuration.
8938 All variants support @option{-mcpu=base}, this is the default.
8939
8940 @item -mtext=@var{text-section}
8941 @itemx -mdata=@var{data-section}
8942 @itemx -mrodata=@var{readonly-data-section}
8943 @opindex mtext
8944 @opindex mdata
8945 @opindex mrodata
8946 Put functions, data, and readonly data in @var{text-section},
8947 @var{data-section}, and @var{readonly-data-section} respectively
8948 by default.  This can be overridden with the @code{section} attribute.
8949 @xref{Variable Attributes}.
8950
8951 @item -mfix-cortex-m3-ldrd
8952 @opindex mfix-cortex-m3-ldrd
8953 Some Cortex-M3 cores can cause data corruption when @code{ldrd} instructions
8954 with overlapping destination and base registers are used.  This option avoids
8955 generating these instructions.  This option is enabled by default when
8956 @option{-mcpu=cortex-m3} is specified.
8957
8958 @end table
8959
8960 @node ARM Options
8961 @subsection ARM Options
8962 @cindex ARM options
8963
8964 These @samp{-m} options are defined for Advanced RISC Machines (ARM)
8965 architectures:
8966
8967 @table @gcctabopt
8968 @item -mabi=@var{name}
8969 @opindex mabi
8970 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
8971 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
8972
8973 @item -mapcs-frame
8974 @opindex mapcs-frame
8975 Generate a stack frame that is compliant with the ARM Procedure Call
8976 Standard for all functions, even if this is not strictly necessary for
8977 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
8978 with this option will cause the stack frames not to be generated for
8979 leaf functions.  The default is @option{-mno-apcs-frame}.
8980
8981 @item -mapcs
8982 @opindex mapcs
8983 This is a synonym for @option{-mapcs-frame}.
8984
8985 @ignore
8986 @c not currently implemented
8987 @item -mapcs-stack-check
8988 @opindex mapcs-stack-check
8989 Generate code to check the amount of stack space available upon entry to
8990 every function (that actually uses some stack space).  If there is
8991 insufficient space available then either the function
8992 @samp{__rt_stkovf_split_small} or @samp{__rt_stkovf_split_big} will be
8993 called, depending upon the amount of stack space required.  The run time
8994 system is required to provide these functions.  The default is
8995 @option{-mno-apcs-stack-check}, since this produces smaller code.
8996
8997 @c not currently implemented
8998 @item -mapcs-float
8999 @opindex mapcs-float
9000 Pass floating point arguments using the float point registers.  This is
9001 one of the variants of the APCS@.  This option is recommended if the
9002 target hardware has a floating point unit or if a lot of floating point
9003 arithmetic is going to be performed by the code.  The default is
9004 @option{-mno-apcs-float}, since integer only code is slightly increased in
9005 size if @option{-mapcs-float} is used.
9006
9007 @c not currently implemented
9008 @item -mapcs-reentrant
9009 @opindex mapcs-reentrant
9010 Generate reentrant, position independent code.  The default is
9011 @option{-mno-apcs-reentrant}.
9012 @end ignore
9013
9014 @item -mthumb-interwork
9015 @opindex mthumb-interwork
9016 Generate code which supports calling between the ARM and Thumb
9017 instruction sets.  Without this option the two instruction sets cannot
9018 be reliably used inside one program.  The default is
9019 @option{-mno-thumb-interwork}, since slightly larger code is generated
9020 when @option{-mthumb-interwork} is specified.
9021
9022 @item -mno-sched-prolog
9023 @opindex mno-sched-prolog
9024 Prevent the reordering of instructions in the function prolog, or the
9025 merging of those instruction with the instructions in the function's
9026 body.  This means that all functions will start with a recognizable set
9027 of instructions (or in fact one of a choice from a small set of
9028 different function prologues), and this information can be used to
9029 locate the start if functions inside an executable piece of code.  The
9030 default is @option{-msched-prolog}.
9031
9032 @item -mfloat-abi=@var{name}
9033 @opindex mfloat-abi
9034 Specifies which floating-point ABI to use.  Permissible values
9035 are: @samp{soft}, @samp{softfp} and @samp{hard}.
9036
9037 Specifying @samp{soft} causes GCC to generate output containing 
9038 library calls for floating-point operations.
9039 @samp{softfp} allows the generation of code using hardware floating-point 
9040 instructions, but still uses the soft-float calling conventions.  
9041 @samp{hard} allows generation of floating-point instructions 
9042 and uses FPU-specific calling conventions.
9043
9044 Using @option{-mfloat-abi=hard} with VFP coprocessors is not supported.
9045 Use @option{-mfloat-abi=softfp} with the appropriate @option{-mfpu} option
9046 to allow the compiler to generate code that makes use of the hardware
9047 floating-point capabilities for these CPUs.
9048
9049 The default depends on the specific target configuration.  Note that
9050 the hard-float and soft-float ABIs are not link-compatible; you must
9051 compile your entire program with the same ABI, and link with a
9052 compatible set of libraries.
9053
9054 @item -mhard-float
9055 @opindex mhard-float
9056 Equivalent to @option{-mfloat-abi=hard}.
9057
9058 @item -msoft-float
9059 @opindex msoft-float
9060 Equivalent to @option{-mfloat-abi=soft}.
9061
9062 @item -mlittle-endian
9063 @opindex mlittle-endian
9064 Generate code for a processor running in little-endian mode.  This is
9065 the default for all standard configurations.
9066
9067 @item -mbig-endian
9068 @opindex mbig-endian
9069 Generate code for a processor running in big-endian mode; the default is
9070 to compile code for a little-endian processor.
9071
9072 @item -mwords-little-endian
9073 @opindex mwords-little-endian
9074 This option only applies when generating code for big-endian processors.
9075 Generate code for a little-endian word order but a big-endian byte
9076 order.  That is, a byte order of the form @samp{32107654}.  Note: this
9077 option should only be used if you require compatibility with code for
9078 big-endian ARM processors generated by versions of the compiler prior to
9079 2.8.
9080
9081 @item -mcpu=@var{name}
9082 @opindex mcpu
9083 This specifies the name of the target ARM processor.  GCC uses this name
9084 to determine what kind of instructions it can emit when generating
9085 assembly code.  Permissible names are: @samp{arm2}, @samp{arm250},
9086 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
9087 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
9088 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
9089 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
9090 @samp{arm720},
9091 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
9092 @samp{arm710t}, @samp{arm720t}, @samp{arm740t},
9093 @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
9094 @samp{strongarm1110},
9095 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
9096 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
9097 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
9098 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
9099 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
9100 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
9101 @samp{arm1156t2-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
9102 @samp{cortex-a8}, @samp{cortex-a9},
9103 @samp{cortex-r4}, @samp{cortex-r4f}, @samp{cortex-m3},
9104 @samp{cortex-m1},
9105 @samp{xscale}, @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312}.
9106
9107 @item -mtune=@var{name}
9108 @opindex mtune
9109 This option is very similar to the @option{-mcpu=} option, except that
9110 instead of specifying the actual target processor type, and hence
9111 restricting which instructions can be used, it specifies that GCC should
9112 tune the performance of the code as if the target were of the type
9113 specified in this option, but still choosing the instructions that it
9114 will generate based on the cpu specified by a @option{-mcpu=} option.
9115 For some ARM implementations better performance can be obtained by using
9116 this option.
9117
9118 @item -march=@var{name}
9119 @opindex march
9120 This specifies the name of the target ARM architecture.  GCC uses this
9121 name to determine what kind of instructions it can emit when generating
9122 assembly code.  This option can be used in conjunction with or instead
9123 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
9124 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
9125 @samp{armv5}, @samp{armv5t}, @samp{armv5e}, @samp{armv5te},
9126 @samp{armv6}, @samp{armv6j},
9127 @samp{armv6t2}, @samp{armv6z}, @samp{armv6zk}, @samp{armv6-m},
9128 @samp{armv7}, @samp{armv7-a}, @samp{armv7-r}, @samp{armv7-m},
9129 @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312}.
9130
9131 @item -mfpu=@var{name}
9132 @itemx -mfpe=@var{number}
9133 @itemx -mfp=@var{number}
9134 @opindex mfpu
9135 @opindex mfpe
9136 @opindex mfp
9137 This specifies what floating point hardware (or hardware emulation) is
9138 available on the target.  Permissible names are: @samp{fpa}, @samp{fpe2},
9139 @samp{fpe3}, @samp{maverick}, @samp{vfp}, @samp{vfpv3}, @samp{vfpv3-d16} and
9140 @samp{neon}.  @option{-mfp} and @option{-mfpe}
9141 are synonyms for @option{-mfpu}=@samp{fpe}@var{number}, for compatibility
9142 with older versions of GCC@.
9143
9144 If @option{-msoft-float} is specified this specifies the format of
9145 floating point values.
9146
9147 @item -mstructure-size-boundary=@var{n}
9148 @opindex mstructure-size-boundary
9149 The size of all structures and unions will be rounded up to a multiple
9150 of the number of bits set by this option.  Permissible values are 8, 32
9151 and 64.  The default value varies for different toolchains.  For the COFF
9152 targeted toolchain the default value is 8.  A value of 64 is only allowed
9153 if the underlying ABI supports it.
9154
9155 Specifying the larger number can produce faster, more efficient code, but
9156 can also increase the size of the program.  Different values are potentially
9157 incompatible.  Code compiled with one value cannot necessarily expect to
9158 work with code or libraries compiled with another value, if they exchange
9159 information using structures or unions.
9160
9161 @item -mabort-on-noreturn
9162 @opindex mabort-on-noreturn
9163 Generate a call to the function @code{abort} at the end of a
9164 @code{noreturn} function.  It will be executed if the function tries to
9165 return.
9166
9167 @item -mlong-calls
9168 @itemx -mno-long-calls
9169 @opindex mlong-calls
9170 @opindex mno-long-calls
9171 Tells the compiler to perform function calls by first loading the
9172 address of the function into a register and then performing a subroutine
9173 call on this register.  This switch is needed if the target function
9174 will lie outside of the 64 megabyte addressing range of the offset based
9175 version of subroutine call instruction.
9176
9177 Even if this switch is enabled, not all function calls will be turned
9178 into long calls.  The heuristic is that static functions, functions
9179 which have the @samp{short-call} attribute, functions that are inside
9180 the scope of a @samp{#pragma no_long_calls} directive and functions whose
9181 definitions have already been compiled within the current compilation
9182 unit, will not be turned into long calls.  The exception to this rule is
9183 that weak function definitions, functions with the @samp{long-call}
9184 attribute or the @samp{section} attribute, and functions that are within
9185 the scope of a @samp{#pragma long_calls} directive, will always be
9186 turned into long calls.
9187
9188 This feature is not enabled by default.  Specifying
9189 @option{-mno-long-calls} will restore the default behavior, as will
9190 placing the function calls within the scope of a @samp{#pragma
9191 long_calls_off} directive.  Note these switches have no effect on how
9192 the compiler generates code to handle function calls via function
9193 pointers.
9194
9195 @item -msingle-pic-base
9196 @opindex msingle-pic-base
9197 Treat the register used for PIC addressing as read-only, rather than
9198 loading it in the prologue for each function.  The run-time system is
9199 responsible for initializing this register with an appropriate value
9200 before execution begins.
9201
9202 @item -mpic-register=@var{reg}
9203 @opindex mpic-register
9204 Specify the register to be used for PIC addressing.  The default is R10
9205 unless stack-checking is enabled, when R9 is used.
9206
9207 @item -mcirrus-fix-invalid-insns
9208 @opindex mcirrus-fix-invalid-insns
9209 @opindex mno-cirrus-fix-invalid-insns
9210 Insert NOPs into the instruction stream to in order to work around
9211 problems with invalid Maverick instruction combinations.  This option
9212 is only valid if the @option{-mcpu=ep9312} option has been used to
9213 enable generation of instructions for the Cirrus Maverick floating
9214 point co-processor.  This option is not enabled by default, since the
9215 problem is only present in older Maverick implementations.  The default
9216 can be re-enabled by use of the @option{-mno-cirrus-fix-invalid-insns}
9217 switch.
9218
9219 @item -mpoke-function-name
9220 @opindex mpoke-function-name
9221 Write the name of each function into the text section, directly
9222 preceding the function prologue.  The generated code is similar to this:
9223
9224 @smallexample
9225      t0
9226          .ascii "arm_poke_function_name", 0
9227          .align
9228      t1
9229          .word 0xff000000 + (t1 - t0)
9230      arm_poke_function_name
9231          mov     ip, sp
9232          stmfd   sp!, @{fp, ip, lr, pc@}
9233          sub     fp, ip, #4
9234 @end smallexample
9235
9236 When performing a stack backtrace, code can inspect the value of
9237 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
9238 location @code{pc - 12} and the top 8 bits are set, then we know that
9239 there is a function name embedded immediately preceding this location
9240 and has length @code{((pc[-3]) & 0xff000000)}.
9241
9242 @item -mthumb
9243 @opindex mthumb
9244 Generate code for the Thumb instruction set.  The default is to
9245 use the 32-bit ARM instruction set.
9246 This option automatically enables either 16-bit Thumb-1 or
9247 mixed 16/32-bit Thumb-2 instructions based on the @option{-mcpu=@var{name}}
9248 and @option{-march=@var{name}} options. This option is not passed to the 
9249 assembler. If you want to force assembler files to be interpreted as Thumb code,
9250 either add a @samp{.thumb} directive to the source or pass the @option{-mthumb} 
9251 option directly to the assembler by prefixing it with @option{-Wa}.
9252
9253 @item -mtpcs-frame
9254 @opindex mtpcs-frame
9255 Generate a stack frame that is compliant with the Thumb Procedure Call
9256 Standard for all non-leaf functions.  (A leaf function is one that does
9257 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
9258
9259 @item -mtpcs-leaf-frame
9260 @opindex mtpcs-leaf-frame
9261 Generate a stack frame that is compliant with the Thumb Procedure Call
9262 Standard for all leaf functions.  (A leaf function is one that does
9263 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
9264
9265 @item -mcallee-super-interworking
9266 @opindex mcallee-super-interworking
9267 Gives all externally visible functions in the file being compiled an ARM
9268 instruction set header which switches to Thumb mode before executing the
9269 rest of the function.  This allows these functions to be called from
9270 non-interworking code.
9271
9272 @item -mcaller-super-interworking
9273 @opindex mcaller-super-interworking
9274 Allows calls via function pointers (including virtual functions) to
9275 execute correctly regardless of whether the target code has been
9276 compiled for interworking or not.  There is a small overhead in the cost
9277 of executing a function pointer if this option is enabled.
9278
9279 @item -mtp=@var{name}
9280 @opindex mtp
9281 Specify the access model for the thread local storage pointer.  The valid
9282 models are @option{soft}, which generates calls to @code{__aeabi_read_tp},
9283 @option{cp15}, which fetches the thread pointer from @code{cp15} directly
9284 (supported in the arm6k architecture), and @option{auto}, which uses the
9285 best available method for the selected processor.  The default setting is
9286 @option{auto}.
9287
9288 @item -mword-relocations
9289 @opindex mword-relocations
9290 Only generate absolute relocations on word sized values (i.e. R_ARM_ABS32).
9291 This is enabled by default on targets (uClinux, SymbianOS) where the runtime
9292 loader imposes this restriction, and when @option{-fpic} or @option{-fPIC}
9293 is specified.
9294
9295 @end table
9296
9297 @node AVR Options
9298 @subsection AVR Options
9299 @cindex AVR Options
9300
9301 These options are defined for AVR implementations:
9302
9303 @table @gcctabopt
9304 @item -mmcu=@var{mcu}
9305 @opindex mmcu
9306 Specify ATMEL AVR instruction set or MCU type.
9307
9308 Instruction set avr1 is for the minimal AVR core, not supported by the C
9309 compiler, only for assembler programs (MCU types: at90s1200, attiny10,
9310 attiny11, attiny12, attiny15, attiny28).
9311
9312 Instruction set avr2 (default) is for the classic AVR core with up to
9313 8K program memory space (MCU types: at90s2313, at90s2323, attiny22,
9314 at90s2333, at90s2343, at90s4414, at90s4433, at90s4434, at90s8515,
9315 at90c8534, at90s8535).
9316
9317 Instruction set avr3 is for the classic AVR core with up to 128K program
9318 memory space (MCU types: atmega103, atmega603, at43usb320, at76c711).
9319
9320 Instruction set avr4 is for the enhanced AVR core with up to 8K program
9321 memory space (MCU types: atmega8, atmega83, atmega85).
9322
9323 Instruction set avr5 is for the enhanced AVR core with up to 128K program
9324 memory space (MCU types: atmega16, atmega161, atmega163, atmega32, atmega323,
9325 atmega64, atmega128, at43usb355, at94k).
9326
9327 @item -msize
9328 @opindex msize
9329 Output instruction sizes to the asm file.
9330
9331 @item -minit-stack=@var{N}
9332 @opindex minit-stack
9333 Specify the initial stack address, which may be a symbol or numeric value,
9334 @samp{__stack} is the default.
9335
9336 @item -mno-interrupts
9337 @opindex mno-interrupts
9338 Generated code is not compatible with hardware interrupts.
9339 Code size will be smaller.
9340
9341 @item -mcall-prologues
9342 @opindex mcall-prologues
9343 Functions prologues/epilogues expanded as call to appropriate
9344 subroutines.  Code size will be smaller.
9345
9346 @item -mtiny-stack
9347 @opindex mtiny-stack
9348 Change only the low 8 bits of the stack pointer.
9349
9350 @item -mint8
9351 @opindex mint8
9352 Assume int to be 8 bit integer.  This affects the sizes of all types: A
9353 char will be 1 byte, an int will be 1 byte, an long will be 2 bytes
9354 and long long will be 4 bytes.  Please note that this option does not
9355 comply to the C standards, but it will provide you with smaller code
9356 size.
9357 @end table
9358
9359 @node Blackfin Options
9360 @subsection Blackfin Options
9361 @cindex Blackfin Options
9362
9363 @table @gcctabopt
9364 @item -mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]}
9365 @opindex mcpu=
9366 Specifies the name of the target Blackfin processor.  Currently, @var{cpu}
9367 can be one of @samp{bf512}, @samp{bf514}, @samp{bf516}, @samp{bf518},
9368 @samp{bf522}, @samp{bf523}, @samp{bf524}, @samp{bf525}, @samp{bf526},
9369 @samp{bf527}, @samp{bf531}, @samp{bf532}, @samp{bf533},
9370 @samp{bf534}, @samp{bf536}, @samp{bf537}, @samp{bf538}, @samp{bf539},
9371 @samp{bf542}, @samp{bf544}, @samp{bf547}, @samp{bf548}, @samp{bf549},
9372 @samp{bf561}.
9373 The optional @var{sirevision} specifies the silicon revision of the target
9374 Blackfin processor.  Any workarounds available for the targeted silicon revision
9375 will be enabled.  If @var{sirevision} is @samp{none}, no workarounds are enabled.
9376 If @var{sirevision} is @samp{any}, all workarounds for the targeted processor
9377 will be enabled.  The @code{__SILICON_REVISION__} macro is defined to two
9378 hexadecimal digits representing the major and minor numbers in the silicon
9379 revision.  If @var{sirevision} is @samp{none}, the @code{__SILICON_REVISION__}
9380 is not defined.  If @var{sirevision} is @samp{any}, the
9381 @code{__SILICON_REVISION__} is defined to be @code{0xffff}.
9382 If this optional @var{sirevision} is not used, GCC assumes the latest known
9383 silicon revision of the targeted Blackfin processor.
9384
9385 Support for @samp{bf561} is incomplete.  For @samp{bf561},
9386 Only the processor macro is defined.
9387 Without this option, @samp{bf532} is used as the processor by default.
9388 The corresponding predefined processor macros for @var{cpu} is to
9389 be defined.  And for @samp{bfin-elf} toolchain, this causes the hardware BSP
9390 provided by libgloss to be linked in if @option{-msim} is not given.
9391
9392 @item -msim
9393 @opindex msim
9394 Specifies that the program will be run on the simulator.  This causes
9395 the simulator BSP provided by libgloss to be linked in.  This option
9396 has effect only for @samp{bfin-elf} toolchain.
9397 Certain other options, such as @option{-mid-shared-library} and
9398 @option{-mfdpic}, imply @option{-msim}.
9399
9400 @item -momit-leaf-frame-pointer
9401 @opindex momit-leaf-frame-pointer
9402 Don't keep the frame pointer in a register for leaf functions.  This
9403 avoids the instructions to save, set up and restore frame pointers and
9404 makes an extra register available in leaf functions.  The option
9405 @option{-fomit-frame-pointer} removes the frame pointer for all functions
9406 which might make debugging harder.
9407
9408 @item -mspecld-anomaly
9409 @opindex mspecld-anomaly
9410 When enabled, the compiler will ensure that the generated code does not
9411 contain speculative loads after jump instructions. If this option is used,
9412 @code{__WORKAROUND_SPECULATIVE_LOADS} is defined.
9413
9414 @item -mno-specld-anomaly
9415 @opindex mno-specld-anomaly
9416 Don't generate extra code to prevent speculative loads from occurring.
9417
9418 @item -mcsync-anomaly
9419 @opindex mcsync-anomaly
9420 When enabled, the compiler will ensure that the generated code does not
9421 contain CSYNC or SSYNC instructions too soon after conditional branches.
9422 If this option is used, @code{__WORKAROUND_SPECULATIVE_SYNCS} is defined.
9423
9424 @item -mno-csync-anomaly
9425 @opindex mno-csync-anomaly
9426 Don't generate extra code to prevent CSYNC or SSYNC instructions from
9427 occurring too soon after a conditional branch.
9428
9429 @item -mlow-64k
9430 @opindex mlow-64k
9431 When enabled, the compiler is free to take advantage of the knowledge that
9432 the entire program fits into the low 64k of memory.
9433
9434 @item -mno-low-64k
9435 @opindex mno-low-64k
9436 Assume that the program is arbitrarily large.  This is the default.
9437
9438 @item -mstack-check-l1
9439 @opindex mstack-check-l1
9440 Do stack checking using information placed into L1 scratchpad memory by the
9441 uClinux kernel.
9442
9443 @item -mid-shared-library
9444 @opindex mid-shared-library
9445 Generate code that supports shared libraries via the library ID method.
9446 This allows for execute in place and shared libraries in an environment
9447 without virtual memory management.  This option implies @option{-fPIC}.
9448 With a @samp{bfin-elf} target, this option implies @option{-msim}.
9449
9450 @item -mno-id-shared-library
9451 @opindex mno-id-shared-library
9452 Generate code that doesn't assume ID based shared libraries are being used.
9453 This is the default.
9454
9455 @item -mleaf-id-shared-library
9456 @opindex mleaf-id-shared-library
9457 Generate code that supports shared libraries via the library ID method,
9458 but assumes that this library or executable won't link against any other
9459 ID shared libraries.  That allows the compiler to use faster code for jumps
9460 and calls.
9461
9462 @item -mno-leaf-id-shared-library
9463 @opindex mno-leaf-id-shared-library
9464 Do not assume that the code being compiled won't link against any ID shared
9465 libraries.  Slower code will be generated for jump and call insns.
9466
9467 @item -mshared-library-id=n
9468 @opindex mshared-library-id
9469 Specified the identification number of the ID based shared library being
9470 compiled.  Specifying a value of 0 will generate more compact code, specifying
9471 other values will force the allocation of that number to the current
9472 library but is no more space or time efficient than omitting this option.
9473
9474 @item -msep-data
9475 @opindex msep-data
9476 Generate code that allows the data segment to be located in a different
9477 area of memory from the text segment.  This allows for execute in place in
9478 an environment without virtual memory management by eliminating relocations
9479 against the text section.
9480
9481 @item -mno-sep-data
9482 @opindex mno-sep-data
9483 Generate code that assumes that the data segment follows the text segment.
9484 This is the default.
9485
9486 @item -mlong-calls
9487 @itemx -mno-long-calls
9488 @opindex mlong-calls
9489 @opindex mno-long-calls
9490 Tells the compiler to perform function calls by first loading the
9491 address of the function into a register and then performing a subroutine
9492 call on this register.  This switch is needed if the target function
9493 will lie outside of the 24 bit addressing range of the offset based
9494 version of subroutine call instruction.
9495
9496 This feature is not enabled by default.  Specifying
9497 @option{-mno-long-calls} will restore the default behavior.  Note these
9498 switches have no effect on how the compiler generates code to handle
9499 function calls via function pointers.
9500
9501 @item -mfast-fp
9502 @opindex mfast-fp
9503 Link with the fast floating-point library. This library relaxes some of
9504 the IEEE floating-point standard's rules for checking inputs against
9505 Not-a-Number (NAN), in the interest of performance.
9506
9507 @item -minline-plt
9508 @opindex minline-plt
9509 Enable inlining of PLT entries in function calls to functions that are
9510 not known to bind locally.  It has no effect without @option{-mfdpic}.
9511
9512 @item -mmulticore
9513 @opindex mmulticore
9514 Build standalone application for multicore Blackfin processor. Proper
9515 start files and link scripts will be used to support multicore.
9516 This option defines @code{__BFIN_MULTICORE}. It can only be used with
9517 @option{-mcpu=bf561@r{[}-@var{sirevision}@r{]}}. It can be used with
9518 @option{-mcorea} or @option{-mcoreb}. If it's used without
9519 @option{-mcorea} or @option{-mcoreb}, single application/dual core
9520 programming model is used. In this model, the main function of Core B
9521 should be named as coreb_main. If it's used with @option{-mcorea} or
9522 @option{-mcoreb}, one application per core programming model is used.
9523 If this option is not used, single core application programming
9524 model is used.
9525
9526 @item -mcorea
9527 @opindex mcorea
9528 Build standalone application for Core A of BF561 when using
9529 one application per core programming model. Proper start files
9530 and link scripts will be used to support Core A. This option
9531 defines @code{__BFIN_COREA}. It must be used with @option{-mmulticore}.
9532
9533 @item -mcoreb
9534 @opindex mcoreb
9535 Build standalone application for Core B of BF561 when using
9536 one application per core programming model. Proper start files
9537 and link scripts will be used to support Core B. This option
9538 defines @code{__BFIN_COREB}. When this option is used, coreb_main
9539 should be used instead of main. It must be used with
9540 @option{-mmulticore}. 
9541
9542 @item -msdram
9543 @opindex msdram
9544 Build standalone application for SDRAM. Proper start files and
9545 link scripts will be used to put the application into SDRAM.
9546 Loader should initialize SDRAM before loading the application
9547 into SDRAM. This option defines @code{__BFIN_SDRAM}.
9548
9549 @item -micplb
9550 @opindex micplb
9551 Assume that ICPLBs are enabled at runtime.  This has an effect on certain
9552 anomaly workarounds.  For Linux targets, the default is to assume ICPLBs
9553 are enabled; for standalone applications the default is off.
9554 @end table
9555
9556 @node CRIS Options
9557 @subsection CRIS Options
9558 @cindex CRIS Options
9559
9560 These options are defined specifically for the CRIS ports.
9561
9562 @table @gcctabopt
9563 @item -march=@var{architecture-type}
9564 @itemx -mcpu=@var{architecture-type}
9565 @opindex march
9566 @opindex mcpu
9567 Generate code for the specified architecture.  The choices for
9568 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
9569 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
9570 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
9571 @samp{v10}.
9572
9573 @item -mtune=@var{architecture-type}
9574 @opindex mtune
9575 Tune to @var{architecture-type} everything applicable about the generated
9576 code, except for the ABI and the set of available instructions.  The
9577 choices for @var{architecture-type} are the same as for
9578 @option{-march=@var{architecture-type}}.
9579
9580 @item -mmax-stack-frame=@var{n}
9581 @opindex mmax-stack-frame
9582 Warn when the stack frame of a function exceeds @var{n} bytes.
9583
9584 @item -metrax4
9585 @itemx -metrax100
9586 @opindex metrax4
9587 @opindex metrax100
9588 The options @option{-metrax4} and @option{-metrax100} are synonyms for
9589 @option{-march=v3} and @option{-march=v8} respectively.
9590
9591 @item -mmul-bug-workaround
9592 @itemx -mno-mul-bug-workaround
9593 @opindex mmul-bug-workaround
9594 @opindex mno-mul-bug-workaround
9595 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
9596 models where it applies.  This option is active by default.
9597
9598 @item -mpdebug
9599 @opindex mpdebug
9600 Enable CRIS-specific verbose debug-related information in the assembly
9601 code.  This option also has the effect to turn off the @samp{#NO_APP}
9602 formatted-code indicator to the assembler at the beginning of the
9603 assembly file.
9604
9605 @item -mcc-init
9606 @opindex mcc-init
9607 Do not use condition-code results from previous instruction; always emit
9608 compare and test instructions before use of condition codes.
9609
9610 @item -mno-side-effects
9611 @opindex mno-side-effects
9612 Do not emit instructions with side-effects in addressing modes other than
9613 post-increment.
9614
9615 @item -mstack-align
9616 @itemx -mno-stack-align
9617 @itemx -mdata-align
9618 @itemx -mno-data-align
9619 @itemx -mconst-align
9620 @itemx -mno-const-align
9621 @opindex mstack-align
9622 @opindex mno-stack-align
9623 @opindex mdata-align
9624 @opindex mno-data-align
9625 @opindex mconst-align
9626 @opindex mno-const-align
9627 These options (no-options) arranges (eliminate arrangements) for the
9628 stack-frame, individual data and constants to be aligned for the maximum
9629 single data access size for the chosen CPU model.  The default is to
9630 arrange for 32-bit alignment.  ABI details such as structure layout are
9631 not affected by these options.
9632
9633 @item -m32-bit
9634 @itemx -m16-bit
9635 @itemx -m8-bit
9636 @opindex m32-bit
9637 @opindex m16-bit
9638 @opindex m8-bit
9639 Similar to the stack- data- and const-align options above, these options
9640 arrange for stack-frame, writable data and constants to all be 32-bit,
9641 16-bit or 8-bit aligned.  The default is 32-bit alignment.
9642
9643 @item -mno-prologue-epilogue
9644 @itemx -mprologue-epilogue
9645 @opindex mno-prologue-epilogue
9646 @opindex mprologue-epilogue
9647 With @option{-mno-prologue-epilogue}, the normal function prologue and
9648 epilogue that sets up the stack-frame are omitted and no return
9649 instructions or return sequences are generated in the code.  Use this
9650 option only together with visual inspection of the compiled code: no
9651 warnings or errors are generated when call-saved registers must be saved,
9652 or storage for local variable needs to be allocated.
9653
9654 @item -mno-gotplt
9655 @itemx -mgotplt
9656 @opindex mno-gotplt
9657 @opindex mgotplt
9658 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
9659 instruction sequences that load addresses for functions from the PLT part
9660 of the GOT rather than (traditional on other architectures) calls to the
9661 PLT@.  The default is @option{-mgotplt}.
9662
9663 @item -melf
9664 @opindex melf
9665 Legacy no-op option only recognized with the cris-axis-elf and
9666 cris-axis-linux-gnu targets.
9667
9668 @item -mlinux
9669 @opindex mlinux
9670 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
9671
9672 @item -sim
9673 @opindex sim
9674 This option, recognized for the cris-axis-elf arranges
9675 to link with input-output functions from a simulator library.  Code,
9676 initialized data and zero-initialized data are allocated consecutively.
9677
9678 @item -sim2
9679 @opindex sim2
9680 Like @option{-sim}, but pass linker options to locate initialized data at
9681 0x40000000 and zero-initialized data at 0x80000000.
9682 @end table
9683
9684 @node CRX Options
9685 @subsection CRX Options
9686 @cindex CRX Options
9687
9688 These options are defined specifically for the CRX ports.
9689
9690 @table @gcctabopt
9691
9692 @item -mmac
9693 @opindex mmac
9694 Enable the use of multiply-accumulate instructions. Disabled by default.
9695
9696 @item -mpush-args
9697 @opindex mpush-args
9698 Push instructions will be used to pass outgoing arguments when functions
9699 are called. Enabled by default.
9700 @end table
9701
9702 @node Darwin Options
9703 @subsection Darwin Options
9704 @cindex Darwin options
9705
9706 These options are defined for all architectures running the Darwin operating
9707 system.
9708
9709 FSF GCC on Darwin does not create ``fat'' object files; it will create
9710 an object file for the single architecture that it was built to
9711 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
9712 @option{-arch} options are used; it does so by running the compiler or
9713 linker multiple times and joining the results together with
9714 @file{lipo}.
9715
9716 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
9717 @samp{i686}) is determined by the flags that specify the ISA
9718 that GCC is targetting, like @option{-mcpu} or @option{-march}.  The
9719 @option{-force_cpusubtype_ALL} option can be used to override this.
9720
9721 The Darwin tools vary in their behavior when presented with an ISA
9722 mismatch.  The assembler, @file{as}, will only permit instructions to
9723 be used that are valid for the subtype of the file it is generating,
9724 so you cannot put 64-bit instructions in an @samp{ppc750} object file.
9725 The linker for shared libraries, @file{/usr/bin/libtool}, will fail
9726 and print an error if asked to create a shared library with a less
9727 restrictive subtype than its input files (for instance, trying to put
9728 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
9729 for executables, @file{ld}, will quietly give the executable the most
9730 restrictive subtype of any of its input files.
9731
9732 @table @gcctabopt
9733 @item -F@var{dir}
9734 @opindex F
9735 Add the framework directory @var{dir} to the head of the list of
9736 directories to be searched for header files.  These directories are
9737 interleaved with those specified by @option{-I} options and are
9738 scanned in a left-to-right order.
9739
9740 A framework directory is a directory with frameworks in it.  A
9741 framework is a directory with a @samp{"Headers"} and/or
9742 @samp{"PrivateHeaders"} directory contained directly in it that ends
9743 in @samp{".framework"}.  The name of a framework is the name of this
9744 directory excluding the @samp{".framework"}.  Headers associated with
9745 the framework are found in one of those two directories, with
9746 @samp{"Headers"} being searched first.  A subframework is a framework
9747 directory that is in a framework's @samp{"Frameworks"} directory.
9748 Includes of subframework headers can only appear in a header of a
9749 framework that contains the subframework, or in a sibling subframework
9750 header.  Two subframeworks are siblings if they occur in the same
9751 framework.  A subframework should not have the same name as a
9752 framework, a warning will be issued if this is violated.  Currently a
9753 subframework cannot have subframeworks, in the future, the mechanism
9754 may be extended to support this.  The standard frameworks can be found
9755 in @samp{"/System/Library/Frameworks"} and
9756 @samp{"/Library/Frameworks"}.  An example include looks like
9757 @code{#include <Framework/header.h>}, where @samp{Framework} denotes
9758 the name of the framework and header.h is found in the
9759 @samp{"PrivateHeaders"} or @samp{"Headers"} directory.
9760
9761 @item -iframework@var{dir}
9762 @opindex iframework
9763 Like @option{-F} except the directory is a treated as a system
9764 directory.  The main difference between this @option{-iframework} and
9765 @option{-F} is that with @option{-iframework} the compiler does not
9766 warn about constructs contained within header files found via
9767 @var{dir}.  This option is valid only for the C family of languages.
9768
9769 @item -gused
9770 @opindex gused
9771 Emit debugging information for symbols that are used.  For STABS
9772 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
9773 This is by default ON@.
9774
9775 @item -gfull
9776 @opindex gfull
9777 Emit debugging information for all symbols and types.
9778
9779 @item -mmacosx-version-min=@var{version}
9780 The earliest version of MacOS X that this executable will run on
9781 is @var{version}.  Typical values of @var{version} include @code{10.1},
9782 @code{10.2}, and @code{10.3.9}.
9783
9784 If the compiler was built to use the system's headers by default,
9785 then the default for this option is the system version on which the
9786 compiler is running, otherwise the default is to make choices which
9787 are compatible with as many systems and code bases as possible.
9788
9789 @item -mkernel
9790 @opindex mkernel
9791 Enable kernel development mode.  The @option{-mkernel} option sets
9792 @option{-static}, @option{-fno-common}, @option{-fno-cxa-atexit},
9793 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
9794 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
9795 applicable.  This mode also sets @option{-mno-altivec},
9796 @option{-msoft-float}, @option{-fno-builtin} and
9797 @option{-mlong-branch} for PowerPC targets.
9798
9799 @item -mone-byte-bool
9800 @opindex mone-byte-bool
9801 Override the defaults for @samp{bool} so that @samp{sizeof(bool)==1}.
9802 By default @samp{sizeof(bool)} is @samp{4} when compiling for
9803 Darwin/PowerPC and @samp{1} when compiling for Darwin/x86, so this
9804 option has no effect on x86.
9805
9806 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
9807 to generate code that is not binary compatible with code generated
9808 without that switch.  Using this switch may require recompiling all
9809 other modules in a program, including system libraries.  Use this
9810 switch to conform to a non-default data model.
9811
9812 @item -mfix-and-continue
9813 @itemx -ffix-and-continue
9814 @itemx -findirect-data
9815 @opindex mfix-and-continue
9816 @opindex ffix-and-continue
9817 @opindex findirect-data
9818 Generate code suitable for fast turn around development.  Needed to
9819 enable gdb to dynamically load @code{.o} files into already running
9820 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
9821 are provided for backwards compatibility.
9822
9823 @item -all_load
9824 @opindex all_load
9825 Loads all members of static archive libraries.
9826 See man ld(1) for more information.
9827
9828 @item -arch_errors_fatal
9829 @opindex arch_errors_fatal
9830 Cause the errors having to do with files that have the wrong architecture
9831 to be fatal.
9832
9833 @item -bind_at_load
9834 @opindex bind_at_load
9835 Causes the output file to be marked such that the dynamic linker will
9836 bind all undefined references when the file is loaded or launched.
9837
9838 @item -bundle
9839 @opindex bundle
9840 Produce a Mach-o bundle format file.
9841 See man ld(1) for more information.
9842
9843 @item -bundle_loader @var{executable}
9844 @opindex bundle_loader
9845 This option specifies the @var{executable} that will be loading the build
9846 output file being linked.  See man ld(1) for more information.
9847
9848 @item -dynamiclib
9849 @opindex dynamiclib
9850 When passed this option, GCC will produce a dynamic library instead of
9851 an executable when linking, using the Darwin @file{libtool} command.
9852
9853 @item -force_cpusubtype_ALL
9854 @opindex force_cpusubtype_ALL
9855 This causes GCC's output file to have the @var{ALL} subtype, instead of
9856 one controlled by the @option{-mcpu} or @option{-march} option.
9857
9858 @item -allowable_client  @var{client_name}
9859 @itemx -client_name
9860 @itemx -compatibility_version
9861 @itemx -current_version
9862 @itemx -dead_strip
9863 @itemx -dependency-file
9864 @itemx -dylib_file
9865 @itemx -dylinker_install_name
9866 @itemx -dynamic
9867 @itemx -exported_symbols_list
9868 @itemx -filelist
9869 @itemx -flat_namespace
9870 @itemx -force_flat_namespace
9871 @itemx -headerpad_max_install_names
9872 @itemx -image_base
9873 @itemx -init
9874 @itemx -install_name
9875 @itemx -keep_private_externs
9876 @itemx -multi_module
9877 @itemx -multiply_defined
9878 @itemx -multiply_defined_unused
9879 @itemx -noall_load
9880 @itemx -no_dead_strip_inits_and_terms
9881 @itemx -nofixprebinding
9882 @itemx -nomultidefs
9883 @itemx -noprebind
9884 @itemx -noseglinkedit
9885 @itemx -pagezero_size
9886 @itemx -prebind
9887 @itemx -prebind_all_twolevel_modules
9888 @itemx -private_bundle
9889 @itemx -read_only_relocs
9890 @itemx -sectalign
9891 @itemx -sectobjectsymbols
9892 @itemx -whyload
9893 @itemx -seg1addr
9894 @itemx -sectcreate
9895 @itemx -sectobjectsymbols
9896 @itemx -sectorder
9897 @itemx -segaddr
9898 @itemx -segs_read_only_addr
9899 @itemx -segs_read_write_addr
9900 @itemx -seg_addr_table
9901 @itemx -seg_addr_table_filename
9902 @itemx -seglinkedit
9903 @itemx -segprot
9904 @itemx -segs_read_only_addr
9905 @itemx -segs_read_write_addr
9906 @itemx -single_module
9907 @itemx -static
9908 @itemx -sub_library
9909 @itemx -sub_umbrella
9910 @itemx -twolevel_namespace
9911 @itemx -umbrella
9912 @itemx -undefined
9913 @itemx -unexported_symbols_list
9914 @itemx -weak_reference_mismatches
9915 @itemx -whatsloaded
9916 @opindex allowable_client
9917 @opindex client_name
9918 @opindex compatibility_version
9919 @opindex current_version
9920 @opindex dead_strip
9921 @opindex dependency-file
9922 @opindex dylib_file
9923 @opindex dylinker_install_name
9924 @opindex dynamic
9925 @opindex exported_symbols_list
9926 @opindex filelist
9927 @opindex flat_namespace
9928 @opindex force_flat_namespace
9929 @opindex headerpad_max_install_names
9930 @opindex image_base
9931 @opindex init
9932 @opindex install_name
9933 @opindex keep_private_externs
9934 @opindex multi_module
9935 @opindex multiply_defined
9936 @opindex multiply_defined_unused
9937 @opindex noall_load
9938 @opindex no_dead_strip_inits_and_terms
9939 @opindex nofixprebinding
9940 @opindex nomultidefs
9941 @opindex noprebind
9942 @opindex noseglinkedit
9943 @opindex pagezero_size
9944 @opindex prebind
9945 @opindex prebind_all_twolevel_modules
9946 @opindex private_bundle
9947 @opindex read_only_relocs
9948 @opindex sectalign
9949 @opindex sectobjectsymbols
9950 @opindex whyload
9951 @opindex seg1addr
9952 @opindex sectcreate
9953 @opindex sectobjectsymbols
9954 @opindex sectorder
9955 @opindex segaddr
9956 @opindex segs_read_only_addr
9957 @opindex segs_read_write_addr
9958 @opindex seg_addr_table
9959 @opindex seg_addr_table_filename
9960 @opindex seglinkedit
9961 @opindex segprot
9962 @opindex segs_read_only_addr
9963 @opindex segs_read_write_addr
9964 @opindex single_module
9965 @opindex static
9966 @opindex sub_library
9967 @opindex sub_umbrella
9968 @opindex twolevel_namespace
9969 @opindex umbrella
9970 @opindex undefined
9971 @opindex unexported_symbols_list
9972 @opindex weak_reference_mismatches
9973 @opindex whatsloaded
9974 These options are passed to the Darwin linker.  The Darwin linker man page
9975 describes them in detail.
9976 @end table
9977
9978 @node DEC Alpha Options
9979 @subsection DEC Alpha Options
9980
9981 These @samp{-m} options are defined for the DEC Alpha implementations:
9982
9983 @table @gcctabopt
9984 @item -mno-soft-float
9985 @itemx -msoft-float
9986 @opindex mno-soft-float
9987 @opindex msoft-float
9988 Use (do not use) the hardware floating-point instructions for
9989 floating-point operations.  When @option{-msoft-float} is specified,
9990 functions in @file{libgcc.a} will be used to perform floating-point
9991 operations.  Unless they are replaced by routines that emulate the
9992 floating-point operations, or compiled in such a way as to call such
9993 emulations routines, these routines will issue floating-point
9994 operations.   If you are compiling for an Alpha without floating-point
9995 operations, you must ensure that the library is built so as not to call
9996 them.
9997
9998 Note that Alpha implementations without floating-point operations are
9999 required to have floating-point registers.
10000
10001 @item -mfp-reg
10002 @itemx -mno-fp-regs
10003 @opindex mfp-reg
10004 @opindex mno-fp-regs
10005 Generate code that uses (does not use) the floating-point register set.
10006 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
10007 register set is not used, floating point operands are passed in integer
10008 registers as if they were integers and floating-point results are passed
10009 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
10010 so any function with a floating-point argument or return value called by code
10011 compiled with @option{-mno-fp-regs} must also be compiled with that
10012 option.
10013
10014 A typical use of this option is building a kernel that does not use,
10015 and hence need not save and restore, any floating-point registers.
10016
10017 @item -mieee
10018 @opindex mieee
10019 The Alpha architecture implements floating-point hardware optimized for
10020 maximum performance.  It is mostly compliant with the IEEE floating
10021 point standard.  However, for full compliance, software assistance is
10022 required.  This option generates code fully IEEE compliant code
10023 @emph{except} that the @var{inexact-flag} is not maintained (see below).
10024 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
10025 defined during compilation.  The resulting code is less efficient but is
10026 able to correctly support denormalized numbers and exceptional IEEE
10027 values such as not-a-number and plus/minus infinity.  Other Alpha
10028 compilers call this option @option{-ieee_with_no_inexact}.
10029
10030 @item -mieee-with-inexact
10031 @opindex mieee-with-inexact
10032 This is like @option{-mieee} except the generated code also maintains
10033 the IEEE @var{inexact-flag}.  Turning on this option causes the
10034 generated code to implement fully-compliant IEEE math.  In addition to
10035 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
10036 macro.  On some Alpha implementations the resulting code may execute
10037 significantly slower than the code generated by default.  Since there is
10038 very little code that depends on the @var{inexact-flag}, you should
10039 normally not specify this option.  Other Alpha compilers call this
10040 option @option{-ieee_with_inexact}.
10041
10042 @item -mfp-trap-mode=@var{trap-mode}
10043 @opindex mfp-trap-mode
10044 This option controls what floating-point related traps are enabled.
10045 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
10046 The trap mode can be set to one of four values:
10047
10048 @table @samp
10049 @item n
10050 This is the default (normal) setting.  The only traps that are enabled
10051 are the ones that cannot be disabled in software (e.g., division by zero
10052 trap).
10053
10054 @item u
10055 In addition to the traps enabled by @samp{n}, underflow traps are enabled
10056 as well.
10057
10058 @item su
10059 Like @samp{u}, but the instructions are marked to be safe for software
10060 completion (see Alpha architecture manual for details).
10061
10062 @item sui
10063 Like @samp{su}, but inexact traps are enabled as well.
10064 @end table
10065
10066 @item -mfp-rounding-mode=@var{rounding-mode}
10067 @opindex mfp-rounding-mode
10068 Selects the IEEE rounding mode.  Other Alpha compilers call this option
10069 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
10070 of:
10071
10072 @table @samp
10073 @item n
10074 Normal IEEE rounding mode.  Floating point numbers are rounded towards
10075 the nearest machine number or towards the even machine number in case
10076 of a tie.
10077
10078 @item m
10079 Round towards minus infinity.
10080
10081 @item c
10082 Chopped rounding mode.  Floating point numbers are rounded towards zero.
10083
10084 @item d
10085 Dynamic rounding mode.  A field in the floating point control register
10086 (@var{fpcr}, see Alpha architecture reference manual) controls the
10087 rounding mode in effect.  The C library initializes this register for
10088 rounding towards plus infinity.  Thus, unless your program modifies the
10089 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
10090 @end table
10091
10092 @item -mtrap-precision=@var{trap-precision}
10093 @opindex mtrap-precision
10094 In the Alpha architecture, floating point traps are imprecise.  This
10095 means without software assistance it is impossible to recover from a
10096 floating trap and program execution normally needs to be terminated.
10097 GCC can generate code that can assist operating system trap handlers
10098 in determining the exact location that caused a floating point trap.
10099 Depending on the requirements of an application, different levels of
10100 precisions can be selected:
10101
10102 @table @samp
10103 @item p
10104 Program precision.  This option is the default and means a trap handler
10105 can only identify which program caused a floating point exception.
10106
10107 @item f
10108 Function precision.  The trap handler can determine the function that
10109 caused a floating point exception.
10110
10111 @item i
10112 Instruction precision.  The trap handler can determine the exact
10113 instruction that caused a floating point exception.
10114 @end table
10115
10116 Other Alpha compilers provide the equivalent options called
10117 @option{-scope_safe} and @option{-resumption_safe}.
10118
10119 @item -mieee-conformant
10120 @opindex mieee-conformant
10121 This option marks the generated code as IEEE conformant.  You must not
10122 use this option unless you also specify @option{-mtrap-precision=i} and either
10123 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
10124 is to emit the line @samp{.eflag 48} in the function prologue of the
10125 generated assembly file.  Under DEC Unix, this has the effect that
10126 IEEE-conformant math library routines will be linked in.
10127
10128 @item -mbuild-constants
10129 @opindex mbuild-constants
10130 Normally GCC examines a 32- or 64-bit integer constant to
10131 see if it can construct it from smaller constants in two or three
10132 instructions.  If it cannot, it will output the constant as a literal and
10133 generate code to load it from the data segment at runtime.
10134
10135 Use this option to require GCC to construct @emph{all} integer constants
10136 using code, even if it takes more instructions (the maximum is six).
10137
10138 You would typically use this option to build a shared library dynamic
10139 loader.  Itself a shared library, it must relocate itself in memory
10140 before it can find the variables and constants in its own data segment.
10141
10142 @item -malpha-as
10143 @itemx -mgas
10144 @opindex malpha-as
10145 @opindex mgas
10146 Select whether to generate code to be assembled by the vendor-supplied
10147 assembler (@option{-malpha-as}) or by the GNU assembler @option{-mgas}.
10148
10149 @item -mbwx
10150 @itemx -mno-bwx
10151 @itemx -mcix
10152 @itemx -mno-cix
10153 @itemx -mfix
10154 @itemx -mno-fix
10155 @itemx -mmax
10156 @itemx -mno-max
10157 @opindex mbwx
10158 @opindex mno-bwx
10159 @opindex mcix
10160 @opindex mno-cix
10161 @opindex mfix
10162 @opindex mno-fix
10163 @opindex mmax
10164 @opindex mno-max
10165 Indicate whether GCC should generate code to use the optional BWX,
10166 CIX, FIX and MAX instruction sets.  The default is to use the instruction
10167 sets supported by the CPU type specified via @option{-mcpu=} option or that
10168 of the CPU on which GCC was built if none was specified.
10169
10170 @item -mfloat-vax
10171 @itemx -mfloat-ieee
10172 @opindex mfloat-vax
10173 @opindex mfloat-ieee
10174 Generate code that uses (does not use) VAX F and G floating point
10175 arithmetic instead of IEEE single and double precision.
10176
10177 @item -mexplicit-relocs
10178 @itemx -mno-explicit-relocs
10179 @opindex mexplicit-relocs
10180 @opindex mno-explicit-relocs
10181 Older Alpha assemblers provided no way to generate symbol relocations
10182 except via assembler macros.  Use of these macros does not allow
10183 optimal instruction scheduling.  GNU binutils as of version 2.12
10184 supports a new syntax that allows the compiler to explicitly mark
10185 which relocations should apply to which instructions.  This option
10186 is mostly useful for debugging, as GCC detects the capabilities of
10187 the assembler when it is built and sets the default accordingly.
10188
10189 @item -msmall-data
10190 @itemx -mlarge-data
10191 @opindex msmall-data
10192 @opindex mlarge-data
10193 When @option{-mexplicit-relocs} is in effect, static data is
10194 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
10195 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
10196 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
10197 16-bit relocations off of the @code{$gp} register.  This limits the
10198 size of the small data area to 64KB, but allows the variables to be
10199 directly accessed via a single instruction.
10200
10201 The default is @option{-mlarge-data}.  With this option the data area
10202 is limited to just below 2GB@.  Programs that require more than 2GB of
10203 data must use @code{malloc} or @code{mmap} to allocate the data in the
10204 heap instead of in the program's data segment.
10205
10206 When generating code for shared libraries, @option{-fpic} implies
10207 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
10208
10209 @item -msmall-text
10210 @itemx -mlarge-text
10211 @opindex msmall-text
10212 @opindex mlarge-text
10213 When @option{-msmall-text} is used, the compiler assumes that the
10214 code of the entire program (or shared library) fits in 4MB, and is
10215 thus reachable with a branch instruction.  When @option{-msmall-data}
10216 is used, the compiler can assume that all local symbols share the
10217 same @code{$gp} value, and thus reduce the number of instructions
10218 required for a function call from 4 to 1.
10219
10220 The default is @option{-mlarge-text}.
10221
10222 @item -mcpu=@var{cpu_type}
10223 @opindex mcpu
10224 Set the instruction set and instruction scheduling parameters for
10225 machine type @var{cpu_type}.  You can specify either the @samp{EV}
10226 style name or the corresponding chip number.  GCC supports scheduling
10227 parameters for the EV4, EV5 and EV6 family of processors and will
10228 choose the default values for the instruction set from the processor
10229 you specify.  If you do not specify a processor type, GCC will default
10230 to the processor on which the compiler was built.
10231
10232 Supported values for @var{cpu_type} are
10233
10234 @table @samp
10235 @item ev4
10236 @itemx ev45
10237 @itemx 21064
10238 Schedules as an EV4 and has no instruction set extensions.
10239
10240 @item ev5
10241 @itemx 21164
10242 Schedules as an EV5 and has no instruction set extensions.
10243
10244 @item ev56
10245 @itemx 21164a
10246 Schedules as an EV5 and supports the BWX extension.
10247
10248 @item pca56
10249 @itemx 21164pc
10250 @itemx 21164PC
10251 Schedules as an EV5 and supports the BWX and MAX extensions.
10252
10253 @item ev6
10254 @itemx 21264
10255 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
10256
10257 @item ev67
10258 @itemx 21264a
10259 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
10260 @end table
10261
10262 Native Linux/GNU toolchains also support the value @samp{native},
10263 which selects the best architecture option for the host processor.
10264 @option{-mcpu=native} has no effect if GCC does not recognize
10265 the processor.
10266
10267 @item -mtune=@var{cpu_type}
10268 @opindex mtune
10269 Set only the instruction scheduling parameters for machine type
10270 @var{cpu_type}.  The instruction set is not changed.
10271
10272 Native Linux/GNU toolchains also support the value @samp{native},
10273 which selects the best architecture option for the host processor.
10274 @option{-mtune=native} has no effect if GCC does not recognize
10275 the processor.
10276
10277 @item -mmemory-latency=@var{time}
10278 @opindex mmemory-latency
10279 Sets the latency the scheduler should assume for typical memory
10280 references as seen by the application.  This number is highly
10281 dependent on the memory access patterns used by the application
10282 and the size of the external cache on the machine.
10283
10284 Valid options for @var{time} are
10285
10286 @table @samp
10287 @item @var{number}
10288 A decimal number representing clock cycles.
10289
10290 @item L1
10291 @itemx L2
10292 @itemx L3
10293 @itemx main
10294 The compiler contains estimates of the number of clock cycles for
10295 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
10296 (also called Dcache, Scache, and Bcache), as well as to main memory.
10297 Note that L3 is only valid for EV5.
10298
10299 @end table
10300 @end table
10301
10302 @node DEC Alpha/VMS Options
10303 @subsection DEC Alpha/VMS Options
10304
10305 These @samp{-m} options are defined for the DEC Alpha/VMS implementations:
10306
10307 @table @gcctabopt
10308 @item -mvms-return-codes
10309 @opindex mvms-return-codes
10310 Return VMS condition codes from main.  The default is to return POSIX
10311 style condition (e.g.@: error) codes.
10312 @end table
10313
10314 @node FR30 Options
10315 @subsection FR30 Options
10316 @cindex FR30 Options
10317
10318 These options are defined specifically for the FR30 port.
10319
10320 @table @gcctabopt
10321
10322 @item -msmall-model
10323 @opindex msmall-model
10324 Use the small address space model.  This can produce smaller code, but
10325 it does assume that all symbolic values and addresses will fit into a
10326 20-bit range.
10327
10328 @item -mno-lsim
10329 @opindex mno-lsim
10330 Assume that run-time support has been provided and so there is no need
10331 to include the simulator library (@file{libsim.a}) on the linker
10332 command line.
10333
10334 @end table
10335
10336 @node FRV Options
10337 @subsection FRV Options
10338 @cindex FRV Options
10339
10340 @table @gcctabopt
10341 @item -mgpr-32
10342 @opindex mgpr-32
10343
10344 Only use the first 32 general purpose registers.
10345
10346 @item -mgpr-64
10347 @opindex mgpr-64
10348
10349 Use all 64 general purpose registers.
10350
10351 @item -mfpr-32
10352 @opindex mfpr-32
10353
10354 Use only the first 32 floating point registers.
10355
10356 @item -mfpr-64
10357 @opindex mfpr-64
10358
10359 Use all 64 floating point registers
10360
10361 @item -mhard-float
10362 @opindex mhard-float
10363
10364 Use hardware instructions for floating point operations.
10365
10366 @item -msoft-float
10367 @opindex msoft-float
10368
10369 Use library routines for floating point operations.
10370
10371 @item -malloc-cc
10372 @opindex malloc-cc
10373
10374 Dynamically allocate condition code registers.
10375
10376 @item -mfixed-cc
10377 @opindex mfixed-cc
10378
10379 Do not try to dynamically allocate condition code registers, only
10380 use @code{icc0} and @code{fcc0}.
10381
10382 @item -mdword
10383 @opindex mdword
10384
10385 Change ABI to use double word insns.
10386
10387 @item -mno-dword
10388 @opindex mno-dword
10389
10390 Do not use double word instructions.
10391
10392 @item -mdouble
10393 @opindex mdouble
10394
10395 Use floating point double instructions.
10396
10397 @item -mno-double
10398 @opindex mno-double
10399
10400 Do not use floating point double instructions.
10401
10402 @item -mmedia
10403 @opindex mmedia
10404
10405 Use media instructions.
10406
10407 @item -mno-media
10408 @opindex mno-media
10409
10410 Do not use media instructions.
10411
10412 @item -mmuladd
10413 @opindex mmuladd
10414
10415 Use multiply and add/subtract instructions.
10416
10417 @item -mno-muladd
10418 @opindex mno-muladd
10419
10420 Do not use multiply and add/subtract instructions.
10421
10422 @item -mfdpic
10423 @opindex mfdpic
10424
10425 Select the FDPIC ABI, that uses function descriptors to represent
10426 pointers to functions.  Without any PIC/PIE-related options, it
10427 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
10428 assumes GOT entries and small data are within a 12-bit range from the
10429 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
10430 are computed with 32 bits.
10431 With a @samp{bfin-elf} target, this option implies @option{-msim}.
10432
10433 @item -minline-plt
10434 @opindex minline-plt
10435
10436 Enable inlining of PLT entries in function calls to functions that are
10437 not known to bind locally.  It has no effect without @option{-mfdpic}.
10438 It's enabled by default if optimizing for speed and compiling for
10439 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
10440 optimization option such as @option{-O3} or above is present in the
10441 command line.
10442
10443 @item -mTLS
10444 @opindex TLS
10445
10446 Assume a large TLS segment when generating thread-local code.
10447
10448 @item -mtls
10449 @opindex tls
10450
10451 Do not assume a large TLS segment when generating thread-local code.
10452
10453 @item -mgprel-ro
10454 @opindex mgprel-ro
10455
10456 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
10457 that is known to be in read-only sections.  It's enabled by default,
10458 except for @option{-fpic} or @option{-fpie}: even though it may help
10459 make the global offset table smaller, it trades 1 instruction for 4.
10460 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
10461 one of which may be shared by multiple symbols, and it avoids the need
10462 for a GOT entry for the referenced symbol, so it's more likely to be a
10463 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
10464
10465 @item -multilib-library-pic
10466 @opindex multilib-library-pic
10467
10468 Link with the (library, not FD) pic libraries.  It's implied by
10469 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
10470 @option{-fpic} without @option{-mfdpic}.  You should never have to use
10471 it explicitly.
10472
10473 @item -mlinked-fp
10474 @opindex mlinked-fp
10475
10476 Follow the EABI requirement of always creating a frame pointer whenever
10477 a stack frame is allocated.  This option is enabled by default and can
10478 be disabled with @option{-mno-linked-fp}.
10479
10480 @item -mlong-calls
10481 @opindex mlong-calls
10482
10483 Use indirect addressing to call functions outside the current
10484 compilation unit.  This allows the functions to be placed anywhere
10485 within the 32-bit address space.
10486
10487 @item -malign-labels
10488 @opindex malign-labels
10489
10490 Try to align labels to an 8-byte boundary by inserting nops into the
10491 previous packet.  This option only has an effect when VLIW packing
10492 is enabled.  It doesn't create new packets; it merely adds nops to
10493 existing ones.
10494
10495 @item -mlibrary-pic
10496 @opindex mlibrary-pic
10497
10498 Generate position-independent EABI code.
10499
10500 @item -macc-4
10501 @opindex macc-4
10502
10503 Use only the first four media accumulator registers.
10504
10505 @item -macc-8
10506 @opindex macc-8
10507
10508 Use all eight media accumulator registers.
10509
10510 @item -mpack
10511 @opindex mpack
10512
10513 Pack VLIW instructions.
10514
10515 @item -mno-pack
10516 @opindex mno-pack
10517
10518 Do not pack VLIW instructions.
10519
10520 @item -mno-eflags
10521 @opindex mno-eflags
10522
10523 Do not mark ABI switches in e_flags.
10524
10525 @item -mcond-move
10526 @opindex mcond-move
10527
10528 Enable the use of conditional-move instructions (default).
10529
10530 This switch is mainly for debugging the compiler and will likely be removed
10531 in a future version.
10532
10533 @item -mno-cond-move
10534 @opindex mno-cond-move
10535
10536 Disable the use of conditional-move instructions.
10537
10538 This switch is mainly for debugging the compiler and will likely be removed
10539 in a future version.
10540
10541 @item -mscc
10542 @opindex mscc
10543
10544 Enable the use of conditional set instructions (default).
10545
10546 This switch is mainly for debugging the compiler and will likely be removed
10547 in a future version.
10548
10549 @item -mno-scc
10550 @opindex mno-scc
10551
10552 Disable the use of conditional set instructions.
10553
10554 This switch is mainly for debugging the compiler and will likely be removed
10555 in a future version.
10556
10557 @item -mcond-exec
10558 @opindex mcond-exec
10559
10560 Enable the use of conditional execution (default).
10561
10562 This switch is mainly for debugging the compiler and will likely be removed
10563 in a future version.
10564
10565 @item -mno-cond-exec
10566 @opindex mno-cond-exec
10567
10568 Disable the use of conditional execution.
10569
10570 This switch is mainly for debugging the compiler and will likely be removed
10571 in a future version.
10572
10573 @item -mvliw-branch
10574 @opindex mvliw-branch
10575
10576 Run a pass to pack branches into VLIW instructions (default).
10577
10578 This switch is mainly for debugging the compiler and will likely be removed
10579 in a future version.
10580
10581 @item -mno-vliw-branch
10582 @opindex mno-vliw-branch
10583
10584 Do not run a pass to pack branches into VLIW instructions.
10585
10586 This switch is mainly for debugging the compiler and will likely be removed
10587 in a future version.
10588
10589 @item -mmulti-cond-exec
10590 @opindex mmulti-cond-exec
10591
10592 Enable optimization of @code{&&} and @code{||} in conditional execution
10593 (default).
10594
10595 This switch is mainly for debugging the compiler and will likely be removed
10596 in a future version.
10597
10598 @item -mno-multi-cond-exec
10599 @opindex mno-multi-cond-exec
10600
10601 Disable optimization of @code{&&} and @code{||} in conditional execution.
10602
10603 This switch is mainly for debugging the compiler and will likely be removed
10604 in a future version.
10605
10606 @item -mnested-cond-exec
10607 @opindex mnested-cond-exec
10608
10609 Enable nested conditional execution optimizations (default).
10610
10611 This switch is mainly for debugging the compiler and will likely be removed
10612 in a future version.
10613
10614 @item -mno-nested-cond-exec
10615 @opindex mno-nested-cond-exec
10616
10617 Disable nested conditional execution optimizations.
10618
10619 This switch is mainly for debugging the compiler and will likely be removed
10620 in a future version.
10621
10622 @item -moptimize-membar
10623 @opindex moptimize-membar
10624
10625 This switch removes redundant @code{membar} instructions from the
10626 compiler generated code.  It is enabled by default.
10627
10628 @item -mno-optimize-membar
10629 @opindex mno-optimize-membar
10630
10631 This switch disables the automatic removal of redundant @code{membar}
10632 instructions from the generated code.
10633
10634 @item -mtomcat-stats
10635 @opindex mtomcat-stats
10636
10637 Cause gas to print out tomcat statistics.
10638
10639 @item -mcpu=@var{cpu}
10640 @opindex mcpu
10641
10642 Select the processor type for which to generate code.  Possible values are
10643 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
10644 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
10645
10646 @end table
10647
10648 @node GNU/Linux Options
10649 @subsection GNU/Linux Options
10650
10651 These @samp{-m} options are defined for GNU/Linux targets:
10652
10653 @table @gcctabopt
10654 @item -mglibc
10655 @opindex mglibc
10656 Use the GNU C library instead of uClibc.  This is the default except
10657 on @samp{*-*-linux-*uclibc*} targets.
10658
10659 @item -muclibc
10660 @opindex muclibc
10661 Use uClibc instead of the GNU C library.  This is the default on
10662 @samp{*-*-linux-*uclibc*} targets.
10663 @end table
10664
10665 @node H8/300 Options
10666 @subsection H8/300 Options
10667
10668 These @samp{-m} options are defined for the H8/300 implementations:
10669
10670 @table @gcctabopt
10671 @item -mrelax
10672 @opindex mrelax
10673 Shorten some address references at link time, when possible; uses the
10674 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
10675 ld, Using ld}, for a fuller description.
10676
10677 @item -mh
10678 @opindex mh
10679 Generate code for the H8/300H@.
10680
10681 @item -ms
10682 @opindex ms
10683 Generate code for the H8S@.
10684
10685 @item -mn
10686 @opindex mn
10687 Generate code for the H8S and H8/300H in the normal mode.  This switch
10688 must be used either with @option{-mh} or @option{-ms}.
10689
10690 @item -ms2600
10691 @opindex ms2600
10692 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
10693
10694 @item -mint32
10695 @opindex mint32
10696 Make @code{int} data 32 bits by default.
10697
10698 @item -malign-300
10699 @opindex malign-300
10700 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
10701 The default for the H8/300H and H8S is to align longs and floats on 4
10702 byte boundaries.
10703 @option{-malign-300} causes them to be aligned on 2 byte boundaries.
10704 This option has no effect on the H8/300.
10705 @end table
10706
10707 @node HPPA Options
10708 @subsection HPPA Options
10709 @cindex HPPA Options
10710
10711 These @samp{-m} options are defined for the HPPA family of computers:
10712
10713 @table @gcctabopt
10714 @item -march=@var{architecture-type}
10715 @opindex march
10716 Generate code for the specified architecture.  The choices for
10717 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
10718 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
10719 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
10720 architecture option for your machine.  Code compiled for lower numbered
10721 architectures will run on higher numbered architectures, but not the
10722 other way around.
10723
10724 @item -mpa-risc-1-0
10725 @itemx -mpa-risc-1-1
10726 @itemx -mpa-risc-2-0
10727 @opindex mpa-risc-1-0
10728 @opindex mpa-risc-1-1
10729 @opindex mpa-risc-2-0
10730 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
10731
10732 @item -mbig-switch
10733 @opindex mbig-switch
10734 Generate code suitable for big switch tables.  Use this option only if
10735 the assembler/linker complain about out of range branches within a switch
10736 table.
10737
10738 @item -mjump-in-delay
10739 @opindex mjump-in-delay
10740 Fill delay slots of function calls with unconditional jump instructions
10741 by modifying the return pointer for the function call to be the target
10742 of the conditional jump.
10743
10744 @item -mdisable-fpregs
10745 @opindex mdisable-fpregs
10746 Prevent floating point registers from being used in any manner.  This is
10747 necessary for compiling kernels which perform lazy context switching of
10748 floating point registers.  If you use this option and attempt to perform
10749 floating point operations, the compiler will abort.
10750
10751 @item -mdisable-indexing
10752 @opindex mdisable-indexing
10753 Prevent the compiler from using indexing address modes.  This avoids some
10754 rather obscure problems when compiling MIG generated code under MACH@.
10755
10756 @item -mno-space-regs
10757 @opindex mno-space-regs
10758 Generate code that assumes the target has no space registers.  This allows
10759 GCC to generate faster indirect calls and use unscaled index address modes.
10760
10761 Such code is suitable for level 0 PA systems and kernels.
10762
10763 @item -mfast-indirect-calls
10764 @opindex mfast-indirect-calls
10765 Generate code that assumes calls never cross space boundaries.  This
10766 allows GCC to emit code which performs faster indirect calls.
10767
10768 This option will not work in the presence of shared libraries or nested
10769 functions.
10770
10771 @item -mfixed-range=@var{register-range}
10772 @opindex mfixed-range
10773 Generate code treating the given register range as fixed registers.
10774 A fixed register is one that the register allocator can not use.  This is
10775 useful when compiling kernel code.  A register range is specified as
10776 two registers separated by a dash.  Multiple register ranges can be
10777 specified separated by a comma.
10778
10779 @item -mlong-load-store
10780 @opindex mlong-load-store
10781 Generate 3-instruction load and store sequences as sometimes required by
10782 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
10783 the HP compilers.
10784
10785 @item -mportable-runtime
10786 @opindex mportable-runtime
10787 Use the portable calling conventions proposed by HP for ELF systems.
10788
10789 @item -mgas
10790 @opindex mgas
10791 Enable the use of assembler directives only GAS understands.
10792
10793 @item -mschedule=@var{cpu-type}
10794 @opindex mschedule
10795 Schedule code according to the constraints for the machine type
10796 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
10797 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
10798 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
10799 proper scheduling option for your machine.  The default scheduling is
10800 @samp{8000}.
10801
10802 @item -mlinker-opt
10803 @opindex mlinker-opt
10804 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
10805 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
10806 linkers in which they give bogus error messages when linking some programs.
10807
10808 @item -msoft-float
10809 @opindex msoft-float
10810 Generate output containing library calls for floating point.
10811 @strong{Warning:} the requisite libraries are not available for all HPPA
10812 targets.  Normally the facilities of the machine's usual C compiler are
10813 used, but this cannot be done directly in cross-compilation.  You must make
10814 your own arrangements to provide suitable library functions for
10815 cross-compilation.
10816
10817 @option{-msoft-float} changes the calling convention in the output file;
10818 therefore, it is only useful if you compile @emph{all} of a program with
10819 this option.  In particular, you need to compile @file{libgcc.a}, the
10820 library that comes with GCC, with @option{-msoft-float} in order for
10821 this to work.
10822
10823 @item -msio
10824 @opindex msio
10825 Generate the predefine, @code{_SIO}, for server IO@.  The default is
10826 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
10827 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
10828 options are available under HP-UX and HI-UX@.
10829
10830 @item -mgnu-ld
10831 @opindex gnu-ld
10832 Use GNU ld specific options.  This passes @option{-shared} to ld when
10833 building a shared library.  It is the default when GCC is configured,
10834 explicitly or implicitly, with the GNU linker.  This option does not
10835 have any affect on which ld is called, it only changes what parameters
10836 are passed to that ld.  The ld that is called is determined by the
10837 @option{--with-ld} configure option, GCC's program search path, and
10838 finally by the user's @env{PATH}.  The linker used by GCC can be printed
10839 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
10840 on the 64 bit HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
10841
10842 @item -mhp-ld
10843 @opindex hp-ld
10844 Use HP ld specific options.  This passes @option{-b} to ld when building
10845 a shared library and passes @option{+Accept TypeMismatch} to ld on all
10846 links.  It is the default when GCC is configured, explicitly or
10847 implicitly, with the HP linker.  This option does not have any affect on
10848 which ld is called, it only changes what parameters are passed to that
10849 ld.  The ld that is called is determined by the @option{--with-ld}
10850 configure option, GCC's program search path, and finally by the user's
10851 @env{PATH}.  The linker used by GCC can be printed using @samp{which
10852 `gcc -print-prog-name=ld`}.  This option is only available on the 64 bit
10853 HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
10854
10855 @item -mlong-calls
10856 @opindex mno-long-calls
10857 Generate code that uses long call sequences.  This ensures that a call
10858 is always able to reach linker generated stubs.  The default is to generate
10859 long calls only when the distance from the call site to the beginning
10860 of the function or translation unit, as the case may be, exceeds a
10861 predefined limit set by the branch type being used.  The limits for
10862 normal calls are 7,600,000 and 240,000 bytes, respectively for the
10863 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
10864 240,000 bytes.
10865
10866 Distances are measured from the beginning of functions when using the
10867 @option{-ffunction-sections} option, or when using the @option{-mgas}
10868 and @option{-mno-portable-runtime} options together under HP-UX with
10869 the SOM linker.
10870
10871 It is normally not desirable to use this option as it will degrade
10872 performance.  However, it may be useful in large applications,
10873 particularly when partial linking is used to build the application.
10874
10875 The types of long calls used depends on the capabilities of the
10876 assembler and linker, and the type of code being generated.  The
10877 impact on systems that support long absolute calls, and long pic
10878 symbol-difference or pc-relative calls should be relatively small.
10879 However, an indirect call is used on 32-bit ELF systems in pic code
10880 and it is quite long.
10881
10882 @item -munix=@var{unix-std}
10883 @opindex march
10884 Generate compiler predefines and select a startfile for the specified
10885 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
10886 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
10887 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
10888 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
10889 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
10890 and later.
10891
10892 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
10893 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
10894 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
10895 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
10896 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
10897 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
10898
10899 It is @emph{important} to note that this option changes the interfaces
10900 for various library routines.  It also affects the operational behavior
10901 of the C library.  Thus, @emph{extreme} care is needed in using this
10902 option.
10903
10904 Library code that is intended to operate with more than one UNIX
10905 standard must test, set and restore the variable @var{__xpg4_extended_mask}
10906 as appropriate.  Most GNU software doesn't provide this capability.
10907
10908 @item -nolibdld
10909 @opindex nolibdld
10910 Suppress the generation of link options to search libdld.sl when the
10911 @option{-static} option is specified on HP-UX 10 and later.
10912
10913 @item -static
10914 @opindex static
10915 The HP-UX implementation of setlocale in libc has a dependency on
10916 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
10917 when the @option{-static} option is specified, special link options
10918 are needed to resolve this dependency.
10919
10920 On HP-UX 10 and later, the GCC driver adds the necessary options to
10921 link with libdld.sl when the @option{-static} option is specified.
10922 This causes the resulting binary to be dynamic.  On the 64-bit port,
10923 the linkers generate dynamic binaries by default in any case.  The
10924 @option{-nolibdld} option can be used to prevent the GCC driver from
10925 adding these link options.
10926
10927 @item -threads
10928 @opindex threads
10929 Add support for multithreading with the @dfn{dce thread} library
10930 under HP-UX@.  This option sets flags for both the preprocessor and
10931 linker.
10932 @end table
10933
10934 @node i386 and x86-64 Options
10935 @subsection Intel 386 and AMD x86-64 Options
10936 @cindex i386 Options
10937 @cindex x86-64 Options
10938 @cindex Intel 386 Options
10939 @cindex AMD x86-64 Options
10940
10941 These @samp{-m} options are defined for the i386 and x86-64 family of
10942 computers:
10943
10944 @table @gcctabopt
10945 @item -mtune=@var{cpu-type}
10946 @opindex mtune
10947 Tune to @var{cpu-type} everything applicable about the generated code, except
10948 for the ABI and the set of available instructions.  The choices for
10949 @var{cpu-type} are:
10950 @table @emph
10951 @item generic
10952 Produce code optimized for the most common IA32/AMD64/EM64T processors.
10953 If you know the CPU on which your code will run, then you should use
10954 the corresponding @option{-mtune} option instead of
10955 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
10956 of your application will have, then you should use this option.
10957
10958 As new processors are deployed in the marketplace, the behavior of this
10959 option will change.  Therefore, if you upgrade to a newer version of
10960 GCC, the code generated option will change to reflect the processors
10961 that were most common when that version of GCC was released.
10962
10963 There is no @option{-march=generic} option because @option{-march}
10964 indicates the instruction set the compiler can use, and there is no
10965 generic instruction set applicable to all processors.  In contrast,
10966 @option{-mtune} indicates the processor (or, in this case, collection of
10967 processors) for which the code is optimized.
10968 @item native
10969 This selects the CPU to tune for at compilation time by determining
10970 the processor type of the compiling machine.  Using @option{-mtune=native}
10971 will produce code optimized for the local machine under the constraints
10972 of the selected instruction set.  Using @option{-march=native} will
10973 enable all instruction subsets supported by the local machine (hence
10974 the result might not run on different machines).
10975 @item i386
10976 Original Intel's i386 CPU@.
10977 @item i486
10978 Intel's i486 CPU@.  (No scheduling is implemented for this chip.)
10979 @item i586, pentium
10980 Intel Pentium CPU with no MMX support.
10981 @item pentium-mmx
10982 Intel PentiumMMX CPU based on Pentium core with MMX instruction set support.
10983 @item pentiumpro
10984 Intel PentiumPro CPU@.
10985 @item i686
10986 Same as @code{generic}, but when used as @code{march} option, PentiumPro
10987 instruction set will be used, so the code will run on all i686 family chips.
10988 @item pentium2
10989 Intel Pentium2 CPU based on PentiumPro core with MMX instruction set support.
10990 @item pentium3, pentium3m
10991 Intel Pentium3 CPU based on PentiumPro core with MMX and SSE instruction set
10992 support.
10993 @item pentium-m
10994 Low power version of Intel Pentium3 CPU with MMX, SSE and SSE2 instruction set
10995 support.  Used by Centrino notebooks.
10996 @item pentium4, pentium4m
10997 Intel Pentium4 CPU with MMX, SSE and SSE2 instruction set support.
10998 @item prescott
10999 Improved version of Intel Pentium4 CPU with MMX, SSE, SSE2 and SSE3 instruction
11000 set support.
11001 @item nocona
11002 Improved version of Intel Pentium4 CPU with 64-bit extensions, MMX, SSE,
11003 SSE2 and SSE3 instruction set support.
11004 @item core2
11005 Intel Core2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
11006 instruction set support.
11007 @item atom
11008 Intel Atom CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
11009 instruction set support.
11010 @item k6
11011 AMD K6 CPU with MMX instruction set support.
11012 @item k6-2, k6-3
11013 Improved versions of AMD K6 CPU with MMX and 3dNOW!@: instruction set support.
11014 @item athlon, athlon-tbird
11015 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW!@: and SSE prefetch instructions
11016 support.
11017 @item athlon-4, athlon-xp, athlon-mp
11018 Improved AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW!@: and full SSE
11019 instruction set support.
11020 @item k8, opteron, athlon64, athlon-fx
11021 AMD K8 core based CPUs with x86-64 instruction set support.  (This supersets
11022 MMX, SSE, SSE2, 3dNOW!, enhanced 3dNOW!@: and 64-bit instruction set extensions.)
11023 @item k8-sse3, opteron-sse3, athlon64-sse3
11024 Improved versions of k8, opteron and athlon64 with SSE3 instruction set support.
11025 @item amdfam10, barcelona
11026 AMD Family 10h core based CPUs with x86-64 instruction set support.  (This
11027 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3dNOW!, enhanced 3dNOW!, ABM and 64-bit
11028 instruction set extensions.)
11029 @item winchip-c6
11030 IDT Winchip C6 CPU, dealt in same way as i486 with additional MMX instruction
11031 set support.
11032 @item winchip2
11033 IDT Winchip2 CPU, dealt in same way as i486 with additional MMX and 3dNOW!@:
11034 instruction set support.
11035 @item c3
11036 Via C3 CPU with MMX and 3dNOW!@: instruction set support.  (No scheduling is
11037 implemented for this chip.)
11038 @item c3-2
11039 Via C3-2 CPU with MMX and SSE instruction set support.  (No scheduling is
11040 implemented for this chip.)
11041 @item geode
11042 Embedded AMD CPU with MMX and 3dNOW! instruction set support.
11043 @end table
11044
11045 While picking a specific @var{cpu-type} will schedule things appropriately
11046 for that particular chip, the compiler will not generate any code that
11047 does not run on the i386 without the @option{-march=@var{cpu-type}} option
11048 being used.
11049
11050 @item -march=@var{cpu-type}
11051 @opindex march
11052 Generate instructions for the machine type @var{cpu-type}.  The choices
11053 for @var{cpu-type} are the same as for @option{-mtune}.  Moreover,
11054 specifying @option{-march=@var{cpu-type}} implies @option{-mtune=@var{cpu-type}}.
11055
11056 @item -mcpu=@var{cpu-type}
11057 @opindex mcpu
11058 A deprecated synonym for @option{-mtune}.
11059
11060 @item -mfpmath=@var{unit}
11061 @opindex mfpmath
11062 Generate floating point arithmetics for selected unit @var{unit}.  The choices
11063 for @var{unit} are:
11064
11065 @table @samp
11066 @item 387
11067 Use the standard 387 floating point coprocessor present majority of chips and
11068 emulated otherwise.  Code compiled with this option will run almost everywhere.
11069 The temporary results are computed in 80bit precision instead of precision
11070 specified by the type resulting in slightly different results compared to most
11071 of other chips.  See @option{-ffloat-store} for more detailed description.
11072
11073 This is the default choice for i386 compiler.
11074
11075 @item sse
11076 Use scalar floating point instructions present in the SSE instruction set.
11077 This instruction set is supported by Pentium3 and newer chips, in the AMD line
11078 by Athlon-4, Athlon-xp and Athlon-mp chips.  The earlier version of SSE
11079 instruction set supports only single precision arithmetics, thus the double and
11080 extended precision arithmetics is still done using 387.  Later version, present
11081 only in Pentium4 and the future AMD x86-64 chips supports double precision
11082 arithmetics too.
11083
11084 For the i386 compiler, you need to use @option{-march=@var{cpu-type}}, @option{-msse}
11085 or @option{-msse2} switches to enable SSE extensions and make this option
11086 effective.  For the x86-64 compiler, these extensions are enabled by default.
11087
11088 The resulting code should be considerably faster in the majority of cases and avoid
11089 the numerical instability problems of 387 code, but may break some existing
11090 code that expects temporaries to be 80bit.
11091
11092 This is the default choice for the x86-64 compiler.
11093
11094 @item sse,387
11095 @itemx sse+387
11096 @itemx both
11097 Attempt to utilize both instruction sets at once.  This effectively double the
11098 amount of available registers and on chips with separate execution units for
11099 387 and SSE the execution resources too.  Use this option with care, as it is
11100 still experimental, because the GCC register allocator does not model separate
11101 functional units well resulting in instable performance.
11102 @end table
11103
11104 @item -masm=@var{dialect}
11105 @opindex masm=@var{dialect}
11106 Output asm instructions using selected @var{dialect}.  Supported
11107 choices are @samp{intel} or @samp{att} (the default one).  Darwin does
11108 not support @samp{intel}.
11109
11110 @item -mieee-fp
11111 @itemx -mno-ieee-fp
11112 @opindex mieee-fp
11113 @opindex mno-ieee-fp
11114 Control whether or not the compiler uses IEEE floating point
11115 comparisons.  These handle correctly the case where the result of a
11116 comparison is unordered.
11117
11118 @item -msoft-float
11119 @opindex msoft-float
11120 Generate output containing library calls for floating point.
11121 @strong{Warning:} the requisite libraries are not part of GCC@.
11122 Normally the facilities of the machine's usual C compiler are used, but
11123 this can't be done directly in cross-compilation.  You must make your
11124 own arrangements to provide suitable library functions for
11125 cross-compilation.
11126
11127 On machines where a function returns floating point results in the 80387
11128 register stack, some floating point opcodes may be emitted even if
11129 @option{-msoft-float} is used.
11130
11131 @item -mno-fp-ret-in-387
11132 @opindex mno-fp-ret-in-387
11133 Do not use the FPU registers for return values of functions.
11134
11135 The usual calling convention has functions return values of types
11136 @code{float} and @code{double} in an FPU register, even if there
11137 is no FPU@.  The idea is that the operating system should emulate
11138 an FPU@.
11139
11140 The option @option{-mno-fp-ret-in-387} causes such values to be returned
11141 in ordinary CPU registers instead.
11142
11143 @item -mno-fancy-math-387
11144 @opindex mno-fancy-math-387
11145 Some 387 emulators do not support the @code{sin}, @code{cos} and
11146 @code{sqrt} instructions for the 387.  Specify this option to avoid
11147 generating those instructions.  This option is the default on FreeBSD,
11148 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
11149 indicates that the target cpu will always have an FPU and so the
11150 instruction will not need emulation.  As of revision 2.6.1, these
11151 instructions are not generated unless you also use the
11152 @option{-funsafe-math-optimizations} switch.
11153
11154 @item -malign-double
11155 @itemx -mno-align-double
11156 @opindex malign-double
11157 @opindex mno-align-double
11158 Control whether GCC aligns @code{double}, @code{long double}, and
11159 @code{long long} variables on a two word boundary or a one word
11160 boundary.  Aligning @code{double} variables on a two word boundary will
11161 produce code that runs somewhat faster on a @samp{Pentium} at the
11162 expense of more memory.
11163
11164 On x86-64, @option{-malign-double} is enabled by default.
11165
11166 @strong{Warning:} if you use the @option{-malign-double} switch,
11167 structures containing the above types will be aligned differently than
11168 the published application binary interface specifications for the 386
11169 and will not be binary compatible with structures in code compiled
11170 without that switch.
11171
11172 @item -m96bit-long-double
11173 @itemx -m128bit-long-double
11174 @opindex m96bit-long-double
11175 @opindex m128bit-long-double
11176 These switches control the size of @code{long double} type.  The i386
11177 application binary interface specifies the size to be 96 bits,
11178 so @option{-m96bit-long-double} is the default in 32 bit mode.
11179
11180 Modern architectures (Pentium and newer) would prefer @code{long double}
11181 to be aligned to an 8 or 16 byte boundary.  In arrays or structures
11182 conforming to the ABI, this would not be possible.  So specifying a
11183 @option{-m128bit-long-double} will align @code{long double}
11184 to a 16 byte boundary by padding the @code{long double} with an additional
11185 32 bit zero.
11186
11187 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
11188 its ABI specifies that @code{long double} is to be aligned on 16 byte boundary.
11189
11190 Notice that neither of these options enable any extra precision over the x87
11191 standard of 80 bits for a @code{long double}.
11192
11193 @strong{Warning:} if you override the default value for your target ABI, the
11194 structures and arrays containing @code{long double} variables will change
11195 their size as well as function calling convention for function taking
11196 @code{long double} will be modified.  Hence they will not be binary
11197 compatible with arrays or structures in code compiled without that switch.
11198
11199 @item -mlarge-data-threshold=@var{number}
11200 @opindex mlarge-data-threshold=@var{number}
11201 When @option{-mcmodel=medium} is specified, the data greater than
11202 @var{threshold} are placed in large data section.  This value must be the
11203 same across all object linked into the binary and defaults to 65535.
11204
11205 @item -mrtd
11206 @opindex mrtd
11207 Use a different function-calling convention, in which functions that
11208 take a fixed number of arguments return with the @code{ret} @var{num}
11209 instruction, which pops their arguments while returning.  This saves one
11210 instruction in the caller since there is no need to pop the arguments
11211 there.
11212
11213 You can specify that an individual function is called with this calling
11214 sequence with the function attribute @samp{stdcall}.  You can also
11215 override the @option{-mrtd} option by using the function attribute
11216 @samp{cdecl}.  @xref{Function Attributes}.
11217
11218 @strong{Warning:} this calling convention is incompatible with the one
11219 normally used on Unix, so you cannot use it if you need to call
11220 libraries compiled with the Unix compiler.
11221
11222 Also, you must provide function prototypes for all functions that
11223 take variable numbers of arguments (including @code{printf});
11224 otherwise incorrect code will be generated for calls to those
11225 functions.
11226
11227 In addition, seriously incorrect code will result if you call a
11228 function with too many arguments.  (Normally, extra arguments are
11229 harmlessly ignored.)
11230
11231 @item -mregparm=@var{num}
11232 @opindex mregparm
11233 Control how many registers are used to pass integer arguments.  By
11234 default, no registers are used to pass arguments, and at most 3
11235 registers can be used.  You can control this behavior for a specific
11236 function by using the function attribute @samp{regparm}.
11237 @xref{Function Attributes}.
11238
11239 @strong{Warning:} if you use this switch, and
11240 @var{num} is nonzero, then you must build all modules with the same
11241 value, including any libraries.  This includes the system libraries and
11242 startup modules.
11243
11244 @item -msseregparm
11245 @opindex msseregparm
11246 Use SSE register passing conventions for float and double arguments
11247 and return values.  You can control this behavior for a specific
11248 function by using the function attribute @samp{sseregparm}.
11249 @xref{Function Attributes}.
11250
11251 @strong{Warning:} if you use this switch then you must build all
11252 modules with the same value, including any libraries.  This includes
11253 the system libraries and startup modules.
11254
11255 @item -mpc32
11256 @itemx -mpc64
11257 @itemx -mpc80
11258 @opindex mpc32
11259 @opindex mpc64
11260 @opindex mpc80
11261
11262 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
11263 is specified, the significands of results of floating-point operations are
11264 rounded to 24 bits (single precision); @option{-mpc64} rounds the
11265 significands of results of floating-point operations to 53 bits (double
11266 precision) and @option{-mpc80} rounds the significands of results of
11267 floating-point operations to 64 bits (extended double precision), which is
11268 the default.  When this option is used, floating-point operations in higher
11269 precisions are not available to the programmer without setting the FPU
11270 control word explicitly.
11271
11272 Setting the rounding of floating-point operations to less than the default
11273 80 bits can speed some programs by 2% or more.  Note that some mathematical
11274 libraries assume that extended precision (80 bit) floating-point operations
11275 are enabled by default; routines in such libraries could suffer significant
11276 loss of accuracy, typically through so-called "catastrophic cancellation",
11277 when this option is used to set the precision to less than extended precision. 
11278
11279 @item -mstackrealign
11280 @opindex mstackrealign
11281 Realign the stack at entry.  On the Intel x86, the @option{-mstackrealign}
11282 option will generate an alternate prologue and epilogue that realigns the
11283 runtime stack if necessary.  This supports mixing legacy codes that keep
11284 a 4-byte aligned stack with modern codes that keep a 16-byte stack for
11285 SSE compatibility.  See also the attribute @code{force_align_arg_pointer},
11286 applicable to individual functions.
11287
11288 @item -mpreferred-stack-boundary=@var{num}
11289 @opindex mpreferred-stack-boundary
11290 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
11291 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
11292 the default is 4 (16 bytes or 128 bits).
11293
11294 @item -mincoming-stack-boundary=@var{num}
11295 @opindex mincoming-stack-boundary
11296 Assume the incoming stack is aligned to a 2 raised to @var{num} byte
11297 boundary.  If @option{-mincoming-stack-boundary} is not specified,
11298 the one specified by @option{-mpreferred-stack-boundary} will be used.
11299
11300 On Pentium and PentiumPro, @code{double} and @code{long double} values
11301 should be aligned to an 8 byte boundary (see @option{-malign-double}) or
11302 suffer significant run time performance penalties.  On Pentium III, the
11303 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
11304 properly if it is not 16 byte aligned.
11305
11306 To ensure proper alignment of this values on the stack, the stack boundary
11307 must be as aligned as that required by any value stored on the stack.
11308 Further, every function must be generated such that it keeps the stack
11309 aligned.  Thus calling a function compiled with a higher preferred
11310 stack boundary from a function compiled with a lower preferred stack
11311 boundary will most likely misalign the stack.  It is recommended that
11312 libraries that use callbacks always use the default setting.
11313
11314 This extra alignment does consume extra stack space, and generally
11315 increases code size.  Code that is sensitive to stack space usage, such
11316 as embedded systems and operating system kernels, may want to reduce the
11317 preferred alignment to @option{-mpreferred-stack-boundary=2}.
11318
11319 @item -mmmx
11320 @itemx -mno-mmx
11321 @itemx -msse
11322 @itemx -mno-sse
11323 @itemx -msse2
11324 @itemx -mno-sse2
11325 @itemx -msse3
11326 @itemx -mno-sse3
11327 @itemx -mssse3
11328 @itemx -mno-ssse3
11329 @itemx -msse4.1
11330 @itemx -mno-sse4.1
11331 @itemx -msse4.2
11332 @itemx -mno-sse4.2
11333 @itemx -msse4
11334 @itemx -mno-sse4
11335 @itemx -mavx
11336 @itemx -mno-avx
11337 @itemx -maes
11338 @itemx -mno-aes
11339 @itemx -mpclmul
11340 @itemx -mno-pclmul
11341 @itemx -msse4a
11342 @itemx -mno-sse4a
11343 @itemx -msse5
11344 @itemx -mno-sse5
11345 @itemx -m3dnow
11346 @itemx -mno-3dnow
11347 @itemx -mpopcnt
11348 @itemx -mno-popcnt
11349 @itemx -mabm
11350 @itemx -mno-abm
11351 @opindex mmmx
11352 @opindex mno-mmx
11353 @opindex msse
11354 @opindex mno-sse
11355 @opindex m3dnow
11356 @opindex mno-3dnow
11357 These switches enable or disable the use of instructions in the MMX,
11358 SSE, SSE2, SSE3, SSSE3, SSE4.1, AVX, AES, PCLMUL, SSE4A, SSE5, ABM or
11359 3DNow!@: extended instruction sets.
11360 These extensions are also available as built-in functions: see
11361 @ref{X86 Built-in Functions}, for details of the functions enabled and
11362 disabled by these switches.
11363
11364 To have SSE/SSE2 instructions generated automatically from floating-point
11365 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
11366
11367 GCC depresses SSEx instructions when @option{-mavx} is used. Instead, it
11368 generates new AVX instructions or AVX equivalence for all SSEx instructions
11369 when needed.
11370
11371 These options will enable GCC to use these extended instructions in
11372 generated code, even without @option{-mfpmath=sse}.  Applications which
11373 perform runtime CPU detection must compile separate files for each
11374 supported architecture, using the appropriate flags.  In particular,
11375 the file containing the CPU detection code should be compiled without
11376 these options.
11377
11378 @item -mcld
11379 @opindex mcld
11380 This option instructs GCC to emit a @code{cld} instruction in the prologue
11381 of functions that use string instructions.  String instructions depend on
11382 the DF flag to select between autoincrement or autodecrement mode.  While the
11383 ABI specifies the DF flag to be cleared on function entry, some operating
11384 systems violate this specification by not clearing the DF flag in their
11385 exception dispatchers.  The exception handler can be invoked with the DF flag
11386 set which leads to wrong direction mode, when string instructions are used.
11387 This option can be enabled by default on 32-bit x86 targets by configuring
11388 GCC with the @option{--enable-cld} configure option.  Generation of @code{cld}
11389 instructions can be suppressed with the @option{-mno-cld} compiler option
11390 in this case.
11391
11392 @item -mcx16
11393 @opindex mcx16
11394 This option will enable GCC to use CMPXCHG16B instruction in generated code.
11395 CMPXCHG16B allows for atomic operations on 128-bit double quadword (or oword)
11396 data types.  This is useful for high resolution counters that could be updated
11397 by multiple processors (or cores).  This instruction is generated as part of
11398 atomic built-in functions: see @ref{Atomic Builtins} for details.
11399
11400 @item -msahf
11401 @opindex msahf
11402 This option will enable GCC to use SAHF instruction in generated 64-bit code.
11403 Early Intel CPUs with Intel 64 lacked LAHF and SAHF instructions supported
11404 by AMD64 until introduction of Pentium 4 G1 step in December 2005.  LAHF and
11405 SAHF are load and store instructions, respectively, for certain status flags.
11406 In 64-bit mode, SAHF instruction is used to optimize @code{fmod}, @code{drem}
11407 or @code{remainder} built-in functions: see @ref{Other Builtins} for details.
11408
11409 @item -mrecip
11410 @opindex mrecip
11411 This option will enable GCC to use RCPSS and RSQRTSS instructions (and their
11412 vectorized variants RCPPS and RSQRTPS) with an additional Newton-Raphson step
11413 to increase precision instead of DIVSS and SQRTSS (and their vectorized
11414 variants) for single precision floating point arguments.  These instructions
11415 are generated only when @option{-funsafe-math-optimizations} is enabled
11416 together with @option{-finite-math-only} and @option{-fno-trapping-math}.
11417 Note that while the throughput of the sequence is higher than the throughput
11418 of the non-reciprocal instruction, the precision of the sequence can be
11419 decreased by up to 2 ulp (i.e. the inverse of 1.0 equals 0.99999994).
11420
11421 @item -mveclibabi=@var{type}
11422 @opindex mveclibabi
11423 Specifies the ABI type to use for vectorizing intrinsics using an
11424 external library.  Supported types are @code{svml} for the Intel short
11425 vector math library and @code{acml} for the AMD math core library style
11426 of interfacing.  GCC will currently emit calls to @code{vmldExp2},
11427 @code{vmldLn2}, @code{vmldLog102}, @code{vmldLog102}, @code{vmldPow2},
11428 @code{vmldTanh2}, @code{vmldTan2}, @code{vmldAtan2}, @code{vmldAtanh2},
11429 @code{vmldCbrt2}, @code{vmldSinh2}, @code{vmldSin2}, @code{vmldAsinh2},
11430 @code{vmldAsin2}, @code{vmldCosh2}, @code{vmldCos2}, @code{vmldAcosh2},
11431 @code{vmldAcos2}, @code{vmlsExp4}, @code{vmlsLn4}, @code{vmlsLog104},
11432 @code{vmlsLog104}, @code{vmlsPow4}, @code{vmlsTanh4}, @code{vmlsTan4},
11433 @code{vmlsAtan4}, @code{vmlsAtanh4}, @code{vmlsCbrt4}, @code{vmlsSinh4},
11434 @code{vmlsSin4}, @code{vmlsAsinh4}, @code{vmlsAsin4}, @code{vmlsCosh4},
11435 @code{vmlsCos4}, @code{vmlsAcosh4} and @code{vmlsAcos4} for corresponding
11436 function type when @option{-mveclibabi=svml} is used and @code{__vrd2_sin},
11437 @code{__vrd2_cos}, @code{__vrd2_exp}, @code{__vrd2_log}, @code{__vrd2_log2},
11438 @code{__vrd2_log10}, @code{__vrs4_sinf}, @code{__vrs4_cosf},
11439 @code{__vrs4_expf}, @code{__vrs4_logf}, @code{__vrs4_log2f},
11440 @code{__vrs4_log10f} and @code{__vrs4_powf} for corresponding function type
11441 when @option{-mveclibabi=acml} is used. Both @option{-ftree-vectorize} and
11442 @option{-funsafe-math-optimizations} have to be enabled. A SVML or ACML ABI
11443 compatible library will have to be specified at link time.
11444
11445 @item -mabi=@var{name}
11446 @opindex mabi
11447 Generate code for the specified calling convention.  Permissible values
11448 are: @samp{sysv} for the ABI used on GNU/Linux and other systems and
11449 @samp{ms} for the Microsoft ABI.  The default is to use the Microsoft
11450 ABI when targeting Windows.  On all other systems, the default is the
11451 SYSV ABI.  You can control this behavior for a specific function by
11452 using the function attribute @samp{ms_abi}/@samp{sysv_abi}.
11453 @xref{Function Attributes}.
11454
11455 @item -mpush-args
11456 @itemx -mno-push-args
11457 @opindex mpush-args
11458 @opindex mno-push-args
11459 Use PUSH operations to store outgoing parameters.  This method is shorter
11460 and usually equally fast as method using SUB/MOV operations and is enabled
11461 by default.  In some cases disabling it may improve performance because of
11462 improved scheduling and reduced dependencies.
11463
11464 @item -maccumulate-outgoing-args
11465 @opindex maccumulate-outgoing-args
11466 If enabled, the maximum amount of space required for outgoing arguments will be
11467 computed in the function prologue.  This is faster on most modern CPUs
11468 because of reduced dependencies, improved scheduling and reduced stack usage
11469 when preferred stack boundary is not equal to 2.  The drawback is a notable
11470 increase in code size.  This switch implies @option{-mno-push-args}.
11471
11472 @item -mthreads
11473 @opindex mthreads
11474 Support thread-safe exception handling on @samp{Mingw32}.  Code that relies
11475 on thread-safe exception handling must compile and link all code with the
11476 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
11477 @option{-D_MT}; when linking, it links in a special thread helper library
11478 @option{-lmingwthrd} which cleans up per thread exception handling data.
11479
11480 @item -mno-align-stringops
11481 @opindex mno-align-stringops
11482 Do not align destination of inlined string operations.  This switch reduces
11483 code size and improves performance in case the destination is already aligned,
11484 but GCC doesn't know about it.
11485
11486 @item -minline-all-stringops
11487 @opindex minline-all-stringops
11488 By default GCC inlines string operations only when destination is known to be
11489 aligned at least to 4 byte boundary.  This enables more inlining, increase code
11490 size, but may improve performance of code that depends on fast memcpy, strlen
11491 and memset for short lengths.
11492
11493 @item -minline-stringops-dynamically
11494 @opindex minline-stringops-dynamically
11495 For string operation of unknown size, inline runtime checks so for small
11496 blocks inline code is used, while for large blocks library call is used.
11497
11498 @item -mstringop-strategy=@var{alg}
11499 @opindex mstringop-strategy=@var{alg}
11500 Overwrite internal decision heuristic about particular algorithm to inline
11501 string operation with.  The allowed values are @code{rep_byte},
11502 @code{rep_4byte}, @code{rep_8byte} for expanding using i386 @code{rep} prefix
11503 of specified size, @code{byte_loop}, @code{loop}, @code{unrolled_loop} for
11504 expanding inline loop, @code{libcall} for always expanding library call.
11505
11506 @item -momit-leaf-frame-pointer
11507 @opindex momit-leaf-frame-pointer
11508 Don't keep the frame pointer in a register for leaf functions.  This
11509 avoids the instructions to save, set up and restore frame pointers and
11510 makes an extra register available in leaf functions.  The option
11511 @option{-fomit-frame-pointer} removes the frame pointer for all functions
11512 which might make debugging harder.
11513
11514 @item -mtls-direct-seg-refs
11515 @itemx -mno-tls-direct-seg-refs
11516 @opindex mtls-direct-seg-refs
11517 Controls whether TLS variables may be accessed with offsets from the
11518 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
11519 or whether the thread base pointer must be added.  Whether or not this
11520 is legal depends on the operating system, and whether it maps the
11521 segment to cover the entire TLS area.
11522
11523 For systems that use GNU libc, the default is on.
11524
11525 @item -mfused-madd
11526 @itemx -mno-fused-madd
11527 @opindex mfused-madd
11528 Enable automatic generation of fused floating point multiply-add instructions
11529 if the ISA supports such instructions.  The -mfused-madd option is on by
11530 default.  The fused multiply-add instructions have a different
11531 rounding behavior compared to executing a multiply followed by an add.
11532
11533 @item -msse2avx
11534 @itemx -mno-sse2avx
11535 @opindex msse2avx
11536 Specify that the assembler should encode SSE instructions with VEX
11537 prefix.  The option @option{-mavx} turns this on by default.
11538 @end table
11539
11540 These @samp{-m} switches are supported in addition to the above
11541 on AMD x86-64 processors in 64-bit environments.
11542
11543 @table @gcctabopt
11544 @item -m32
11545 @itemx -m64
11546 @opindex m32
11547 @opindex m64
11548 Generate code for a 32-bit or 64-bit environment.
11549 The 32-bit environment sets int, long and pointer to 32 bits and
11550 generates code that runs on any i386 system.
11551 The 64-bit environment sets int to 32 bits and long and pointer
11552 to 64 bits and generates code for AMD's x86-64 architecture. For
11553 darwin only the -m64 option turns off the @option{-fno-pic} and
11554 @option{-mdynamic-no-pic} options.
11555
11556 @item -mno-red-zone
11557 @opindex no-red-zone
11558 Do not use a so called red zone for x86-64 code.  The red zone is mandated
11559 by the x86-64 ABI, it is a 128-byte area beyond the location of the
11560 stack pointer that will not be modified by signal or interrupt handlers
11561 and therefore can be used for temporary data without adjusting the stack
11562 pointer.  The flag @option{-mno-red-zone} disables this red zone.
11563
11564 @item -mcmodel=small
11565 @opindex mcmodel=small
11566 Generate code for the small code model: the program and its symbols must
11567 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
11568 Programs can be statically or dynamically linked.  This is the default
11569 code model.
11570
11571 @item -mcmodel=kernel
11572 @opindex mcmodel=kernel
11573 Generate code for the kernel code model.  The kernel runs in the
11574 negative 2 GB of the address space.
11575 This model has to be used for Linux kernel code.
11576
11577 @item -mcmodel=medium
11578 @opindex mcmodel=medium
11579 Generate code for the medium model: The program is linked in the lower 2
11580 GB of the address space.  Small symbols are also placed there.  Symbols
11581 with sizes larger than @option{-mlarge-data-threshold} are put into
11582 large data or bss sections and can be located above 2GB.  Programs can
11583 be statically or dynamically linked.
11584
11585 @item -mcmodel=large
11586 @opindex mcmodel=large
11587 Generate code for the large model: This model makes no assumptions
11588 about addresses and sizes of sections.
11589 @end table
11590
11591 @node IA-64 Options
11592 @subsection IA-64 Options
11593 @cindex IA-64 Options
11594
11595 These are the @samp{-m} options defined for the Intel IA-64 architecture.
11596
11597 @table @gcctabopt
11598 @item -mbig-endian
11599 @opindex mbig-endian
11600 Generate code for a big endian target.  This is the default for HP-UX@.
11601
11602 @item -mlittle-endian
11603 @opindex mlittle-endian
11604 Generate code for a little endian target.  This is the default for AIX5
11605 and GNU/Linux.
11606
11607 @item -mgnu-as
11608 @itemx -mno-gnu-as
11609 @opindex mgnu-as
11610 @opindex mno-gnu-as
11611 Generate (or don't) code for the GNU assembler.  This is the default.
11612 @c Also, this is the default if the configure option @option{--with-gnu-as}
11613 @c is used.
11614
11615 @item -mgnu-ld
11616 @itemx -mno-gnu-ld
11617 @opindex mgnu-ld
11618 @opindex mno-gnu-ld
11619 Generate (or don't) code for the GNU linker.  This is the default.
11620 @c Also, this is the default if the configure option @option{--with-gnu-ld}
11621 @c is used.
11622
11623 @item -mno-pic
11624 @opindex mno-pic
11625 Generate code that does not use a global pointer register.  The result
11626 is not position independent code, and violates the IA-64 ABI@.
11627
11628 @item -mvolatile-asm-stop
11629 @itemx -mno-volatile-asm-stop
11630 @opindex mvolatile-asm-stop
11631 @opindex mno-volatile-asm-stop
11632 Generate (or don't) a stop bit immediately before and after volatile asm
11633 statements.
11634
11635 @item -mregister-names
11636 @itemx -mno-register-names
11637 @opindex mregister-names
11638 @opindex mno-register-names
11639 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
11640 the stacked registers.  This may make assembler output more readable.
11641
11642 @item -mno-sdata
11643 @itemx -msdata
11644 @opindex mno-sdata
11645 @opindex msdata
11646 Disable (or enable) optimizations that use the small data section.  This may
11647 be useful for working around optimizer bugs.
11648
11649 @item -mconstant-gp
11650 @opindex mconstant-gp
11651 Generate code that uses a single constant global pointer value.  This is
11652 useful when compiling kernel code.
11653
11654 @item -mauto-pic
11655 @opindex mauto-pic
11656 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
11657 This is useful when compiling firmware code.
11658
11659 @item -minline-float-divide-min-latency
11660 @opindex minline-float-divide-min-latency
11661 Generate code for inline divides of floating point values
11662 using the minimum latency algorithm.
11663
11664 @item -minline-float-divide-max-throughput
11665 @opindex minline-float-divide-max-throughput
11666 Generate code for inline divides of floating point values
11667 using the maximum throughput algorithm.
11668
11669 @item -minline-int-divide-min-latency
11670 @opindex minline-int-divide-min-latency
11671 Generate code for inline divides of integer values
11672 using the minimum latency algorithm.
11673
11674 @item -minline-int-divide-max-throughput
11675 @opindex minline-int-divide-max-throughput
11676 Generate code for inline divides of integer values
11677 using the maximum throughput algorithm.
11678
11679 @item -minline-sqrt-min-latency
11680 @opindex minline-sqrt-min-latency
11681 Generate code for inline square roots
11682 using the minimum latency algorithm.
11683
11684 @item -minline-sqrt-max-throughput
11685 @opindex minline-sqrt-max-throughput
11686 Generate code for inline square roots
11687 using the maximum throughput algorithm.
11688
11689 @item -mno-dwarf2-asm
11690 @itemx -mdwarf2-asm
11691 @opindex mno-dwarf2-asm
11692 @opindex mdwarf2-asm
11693 Don't (or do) generate assembler code for the DWARF2 line number debugging
11694 info.  This may be useful when not using the GNU assembler.
11695
11696 @item -mearly-stop-bits
11697 @itemx -mno-early-stop-bits
11698 @opindex mearly-stop-bits
11699 @opindex mno-early-stop-bits
11700 Allow stop bits to be placed earlier than immediately preceding the
11701 instruction that triggered the stop bit.  This can improve instruction
11702 scheduling, but does not always do so.
11703
11704 @item -mfixed-range=@var{register-range}
11705 @opindex mfixed-range
11706 Generate code treating the given register range as fixed registers.
11707 A fixed register is one that the register allocator can not use.  This is
11708 useful when compiling kernel code.  A register range is specified as
11709 two registers separated by a dash.  Multiple register ranges can be
11710 specified separated by a comma.
11711
11712 @item -mtls-size=@var{tls-size}
11713 @opindex mtls-size
11714 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
11715 64.
11716
11717 @item -mtune=@var{cpu-type}
11718 @opindex mtune
11719 Tune the instruction scheduling for a particular CPU, Valid values are
11720 itanium, itanium1, merced, itanium2, and mckinley.
11721
11722 @item -mt
11723 @itemx -pthread
11724 @opindex mt
11725 @opindex pthread
11726 Add support for multithreading using the POSIX threads library.  This
11727 option sets flags for both the preprocessor and linker.  It does
11728 not affect the thread safety of object code produced by the compiler or
11729 that of libraries supplied with it.  These are HP-UX specific flags.
11730
11731 @item -milp32
11732 @itemx -mlp64
11733 @opindex milp32
11734 @opindex mlp64
11735 Generate code for a 32-bit or 64-bit environment.
11736 The 32-bit environment sets int, long and pointer to 32 bits.
11737 The 64-bit environment sets int to 32 bits and long and pointer
11738 to 64 bits.  These are HP-UX specific flags.
11739
11740 @item -mno-sched-br-data-spec
11741 @itemx -msched-br-data-spec
11742 @opindex mno-sched-br-data-spec
11743 @opindex msched-br-data-spec
11744 (Dis/En)able data speculative scheduling before reload.
11745 This will result in generation of the ld.a instructions and
11746 the corresponding check instructions (ld.c / chk.a).
11747 The default is 'disable'.
11748
11749 @item -msched-ar-data-spec
11750 @itemx -mno-sched-ar-data-spec
11751 @opindex msched-ar-data-spec
11752 @opindex mno-sched-ar-data-spec
11753 (En/Dis)able data speculative scheduling after reload.
11754 This will result in generation of the ld.a instructions and
11755 the corresponding check instructions (ld.c / chk.a).
11756 The default is 'enable'.
11757
11758 @item -mno-sched-control-spec
11759 @itemx -msched-control-spec
11760 @opindex mno-sched-control-spec
11761 @opindex msched-control-spec
11762 (Dis/En)able control speculative scheduling.  This feature is
11763 available only during region scheduling (i.e.@: before reload).
11764 This will result in generation of the ld.s instructions and
11765 the corresponding check instructions chk.s .
11766 The default is 'disable'.
11767
11768 @item -msched-br-in-data-spec
11769 @itemx -mno-sched-br-in-data-spec
11770 @opindex msched-br-in-data-spec
11771 @opindex mno-sched-br-in-data-spec
11772 (En/Dis)able speculative scheduling of the instructions that
11773 are dependent on the data speculative loads before reload.
11774 This is effective only with @option{-msched-br-data-spec} enabled.
11775 The default is 'enable'.
11776
11777 @item -msched-ar-in-data-spec
11778 @itemx -mno-sched-ar-in-data-spec
11779 @opindex msched-ar-in-data-spec
11780 @opindex mno-sched-ar-in-data-spec
11781 (En/Dis)able speculative scheduling of the instructions that
11782 are dependent on the data speculative loads after reload.
11783 This is effective only with @option{-msched-ar-data-spec} enabled.
11784 The default is 'enable'.
11785
11786 @item -msched-in-control-spec
11787 @itemx -mno-sched-in-control-spec
11788 @opindex msched-in-control-spec
11789 @opindex mno-sched-in-control-spec
11790 (En/Dis)able speculative scheduling of the instructions that
11791 are dependent on the control speculative loads.
11792 This is effective only with @option{-msched-control-spec} enabled.
11793 The default is 'enable'.
11794
11795 @item -msched-ldc
11796 @itemx -mno-sched-ldc
11797 @opindex msched-ldc
11798 @opindex mno-sched-ldc
11799 (En/Dis)able use of simple data speculation checks ld.c .
11800 If disabled, only chk.a instructions will be emitted to check
11801 data speculative loads.
11802 The default is 'enable'.
11803
11804 @item -mno-sched-control-ldc
11805 @itemx -msched-control-ldc
11806 @opindex mno-sched-control-ldc
11807 @opindex msched-control-ldc
11808 (Dis/En)able use of ld.c instructions to check control speculative loads.
11809 If enabled, in case of control speculative load with no speculatively
11810 scheduled dependent instructions this load will be emitted as ld.sa and
11811 ld.c will be used to check it.
11812 The default is 'disable'.
11813
11814 @item -mno-sched-spec-verbose
11815 @itemx -msched-spec-verbose
11816 @opindex mno-sched-spec-verbose
11817 @opindex msched-spec-verbose
11818 (Dis/En)able printing of the information about speculative motions.
11819
11820 @item -mno-sched-prefer-non-data-spec-insns
11821 @itemx -msched-prefer-non-data-spec-insns
11822 @opindex mno-sched-prefer-non-data-spec-insns
11823 @opindex msched-prefer-non-data-spec-insns
11824 If enabled, data speculative instructions will be chosen for schedule
11825 only if there are no other choices at the moment.  This will make
11826 the use of the data speculation much more conservative.
11827 The default is 'disable'.
11828
11829 @item -mno-sched-prefer-non-control-spec-insns
11830 @itemx -msched-prefer-non-control-spec-insns
11831 @opindex mno-sched-prefer-non-control-spec-insns
11832 @opindex msched-prefer-non-control-spec-insns
11833 If enabled, control speculative instructions will be chosen for schedule
11834 only if there are no other choices at the moment.  This will make
11835 the use of the control speculation much more conservative.
11836 The default is 'disable'.
11837
11838 @item -mno-sched-count-spec-in-critical-path
11839 @itemx -msched-count-spec-in-critical-path
11840 @opindex mno-sched-count-spec-in-critical-path
11841 @opindex msched-count-spec-in-critical-path
11842 If enabled, speculative dependencies will be considered during
11843 computation of the instructions priorities.  This will make the use of the
11844 speculation a bit more conservative.
11845 The default is 'disable'.
11846
11847 @end table
11848
11849 @node M32C Options
11850 @subsection M32C Options
11851 @cindex M32C options
11852
11853 @table @gcctabopt
11854 @item -mcpu=@var{name}
11855 @opindex mcpu=
11856 Select the CPU for which code is generated.  @var{name} may be one of
11857 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
11858 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
11859 the M32C/80 series.
11860
11861 @item -msim
11862 @opindex msim
11863 Specifies that the program will be run on the simulator.  This causes
11864 an alternate runtime library to be linked in which supports, for
11865 example, file I/O@.  You must not use this option when generating
11866 programs that will run on real hardware; you must provide your own
11867 runtime library for whatever I/O functions are needed.
11868
11869 @item -memregs=@var{number}
11870 @opindex memregs=
11871 Specifies the number of memory-based pseudo-registers GCC will use
11872 during code generation.  These pseudo-registers will be used like real
11873 registers, so there is a tradeoff between GCC's ability to fit the
11874 code into available registers, and the performance penalty of using
11875 memory instead of registers.  Note that all modules in a program must
11876 be compiled with the same value for this option.  Because of that, you
11877 must not use this option with the default runtime libraries gcc
11878 builds.
11879
11880 @end table
11881
11882 @node M32R/D Options
11883 @subsection M32R/D Options
11884 @cindex M32R/D options
11885
11886 These @option{-m} options are defined for Renesas M32R/D architectures:
11887
11888 @table @gcctabopt
11889 @item -m32r2
11890 @opindex m32r2
11891 Generate code for the M32R/2@.
11892
11893 @item -m32rx
11894 @opindex m32rx
11895 Generate code for the M32R/X@.
11896
11897 @item -m32r
11898 @opindex m32r
11899 Generate code for the M32R@.  This is the default.
11900
11901 @item -mmodel=small
11902 @opindex mmodel=small
11903 Assume all objects live in the lower 16MB of memory (so that their addresses
11904 can be loaded with the @code{ld24} instruction), and assume all subroutines
11905 are reachable with the @code{bl} instruction.
11906 This is the default.
11907
11908 The addressability of a particular object can be set with the
11909 @code{model} attribute.
11910
11911 @item -mmodel=medium
11912 @opindex mmodel=medium
11913 Assume objects may be anywhere in the 32-bit address space (the compiler
11914 will generate @code{seth/add3} instructions to load their addresses), and
11915 assume all subroutines are reachable with the @code{bl} instruction.
11916
11917 @item -mmodel=large
11918 @opindex mmodel=large
11919 Assume objects may be anywhere in the 32-bit address space (the compiler
11920 will generate @code{seth/add3} instructions to load their addresses), and
11921 assume subroutines may not be reachable with the @code{bl} instruction
11922 (the compiler will generate the much slower @code{seth/add3/jl}
11923 instruction sequence).
11924
11925 @item -msdata=none
11926 @opindex msdata=none
11927 Disable use of the small data area.  Variables will be put into
11928 one of @samp{.data}, @samp{bss}, or @samp{.rodata} (unless the
11929 @code{section} attribute has been specified).
11930 This is the default.
11931
11932 The small data area consists of sections @samp{.sdata} and @samp{.sbss}.
11933 Objects may be explicitly put in the small data area with the
11934 @code{section} attribute using one of these sections.
11935
11936 @item -msdata=sdata
11937 @opindex msdata=sdata
11938 Put small global and static data in the small data area, but do not
11939 generate special code to reference them.
11940
11941 @item -msdata=use
11942 @opindex msdata=use
11943 Put small global and static data in the small data area, and generate
11944 special instructions to reference them.
11945
11946 @item -G @var{num}
11947 @opindex G
11948 @cindex smaller data references
11949 Put global and static objects less than or equal to @var{num} bytes
11950 into the small data or bss sections instead of the normal data or bss
11951 sections.  The default value of @var{num} is 8.
11952 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
11953 for this option to have any effect.
11954
11955 All modules should be compiled with the same @option{-G @var{num}} value.
11956 Compiling with different values of @var{num} may or may not work; if it
11957 doesn't the linker will give an error message---incorrect code will not be
11958 generated.
11959
11960 @item -mdebug
11961 @opindex mdebug
11962 Makes the M32R specific code in the compiler display some statistics
11963 that might help in debugging programs.
11964
11965 @item -malign-loops
11966 @opindex malign-loops
11967 Align all loops to a 32-byte boundary.
11968
11969 @item -mno-align-loops
11970 @opindex mno-align-loops
11971 Do not enforce a 32-byte alignment for loops.  This is the default.
11972
11973 @item -missue-rate=@var{number}
11974 @opindex missue-rate=@var{number}
11975 Issue @var{number} instructions per cycle.  @var{number} can only be 1
11976 or 2.
11977
11978 @item -mbranch-cost=@var{number}
11979 @opindex mbranch-cost=@var{number}
11980 @var{number} can only be 1 or 2.  If it is 1 then branches will be
11981 preferred over conditional code, if it is 2, then the opposite will
11982 apply.
11983
11984 @item -mflush-trap=@var{number}
11985 @opindex mflush-trap=@var{number}
11986 Specifies the trap number to use to flush the cache.  The default is
11987 12.  Valid numbers are between 0 and 15 inclusive.
11988
11989 @item -mno-flush-trap
11990 @opindex mno-flush-trap
11991 Specifies that the cache cannot be flushed by using a trap.
11992
11993 @item -mflush-func=@var{name}
11994 @opindex mflush-func=@var{name}
11995 Specifies the name of the operating system function to call to flush
11996 the cache.  The default is @emph{_flush_cache}, but a function call
11997 will only be used if a trap is not available.
11998
11999 @item -mno-flush-func
12000 @opindex mno-flush-func
12001 Indicates that there is no OS function for flushing the cache.
12002
12003 @end table
12004
12005 @node M680x0 Options
12006 @subsection M680x0 Options
12007 @cindex M680x0 options
12008
12009 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
12010 The default settings depend on which architecture was selected when
12011 the compiler was configured; the defaults for the most common choices
12012 are given below.
12013
12014 @table @gcctabopt
12015 @item -march=@var{arch}
12016 @opindex march
12017 Generate code for a specific M680x0 or ColdFire instruction set
12018 architecture.  Permissible values of @var{arch} for M680x0
12019 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
12020 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
12021 architectures are selected according to Freescale's ISA classification
12022 and the permissible values are: @samp{isaa}, @samp{isaaplus},
12023 @samp{isab} and @samp{isac}.
12024
12025 gcc defines a macro @samp{__mcf@var{arch}__} whenever it is generating
12026 code for a ColdFire target.  The @var{arch} in this macro is one of the
12027 @option{-march} arguments given above.
12028
12029 When used together, @option{-march} and @option{-mtune} select code
12030 that runs on a family of similar processors but that is optimized
12031 for a particular microarchitecture.
12032
12033 @item -mcpu=@var{cpu}
12034 @opindex mcpu
12035 Generate code for a specific M680x0 or ColdFire processor.
12036 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
12037 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
12038 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
12039 below, which also classifies the CPUs into families:
12040
12041 @multitable @columnfractions 0.20 0.80
12042 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
12043 @item @samp{51qe} @tab @samp{51qe}
12044 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
12045 @item @samp{5206e} @tab @samp{5206e}
12046 @item @samp{5208} @tab @samp{5207} @samp{5208}
12047 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
12048 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
12049 @item @samp{5216} @tab @samp{5214} @samp{5216}
12050 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
12051 @item @samp{5225} @tab @samp{5224} @samp{5225}
12052 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
12053 @item @samp{5249} @tab @samp{5249}
12054 @item @samp{5250} @tab @samp{5250}
12055 @item @samp{5271} @tab @samp{5270} @samp{5271}
12056 @item @samp{5272} @tab @samp{5272}
12057 @item @samp{5275} @tab @samp{5274} @samp{5275}
12058 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
12059 @item @samp{5307} @tab @samp{5307}
12060 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
12061 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
12062 @item @samp{5407} @tab @samp{5407}
12063 @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}
12064 @end multitable
12065
12066 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
12067 @var{arch} is compatible with @var{cpu}.  Other combinations of
12068 @option{-mcpu} and @option{-march} are rejected.
12069
12070 gcc defines the macro @samp{__mcf_cpu_@var{cpu}} when ColdFire target
12071 @var{cpu} is selected.  It also defines @samp{__mcf_family_@var{family}},
12072 where the value of @var{family} is given by the table above.
12073
12074 @item -mtune=@var{tune}
12075 @opindex mtune
12076 Tune the code for a particular microarchitecture, within the
12077 constraints set by @option{-march} and @option{-mcpu}.
12078 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
12079 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
12080 and @samp{cpu32}.  The ColdFire microarchitectures
12081 are: @samp{cfv1}, @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
12082
12083 You can also use @option{-mtune=68020-40} for code that needs
12084 to run relatively well on 68020, 68030 and 68040 targets.
12085 @option{-mtune=68020-60} is similar but includes 68060 targets
12086 as well.  These two options select the same tuning decisions as
12087 @option{-m68020-40} and @option{-m68020-60} respectively.
12088
12089 gcc defines the macros @samp{__mc@var{arch}} and @samp{__mc@var{arch}__}
12090 when tuning for 680x0 architecture @var{arch}.  It also defines
12091 @samp{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
12092 option is used.  If gcc is tuning for a range of architectures,
12093 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
12094 it defines the macros for every architecture in the range.
12095
12096 gcc also defines the macro @samp{__m@var{uarch}__} when tuning for
12097 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
12098 of the arguments given above.
12099
12100 @item -m68000
12101 @itemx -mc68000
12102 @opindex m68000
12103 @opindex mc68000
12104 Generate output for a 68000.  This is the default
12105 when the compiler is configured for 68000-based systems.
12106 It is equivalent to @option{-march=68000}.
12107
12108 Use this option for microcontrollers with a 68000 or EC000 core,
12109 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
12110
12111 @item -m68010
12112 @opindex m68010
12113 Generate output for a 68010.  This is the default
12114 when the compiler is configured for 68010-based systems.
12115 It is equivalent to @option{-march=68010}.
12116
12117 @item -m68020
12118 @itemx -mc68020
12119 @opindex m68020
12120 @opindex mc68020
12121 Generate output for a 68020.  This is the default
12122 when the compiler is configured for 68020-based systems.
12123 It is equivalent to @option{-march=68020}.
12124
12125 @item -m68030
12126 @opindex m68030
12127 Generate output for a 68030.  This is the default when the compiler is
12128 configured for 68030-based systems.  It is equivalent to
12129 @option{-march=68030}.
12130
12131 @item -m68040
12132 @opindex m68040
12133 Generate output for a 68040.  This is the default when the compiler is
12134 configured for 68040-based systems.  It is equivalent to
12135 @option{-march=68040}.
12136
12137 This option inhibits the use of 68881/68882 instructions that have to be
12138 emulated by software on the 68040.  Use this option if your 68040 does not
12139 have code to emulate those instructions.
12140
12141 @item -m68060
12142 @opindex m68060
12143 Generate output for a 68060.  This is the default when the compiler is
12144 configured for 68060-based systems.  It is equivalent to
12145 @option{-march=68060}.
12146
12147 This option inhibits the use of 68020 and 68881/68882 instructions that
12148 have to be emulated by software on the 68060.  Use this option if your 68060
12149 does not have code to emulate those instructions.
12150
12151 @item -mcpu32
12152 @opindex mcpu32
12153 Generate output for a CPU32.  This is the default
12154 when the compiler is configured for CPU32-based systems.
12155 It is equivalent to @option{-march=cpu32}.
12156
12157 Use this option for microcontrollers with a
12158 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
12159 68336, 68340, 68341, 68349 and 68360.
12160
12161 @item -m5200
12162 @opindex m5200
12163 Generate output for a 520X ColdFire CPU@.  This is the default
12164 when the compiler is configured for 520X-based systems.
12165 It is equivalent to @option{-mcpu=5206}, and is now deprecated
12166 in favor of that option.
12167
12168 Use this option for microcontroller with a 5200 core, including
12169 the MCF5202, MCF5203, MCF5204 and MCF5206.
12170
12171 @item -m5206e
12172 @opindex m5206e
12173 Generate output for a 5206e ColdFire CPU@.  The option is now
12174 deprecated in favor of the equivalent @option{-mcpu=5206e}.
12175
12176 @item -m528x
12177 @opindex m528x
12178 Generate output for a member of the ColdFire 528X family.
12179 The option is now deprecated in favor of the equivalent
12180 @option{-mcpu=528x}.
12181
12182 @item -m5307
12183 @opindex m5307
12184 Generate output for a ColdFire 5307 CPU@.  The option is now deprecated
12185 in favor of the equivalent @option{-mcpu=5307}.
12186
12187 @item -m5407
12188 @opindex m5407
12189 Generate output for a ColdFire 5407 CPU@.  The option is now deprecated
12190 in favor of the equivalent @option{-mcpu=5407}.
12191
12192 @item -mcfv4e
12193 @opindex mcfv4e
12194 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
12195 This includes use of hardware floating point instructions.
12196 The option is equivalent to @option{-mcpu=547x}, and is now
12197 deprecated in favor of that option.
12198
12199 @item -m68020-40
12200 @opindex m68020-40
12201 Generate output for a 68040, without using any of the new instructions.
12202 This results in code which can run relatively efficiently on either a
12203 68020/68881 or a 68030 or a 68040.  The generated code does use the
12204 68881 instructions that are emulated on the 68040.
12205
12206 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
12207
12208 @item -m68020-60
12209 @opindex m68020-60
12210 Generate output for a 68060, without using any of the new instructions.
12211 This results in code which can run relatively efficiently on either a
12212 68020/68881 or a 68030 or a 68040.  The generated code does use the
12213 68881 instructions that are emulated on the 68060.
12214
12215 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
12216
12217 @item -mhard-float
12218 @itemx -m68881
12219 @opindex mhard-float
12220 @opindex m68881
12221 Generate floating-point instructions.  This is the default for 68020
12222 and above, and for ColdFire devices that have an FPU@.  It defines the
12223 macro @samp{__HAVE_68881__} on M680x0 targets and @samp{__mcffpu__}
12224 on ColdFire targets.
12225
12226 @item -msoft-float
12227 @opindex msoft-float
12228 Do not generate floating-point instructions; use library calls instead.
12229 This is the default for 68000, 68010, and 68832 targets.  It is also
12230 the default for ColdFire devices that have no FPU.
12231
12232 @item -mdiv
12233 @itemx -mno-div
12234 @opindex mdiv
12235 @opindex mno-div
12236 Generate (do not generate) ColdFire hardware divide and remainder
12237 instructions.  If @option{-march} is used without @option{-mcpu},
12238 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
12239 architectures.  Otherwise, the default is taken from the target CPU
12240 (either the default CPU, or the one specified by @option{-mcpu}).  For
12241 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
12242 @option{-mcpu=5206e}.
12243
12244 gcc defines the macro @samp{__mcfhwdiv__} when this option is enabled.
12245
12246 @item -mshort
12247 @opindex mshort
12248 Consider type @code{int} to be 16 bits wide, like @code{short int}.
12249 Additionally, parameters passed on the stack are also aligned to a
12250 16-bit boundary even on targets whose API mandates promotion to 32-bit.
12251
12252 @item -mno-short
12253 @opindex mno-short
12254 Do not consider type @code{int} to be 16 bits wide.  This is the default.
12255
12256 @item -mnobitfield
12257 @itemx -mno-bitfield
12258 @opindex mnobitfield
12259 @opindex mno-bitfield
12260 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
12261 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
12262
12263 @item -mbitfield
12264 @opindex mbitfield
12265 Do use the bit-field instructions.  The @option{-m68020} option implies
12266 @option{-mbitfield}.  This is the default if you use a configuration
12267 designed for a 68020.
12268
12269 @item -mrtd
12270 @opindex mrtd
12271 Use a different function-calling convention, in which functions
12272 that take a fixed number of arguments return with the @code{rtd}
12273 instruction, which pops their arguments while returning.  This
12274 saves one instruction in the caller since there is no need to pop
12275 the arguments there.
12276
12277 This calling convention is incompatible with the one normally
12278 used on Unix, so you cannot use it if you need to call libraries
12279 compiled with the Unix compiler.
12280
12281 Also, you must provide function prototypes for all functions that
12282 take variable numbers of arguments (including @code{printf});
12283 otherwise incorrect code will be generated for calls to those
12284 functions.
12285
12286 In addition, seriously incorrect code will result if you call a
12287 function with too many arguments.  (Normally, extra arguments are
12288 harmlessly ignored.)
12289
12290 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
12291 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
12292
12293 @item -mno-rtd
12294 @opindex mno-rtd
12295 Do not use the calling conventions selected by @option{-mrtd}.
12296 This is the default.
12297
12298 @item -malign-int
12299 @itemx -mno-align-int
12300 @opindex malign-int
12301 @opindex mno-align-int
12302 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
12303 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
12304 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
12305 Aligning variables on 32-bit boundaries produces code that runs somewhat
12306 faster on processors with 32-bit busses at the expense of more memory.
12307
12308 @strong{Warning:} if you use the @option{-malign-int} switch, GCC will
12309 align structures containing the above types  differently than
12310 most published application binary interface specifications for the m68k.
12311
12312 @item -mpcrel
12313 @opindex mpcrel
12314 Use the pc-relative addressing mode of the 68000 directly, instead of
12315 using a global offset table.  At present, this option implies @option{-fpic},
12316 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
12317 not presently supported with @option{-mpcrel}, though this could be supported for
12318 68020 and higher processors.
12319
12320 @item -mno-strict-align
12321 @itemx -mstrict-align
12322 @opindex mno-strict-align
12323 @opindex mstrict-align
12324 Do not (do) assume that unaligned memory references will be handled by
12325 the system.
12326
12327 @item -msep-data
12328 Generate code that allows the data segment to be located in a different
12329 area of memory from the text segment.  This allows for execute in place in
12330 an environment without virtual memory management.  This option implies
12331 @option{-fPIC}.
12332
12333 @item -mno-sep-data
12334 Generate code that assumes that the data segment follows the text segment.
12335 This is the default.
12336
12337 @item -mid-shared-library
12338 Generate code that supports shared libraries via the library ID method.
12339 This allows for execute in place and shared libraries in an environment
12340 without virtual memory management.  This option implies @option{-fPIC}.
12341
12342 @item -mno-id-shared-library
12343 Generate code that doesn't assume ID based shared libraries are being used.
12344 This is the default.
12345
12346 @item -mshared-library-id=n
12347 Specified the identification number of the ID based shared library being
12348 compiled.  Specifying a value of 0 will generate more compact code, specifying
12349 other values will force the allocation of that number to the current
12350 library but is no more space or time efficient than omitting this option.
12351
12352 @item -mxgot
12353 @itemx -mno-xgot
12354 @opindex mxgot
12355 @opindex mno-xgot
12356 When generating position-independent code for ColdFire, generate code
12357 that works if the GOT has more than 8192 entries.  This code is
12358 larger and slower than code generated without this option.  On M680x0
12359 processors, this option is not needed; @option{-fPIC} suffices.
12360
12361 GCC normally uses a single instruction to load values from the GOT@.
12362 While this is relatively efficient, it only works if the GOT
12363 is smaller than about 64k.  Anything larger causes the linker
12364 to report an error such as:
12365
12366 @cindex relocation truncated to fit (ColdFire)
12367 @smallexample
12368 relocation truncated to fit: R_68K_GOT16O foobar
12369 @end smallexample
12370
12371 If this happens, you should recompile your code with @option{-mxgot}.
12372 It should then work with very large GOTs.  However, code generated with
12373 @option{-mxgot} is less efficient, since it takes 4 instructions to fetch
12374 the value of a global symbol.
12375
12376 Note that some linkers, including newer versions of the GNU linker,
12377 can create multiple GOTs and sort GOT entries.  If you have such a linker,
12378 you should only need to use @option{-mxgot} when compiling a single
12379 object file that accesses more than 8192 GOT entries.  Very few do.
12380
12381 These options have no effect unless GCC is generating
12382 position-independent code.
12383
12384 @end table
12385
12386 @node M68hc1x Options
12387 @subsection M68hc1x Options
12388 @cindex M68hc1x options
12389
12390 These are the @samp{-m} options defined for the 68hc11 and 68hc12
12391 microcontrollers.  The default values for these options depends on
12392 which style of microcontroller was selected when the compiler was configured;
12393 the defaults for the most common choices are given below.
12394
12395 @table @gcctabopt
12396 @item -m6811
12397 @itemx -m68hc11
12398 @opindex m6811
12399 @opindex m68hc11
12400 Generate output for a 68HC11.  This is the default
12401 when the compiler is configured for 68HC11-based systems.
12402
12403 @item -m6812
12404 @itemx -m68hc12
12405 @opindex m6812
12406 @opindex m68hc12
12407 Generate output for a 68HC12.  This is the default
12408 when the compiler is configured for 68HC12-based systems.
12409
12410 @item -m68S12
12411 @itemx -m68hcs12
12412 @opindex m68S12
12413 @opindex m68hcs12
12414 Generate output for a 68HCS12.
12415
12416 @item -mauto-incdec
12417 @opindex mauto-incdec
12418 Enable the use of 68HC12 pre and post auto-increment and auto-decrement
12419 addressing modes.
12420
12421 @item -minmax
12422 @itemx -nominmax
12423 @opindex minmax
12424 @opindex mnominmax
12425 Enable the use of 68HC12 min and max instructions.
12426
12427 @item -mlong-calls
12428 @itemx -mno-long-calls
12429 @opindex mlong-calls
12430 @opindex mno-long-calls
12431 Treat all calls as being far away (near).  If calls are assumed to be
12432 far away, the compiler will use the @code{call} instruction to
12433 call a function and the @code{rtc} instruction for returning.
12434
12435 @item -mshort
12436 @opindex mshort
12437 Consider type @code{int} to be 16 bits wide, like @code{short int}.
12438
12439 @item -msoft-reg-count=@var{count}
12440 @opindex msoft-reg-count
12441 Specify the number of pseudo-soft registers which are used for the
12442 code generation.  The maximum number is 32.  Using more pseudo-soft
12443 register may or may not result in better code depending on the program.
12444 The default is 4 for 68HC11 and 2 for 68HC12.
12445
12446 @end table
12447
12448 @node MCore Options
12449 @subsection MCore Options
12450 @cindex MCore options
12451
12452 These are the @samp{-m} options defined for the Motorola M*Core
12453 processors.
12454
12455 @table @gcctabopt
12456
12457 @item -mhardlit
12458 @itemx -mno-hardlit
12459 @opindex mhardlit
12460 @opindex mno-hardlit
12461 Inline constants into the code stream if it can be done in two
12462 instructions or less.
12463
12464 @item -mdiv
12465 @itemx -mno-div
12466 @opindex mdiv
12467 @opindex mno-div
12468 Use the divide instruction.  (Enabled by default).
12469
12470 @item -mrelax-immediate
12471 @itemx -mno-relax-immediate
12472 @opindex mrelax-immediate
12473 @opindex mno-relax-immediate
12474 Allow arbitrary sized immediates in bit operations.
12475
12476 @item -mwide-bitfields
12477 @itemx -mno-wide-bitfields
12478 @opindex mwide-bitfields
12479 @opindex mno-wide-bitfields
12480 Always treat bit-fields as int-sized.
12481
12482 @item -m4byte-functions
12483 @itemx -mno-4byte-functions
12484 @opindex m4byte-functions
12485 @opindex mno-4byte-functions
12486 Force all functions to be aligned to a four byte boundary.
12487
12488 @item -mcallgraph-data
12489 @itemx -mno-callgraph-data
12490 @opindex mcallgraph-data
12491 @opindex mno-callgraph-data
12492 Emit callgraph information.
12493
12494 @item -mslow-bytes
12495 @itemx -mno-slow-bytes
12496 @opindex mslow-bytes
12497 @opindex mno-slow-bytes
12498 Prefer word access when reading byte quantities.
12499
12500 @item -mlittle-endian
12501 @itemx -mbig-endian
12502 @opindex mlittle-endian
12503 @opindex mbig-endian
12504 Generate code for a little endian target.
12505
12506 @item -m210
12507 @itemx -m340
12508 @opindex m210
12509 @opindex m340
12510 Generate code for the 210 processor.
12511
12512 @item -mno-lsim
12513 @opindex no-lsim
12514 Assume that run-time support has been provided and so omit the
12515 simulator library (@file{libsim.a)} from the linker command line.
12516
12517 @item -mstack-increment=@var{size}
12518 @opindex mstack-increment
12519 Set the maximum amount for a single stack increment operation.  Large
12520 values can increase the speed of programs which contain functions
12521 that need a large amount of stack space, but they can also trigger a
12522 segmentation fault if the stack is extended too much.  The default
12523 value is 0x1000.
12524
12525 @end table
12526
12527 @node MIPS Options
12528 @subsection MIPS Options
12529 @cindex MIPS options
12530
12531 @table @gcctabopt
12532
12533 @item -EB
12534 @opindex EB
12535 Generate big-endian code.
12536
12537 @item -EL
12538 @opindex EL
12539 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
12540 configurations.
12541
12542 @item -march=@var{arch}
12543 @opindex march
12544 Generate code that will run on @var{arch}, which can be the name of a
12545 generic MIPS ISA, or the name of a particular processor.
12546 The ISA names are:
12547 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
12548 @samp{mips32}, @samp{mips32r2}, @samp{mips64} and @samp{mips64r2}.
12549 The processor names are:
12550 @samp{4kc}, @samp{4km}, @samp{4kp}, @samp{4ksc},
12551 @samp{4kec}, @samp{4kem}, @samp{4kep}, @samp{4ksd},
12552 @samp{5kc}, @samp{5kf},
12553 @samp{20kc},
12554 @samp{24kc}, @samp{24kf2_1}, @samp{24kf1_1},
12555 @samp{24kec}, @samp{24kef2_1}, @samp{24kef1_1},
12556 @samp{34kc}, @samp{34kf2_1}, @samp{34kf1_1},
12557 @samp{74kc}, @samp{74kf2_1}, @samp{74kf1_1}, @samp{74kf3_2},
12558 @samp{loongson2e}, @samp{loongson2f},
12559 @samp{m4k},
12560 @samp{octeon},
12561 @samp{orion},
12562 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
12563 @samp{r4600}, @samp{r4650}, @samp{r6000}, @samp{r8000},
12564 @samp{rm7000}, @samp{rm9000},
12565 @samp{r10000}, @samp{r12000}, @samp{r14000}, @samp{r16000},
12566 @samp{sb1},
12567 @samp{sr71000},
12568 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
12569 @samp{vr5000}, @samp{vr5400}, @samp{vr5500}
12570 and @samp{xlr}.
12571 The special value @samp{from-abi} selects the
12572 most compatible architecture for the selected ABI (that is,
12573 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
12574
12575 Native Linux/GNU toolchains also support the value @samp{native},
12576 which selects the best architecture option for the host processor.
12577 @option{-march=native} has no effect if GCC does not recognize
12578 the processor.
12579
12580 In processor names, a final @samp{000} can be abbreviated as @samp{k}
12581 (for example, @samp{-march=r2k}).  Prefixes are optional, and
12582 @samp{vr} may be written @samp{r}.
12583
12584 Names of the form @samp{@var{n}f2_1} refer to processors with
12585 FPUs clocked at half the rate of the core, names of the form
12586 @samp{@var{n}f1_1} refer to processors with FPUs clocked at the same
12587 rate as the core, and names of the form @samp{@var{n}f3_2} refer to
12588 processors with FPUs clocked a ratio of 3:2 with respect to the core.
12589 For compatibility reasons, @samp{@var{n}f} is accepted as a synonym
12590 for @samp{@var{n}f2_1} while @samp{@var{n}x} and @samp{@var{b}fx} are
12591 accepted as synonyms for @samp{@var{n}f1_1}.
12592
12593 GCC defines two macros based on the value of this option.  The first
12594 is @samp{_MIPS_ARCH}, which gives the name of target architecture, as
12595 a string.  The second has the form @samp{_MIPS_ARCH_@var{foo}},
12596 where @var{foo} is the capitalized value of @samp{_MIPS_ARCH}@.
12597 For example, @samp{-march=r2000} will set @samp{_MIPS_ARCH}
12598 to @samp{"r2000"} and define the macro @samp{_MIPS_ARCH_R2000}.
12599
12600 Note that the @samp{_MIPS_ARCH} macro uses the processor names given
12601 above.  In other words, it will have the full prefix and will not
12602 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
12603 the macro names the resolved architecture (either @samp{"mips1"} or
12604 @samp{"mips3"}).  It names the default architecture when no
12605 @option{-march} option is given.
12606
12607 @item -mtune=@var{arch}
12608 @opindex mtune
12609 Optimize for @var{arch}.  Among other things, this option controls
12610 the way instructions are scheduled, and the perceived cost of arithmetic
12611 operations.  The list of @var{arch} values is the same as for
12612 @option{-march}.
12613
12614 When this option is not used, GCC will optimize for the processor
12615 specified by @option{-march}.  By using @option{-march} and
12616 @option{-mtune} together, it is possible to generate code that will
12617 run on a family of processors, but optimize the code for one
12618 particular member of that family.
12619
12620 @samp{-mtune} defines the macros @samp{_MIPS_TUNE} and
12621 @samp{_MIPS_TUNE_@var{foo}}, which work in the same way as the
12622 @samp{-march} ones described above.
12623
12624 @item -mips1
12625 @opindex mips1
12626 Equivalent to @samp{-march=mips1}.
12627
12628 @item -mips2
12629 @opindex mips2
12630 Equivalent to @samp{-march=mips2}.
12631
12632 @item -mips3
12633 @opindex mips3
12634 Equivalent to @samp{-march=mips3}.
12635
12636 @item -mips4
12637 @opindex mips4
12638 Equivalent to @samp{-march=mips4}.
12639
12640 @item -mips32
12641 @opindex mips32
12642 Equivalent to @samp{-march=mips32}.
12643
12644 @item -mips32r2
12645 @opindex mips32r2
12646 Equivalent to @samp{-march=mips32r2}.
12647
12648 @item -mips64
12649 @opindex mips64
12650 Equivalent to @samp{-march=mips64}.
12651
12652 @item -mips64r2
12653 @opindex mips64r2
12654 Equivalent to @samp{-march=mips64r2}.
12655
12656 @item -mips16
12657 @itemx -mno-mips16
12658 @opindex mips16
12659 @opindex mno-mips16
12660 Generate (do not generate) MIPS16 code.  If GCC is targetting a
12661 MIPS32 or MIPS64 architecture, it will make use of the MIPS16e ASE@.
12662
12663 MIPS16 code generation can also be controlled on a per-function basis
12664 by means of @code{mips16} and @code{nomips16} attributes.  
12665 @xref{Function Attributes}, for more information.
12666
12667 @item -mflip-mips16
12668 @opindex mflip-mips16
12669 Generate MIPS16 code on alternating functions.  This option is provided
12670 for regression testing of mixed MIPS16/non-MIPS16 code generation, and is
12671 not intended for ordinary use in compiling user code.
12672
12673 @item -minterlink-mips16
12674 @itemx -mno-interlink-mips16
12675 @opindex minterlink-mips16
12676 @opindex mno-interlink-mips16
12677 Require (do not require) that non-MIPS16 code be link-compatible with
12678 MIPS16 code.
12679
12680 For example, non-MIPS16 code cannot jump directly to MIPS16 code;
12681 it must either use a call or an indirect jump.  @option{-minterlink-mips16}
12682 therefore disables direct jumps unless GCC knows that the target of the
12683 jump is not MIPS16.
12684
12685 @item -mabi=32
12686 @itemx -mabi=o64
12687 @itemx -mabi=n32
12688 @itemx -mabi=64
12689 @itemx -mabi=eabi
12690 @opindex mabi=32
12691 @opindex mabi=o64
12692 @opindex mabi=n32
12693 @opindex mabi=64
12694 @opindex mabi=eabi
12695 Generate code for the given ABI@.
12696
12697 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
12698 generates 64-bit code when you select a 64-bit architecture, but you
12699 can use @option{-mgp32} to get 32-bit code instead.
12700
12701 For information about the O64 ABI, see
12702 @w{@uref{http://gcc.gnu.org/projects/mipso64-abi.html}}.
12703
12704 GCC supports a variant of the o32 ABI in which floating-point registers
12705 are 64 rather than 32 bits wide.  You can select this combination with
12706 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @samp{mthc1}
12707 and @samp{mfhc1} instructions and is therefore only supported for
12708 MIPS32R2 processors.
12709
12710 The register assignments for arguments and return values remain the
12711 same, but each scalar value is passed in a single 64-bit register
12712 rather than a pair of 32-bit registers.  For example, scalar
12713 floating-point values are returned in @samp{$f0} only, not a
12714 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
12715 remains the same, but all 64 bits are saved.
12716
12717 @item -mabicalls
12718 @itemx -mno-abicalls
12719 @opindex mabicalls
12720 @opindex mno-abicalls
12721 Generate (do not generate) code that is suitable for SVR4-style
12722 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
12723 systems.
12724
12725 @item -mshared
12726 @itemx -mno-shared
12727 Generate (do not generate) code that is fully position-independent,
12728 and that can therefore be linked into shared libraries.  This option
12729 only affects @option{-mabicalls}.
12730
12731 All @option{-mabicalls} code has traditionally been position-independent,
12732 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
12733 as an extension, the GNU toolchain allows executables to use absolute
12734 accesses for locally-binding symbols.  It can also use shorter GP
12735 initialization sequences and generate direct calls to locally-defined
12736 functions.  This mode is selected by @option{-mno-shared}.
12737
12738 @option{-mno-shared} depends on binutils 2.16 or higher and generates
12739 objects that can only be linked by the GNU linker.  However, the option
12740 does not affect the ABI of the final executable; it only affects the ABI
12741 of relocatable objects.  Using @option{-mno-shared} will generally make
12742 executables both smaller and quicker.
12743
12744 @option{-mshared} is the default.
12745
12746 @item -mplt
12747 @itemx -mno-plt
12748 @opindex mplt
12749 @opindex mno-plt
12750 Assume (do not assume) that the static and dynamic linkers
12751 support PLTs and copy relocations.  This option only affects
12752 @samp{-mno-shared -mabicalls}.  For the n64 ABI, this option
12753 has no effect without @samp{-msym32}.
12754
12755 You can make @option{-mplt} the default by configuring
12756 GCC with @option{--with-mips-plt}.  The default is
12757 @option{-mno-plt} otherwise.
12758
12759 @item -mxgot
12760 @itemx -mno-xgot
12761 @opindex mxgot
12762 @opindex mno-xgot
12763 Lift (do not lift) the usual restrictions on the size of the global
12764 offset table.
12765
12766 GCC normally uses a single instruction to load values from the GOT@.
12767 While this is relatively efficient, it will only work if the GOT
12768 is smaller than about 64k.  Anything larger will cause the linker
12769 to report an error such as:
12770
12771 @cindex relocation truncated to fit (MIPS)
12772 @smallexample
12773 relocation truncated to fit: R_MIPS_GOT16 foobar
12774 @end smallexample
12775
12776 If this happens, you should recompile your code with @option{-mxgot}.
12777 It should then work with very large GOTs, although it will also be
12778 less efficient, since it will take three instructions to fetch the
12779 value of a global symbol.
12780
12781 Note that some linkers can create multiple GOTs.  If you have such a
12782 linker, you should only need to use @option{-mxgot} when a single object
12783 file accesses more than 64k's worth of GOT entries.  Very few do.
12784
12785 These options have no effect unless GCC is generating position
12786 independent code.
12787
12788 @item -mgp32
12789 @opindex mgp32
12790 Assume that general-purpose registers are 32 bits wide.
12791
12792 @item -mgp64
12793 @opindex mgp64
12794 Assume that general-purpose registers are 64 bits wide.
12795
12796 @item -mfp32
12797 @opindex mfp32
12798 Assume that floating-point registers are 32 bits wide.
12799
12800 @item -mfp64
12801 @opindex mfp64
12802 Assume that floating-point registers are 64 bits wide.
12803
12804 @item -mhard-float
12805 @opindex mhard-float
12806 Use floating-point coprocessor instructions.
12807
12808 @item -msoft-float
12809 @opindex msoft-float
12810 Do not use floating-point coprocessor instructions.  Implement
12811 floating-point calculations using library calls instead.
12812
12813 @item -msingle-float
12814 @opindex msingle-float
12815 Assume that the floating-point coprocessor only supports single-precision
12816 operations.
12817
12818 @item -mdouble-float
12819 @opindex mdouble-float
12820 Assume that the floating-point coprocessor supports double-precision
12821 operations.  This is the default.
12822
12823 @item -mllsc
12824 @itemx -mno-llsc
12825 @opindex mllsc
12826 @opindex mno-llsc
12827 Use (do not use) @samp{ll}, @samp{sc}, and @samp{sync} instructions to
12828 implement atomic memory built-in functions.  When neither option is
12829 specified, GCC will use the instructions if the target architecture
12830 supports them.
12831
12832 @option{-mllsc} is useful if the runtime environment can emulate the
12833 instructions and @option{-mno-llsc} can be useful when compiling for
12834 nonstandard ISAs.  You can make either option the default by
12835 configuring GCC with @option{--with-llsc} and @option{--without-llsc}
12836 respectively.  @option{--with-llsc} is the default for some
12837 configurations; see the installation documentation for details.
12838
12839 @item -mdsp
12840 @itemx -mno-dsp
12841 @opindex mdsp
12842 @opindex mno-dsp
12843 Use (do not use) revision 1 of the MIPS DSP ASE@.
12844 @xref{MIPS DSP Built-in Functions}.  This option defines the
12845 preprocessor macro @samp{__mips_dsp}.  It also defines
12846 @samp{__mips_dsp_rev} to 1.
12847
12848 @item -mdspr2
12849 @itemx -mno-dspr2
12850 @opindex mdspr2
12851 @opindex mno-dspr2
12852 Use (do not use) revision 2 of the MIPS DSP ASE@.
12853 @xref{MIPS DSP Built-in Functions}.  This option defines the
12854 preprocessor macros @samp{__mips_dsp} and @samp{__mips_dspr2}.
12855 It also defines @samp{__mips_dsp_rev} to 2.
12856
12857 @item -msmartmips
12858 @itemx -mno-smartmips
12859 @opindex msmartmips
12860 @opindex mno-smartmips
12861 Use (do not use) the MIPS SmartMIPS ASE.
12862
12863 @item -mpaired-single
12864 @itemx -mno-paired-single
12865 @opindex mpaired-single
12866 @opindex mno-paired-single
12867 Use (do not use) paired-single floating-point instructions.
12868 @xref{MIPS Paired-Single Support}.  This option requires
12869 hardware floating-point support to be enabled.
12870
12871 @item -mdmx
12872 @itemx -mno-mdmx
12873 @opindex mdmx
12874 @opindex mno-mdmx
12875 Use (do not use) MIPS Digital Media Extension instructions.
12876 This option can only be used when generating 64-bit code and requires
12877 hardware floating-point support to be enabled.
12878
12879 @item -mips3d
12880 @itemx -mno-mips3d
12881 @opindex mips3d
12882 @opindex mno-mips3d
12883 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
12884 The option @option{-mips3d} implies @option{-mpaired-single}.
12885
12886 @item -mmt
12887 @itemx -mno-mt
12888 @opindex mmt
12889 @opindex mno-mt
12890 Use (do not use) MT Multithreading instructions.
12891
12892 @item -mlong64
12893 @opindex mlong64
12894 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
12895 an explanation of the default and the way that the pointer size is
12896 determined.
12897
12898 @item -mlong32
12899 @opindex mlong32
12900 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
12901
12902 The default size of @code{int}s, @code{long}s and pointers depends on
12903 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
12904 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
12905 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
12906 or the same size as integer registers, whichever is smaller.
12907
12908 @item -msym32
12909 @itemx -mno-sym32
12910 @opindex msym32
12911 @opindex mno-sym32
12912 Assume (do not assume) that all symbols have 32-bit values, regardless
12913 of the selected ABI@.  This option is useful in combination with
12914 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
12915 to generate shorter and faster references to symbolic addresses.
12916
12917 @item -G @var{num}
12918 @opindex G
12919 Put definitions of externally-visible data in a small data section
12920 if that data is no bigger than @var{num} bytes.  GCC can then access
12921 the data more efficiently; see @option{-mgpopt} for details.
12922
12923 The default @option{-G} option depends on the configuration.
12924
12925 @item -mlocal-sdata
12926 @itemx -mno-local-sdata
12927 @opindex mlocal-sdata
12928 @opindex mno-local-sdata
12929 Extend (do not extend) the @option{-G} behavior to local data too,
12930 such as to static variables in C@.  @option{-mlocal-sdata} is the
12931 default for all configurations.
12932
12933 If the linker complains that an application is using too much small data,
12934 you might want to try rebuilding the less performance-critical parts with
12935 @option{-mno-local-sdata}.  You might also want to build large
12936 libraries with @option{-mno-local-sdata}, so that the libraries leave
12937 more room for the main program.
12938
12939 @item -mextern-sdata
12940 @itemx -mno-extern-sdata
12941 @opindex mextern-sdata
12942 @opindex mno-extern-sdata
12943 Assume (do not assume) that externally-defined data will be in
12944 a small data section if that data is within the @option{-G} limit.
12945 @option{-mextern-sdata} is the default for all configurations.
12946
12947 If you compile a module @var{Mod} with @option{-mextern-sdata} @option{-G
12948 @var{num}} @option{-mgpopt}, and @var{Mod} references a variable @var{Var}
12949 that is no bigger than @var{num} bytes, you must make sure that @var{Var}
12950 is placed in a small data section.  If @var{Var} is defined by another
12951 module, you must either compile that module with a high-enough
12952 @option{-G} setting or attach a @code{section} attribute to @var{Var}'s
12953 definition.  If @var{Var} is common, you must link the application
12954 with a high-enough @option{-G} setting.
12955
12956 The easiest way of satisfying these restrictions is to compile
12957 and link every module with the same @option{-G} option.  However,
12958 you may wish to build a library that supports several different
12959 small data limits.  You can do this by compiling the library with
12960 the highest supported @option{-G} setting and additionally using
12961 @option{-mno-extern-sdata} to stop the library from making assumptions
12962 about externally-defined data.
12963
12964 @item -mgpopt
12965 @itemx -mno-gpopt
12966 @opindex mgpopt
12967 @opindex mno-gpopt
12968 Use (do not use) GP-relative accesses for symbols that are known to be
12969 in a small data section; see @option{-G}, @option{-mlocal-sdata} and
12970 @option{-mextern-sdata}.  @option{-mgpopt} is the default for all
12971 configurations.
12972
12973 @option{-mno-gpopt} is useful for cases where the @code{$gp} register
12974 might not hold the value of @code{_gp}.  For example, if the code is
12975 part of a library that might be used in a boot monitor, programs that
12976 call boot monitor routines will pass an unknown value in @code{$gp}.
12977 (In such situations, the boot monitor itself would usually be compiled
12978 with @option{-G0}.)
12979
12980 @option{-mno-gpopt} implies @option{-mno-local-sdata} and
12981 @option{-mno-extern-sdata}.
12982
12983 @item -membedded-data
12984 @itemx -mno-embedded-data
12985 @opindex membedded-data
12986 @opindex mno-embedded-data
12987 Allocate variables to the read-only data section first if possible, then
12988 next in the small data section if possible, otherwise in data.  This gives
12989 slightly slower code than the default, but reduces the amount of RAM required
12990 when executing, and thus may be preferred for some embedded systems.
12991
12992 @item -muninit-const-in-rodata
12993 @itemx -mno-uninit-const-in-rodata
12994 @opindex muninit-const-in-rodata
12995 @opindex mno-uninit-const-in-rodata
12996 Put uninitialized @code{const} variables in the read-only data section.
12997 This option is only meaningful in conjunction with @option{-membedded-data}.
12998
12999 @item -mcode-readable=@var{setting}
13000 @opindex mcode-readable
13001 Specify whether GCC may generate code that reads from executable sections.
13002 There are three possible settings:
13003
13004 @table @gcctabopt
13005 @item -mcode-readable=yes
13006 Instructions may freely access executable sections.  This is the
13007 default setting.
13008
13009 @item -mcode-readable=pcrel
13010 MIPS16 PC-relative load instructions can access executable sections,
13011 but other instructions must not do so.  This option is useful on 4KSc
13012 and 4KSd processors when the code TLBs have the Read Inhibit bit set.
13013 It is also useful on processors that can be configured to have a dual
13014 instruction/data SRAM interface and that, like the M4K, automatically
13015 redirect PC-relative loads to the instruction RAM.
13016
13017 @item -mcode-readable=no
13018 Instructions must not access executable sections.  This option can be
13019 useful on targets that are configured to have a dual instruction/data
13020 SRAM interface but that (unlike the M4K) do not automatically redirect
13021 PC-relative loads to the instruction RAM.
13022 @end table
13023
13024 @item -msplit-addresses
13025 @itemx -mno-split-addresses
13026 @opindex msplit-addresses
13027 @opindex mno-split-addresses
13028 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
13029 relocation operators.  This option has been superseded by
13030 @option{-mexplicit-relocs} but is retained for backwards compatibility.
13031
13032 @item -mexplicit-relocs
13033 @itemx -mno-explicit-relocs
13034 @opindex mexplicit-relocs
13035 @opindex mno-explicit-relocs
13036 Use (do not use) assembler relocation operators when dealing with symbolic
13037 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
13038 is to use assembler macros instead.
13039
13040 @option{-mexplicit-relocs} is the default if GCC was configured
13041 to use an assembler that supports relocation operators.
13042
13043 @item -mcheck-zero-division
13044 @itemx -mno-check-zero-division
13045 @opindex mcheck-zero-division
13046 @opindex mno-check-zero-division
13047 Trap (do not trap) on integer division by zero.
13048
13049 The default is @option{-mcheck-zero-division}.
13050
13051 @item -mdivide-traps
13052 @itemx -mdivide-breaks
13053 @opindex mdivide-traps
13054 @opindex mdivide-breaks
13055 MIPS systems check for division by zero by generating either a
13056 conditional trap or a break instruction.  Using traps results in
13057 smaller code, but is only supported on MIPS II and later.  Also, some
13058 versions of the Linux kernel have a bug that prevents trap from
13059 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
13060 allow conditional traps on architectures that support them and
13061 @option{-mdivide-breaks} to force the use of breaks.
13062
13063 The default is usually @option{-mdivide-traps}, but this can be
13064 overridden at configure time using @option{--with-divide=breaks}.
13065 Divide-by-zero checks can be completely disabled using
13066 @option{-mno-check-zero-division}.
13067
13068 @item -mmemcpy
13069 @itemx -mno-memcpy
13070 @opindex mmemcpy
13071 @opindex mno-memcpy
13072 Force (do not force) the use of @code{memcpy()} for non-trivial block
13073 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
13074 most constant-sized copies.
13075
13076 @item -mlong-calls
13077 @itemx -mno-long-calls
13078 @opindex mlong-calls
13079 @opindex mno-long-calls
13080 Disable (do not disable) use of the @code{jal} instruction.  Calling
13081 functions using @code{jal} is more efficient but requires the caller
13082 and callee to be in the same 256 megabyte segment.
13083
13084 This option has no effect on abicalls code.  The default is
13085 @option{-mno-long-calls}.
13086
13087 @item -mmad
13088 @itemx -mno-mad
13089 @opindex mmad
13090 @opindex mno-mad
13091 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
13092 instructions, as provided by the R4650 ISA@.
13093
13094 @item -mfused-madd
13095 @itemx -mno-fused-madd
13096 @opindex mfused-madd
13097 @opindex mno-fused-madd
13098 Enable (disable) use of the floating point multiply-accumulate
13099 instructions, when they are available.  The default is
13100 @option{-mfused-madd}.
13101
13102 When multiply-accumulate instructions are used, the intermediate
13103 product is calculated to infinite precision and is not subject to
13104 the FCSR Flush to Zero bit.  This may be undesirable in some
13105 circumstances.
13106
13107 @item -nocpp
13108 @opindex nocpp
13109 Tell the MIPS assembler to not run its preprocessor over user
13110 assembler files (with a @samp{.s} suffix) when assembling them.
13111
13112 @item -mfix-r4000
13113 @itemx -mno-fix-r4000
13114 @opindex mfix-r4000
13115 @opindex mno-fix-r4000
13116 Work around certain R4000 CPU errata:
13117 @itemize @minus
13118 @item
13119 A double-word or a variable shift may give an incorrect result if executed
13120 immediately after starting an integer division.
13121 @item
13122 A double-word or a variable shift may give an incorrect result if executed
13123 while an integer multiplication is in progress.
13124 @item
13125 An integer division may give an incorrect result if started in a delay slot
13126 of a taken branch or a jump.
13127 @end itemize
13128
13129 @item -mfix-r4400
13130 @itemx -mno-fix-r4400
13131 @opindex mfix-r4400
13132 @opindex mno-fix-r4400
13133 Work around certain R4400 CPU errata:
13134 @itemize @minus
13135 @item
13136 A double-word or a variable shift may give an incorrect result if executed
13137 immediately after starting an integer division.
13138 @end itemize
13139
13140 @item -mfix-r10000
13141 @itemx -mno-fix-r10000
13142 @opindex mfix-r10000
13143 @opindex mno-fix-r10000
13144 Work around certain R10000 errata:
13145 @itemize @minus
13146 @item
13147 @code{ll}/@code{sc} sequences may not behave atomically on revisions
13148 prior to 3.0.  They may deadlock on revisions 2.6 and earlier.
13149 @end itemize
13150
13151 This option can only be used if the target architecture supports
13152 branch-likely instructions.  @option{-mfix-r10000} is the default when
13153 @option{-march=r10000} is used; @option{-mno-fix-r10000} is the default
13154 otherwise.
13155
13156 @item -mfix-vr4120
13157 @itemx -mno-fix-vr4120
13158 @opindex mfix-vr4120
13159 Work around certain VR4120 errata:
13160 @itemize @minus
13161 @item
13162 @code{dmultu} does not always produce the correct result.
13163 @item
13164 @code{div} and @code{ddiv} do not always produce the correct result if one
13165 of the operands is negative.
13166 @end itemize
13167 The workarounds for the division errata rely on special functions in
13168 @file{libgcc.a}.  At present, these functions are only provided by
13169 the @code{mips64vr*-elf} configurations.
13170
13171 Other VR4120 errata require a nop to be inserted between certain pairs of
13172 instructions.  These errata are handled by the assembler, not by GCC itself.
13173
13174 @item -mfix-vr4130
13175 @opindex mfix-vr4130
13176 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
13177 workarounds are implemented by the assembler rather than by GCC,
13178 although GCC will avoid using @code{mflo} and @code{mfhi} if the
13179 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
13180 instructions are available instead.
13181
13182 @item -mfix-sb1
13183 @itemx -mno-fix-sb1
13184 @opindex mfix-sb1
13185 Work around certain SB-1 CPU core errata.
13186 (This flag currently works around the SB-1 revision 2
13187 ``F1'' and ``F2'' floating point errata.)
13188
13189 @item -mr10k-cache-barrier=@var{setting}
13190 @opindex mr10k-cache-barrier
13191 Specify whether GCC should insert cache barriers to avoid the
13192 side-effects of speculation on R10K processors.
13193
13194 In common with many processors, the R10K tries to predict the outcome
13195 of a conditional branch and speculatively executes instructions from
13196 the ``taken'' branch.  It later aborts these instructions if the
13197 predicted outcome was wrong.  However, on the R10K, even aborted
13198 instructions can have side effects.
13199
13200 This problem only affects kernel stores and, depending on the system,
13201 kernel loads.  As an example, a speculatively-executed store may load
13202 the target memory into cache and mark the cache line as dirty, even if
13203 the store itself is later aborted.  If a DMA operation writes to the
13204 same area of memory before the ``dirty'' line is flushed, the cached
13205 data will overwrite the DMA-ed data.  See the R10K processor manual
13206 for a full description, including other potential problems.
13207
13208 One workaround is to insert cache barrier instructions before every memory
13209 access that might be speculatively executed and that might have side
13210 effects even if aborted.  @option{-mr10k-cache-barrier=@var{setting}}
13211 controls GCC's implementation of this workaround.  It assumes that
13212 aborted accesses to any byte in the following regions will not have
13213 side effects:
13214
13215 @enumerate
13216 @item
13217 the memory occupied by the current function's stack frame;
13218
13219 @item
13220 the memory occupied by an incoming stack argument;
13221
13222 @item
13223 the memory occupied by an object with a link-time-constant address.
13224 @end enumerate
13225
13226 It is the kernel's responsibility to ensure that speculative
13227 accesses to these regions are indeed safe.
13228
13229 If the input program contains a function declaration such as:
13230
13231 @smallexample
13232 void foo (void);
13233 @end smallexample
13234
13235 then the implementation of @code{foo} must allow @code{j foo} and
13236 @code{jal foo} to be executed speculatively.  GCC honors this
13237 restriction for functions it compiles itself.  It expects non-GCC
13238 functions (such as hand-written assembly code) to do the same.
13239
13240 The option has three forms:
13241
13242 @table @gcctabopt
13243 @item -mr10k-cache-barrier=load-store
13244 Insert a cache barrier before a load or store that might be
13245 speculatively executed and that might have side effects even
13246 if aborted.
13247
13248 @item -mr10k-cache-barrier=store
13249 Insert a cache barrier before a store that might be speculatively
13250 executed and that might have side effects even if aborted.
13251
13252 @item -mr10k-cache-barrier=none
13253 Disable the insertion of cache barriers.  This is the default setting.
13254 @end table
13255
13256 @item -mflush-func=@var{func}
13257 @itemx -mno-flush-func
13258 @opindex mflush-func
13259 Specifies the function to call to flush the I and D caches, or to not
13260 call any such function.  If called, the function must take the same
13261 arguments as the common @code{_flush_func()}, that is, the address of the
13262 memory range for which the cache is being flushed, the size of the
13263 memory range, and the number 3 (to flush both caches).  The default
13264 depends on the target GCC was configured for, but commonly is either
13265 @samp{_flush_func} or @samp{__cpu_flush}.
13266
13267 @item mbranch-cost=@var{num}
13268 @opindex mbranch-cost
13269 Set the cost of branches to roughly @var{num} ``simple'' instructions.
13270 This cost is only a heuristic and is not guaranteed to produce
13271 consistent results across releases.  A zero cost redundantly selects
13272 the default, which is based on the @option{-mtune} setting.
13273
13274 @item -mbranch-likely
13275 @itemx -mno-branch-likely
13276 @opindex mbranch-likely
13277 @opindex mno-branch-likely
13278 Enable or disable use of Branch Likely instructions, regardless of the
13279 default for the selected architecture.  By default, Branch Likely
13280 instructions may be generated if they are supported by the selected
13281 architecture.  An exception is for the MIPS32 and MIPS64 architectures
13282 and processors which implement those architectures; for those, Branch
13283 Likely instructions will not be generated by default because the MIPS32
13284 and MIPS64 architectures specifically deprecate their use.
13285
13286 @item -mfp-exceptions
13287 @itemx -mno-fp-exceptions
13288 @opindex mfp-exceptions
13289 Specifies whether FP exceptions are enabled.  This affects how we schedule
13290 FP instructions for some processors.  The default is that FP exceptions are
13291 enabled.
13292
13293 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
13294 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
13295 FP pipe.
13296
13297 @item -mvr4130-align
13298 @itemx -mno-vr4130-align
13299 @opindex mvr4130-align
13300 The VR4130 pipeline is two-way superscalar, but can only issue two
13301 instructions together if the first one is 8-byte aligned.  When this
13302 option is enabled, GCC will align pairs of instructions that it
13303 thinks should execute in parallel.
13304
13305 This option only has an effect when optimizing for the VR4130.
13306 It normally makes code faster, but at the expense of making it bigger.
13307 It is enabled by default at optimization level @option{-O3}.
13308 @end table
13309
13310 @node MMIX Options
13311 @subsection MMIX Options
13312 @cindex MMIX Options
13313
13314 These options are defined for the MMIX:
13315
13316 @table @gcctabopt
13317 @item -mlibfuncs
13318 @itemx -mno-libfuncs
13319 @opindex mlibfuncs
13320 @opindex mno-libfuncs
13321 Specify that intrinsic library functions are being compiled, passing all
13322 values in registers, no matter the size.
13323
13324 @item -mepsilon
13325 @itemx -mno-epsilon
13326 @opindex mepsilon
13327 @opindex mno-epsilon
13328 Generate floating-point comparison instructions that compare with respect
13329 to the @code{rE} epsilon register.
13330
13331 @item -mabi=mmixware
13332 @itemx -mabi=gnu
13333 @opindex mabi-mmixware
13334 @opindex mabi=gnu
13335 Generate code that passes function parameters and return values that (in
13336 the called function) are seen as registers @code{$0} and up, as opposed to
13337 the GNU ABI which uses global registers @code{$231} and up.
13338
13339 @item -mzero-extend
13340 @itemx -mno-zero-extend
13341 @opindex mzero-extend
13342 @opindex mno-zero-extend
13343 When reading data from memory in sizes shorter than 64 bits, use (do not
13344 use) zero-extending load instructions by default, rather than
13345 sign-extending ones.
13346
13347 @item -mknuthdiv
13348 @itemx -mno-knuthdiv
13349 @opindex mknuthdiv
13350 @opindex mno-knuthdiv
13351 Make the result of a division yielding a remainder have the same sign as
13352 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
13353 remainder follows the sign of the dividend.  Both methods are
13354 arithmetically valid, the latter being almost exclusively used.
13355
13356 @item -mtoplevel-symbols
13357 @itemx -mno-toplevel-symbols
13358 @opindex mtoplevel-symbols
13359 @opindex mno-toplevel-symbols
13360 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
13361 code can be used with the @code{PREFIX} assembly directive.
13362
13363 @item -melf
13364 @opindex melf
13365 Generate an executable in the ELF format, rather than the default
13366 @samp{mmo} format used by the @command{mmix} simulator.
13367
13368 @item -mbranch-predict
13369 @itemx -mno-branch-predict
13370 @opindex mbranch-predict
13371 @opindex mno-branch-predict
13372 Use (do not use) the probable-branch instructions, when static branch
13373 prediction indicates a probable branch.
13374
13375 @item -mbase-addresses
13376 @itemx -mno-base-addresses
13377 @opindex mbase-addresses
13378 @opindex mno-base-addresses
13379 Generate (do not generate) code that uses @emph{base addresses}.  Using a
13380 base address automatically generates a request (handled by the assembler
13381 and the linker) for a constant to be set up in a global register.  The
13382 register is used for one or more base address requests within the range 0
13383 to 255 from the value held in the register.  The generally leads to short
13384 and fast code, but the number of different data items that can be
13385 addressed is limited.  This means that a program that uses lots of static
13386 data may require @option{-mno-base-addresses}.
13387
13388 @item -msingle-exit
13389 @itemx -mno-single-exit
13390 @opindex msingle-exit
13391 @opindex mno-single-exit
13392 Force (do not force) generated code to have a single exit point in each
13393 function.
13394 @end table
13395
13396 @node MN10300 Options
13397 @subsection MN10300 Options
13398 @cindex MN10300 options
13399
13400 These @option{-m} options are defined for Matsushita MN10300 architectures:
13401
13402 @table @gcctabopt
13403 @item -mmult-bug
13404 @opindex mmult-bug
13405 Generate code to avoid bugs in the multiply instructions for the MN10300
13406 processors.  This is the default.
13407
13408 @item -mno-mult-bug
13409 @opindex mno-mult-bug
13410 Do not generate code to avoid bugs in the multiply instructions for the
13411 MN10300 processors.
13412
13413 @item -mam33
13414 @opindex mam33
13415 Generate code which uses features specific to the AM33 processor.
13416
13417 @item -mno-am33
13418 @opindex mno-am33
13419 Do not generate code which uses features specific to the AM33 processor.  This
13420 is the default.
13421
13422 @item -mreturn-pointer-on-d0
13423 @opindex mreturn-pointer-on-d0
13424 When generating a function which returns a pointer, return the pointer
13425 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
13426 only in a0, and attempts to call such functions without a prototype
13427 would result in errors.  Note that this option is on by default; use
13428 @option{-mno-return-pointer-on-d0} to disable it.
13429
13430 @item -mno-crt0
13431 @opindex mno-crt0
13432 Do not link in the C run-time initialization object file.
13433
13434 @item -mrelax
13435 @opindex mrelax
13436 Indicate to the linker that it should perform a relaxation optimization pass
13437 to shorten branches, calls and absolute memory addresses.  This option only
13438 has an effect when used on the command line for the final link step.
13439
13440 This option makes symbolic debugging impossible.
13441 @end table
13442
13443 @node PDP-11 Options
13444 @subsection PDP-11 Options
13445 @cindex PDP-11 Options
13446
13447 These options are defined for the PDP-11:
13448
13449 @table @gcctabopt
13450 @item -mfpu
13451 @opindex mfpu
13452 Use hardware FPP floating point.  This is the default.  (FIS floating
13453 point on the PDP-11/40 is not supported.)
13454
13455 @item -msoft-float
13456 @opindex msoft-float
13457 Do not use hardware floating point.
13458
13459 @item -mac0
13460 @opindex mac0
13461 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
13462
13463 @item -mno-ac0
13464 @opindex mno-ac0
13465 Return floating-point results in memory.  This is the default.
13466
13467 @item -m40
13468 @opindex m40
13469 Generate code for a PDP-11/40.
13470
13471 @item -m45
13472 @opindex m45
13473 Generate code for a PDP-11/45.  This is the default.
13474
13475 @item -m10
13476 @opindex m10
13477 Generate code for a PDP-11/10.
13478
13479 @item -mbcopy-builtin
13480 @opindex bcopy-builtin
13481 Use inline @code{movmemhi} patterns for copying memory.  This is the
13482 default.
13483
13484 @item -mbcopy
13485 @opindex mbcopy
13486 Do not use inline @code{movmemhi} patterns for copying memory.
13487
13488 @item -mint16
13489 @itemx -mno-int32
13490 @opindex mint16
13491 @opindex mno-int32
13492 Use 16-bit @code{int}.  This is the default.
13493
13494 @item -mint32
13495 @itemx -mno-int16
13496 @opindex mint32
13497 @opindex mno-int16
13498 Use 32-bit @code{int}.
13499
13500 @item -mfloat64
13501 @itemx -mno-float32
13502 @opindex mfloat64
13503 @opindex mno-float32
13504 Use 64-bit @code{float}.  This is the default.
13505
13506 @item -mfloat32
13507 @itemx -mno-float64
13508 @opindex mfloat32
13509 @opindex mno-float64
13510 Use 32-bit @code{float}.
13511
13512 @item -mabshi
13513 @opindex mabshi
13514 Use @code{abshi2} pattern.  This is the default.
13515
13516 @item -mno-abshi
13517 @opindex mno-abshi
13518 Do not use @code{abshi2} pattern.
13519
13520 @item -mbranch-expensive
13521 @opindex mbranch-expensive
13522 Pretend that branches are expensive.  This is for experimenting with
13523 code generation only.
13524
13525 @item -mbranch-cheap
13526 @opindex mbranch-cheap
13527 Do not pretend that branches are expensive.  This is the default.
13528
13529 @item -msplit
13530 @opindex msplit
13531 Generate code for a system with split I&D@.
13532
13533 @item -mno-split
13534 @opindex mno-split
13535 Generate code for a system without split I&D@.  This is the default.
13536
13537 @item -munix-asm
13538 @opindex munix-asm
13539 Use Unix assembler syntax.  This is the default when configured for
13540 @samp{pdp11-*-bsd}.
13541
13542 @item -mdec-asm
13543 @opindex mdec-asm
13544 Use DEC assembler syntax.  This is the default when configured for any
13545 PDP-11 target other than @samp{pdp11-*-bsd}.
13546 @end table
13547
13548 @node picoChip Options
13549 @subsection picoChip Options
13550 @cindex picoChip options
13551
13552 These @samp{-m} options are defined for picoChip implementations:
13553
13554 @table @gcctabopt
13555
13556 @item -mae=@var{ae_type}
13557 @opindex mcpu
13558 Set the instruction set, register set, and instruction scheduling
13559 parameters for array element type @var{ae_type}.  Supported values
13560 for @var{ae_type} are @samp{ANY}, @samp{MUL}, and @samp{MAC}.
13561
13562 @option{-mae=ANY} selects a completely generic AE type.  Code
13563 generated with this option will run on any of the other AE types.  The
13564 code will not be as efficient as it would be if compiled for a specific
13565 AE type, and some types of operation (e.g., multiplication) will not
13566 work properly on all types of AE.
13567
13568 @option{-mae=MUL} selects a MUL AE type.  This is the most useful AE type
13569 for compiled code, and is the default.
13570
13571 @option{-mae=MAC} selects a DSP-style MAC AE.  Code compiled with this
13572 option may suffer from poor performance of byte (char) manipulation,
13573 since the DSP AE does not provide hardware support for byte load/stores.
13574
13575 @item -msymbol-as-address
13576 Enable the compiler to directly use a symbol name as an address in a
13577 load/store instruction, without first loading it into a
13578 register.  Typically, the use of this option will generate larger
13579 programs, which run faster than when the option isn't used.  However, the
13580 results vary from program to program, so it is left as a user option,
13581 rather than being permanently enabled.
13582
13583 @item -mno-inefficient-warnings
13584 Disables warnings about the generation of inefficient code.  These
13585 warnings can be generated, for example, when compiling code which
13586 performs byte-level memory operations on the MAC AE type.  The MAC AE has
13587 no hardware support for byte-level memory operations, so all byte
13588 load/stores must be synthesized from word load/store operations.  This is
13589 inefficient and a warning will be generated indicating to the programmer
13590 that they should rewrite the code to avoid byte operations, or to target
13591 an AE type which has the necessary hardware support.  This option enables
13592 the warning to be turned off.
13593
13594 @end table
13595
13596 @node PowerPC Options
13597 @subsection PowerPC Options
13598 @cindex PowerPC options
13599
13600 These are listed under @xref{RS/6000 and PowerPC Options}.
13601
13602 @node RS/6000 and PowerPC Options
13603 @subsection IBM RS/6000 and PowerPC Options
13604 @cindex RS/6000 and PowerPC Options
13605 @cindex IBM RS/6000 and PowerPC Options
13606
13607 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
13608 @table @gcctabopt
13609 @item -mpower
13610 @itemx -mno-power
13611 @itemx -mpower2
13612 @itemx -mno-power2
13613 @itemx -mpowerpc
13614 @itemx -mno-powerpc
13615 @itemx -mpowerpc-gpopt
13616 @itemx -mno-powerpc-gpopt
13617 @itemx -mpowerpc-gfxopt
13618 @itemx -mno-powerpc-gfxopt
13619 @itemx -mpowerpc64
13620 @itemx -mno-powerpc64
13621 @itemx -mmfcrf
13622 @itemx -mno-mfcrf
13623 @itemx -mpopcntb
13624 @itemx -mno-popcntb
13625 @itemx -mfprnd
13626 @itemx -mno-fprnd
13627 @itemx -mcmpb
13628 @itemx -mno-cmpb
13629 @itemx -mmfpgpr
13630 @itemx -mno-mfpgpr
13631 @itemx -mhard-dfp
13632 @itemx -mno-hard-dfp
13633 @opindex mpower
13634 @opindex mno-power
13635 @opindex mpower2
13636 @opindex mno-power2
13637 @opindex mpowerpc
13638 @opindex mno-powerpc
13639 @opindex mpowerpc-gpopt
13640 @opindex mno-powerpc-gpopt
13641 @opindex mpowerpc-gfxopt
13642 @opindex mno-powerpc-gfxopt
13643 @opindex mpowerpc64
13644 @opindex mno-powerpc64
13645 @opindex mmfcrf
13646 @opindex mno-mfcrf
13647 @opindex mpopcntb
13648 @opindex mno-popcntb
13649 @opindex mfprnd
13650 @opindex mno-fprnd
13651 @opindex mcmpb
13652 @opindex mno-cmpb
13653 @opindex mmfpgpr
13654 @opindex mno-mfpgpr
13655 @opindex mhard-dfp
13656 @opindex mno-hard-dfp
13657 GCC supports two related instruction set architectures for the
13658 RS/6000 and PowerPC@.  The @dfn{POWER} instruction set are those
13659 instructions supported by the @samp{rios} chip set used in the original
13660 RS/6000 systems and the @dfn{PowerPC} instruction set is the
13661 architecture of the Freescale MPC5xx, MPC6xx, MPC8xx microprocessors, and
13662 the IBM 4xx, 6xx, and follow-on microprocessors.
13663
13664 Neither architecture is a subset of the other.  However there is a
13665 large common subset of instructions supported by both.  An MQ
13666 register is included in processors supporting the POWER architecture.
13667
13668 You use these options to specify which instructions are available on the
13669 processor you are using.  The default value of these options is
13670 determined when configuring GCC@.  Specifying the
13671 @option{-mcpu=@var{cpu_type}} overrides the specification of these
13672 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
13673 rather than the options listed above.
13674
13675 The @option{-mpower} option allows GCC to generate instructions that
13676 are found only in the POWER architecture and to use the MQ register.
13677 Specifying @option{-mpower2} implies @option{-power} and also allows GCC
13678 to generate instructions that are present in the POWER2 architecture but
13679 not the original POWER architecture.
13680
13681 The @option{-mpowerpc} option allows GCC to generate instructions that
13682 are found only in the 32-bit subset of the PowerPC architecture.
13683 Specifying @option{-mpowerpc-gpopt} implies @option{-mpowerpc} and also allows
13684 GCC to use the optional PowerPC architecture instructions in the
13685 General Purpose group, including floating-point square root.  Specifying
13686 @option{-mpowerpc-gfxopt} implies @option{-mpowerpc} and also allows GCC to
13687 use the optional PowerPC architecture instructions in the Graphics
13688 group, including floating-point select.
13689
13690 The @option{-mmfcrf} option allows GCC to generate the move from
13691 condition register field instruction implemented on the POWER4
13692 processor and other processors that support the PowerPC V2.01
13693 architecture.
13694 The @option{-mpopcntb} option allows GCC to generate the popcount and
13695 double precision FP reciprocal estimate instruction implemented on the
13696 POWER5 processor and other processors that support the PowerPC V2.02
13697 architecture.
13698 The @option{-mfprnd} option allows GCC to generate the FP round to
13699 integer instructions implemented on the POWER5+ processor and other
13700 processors that support the PowerPC V2.03 architecture.
13701 The @option{-mcmpb} option allows GCC to generate the compare bytes
13702 instruction implemented on the POWER6 processor and other processors
13703 that support the PowerPC V2.05 architecture.
13704 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
13705 general purpose register instructions implemented on the POWER6X
13706 processor and other processors that support the extended PowerPC V2.05
13707 architecture.
13708 The @option{-mhard-dfp} option allows GCC to generate the decimal floating
13709 point instructions implemented on some POWER processors.
13710
13711 The @option{-mpowerpc64} option allows GCC to generate the additional
13712 64-bit instructions that are found in the full PowerPC64 architecture
13713 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
13714 @option{-mno-powerpc64}.
13715
13716 If you specify both @option{-mno-power} and @option{-mno-powerpc}, GCC
13717 will use only the instructions in the common subset of both
13718 architectures plus some special AIX common-mode calls, and will not use
13719 the MQ register.  Specifying both @option{-mpower} and @option{-mpowerpc}
13720 permits GCC to use any instruction from either architecture and to
13721 allow use of the MQ register; specify this for the Motorola MPC601.
13722
13723 @item -mnew-mnemonics
13724 @itemx -mold-mnemonics
13725 @opindex mnew-mnemonics
13726 @opindex mold-mnemonics
13727 Select which mnemonics to use in the generated assembler code.  With
13728 @option{-mnew-mnemonics}, GCC uses the assembler mnemonics defined for
13729 the PowerPC architecture.  With @option{-mold-mnemonics} it uses the
13730 assembler mnemonics defined for the POWER architecture.  Instructions
13731 defined in only one architecture have only one mnemonic; GCC uses that
13732 mnemonic irrespective of which of these options is specified.
13733
13734 GCC defaults to the mnemonics appropriate for the architecture in
13735 use.  Specifying @option{-mcpu=@var{cpu_type}} sometimes overrides the
13736 value of these option.  Unless you are building a cross-compiler, you
13737 should normally not specify either @option{-mnew-mnemonics} or
13738 @option{-mold-mnemonics}, but should instead accept the default.
13739
13740 @item -mcpu=@var{cpu_type}
13741 @opindex mcpu
13742 Set architecture type, register usage, choice of mnemonics, and
13743 instruction scheduling parameters for machine type @var{cpu_type}.
13744 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
13745 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{464}, @samp{464fp},
13746 @samp{505}, @samp{601}, @samp{602}, @samp{603}, @samp{603e}, @samp{604},
13747 @samp{604e}, @samp{620}, @samp{630}, @samp{740}, @samp{7400},
13748 @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
13749 @samp{860}, @samp{970}, @samp{8540}, @samp{e300c2}, @samp{e300c3},
13750 @samp{e500mc}, @samp{ec603e}, @samp{G3}, @samp{G4}, @samp{G5},
13751 @samp{power}, @samp{power2}, @samp{power3}, @samp{power4},
13752 @samp{power5}, @samp{power5+}, @samp{power6}, @samp{power6x}, @samp{power7}
13753 @samp{common}, @samp{powerpc}, @samp{powerpc64}, @samp{rios},
13754 @samp{rios1}, @samp{rios2}, @samp{rsc}, and @samp{rs64}.
13755
13756 @option{-mcpu=common} selects a completely generic processor.  Code
13757 generated under this option will run on any POWER or PowerPC processor.
13758 GCC will use only the instructions in the common subset of both
13759 architectures, and will not use the MQ register.  GCC assumes a generic
13760 processor model for scheduling purposes.
13761
13762 @option{-mcpu=power}, @option{-mcpu=power2}, @option{-mcpu=powerpc}, and
13763 @option{-mcpu=powerpc64} specify generic POWER, POWER2, pure 32-bit
13764 PowerPC (i.e., not MPC601), and 64-bit PowerPC architecture machine
13765 types, with an appropriate, generic processor model assumed for
13766 scheduling purposes.
13767
13768 The other options specify a specific processor.  Code generated under
13769 those options will run best on that processor, and may not run at all on
13770 others.
13771
13772 The @option{-mcpu} options automatically enable or disable the
13773 following options:
13774
13775 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
13776 -mnew-mnemonics  -mpopcntb  -mpower  -mpower2  -mpowerpc64 @gol
13777 -mpowerpc-gpopt  -mpowerpc-gfxopt  -msingle-float -mdouble-float @gol
13778 -msimple-fpu -mstring  -mmulhw  -mdlmzb  -mmfpgpr}
13779
13780 The particular options set for any particular CPU will vary between
13781 compiler versions, depending on what setting seems to produce optimal
13782 code for that CPU; it doesn't necessarily reflect the actual hardware's
13783 capabilities.  If you wish to set an individual option to a particular
13784 value, you may specify it after the @option{-mcpu} option, like
13785 @samp{-mcpu=970 -mno-altivec}.
13786
13787 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
13788 not enabled or disabled by the @option{-mcpu} option at present because
13789 AIX does not have full support for these options.  You may still
13790 enable or disable them individually if you're sure it'll work in your
13791 environment.
13792
13793 @item -mtune=@var{cpu_type}
13794 @opindex mtune
13795 Set the instruction scheduling parameters for machine type
13796 @var{cpu_type}, but do not set the architecture type, register usage, or
13797 choice of mnemonics, as @option{-mcpu=@var{cpu_type}} would.  The same
13798 values for @var{cpu_type} are used for @option{-mtune} as for
13799 @option{-mcpu}.  If both are specified, the code generated will use the
13800 architecture, registers, and mnemonics set by @option{-mcpu}, but the
13801 scheduling parameters set by @option{-mtune}.
13802
13803 @item -mswdiv
13804 @itemx -mno-swdiv
13805 @opindex mswdiv
13806 @opindex mno-swdiv
13807 Generate code to compute division as reciprocal estimate and iterative
13808 refinement, creating opportunities for increased throughput.  This
13809 feature requires: optional PowerPC Graphics instruction set for single
13810 precision and FRE instruction for double precision, assuming divides
13811 cannot generate user-visible traps, and the domain values not include
13812 Infinities, denormals or zero denominator.
13813
13814 @item -maltivec
13815 @itemx -mno-altivec
13816 @opindex maltivec
13817 @opindex mno-altivec
13818 Generate code that uses (does not use) AltiVec instructions, and also
13819 enable the use of built-in functions that allow more direct access to
13820 the AltiVec instruction set.  You may also need to set
13821 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
13822 enhancements.
13823
13824 @item -mvrsave
13825 @itemx -mno-vrsave
13826 @opindex mvrsave
13827 @opindex mno-vrsave
13828 Generate VRSAVE instructions when generating AltiVec code.
13829
13830 @item -mgen-cell-microcode
13831 @opindex mgen-cell-microcode
13832 Generate Cell microcode instructions
13833
13834 @item -mwarn-cell-microcode
13835 @opindex mwarn-cell-microcode
13836 Warning when a Cell microcode instruction is going to emitted.  An example
13837 of a Cell microcode instruction is a variable shift.
13838
13839 @item -msecure-plt
13840 @opindex msecure-plt
13841 Generate code that allows ld and ld.so to build executables and shared
13842 libraries with non-exec .plt and .got sections.  This is a PowerPC
13843 32-bit SYSV ABI option.
13844
13845 @item -mbss-plt
13846 @opindex mbss-plt
13847 Generate code that uses a BSS .plt section that ld.so fills in, and
13848 requires .plt and .got sections that are both writable and executable.
13849 This is a PowerPC 32-bit SYSV ABI option.
13850
13851 @item -misel
13852 @itemx -mno-isel
13853 @opindex misel
13854 @opindex mno-isel
13855 This switch enables or disables the generation of ISEL instructions.
13856
13857 @item -misel=@var{yes/no}
13858 This switch has been deprecated.  Use @option{-misel} and
13859 @option{-mno-isel} instead.
13860
13861 @item -mspe
13862 @itemx -mno-spe
13863 @opindex mspe
13864 @opindex mno-spe
13865 This switch enables or disables the generation of SPE simd
13866 instructions.
13867
13868 @item -mpaired
13869 @itemx -mno-paired
13870 @opindex mpaired
13871 @opindex mno-paired
13872 This switch enables or disables the generation of PAIRED simd
13873 instructions.
13874
13875 @item -mspe=@var{yes/no}
13876 This option has been deprecated.  Use @option{-mspe} and
13877 @option{-mno-spe} instead.
13878
13879 @item -mfloat-gprs=@var{yes/single/double/no}
13880 @itemx -mfloat-gprs
13881 @opindex mfloat-gprs
13882 This switch enables or disables the generation of floating point
13883 operations on the general purpose registers for architectures that
13884 support it.
13885
13886 The argument @var{yes} or @var{single} enables the use of
13887 single-precision floating point operations.
13888
13889 The argument @var{double} enables the use of single and
13890 double-precision floating point operations.
13891
13892 The argument @var{no} disables floating point operations on the
13893 general purpose registers.
13894
13895 This option is currently only available on the MPC854x.
13896
13897 @item -m32
13898 @itemx -m64
13899 @opindex m32
13900 @opindex m64
13901 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
13902 targets (including GNU/Linux).  The 32-bit environment sets int, long
13903 and pointer to 32 bits and generates code that runs on any PowerPC
13904 variant.  The 64-bit environment sets int to 32 bits and long and
13905 pointer to 64 bits, and generates code for PowerPC64, as for
13906 @option{-mpowerpc64}.
13907
13908 @item -mfull-toc
13909 @itemx -mno-fp-in-toc
13910 @itemx -mno-sum-in-toc
13911 @itemx -mminimal-toc
13912 @opindex mfull-toc
13913 @opindex mno-fp-in-toc
13914 @opindex mno-sum-in-toc
13915 @opindex mminimal-toc
13916 Modify generation of the TOC (Table Of Contents), which is created for
13917 every executable file.  The @option{-mfull-toc} option is selected by
13918 default.  In that case, GCC will allocate at least one TOC entry for
13919 each unique non-automatic variable reference in your program.  GCC
13920 will also place floating-point constants in the TOC@.  However, only
13921 16,384 entries are available in the TOC@.
13922
13923 If you receive a linker error message that saying you have overflowed
13924 the available TOC space, you can reduce the amount of TOC space used
13925 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
13926 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
13927 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
13928 generate code to calculate the sum of an address and a constant at
13929 run-time instead of putting that sum into the TOC@.  You may specify one
13930 or both of these options.  Each causes GCC to produce very slightly
13931 slower and larger code at the expense of conserving TOC space.
13932
13933 If you still run out of space in the TOC even when you specify both of
13934 these options, specify @option{-mminimal-toc} instead.  This option causes
13935 GCC to make only one TOC entry for every file.  When you specify this
13936 option, GCC will produce code that is slower and larger but which
13937 uses extremely little TOC space.  You may wish to use this option
13938 only on files that contain less frequently executed code.
13939
13940 @item -maix64
13941 @itemx -maix32
13942 @opindex maix64
13943 @opindex maix32
13944 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
13945 @code{long} type, and the infrastructure needed to support them.
13946 Specifying @option{-maix64} implies @option{-mpowerpc64} and
13947 @option{-mpowerpc}, while @option{-maix32} disables the 64-bit ABI and
13948 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
13949
13950 @item -mxl-compat
13951 @itemx -mno-xl-compat
13952 @opindex mxl-compat
13953 @opindex mno-xl-compat
13954 Produce code that conforms more closely to IBM XL compiler semantics
13955 when using AIX-compatible ABI@.  Pass floating-point arguments to
13956 prototyped functions beyond the register save area (RSA) on the stack
13957 in addition to argument FPRs.  Do not assume that most significant
13958 double in 128-bit long double value is properly rounded when comparing
13959 values and converting to double.  Use XL symbol names for long double
13960 support routines.
13961
13962 The AIX calling convention was extended but not initially documented to
13963 handle an obscure K&R C case of calling a function that takes the
13964 address of its arguments with fewer arguments than declared.  IBM XL
13965 compilers access floating point arguments which do not fit in the
13966 RSA from the stack when a subroutine is compiled without
13967 optimization.  Because always storing floating-point arguments on the
13968 stack is inefficient and rarely needed, this option is not enabled by
13969 default and only is necessary when calling subroutines compiled by IBM
13970 XL compilers without optimization.
13971
13972 @item -mpe
13973 @opindex mpe
13974 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
13975 application written to use message passing with special startup code to
13976 enable the application to run.  The system must have PE installed in the
13977 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
13978 must be overridden with the @option{-specs=} option to specify the
13979 appropriate directory location.  The Parallel Environment does not
13980 support threads, so the @option{-mpe} option and the @option{-pthread}
13981 option are incompatible.
13982
13983 @item -malign-natural
13984 @itemx -malign-power
13985 @opindex malign-natural
13986 @opindex malign-power
13987 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
13988 @option{-malign-natural} overrides the ABI-defined alignment of larger
13989 types, such as floating-point doubles, on their natural size-based boundary.
13990 The option @option{-malign-power} instructs GCC to follow the ABI-specified
13991 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
13992
13993 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
13994 is not supported.
13995
13996 @item -msoft-float
13997 @itemx -mhard-float
13998 @opindex msoft-float
13999 @opindex mhard-float
14000 Generate code that does not use (uses) the floating-point register set.
14001 Software floating point emulation is provided if you use the
14002 @option{-msoft-float} option, and pass the option to GCC when linking.
14003
14004 @item -msingle-float
14005 @itemx -mdouble-float
14006 @opindex msingle-float
14007 @opindex mdouble-float
14008 Generate code for single or double-precision floating point operations. 
14009 @option{-mdouble-float} implies @option{-msingle-float}. 
14010
14011 @item -msimple-fpu
14012 @opindex msimple-fpu
14013 Do not generate sqrt and div instructions for hardware floating point unit.
14014
14015 @item -mfpu
14016 @opindex mfpu
14017 Specify type of floating point unit.  Valid values are @var{sp_lite} 
14018 (equivalent to -msingle-float -msimple-fpu), @var{dp_lite} (equivalent
14019 to -mdouble-float -msimple-fpu), @var{sp_full} (equivalent to -msingle-float),
14020 and @var{dp_full} (equivalent to -mdouble-float).
14021
14022 @item -mxilinx-fpu
14023 @opindex mxilinx-fpu
14024 Perform optimizations for floating point unit on Xilinx PPC 405/440.
14025
14026 @item -mmultiple
14027 @itemx -mno-multiple
14028 @opindex mmultiple
14029 @opindex mno-multiple
14030 Generate code that uses (does not use) the load multiple word
14031 instructions and the store multiple word instructions.  These
14032 instructions are generated by default on POWER systems, and not
14033 generated on PowerPC systems.  Do not use @option{-mmultiple} on little
14034 endian PowerPC systems, since those instructions do not work when the
14035 processor is in little endian mode.  The exceptions are PPC740 and
14036 PPC750 which permit the instructions usage in little endian mode.
14037
14038 @item -mstring
14039 @itemx -mno-string
14040 @opindex mstring
14041 @opindex mno-string
14042 Generate code that uses (does not use) the load string instructions
14043 and the store string word instructions to save multiple registers and
14044 do small block moves.  These instructions are generated by default on
14045 POWER systems, and not generated on PowerPC systems.  Do not use
14046 @option{-mstring} on little endian PowerPC systems, since those
14047 instructions do not work when the processor is in little endian mode.
14048 The exceptions are PPC740 and PPC750 which permit the instructions
14049 usage in little endian mode.
14050
14051 @item -mupdate
14052 @itemx -mno-update
14053 @opindex mupdate
14054 @opindex mno-update
14055 Generate code that uses (does not use) the load or store instructions
14056 that update the base register to the address of the calculated memory
14057 location.  These instructions are generated by default.  If you use
14058 @option{-mno-update}, there is a small window between the time that the
14059 stack pointer is updated and the address of the previous frame is
14060 stored, which means code that walks the stack frame across interrupts or
14061 signals may get corrupted data.
14062
14063 @item -mavoid-indexed-addresses
14064 @item -mno-avoid-indexed-addresses
14065 @opindex mavoid-indexed-addresses
14066 @opindex mno-avoid-indexed-addresses
14067 Generate code that tries to avoid (not avoid) the use of indexed load
14068 or store instructions. These instructions can incur a performance
14069 penalty on Power6 processors in certain situations, such as when
14070 stepping through large arrays that cross a 16M boundary.  This option
14071 is enabled by default when targetting Power6 and disabled otherwise.
14072
14073 @item -mfused-madd
14074 @itemx -mno-fused-madd
14075 @opindex mfused-madd
14076 @opindex mno-fused-madd
14077 Generate code that uses (does not use) the floating point multiply and
14078 accumulate instructions.  These instructions are generated by default if
14079 hardware floating is used.
14080
14081 @item -mmulhw
14082 @itemx -mno-mulhw
14083 @opindex mmulhw
14084 @opindex mno-mulhw
14085 Generate code that uses (does not use) the half-word multiply and
14086 multiply-accumulate instructions on the IBM 405, 440 and 464 processors.
14087 These instructions are generated by default when targetting those
14088 processors.
14089
14090 @item -mdlmzb
14091 @itemx -mno-dlmzb
14092 @opindex mdlmzb
14093 @opindex mno-dlmzb
14094 Generate code that uses (does not use) the string-search @samp{dlmzb}
14095 instruction on the IBM 405, 440 and 464 processors.  This instruction is
14096 generated by default when targetting those processors.
14097
14098 @item -mno-bit-align
14099 @itemx -mbit-align
14100 @opindex mno-bit-align
14101 @opindex mbit-align
14102 On System V.4 and embedded PowerPC systems do not (do) force structures
14103 and unions that contain bit-fields to be aligned to the base type of the
14104 bit-field.
14105
14106 For example, by default a structure containing nothing but 8
14107 @code{unsigned} bit-fields of length 1 would be aligned to a 4 byte
14108 boundary and have a size of 4 bytes.  By using @option{-mno-bit-align},
14109 the structure would be aligned to a 1 byte boundary and be one byte in
14110 size.
14111
14112 @item -mno-strict-align
14113 @itemx -mstrict-align
14114 @opindex mno-strict-align
14115 @opindex mstrict-align
14116 On System V.4 and embedded PowerPC systems do not (do) assume that
14117 unaligned memory references will be handled by the system.
14118
14119 @item -mrelocatable
14120 @itemx -mno-relocatable
14121 @opindex mrelocatable
14122 @opindex mno-relocatable
14123 On embedded PowerPC systems generate code that allows (does not allow)
14124 the program to be relocated to a different address at runtime.  If you
14125 use @option{-mrelocatable} on any module, all objects linked together must
14126 be compiled with @option{-mrelocatable} or @option{-mrelocatable-lib}.
14127
14128 @item -mrelocatable-lib
14129 @itemx -mno-relocatable-lib
14130 @opindex mrelocatable-lib
14131 @opindex mno-relocatable-lib
14132 On embedded PowerPC systems generate code that allows (does not allow)
14133 the program to be relocated to a different address at runtime.  Modules
14134 compiled with @option{-mrelocatable-lib} can be linked with either modules
14135 compiled without @option{-mrelocatable} and @option{-mrelocatable-lib} or
14136 with modules compiled with the @option{-mrelocatable} options.
14137
14138 @item -mno-toc
14139 @itemx -mtoc
14140 @opindex mno-toc
14141 @opindex mtoc
14142 On System V.4 and embedded PowerPC systems do not (do) assume that
14143 register 2 contains a pointer to a global area pointing to the addresses
14144 used in the program.
14145
14146 @item -mlittle
14147 @itemx -mlittle-endian
14148 @opindex mlittle
14149 @opindex mlittle-endian
14150 On System V.4 and embedded PowerPC systems compile code for the
14151 processor in little endian mode.  The @option{-mlittle-endian} option is
14152 the same as @option{-mlittle}.
14153
14154 @item -mbig
14155 @itemx -mbig-endian
14156 @opindex mbig
14157 @opindex mbig-endian
14158 On System V.4 and embedded PowerPC systems compile code for the
14159 processor in big endian mode.  The @option{-mbig-endian} option is
14160 the same as @option{-mbig}.
14161
14162 @item -mdynamic-no-pic
14163 @opindex mdynamic-no-pic
14164 On Darwin and Mac OS X systems, compile code so that it is not
14165 relocatable, but that its external references are relocatable.  The
14166 resulting code is suitable for applications, but not shared
14167 libraries.
14168
14169 @item -mprioritize-restricted-insns=@var{priority}
14170 @opindex mprioritize-restricted-insns
14171 This option controls the priority that is assigned to
14172 dispatch-slot restricted instructions during the second scheduling
14173 pass.  The argument @var{priority} takes the value @var{0/1/2} to assign
14174 @var{no/highest/second-highest} priority to dispatch slot restricted
14175 instructions.
14176
14177 @item -msched-costly-dep=@var{dependence_type}
14178 @opindex msched-costly-dep
14179 This option controls which dependences are considered costly
14180 by the target during instruction scheduling.  The argument
14181 @var{dependence_type} takes one of the following values:
14182 @var{no}: no dependence is costly,
14183 @var{all}: all dependences are costly,
14184 @var{true_store_to_load}: a true dependence from store to load is costly,
14185 @var{store_to_load}: any dependence from store to load is costly,
14186 @var{number}: any dependence which latency >= @var{number} is costly.
14187
14188 @item -minsert-sched-nops=@var{scheme}
14189 @opindex minsert-sched-nops
14190 This option controls which nop insertion scheme will be used during
14191 the second scheduling pass.  The argument @var{scheme} takes one of the
14192 following values:
14193 @var{no}: Don't insert nops.
14194 @var{pad}: Pad with nops any dispatch group which has vacant issue slots,
14195 according to the scheduler's grouping.
14196 @var{regroup_exact}: Insert nops to force costly dependent insns into
14197 separate groups.  Insert exactly as many nops as needed to force an insn
14198 to a new group, according to the estimated processor grouping.
14199 @var{number}: Insert nops to force costly dependent insns into
14200 separate groups.  Insert @var{number} nops to force an insn to a new group.
14201
14202 @item -mcall-sysv
14203 @opindex mcall-sysv
14204 On System V.4 and embedded PowerPC systems compile code using calling
14205 conventions that adheres to the March 1995 draft of the System V
14206 Application Binary Interface, PowerPC processor supplement.  This is the
14207 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
14208
14209 @item -mcall-sysv-eabi
14210 @opindex mcall-sysv-eabi
14211 Specify both @option{-mcall-sysv} and @option{-meabi} options.
14212
14213 @item -mcall-sysv-noeabi
14214 @opindex mcall-sysv-noeabi
14215 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
14216
14217 @item -mcall-solaris
14218 @opindex mcall-solaris
14219 On System V.4 and embedded PowerPC systems compile code for the Solaris
14220 operating system.
14221
14222 @item -mcall-linux
14223 @opindex mcall-linux
14224 On System V.4 and embedded PowerPC systems compile code for the
14225 Linux-based GNU system.
14226
14227 @item -mcall-gnu
14228 @opindex mcall-gnu
14229 On System V.4 and embedded PowerPC systems compile code for the
14230 Hurd-based GNU system.
14231
14232 @item -mcall-netbsd
14233 @opindex mcall-netbsd
14234 On System V.4 and embedded PowerPC systems compile code for the
14235 NetBSD operating system.
14236
14237 @item -maix-struct-return
14238 @opindex maix-struct-return
14239 Return all structures in memory (as specified by the AIX ABI)@.
14240
14241 @item -msvr4-struct-return
14242 @opindex msvr4-struct-return
14243 Return structures smaller than 8 bytes in registers (as specified by the
14244 SVR4 ABI)@.
14245
14246 @item -mabi=@var{abi-type}
14247 @opindex mabi
14248 Extend the current ABI with a particular extension, or remove such extension.
14249 Valid values are @var{altivec}, @var{no-altivec}, @var{spe},
14250 @var{no-spe}, @var{ibmlongdouble}, @var{ieeelongdouble}@.
14251
14252 @item -mabi=spe
14253 @opindex mabi=spe
14254 Extend the current ABI with SPE ABI extensions.  This does not change
14255 the default ABI, instead it adds the SPE ABI extensions to the current
14256 ABI@.
14257
14258 @item -mabi=no-spe
14259 @opindex mabi=no-spe
14260 Disable Booke SPE ABI extensions for the current ABI@.
14261
14262 @item -mabi=ibmlongdouble
14263 @opindex mabi=ibmlongdouble
14264 Change the current ABI to use IBM extended precision long double.
14265 This is a PowerPC 32-bit SYSV ABI option.
14266
14267 @item -mabi=ieeelongdouble
14268 @opindex mabi=ieeelongdouble
14269 Change the current ABI to use IEEE extended precision long double.
14270 This is a PowerPC 32-bit Linux ABI option.
14271
14272 @item -mprototype
14273 @itemx -mno-prototype
14274 @opindex mprototype
14275 @opindex mno-prototype
14276 On System V.4 and embedded PowerPC systems assume that all calls to
14277 variable argument functions are properly prototyped.  Otherwise, the
14278 compiler must insert an instruction before every non prototyped call to
14279 set or clear bit 6 of the condition code register (@var{CR}) to
14280 indicate whether floating point values were passed in the floating point
14281 registers in case the function takes a variable arguments.  With
14282 @option{-mprototype}, only calls to prototyped variable argument functions
14283 will set or clear the bit.
14284
14285 @item -msim
14286 @opindex msim
14287 On embedded PowerPC systems, assume that the startup module is called
14288 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
14289 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}
14290 configurations.
14291
14292 @item -mmvme
14293 @opindex mmvme
14294 On embedded PowerPC systems, assume that the startup module is called
14295 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
14296 @file{libc.a}.
14297
14298 @item -mads
14299 @opindex mads
14300 On embedded PowerPC systems, assume that the startup module is called
14301 @file{crt0.o} and the standard C libraries are @file{libads.a} and
14302 @file{libc.a}.
14303
14304 @item -myellowknife
14305 @opindex myellowknife
14306 On embedded PowerPC systems, assume that the startup module is called
14307 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
14308 @file{libc.a}.
14309
14310 @item -mvxworks
14311 @opindex mvxworks
14312 On System V.4 and embedded PowerPC systems, specify that you are
14313 compiling for a VxWorks system.
14314
14315 @item -memb
14316 @opindex memb
14317 On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
14318 header to indicate that @samp{eabi} extended relocations are used.
14319
14320 @item -meabi
14321 @itemx -mno-eabi
14322 @opindex meabi
14323 @opindex mno-eabi
14324 On System V.4 and embedded PowerPC systems do (do not) adhere to the
14325 Embedded Applications Binary Interface (eabi) which is a set of
14326 modifications to the System V.4 specifications.  Selecting @option{-meabi}
14327 means that the stack is aligned to an 8 byte boundary, a function
14328 @code{__eabi} is called to from @code{main} to set up the eabi
14329 environment, and the @option{-msdata} option can use both @code{r2} and
14330 @code{r13} to point to two separate small data areas.  Selecting
14331 @option{-mno-eabi} means that the stack is aligned to a 16 byte boundary,
14332 do not call an initialization function from @code{main}, and the
14333 @option{-msdata} option will only use @code{r13} to point to a single
14334 small data area.  The @option{-meabi} option is on by default if you
14335 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
14336
14337 @item -msdata=eabi
14338 @opindex msdata=eabi
14339 On System V.4 and embedded PowerPC systems, put small initialized
14340 @code{const} global and static data in the @samp{.sdata2} section, which
14341 is pointed to by register @code{r2}.  Put small initialized
14342 non-@code{const} global and static data in the @samp{.sdata} section,
14343 which is pointed to by register @code{r13}.  Put small uninitialized
14344 global and static data in the @samp{.sbss} section, which is adjacent to
14345 the @samp{.sdata} section.  The @option{-msdata=eabi} option is
14346 incompatible with the @option{-mrelocatable} option.  The
14347 @option{-msdata=eabi} option also sets the @option{-memb} option.
14348
14349 @item -msdata=sysv
14350 @opindex msdata=sysv
14351 On System V.4 and embedded PowerPC systems, put small global and static
14352 data in the @samp{.sdata} section, which is pointed to by register
14353 @code{r13}.  Put small uninitialized global and static data in the
14354 @samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
14355 The @option{-msdata=sysv} option is incompatible with the
14356 @option{-mrelocatable} option.
14357
14358 @item -msdata=default
14359 @itemx -msdata
14360 @opindex msdata=default
14361 @opindex msdata
14362 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
14363 compile code the same as @option{-msdata=eabi}, otherwise compile code the
14364 same as @option{-msdata=sysv}.
14365
14366 @item -msdata=data
14367 @opindex msdata=data
14368 On System V.4 and embedded PowerPC systems, put small global
14369 data in the @samp{.sdata} section.  Put small uninitialized global
14370 data in the @samp{.sbss} section.  Do not use register @code{r13}
14371 to address small data however.  This is the default behavior unless
14372 other @option{-msdata} options are used.
14373
14374 @item -msdata=none
14375 @itemx -mno-sdata
14376 @opindex msdata=none
14377 @opindex mno-sdata
14378 On embedded PowerPC systems, put all initialized global and static data
14379 in the @samp{.data} section, and all uninitialized data in the
14380 @samp{.bss} section.
14381
14382 @item -G @var{num}
14383 @opindex G
14384 @cindex smaller data references (PowerPC)
14385 @cindex .sdata/.sdata2 references (PowerPC)
14386 On embedded PowerPC systems, put global and static items less than or
14387 equal to @var{num} bytes into the small data or bss sections instead of
14388 the normal data or bss section.  By default, @var{num} is 8.  The
14389 @option{-G @var{num}} switch is also passed to the linker.
14390 All modules should be compiled with the same @option{-G @var{num}} value.
14391
14392 @item -mregnames
14393 @itemx -mno-regnames
14394 @opindex mregnames
14395 @opindex mno-regnames
14396 On System V.4 and embedded PowerPC systems do (do not) emit register
14397 names in the assembly language output using symbolic forms.
14398
14399 @item -mlongcall
14400 @itemx -mno-longcall
14401 @opindex mlongcall
14402 @opindex mno-longcall
14403 By default assume that all calls are far away so that a longer more
14404 expensive calling sequence is required.  This is required for calls
14405 further than 32 megabytes (33,554,432 bytes) from the current location.
14406 A short call will be generated if the compiler knows
14407 the call cannot be that far away.  This setting can be overridden by
14408 the @code{shortcall} function attribute, or by @code{#pragma
14409 longcall(0)}.
14410
14411 Some linkers are capable of detecting out-of-range calls and generating
14412 glue code on the fly.  On these systems, long calls are unnecessary and
14413 generate slower code.  As of this writing, the AIX linker can do this,
14414 as can the GNU linker for PowerPC/64.  It is planned to add this feature
14415 to the GNU linker for 32-bit PowerPC systems as well.
14416
14417 On Darwin/PPC systems, @code{#pragma longcall} will generate ``jbsr
14418 callee, L42'', plus a ``branch island'' (glue code).  The two target
14419 addresses represent the callee and the ``branch island''.  The
14420 Darwin/PPC linker will prefer the first address and generate a ``bl
14421 callee'' if the PPC ``bl'' instruction will reach the callee directly;
14422 otherwise, the linker will generate ``bl L42'' to call the ``branch
14423 island''.  The ``branch island'' is appended to the body of the
14424 calling function; it computes the full 32-bit address of the callee
14425 and jumps to it.
14426
14427 On Mach-O (Darwin) systems, this option directs the compiler emit to
14428 the glue for every direct call, and the Darwin linker decides whether
14429 to use or discard it.
14430
14431 In the future, we may cause GCC to ignore all longcall specifications
14432 when the linker is known to generate glue.
14433
14434 @item -mtls-markers
14435 @itemx -mno-tls-markers
14436 @opindex mtls-markers
14437 @opindex mno-tls-markers
14438 Mark (do not mark) calls to @code{__tls_get_addr} with a relocation
14439 specifying the function argument.  The relocation allows ld to
14440 reliably associate function call with argument setup instructions for
14441 TLS optimization, which in turn allows gcc to better schedule the
14442 sequence.
14443
14444 @item -pthread
14445 @opindex pthread
14446 Adds support for multithreading with the @dfn{pthreads} library.
14447 This option sets flags for both the preprocessor and linker.
14448
14449 @end table
14450
14451 @node S/390 and zSeries Options
14452 @subsection S/390 and zSeries Options
14453 @cindex S/390 and zSeries Options
14454
14455 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
14456
14457 @table @gcctabopt
14458 @item -mhard-float
14459 @itemx -msoft-float
14460 @opindex mhard-float
14461 @opindex msoft-float
14462 Use (do not use) the hardware floating-point instructions and registers
14463 for floating-point operations.  When @option{-msoft-float} is specified,
14464 functions in @file{libgcc.a} will be used to perform floating-point
14465 operations.  When @option{-mhard-float} is specified, the compiler
14466 generates IEEE floating-point instructions.  This is the default.
14467
14468 @item -mhard-dfp
14469 @itemx -mno-hard-dfp
14470 @opindex mhard-dfp
14471 @opindex mno-hard-dfp
14472 Use (do not use) the hardware decimal-floating-point instructions for
14473 decimal-floating-point operations.  When @option{-mno-hard-dfp} is
14474 specified, functions in @file{libgcc.a} will be used to perform
14475 decimal-floating-point operations.  When @option{-mhard-dfp} is
14476 specified, the compiler generates decimal-floating-point hardware
14477 instructions.  This is the default for @option{-march=z9-ec} or higher.
14478
14479 @item -mlong-double-64
14480 @itemx -mlong-double-128
14481 @opindex mlong-double-64
14482 @opindex mlong-double-128
14483 These switches control the size of @code{long double} type. A size
14484 of 64bit makes the @code{long double} type equivalent to the @code{double}
14485 type. This is the default.
14486
14487 @item -mbackchain
14488 @itemx -mno-backchain
14489 @opindex mbackchain
14490 @opindex mno-backchain
14491 Store (do not store) the address of the caller's frame as backchain pointer
14492 into the callee's stack frame.
14493 A backchain may be needed to allow debugging using tools that do not understand
14494 DWARF-2 call frame information.
14495 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
14496 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
14497 the backchain is placed into the topmost word of the 96/160 byte register
14498 save area.
14499
14500 In general, code compiled with @option{-mbackchain} is call-compatible with
14501 code compiled with @option{-mmo-backchain}; however, use of the backchain
14502 for debugging purposes usually requires that the whole binary is built with
14503 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
14504 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
14505 to build a linux kernel use @option{-msoft-float}.
14506
14507 The default is to not maintain the backchain.
14508
14509 @item -mpacked-stack
14510 @itemx -mno-packed-stack
14511 @opindex mpacked-stack
14512 @opindex mno-packed-stack
14513 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
14514 specified, the compiler uses the all fields of the 96/160 byte register save
14515 area only for their default purpose; unused fields still take up stack space.
14516 When @option{-mpacked-stack} is specified, register save slots are densely
14517 packed at the top of the register save area; unused space is reused for other
14518 purposes, allowing for more efficient use of the available stack space.
14519 However, when @option{-mbackchain} is also in effect, the topmost word of
14520 the save area is always used to store the backchain, and the return address
14521 register is always saved two words below the backchain.
14522
14523 As long as the stack frame backchain is not used, code generated with
14524 @option{-mpacked-stack} is call-compatible with code generated with
14525 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
14526 S/390 or zSeries generated code that uses the stack frame backchain at run
14527 time, not just for debugging purposes.  Such code is not call-compatible
14528 with code compiled with @option{-mpacked-stack}.  Also, note that the
14529 combination of @option{-mbackchain},
14530 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
14531 to build a linux kernel use @option{-msoft-float}.
14532
14533 The default is to not use the packed stack layout.
14534
14535 @item -msmall-exec
14536 @itemx -mno-small-exec
14537 @opindex msmall-exec
14538 @opindex mno-small-exec
14539 Generate (or do not generate) code using the @code{bras} instruction
14540 to do subroutine calls.
14541 This only works reliably if the total executable size does not
14542 exceed 64k.  The default is to use the @code{basr} instruction instead,
14543 which does not have this limitation.
14544
14545 @item -m64
14546 @itemx -m31
14547 @opindex m64
14548 @opindex m31
14549 When @option{-m31} is specified, generate code compliant to the
14550 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
14551 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
14552 particular to generate 64-bit instructions.  For the @samp{s390}
14553 targets, the default is @option{-m31}, while the @samp{s390x}
14554 targets default to @option{-m64}.
14555
14556 @item -mzarch
14557 @itemx -mesa
14558 @opindex mzarch
14559 @opindex mesa
14560 When @option{-mzarch} is specified, generate code using the
14561 instructions available on z/Architecture.
14562 When @option{-mesa} is specified, generate code using the
14563 instructions available on ESA/390.  Note that @option{-mesa} is
14564 not possible with @option{-m64}.
14565 When generating code compliant to the GNU/Linux for S/390 ABI,
14566 the default is @option{-mesa}.  When generating code compliant
14567 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
14568
14569 @item -mmvcle
14570 @itemx -mno-mvcle
14571 @opindex mmvcle
14572 @opindex mno-mvcle
14573 Generate (or do not generate) code using the @code{mvcle} instruction
14574 to perform block moves.  When @option{-mno-mvcle} is specified,
14575 use a @code{mvc} loop instead.  This is the default unless optimizing for
14576 size.
14577
14578 @item -mdebug
14579 @itemx -mno-debug
14580 @opindex mdebug
14581 @opindex mno-debug
14582 Print (or do not print) additional debug information when compiling.
14583 The default is to not print debug information.
14584
14585 @item -march=@var{cpu-type}
14586 @opindex march
14587 Generate code that will run on @var{cpu-type}, which is the name of a system
14588 representing a certain processor type.  Possible values for
14589 @var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, @samp{z990},
14590 @samp{z9-109}, @samp{z9-ec} and @samp{z10}.
14591 When generating code using the instructions available on z/Architecture,
14592 the default is @option{-march=z900}.  Otherwise, the default is
14593 @option{-march=g5}.
14594
14595 @item -mtune=@var{cpu-type}
14596 @opindex mtune
14597 Tune to @var{cpu-type} everything applicable about the generated code,
14598 except for the ABI and the set of available instructions.
14599 The list of @var{cpu-type} values is the same as for @option{-march}.
14600 The default is the value used for @option{-march}.
14601
14602 @item -mtpf-trace
14603 @itemx -mno-tpf-trace
14604 @opindex mtpf-trace
14605 @opindex mno-tpf-trace
14606 Generate code that adds (does not add) in TPF OS specific branches to trace
14607 routines in the operating system.  This option is off by default, even
14608 when compiling for the TPF OS@.
14609
14610 @item -mfused-madd
14611 @itemx -mno-fused-madd
14612 @opindex mfused-madd
14613 @opindex mno-fused-madd
14614 Generate code that uses (does not use) the floating point multiply and
14615 accumulate instructions.  These instructions are generated by default if
14616 hardware floating point is used.
14617
14618 @item -mwarn-framesize=@var{framesize}
14619 @opindex mwarn-framesize
14620 Emit a warning if the current function exceeds the given frame size.  Because
14621 this is a compile time check it doesn't need to be a real problem when the program
14622 runs.  It is intended to identify functions which most probably cause
14623 a stack overflow.  It is useful to be used in an environment with limited stack
14624 size e.g.@: the linux kernel.
14625
14626 @item -mwarn-dynamicstack
14627 @opindex mwarn-dynamicstack
14628 Emit a warning if the function calls alloca or uses dynamically
14629 sized arrays.  This is generally a bad idea with a limited stack size.
14630
14631 @item -mstack-guard=@var{stack-guard}
14632 @itemx -mstack-size=@var{stack-size}
14633 @opindex mstack-guard
14634 @opindex mstack-size
14635 If these options are provided the s390 back end emits additional instructions in
14636 the function prologue which trigger a trap if the stack size is @var{stack-guard}
14637 bytes above the @var{stack-size} (remember that the stack on s390 grows downward).
14638 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
14639 the frame size of the compiled function is chosen.
14640 These options are intended to be used to help debugging stack overflow problems.
14641 The additionally emitted code causes only little overhead and hence can also be
14642 used in production like systems without greater performance degradation.  The given
14643 values have to be exact powers of 2 and @var{stack-size} has to be greater than
14644 @var{stack-guard} without exceeding 64k.
14645 In order to be efficient the extra code makes the assumption that the stack starts
14646 at an address aligned to the value given by @var{stack-size}.
14647 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
14648 @end table
14649
14650 @node Score Options
14651 @subsection Score Options
14652 @cindex Score Options
14653
14654 These options are defined for Score implementations:
14655
14656 @table @gcctabopt
14657 @item -meb
14658 @opindex meb
14659 Compile code for big endian mode.  This is the default.
14660
14661 @item -mel
14662 @opindex mel
14663 Compile code for little endian mode. 
14664
14665 @item -mnhwloop
14666 @opindex mnhwloop
14667 Disable generate bcnz instruction.
14668
14669 @item -muls
14670 @opindex muls
14671 Enable generate unaligned load and store instruction.
14672
14673 @item -mmac
14674 @opindex mmac
14675 Enable the use of multiply-accumulate instructions. Disabled by default. 
14676
14677 @item -mscore5
14678 @opindex mscore5
14679 Specify the SCORE5 as the target architecture.
14680
14681 @item -mscore5u
14682 @opindex mscore5u
14683 Specify the SCORE5U of the target architecture.
14684
14685 @item -mscore7
14686 @opindex mscore7
14687 Specify the SCORE7 as the target architecture. This is the default.
14688
14689 @item -mscore7d
14690 @opindex mscore7d
14691 Specify the SCORE7D as the target architecture.
14692 @end table
14693
14694 @node SH Options
14695 @subsection SH Options
14696
14697 These @samp{-m} options are defined for the SH implementations:
14698
14699 @table @gcctabopt
14700 @item -m1
14701 @opindex m1
14702 Generate code for the SH1.
14703
14704 @item -m2
14705 @opindex m2
14706 Generate code for the SH2.
14707
14708 @item -m2e
14709 Generate code for the SH2e.
14710
14711 @item -m3
14712 @opindex m3
14713 Generate code for the SH3.
14714
14715 @item -m3e
14716 @opindex m3e
14717 Generate code for the SH3e.
14718
14719 @item -m4-nofpu
14720 @opindex m4-nofpu
14721 Generate code for the SH4 without a floating-point unit.
14722
14723 @item -m4-single-only
14724 @opindex m4-single-only
14725 Generate code for the SH4 with a floating-point unit that only
14726 supports single-precision arithmetic.
14727
14728 @item -m4-single
14729 @opindex m4-single
14730 Generate code for the SH4 assuming the floating-point unit is in
14731 single-precision mode by default.
14732
14733 @item -m4
14734 @opindex m4
14735 Generate code for the SH4.
14736
14737 @item -m4a-nofpu
14738 @opindex m4a-nofpu
14739 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
14740 floating-point unit is not used.
14741
14742 @item -m4a-single-only
14743 @opindex m4a-single-only
14744 Generate code for the SH4a, in such a way that no double-precision
14745 floating point operations are used.
14746
14747 @item -m4a-single
14748 @opindex m4a-single
14749 Generate code for the SH4a assuming the floating-point unit is in
14750 single-precision mode by default.
14751
14752 @item -m4a
14753 @opindex m4a
14754 Generate code for the SH4a.
14755
14756 @item -m4al
14757 @opindex m4al
14758 Same as @option{-m4a-nofpu}, except that it implicitly passes
14759 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
14760 instructions at the moment.
14761
14762 @item -mb
14763 @opindex mb
14764 Compile code for the processor in big endian mode.
14765
14766 @item -ml
14767 @opindex ml
14768 Compile code for the processor in little endian mode.
14769
14770 @item -mdalign
14771 @opindex mdalign
14772 Align doubles at 64-bit boundaries.  Note that this changes the calling
14773 conventions, and thus some functions from the standard C library will
14774 not work unless you recompile it first with @option{-mdalign}.
14775
14776 @item -mrelax
14777 @opindex mrelax
14778 Shorten some address references at link time, when possible; uses the
14779 linker option @option{-relax}.
14780
14781 @item -mbigtable
14782 @opindex mbigtable
14783 Use 32-bit offsets in @code{switch} tables.  The default is to use
14784 16-bit offsets.
14785
14786 @item -mbitops
14787 @opindex mbitops
14788 Enable the use of bit manipulation instructions on SH2A.
14789
14790 @item -mfmovd
14791 @opindex mfmovd
14792 Enable the use of the instruction @code{fmovd}.
14793
14794 @item -mhitachi
14795 @opindex mhitachi
14796 Comply with the calling conventions defined by Renesas.
14797
14798 @item -mrenesas
14799 @opindex mhitachi
14800 Comply with the calling conventions defined by Renesas.
14801
14802 @item -mno-renesas
14803 @opindex mhitachi
14804 Comply with the calling conventions defined for GCC before the Renesas
14805 conventions were available.  This option is the default for all
14806 targets of the SH toolchain except for @samp{sh-symbianelf}.
14807
14808 @item -mnomacsave
14809 @opindex mnomacsave
14810 Mark the @code{MAC} register as call-clobbered, even if
14811 @option{-mhitachi} is given.
14812
14813 @item -mieee
14814 @opindex mieee
14815 Increase IEEE-compliance of floating-point code.
14816 At the moment, this is equivalent to @option{-fno-finite-math-only}.
14817 When generating 16 bit SH opcodes, getting IEEE-conforming results for
14818 comparisons of NANs / infinities incurs extra overhead in every
14819 floating point comparison, therefore the default is set to
14820 @option{-ffinite-math-only}.
14821
14822 @item -minline-ic_invalidate
14823 @opindex minline-ic_invalidate
14824 Inline code to invalidate instruction cache entries after setting up
14825 nested function trampolines.
14826 This option has no effect if -musermode is in effect and the selected
14827 code generation option (e.g. -m4) does not allow the use of the icbi
14828 instruction.
14829 If the selected code generation option does not allow the use of the icbi
14830 instruction, and -musermode is not in effect, the inlined code will
14831 manipulate the instruction cache address array directly with an associative
14832 write.  This not only requires privileged mode, but it will also
14833 fail if the cache line had been mapped via the TLB and has become unmapped.
14834
14835 @item -misize
14836 @opindex misize
14837 Dump instruction size and location in the assembly code.
14838
14839 @item -mpadstruct
14840 @opindex mpadstruct
14841 This option is deprecated.  It pads structures to multiple of 4 bytes,
14842 which is incompatible with the SH ABI@.
14843
14844 @item -mspace
14845 @opindex mspace
14846 Optimize for space instead of speed.  Implied by @option{-Os}.
14847
14848 @item -mprefergot
14849 @opindex mprefergot
14850 When generating position-independent code, emit function calls using
14851 the Global Offset Table instead of the Procedure Linkage Table.
14852
14853 @item -musermode
14854 @opindex musermode
14855 Don't generate privileged mode only code; implies -mno-inline-ic_invalidate
14856 if the inlined code would not work in user mode.
14857 This is the default when the target is @code{sh-*-linux*}.
14858
14859 @item -multcost=@var{number}
14860 @opindex multcost=@var{number}
14861 Set the cost to assume for a multiply insn.
14862
14863 @item -mdiv=@var{strategy}
14864 @opindex mdiv=@var{strategy}
14865 Set the division strategy to use for SHmedia code.  @var{strategy} must be
14866 one of: call, call2, fp, inv, inv:minlat, inv20u, inv20l, inv:call,
14867 inv:call2, inv:fp .
14868 "fp" performs the operation in floating point.  This has a very high latency,
14869 but needs only a few instructions, so it might be a good choice if
14870 your code has enough easily exploitable ILP to allow the compiler to
14871 schedule the floating point instructions together with other instructions.
14872 Division by zero causes a floating point exception.
14873 "inv" uses integer operations to calculate the inverse of the divisor,
14874 and then multiplies the dividend with the inverse.  This strategy allows
14875 cse and hoisting of the inverse calculation.  Division by zero calculates
14876 an unspecified result, but does not trap.
14877 "inv:minlat" is a variant of "inv" where if no cse / hoisting opportunities
14878 have been found, or if the entire operation has been hoisted to the same
14879 place, the last stages of the inverse calculation are intertwined with the
14880 final multiply to reduce the overall latency, at the expense of using a few
14881 more instructions, and thus offering fewer scheduling opportunities with
14882 other code.
14883 "call" calls a library function that usually implements the inv:minlat
14884 strategy.
14885 This gives high code density for m5-*media-nofpu compilations.
14886 "call2" uses a different entry point of the same library function, where it
14887 assumes that a pointer to a lookup table has already been set up, which
14888 exposes the pointer load to cse / code hoisting optimizations.
14889 "inv:call", "inv:call2" and "inv:fp" all use the "inv" algorithm for initial
14890 code generation, but if the code stays unoptimized, revert to the "call",
14891 "call2", or "fp" strategies, respectively.  Note that the
14892 potentially-trapping side effect of division by zero is carried by a
14893 separate instruction, so it is possible that all the integer instructions
14894 are hoisted out, but the marker for the side effect stays where it is.
14895 A recombination to fp operations or a call is not possible in that case.
14896 "inv20u" and "inv20l" are variants of the "inv:minlat" strategy.  In the case
14897 that the inverse calculation was nor separated from the multiply, they speed
14898 up division where the dividend fits into 20 bits (plus sign where applicable),
14899 by inserting a test to skip a number of operations in this case; this test
14900 slows down the case of larger dividends.  inv20u assumes the case of a such
14901 a small dividend to be unlikely, and inv20l assumes it to be likely.
14902
14903 @item -mdivsi3_libfunc=@var{name}
14904 @opindex mdivsi3_libfunc=@var{name}
14905 Set the name of the library function used for 32 bit signed division to
14906 @var{name}.  This only affect the name used in the call and inv:call
14907 division strategies, and the compiler will still expect the same
14908 sets of input/output/clobbered registers as if this option was not present.
14909
14910 @item -mfixed-range=@var{register-range}
14911 @opindex mfixed-range
14912 Generate code treating the given register range as fixed registers.
14913 A fixed register is one that the register allocator can not use.  This is
14914 useful when compiling kernel code.  A register range is specified as
14915 two registers separated by a dash.  Multiple register ranges can be
14916 specified separated by a comma.
14917
14918 @item -madjust-unroll
14919 @opindex madjust-unroll
14920 Throttle unrolling to avoid thrashing target registers.
14921 This option only has an effect if the gcc code base supports the
14922 TARGET_ADJUST_UNROLL_MAX target hook.
14923
14924 @item -mindexed-addressing
14925 @opindex mindexed-addressing
14926 Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
14927 This is only safe if the hardware and/or OS implement 32 bit wrap-around
14928 semantics for the indexed addressing mode.  The architecture allows the
14929 implementation of processors with 64 bit MMU, which the OS could use to
14930 get 32 bit addressing, but since no current hardware implementation supports
14931 this or any other way to make the indexed addressing mode safe to use in
14932 the 32 bit ABI, the default is -mno-indexed-addressing.
14933
14934 @item -mgettrcost=@var{number}
14935 @opindex mgettrcost=@var{number}
14936 Set the cost assumed for the gettr instruction to @var{number}.
14937 The default is 2 if @option{-mpt-fixed} is in effect, 100 otherwise.
14938
14939 @item -mpt-fixed
14940 @opindex mpt-fixed
14941 Assume pt* instructions won't trap.  This will generally generate better
14942 scheduled code, but is unsafe on current hardware.  The current architecture
14943 definition says that ptabs and ptrel trap when the target anded with 3 is 3.
14944 This has the unintentional effect of making it unsafe to schedule ptabs /
14945 ptrel before a branch, or hoist it out of a loop.  For example,
14946 __do_global_ctors, a part of libgcc that runs constructors at program
14947 startup, calls functions in a list which is delimited by @minus{}1.  With the
14948 -mpt-fixed option, the ptabs will be done before testing against @minus{}1.
14949 That means that all the constructors will be run a bit quicker, but when
14950 the loop comes to the end of the list, the program crashes because ptabs
14951 loads @minus{}1 into a target register.  Since this option is unsafe for any
14952 hardware implementing the current architecture specification, the default
14953 is -mno-pt-fixed.  Unless the user specifies a specific cost with
14954 @option{-mgettrcost}, -mno-pt-fixed also implies @option{-mgettrcost=100};
14955 this deters register allocation using target registers for storing
14956 ordinary integers.
14957
14958 @item -minvalid-symbols
14959 @opindex minvalid-symbols
14960 Assume symbols might be invalid.  Ordinary function symbols generated by
14961 the compiler will always be valid to load with movi/shori/ptabs or
14962 movi/shori/ptrel, but with assembler and/or linker tricks it is possible
14963 to generate symbols that will cause ptabs / ptrel to trap.
14964 This option is only meaningful when @option{-mno-pt-fixed} is in effect.
14965 It will then prevent cross-basic-block cse, hoisting and most scheduling
14966 of symbol loads.  The default is @option{-mno-invalid-symbols}.
14967 @end table
14968
14969 @node SPARC Options
14970 @subsection SPARC Options
14971 @cindex SPARC options
14972
14973 These @samp{-m} options are supported on the SPARC:
14974
14975 @table @gcctabopt
14976 @item -mno-app-regs
14977 @itemx -mapp-regs
14978 @opindex mno-app-regs
14979 @opindex mapp-regs
14980 Specify @option{-mapp-regs} to generate output using the global registers
14981 2 through 4, which the SPARC SVR4 ABI reserves for applications.  This
14982 is the default.
14983
14984 To be fully SVR4 ABI compliant at the cost of some performance loss,
14985 specify @option{-mno-app-regs}.  You should compile libraries and system
14986 software with this option.
14987
14988 @item -mfpu
14989 @itemx -mhard-float
14990 @opindex mfpu
14991 @opindex mhard-float
14992 Generate output containing floating point instructions.  This is the
14993 default.
14994
14995 @item -mno-fpu
14996 @itemx -msoft-float
14997 @opindex mno-fpu
14998 @opindex msoft-float
14999 Generate output containing library calls for floating point.
15000 @strong{Warning:} the requisite libraries are not available for all SPARC
15001 targets.  Normally the facilities of the machine's usual C compiler are
15002 used, but this cannot be done directly in cross-compilation.  You must make
15003 your own arrangements to provide suitable library functions for
15004 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
15005 @samp{sparclite-*-*} do provide software floating point support.
15006
15007 @option{-msoft-float} changes the calling convention in the output file;
15008 therefore, it is only useful if you compile @emph{all} of a program with
15009 this option.  In particular, you need to compile @file{libgcc.a}, the
15010 library that comes with GCC, with @option{-msoft-float} in order for
15011 this to work.
15012
15013 @item -mhard-quad-float
15014 @opindex mhard-quad-float
15015 Generate output containing quad-word (long double) floating point
15016 instructions.
15017
15018 @item -msoft-quad-float
15019 @opindex msoft-quad-float
15020 Generate output containing library calls for quad-word (long double)
15021 floating point instructions.  The functions called are those specified
15022 in the SPARC ABI@.  This is the default.
15023
15024 As of this writing, there are no SPARC implementations that have hardware
15025 support for the quad-word floating point instructions.  They all invoke
15026 a trap handler for one of these instructions, and then the trap handler
15027 emulates the effect of the instruction.  Because of the trap handler overhead,
15028 this is much slower than calling the ABI library routines.  Thus the
15029 @option{-msoft-quad-float} option is the default.
15030
15031 @item -mno-unaligned-doubles
15032 @itemx -munaligned-doubles
15033 @opindex mno-unaligned-doubles
15034 @opindex munaligned-doubles
15035 Assume that doubles have 8 byte alignment.  This is the default.
15036
15037 With @option{-munaligned-doubles}, GCC assumes that doubles have 8 byte
15038 alignment only if they are contained in another type, or if they have an
15039 absolute address.  Otherwise, it assumes they have 4 byte alignment.
15040 Specifying this option avoids some rare compatibility problems with code
15041 generated by other compilers.  It is not the default because it results
15042 in a performance loss, especially for floating point code.
15043
15044 @item -mno-faster-structs
15045 @itemx -mfaster-structs
15046 @opindex mno-faster-structs
15047 @opindex mfaster-structs
15048 With @option{-mfaster-structs}, the compiler assumes that structures
15049 should have 8 byte alignment.  This enables the use of pairs of
15050 @code{ldd} and @code{std} instructions for copies in structure
15051 assignment, in place of twice as many @code{ld} and @code{st} pairs.
15052 However, the use of this changed alignment directly violates the SPARC
15053 ABI@.  Thus, it's intended only for use on targets where the developer
15054 acknowledges that their resulting code will not be directly in line with
15055 the rules of the ABI@.
15056
15057 @item -mimpure-text
15058 @opindex mimpure-text
15059 @option{-mimpure-text}, used in addition to @option{-shared}, tells
15060 the compiler to not pass @option{-z text} to the linker when linking a
15061 shared object.  Using this option, you can link position-dependent
15062 code into a shared object.
15063
15064 @option{-mimpure-text} suppresses the ``relocations remain against
15065 allocatable but non-writable sections'' linker error message.
15066 However, the necessary relocations will trigger copy-on-write, and the
15067 shared object is not actually shared across processes.  Instead of
15068 using @option{-mimpure-text}, you should compile all source code with
15069 @option{-fpic} or @option{-fPIC}.
15070
15071 This option is only available on SunOS and Solaris.
15072
15073 @item -mcpu=@var{cpu_type}
15074 @opindex mcpu
15075 Set the instruction set, register set, and instruction scheduling parameters
15076 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
15077 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{sparclite},
15078 @samp{f930}, @samp{f934}, @samp{hypersparc}, @samp{sparclite86x},
15079 @samp{sparclet}, @samp{tsc701}, @samp{v9}, @samp{ultrasparc},
15080 @samp{ultrasparc3}, @samp{niagara} and @samp{niagara2}.
15081
15082 Default instruction scheduling parameters are used for values that select
15083 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
15084 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
15085
15086 Here is a list of each supported architecture and their supported
15087 implementations.
15088
15089 @smallexample
15090     v7:             cypress
15091     v8:             supersparc, hypersparc
15092     sparclite:      f930, f934, sparclite86x
15093     sparclet:       tsc701
15094     v9:             ultrasparc, ultrasparc3, niagara, niagara2
15095 @end smallexample
15096
15097 By default (unless configured otherwise), GCC generates code for the V7
15098 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
15099 additionally optimizes it for the Cypress CY7C602 chip, as used in the
15100 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
15101 SPARCStation 1, 2, IPX etc.
15102
15103 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
15104 architecture.  The only difference from V7 code is that the compiler emits
15105 the integer multiply and integer divide instructions which exist in SPARC-V8
15106 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
15107 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
15108 2000 series.
15109
15110 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
15111 the SPARC architecture.  This adds the integer multiply, integer divide step
15112 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
15113 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
15114 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
15115 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
15116 MB86934 chip, which is the more recent SPARClite with FPU@.
15117
15118 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
15119 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
15120 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
15121 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
15122 optimizes it for the TEMIC SPARClet chip.
15123
15124 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
15125 architecture.  This adds 64-bit integer and floating-point move instructions,
15126 3 additional floating-point condition code registers and conditional move
15127 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
15128 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
15129 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
15130 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
15131 @option{-mcpu=niagara}, the compiler additionally optimizes it for
15132 Sun UltraSPARC T1 chips.  With @option{-mcpu=niagara2}, the compiler
15133 additionally optimizes it for Sun UltraSPARC T2 chips.
15134
15135 @item -mtune=@var{cpu_type}
15136 @opindex mtune
15137 Set the instruction scheduling parameters for machine type
15138 @var{cpu_type}, but do not set the instruction set or register set that the
15139 option @option{-mcpu=@var{cpu_type}} would.
15140
15141 The same values for @option{-mcpu=@var{cpu_type}} can be used for
15142 @option{-mtune=@var{cpu_type}}, but the only useful values are those
15143 that select a particular cpu implementation.  Those are @samp{cypress},
15144 @samp{supersparc}, @samp{hypersparc}, @samp{f930}, @samp{f934},
15145 @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc},
15146 @samp{ultrasparc3}, @samp{niagara}, and @samp{niagara2}.
15147
15148 @item -mv8plus
15149 @itemx -mno-v8plus
15150 @opindex mv8plus
15151 @opindex mno-v8plus
15152 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
15153 difference from the V8 ABI is that the global and out registers are
15154 considered 64-bit wide.  This is enabled by default on Solaris in 32-bit
15155 mode for all SPARC-V9 processors.
15156
15157 @item -mvis
15158 @itemx -mno-vis
15159 @opindex mvis
15160 @opindex mno-vis
15161 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
15162 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
15163 @end table
15164
15165 These @samp{-m} options are supported in addition to the above
15166 on SPARC-V9 processors in 64-bit environments:
15167
15168 @table @gcctabopt
15169 @item -mlittle-endian
15170 @opindex mlittle-endian
15171 Generate code for a processor running in little-endian mode.  It is only
15172 available for a few configurations and most notably not on Solaris and Linux.
15173
15174 @item -m32
15175 @itemx -m64
15176 @opindex m32
15177 @opindex m64
15178 Generate code for a 32-bit or 64-bit environment.
15179 The 32-bit environment sets int, long and pointer to 32 bits.
15180 The 64-bit environment sets int to 32 bits and long and pointer
15181 to 64 bits.
15182
15183 @item -mcmodel=medlow
15184 @opindex mcmodel=medlow
15185 Generate code for the Medium/Low code model: 64-bit addresses, programs
15186 must be linked in the low 32 bits of memory.  Programs can be statically
15187 or dynamically linked.
15188
15189 @item -mcmodel=medmid
15190 @opindex mcmodel=medmid
15191 Generate code for the Medium/Middle code model: 64-bit addresses, programs
15192 must be linked in the low 44 bits of memory, the text and data segments must
15193 be less than 2GB in size and the data segment must be located within 2GB of
15194 the text segment.
15195
15196 @item -mcmodel=medany
15197 @opindex mcmodel=medany
15198 Generate code for the Medium/Anywhere code model: 64-bit addresses, programs
15199 may be linked anywhere in memory, the text and data segments must be less
15200 than 2GB in size and the data segment must be located within 2GB of the
15201 text segment.
15202
15203 @item -mcmodel=embmedany
15204 @opindex mcmodel=embmedany
15205 Generate code for the Medium/Anywhere code model for embedded systems:
15206 64-bit addresses, the text and data segments must be less than 2GB in
15207 size, both starting anywhere in memory (determined at link time).  The
15208 global register %g4 points to the base of the data segment.  Programs
15209 are statically linked and PIC is not supported.
15210
15211 @item -mstack-bias
15212 @itemx -mno-stack-bias
15213 @opindex mstack-bias
15214 @opindex mno-stack-bias
15215 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
15216 frame pointer if present, are offset by @minus{}2047 which must be added back
15217 when making stack frame references.  This is the default in 64-bit mode.
15218 Otherwise, assume no such offset is present.
15219 @end table
15220
15221 These switches are supported in addition to the above on Solaris:
15222
15223 @table @gcctabopt
15224 @item -threads
15225 @opindex threads
15226 Add support for multithreading using the Solaris threads library.  This
15227 option sets flags for both the preprocessor and linker.  This option does
15228 not affect the thread safety of object code produced by the compiler or
15229 that of libraries supplied with it.
15230
15231 @item -pthreads
15232 @opindex pthreads
15233 Add support for multithreading using the POSIX threads library.  This
15234 option sets flags for both the preprocessor and linker.  This option does
15235 not affect the thread safety of object code produced  by the compiler or
15236 that of libraries supplied with it.
15237
15238 @item -pthread
15239 @opindex pthread
15240 This is a synonym for @option{-pthreads}.
15241 @end table
15242
15243 @node SPU Options
15244 @subsection SPU Options
15245 @cindex SPU options
15246
15247 These @samp{-m} options are supported on the SPU:
15248
15249 @table @gcctabopt
15250 @item -mwarn-reloc
15251 @itemx -merror-reloc
15252 @opindex mwarn-reloc
15253 @opindex merror-reloc
15254
15255 The loader for SPU does not handle dynamic relocations.  By default, GCC
15256 will give an error when it generates code that requires a dynamic
15257 relocation.  @option{-mno-error-reloc} disables the error,
15258 @option{-mwarn-reloc} will generate a warning instead.
15259
15260 @item -msafe-dma
15261 @itemx -munsafe-dma
15262 @opindex msafe-dma
15263 @opindex munsafe-dma
15264
15265 Instructions which initiate or test completion of DMA must not be
15266 reordered with respect to loads and stores of the memory which is being
15267 accessed.  Users typically address this problem using the volatile
15268 keyword, but that can lead to inefficient code in places where the
15269 memory is known to not change.  Rather than mark the memory as volatile
15270 we treat the DMA instructions as potentially effecting all memory.  With
15271 @option{-munsafe-dma} users must use the volatile keyword to protect
15272 memory accesses.
15273
15274 @item -mbranch-hints
15275 @opindex mbranch-hints
15276
15277 By default, GCC will generate a branch hint instruction to avoid
15278 pipeline stalls for always taken or probably taken branches.  A hint
15279 will not be generated closer than 8 instructions away from its branch.
15280 There is little reason to disable them, except for debugging purposes,
15281 or to make an object a little bit smaller.
15282
15283 @item -msmall-mem
15284 @itemx -mlarge-mem
15285 @opindex msmall-mem
15286 @opindex mlarge-mem
15287
15288 By default, GCC generates code assuming that addresses are never larger
15289 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
15290 a full 32 bit address.
15291
15292 @item -mstdmain
15293 @opindex mstdmain
15294
15295 By default, GCC links against startup code that assumes the SPU-style
15296 main function interface (which has an unconventional parameter list).
15297 With @option{-mstdmain}, GCC will link your program against startup
15298 code that assumes a C99-style interface to @code{main}, including a
15299 local copy of @code{argv} strings.
15300
15301 @item -mfixed-range=@var{register-range}
15302 @opindex mfixed-range
15303 Generate code treating the given register range as fixed registers.
15304 A fixed register is one that the register allocator can not use.  This is
15305 useful when compiling kernel code.  A register range is specified as
15306 two registers separated by a dash.  Multiple register ranges can be
15307 specified separated by a comma.
15308
15309 @item -mdual-nops
15310 @itemx -mdual-nops=@var{n}
15311 @opindex mdual-nops
15312 By default, GCC will insert nops to increase dual issue when it expects
15313 it to increase performance.  @var{n} can be a value from 0 to 10.  A
15314 smaller @var{n} will insert fewer nops.  10 is the default, 0 is the
15315 same as @option{-mno-dual-nops}.  Disabled with @option{-Os}.
15316
15317 @item -mhint-max-nops=@var{n}
15318 @opindex mhint-max-nops
15319 Maximum number of nops to insert for a branch hint.  A branch hint must
15320 be at least 8 instructions away from the branch it is effecting.  GCC
15321 will insert up to @var{n} nops to enforce this, otherwise it will not
15322 generate the branch hint.
15323
15324 @item -mhint-max-distance=@var{n}
15325 @opindex mhint-max-distance
15326 The encoding of the branch hint instruction limits the hint to be within
15327 256 instructions of the branch it is effecting.  By default, GCC makes
15328 sure it is within 125. 
15329
15330 @item -msafe-hints
15331 @opindex msafe-hints
15332 Work around a hardware bug which causes the SPU to stall indefinitely.
15333 By default, GCC will insert the @code{hbrp} instruction to make sure
15334 this stall won't happen.
15335
15336 @end table
15337
15338 @node System V Options
15339 @subsection Options for System V
15340
15341 These additional options are available on System V Release 4 for
15342 compatibility with other compilers on those systems:
15343
15344 @table @gcctabopt
15345 @item -G
15346 @opindex G
15347 Create a shared object.
15348 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
15349
15350 @item -Qy
15351 @opindex Qy
15352 Identify the versions of each tool used by the compiler, in a
15353 @code{.ident} assembler directive in the output.
15354
15355 @item -Qn
15356 @opindex Qn
15357 Refrain from adding @code{.ident} directives to the output file (this is
15358 the default).
15359
15360 @item -YP,@var{dirs}
15361 @opindex YP
15362 Search the directories @var{dirs}, and no others, for libraries
15363 specified with @option{-l}.
15364
15365 @item -Ym,@var{dir}
15366 @opindex Ym
15367 Look in the directory @var{dir} to find the M4 preprocessor.
15368 The assembler uses this option.
15369 @c This is supposed to go with a -Yd for predefined M4 macro files, but
15370 @c the generic assembler that comes with Solaris takes just -Ym.
15371 @end table
15372
15373 @node V850 Options
15374 @subsection V850 Options
15375 @cindex V850 Options
15376
15377 These @samp{-m} options are defined for V850 implementations:
15378
15379 @table @gcctabopt
15380 @item -mlong-calls
15381 @itemx -mno-long-calls
15382 @opindex mlong-calls
15383 @opindex mno-long-calls
15384 Treat all calls as being far away (near).  If calls are assumed to be
15385 far away, the compiler will always load the functions address up into a
15386 register, and call indirect through the pointer.
15387
15388 @item -mno-ep
15389 @itemx -mep
15390 @opindex mno-ep
15391 @opindex mep
15392 Do not optimize (do optimize) basic blocks that use the same index
15393 pointer 4 or more times to copy pointer into the @code{ep} register, and
15394 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
15395 option is on by default if you optimize.
15396
15397 @item -mno-prolog-function
15398 @itemx -mprolog-function
15399 @opindex mno-prolog-function
15400 @opindex mprolog-function
15401 Do not use (do use) external functions to save and restore registers
15402 at the prologue and epilogue of a function.  The external functions
15403 are slower, but use less code space if more than one function saves
15404 the same number of registers.  The @option{-mprolog-function} option
15405 is on by default if you optimize.
15406
15407 @item -mspace
15408 @opindex mspace
15409 Try to make the code as small as possible.  At present, this just turns
15410 on the @option{-mep} and @option{-mprolog-function} options.
15411
15412 @item -mtda=@var{n}
15413 @opindex mtda
15414 Put static or global variables whose size is @var{n} bytes or less into
15415 the tiny data area that register @code{ep} points to.  The tiny data
15416 area can hold up to 256 bytes in total (128 bytes for byte references).
15417
15418 @item -msda=@var{n}
15419 @opindex msda
15420 Put static or global variables whose size is @var{n} bytes or less into
15421 the small data area that register @code{gp} points to.  The small data
15422 area can hold up to 64 kilobytes.
15423
15424 @item -mzda=@var{n}
15425 @opindex mzda
15426 Put static or global variables whose size is @var{n} bytes or less into
15427 the first 32 kilobytes of memory.
15428
15429 @item -mv850
15430 @opindex mv850
15431 Specify that the target processor is the V850.
15432
15433 @item -mbig-switch
15434 @opindex mbig-switch
15435 Generate code suitable for big switch tables.  Use this option only if
15436 the assembler/linker complain about out of range branches within a switch
15437 table.
15438
15439 @item -mapp-regs
15440 @opindex mapp-regs
15441 This option will cause r2 and r5 to be used in the code generated by
15442 the compiler.  This setting is the default.
15443
15444 @item -mno-app-regs
15445 @opindex mno-app-regs
15446 This option will cause r2 and r5 to be treated as fixed registers.
15447
15448 @item -mv850e1
15449 @opindex mv850e1
15450 Specify that the target processor is the V850E1.  The preprocessor
15451 constants @samp{__v850e1__} and @samp{__v850e__} will be defined if
15452 this option is used.
15453
15454 @item -mv850e
15455 @opindex mv850e
15456 Specify that the target processor is the V850E@.  The preprocessor
15457 constant @samp{__v850e__} will be defined if this option is used.
15458
15459 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
15460 are defined then a default target processor will be chosen and the
15461 relevant @samp{__v850*__} preprocessor constant will be defined.
15462
15463 The preprocessor constants @samp{__v850} and @samp{__v851__} are always
15464 defined, regardless of which processor variant is the target.
15465
15466 @item -mdisable-callt
15467 @opindex mdisable-callt
15468 This option will suppress generation of the CALLT instruction for the
15469 v850e and v850e1 flavors of the v850 architecture.  The default is
15470 @option{-mno-disable-callt} which allows the CALLT instruction to be used.
15471
15472 @end table
15473
15474 @node VAX Options
15475 @subsection VAX Options
15476 @cindex VAX options
15477
15478 These @samp{-m} options are defined for the VAX:
15479
15480 @table @gcctabopt
15481 @item -munix
15482 @opindex munix
15483 Do not output certain jump instructions (@code{aobleq} and so on)
15484 that the Unix assembler for the VAX cannot handle across long
15485 ranges.
15486
15487 @item -mgnu
15488 @opindex mgnu
15489 Do output those jump instructions, on the assumption that you
15490 will assemble with the GNU assembler.
15491
15492 @item -mg
15493 @opindex mg
15494 Output code for g-format floating point numbers instead of d-format.
15495 @end table
15496
15497 @node VxWorks Options
15498 @subsection VxWorks Options
15499 @cindex VxWorks Options
15500
15501 The options in this section are defined for all VxWorks targets.
15502 Options specific to the target hardware are listed with the other
15503 options for that target.
15504
15505 @table @gcctabopt
15506 @item -mrtp
15507 @opindex mrtp
15508 GCC can generate code for both VxWorks kernels and real time processes
15509 (RTPs).  This option switches from the former to the latter.  It also
15510 defines the preprocessor macro @code{__RTP__}.
15511
15512 @item -non-static
15513 @opindex non-static
15514 Link an RTP executable against shared libraries rather than static
15515 libraries.  The options @option{-static} and @option{-shared} can
15516 also be used for RTPs (@pxref{Link Options}); @option{-static}
15517 is the default.
15518
15519 @item -Bstatic
15520 @itemx -Bdynamic
15521 @opindex Bstatic
15522 @opindex Bdynamic
15523 These options are passed down to the linker.  They are defined for
15524 compatibility with Diab.
15525
15526 @item -Xbind-lazy
15527 @opindex Xbind-lazy
15528 Enable lazy binding of function calls.  This option is equivalent to
15529 @option{-Wl,-z,now} and is defined for compatibility with Diab.
15530
15531 @item -Xbind-now
15532 @opindex Xbind-now
15533 Disable lazy binding of function calls.  This option is the default and
15534 is defined for compatibility with Diab.
15535 @end table
15536
15537 @node x86-64 Options
15538 @subsection x86-64 Options
15539 @cindex x86-64 options
15540
15541 These are listed under @xref{i386 and x86-64 Options}.
15542
15543 @node i386 and x86-64 Windows Options
15544 @subsection i386 and x86-64 Windows Options
15545 @cindex i386 and x86-64 Windows Options
15546
15547 These additional options are available for Windows targets:
15548
15549 @table @gcctabopt
15550 @item -mconsole
15551 @opindex mconsole
15552 This option is available for Cygwin and MinGW targets.  It
15553 specifies that a console application is to be generated, by
15554 instructing the linker to set the PE header subsystem type
15555 required for console applications.
15556 This is the default behaviour for Cygwin and MinGW targets.
15557
15558 @item -mcygwin
15559 @opindex mcygwin
15560 This option is available for Cygwin targets.  It specifies that
15561 the Cygwin internal interface is to be used for predefined
15562 preprocessor macros, C runtime libraries and related linker
15563 paths and options.  For Cygwin targets this is the default behaviour.
15564 This option is deprecated and will be removed in a future release.
15565
15566 @item -mno-cygwin
15567 @opindex mno-cygwin
15568 This option is available for Cygwin targets.  It specifies that
15569 the MinGW internal interface is to be used instead of Cygwin's, by
15570 setting MinGW-related predefined macros and linker paths and default
15571 library options.
15572 This option is deprecated and will be removed in a future release.
15573
15574 @item -mdll
15575 @opindex mdll
15576 This option is available for Cygwin and MinGW targets.  It
15577 specifies that a DLL - a dynamic link library - is to be
15578 generated, enabling the selection of the required runtime
15579 startup object and entry point.
15580
15581 @item -mnop-fun-dllimport
15582 @opindex mnop-fun-dllimport
15583 This option is available for Cygwin and MinGW targets.  It
15584 specifies that the dllimport attribute should be ignored.
15585
15586 @item -mthread
15587 @opindex mthread
15588 This option is available for MinGW targets. It specifies
15589 that MinGW-specific thread support is to be used.
15590
15591 @item -mwin32
15592 @opindex mwin32
15593 This option is available for Cygwin and MinGW targets.  It
15594 specifies that the typical Windows pre-defined macros are to
15595 be set in the pre-processor, but does not influence the choice
15596 of runtime library/startup code.
15597
15598 @item -mwindows
15599 @opindex mwindows
15600 This option is available for Cygwin and MinGW targets.  It
15601 specifies that a GUI application is to be generated by
15602 instructing the linker to set the PE header subsystem type
15603 appropriately.
15604 @end table
15605
15606 See also under @ref{i386 and x86-64 Options} for standard options.
15607
15608 @node Xstormy16 Options
15609 @subsection Xstormy16 Options
15610 @cindex Xstormy16 Options
15611
15612 These options are defined for Xstormy16:
15613
15614 @table @gcctabopt
15615 @item -msim
15616 @opindex msim
15617 Choose startup files and linker script suitable for the simulator.
15618 @end table
15619
15620 @node Xtensa Options
15621 @subsection Xtensa Options
15622 @cindex Xtensa Options
15623
15624 These options are supported for Xtensa targets:
15625
15626 @table @gcctabopt
15627 @item -mconst16
15628 @itemx -mno-const16
15629 @opindex mconst16
15630 @opindex mno-const16
15631 Enable or disable use of @code{CONST16} instructions for loading
15632 constant values.  The @code{CONST16} instruction is currently not a
15633 standard option from Tensilica.  When enabled, @code{CONST16}
15634 instructions are always used in place of the standard @code{L32R}
15635 instructions.  The use of @code{CONST16} is enabled by default only if
15636 the @code{L32R} instruction is not available.
15637
15638 @item -mfused-madd
15639 @itemx -mno-fused-madd
15640 @opindex mfused-madd
15641 @opindex mno-fused-madd
15642 Enable or disable use of fused multiply/add and multiply/subtract
15643 instructions in the floating-point option.  This has no effect if the
15644 floating-point option is not also enabled.  Disabling fused multiply/add
15645 and multiply/subtract instructions forces the compiler to use separate
15646 instructions for the multiply and add/subtract operations.  This may be
15647 desirable in some cases where strict IEEE 754-compliant results are
15648 required: the fused multiply add/subtract instructions do not round the
15649 intermediate result, thereby producing results with @emph{more} bits of
15650 precision than specified by the IEEE standard.  Disabling fused multiply
15651 add/subtract instructions also ensures that the program output is not
15652 sensitive to the compiler's ability to combine multiply and add/subtract
15653 operations.
15654
15655 @item -mserialize-volatile
15656 @itemx -mno-serialize-volatile
15657 @opindex mserialize-volatile
15658 @opindex mno-serialize-volatile
15659 When this option is enabled, GCC inserts @code{MEMW} instructions before
15660 @code{volatile} memory references to guarantee sequential consistency.
15661 The default is @option{-mserialize-volatile}.  Use
15662 @option{-mno-serialize-volatile} to omit the @code{MEMW} instructions.
15663
15664 @item -mtext-section-literals
15665 @itemx -mno-text-section-literals
15666 @opindex mtext-section-literals
15667 @opindex mno-text-section-literals
15668 Control the treatment of literal pools.  The default is
15669 @option{-mno-text-section-literals}, which places literals in a separate
15670 section in the output file.  This allows the literal pool to be placed
15671 in a data RAM/ROM, and it also allows the linker to combine literal
15672 pools from separate object files to remove redundant literals and
15673 improve code size.  With @option{-mtext-section-literals}, the literals
15674 are interspersed in the text section in order to keep them as close as
15675 possible to their references.  This may be necessary for large assembly
15676 files.
15677
15678 @item -mtarget-align
15679 @itemx -mno-target-align
15680 @opindex mtarget-align
15681 @opindex mno-target-align
15682 When this option is enabled, GCC instructs the assembler to
15683 automatically align instructions to reduce branch penalties at the
15684 expense of some code density.  The assembler attempts to widen density
15685 instructions to align branch targets and the instructions following call
15686 instructions.  If there are not enough preceding safe density
15687 instructions to align a target, no widening will be performed.  The
15688 default is @option{-mtarget-align}.  These options do not affect the
15689 treatment of auto-aligned instructions like @code{LOOP}, which the
15690 assembler will always align, either by widening density instructions or
15691 by inserting no-op instructions.
15692
15693 @item -mlongcalls
15694 @itemx -mno-longcalls
15695 @opindex mlongcalls
15696 @opindex mno-longcalls
15697 When this option is enabled, GCC instructs the assembler to translate
15698 direct calls to indirect calls unless it can determine that the target
15699 of a direct call is in the range allowed by the call instruction.  This
15700 translation typically occurs for calls to functions in other source
15701 files.  Specifically, the assembler translates a direct @code{CALL}
15702 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
15703 The default is @option{-mno-longcalls}.  This option should be used in
15704 programs where the call target can potentially be out of range.  This
15705 option is implemented in the assembler, not the compiler, so the
15706 assembly code generated by GCC will still show direct call
15707 instructions---look at the disassembled object code to see the actual
15708 instructions.  Note that the assembler will use an indirect call for
15709 every cross-file call, not just those that really will be out of range.
15710 @end table
15711
15712 @node zSeries Options
15713 @subsection zSeries Options
15714 @cindex zSeries options
15715
15716 These are listed under @xref{S/390 and zSeries Options}.
15717
15718 @node Code Gen Options
15719 @section Options for Code Generation Conventions
15720 @cindex code generation conventions
15721 @cindex options, code generation
15722 @cindex run-time options
15723
15724 These machine-independent options control the interface conventions
15725 used in code generation.
15726
15727 Most of them have both positive and negative forms; the negative form
15728 of @option{-ffoo} would be @option{-fno-foo}.  In the table below, only
15729 one of the forms is listed---the one which is not the default.  You
15730 can figure out the other form by either removing @samp{no-} or adding
15731 it.
15732
15733 @table @gcctabopt
15734 @item -fbounds-check
15735 @opindex fbounds-check
15736 For front-ends that support it, generate additional code to check that
15737 indices used to access arrays are within the declared range.  This is
15738 currently only supported by the Java and Fortran front-ends, where
15739 this option defaults to true and false respectively.
15740
15741 @item -ftrapv
15742 @opindex ftrapv
15743 This option generates traps for signed overflow on addition, subtraction,
15744 multiplication operations.
15745
15746 @item -fwrapv
15747 @opindex fwrapv
15748 This option instructs the compiler to assume that signed arithmetic
15749 overflow of addition, subtraction and multiplication wraps around
15750 using twos-complement representation.  This flag enables some optimizations
15751 and disables others.  This option is enabled by default for the Java
15752 front-end, as required by the Java language specification.
15753
15754 @item -fexceptions
15755 @opindex fexceptions
15756 Enable exception handling.  Generates extra code needed to propagate
15757 exceptions.  For some targets, this implies GCC will generate frame
15758 unwind information for all functions, which can produce significant data
15759 size overhead, although it does not affect execution.  If you do not
15760 specify this option, GCC will enable it by default for languages like
15761 C++ which normally require exception handling, and disable it for
15762 languages like C that do not normally require it.  However, you may need
15763 to enable this option when compiling C code that needs to interoperate
15764 properly with exception handlers written in C++.  You may also wish to
15765 disable this option if you are compiling older C++ programs that don't
15766 use exception handling.
15767
15768 @item -fnon-call-exceptions
15769 @opindex fnon-call-exceptions
15770 Generate code that allows trapping instructions to throw exceptions.
15771 Note that this requires platform-specific runtime support that does
15772 not exist everywhere.  Moreover, it only allows @emph{trapping}
15773 instructions to throw exceptions, i.e.@: memory references or floating
15774 point instructions.  It does not allow exceptions to be thrown from
15775 arbitrary signal handlers such as @code{SIGALRM}.
15776
15777 @item -funwind-tables
15778 @opindex funwind-tables
15779 Similar to @option{-fexceptions}, except that it will just generate any needed
15780 static data, but will not affect the generated code in any other way.
15781 You will normally not enable this option; instead, a language processor
15782 that needs this handling would enable it on your behalf.
15783
15784 @item -fasynchronous-unwind-tables
15785 @opindex fasynchronous-unwind-tables
15786 Generate unwind table in dwarf2 format, if supported by target machine.  The
15787 table is exact at each instruction boundary, so it can be used for stack
15788 unwinding from asynchronous events (such as debugger or garbage collector).
15789
15790 @item -fpcc-struct-return
15791 @opindex fpcc-struct-return
15792 Return ``short'' @code{struct} and @code{union} values in memory like
15793 longer ones, rather than in registers.  This convention is less
15794 efficient, but it has the advantage of allowing intercallability between
15795 GCC-compiled files and files compiled with other compilers, particularly
15796 the Portable C Compiler (pcc).
15797
15798 The precise convention for returning structures in memory depends
15799 on the target configuration macros.
15800
15801 Short structures and unions are those whose size and alignment match
15802 that of some integer type.
15803
15804 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
15805 switch is not binary compatible with code compiled with the
15806 @option{-freg-struct-return} switch.
15807 Use it to conform to a non-default application binary interface.
15808
15809 @item -freg-struct-return
15810 @opindex freg-struct-return
15811 Return @code{struct} and @code{union} values in registers when possible.
15812 This is more efficient for small structures than
15813 @option{-fpcc-struct-return}.
15814
15815 If you specify neither @option{-fpcc-struct-return} nor
15816 @option{-freg-struct-return}, GCC defaults to whichever convention is
15817 standard for the target.  If there is no standard convention, GCC
15818 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
15819 the principal compiler.  In those cases, we can choose the standard, and
15820 we chose the more efficient register return alternative.
15821
15822 @strong{Warning:} code compiled with the @option{-freg-struct-return}
15823 switch is not binary compatible with code compiled with the
15824 @option{-fpcc-struct-return} switch.
15825 Use it to conform to a non-default application binary interface.
15826
15827 @item -fshort-enums
15828 @opindex fshort-enums
15829 Allocate to an @code{enum} type only as many bytes as it needs for the
15830 declared range of possible values.  Specifically, the @code{enum} type
15831 will be equivalent to the smallest integer type which has enough room.
15832
15833 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
15834 code that is not binary compatible with code generated without that switch.
15835 Use it to conform to a non-default application binary interface.
15836
15837 @item -fshort-double
15838 @opindex fshort-double
15839 Use the same size for @code{double} as for @code{float}.
15840
15841 @strong{Warning:} the @option{-fshort-double} switch causes GCC to generate
15842 code that is not binary compatible with code generated without that switch.
15843 Use it to conform to a non-default application binary interface.
15844
15845 @item -fshort-wchar
15846 @opindex fshort-wchar
15847 Override the underlying type for @samp{wchar_t} to be @samp{short
15848 unsigned int} instead of the default for the target.  This option is
15849 useful for building programs to run under WINE@.
15850
15851 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
15852 code that is not binary compatible with code generated without that switch.
15853 Use it to conform to a non-default application binary interface.
15854
15855 @item -fno-common
15856 @opindex fno-common
15857 In C code, controls the placement of uninitialized global variables.
15858 Unix C compilers have traditionally permitted multiple definitions of
15859 such variables in different compilation units by placing the variables
15860 in a common block.  
15861 This is the behavior specified by @option{-fcommon}, and is the default 
15862 for GCC on most targets.  
15863 On the other hand, this behavior is not required by ISO C, and on some
15864 targets may carry a speed or code size penalty on variable references.
15865 The @option{-fno-common} option specifies that the compiler should place 
15866 uninitialized global variables in the data section of the object file,
15867 rather than generating them as common blocks.
15868 This has the effect that if the same variable is declared 
15869 (without @code{extern}) in two different compilations,
15870 you will get a multiple-definition error when you link them.
15871 In this case, you must compile with @option{-fcommon} instead.  
15872 Compiling with @option{-fno-common} is useful on targets for which 
15873 it provides better performance, or if you wish to verify that the
15874 program will work on other systems which always treat uninitialized
15875 variable declarations this way.
15876
15877 @item -fno-ident
15878 @opindex fno-ident
15879 Ignore the @samp{#ident} directive.
15880
15881 @item -finhibit-size-directive
15882 @opindex finhibit-size-directive
15883 Don't output a @code{.size} assembler directive, or anything else that
15884 would cause trouble if the function is split in the middle, and the
15885 two halves are placed at locations far apart in memory.  This option is
15886 used when compiling @file{crtstuff.c}; you should not need to use it
15887 for anything else.
15888
15889 @item -fverbose-asm
15890 @opindex fverbose-asm
15891 Put extra commentary information in the generated assembly code to
15892 make it more readable.  This option is generally only of use to those
15893 who actually need to read the generated assembly code (perhaps while
15894 debugging the compiler itself).
15895
15896 @option{-fno-verbose-asm}, the default, causes the
15897 extra information to be omitted and is useful when comparing two assembler
15898 files.
15899
15900 @item -frecord-gcc-switches
15901 @opindex frecord-gcc-switches
15902 This switch causes the command line that was used to invoke the
15903 compiler to be recorded into the object file that is being created.
15904 This switch is only implemented on some targets and the exact format
15905 of the recording is target and binary file format dependent, but it
15906 usually takes the form of a section containing ASCII text.  This
15907 switch is related to the @option{-fverbose-asm} switch, but that
15908 switch only records information in the assembler output file as
15909 comments, so it never reaches the object file.
15910
15911 @item -fpic
15912 @opindex fpic
15913 @cindex global offset table
15914 @cindex PIC
15915 Generate position-independent code (PIC) suitable for use in a shared
15916 library, if supported for the target machine.  Such code accesses all
15917 constant addresses through a global offset table (GOT)@.  The dynamic
15918 loader resolves the GOT entries when the program starts (the dynamic
15919 loader is not part of GCC; it is part of the operating system).  If
15920 the GOT size for the linked executable exceeds a machine-specific
15921 maximum size, you get an error message from the linker indicating that
15922 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
15923 instead.  (These maximums are 8k on the SPARC and 32k
15924 on the m68k and RS/6000.  The 386 has no such limit.)
15925
15926 Position-independent code requires special support, and therefore works
15927 only on certain machines.  For the 386, GCC supports PIC for System V
15928 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
15929 position-independent.
15930
15931 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
15932 are defined to 1.
15933
15934 @item -fPIC
15935 @opindex fPIC
15936 If supported for the target machine, emit position-independent code,
15937 suitable for dynamic linking and avoiding any limit on the size of the
15938 global offset table.  This option makes a difference on the m68k,
15939 PowerPC and SPARC@.
15940
15941 Position-independent code requires special support, and therefore works
15942 only on certain machines.
15943
15944 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
15945 are defined to 2.
15946
15947 @item -fpie
15948 @itemx -fPIE
15949 @opindex fpie
15950 @opindex fPIE
15951 These options are similar to @option{-fpic} and @option{-fPIC}, but
15952 generated position independent code can be only linked into executables.
15953 Usually these options are used when @option{-pie} GCC option will be
15954 used during linking.
15955
15956 @option{-fpie} and @option{-fPIE} both define the macros
15957 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
15958 for @option{-fpie} and 2 for @option{-fPIE}.
15959
15960 @item -fno-jump-tables
15961 @opindex fno-jump-tables
15962 Do not use jump tables for switch statements even where it would be
15963 more efficient than other code generation strategies.  This option is
15964 of use in conjunction with @option{-fpic} or @option{-fPIC} for
15965 building code which forms part of a dynamic linker and cannot
15966 reference the address of a jump table.  On some targets, jump tables
15967 do not require a GOT and this option is not needed.
15968
15969 @item -ffixed-@var{reg}
15970 @opindex ffixed
15971 Treat the register named @var{reg} as a fixed register; generated code
15972 should never refer to it (except perhaps as a stack pointer, frame
15973 pointer or in some other fixed role).
15974
15975 @var{reg} must be the name of a register.  The register names accepted
15976 are machine-specific and are defined in the @code{REGISTER_NAMES}
15977 macro in the machine description macro file.
15978
15979 This flag does not have a negative form, because it specifies a
15980 three-way choice.
15981
15982 @item -fcall-used-@var{reg}
15983 @opindex fcall-used
15984 Treat the register named @var{reg} as an allocable register that is
15985 clobbered by function calls.  It may be allocated for temporaries or
15986 variables that do not live across a call.  Functions compiled this way
15987 will not save and restore the register @var{reg}.
15988
15989 It is an error to used this flag with the frame pointer or stack pointer.
15990 Use of this flag for other registers that have fixed pervasive roles in
15991 the machine's execution model will produce disastrous results.
15992
15993 This flag does not have a negative form, because it specifies a
15994 three-way choice.
15995
15996 @item -fcall-saved-@var{reg}
15997 @opindex fcall-saved
15998 Treat the register named @var{reg} as an allocable register saved by
15999 functions.  It may be allocated even for temporaries or variables that
16000 live across a call.  Functions compiled this way will save and restore
16001 the register @var{reg} if they use it.
16002
16003 It is an error to used this flag with the frame pointer or stack pointer.
16004 Use of this flag for other registers that have fixed pervasive roles in
16005 the machine's execution model will produce disastrous results.
16006
16007 A different sort of disaster will result from the use of this flag for
16008 a register in which function values may be returned.
16009
16010 This flag does not have a negative form, because it specifies a
16011 three-way choice.
16012
16013 @item -fpack-struct[=@var{n}]
16014 @opindex fpack-struct
16015 Without a value specified, pack all structure members together without
16016 holes.  When a value is specified (which must be a small power of two), pack
16017 structure members according to this value, representing the maximum
16018 alignment (that is, objects with default alignment requirements larger than
16019 this will be output potentially unaligned at the next fitting location.
16020
16021 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
16022 code that is not binary compatible with code generated without that switch.
16023 Additionally, it makes the code suboptimal.
16024 Use it to conform to a non-default application binary interface.
16025
16026 @item -finstrument-functions
16027 @opindex finstrument-functions
16028 Generate instrumentation calls for entry and exit to functions.  Just
16029 after function entry and just before function exit, the following
16030 profiling functions will be called with the address of the current
16031 function and its call site.  (On some platforms,
16032 @code{__builtin_return_address} does not work beyond the current
16033 function, so the call site information may not be available to the
16034 profiling functions otherwise.)
16035
16036 @smallexample
16037 void __cyg_profile_func_enter (void *this_fn,
16038                                void *call_site);
16039 void __cyg_profile_func_exit  (void *this_fn,
16040                                void *call_site);
16041 @end smallexample
16042
16043 The first argument is the address of the start of the current function,
16044 which may be looked up exactly in the symbol table.
16045
16046 This instrumentation is also done for functions expanded inline in other
16047 functions.  The profiling calls will indicate where, conceptually, the
16048 inline function is entered and exited.  This means that addressable
16049 versions of such functions must be available.  If all your uses of a
16050 function are expanded inline, this may mean an additional expansion of
16051 code size.  If you use @samp{extern inline} in your C code, an
16052 addressable version of such functions must be provided.  (This is
16053 normally the case anyways, but if you get lucky and the optimizer always
16054 expands the functions inline, you might have gotten away without
16055 providing static copies.)
16056
16057 A function may be given the attribute @code{no_instrument_function}, in
16058 which case this instrumentation will not be done.  This can be used, for
16059 example, for the profiling functions listed above, high-priority
16060 interrupt routines, and any functions from which the profiling functions
16061 cannot safely be called (perhaps signal handlers, if the profiling
16062 routines generate output or allocate memory).
16063
16064 @item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
16065 @opindex finstrument-functions-exclude-file-list
16066
16067 Set the list of functions that are excluded from instrumentation (see
16068 the description of @code{-finstrument-functions}).  If the file that
16069 contains a function definition matches with one of @var{file}, then
16070 that function is not instrumented.  The match is done on substrings:
16071 if the @var{file} parameter is a substring of the file name, it is
16072 considered to be a match.
16073
16074 For example,
16075 @code{-finstrument-functions-exclude-file-list=/bits/stl,include/sys}
16076 will exclude any inline function defined in files whose pathnames
16077 contain @code{/bits/stl} or @code{include/sys}.
16078
16079 If, for some reason, you want to include letter @code{','} in one of
16080 @var{sym}, write @code{'\,'}. For example,
16081 @code{-finstrument-functions-exclude-file-list='\,\,tmp'}
16082 (note the single quote surrounding the option).
16083
16084 @item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{}
16085 @opindex finstrument-functions-exclude-function-list
16086
16087 This is similar to @code{-finstrument-functions-exclude-file-list},
16088 but this option sets the list of function names to be excluded from
16089 instrumentation.  The function name to be matched is its user-visible
16090 name, such as @code{vector<int> blah(const vector<int> &)}, not the
16091 internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}).  The
16092 match is done on substrings: if the @var{sym} parameter is a substring
16093 of the function name, it is considered to be a match.
16094
16095 @item -fstack-check
16096 @opindex fstack-check
16097 Generate code to verify that you do not go beyond the boundary of the
16098 stack.  You should specify this flag if you are running in an
16099 environment with multiple threads, but only rarely need to specify it in
16100 a single-threaded environment since stack overflow is automatically
16101 detected on nearly all systems if there is only one stack.
16102
16103 Note that this switch does not actually cause checking to be done; the
16104 operating system or the language runtime must do that.  The switch causes
16105 generation of code to ensure that they see the stack being extended.
16106
16107 You can additionally specify a string parameter: @code{no} means no
16108 checking, @code{generic} means force the use of old-style checking,
16109 @code{specific} means use the best checking method and is equivalent
16110 to bare @option{-fstack-check}.
16111
16112 Old-style checking is a generic mechanism that requires no specific
16113 target support in the compiler but comes with the following drawbacks:
16114
16115 @enumerate
16116 @item
16117 Modified allocation strategy for large objects: they will always be
16118 allocated dynamically if their size exceeds a fixed threshold.
16119
16120 @item
16121 Fixed limit on the size of the static frame of functions: when it is
16122 topped by a particular function, stack checking is not reliable and
16123 a warning is issued by the compiler.
16124
16125 @item
16126 Inefficiency: because of both the modified allocation strategy and the
16127 generic implementation, the performances of the code are hampered.
16128 @end enumerate
16129
16130 Note that old-style stack checking is also the fallback method for
16131 @code{specific} if no target support has been added in the compiler.
16132
16133 @item -fstack-limit-register=@var{reg}
16134 @itemx -fstack-limit-symbol=@var{sym}
16135 @itemx -fno-stack-limit
16136 @opindex fstack-limit-register
16137 @opindex fstack-limit-symbol
16138 @opindex fno-stack-limit
16139 Generate code to ensure that the stack does not grow beyond a certain value,
16140 either the value of a register or the address of a symbol.  If the stack
16141 would grow beyond the value, a signal is raised.  For most targets,
16142 the signal is raised before the stack overruns the boundary, so
16143 it is possible to catch the signal without taking special precautions.
16144
16145 For instance, if the stack starts at absolute address @samp{0x80000000}
16146 and grows downwards, you can use the flags
16147 @option{-fstack-limit-symbol=__stack_limit} and
16148 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
16149 of 128KB@.  Note that this may only work with the GNU linker.
16150
16151 @cindex aliasing of parameters
16152 @cindex parameters, aliased
16153 @item -fargument-alias
16154 @itemx -fargument-noalias
16155 @itemx -fargument-noalias-global
16156 @itemx -fargument-noalias-anything
16157 @opindex fargument-alias
16158 @opindex fargument-noalias
16159 @opindex fargument-noalias-global
16160 @opindex fargument-noalias-anything
16161 Specify the possible relationships among parameters and between
16162 parameters and global data.
16163
16164 @option{-fargument-alias} specifies that arguments (parameters) may
16165 alias each other and may alias global storage.@*
16166 @option{-fargument-noalias} specifies that arguments do not alias
16167 each other, but may alias global storage.@*
16168 @option{-fargument-noalias-global} specifies that arguments do not
16169 alias each other and do not alias global storage.
16170 @option{-fargument-noalias-anything} specifies that arguments do not
16171 alias any other storage.
16172
16173 Each language will automatically use whatever option is required by
16174 the language standard.  You should not need to use these options yourself.
16175
16176 @item -fleading-underscore
16177 @opindex fleading-underscore
16178 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
16179 change the way C symbols are represented in the object file.  One use
16180 is to help link with legacy assembly code.
16181
16182 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
16183 generate code that is not binary compatible with code generated without that
16184 switch.  Use it to conform to a non-default application binary interface.
16185 Not all targets provide complete support for this switch.
16186
16187 @item -ftls-model=@var{model}
16188 @opindex ftls-model
16189 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
16190 The @var{model} argument should be one of @code{global-dynamic},
16191 @code{local-dynamic}, @code{initial-exec} or @code{local-exec}.
16192
16193 The default without @option{-fpic} is @code{initial-exec}; with
16194 @option{-fpic} the default is @code{global-dynamic}.
16195
16196 @item -fvisibility=@var{default|internal|hidden|protected}
16197 @opindex fvisibility
16198 Set the default ELF image symbol visibility to the specified option---all
16199 symbols will be marked with this unless overridden within the code.
16200 Using this feature can very substantially improve linking and
16201 load times of shared object libraries, produce more optimized
16202 code, provide near-perfect API export and prevent symbol clashes.
16203 It is @strong{strongly} recommended that you use this in any shared objects
16204 you distribute.
16205
16206 Despite the nomenclature, @code{default} always means public ie;
16207 available to be linked against from outside the shared object.
16208 @code{protected} and @code{internal} are pretty useless in real-world
16209 usage so the only other commonly used option will be @code{hidden}.
16210 The default if @option{-fvisibility} isn't specified is
16211 @code{default}, i.e., make every
16212 symbol public---this causes the same behavior as previous versions of
16213 GCC@.
16214
16215 A good explanation of the benefits offered by ensuring ELF
16216 symbols have the correct visibility is given by ``How To Write
16217 Shared Libraries'' by Ulrich Drepper (which can be found at
16218 @w{@uref{http://people.redhat.com/~drepper/}})---however a superior
16219 solution made possible by this option to marking things hidden when
16220 the default is public is to make the default hidden and mark things
16221 public.  This is the norm with DLL's on Windows and with @option{-fvisibility=hidden}
16222 and @code{__attribute__ ((visibility("default")))} instead of
16223 @code{__declspec(dllexport)} you get almost identical semantics with
16224 identical syntax.  This is a great boon to those working with
16225 cross-platform projects.
16226
16227 For those adding visibility support to existing code, you may find
16228 @samp{#pragma GCC visibility} of use.  This works by you enclosing
16229 the declarations you wish to set visibility for with (for example)
16230 @samp{#pragma GCC visibility push(hidden)} and
16231 @samp{#pragma GCC visibility pop}.
16232 Bear in mind that symbol visibility should be viewed @strong{as
16233 part of the API interface contract} and thus all new code should
16234 always specify visibility when it is not the default ie; declarations
16235 only for use within the local DSO should @strong{always} be marked explicitly
16236 as hidden as so to avoid PLT indirection overheads---making this
16237 abundantly clear also aids readability and self-documentation of the code.
16238 Note that due to ISO C++ specification requirements, operator new and
16239 operator delete must always be of default visibility.
16240
16241 Be aware that headers from outside your project, in particular system
16242 headers and headers from any other library you use, may not be
16243 expecting to be compiled with visibility other than the default.  You
16244 may need to explicitly say @samp{#pragma GCC visibility push(default)}
16245 before including any such headers.
16246
16247 @samp{extern} declarations are not affected by @samp{-fvisibility}, so
16248 a lot of code can be recompiled with @samp{-fvisibility=hidden} with
16249 no modifications.  However, this means that calls to @samp{extern}
16250 functions with no explicit visibility will use the PLT, so it is more
16251 effective to use @samp{__attribute ((visibility))} and/or
16252 @samp{#pragma GCC visibility} to tell the compiler which @samp{extern}
16253 declarations should be treated as hidden.
16254
16255 Note that @samp{-fvisibility} does affect C++ vague linkage
16256 entities. This means that, for instance, an exception class that will
16257 be thrown between DSOs must be explicitly marked with default
16258 visibility so that the @samp{type_info} nodes will be unified between
16259 the DSOs.
16260
16261 An overview of these techniques, their benefits and how to use them
16262 is at @w{@uref{http://gcc.gnu.org/wiki/Visibility}}.
16263
16264 @end table
16265
16266 @c man end
16267
16268 @node Environment Variables
16269 @section Environment Variables Affecting GCC
16270 @cindex environment variables
16271
16272 @c man begin ENVIRONMENT
16273 This section describes several environment variables that affect how GCC
16274 operates.  Some of them work by specifying directories or prefixes to use
16275 when searching for various kinds of files.  Some are used to specify other
16276 aspects of the compilation environment.
16277
16278 Note that you can also specify places to search using options such as
16279 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
16280 take precedence over places specified using environment variables, which
16281 in turn take precedence over those specified by the configuration of GCC@.
16282 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
16283 GNU Compiler Collection (GCC) Internals}.
16284
16285 @table @env
16286 @item LANG
16287 @itemx LC_CTYPE
16288 @c @itemx LC_COLLATE
16289 @itemx LC_MESSAGES
16290 @c @itemx LC_MONETARY
16291 @c @itemx LC_NUMERIC
16292 @c @itemx LC_TIME
16293 @itemx LC_ALL
16294 @findex LANG
16295 @findex LC_CTYPE
16296 @c @findex LC_COLLATE
16297 @findex LC_MESSAGES
16298 @c @findex LC_MONETARY
16299 @c @findex LC_NUMERIC
16300 @c @findex LC_TIME
16301 @findex LC_ALL
16302 @cindex locale
16303 These environment variables control the way that GCC uses
16304 localization information that allow GCC to work with different
16305 national conventions.  GCC inspects the locale categories
16306 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
16307 so.  These locale categories can be set to any value supported by your
16308 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
16309 Kingdom encoded in UTF-8.
16310
16311 The @env{LC_CTYPE} environment variable specifies character
16312 classification.  GCC uses it to determine the character boundaries in
16313 a string; this is needed for some multibyte encodings that contain quote
16314 and escape characters that would otherwise be interpreted as a string
16315 end or escape.
16316
16317 The @env{LC_MESSAGES} environment variable specifies the language to
16318 use in diagnostic messages.
16319
16320 If the @env{LC_ALL} environment variable is set, it overrides the value
16321 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
16322 and @env{LC_MESSAGES} default to the value of the @env{LANG}
16323 environment variable.  If none of these variables are set, GCC
16324 defaults to traditional C English behavior.
16325
16326 @item TMPDIR
16327 @findex TMPDIR
16328 If @env{TMPDIR} is set, it specifies the directory to use for temporary
16329 files.  GCC uses temporary files to hold the output of one stage of
16330 compilation which is to be used as input to the next stage: for example,
16331 the output of the preprocessor, which is the input to the compiler
16332 proper.
16333
16334 @item GCC_EXEC_PREFIX
16335 @findex GCC_EXEC_PREFIX
16336 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
16337 names of the subprograms executed by the compiler.  No slash is added
16338 when this prefix is combined with the name of a subprogram, but you can
16339 specify a prefix that ends with a slash if you wish.
16340
16341 If @env{GCC_EXEC_PREFIX} is not set, GCC will attempt to figure out
16342 an appropriate prefix to use based on the pathname it was invoked with.
16343
16344 If GCC cannot find the subprogram using the specified prefix, it
16345 tries looking in the usual places for the subprogram.
16346
16347 The default value of @env{GCC_EXEC_PREFIX} is
16348 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
16349 the installed compiler. In many cases @var{prefix} is the value
16350 of @code{prefix} when you ran the @file{configure} script.
16351
16352 Other prefixes specified with @option{-B} take precedence over this prefix.
16353
16354 This prefix is also used for finding files such as @file{crt0.o} that are
16355 used for linking.
16356
16357 In addition, the prefix is used in an unusual way in finding the
16358 directories to search for header files.  For each of the standard
16359 directories whose name normally begins with @samp{/usr/local/lib/gcc}
16360 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
16361 replacing that beginning with the specified prefix to produce an
16362 alternate directory name.  Thus, with @option{-Bfoo/}, GCC will search
16363 @file{foo/bar} where it would normally search @file{/usr/local/lib/bar}.
16364 These alternate directories are searched first; the standard directories
16365 come next. If a standard directory begins with the configured
16366 @var{prefix} then the value of @var{prefix} is replaced by
16367 @env{GCC_EXEC_PREFIX} when looking for header files.
16368
16369 @item COMPILER_PATH
16370 @findex COMPILER_PATH
16371 The value of @env{COMPILER_PATH} is a colon-separated list of
16372 directories, much like @env{PATH}.  GCC tries the directories thus
16373 specified when searching for subprograms, if it can't find the
16374 subprograms using @env{GCC_EXEC_PREFIX}.
16375
16376 @item LIBRARY_PATH
16377 @findex LIBRARY_PATH
16378 The value of @env{LIBRARY_PATH} is a colon-separated list of
16379 directories, much like @env{PATH}.  When configured as a native compiler,
16380 GCC tries the directories thus specified when searching for special
16381 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
16382 using GCC also uses these directories when searching for ordinary
16383 libraries for the @option{-l} option (but directories specified with
16384 @option{-L} come first).
16385
16386 @item LANG
16387 @findex LANG
16388 @cindex locale definition
16389 This variable is used to pass locale information to the compiler.  One way in
16390 which this information is used is to determine the character set to be used
16391 when character literals, string literals and comments are parsed in C and C++.
16392 When the compiler is configured to allow multibyte characters,
16393 the following values for @env{LANG} are recognized:
16394
16395 @table @samp
16396 @item C-JIS
16397 Recognize JIS characters.
16398 @item C-SJIS
16399 Recognize SJIS characters.
16400 @item C-EUCJP
16401 Recognize EUCJP characters.
16402 @end table
16403
16404 If @env{LANG} is not defined, or if it has some other value, then the
16405 compiler will use mblen and mbtowc as defined by the default locale to
16406 recognize and translate multibyte characters.
16407 @end table
16408
16409 @noindent
16410 Some additional environments variables affect the behavior of the
16411 preprocessor.
16412
16413 @include cppenv.texi
16414
16415 @c man end
16416
16417 @node Precompiled Headers
16418 @section Using Precompiled Headers
16419 @cindex precompiled headers
16420 @cindex speed of compilation
16421
16422 Often large projects have many header files that are included in every
16423 source file.  The time the compiler takes to process these header files
16424 over and over again can account for nearly all of the time required to
16425 build the project.  To make builds faster, GCC allows users to
16426 `precompile' a header file; then, if builds can use the precompiled
16427 header file they will be much faster.
16428
16429 To create a precompiled header file, simply compile it as you would any
16430 other file, if necessary using the @option{-x} option to make the driver
16431 treat it as a C or C++ header file.  You will probably want to use a
16432 tool like @command{make} to keep the precompiled header up-to-date when
16433 the headers it contains change.
16434
16435 A precompiled header file will be searched for when @code{#include} is
16436 seen in the compilation.  As it searches for the included file
16437 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
16438 compiler looks for a precompiled header in each directory just before it
16439 looks for the include file in that directory.  The name searched for is
16440 the name specified in the @code{#include} with @samp{.gch} appended.  If
16441 the precompiled header file can't be used, it is ignored.
16442
16443 For instance, if you have @code{#include "all.h"}, and you have
16444 @file{all.h.gch} in the same directory as @file{all.h}, then the
16445 precompiled header file will be used if possible, and the original
16446 header will be used otherwise.
16447
16448 Alternatively, you might decide to put the precompiled header file in a
16449 directory and use @option{-I} to ensure that directory is searched
16450 before (or instead of) the directory containing the original header.
16451 Then, if you want to check that the precompiled header file is always
16452 used, you can put a file of the same name as the original header in this
16453 directory containing an @code{#error} command.
16454
16455 This also works with @option{-include}.  So yet another way to use
16456 precompiled headers, good for projects not designed with precompiled
16457 header files in mind, is to simply take most of the header files used by
16458 a project, include them from another header file, precompile that header
16459 file, and @option{-include} the precompiled header.  If the header files
16460 have guards against multiple inclusion, they will be skipped because
16461 they've already been included (in the precompiled header).
16462
16463 If you need to precompile the same header file for different
16464 languages, targets, or compiler options, you can instead make a
16465 @emph{directory} named like @file{all.h.gch}, and put each precompiled
16466 header in the directory, perhaps using @option{-o}.  It doesn't matter
16467 what you call the files in the directory, every precompiled header in
16468 the directory will be considered.  The first precompiled header
16469 encountered in the directory that is valid for this compilation will
16470 be used; they're searched in no particular order.
16471
16472 There are many other possibilities, limited only by your imagination,
16473 good sense, and the constraints of your build system.
16474
16475 A precompiled header file can be used only when these conditions apply:
16476
16477 @itemize
16478 @item
16479 Only one precompiled header can be used in a particular compilation.
16480
16481 @item
16482 A precompiled header can't be used once the first C token is seen.  You
16483 can have preprocessor directives before a precompiled header; you can
16484 even include a precompiled header from inside another header, so long as
16485 there are no C tokens before the @code{#include}.
16486
16487 @item
16488 The precompiled header file must be produced for the same language as
16489 the current compilation.  You can't use a C precompiled header for a C++
16490 compilation.
16491
16492 @item
16493 The precompiled header file must have been produced by the same compiler
16494 binary as the current compilation is using.
16495
16496 @item
16497 Any macros defined before the precompiled header is included must
16498 either be defined in the same way as when the precompiled header was
16499 generated, or must not affect the precompiled header, which usually
16500 means that they don't appear in the precompiled header at all.
16501
16502 The @option{-D} option is one way to define a macro before a
16503 precompiled header is included; using a @code{#define} can also do it.
16504 There are also some options that define macros implicitly, like
16505 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
16506 defined this way.
16507
16508 @item If debugging information is output when using the precompiled
16509 header, using @option{-g} or similar, the same kind of debugging information
16510 must have been output when building the precompiled header.  However,
16511 a precompiled header built using @option{-g} can be used in a compilation
16512 when no debugging information is being output.
16513
16514 @item The same @option{-m} options must generally be used when building
16515 and using the precompiled header.  @xref{Submodel Options},
16516 for any cases where this rule is relaxed.
16517
16518 @item Each of the following options must be the same when building and using
16519 the precompiled header:
16520
16521 @gccoptlist{-fexceptions}
16522
16523 @item
16524 Some other command-line options starting with @option{-f},
16525 @option{-p}, or @option{-O} must be defined in the same way as when
16526 the precompiled header was generated.  At present, it's not clear
16527 which options are safe to change and which are not; the safest choice
16528 is to use exactly the same options when generating and using the
16529 precompiled header.  The following are known to be safe:
16530
16531 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
16532 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
16533 -fsched-verbose=<number>  -fschedule-insns  -fvisibility= @gol
16534 -pedantic-errors}
16535
16536 @end itemize
16537
16538 For all of these except the last, the compiler will automatically
16539 ignore the precompiled header if the conditions aren't met.  If you
16540 find an option combination that doesn't work and doesn't cause the
16541 precompiled header to be ignored, please consider filing a bug report,
16542 see @ref{Bugs}.
16543
16544 If you do use differing options when generating and using the
16545 precompiled header, the actual behavior will be a mixture of the
16546 behavior for the options.  For instance, if you use @option{-g} to
16547 generate the precompiled header but not when using it, you may or may
16548 not get debugging information for routines in the precompiled header.