OSDN Git Service

* gcc.c (option_map): New flag -no-canonical-prefixes.
[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  -no-canonical-prefixes  @gol
165 -pipe  -pass-exit-codes  @gol
166 -x @var{language}  -v  -###  --help@r{[}=@var{class}@r{[},@dots{}@r{]]}  --target-help  @gol
167 --version -wrapper@@@var{file} -fplugin=@var{file} -fplugin-arg-@var{name}=@var{arg}}
168
169 @item C Language Options
170 @xref{C Dialect Options,,Options Controlling C Dialect}.
171 @gccoptlist{-ansi  -std=@var{standard}  -fgnu89-inline @gol
172 -aux-info @var{filename} @gol
173 -fno-asm  -fno-builtin  -fno-builtin-@var{function} @gol
174 -fhosted  -ffreestanding -fopenmp -fms-extensions @gol
175 -trigraphs  -no-integrated-cpp  -traditional  -traditional-cpp @gol
176 -fallow-single-precision  -fcond-mismatch -flax-vector-conversions @gol
177 -fsigned-bitfields  -fsigned-char @gol
178 -funsigned-bitfields  -funsigned-char}
179
180 @item C++ Language Options
181 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}.
182 @gccoptlist{-fabi-version=@var{n}  -fno-access-control  -fcheck-new @gol
183 -fconserve-space  -ffriend-injection @gol
184 -fno-elide-constructors @gol
185 -fno-enforce-eh-specs @gol
186 -ffor-scope  -fno-for-scope  -fno-gnu-keywords @gol
187 -fno-implicit-templates @gol
188 -fno-implicit-inline-templates @gol
189 -fno-implement-inlines  -fms-extensions @gol
190 -fno-nonansi-builtins  -fno-operator-names @gol
191 -fno-optional-diags  -fpermissive @gol
192 -fno-pretty-templates @gol
193 -frepo  -fno-rtti  -fstats  -ftemplate-depth-@var{n} @gol
194 -fno-threadsafe-statics -fuse-cxa-atexit  -fno-weak  -nostdinc++ @gol
195 -fno-default-inline  -fvisibility-inlines-hidden @gol
196 -fvisibility-ms-compat @gol
197 -Wabi  -Wctor-dtor-privacy @gol
198 -Wnon-virtual-dtor  -Wreorder @gol
199 -Weffc++  -Wstrict-null-sentinel @gol
200 -Wno-non-template-friend  -Wold-style-cast @gol
201 -Woverloaded-virtual  -Wno-pmf-conversions @gol
202 -Wsign-promo}
203
204 @item Objective-C and Objective-C++ Language Options
205 @xref{Objective-C and Objective-C++ Dialect Options,,Options Controlling
206 Objective-C and Objective-C++ Dialects}.
207 @gccoptlist{-fconstant-string-class=@var{class-name} @gol
208 -fgnu-runtime  -fnext-runtime @gol
209 -fno-nil-receivers @gol
210 -fobjc-call-cxx-cdtors @gol
211 -fobjc-direct-dispatch @gol
212 -fobjc-exceptions @gol
213 -fobjc-gc @gol
214 -freplace-objc-classes @gol
215 -fzero-link @gol
216 -gen-decls @gol
217 -Wassign-intercept @gol
218 -Wno-protocol  -Wselector @gol
219 -Wstrict-selector-match @gol
220 -Wundeclared-selector}
221
222 @item Language Independent Options
223 @xref{Language Independent Options,,Options to Control Diagnostic Messages Formatting}.
224 @gccoptlist{-fmessage-length=@var{n}  @gol
225 -fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]}  @gol
226 -fdiagnostics-show-option}
227
228 @item Warning Options
229 @xref{Warning Options,,Options to Request or Suppress Warnings}.
230 @gccoptlist{-fsyntax-only  -pedantic  -pedantic-errors @gol
231 -w  -Wextra  -Wall  -Waddress  -Waggregate-return  -Warray-bounds @gol
232 -Wno-attributes -Wno-builtin-macro-redefined @gol
233 -Wc++-compat -Wc++0x-compat -Wcast-align  -Wcast-qual  @gol
234 -Wchar-subscripts -Wclobbered  -Wcomment @gol
235 -Wconversion  -Wcoverage-mismatch  -Wno-deprecated  @gol
236 -Wno-deprecated-declarations -Wdisabled-optimization  @gol
237 -Wno-div-by-zero -Wempty-body  -Wenum-compare -Wno-endif-labels @gol
238 -Werror  -Werror=* @gol
239 -Wfatal-errors  -Wfloat-equal  -Wformat  -Wformat=2 @gol
240 -Wno-format-contains-nul -Wno-format-extra-args -Wformat-nonliteral @gol
241 -Wformat-security  -Wformat-y2k @gol
242 -Wframe-larger-than=@var{len} -Wjump-misses-init -Wignored-qualifiers @gol
243 -Wimplicit  -Wimplicit-function-declaration  -Wimplicit-int @gol
244 -Winit-self  -Winline @gol
245 -Wno-int-to-pointer-cast -Wno-invalid-offsetof @gol
246 -Winvalid-pch -Wlarger-than=@var{len}  -Wunsafe-loop-optimizations @gol
247 -Wlogical-op -Wlong-long @gol
248 -Wmain  -Wmissing-braces  -Wmissing-field-initializers @gol
249 -Wmissing-format-attribute  -Wmissing-include-dirs @gol
250 -Wmissing-noreturn  -Wno-mudflap @gol
251 -Wno-multichar  -Wnonnull  -Wno-overflow @gol
252 -Woverlength-strings  -Wpacked  -Wpacked-bitfield-compat  -Wpadded @gol
253 -Wparentheses  -Wpedantic-ms-format -Wno-pedantic-ms-format @gol
254 -Wpointer-arith  -Wno-pointer-to-int-cast @gol
255 -Wredundant-decls @gol
256 -Wreturn-type  -Wsequence-point  -Wshadow @gol
257 -Wsign-compare  -Wsign-conversion  -Wstack-protector @gol
258 -Wstrict-aliasing -Wstrict-aliasing=n @gol
259 -Wstrict-overflow -Wstrict-overflow=@var{n} @gol
260 -Wswitch  -Wswitch-default  -Wswitch-enum -Wsync-nand @gol
261 -Wsystem-headers  -Wtrigraphs  -Wtype-limits  -Wundef  -Wuninitialized @gol
262 -Wunknown-pragmas  -Wno-pragmas -Wunreachable-code @gol
263 -Wunsuffixed-float-constants  -Wunused  -Wunused-function @gol
264 -Wunused-label  -Wunused-parameter -Wno-unused-result -Wunused-value  -Wunused-variable @gol
265 -Wvariadic-macros -Wvla @gol
266 -Wvolatile-register-var  -Wwrite-strings}
267
268 @item C and Objective-C-only Warning Options
269 @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
270 -Wmissing-parameter-type  -Wmissing-prototypes  -Wnested-externs @gol
271 -Wold-style-declaration  -Wold-style-definition @gol
272 -Wstrict-prototypes  -Wtraditional  -Wtraditional-conversion @gol
273 -Wdeclaration-after-statement -Wpointer-sign}
274
275 @item Debugging Options
276 @xref{Debugging Options,,Options for Debugging Your Program or GCC}.
277 @gccoptlist{-d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
278 -fdbg-cnt-list -fdbg-cnt=@var{counter-value-list} @gol
279 -fdump-noaddr -fdump-unnumbered -fdump-unnumbered-links @gol
280 -fdump-translation-unit@r{[}-@var{n}@r{]} @gol
281 -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
282 -fdump-ipa-all -fdump-ipa-cgraph -fdump-ipa-inline @gol
283 -fdump-statistics @gol
284 -fdump-tree-all @gol
285 -fdump-tree-original@r{[}-@var{n}@r{]}  @gol
286 -fdump-tree-optimized@r{[}-@var{n}@r{]} @gol
287 -fdump-tree-cfg -fdump-tree-vcg -fdump-tree-alias @gol
288 -fdump-tree-ch @gol
289 -fdump-tree-ssa@r{[}-@var{n}@r{]} -fdump-tree-pre@r{[}-@var{n}@r{]} @gol
290 -fdump-tree-ccp@r{[}-@var{n}@r{]} -fdump-tree-dce@r{[}-@var{n}@r{]} @gol
291 -fdump-tree-gimple@r{[}-raw@r{]} -fdump-tree-mudflap@r{[}-@var{n}@r{]} @gol
292 -fdump-tree-dom@r{[}-@var{n}@r{]} @gol
293 -fdump-tree-dse@r{[}-@var{n}@r{]} @gol
294 -fdump-tree-phiprop@r{[}-@var{n}@r{]} @gol
295 -fdump-tree-phiopt@r{[}-@var{n}@r{]} @gol
296 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
297 -fdump-tree-copyrename@r{[}-@var{n}@r{]} @gol
298 -fdump-tree-nrv -fdump-tree-vect @gol
299 -fdump-tree-sink @gol
300 -fdump-tree-sra@r{[}-@var{n}@r{]} @gol
301 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
302 -fdump-tree-fre@r{[}-@var{n}@r{]} @gol
303 -fdump-tree-vrp@r{[}-@var{n}@r{]} @gol
304 -ftree-vectorizer-verbose=@var{n} @gol
305 -fdump-tree-storeccp@r{[}-@var{n}@r{]} @gol
306 -fdump-final-insns=@var{file} @gol
307 -fcompare-debug@r{[}=@var{opts}@r{]}  -fcompare-debug-second @gol
308 -feliminate-dwarf2-dups -feliminate-unused-debug-types @gol
309 -feliminate-unused-debug-symbols -femit-class-debug-always @gol
310 -fmem-report -fpre-ipa-mem-report -fpost-ipa-mem-report -fprofile-arcs @gol
311 -frandom-seed=@var{string} -fsched-verbose=@var{n} @gol
312 -fsel-sched-verbose -fsel-sched-dump-cfg -fsel-sched-pipelining-verbose @gol
313 -ftest-coverage  -ftime-report -fvar-tracking @gol
314 -g  -g@var{level}  -gtoggle  -gcoff  -gdwarf-@var{version} @gol
315 -ggdb  -gstabs  -gstabs+  -gvms  -gxcoff  -gxcoff+ @gol
316 -fno-merge-debug-strings -fno-dwarf2-cfi-asm @gol
317 -fdebug-prefix-map=@var{old}=@var{new} @gol
318 -femit-struct-debug-baseonly -femit-struct-debug-reduced @gol
319 -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol
320 -p  -pg  -print-file-name=@var{library}  -print-libgcc-file-name @gol
321 -print-multi-directory  -print-multi-lib @gol
322 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
323 -print-sysroot -print-sysroot-headers-suffix @gol
324 -save-temps -save-temps=cwd -save-temps=obj -time@r{[}=@var{file}@r{]}}
325
326 @item Optimization Options
327 @xref{Optimize Options,,Options that Control Optimization}.
328 @gccoptlist{
329 -falign-functions[=@var{n}] -falign-jumps[=@var{n}] @gol
330 -falign-labels[=@var{n}] -falign-loops[=@var{n}] -fassociative-math @gol
331 -fauto-inc-dec -fbranch-probabilities -fbranch-target-load-optimize @gol
332 -fbranch-target-load-optimize2 -fbtr-bb-exclusive -fcaller-saves @gol
333 -fcheck-data-deps -fconserve-stack -fcprop-registers -fcrossjumping @gol
334 -fcse-follow-jumps -fcse-skip-blocks -fcx-fortran-rules -fcx-limited-range @gol
335 -fdata-sections -fdce -fdce @gol
336 -fdelayed-branch -fdelete-null-pointer-checks -fdse -fdse @gol
337 -fearly-inlining -fexpensive-optimizations -ffast-math @gol
338 -ffinite-math-only -ffloat-store -fexcess-precision=@var{style} @gol
339 -fforward-propagate -ffunction-sections @gol
340 -fgcse -fgcse-after-reload -fgcse-las -fgcse-lm @gol
341 -fgcse-sm -fif-conversion -fif-conversion2 -findirect-inlining @gol
342 -finline-functions -finline-functions-called-once -finline-limit=@var{n} @gol
343 -finline-small-functions -fipa-cp -fipa-cp-clone -fipa-matrix-reorg -fipa-pta @gol
344 -fipa-pure-const -fipa-reference -fipa-struct-reorg @gol
345 -fipa-type-escape -fira-algorithm=@var{algorithm} @gol
346 -fira-region=@var{region} -fira-coalesce -fno-ira-share-save-slots @gol
347 -fno-ira-share-spill-slots -fira-verbose=@var{n} @gol
348 -fivopts -fkeep-inline-functions -fkeep-static-consts @gol
349 -floop-block -floop-interchange -floop-strip-mine @gol
350 -fmerge-all-constants -fmerge-constants -fmodulo-sched @gol
351 -fmodulo-sched-allow-regmoves -fmove-loop-invariants -fmudflap @gol
352 -fmudflapir -fmudflapth -fno-branch-count-reg -fno-default-inline @gol
353 -fno-defer-pop -fno-function-cse -fno-guess-branch-probability @gol
354 -fno-inline -fno-math-errno -fno-peephole -fno-peephole2 @gol
355 -fno-sched-interblock -fno-sched-spec -fno-signed-zeros @gol
356 -fno-toplevel-reorder -fno-trapping-math -fno-zero-initialized-in-bss @gol
357 -fomit-frame-pointer -foptimize-register-move -foptimize-sibling-calls @gol
358 -fpeel-loops -fpredictive-commoning -fprefetch-loop-arrays @gol
359 -fprofile-correction -fprofile-dir=@var{path} -fprofile-generate @gol
360 -fprofile-generate=@var{path} @gol
361 -fprofile-use -fprofile-use=@var{path} -fprofile-values @gol
362 -freciprocal-math -fregmove -frename-registers -freorder-blocks @gol
363 -freorder-blocks-and-partition -freorder-functions @gol
364 -frerun-cse-after-loop -freschedule-modulo-scheduled-loops @gol
365 -frounding-math -fsched2-use-superblocks @gol
366 -fsched2-use-traces -fsched-spec-load -fsched-spec-load-dangerous @gol
367 -fsched-stalled-insns-dep[=@var{n}] -fsched-stalled-insns[=@var{n}] @gol
368 -fsched-group-heuristic -fsched-critical-path-heuristic @gol
369 -fsched-spec-insn-heuristic -fsched-reg-pressure-heuristic @gol
370 -fsched-rank-heuristic -fsched-last-insn-heuristic @gol
371 -fsched-dep-count-heuristic @gol
372 -fschedule-insns -fschedule-insns2 -fsection-anchors @gol
373 -fselective-scheduling -fselective-scheduling2 @gol
374 -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops @gol
375 -fsignaling-nans -fsingle-precision-constant -fsplit-ivs-in-unroller @gol
376 -fsplit-wide-types -fstack-protector -fstack-protector-all @gol
377 -fstrict-aliasing -fstrict-overflow -fthread-jumps -ftracer @gol
378 -ftree-builtin-call-dce -ftree-ccp -ftree-ch -ftree-copy-prop @gol
379 -ftree-copyrename -ftree-dce @gol
380 -ftree-dominator-opts -ftree-dse -ftree-forwprop -ftree-fre -ftree-loop-im @gol
381 -ftree-phiprop -ftree-loop-distribution @gol
382 -ftree-loop-ivcanon -ftree-loop-linear -ftree-loop-optimize @gol
383 -ftree-parallelize-loops=@var{n} -ftree-pre -ftree-pta -ftree-reassoc @gol
384 -ftree-sink -ftree-sra -ftree-switch-conversion @gol
385 -ftree-ter -ftree-vect-loop-version -ftree-vectorize -ftree-vrp @gol
386 -funit-at-a-time -funroll-all-loops -funroll-loops @gol
387 -funsafe-loop-optimizations -funsafe-math-optimizations -funswitch-loops @gol
388 -fvariable-expansion-in-unroller -fvect-cost-model -fvpt -fweb @gol
389 -fwhole-program @gol
390 --param @var{name}=@var{value}
391 -O  -O0  -O1  -O2  -O3  -Os}
392
393 @item Preprocessor Options
394 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
395 @gccoptlist{-A@var{question}=@var{answer} @gol
396 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
397 -C  -dD  -dI  -dM  -dN @gol
398 -D@var{macro}@r{[}=@var{defn}@r{]}  -E  -H @gol
399 -idirafter @var{dir} @gol
400 -include @var{file}  -imacros @var{file} @gol
401 -iprefix @var{file}  -iwithprefix @var{dir} @gol
402 -iwithprefixbefore @var{dir}  -isystem @var{dir} @gol
403 -imultilib @var{dir} -isysroot @var{dir} @gol
404 -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  @gol
405 -P  -fworking-directory  -remap @gol
406 -trigraphs  -undef  -U@var{macro}  -Wp,@var{option} @gol
407 -Xpreprocessor @var{option}}
408
409 @item Assembler Option
410 @xref{Assembler Options,,Passing Options to the Assembler}.
411 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
412
413 @item Linker Options
414 @xref{Link Options,,Options for Linking}.
415 @gccoptlist{@var{object-file-name}  -l@var{library} @gol
416 -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic @gol
417 -s  -static  -static-libgcc  -static-libstdc++ -shared  @gol
418 -shared-libgcc  -symbolic @gol
419 -T @var{script}  -Wl,@var{option}  -Xlinker @var{option} @gol
420 -u @var{symbol}}
421
422 @item Directory Options
423 @xref{Directory Options,,Options for Directory Search}.
424 @gccoptlist{-B@var{prefix}  -I@var{dir}  -iquote@var{dir}  -L@var{dir}
425 -specs=@var{file}  -I- --sysroot=@var{dir}}
426
427 @item Target Options
428 @c I wrote this xref this way to avoid overfull hbox. -- rms
429 @xref{Target Options}.
430 @gccoptlist{-V @var{version}  -b @var{machine}}
431
432 @item Machine Dependent Options
433 @xref{Submodel Options,,Hardware Models and Configurations}.
434 @c This list is ordered alphanumerically by subsection name.
435 @c Try and put the significant identifier (CPU or system) first,
436 @c so users have a clue at guessing where the ones they want will be.
437
438 @emph{ARC Options}
439 @gccoptlist{-EB  -EL @gol
440 -mmangle-cpu  -mcpu=@var{cpu}  -mtext=@var{text-section} @gol
441 -mdata=@var{data-section}  -mrodata=@var{readonly-data-section}}
442
443 @emph{ARM Options}
444 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
445 -mabi=@var{name} @gol
446 -mapcs-stack-check  -mno-apcs-stack-check @gol
447 -mapcs-float  -mno-apcs-float @gol
448 -mapcs-reentrant  -mno-apcs-reentrant @gol
449 -msched-prolog  -mno-sched-prolog @gol
450 -mlittle-endian  -mbig-endian  -mwords-little-endian @gol
451 -mfloat-abi=@var{name}  -msoft-float  -mhard-float  -mfpe @gol
452 -mfp16-format=@var{name}
453 -mthumb-interwork  -mno-thumb-interwork @gol
454 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
455 -mstructure-size-boundary=@var{n} @gol
456 -mabort-on-noreturn @gol
457 -mlong-calls  -mno-long-calls @gol
458 -msingle-pic-base  -mno-single-pic-base @gol
459 -mpic-register=@var{reg} @gol
460 -mnop-fun-dllimport @gol
461 -mcirrus-fix-invalid-insns -mno-cirrus-fix-invalid-insns @gol
462 -mpoke-function-name @gol
463 -mthumb  -marm @gol
464 -mtpcs-frame  -mtpcs-leaf-frame @gol
465 -mcaller-super-interworking  -mcallee-super-interworking @gol
466 -mtp=@var{name} @gol
467 -mword-relocations @gol
468 -mfix-cortex-m3-ldrd}
469
470 @emph{AVR Options}
471 @gccoptlist{-mmcu=@var{mcu}  -msize  -minit-stack=@var{n}  -mno-interrupts @gol
472 -mcall-prologues  -mtiny-stack  -mint8}
473
474 @emph{Blackfin Options}
475 @gccoptlist{-mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]} @gol
476 -msim -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
477 -mspecld-anomaly  -mno-specld-anomaly  -mcsync-anomaly  -mno-csync-anomaly @gol
478 -mlow-64k -mno-low64k  -mstack-check-l1  -mid-shared-library @gol
479 -mno-id-shared-library  -mshared-library-id=@var{n} @gol
480 -mleaf-id-shared-library  -mno-leaf-id-shared-library @gol
481 -msep-data  -mno-sep-data  -mlong-calls  -mno-long-calls @gol
482 -mfast-fp -minline-plt -mmulticore  -mcorea  -mcoreb  -msdram @gol
483 -micplb}
484
485 @emph{CRIS Options}
486 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
487 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
488 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
489 -mstack-align  -mdata-align  -mconst-align @gol
490 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
491 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
492 -mmul-bug-workaround  -mno-mul-bug-workaround}
493
494 @emph{CRX Options}
495 @gccoptlist{-mmac -mpush-args}
496
497 @emph{Darwin Options}
498 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
499 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
500 -client_name  -compatibility_version  -current_version @gol
501 -dead_strip @gol
502 -dependency-file  -dylib_file  -dylinker_install_name @gol
503 -dynamic  -dynamiclib  -exported_symbols_list @gol
504 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
505 -force_flat_namespace  -headerpad_max_install_names @gol
506 -iframework @gol
507 -image_base  -init  -install_name  -keep_private_externs @gol
508 -multi_module  -multiply_defined  -multiply_defined_unused @gol
509 -noall_load   -no_dead_strip_inits_and_terms @gol
510 -nofixprebinding -nomultidefs  -noprebind  -noseglinkedit @gol
511 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
512 -private_bundle  -read_only_relocs  -sectalign @gol
513 -sectobjectsymbols  -whyload  -seg1addr @gol
514 -sectcreate  -sectobjectsymbols  -sectorder @gol
515 -segaddr -segs_read_only_addr -segs_read_write_addr @gol
516 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
517 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
518 -single_module  -static  -sub_library  -sub_umbrella @gol
519 -twolevel_namespace  -umbrella  -undefined @gol
520 -unexported_symbols_list  -weak_reference_mismatches @gol
521 -whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} @gol
522 -mkernel -mone-byte-bool}
523
524 @emph{DEC Alpha Options}
525 @gccoptlist{-mno-fp-regs  -msoft-float  -malpha-as  -mgas @gol
526 -mieee  -mieee-with-inexact  -mieee-conformant @gol
527 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
528 -mtrap-precision=@var{mode}  -mbuild-constants @gol
529 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
530 -mbwx  -mmax  -mfix  -mcix @gol
531 -mfloat-vax  -mfloat-ieee @gol
532 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
533 -msmall-text  -mlarge-text @gol
534 -mmemory-latency=@var{time}}
535
536 @emph{DEC Alpha/VMS Options}
537 @gccoptlist{-mvms-return-codes}
538
539 @emph{FR30 Options}
540 @gccoptlist{-msmall-model -mno-lsim}
541
542 @emph{FRV Options}
543 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
544 -mhard-float  -msoft-float @gol
545 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
546 -mdouble  -mno-double @gol
547 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
548 -mfdpic  -minline-plt -mgprel-ro  -multilib-library-pic @gol
549 -mlinked-fp  -mlong-calls  -malign-labels @gol
550 -mlibrary-pic  -macc-4  -macc-8 @gol
551 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
552 -moptimize-membar -mno-optimize-membar @gol
553 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
554 -mvliw-branch  -mno-vliw-branch @gol
555 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
556 -mno-nested-cond-exec  -mtomcat-stats @gol
557 -mTLS -mtls @gol
558 -mcpu=@var{cpu}}
559
560 @emph{GNU/Linux Options}
561 @gccoptlist{-muclibc}
562
563 @emph{H8/300 Options}
564 @gccoptlist{-mrelax  -mh  -ms  -mn  -mint32  -malign-300}
565
566 @emph{HPPA Options}
567 @gccoptlist{-march=@var{architecture-type} @gol
568 -mbig-switch  -mdisable-fpregs  -mdisable-indexing @gol
569 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
570 -mfixed-range=@var{register-range} @gol
571 -mjump-in-delay -mlinker-opt -mlong-calls @gol
572 -mlong-load-store  -mno-big-switch  -mno-disable-fpregs @gol
573 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
574 -mno-jump-in-delay  -mno-long-load-store @gol
575 -mno-portable-runtime  -mno-soft-float @gol
576 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
577 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
578 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
579 -munix=@var{unix-std}  -nolibdld  -static  -threads}
580
581 @emph{i386 and x86-64 Options}
582 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
583 -mfpmath=@var{unit} @gol
584 -masm=@var{dialect}  -mno-fancy-math-387 @gol
585 -mno-fp-ret-in-387  -msoft-float @gol
586 -mno-wide-multiply  -mrtd  -malign-double @gol
587 -mpreferred-stack-boundary=@var{num}
588 -mincoming-stack-boundary=@var{num}
589 -mcld -mcx16 -msahf -mmovbe -mcrc32 -mrecip @gol
590 -mmmx  -msse  -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -msse4 -mavx @gol
591 -maes -mpclmul @gol
592 -msse4a -m3dnow -mpopcnt -mabm -msse5 @gol
593 -mthreads  -mno-align-stringops  -minline-all-stringops @gol
594 -minline-stringops-dynamically -mstringop-strategy=@var{alg} @gol
595 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
596 -m96bit-long-double  -mregparm=@var{num}  -msseregparm @gol
597 -mveclibabi=@var{type} -mpc32 -mpc64 -mpc80 -mstackrealign @gol
598 -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs @gol
599 -mcmodel=@var{code-model} -mabi=@var{name} @gol
600 -m32  -m64 -mlarge-data-threshold=@var{num} @gol
601 -mfused-madd -mno-fused-madd -msse2avx}
602
603 @emph{IA-64 Options}
604 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
605 -mvolatile-asm-stop  -mregister-names  -msdata -mno-sdata @gol
606 -mconstant-gp  -mauto-pic  -mfused-madd @gol
607 -minline-float-divide-min-latency @gol
608 -minline-float-divide-max-throughput @gol
609 -mno-inline-float-divide @gol
610 -minline-int-divide-min-latency @gol
611 -minline-int-divide-max-throughput  @gol
612 -mno-inline-int-divide @gol
613 -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
614 -mno-inline-sqrt @gol
615 -mdwarf2-asm -mearly-stop-bits @gol
616 -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
617 -mtune=@var{cpu-type} -milp32 -mlp64 @gol
618 -msched-br-data-spec -msched-ar-data-spec -msched-control-spec @gol
619 -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec @gol
620 -msched-spec-ldc -msched-spec-control-ldc @gol
621 -msched-prefer-non-data-spec-insns -msched-prefer-non-control-spec-insns @gol
622 -msched-stop-bits-after-every-cycle -msched-count-spec-in-critical-path @gol
623 -msel-sched-dont-check-control-spec -msched-fp-mem-deps-zero-cost @gol
624 -msched-max-memory-insns-hard-limit -msched-max-memory-insns=@var{max-insns}}
625
626 @emph{M32R/D Options}
627 @gccoptlist{-m32r2 -m32rx -m32r @gol
628 -mdebug @gol
629 -malign-loops -mno-align-loops @gol
630 -missue-rate=@var{number} @gol
631 -mbranch-cost=@var{number} @gol
632 -mmodel=@var{code-size-model-type} @gol
633 -msdata=@var{sdata-type} @gol
634 -mno-flush-func -mflush-func=@var{name} @gol
635 -mno-flush-trap -mflush-trap=@var{number} @gol
636 -G @var{num}}
637
638 @emph{M32C Options}
639 @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
640
641 @emph{M680x0 Options}
642 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu}  -mtune=@var{tune}
643 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
644 -m68060  -mcpu32  -m5200  -m5206e  -m528x  -m5307  -m5407 @gol
645 -mcfv4e  -mbitfield  -mno-bitfield  -mc68000  -mc68020 @gol
646 -mnobitfield  -mrtd  -mno-rtd  -mdiv  -mno-div  -mshort @gol
647 -mno-short  -mhard-float  -m68881  -msoft-float  -mpcrel @gol
648 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
649 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library @gol
650 -mxgot -mno-xgot}
651
652 @emph{M68hc1x Options}
653 @gccoptlist{-m6811  -m6812  -m68hc11  -m68hc12   -m68hcs12 @gol
654 -mauto-incdec  -minmax  -mlong-calls  -mshort @gol
655 -msoft-reg-count=@var{count}}
656
657 @emph{MCore Options}
658 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
659 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
660 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
661 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
662 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
663
664 @emph{MeP Options}
665 @gccoptlist{-mabsdiff -mall-opts -maverage -mbased=@var{n} -mbitops @gol
666 -mc=@var{n} -mclip -mconfig=@var{name} -mcop -mcop32 -mcop64 -mivc2 @gol
667 -mdc -mdiv -meb -mel -mio-volatile -ml -mleadz -mm -mminmax @gol
668 -mmult -mno-opts -mrepeat -ms -msatur -msdram -msim -msimnovec -mtf @gol
669 -mtiny=@var{n}}
670
671 @emph{MIPS Options}
672 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
673 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2 @gol
674 -mips64  -mips64r2 @gol
675 -mips16  -mno-mips16  -mflip-mips16 @gol
676 -minterlink-mips16  -mno-interlink-mips16 @gol
677 -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
678 -mshared  -mno-shared  -mplt  -mno-plt  -mxgot  -mno-xgot @gol
679 -mgp32  -mgp64  -mfp32  -mfp64  -mhard-float  -msoft-float @gol
680 -msingle-float  -mdouble-float  -mdsp  -mno-dsp  -mdspr2  -mno-dspr2 @gol
681 -mfpu=@var{fpu-type} @gol
682 -msmartmips  -mno-smartmips @gol
683 -mpaired-single  -mno-paired-single  -mdmx  -mno-mdmx @gol
684 -mips3d  -mno-mips3d  -mmt  -mno-mt  -mllsc  -mno-llsc @gol
685 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
686 -G@var{num}  -mlocal-sdata  -mno-local-sdata @gol
687 -mextern-sdata  -mno-extern-sdata  -mgpopt  -mno-gopt @gol
688 -membedded-data  -mno-embedded-data @gol
689 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
690 -mcode-readable=@var{setting} @gol
691 -msplit-addresses  -mno-split-addresses @gol
692 -mexplicit-relocs  -mno-explicit-relocs @gol
693 -mcheck-zero-division  -mno-check-zero-division @gol
694 -mdivide-traps  -mdivide-breaks @gol
695 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
696 -mmad  -mno-mad  -mfused-madd  -mno-fused-madd  -nocpp @gol
697 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
698 -mfix-r10000 -mno-fix-r10000  -mfix-vr4120  -mno-fix-vr4120 @gol
699 -mfix-vr4130  -mno-fix-vr4130  -mfix-sb1  -mno-fix-sb1 @gol
700 -mflush-func=@var{func}  -mno-flush-func @gol
701 -mbranch-cost=@var{num}  -mbranch-likely  -mno-branch-likely @gol
702 -mfp-exceptions -mno-fp-exceptions @gol
703 -mvr4130-align -mno-vr4130-align -msynci -mno-synci}
704
705 @emph{MMIX Options}
706 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
707 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
708 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
709 -mno-base-addresses  -msingle-exit  -mno-single-exit}
710
711 @emph{MN10300 Options}
712 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
713 -mam33  -mno-am33 @gol
714 -mam33-2  -mno-am33-2 @gol
715 -mreturn-pointer-on-d0 @gol
716 -mno-crt0  -mrelax}
717
718 @emph{PDP-11 Options}
719 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
720 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
721 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
722 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
723 -mbranch-expensive  -mbranch-cheap @gol
724 -msplit  -mno-split  -munix-asm  -mdec-asm}
725
726 @emph{picoChip Options}
727 @gccoptlist{-mae=@var{ae_type} -mvliw-lookahead=@var{N}
728 -msymbol-as-address -mno-inefficient-warnings}
729
730 @emph{PowerPC Options}
731 See RS/6000 and PowerPC Options.
732
733 @emph{RS/6000 and PowerPC Options}
734 @gccoptlist{-mcpu=@var{cpu-type} @gol
735 -mtune=@var{cpu-type} @gol
736 -mpower  -mno-power  -mpower2  -mno-power2 @gol
737 -mpowerpc  -mpowerpc64  -mno-powerpc @gol
738 -maltivec  -mno-altivec @gol
739 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
740 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
741 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb  -mfprnd  -mno-fprnd @gol
742 -mcmpb -mno-cmpb -mmfpgpr -mno-mfpgpr -mhard-dfp -mno-hard-dfp @gol
743 -mnew-mnemonics  -mold-mnemonics @gol
744 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
745 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
746 -malign-power  -malign-natural @gol
747 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
748 -msingle-float -mdouble-float -msimple-fpu @gol
749 -mstring  -mno-string  -mupdate  -mno-update @gol
750 -mavoid-indexed-addresses  -mno-avoid-indexed-addresses @gol
751 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
752 -mstrict-align  -mno-strict-align  -mrelocatable @gol
753 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
754 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
755 -mdynamic-no-pic  -maltivec  -mswdiv @gol
756 -mprioritize-restricted-insns=@var{priority} @gol
757 -msched-costly-dep=@var{dependence_type} @gol
758 -minsert-sched-nops=@var{scheme} @gol
759 -mcall-sysv  -mcall-netbsd @gol
760 -maix-struct-return  -msvr4-struct-return @gol
761 -mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
762 -misel -mno-isel @gol
763 -misel=yes  -misel=no @gol
764 -mspe -mno-spe @gol
765 -mspe=yes  -mspe=no @gol
766 -mpaired @gol
767 -mgen-cell-microcode -mwarn-cell-microcode @gol
768 -mvrsave -mno-vrsave @gol
769 -mmulhw -mno-mulhw @gol
770 -mdlmzb -mno-dlmzb @gol
771 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
772 -mprototype  -mno-prototype @gol
773 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
774 -msdata=@var{opt}  -mvxworks  -G @var{num}  -pthread}
775
776 @emph{S/390 and zSeries Options}
777 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
778 -mhard-float  -msoft-float  -mhard-dfp -mno-hard-dfp @gol
779 -mlong-double-64 -mlong-double-128 @gol
780 -mbackchain  -mno-backchain -mpacked-stack  -mno-packed-stack @gol
781 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
782 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
783 -mtpf-trace -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
784 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size -mstack-guard}
785
786 @emph{Score Options}
787 @gccoptlist{-meb -mel @gol
788 -mnhwloop @gol
789 -muls @gol
790 -mmac @gol
791 -mscore5 -mscore5u -mscore7 -mscore7d}
792
793 @emph{SH Options}
794 @gccoptlist{-m1  -m2  -m2e @gol
795 -m2a-nofpu -m2a-single-only -m2a-single -m2a @gol
796 -m3  -m3e @gol
797 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
798 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol
799 -m5-64media  -m5-64media-nofpu @gol
800 -m5-32media  -m5-32media-nofpu @gol
801 -m5-compact  -m5-compact-nofpu @gol
802 -mb  -ml  -mdalign  -mrelax @gol
803 -mbigtable  -mhitachi -mrenesas -mno-renesas -mnomacsave @gol
804 -mieee  -mbitops  -misize  -minline-ic_invalidate -mpadstruct  -mspace @gol
805 -mprefergot  -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
806 -mdivsi3_libfunc=@var{name} -mfixed-range=@var{register-range} @gol
807 -madjust-unroll -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol
808 -minvalid-symbols}
809
810 @emph{SPARC Options}
811 @gccoptlist{-mcpu=@var{cpu-type} @gol
812 -mtune=@var{cpu-type} @gol
813 -mcmodel=@var{code-model} @gol
814 -m32  -m64  -mapp-regs  -mno-app-regs @gol
815 -mfaster-structs  -mno-faster-structs @gol
816 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
817 -mhard-quad-float  -msoft-quad-float @gol
818 -mimpure-text  -mno-impure-text  -mlittle-endian @gol
819 -mstack-bias  -mno-stack-bias @gol
820 -munaligned-doubles  -mno-unaligned-doubles @gol
821 -mv8plus  -mno-v8plus  -mvis  -mno-vis
822 -threads -pthreads -pthread}
823
824 @emph{SPU Options}
825 @gccoptlist{-mwarn-reloc -merror-reloc @gol
826 -msafe-dma -munsafe-dma @gol
827 -mbranch-hints @gol
828 -msmall-mem -mlarge-mem -mstdmain @gol
829 -mfixed-range=@var{register-range}}
830
831 @emph{System V Options}
832 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
833
834 @emph{V850 Options}
835 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
836 -mprolog-function  -mno-prolog-function  -mspace @gol
837 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
838 -mapp-regs  -mno-app-regs @gol
839 -mdisable-callt  -mno-disable-callt @gol
840 -mv850e1 @gol
841 -mv850e @gol
842 -mv850  -mbig-switch}
843
844 @emph{VAX Options}
845 @gccoptlist{-mg  -mgnu  -munix}
846
847 @emph{VxWorks Options}
848 @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
849 -Xbind-lazy  -Xbind-now}
850
851 @emph{x86-64 Options}
852 See i386 and x86-64 Options.
853
854 @emph{i386 and x86-64 Windows Options}
855 @gccoptlist{-mconsole -mcygwin -mno-cygwin -mdll
856 -mnop-fun-dllimport -mthread -municode -mwin32 -mwindows}
857
858 @emph{Xstormy16 Options}
859 @gccoptlist{-msim}
860
861 @emph{Xtensa Options}
862 @gccoptlist{-mconst16 -mno-const16 @gol
863 -mfused-madd  -mno-fused-madd @gol
864 -mserialize-volatile  -mno-serialize-volatile @gol
865 -mtext-section-literals  -mno-text-section-literals @gol
866 -mtarget-align  -mno-target-align @gol
867 -mlongcalls  -mno-longcalls}
868
869 @emph{zSeries Options}
870 See S/390 and zSeries Options.
871
872 @item Code Generation Options
873 @xref{Code Gen Options,,Options for Code Generation Conventions}.
874 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
875 -ffixed-@var{reg}  -fexceptions @gol
876 -fnon-call-exceptions  -funwind-tables @gol
877 -fasynchronous-unwind-tables @gol
878 -finhibit-size-directive  -finstrument-functions @gol
879 -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol
880 -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{} @gol
881 -fno-common  -fno-ident @gol
882 -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE @gol
883 -fno-jump-tables @gol
884 -frecord-gcc-switches @gol
885 -freg-struct-return  -fshort-enums @gol
886 -fshort-double  -fshort-wchar @gol
887 -fverbose-asm  -fpack-struct[=@var{n}]  -fstack-check @gol
888 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
889 -fno-stack-limit  -fargument-alias  -fargument-noalias @gol
890 -fargument-noalias-global  -fargument-noalias-anything @gol
891 -fleading-underscore  -ftls-model=@var{model} @gol
892 -ftrapv  -fwrapv  -fbounds-check @gol
893 -fvisibility}
894 @end table
895
896 @menu
897 * Overall Options::     Controlling the kind of output:
898                         an executable, object files, assembler files,
899                         or preprocessed source.
900 * C Dialect Options::   Controlling the variant of C language compiled.
901 * C++ Dialect Options:: Variations on C++.
902 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
903                         and Objective-C++.
904 * Language Independent Options:: Controlling how diagnostics should be
905                         formatted.
906 * Warning Options::     How picky should the compiler be?
907 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
908 * Optimize Options::    How much optimization?
909 * Preprocessor Options:: Controlling header files and macro definitions.
910                          Also, getting dependency information for Make.
911 * Assembler Options::   Passing options to the assembler.
912 * Link Options::        Specifying libraries and so on.
913 * Directory Options::   Where to find header files and libraries.
914                         Where to find the compiler executable files.
915 * Spec Files::          How to pass switches to sub-processes.
916 * Target Options::      Running a cross-compiler, or an old version of GCC.
917 @end menu
918
919 @node Overall Options
920 @section Options Controlling the Kind of Output
921
922 Compilation can involve up to four stages: preprocessing, compilation
923 proper, assembly and linking, always in that order.  GCC is capable of
924 preprocessing and compiling several files either into several
925 assembler input files, or into one assembler input file; then each
926 assembler input file produces an object file, and linking combines all
927 the object files (those newly compiled, and those specified as input)
928 into an executable file.
929
930 @cindex file name suffix
931 For any given input file, the file name suffix determines what kind of
932 compilation is done:
933
934 @table @gcctabopt
935 @item @var{file}.c
936 C source code which must be preprocessed.
937
938 @item @var{file}.i
939 C source code which should not be preprocessed.
940
941 @item @var{file}.ii
942 C++ source code which should not be preprocessed.
943
944 @item @var{file}.m
945 Objective-C source code.  Note that you must link with the @file{libobjc}
946 library to make an Objective-C program work.
947
948 @item @var{file}.mi
949 Objective-C source code which should not be preprocessed.
950
951 @item @var{file}.mm
952 @itemx @var{file}.M
953 Objective-C++ source code.  Note that you must link with the @file{libobjc}
954 library to make an Objective-C++ program work.  Note that @samp{.M} refers
955 to a literal capital M@.
956
957 @item @var{file}.mii
958 Objective-C++ source code which should not be preprocessed.
959
960 @item @var{file}.h
961 C, C++, Objective-C or Objective-C++ header file to be turned into a
962 precompiled header.
963
964 @item @var{file}.cc
965 @itemx @var{file}.cp
966 @itemx @var{file}.cxx
967 @itemx @var{file}.cpp
968 @itemx @var{file}.CPP
969 @itemx @var{file}.c++
970 @itemx @var{file}.C
971 C++ source code which must be preprocessed.  Note that in @samp{.cxx},
972 the last two letters must both be literally @samp{x}.  Likewise,
973 @samp{.C} refers to a literal capital C@.
974
975 @item @var{file}.mm
976 @itemx @var{file}.M
977 Objective-C++ source code which must be preprocessed.
978
979 @item @var{file}.mii
980 Objective-C++ source code which should not be preprocessed.
981
982 @item @var{file}.hh
983 @itemx @var{file}.H
984 @itemx @var{file}.hp
985 @itemx @var{file}.hxx
986 @itemx @var{file}.hpp
987 @itemx @var{file}.HPP
988 @itemx @var{file}.h++
989 @itemx @var{file}.tcc
990 C++ header file to be turned into a precompiled header.
991
992 @item @var{file}.f
993 @itemx @var{file}.for
994 @itemx @var{file}.ftn
995 Fixed form Fortran source code which should not be preprocessed.
996
997 @item @var{file}.F
998 @itemx @var{file}.FOR
999 @itemx @var{file}.fpp
1000 @itemx @var{file}.FPP
1001 @itemx @var{file}.FTN
1002 Fixed form Fortran source code which must be preprocessed (with the traditional
1003 preprocessor).
1004
1005 @item @var{file}.f90
1006 @itemx @var{file}.f95
1007 @itemx @var{file}.f03
1008 @itemx @var{file}.f08
1009 Free form Fortran source code which should not be preprocessed.
1010
1011 @item @var{file}.F90
1012 @itemx @var{file}.F95
1013 @itemx @var{file}.F03
1014 @itemx @var{file}.F08
1015 Free form Fortran source code which must be preprocessed (with the
1016 traditional preprocessor).
1017
1018 @c FIXME: Descriptions of Java file types.
1019 @c @var{file}.java
1020 @c @var{file}.class
1021 @c @var{file}.zip
1022 @c @var{file}.jar
1023
1024 @item @var{file}.ads
1025 Ada source code file which contains a library unit declaration (a
1026 declaration of a package, subprogram, or generic, or a generic
1027 instantiation), or a library unit renaming declaration (a package,
1028 generic, or subprogram renaming declaration).  Such files are also
1029 called @dfn{specs}.
1030
1031 @item @var{file}.adb
1032 Ada source code file containing a library unit body (a subprogram or
1033 package body).  Such files are also called @dfn{bodies}.
1034
1035 @c GCC also knows about some suffixes for languages not yet included:
1036 @c Pascal:
1037 @c @var{file}.p
1038 @c @var{file}.pas
1039 @c Ratfor:
1040 @c @var{file}.r
1041
1042 @item @var{file}.s
1043 Assembler code.
1044
1045 @item @var{file}.S
1046 @itemx @var{file}.sx
1047 Assembler code which must be preprocessed.
1048
1049 @item @var{other}
1050 An object file to be fed straight into linking.
1051 Any file name with no recognized suffix is treated this way.
1052 @end table
1053
1054 @opindex x
1055 You can specify the input language explicitly with the @option{-x} option:
1056
1057 @table @gcctabopt
1058 @item -x @var{language}
1059 Specify explicitly the @var{language} for the following input files
1060 (rather than letting the compiler choose a default based on the file
1061 name suffix).  This option applies to all following input files until
1062 the next @option{-x} option.  Possible values for @var{language} are:
1063 @smallexample
1064 c  c-header  c-cpp-output
1065 c++  c++-header  c++-cpp-output
1066 objective-c  objective-c-header  objective-c-cpp-output
1067 objective-c++ objective-c++-header objective-c++-cpp-output
1068 assembler  assembler-with-cpp
1069 ada
1070 f77  f77-cpp-input f95  f95-cpp-input
1071 java
1072 @end smallexample
1073
1074 @item -x none
1075 Turn off any specification of a language, so that subsequent files are
1076 handled according to their file name suffixes (as they are if @option{-x}
1077 has not been used at all).
1078
1079 @item -pass-exit-codes
1080 @opindex pass-exit-codes
1081 Normally the @command{gcc} program will exit with the code of 1 if any
1082 phase of the compiler returns a non-success return code.  If you specify
1083 @option{-pass-exit-codes}, the @command{gcc} program will instead return with
1084 numerically highest error produced by any phase that returned an error
1085 indication.  The C, C++, and Fortran frontends return 4, if an internal
1086 compiler error is encountered.
1087 @end table
1088
1089 If you only want some of the stages of compilation, you can use
1090 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
1091 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
1092 @command{gcc} is to stop.  Note that some combinations (for example,
1093 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
1094
1095 @table @gcctabopt
1096 @item -c
1097 @opindex c
1098 Compile or assemble the source files, but do not link.  The linking
1099 stage simply is not done.  The ultimate output is in the form of an
1100 object file for each source file.
1101
1102 By default, the object file name for a source file is made by replacing
1103 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1104
1105 Unrecognized input files, not requiring compilation or assembly, are
1106 ignored.
1107
1108 @item -S
1109 @opindex S
1110 Stop after the stage of compilation proper; do not assemble.  The output
1111 is in the form of an assembler code file for each non-assembler input
1112 file specified.
1113
1114 By default, the assembler file name for a source file is made by
1115 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1116
1117 Input files that don't require compilation are ignored.
1118
1119 @item -E
1120 @opindex E
1121 Stop after the preprocessing stage; do not run the compiler proper.  The
1122 output is in the form of preprocessed source code, which is sent to the
1123 standard output.
1124
1125 Input files which don't require preprocessing are ignored.
1126
1127 @cindex output file option
1128 @item -o @var{file}
1129 @opindex o
1130 Place output in file @var{file}.  This applies regardless to whatever
1131 sort of output is being produced, whether it be an executable file,
1132 an object file, an assembler file or preprocessed C code.
1133
1134 If @option{-o} is not specified, the default is to put an executable
1135 file in @file{a.out}, the object file for
1136 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1137 assembler file in @file{@var{source}.s}, a precompiled header file in
1138 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1139 standard output.
1140
1141 @item -v
1142 @opindex v
1143 Print (on standard error output) the commands executed to run the stages
1144 of compilation.  Also print the version number of the compiler driver
1145 program and of the preprocessor and the compiler proper.
1146
1147 @item -###
1148 @opindex ###
1149 Like @option{-v} except the commands are not executed and all command
1150 arguments are quoted.  This is useful for shell scripts to capture the
1151 driver-generated command lines.
1152
1153 @item -pipe
1154 @opindex pipe
1155 Use pipes rather than temporary files for communication between the
1156 various stages of compilation.  This fails to work on some systems where
1157 the assembler is unable to read from a pipe; but the GNU assembler has
1158 no trouble.
1159
1160 @item -combine
1161 @opindex combine
1162 If you are compiling multiple source files, this option tells the driver
1163 to pass all the source files to the compiler at once (for those
1164 languages for which the compiler can handle this).  This will allow
1165 intermodule analysis (IMA) to be performed by the compiler.  Currently the only
1166 language for which this is supported is C@.  If you pass source files for
1167 multiple languages to the driver, using this option, the driver will invoke
1168 the compiler(s) that support IMA once each, passing each compiler all the
1169 source files appropriate for it.  For those languages that do not support
1170 IMA this option will be ignored, and the compiler will be invoked once for
1171 each source file in that language.  If you use this option in conjunction
1172 with @option{-save-temps}, the compiler will generate multiple
1173 pre-processed files
1174 (one for each source file), but only one (combined) @file{.o} or
1175 @file{.s} file.
1176
1177 @item --help
1178 @opindex help
1179 Print (on the standard output) a description of the command line options
1180 understood by @command{gcc}.  If the @option{-v} option is also specified
1181 then @option{--help} will also be passed on to the various processes
1182 invoked by @command{gcc}, so that they can display the command line options
1183 they accept.  If the @option{-Wextra} option has also been specified
1184 (prior to the @option{--help} option), then command line options which
1185 have no documentation associated with them will also be displayed.
1186
1187 @item --target-help
1188 @opindex target-help
1189 Print (on the standard output) a description of target-specific command
1190 line options for each tool.  For some targets extra target-specific
1191 information may also be printed.
1192
1193 @item --help=@{@var{class}@r{|[}^@r{]}@var{qualifier}@}@r{[},@dots{}@r{]}
1194 Print (on the standard output) a description of the command line
1195 options understood by the compiler that fit into all specified classes
1196 and qualifiers.  These are the supported classes:
1197
1198 @table @asis
1199 @item @samp{optimizers}
1200 This will display all of the optimization options supported by the
1201 compiler.
1202
1203 @item @samp{warnings}
1204 This will display all of the options controlling warning messages
1205 produced by the compiler.
1206
1207 @item @samp{target}
1208 This will display target-specific options.  Unlike the
1209 @option{--target-help} option however, target-specific options of the
1210 linker and assembler will not be displayed.  This is because those
1211 tools do not currently support the extended @option{--help=} syntax.
1212
1213 @item @samp{params}
1214 This will display the values recognized by the @option{--param}
1215 option.
1216
1217 @item @var{language}
1218 This will display the options supported for @var{language}, where
1219 @var{language} is the name of one of the languages supported in this
1220 version of GCC.
1221
1222 @item @samp{common}
1223 This will display the options that are common to all languages.
1224 @end table
1225
1226 These are the supported qualifiers:
1227
1228 @table @asis
1229 @item @samp{undocumented}
1230 Display only those options which are undocumented.
1231
1232 @item @samp{joined}
1233 Display options which take an argument that appears after an equal
1234 sign in the same continuous piece of text, such as:
1235 @samp{--help=target}.
1236
1237 @item @samp{separate}
1238 Display options which take an argument that appears as a separate word
1239 following the original option, such as: @samp{-o output-file}.
1240 @end table
1241
1242 Thus for example to display all the undocumented target-specific
1243 switches supported by the compiler the following can be used:
1244
1245 @smallexample
1246 --help=target,undocumented
1247 @end smallexample
1248
1249 The sense of a qualifier can be inverted by prefixing it with the
1250 @samp{^} character, so for example to display all binary warning
1251 options (i.e., ones that are either on or off and that do not take an
1252 argument), which have a description the following can be used:
1253
1254 @smallexample
1255 --help=warnings,^joined,^undocumented
1256 @end smallexample
1257
1258 The argument to @option{--help=} should not consist solely of inverted
1259 qualifiers.
1260
1261 Combining several classes is possible, although this usually
1262 restricts the output by so much that there is nothing to display.  One
1263 case where it does work however is when one of the classes is
1264 @var{target}.  So for example to display all the target-specific
1265 optimization options the following can be used:
1266
1267 @smallexample
1268 --help=target,optimizers
1269 @end smallexample
1270
1271 The @option{--help=} option can be repeated on the command line.  Each
1272 successive use will display its requested class of options, skipping
1273 those that have already been displayed.
1274
1275 If the @option{-Q} option appears on the command line before the
1276 @option{--help=} option, then the descriptive text displayed by
1277 @option{--help=} is changed.  Instead of describing the displayed
1278 options, an indication is given as to whether the option is enabled,
1279 disabled or set to a specific value (assuming that the compiler
1280 knows this at the point where the @option{--help=} option is used).
1281
1282 Here is a truncated example from the ARM port of @command{gcc}:
1283
1284 @smallexample
1285   % gcc -Q -mabi=2 --help=target -c
1286   The following options are target specific:
1287   -mabi=                                2
1288   -mabort-on-noreturn                   [disabled]
1289   -mapcs                                [disabled]
1290 @end smallexample
1291
1292 The output is sensitive to the effects of previous command line
1293 options, so for example it is possible to find out which optimizations
1294 are enabled at @option{-O2} by using:
1295
1296 @smallexample
1297 -Q -O2 --help=optimizers
1298 @end smallexample
1299
1300 Alternatively you can discover which binary optimizations are enabled
1301 by @option{-O3} by using:
1302
1303 @smallexample
1304 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1305 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1306 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1307 @end smallexample
1308
1309 @item -no-canonical-prefixes
1310 @opindex no-canonical-prefixes
1311 Do not expand any symbolic links, resolve references to @samp{/../}
1312 or @samp{/./}, or make the path absolute when generating a relative
1313 prefix.
1314
1315 @item --version
1316 @opindex version
1317 Display the version number and copyrights of the invoked GCC@.
1318
1319 @item -wrapper
1320 @opindex wrapper
1321 Invoke all subcommands under a wrapper program. It takes a single
1322 comma separated list as an argument, which will be used to invoke
1323 the wrapper:
1324
1325 @smallexample
1326 gcc -c t.c -wrapper gdb,--args
1327 @end smallexample
1328
1329 This will invoke all subprograms of gcc under "gdb --args",
1330 thus cc1 invocation will be "gdb --args cc1 ...".
1331
1332 @item -fplugin=@var{name}.so
1333 Load the plugin code in file @var{name}.so, assumed to be a
1334 shared object to be dlopen'd by the compiler.  The base name of
1335 the shared object file is used to identify the plugin for the
1336 purposes of argument parsing (See
1337 @option{-fplugin-arg-@var{name}-@var{key}=@var{value}} below).
1338 Each plugin should define the callback functions specified in the
1339 Plugins API.
1340
1341 @item -fplugin-arg-@var{name}-@var{key}=@var{value}
1342 Define an argument called @var{key} with a value of @var{value}
1343 for the plugin called @var{name}.
1344
1345 @include @value{srcdir}/../libiberty/at-file.texi
1346 @end table
1347
1348 @node Invoking G++
1349 @section Compiling C++ Programs
1350
1351 @cindex suffixes for C++ source
1352 @cindex C++ source file suffixes
1353 C++ source files conventionally use one of the suffixes @samp{.C},
1354 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1355 @samp{.cxx}; C++ header files often use @samp{.hh}, @samp{.hpp},
1356 @samp{.H}, or (for shared template code) @samp{.tcc}; and
1357 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1358 files with these names and compiles them as C++ programs even if you
1359 call the compiler the same way as for compiling C programs (usually
1360 with the name @command{gcc}).
1361
1362 @findex g++
1363 @findex c++
1364 However, the use of @command{gcc} does not add the C++ library.
1365 @command{g++} is a program that calls GCC and treats @samp{.c},
1366 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1367 files unless @option{-x} is used, and automatically specifies linking
1368 against the C++ library.  This program is also useful when
1369 precompiling a C header file with a @samp{.h} extension for use in C++
1370 compilations.  On many systems, @command{g++} is also installed with
1371 the name @command{c++}.
1372
1373 @cindex invoking @command{g++}
1374 When you compile C++ programs, you may specify many of the same
1375 command-line options that you use for compiling programs in any
1376 language; or command-line options meaningful for C and related
1377 languages; or options that are meaningful only for C++ programs.
1378 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1379 explanations of options for languages related to C@.
1380 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1381 explanations of options that are meaningful only for C++ programs.
1382
1383 @node C Dialect Options
1384 @section Options Controlling C Dialect
1385 @cindex dialect options
1386 @cindex language dialect options
1387 @cindex options, dialect
1388
1389 The following options control the dialect of C (or languages derived
1390 from C, such as C++, Objective-C and Objective-C++) that the compiler
1391 accepts:
1392
1393 @table @gcctabopt
1394 @cindex ANSI support
1395 @cindex ISO support
1396 @item -ansi
1397 @opindex ansi
1398 In C mode, this is equivalent to @samp{-std=c89}. In C++ mode, it is
1399 equivalent to @samp{-std=c++98}.
1400
1401 This turns off certain features of GCC that are incompatible with ISO
1402 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1403 such as the @code{asm} and @code{typeof} keywords, and
1404 predefined macros such as @code{unix} and @code{vax} that identify the
1405 type of system you are using.  It also enables the undesirable and
1406 rarely used ISO trigraph feature.  For the C compiler,
1407 it disables recognition of C++ style @samp{//} comments as well as
1408 the @code{inline} keyword.
1409
1410 The alternate keywords @code{__asm__}, @code{__extension__},
1411 @code{__inline__} and @code{__typeof__} continue to work despite
1412 @option{-ansi}.  You would not want to use them in an ISO C program, of
1413 course, but it is useful to put them in header files that might be included
1414 in compilations done with @option{-ansi}.  Alternate predefined macros
1415 such as @code{__unix__} and @code{__vax__} are also available, with or
1416 without @option{-ansi}.
1417
1418 The @option{-ansi} option does not cause non-ISO programs to be
1419 rejected gratuitously.  For that, @option{-pedantic} is required in
1420 addition to @option{-ansi}.  @xref{Warning Options}.
1421
1422 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1423 option is used.  Some header files may notice this macro and refrain
1424 from declaring certain functions or defining certain macros that the
1425 ISO standard doesn't call for; this is to avoid interfering with any
1426 programs that might use these names for other things.
1427
1428 Functions that would normally be built in but do not have semantics
1429 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1430 functions when @option{-ansi} is used.  @xref{Other Builtins,,Other
1431 built-in functions provided by GCC}, for details of the functions
1432 affected.
1433
1434 @item -std=
1435 @opindex std
1436 Determine the language standard. @xref{Standards,,Language Standards
1437 Supported by GCC}, for details of these standard versions.  This option
1438 is currently only supported when compiling C or C++.
1439
1440 The compiler can accept several base standards, such as @samp{c89} or
1441 @samp{c++98}, and GNU dialects of those standards, such as
1442 @samp{gnu89} or @samp{gnu++98}.  By specifying a base standard, the
1443 compiler will accept all programs following that standard and those
1444 using GNU extensions that do not contradict it.  For example,
1445 @samp{-std=c89} turns off certain features of GCC that are
1446 incompatible with ISO C90, such as the @code{asm} and @code{typeof}
1447 keywords, but not other GNU extensions that do not have a meaning in
1448 ISO C90, such as omitting the middle term of a @code{?:}
1449 expression. On the other hand, by specifying a GNU dialect of a
1450 standard, all features the compiler support are enabled, even when
1451 those features change the meaning of the base standard and some
1452 strict-conforming programs may be rejected.  The particular standard
1453 is used by @option{-pedantic} to identify which features are GNU
1454 extensions given that version of the standard. For example
1455 @samp{-std=gnu89 -pedantic} would warn about C++ style @samp{//}
1456 comments, while @samp{-std=gnu99 -pedantic} would not.
1457
1458 A value for this option must be provided; possible values are
1459
1460 @table @samp
1461 @item c89
1462 @itemx iso9899:1990
1463 Support all ISO C90 programs (certain GNU extensions that conflict
1464 with ISO C90 are disabled). Same as @option{-ansi} for C code.
1465
1466 @item iso9899:199409
1467 ISO C90 as modified in amendment 1.
1468
1469 @item c99
1470 @itemx c9x
1471 @itemx iso9899:1999
1472 @itemx iso9899:199x
1473 ISO C99.  Note that this standard is not yet fully supported; see
1474 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1475 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1476
1477 @item gnu89
1478 GNU dialect of ISO C90 (including some C99 features). This
1479 is the default for C code.
1480
1481 @item gnu99
1482 @itemx gnu9x
1483 GNU dialect of ISO C99.  When ISO C99 is fully implemented in GCC,
1484 this will become the default.  The name @samp{gnu9x} is deprecated.
1485
1486 @item c++98
1487 The 1998 ISO C++ standard plus amendments. Same as @option{-ansi} for
1488 C++ code.
1489
1490 @item gnu++98
1491 GNU dialect of @option{-std=c++98}.  This is the default for
1492 C++ code.
1493
1494 @item c++0x
1495 The working draft of the upcoming ISO C++0x standard. This option
1496 enables experimental features that are likely to be included in
1497 C++0x. The working draft is constantly changing, and any feature that is
1498 enabled by this flag may be removed from future versions of GCC if it is
1499 not part of the C++0x standard.
1500
1501 @item gnu++0x
1502 GNU dialect of @option{-std=c++0x}. This option enables
1503 experimental features that may be removed in future versions of GCC.
1504 @end table
1505
1506 @item -fgnu89-inline
1507 @opindex fgnu89-inline
1508 The option @option{-fgnu89-inline} tells GCC to use the traditional
1509 GNU semantics for @code{inline} functions when in C99 mode.
1510 @xref{Inline,,An Inline Function is As Fast As a Macro}.  This option
1511 is accepted and ignored by GCC versions 4.1.3 up to but not including
1512 4.3.  In GCC versions 4.3 and later it changes the behavior of GCC in
1513 C99 mode.  Using this option is roughly equivalent to adding the
1514 @code{gnu_inline} function attribute to all inline functions
1515 (@pxref{Function Attributes}).
1516
1517 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
1518 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
1519 specifies the default behavior).  This option was first supported in
1520 GCC 4.3.  This option is not supported in C89 or gnu89 mode.
1521
1522 The preprocessor macros @code{__GNUC_GNU_INLINE__} and
1523 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
1524 in effect for @code{inline} functions.  @xref{Common Predefined
1525 Macros,,,cpp,The C Preprocessor}.
1526
1527 @item -aux-info @var{filename}
1528 @opindex aux-info
1529 Output to the given filename prototyped declarations for all functions
1530 declared and/or defined in a translation unit, including those in header
1531 files.  This option is silently ignored in any language other than C@.
1532
1533 Besides declarations, the file indicates, in comments, the origin of
1534 each declaration (source file and line), whether the declaration was
1535 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1536 @samp{O} for old, respectively, in the first character after the line
1537 number and the colon), and whether it came from a declaration or a
1538 definition (@samp{C} or @samp{F}, respectively, in the following
1539 character).  In the case of function definitions, a K&R-style list of
1540 arguments followed by their declarations is also provided, inside
1541 comments, after the declaration.
1542
1543 @item -fno-asm
1544 @opindex fno-asm
1545 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1546 keyword, so that code can use these words as identifiers.  You can use
1547 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1548 instead.  @option{-ansi} implies @option{-fno-asm}.
1549
1550 In C++, this switch only affects the @code{typeof} keyword, since
1551 @code{asm} and @code{inline} are standard keywords.  You may want to
1552 use the @option{-fno-gnu-keywords} flag instead, which has the same
1553 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1554 switch only affects the @code{asm} and @code{typeof} keywords, since
1555 @code{inline} is a standard keyword in ISO C99.
1556
1557 @item -fno-builtin
1558 @itemx -fno-builtin-@var{function}
1559 @opindex fno-builtin
1560 @cindex built-in functions
1561 Don't recognize built-in functions that do not begin with
1562 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1563 functions provided by GCC}, for details of the functions affected,
1564 including those which are not built-in functions when @option{-ansi} or
1565 @option{-std} options for strict ISO C conformance are used because they
1566 do not have an ISO standard meaning.
1567
1568 GCC normally generates special code to handle certain built-in functions
1569 more efficiently; for instance, calls to @code{alloca} may become single
1570 instructions that adjust the stack directly, and calls to @code{memcpy}
1571 may become inline copy loops.  The resulting code is often both smaller
1572 and faster, but since the function calls no longer appear as such, you
1573 cannot set a breakpoint on those calls, nor can you change the behavior
1574 of the functions by linking with a different library.  In addition,
1575 when a function is recognized as a built-in function, GCC may use
1576 information about that function to warn about problems with calls to
1577 that function, or to generate more efficient code, even if the
1578 resulting code still contains calls to that function.  For example,
1579 warnings are given with @option{-Wformat} for bad calls to
1580 @code{printf}, when @code{printf} is built in, and @code{strlen} is
1581 known not to modify global memory.
1582
1583 With the @option{-fno-builtin-@var{function}} option
1584 only the built-in function @var{function} is
1585 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1586 function is named that is not built-in in this version of GCC, this
1587 option is ignored.  There is no corresponding
1588 @option{-fbuiltin-@var{function}} option; if you wish to enable
1589 built-in functions selectively when using @option{-fno-builtin} or
1590 @option{-ffreestanding}, you may define macros such as:
1591
1592 @smallexample
1593 #define abs(n)          __builtin_abs ((n))
1594 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1595 @end smallexample
1596
1597 @item -fhosted
1598 @opindex fhosted
1599 @cindex hosted environment
1600
1601 Assert that compilation takes place in a hosted environment.  This implies
1602 @option{-fbuiltin}.  A hosted environment is one in which the
1603 entire standard library is available, and in which @code{main} has a return
1604 type of @code{int}.  Examples are nearly everything except a kernel.
1605 This is equivalent to @option{-fno-freestanding}.
1606
1607 @item -ffreestanding
1608 @opindex ffreestanding
1609 @cindex hosted environment
1610
1611 Assert that compilation takes place in a freestanding environment.  This
1612 implies @option{-fno-builtin}.  A freestanding environment
1613 is one in which the standard library may not exist, and program startup may
1614 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1615 This is equivalent to @option{-fno-hosted}.
1616
1617 @xref{Standards,,Language Standards Supported by GCC}, for details of
1618 freestanding and hosted environments.
1619
1620 @item -fopenmp
1621 @opindex fopenmp
1622 @cindex openmp parallel
1623 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
1624 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
1625 compiler generates parallel code according to the OpenMP Application
1626 Program Interface v3.0 @w{@uref{http://www.openmp.org/}}.  This option
1627 implies @option{-pthread}, and thus is only supported on targets that
1628 have support for @option{-pthread}.
1629
1630 @item -fms-extensions
1631 @opindex fms-extensions
1632 Accept some non-standard constructs used in Microsoft header files.
1633
1634 Some cases of unnamed fields in structures and unions are only
1635 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
1636 fields within structs/unions}, for details.
1637
1638 @item -trigraphs
1639 @opindex trigraphs
1640 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
1641 options for strict ISO C conformance) implies @option{-trigraphs}.
1642
1643 @item -no-integrated-cpp
1644 @opindex no-integrated-cpp
1645 Performs a compilation in two passes: preprocessing and compiling.  This
1646 option allows a user supplied "cc1", "cc1plus", or "cc1obj" via the
1647 @option{-B} option.  The user supplied compilation step can then add in
1648 an additional preprocessing step after normal preprocessing but before
1649 compiling.  The default is to use the integrated cpp (internal cpp)
1650
1651 The semantics of this option will change if "cc1", "cc1plus", and
1652 "cc1obj" are merged.
1653
1654 @cindex traditional C language
1655 @cindex C language, traditional
1656 @item -traditional
1657 @itemx -traditional-cpp
1658 @opindex traditional-cpp
1659 @opindex traditional
1660 Formerly, these options caused GCC to attempt to emulate a pre-standard
1661 C compiler.  They are now only supported with the @option{-E} switch.
1662 The preprocessor continues to support a pre-standard mode.  See the GNU
1663 CPP manual for details.
1664
1665 @item -fcond-mismatch
1666 @opindex fcond-mismatch
1667 Allow conditional expressions with mismatched types in the second and
1668 third arguments.  The value of such an expression is void.  This option
1669 is not supported for C++.
1670
1671 @item -flax-vector-conversions
1672 @opindex flax-vector-conversions
1673 Allow implicit conversions between vectors with differing numbers of
1674 elements and/or incompatible element types.  This option should not be
1675 used for new code.
1676
1677 @item -funsigned-char
1678 @opindex funsigned-char
1679 Let the type @code{char} be unsigned, like @code{unsigned char}.
1680
1681 Each kind of machine has a default for what @code{char} should
1682 be.  It is either like @code{unsigned char} by default or like
1683 @code{signed char} by default.
1684
1685 Ideally, a portable program should always use @code{signed char} or
1686 @code{unsigned char} when it depends on the signedness of an object.
1687 But many programs have been written to use plain @code{char} and
1688 expect it to be signed, or expect it to be unsigned, depending on the
1689 machines they were written for.  This option, and its inverse, let you
1690 make such a program work with the opposite default.
1691
1692 The type @code{char} is always a distinct type from each of
1693 @code{signed char} or @code{unsigned char}, even though its behavior
1694 is always just like one of those two.
1695
1696 @item -fsigned-char
1697 @opindex fsigned-char
1698 Let the type @code{char} be signed, like @code{signed char}.
1699
1700 Note that this is equivalent to @option{-fno-unsigned-char}, which is
1701 the negative form of @option{-funsigned-char}.  Likewise, the option
1702 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
1703
1704 @item -fsigned-bitfields
1705 @itemx -funsigned-bitfields
1706 @itemx -fno-signed-bitfields
1707 @itemx -fno-unsigned-bitfields
1708 @opindex fsigned-bitfields
1709 @opindex funsigned-bitfields
1710 @opindex fno-signed-bitfields
1711 @opindex fno-unsigned-bitfields
1712 These options control whether a bit-field is signed or unsigned, when the
1713 declaration does not use either @code{signed} or @code{unsigned}.  By
1714 default, such a bit-field is signed, because this is consistent: the
1715 basic integer types such as @code{int} are signed types.
1716 @end table
1717
1718 @node C++ Dialect Options
1719 @section Options Controlling C++ Dialect
1720
1721 @cindex compiler options, C++
1722 @cindex C++ options, command line
1723 @cindex options, C++
1724 This section describes the command-line options that are only meaningful
1725 for C++ programs; but you can also use most of the GNU compiler options
1726 regardless of what language your program is in.  For example, you
1727 might compile a file @code{firstClass.C} like this:
1728
1729 @smallexample
1730 g++ -g -frepo -O -c firstClass.C
1731 @end smallexample
1732
1733 @noindent
1734 In this example, only @option{-frepo} is an option meant
1735 only for C++ programs; you can use the other options with any
1736 language supported by GCC@.
1737
1738 Here is a list of options that are @emph{only} for compiling C++ programs:
1739
1740 @table @gcctabopt
1741
1742 @item -fabi-version=@var{n}
1743 @opindex fabi-version
1744 Use version @var{n} of the C++ ABI@.  Version 2 is the version of the
1745 C++ ABI that first appeared in G++ 3.4.  Version 1 is the version of
1746 the C++ ABI that first appeared in G++ 3.2.  Version 0 will always be
1747 the version that conforms most closely to the C++ ABI specification.
1748 Therefore, the ABI obtained using version 0 will change as ABI bugs
1749 are fixed.
1750
1751 The default is version 2.
1752
1753 @item -fno-access-control
1754 @opindex fno-access-control
1755 Turn off all access checking.  This switch is mainly useful for working
1756 around bugs in the access control code.
1757
1758 @item -fcheck-new
1759 @opindex fcheck-new
1760 Check that the pointer returned by @code{operator new} is non-null
1761 before attempting to modify the storage allocated.  This check is
1762 normally unnecessary because the C++ standard specifies that
1763 @code{operator new} will only return @code{0} if it is declared
1764 @samp{throw()}, in which case the compiler will always check the
1765 return value even without this option.  In all other cases, when
1766 @code{operator new} has a non-empty exception specification, memory
1767 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
1768 @samp{new (nothrow)}.
1769
1770 @item -fconserve-space
1771 @opindex fconserve-space
1772 Put uninitialized or runtime-initialized global variables into the
1773 common segment, as C does.  This saves space in the executable at the
1774 cost of not diagnosing duplicate definitions.  If you compile with this
1775 flag and your program mysteriously crashes after @code{main()} has
1776 completed, you may have an object that is being destroyed twice because
1777 two definitions were merged.
1778
1779 This option is no longer useful on most targets, now that support has
1780 been added for putting variables into BSS without making them common.
1781
1782 @item -ffriend-injection
1783 @opindex ffriend-injection
1784 Inject friend functions into the enclosing namespace, so that they are
1785 visible outside the scope of the class in which they are declared.
1786 Friend functions were documented to work this way in the old Annotated
1787 C++ Reference Manual, and versions of G++ before 4.1 always worked
1788 that way.  However, in ISO C++ a friend function which is not declared
1789 in an enclosing scope can only be found using argument dependent
1790 lookup.  This option causes friends to be injected as they were in
1791 earlier releases.
1792
1793 This option is for compatibility, and may be removed in a future
1794 release of G++.
1795
1796 @item -fno-elide-constructors
1797 @opindex fno-elide-constructors
1798 The C++ standard allows an implementation to omit creating a temporary
1799 which is only used to initialize another object of the same type.
1800 Specifying this option disables that optimization, and forces G++ to
1801 call the copy constructor in all cases.
1802
1803 @item -fno-enforce-eh-specs
1804 @opindex fno-enforce-eh-specs
1805 Don't generate code to check for violation of exception specifications
1806 at runtime.  This option violates the C++ standard, but may be useful
1807 for reducing code size in production builds, much like defining
1808 @samp{NDEBUG}.  This does not give user code permission to throw
1809 exceptions in violation of the exception specifications; the compiler
1810 will still optimize based on the specifications, so throwing an
1811 unexpected exception will result in undefined behavior.
1812
1813 @item -ffor-scope
1814 @itemx -fno-for-scope
1815 @opindex ffor-scope
1816 @opindex fno-for-scope
1817 If @option{-ffor-scope} is specified, the scope of variables declared in
1818 a @i{for-init-statement} is limited to the @samp{for} loop itself,
1819 as specified by the C++ standard.
1820 If @option{-fno-for-scope} is specified, the scope of variables declared in
1821 a @i{for-init-statement} extends to the end of the enclosing scope,
1822 as was the case in old versions of G++, and other (traditional)
1823 implementations of C++.
1824
1825 The default if neither flag is given to follow the standard,
1826 but to allow and give a warning for old-style code that would
1827 otherwise be invalid, or have different behavior.
1828
1829 @item -fno-gnu-keywords
1830 @opindex fno-gnu-keywords
1831 Do not recognize @code{typeof} as a keyword, so that code can use this
1832 word as an identifier.  You can use the keyword @code{__typeof__} instead.
1833 @option{-ansi} implies @option{-fno-gnu-keywords}.
1834
1835 @item -fno-implicit-templates
1836 @opindex fno-implicit-templates
1837 Never emit code for non-inline templates which are instantiated
1838 implicitly (i.e.@: by use); only emit code for explicit instantiations.
1839 @xref{Template Instantiation}, for more information.
1840
1841 @item -fno-implicit-inline-templates
1842 @opindex fno-implicit-inline-templates
1843 Don't emit code for implicit instantiations of inline templates, either.
1844 The default is to handle inlines differently so that compiles with and
1845 without optimization will need the same set of explicit instantiations.
1846
1847 @item -fno-implement-inlines
1848 @opindex fno-implement-inlines
1849 To save space, do not emit out-of-line copies of inline functions
1850 controlled by @samp{#pragma implementation}.  This will cause linker
1851 errors if these functions are not inlined everywhere they are called.
1852
1853 @item -fms-extensions
1854 @opindex fms-extensions
1855 Disable pedantic warnings about constructs used in MFC, such as implicit
1856 int and getting a pointer to member function via non-standard syntax.
1857
1858 @item -fno-nonansi-builtins
1859 @opindex fno-nonansi-builtins
1860 Disable built-in declarations of functions that are not mandated by
1861 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
1862 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
1863
1864 @item -fno-operator-names
1865 @opindex fno-operator-names
1866 Do not treat the operator name keywords @code{and}, @code{bitand},
1867 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
1868 synonyms as keywords.
1869
1870 @item -fno-optional-diags
1871 @opindex fno-optional-diags
1872 Disable diagnostics that the standard says a compiler does not need to
1873 issue.  Currently, the only such diagnostic issued by G++ is the one for
1874 a name having multiple meanings within a class.
1875
1876 @item -fpermissive
1877 @opindex fpermissive
1878 Downgrade some diagnostics about nonconformant code from errors to
1879 warnings.  Thus, using @option{-fpermissive} will allow some
1880 nonconforming code to compile.
1881
1882 @item -fno-pretty-templates
1883 @opindex fno-pretty-templates
1884 When an error message refers to a specialization of a function
1885 template, the compiler will normally print the signature of the
1886 template followed by the template arguments and any typedefs or
1887 typenames in the signature (e.g. @code{void f(T) [with T = int]}
1888 rather than @code{void f(int)}) so that it's clear which template is
1889 involved.  When an error message refers to a specialization of a class
1890 template, the compiler will omit any template arguments which match
1891 the default template arguments for that template.  If either of these
1892 behaviors make it harder to understand the error message rather than
1893 easier, using @option{-fno-pretty-templates} will disable them.
1894
1895 @item -frepo
1896 @opindex frepo
1897 Enable automatic template instantiation at link time.  This option also
1898 implies @option{-fno-implicit-templates}.  @xref{Template
1899 Instantiation}, for more information.
1900
1901 @item -fno-rtti
1902 @opindex fno-rtti
1903 Disable generation of information about every class with virtual
1904 functions for use by the C++ runtime type identification features
1905 (@samp{dynamic_cast} and @samp{typeid}).  If you don't use those parts
1906 of the language, you can save some space by using this flag.  Note that
1907 exception handling uses the same information, but it will generate it as
1908 needed. The @samp{dynamic_cast} operator can still be used for casts that
1909 do not require runtime type information, i.e.@: casts to @code{void *} or to
1910 unambiguous base classes.
1911
1912 @item -fstats
1913 @opindex fstats
1914 Emit statistics about front-end processing at the end of the compilation.
1915 This information is generally only useful to the G++ development team.
1916
1917 @item -ftemplate-depth-@var{n}
1918 @opindex ftemplate-depth
1919 Set the maximum instantiation depth for template classes to @var{n}.
1920 A limit on the template instantiation depth is needed to detect
1921 endless recursions during template class instantiation.  ANSI/ISO C++
1922 conforming programs must not rely on a maximum depth greater than 17.
1923
1924 @item -fno-threadsafe-statics
1925 @opindex fno-threadsafe-statics
1926 Do not emit the extra code to use the routines specified in the C++
1927 ABI for thread-safe initialization of local statics.  You can use this
1928 option to reduce code size slightly in code that doesn't need to be
1929 thread-safe.
1930
1931 @item -fuse-cxa-atexit
1932 @opindex fuse-cxa-atexit
1933 Register destructors for objects with static storage duration with the
1934 @code{__cxa_atexit} function rather than the @code{atexit} function.
1935 This option is required for fully standards-compliant handling of static
1936 destructors, but will only work if your C library supports
1937 @code{__cxa_atexit}.
1938
1939 @item -fno-use-cxa-get-exception-ptr
1940 @opindex fno-use-cxa-get-exception-ptr
1941 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
1942 will cause @code{std::uncaught_exception} to be incorrect, but is necessary
1943 if the runtime routine is not available.
1944
1945 @item -fvisibility-inlines-hidden
1946 @opindex fvisibility-inlines-hidden
1947 This switch declares that the user does not attempt to compare
1948 pointers to inline methods where the addresses of the two functions
1949 were taken in different shared objects.
1950
1951 The effect of this is that GCC may, effectively, mark inline methods with
1952 @code{__attribute__ ((visibility ("hidden")))} so that they do not
1953 appear in the export table of a DSO and do not require a PLT indirection
1954 when used within the DSO@.  Enabling this option can have a dramatic effect
1955 on load and link times of a DSO as it massively reduces the size of the
1956 dynamic export table when the library makes heavy use of templates.
1957
1958 The behavior of this switch is not quite the same as marking the
1959 methods as hidden directly, because it does not affect static variables
1960 local to the function or cause the compiler to deduce that
1961 the function is defined in only one shared object.
1962
1963 You may mark a method as having a visibility explicitly to negate the
1964 effect of the switch for that method.  For example, if you do want to
1965 compare pointers to a particular inline method, you might mark it as
1966 having default visibility.  Marking the enclosing class with explicit
1967 visibility will have no effect.
1968
1969 Explicitly instantiated inline methods are unaffected by this option
1970 as their linkage might otherwise cross a shared library boundary.
1971 @xref{Template Instantiation}.
1972
1973 @item -fvisibility-ms-compat
1974 @opindex fvisibility-ms-compat
1975 This flag attempts to use visibility settings to make GCC's C++
1976 linkage model compatible with that of Microsoft Visual Studio.
1977
1978 The flag makes these changes to GCC's linkage model:
1979
1980 @enumerate
1981 @item
1982 It sets the default visibility to @code{hidden}, like
1983 @option{-fvisibility=hidden}.
1984
1985 @item
1986 Types, but not their members, are not hidden by default.
1987
1988 @item
1989 The One Definition Rule is relaxed for types without explicit
1990 visibility specifications which are defined in more than one different
1991 shared object: those declarations are permitted if they would have
1992 been permitted when this option was not used.
1993 @end enumerate
1994
1995 In new code it is better to use @option{-fvisibility=hidden} and
1996 export those classes which are intended to be externally visible.
1997 Unfortunately it is possible for code to rely, perhaps accidentally,
1998 on the Visual Studio behavior.
1999
2000 Among the consequences of these changes are that static data members
2001 of the same type with the same name but defined in different shared
2002 objects will be different, so changing one will not change the other;
2003 and that pointers to function members defined in different shared
2004 objects may not compare equal.  When this flag is given, it is a
2005 violation of the ODR to define types with the same name differently.
2006
2007 @item -fno-weak
2008 @opindex fno-weak
2009 Do not use weak symbol support, even if it is provided by the linker.
2010 By default, G++ will use weak symbols if they are available.  This
2011 option exists only for testing, and should not be used by end-users;
2012 it will result in inferior code and has no benefits.  This option may
2013 be removed in a future release of G++.
2014
2015 @item -nostdinc++
2016 @opindex nostdinc++
2017 Do not search for header files in the standard directories specific to
2018 C++, but do still search the other standard directories.  (This option
2019 is used when building the C++ library.)
2020 @end table
2021
2022 In addition, these optimization, warning, and code generation options
2023 have meanings only for C++ programs:
2024
2025 @table @gcctabopt
2026 @item -fno-default-inline
2027 @opindex fno-default-inline
2028 Do not assume @samp{inline} for functions defined inside a class scope.
2029 @xref{Optimize Options,,Options That Control Optimization}.  Note that these
2030 functions will have linkage like inline functions; they just won't be
2031 inlined by default.
2032
2033 @item -Wabi @r{(C, Objective-C, C++ and Objective-C++ only)}
2034 @opindex Wabi
2035 @opindex Wno-abi
2036 Warn when G++ generates code that is probably not compatible with the
2037 vendor-neutral C++ ABI@.  Although an effort has been made to warn about
2038 all such cases, there are probably some cases that are not warned about,
2039 even though G++ is generating incompatible code.  There may also be
2040 cases where warnings are emitted even though the code that is generated
2041 will be compatible.
2042
2043 You should rewrite your code to avoid these warnings if you are
2044 concerned about the fact that code generated by G++ may not be binary
2045 compatible with code generated by other compilers.
2046
2047 The known incompatibilities at this point include:
2048
2049 @itemize @bullet
2050
2051 @item
2052 Incorrect handling of tail-padding for bit-fields.  G++ may attempt to
2053 pack data into the same byte as a base class.  For example:
2054
2055 @smallexample
2056 struct A @{ virtual void f(); int f1 : 1; @};
2057 struct B : public A @{ int f2 : 1; @};
2058 @end smallexample
2059
2060 @noindent
2061 In this case, G++ will place @code{B::f2} into the same byte
2062 as@code{A::f1}; other compilers will not.  You can avoid this problem
2063 by explicitly padding @code{A} so that its size is a multiple of the
2064 byte size on your platform; that will cause G++ and other compilers to
2065 layout @code{B} identically.
2066
2067 @item
2068 Incorrect handling of tail-padding for virtual bases.  G++ does not use
2069 tail padding when laying out virtual bases.  For example:
2070
2071 @smallexample
2072 struct A @{ virtual void f(); char c1; @};
2073 struct B @{ B(); char c2; @};
2074 struct C : public A, public virtual B @{@};
2075 @end smallexample
2076
2077 @noindent
2078 In this case, G++ will not place @code{B} into the tail-padding for
2079 @code{A}; other compilers will.  You can avoid this problem by
2080 explicitly padding @code{A} so that its size is a multiple of its
2081 alignment (ignoring virtual base classes); that will cause G++ and other
2082 compilers to layout @code{C} identically.
2083
2084 @item
2085 Incorrect handling of bit-fields with declared widths greater than that
2086 of their underlying types, when the bit-fields appear in a union.  For
2087 example:
2088
2089 @smallexample
2090 union U @{ int i : 4096; @};
2091 @end smallexample
2092
2093 @noindent
2094 Assuming that an @code{int} does not have 4096 bits, G++ will make the
2095 union too small by the number of bits in an @code{int}.
2096
2097 @item
2098 Empty classes can be placed at incorrect offsets.  For example:
2099
2100 @smallexample
2101 struct A @{@};
2102
2103 struct B @{
2104   A a;
2105   virtual void f ();
2106 @};
2107
2108 struct C : public B, public A @{@};
2109 @end smallexample
2110
2111 @noindent
2112 G++ will place the @code{A} base class of @code{C} at a nonzero offset;
2113 it should be placed at offset zero.  G++ mistakenly believes that the
2114 @code{A} data member of @code{B} is already at offset zero.
2115
2116 @item
2117 Names of template functions whose types involve @code{typename} or
2118 template template parameters can be mangled incorrectly.
2119
2120 @smallexample
2121 template <typename Q>
2122 void f(typename Q::X) @{@}
2123
2124 template <template <typename> class Q>
2125 void f(typename Q<int>::X) @{@}
2126 @end smallexample
2127
2128 @noindent
2129 Instantiations of these templates may be mangled incorrectly.
2130
2131 @end itemize
2132
2133 It also warns psABI related changes.  The known psABI changes at this
2134 point include:
2135
2136 @itemize @bullet
2137
2138 @item
2139 For SYSV/x86-64, when passing union with long double, it is changed to
2140 pass in memory as specified in psABI.  For example:
2141
2142 @smallexample
2143 union U @{
2144   long double ld;
2145   int i;
2146 @};
2147 @end smallexample
2148
2149 @noindent
2150 @code{union U} will always be passed in memory.
2151
2152 @end itemize
2153
2154 @item -Wctor-dtor-privacy @r{(C++ and Objective-C++ only)}
2155 @opindex Wctor-dtor-privacy
2156 @opindex Wno-ctor-dtor-privacy
2157 Warn when a class seems unusable because all the constructors or
2158 destructors in that class are private, and it has neither friends nor
2159 public static member functions.
2160
2161 @item -Wnon-virtual-dtor @r{(C++ and Objective-C++ only)}
2162 @opindex Wnon-virtual-dtor
2163 @opindex Wno-non-virtual-dtor
2164 Warn when a class has virtual functions and accessible non-virtual
2165 destructor, in which case it would be possible but unsafe to delete
2166 an instance of a derived class through a pointer to the base class.
2167 This warning is also enabled if -Weffc++ is specified.
2168
2169 @item -Wreorder @r{(C++ and Objective-C++ only)}
2170 @opindex Wreorder
2171 @opindex Wno-reorder
2172 @cindex reordering, warning
2173 @cindex warning for reordering of member initializers
2174 Warn when the order of member initializers given in the code does not
2175 match the order in which they must be executed.  For instance:
2176
2177 @smallexample
2178 struct A @{
2179   int i;
2180   int j;
2181   A(): j (0), i (1) @{ @}
2182 @};
2183 @end smallexample
2184
2185 The compiler will rearrange the member initializers for @samp{i}
2186 and @samp{j} to match the declaration order of the members, emitting
2187 a warning to that effect.  This warning is enabled by @option{-Wall}.
2188 @end table
2189
2190 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
2191
2192 @table @gcctabopt
2193 @item -Weffc++ @r{(C++ and Objective-C++ only)}
2194 @opindex Weffc++
2195 @opindex Wno-effc++
2196 Warn about violations of the following style guidelines from Scott Meyers'
2197 @cite{Effective C++} book:
2198
2199 @itemize @bullet
2200 @item
2201 Item 11:  Define a copy constructor and an assignment operator for classes
2202 with dynamically allocated memory.
2203
2204 @item
2205 Item 12:  Prefer initialization to assignment in constructors.
2206
2207 @item
2208 Item 14:  Make destructors virtual in base classes.
2209
2210 @item
2211 Item 15:  Have @code{operator=} return a reference to @code{*this}.
2212
2213 @item
2214 Item 23:  Don't try to return a reference when you must return an object.
2215
2216 @end itemize
2217
2218 Also warn about violations of the following style guidelines from
2219 Scott Meyers' @cite{More Effective C++} book:
2220
2221 @itemize @bullet
2222 @item
2223 Item 6:  Distinguish between prefix and postfix forms of increment and
2224 decrement operators.
2225
2226 @item
2227 Item 7:  Never overload @code{&&}, @code{||}, or @code{,}.
2228
2229 @end itemize
2230
2231 When selecting this option, be aware that the standard library
2232 headers do not obey all of these guidelines; use @samp{grep -v}
2233 to filter out those warnings.
2234
2235 @item -Wstrict-null-sentinel @r{(C++ and Objective-C++ only)}
2236 @opindex Wstrict-null-sentinel
2237 @opindex Wno-strict-null-sentinel
2238 Warn also about the use of an uncasted @code{NULL} as sentinel.  When
2239 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
2240 to @code{__null}.  Although it is a null pointer constant not a null pointer,
2241 it is guaranteed to be of the same size as a pointer.  But this use is
2242 not portable across different compilers.
2243
2244 @item -Wno-non-template-friend @r{(C++ and Objective-C++ only)}
2245 @opindex Wno-non-template-friend
2246 @opindex Wnon-template-friend
2247 Disable warnings when non-templatized friend functions are declared
2248 within a template.  Since the advent of explicit template specification
2249 support in G++, if the name of the friend is an unqualified-id (i.e.,
2250 @samp{friend foo(int)}), the C++ language specification demands that the
2251 friend declare or define an ordinary, nontemplate function.  (Section
2252 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
2253 could be interpreted as a particular specialization of a templatized
2254 function.  Because this non-conforming behavior is no longer the default
2255 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
2256 check existing code for potential trouble spots and is on by default.
2257 This new compiler behavior can be turned off with
2258 @option{-Wno-non-template-friend} which keeps the conformant compiler code
2259 but disables the helpful warning.
2260
2261 @item -Wold-style-cast @r{(C++ and Objective-C++ only)}
2262 @opindex Wold-style-cast
2263 @opindex Wno-old-style-cast
2264 Warn if an old-style (C-style) cast to a non-void type is used within
2265 a C++ program.  The new-style casts (@samp{dynamic_cast},
2266 @samp{static_cast}, @samp{reinterpret_cast}, and @samp{const_cast}) are
2267 less vulnerable to unintended effects and much easier to search for.
2268
2269 @item -Woverloaded-virtual @r{(C++ and Objective-C++ only)}
2270 @opindex Woverloaded-virtual
2271 @opindex Wno-overloaded-virtual
2272 @cindex overloaded virtual fn, warning
2273 @cindex warning for overloaded virtual fn
2274 Warn when a function declaration hides virtual functions from a
2275 base class.  For example, in:
2276
2277 @smallexample
2278 struct A @{
2279   virtual void f();
2280 @};
2281
2282 struct B: public A @{
2283   void f(int);
2284 @};
2285 @end smallexample
2286
2287 the @code{A} class version of @code{f} is hidden in @code{B}, and code
2288 like:
2289
2290 @smallexample
2291 B* b;
2292 b->f();
2293 @end smallexample
2294
2295 will fail to compile.
2296
2297 @item -Wno-pmf-conversions @r{(C++ and Objective-C++ only)}
2298 @opindex Wno-pmf-conversions
2299 @opindex Wpmf-conversions
2300 Disable the diagnostic for converting a bound pointer to member function
2301 to a plain pointer.
2302
2303 @item -Wsign-promo @r{(C++ and Objective-C++ only)}
2304 @opindex Wsign-promo
2305 @opindex Wno-sign-promo
2306 Warn when overload resolution chooses a promotion from unsigned or
2307 enumerated type to a signed type, over a conversion to an unsigned type of
2308 the same size.  Previous versions of G++ would try to preserve
2309 unsignedness, but the standard mandates the current behavior.
2310
2311 @smallexample
2312 struct A @{
2313   operator int ();
2314   A& operator = (int);
2315 @};
2316
2317 main ()
2318 @{
2319   A a,b;
2320   a = b;
2321 @}
2322 @end smallexample
2323
2324 In this example, G++ will synthesize a default @samp{A& operator =
2325 (const A&);}, while cfront will use the user-defined @samp{operator =}.
2326 @end table
2327
2328 @node Objective-C and Objective-C++ Dialect Options
2329 @section Options Controlling Objective-C and Objective-C++ Dialects
2330
2331 @cindex compiler options, Objective-C and Objective-C++
2332 @cindex Objective-C and Objective-C++ options, command line
2333 @cindex options, Objective-C and Objective-C++
2334 (NOTE: This manual does not describe the Objective-C and Objective-C++
2335 languages themselves.  See @xref{Standards,,Language Standards
2336 Supported by GCC}, for references.)
2337
2338 This section describes the command-line options that are only meaningful
2339 for Objective-C and Objective-C++ programs, but you can also use most of
2340 the language-independent GNU compiler options.
2341 For example, you might compile a file @code{some_class.m} like this:
2342
2343 @smallexample
2344 gcc -g -fgnu-runtime -O -c some_class.m
2345 @end smallexample
2346
2347 @noindent
2348 In this example, @option{-fgnu-runtime} is an option meant only for
2349 Objective-C and Objective-C++ programs; you can use the other options with
2350 any language supported by GCC@.
2351
2352 Note that since Objective-C is an extension of the C language, Objective-C
2353 compilations may also use options specific to the C front-end (e.g.,
2354 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
2355 C++-specific options (e.g., @option{-Wabi}).
2356
2357 Here is a list of options that are @emph{only} for compiling Objective-C
2358 and Objective-C++ programs:
2359
2360 @table @gcctabopt
2361 @item -fconstant-string-class=@var{class-name}
2362 @opindex fconstant-string-class
2363 Use @var{class-name} as the name of the class to instantiate for each
2364 literal string specified with the syntax @code{@@"@dots{}"}.  The default
2365 class name is @code{NXConstantString} if the GNU runtime is being used, and
2366 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
2367 @option{-fconstant-cfstrings} option, if also present, will override the
2368 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
2369 to be laid out as constant CoreFoundation strings.
2370
2371 @item -fgnu-runtime
2372 @opindex fgnu-runtime
2373 Generate object code compatible with the standard GNU Objective-C
2374 runtime.  This is the default for most types of systems.
2375
2376 @item -fnext-runtime
2377 @opindex fnext-runtime
2378 Generate output compatible with the NeXT runtime.  This is the default
2379 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
2380 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
2381 used.
2382
2383 @item -fno-nil-receivers
2384 @opindex fno-nil-receivers
2385 Assume that all Objective-C message dispatches (e.g.,
2386 @code{[receiver message:arg]}) in this translation unit ensure that the receiver
2387 is not @code{nil}.  This allows for more efficient entry points in the runtime
2388 to be used.  Currently, this option is only available in conjunction with
2389 the NeXT runtime on Mac OS X 10.3 and later.
2390
2391 @item -fobjc-call-cxx-cdtors
2392 @opindex fobjc-call-cxx-cdtors
2393 For each Objective-C class, check if any of its instance variables is a
2394 C++ object with a non-trivial default constructor.  If so, synthesize a
2395 special @code{- (id) .cxx_construct} instance method that will run
2396 non-trivial default constructors on any such instance variables, in order,
2397 and then return @code{self}.  Similarly, check if any instance variable
2398 is a C++ object with a non-trivial destructor, and if so, synthesize a
2399 special @code{- (void) .cxx_destruct} method that will run
2400 all such default destructors, in reverse order.
2401
2402 The @code{- (id) .cxx_construct} and/or @code{- (void) .cxx_destruct} methods
2403 thusly generated will only operate on instance variables declared in the
2404 current Objective-C class, and not those inherited from superclasses.  It
2405 is the responsibility of the Objective-C runtime to invoke all such methods
2406 in an object's inheritance hierarchy.  The @code{- (id) .cxx_construct} methods
2407 will be invoked by the runtime immediately after a new object
2408 instance is allocated; the @code{- (void) .cxx_destruct} methods will
2409 be invoked immediately before the runtime deallocates an object instance.
2410
2411 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
2412 support for invoking the @code{- (id) .cxx_construct} and
2413 @code{- (void) .cxx_destruct} methods.
2414
2415 @item -fobjc-direct-dispatch
2416 @opindex fobjc-direct-dispatch
2417 Allow fast jumps to the message dispatcher.  On Darwin this is
2418 accomplished via the comm page.
2419
2420 @item -fobjc-exceptions
2421 @opindex fobjc-exceptions
2422 Enable syntactic support for structured exception handling in Objective-C,
2423 similar to what is offered by C++ and Java.  This option is
2424 unavailable in conjunction with the NeXT runtime on Mac OS X 10.2 and
2425 earlier.
2426
2427 @smallexample
2428   @@try @{
2429     @dots{}
2430        @@throw expr;
2431     @dots{}
2432   @}
2433   @@catch (AnObjCClass *exc) @{
2434     @dots{}
2435       @@throw expr;
2436     @dots{}
2437       @@throw;
2438     @dots{}
2439   @}
2440   @@catch (AnotherClass *exc) @{
2441     @dots{}
2442   @}
2443   @@catch (id allOthers) @{
2444     @dots{}
2445   @}
2446   @@finally @{
2447     @dots{}
2448       @@throw expr;
2449     @dots{}
2450   @}
2451 @end smallexample
2452
2453 The @code{@@throw} statement may appear anywhere in an Objective-C or
2454 Objective-C++ program; when used inside of a @code{@@catch} block, the
2455 @code{@@throw} may appear without an argument (as shown above), in which case
2456 the object caught by the @code{@@catch} will be rethrown.
2457
2458 Note that only (pointers to) Objective-C objects may be thrown and
2459 caught using this scheme.  When an object is thrown, it will be caught
2460 by the nearest @code{@@catch} clause capable of handling objects of that type,
2461 analogously to how @code{catch} blocks work in C++ and Java.  A
2462 @code{@@catch(id @dots{})} clause (as shown above) may also be provided to catch
2463 any and all Objective-C exceptions not caught by previous @code{@@catch}
2464 clauses (if any).
2465
2466 The @code{@@finally} clause, if present, will be executed upon exit from the
2467 immediately preceding @code{@@try @dots{} @@catch} section.  This will happen
2468 regardless of whether any exceptions are thrown, caught or rethrown
2469 inside the @code{@@try @dots{} @@catch} section, analogously to the behavior
2470 of the @code{finally} clause in Java.
2471
2472 There are several caveats to using the new exception mechanism:
2473
2474 @itemize @bullet
2475 @item
2476 Although currently designed to be binary compatible with @code{NS_HANDLER}-style
2477 idioms provided by the @code{NSException} class, the new
2478 exceptions can only be used on Mac OS X 10.3 (Panther) and later
2479 systems, due to additional functionality needed in the (NeXT) Objective-C
2480 runtime.
2481
2482 @item
2483 As mentioned above, the new exceptions do not support handling
2484 types other than Objective-C objects.   Furthermore, when used from
2485 Objective-C++, the Objective-C exception model does not interoperate with C++
2486 exceptions at this time.  This means you cannot @code{@@throw} an exception
2487 from Objective-C and @code{catch} it in C++, or vice versa
2488 (i.e., @code{throw @dots{} @@catch}).
2489 @end itemize
2490
2491 The @option{-fobjc-exceptions} switch also enables the use of synchronization
2492 blocks for thread-safe execution:
2493
2494 @smallexample
2495   @@synchronized (ObjCClass *guard) @{
2496     @dots{}
2497   @}
2498 @end smallexample
2499
2500 Upon entering the @code{@@synchronized} block, a thread of execution shall
2501 first check whether a lock has been placed on the corresponding @code{guard}
2502 object by another thread.  If it has, the current thread shall wait until
2503 the other thread relinquishes its lock.  Once @code{guard} becomes available,
2504 the current thread will place its own lock on it, execute the code contained in
2505 the @code{@@synchronized} block, and finally relinquish the lock (thereby
2506 making @code{guard} available to other threads).
2507
2508 Unlike Java, Objective-C does not allow for entire methods to be marked
2509 @code{@@synchronized}.  Note that throwing exceptions out of
2510 @code{@@synchronized} blocks is allowed, and will cause the guarding object
2511 to be unlocked properly.
2512
2513 @item -fobjc-gc
2514 @opindex fobjc-gc
2515 Enable garbage collection (GC) in Objective-C and Objective-C++ programs.
2516
2517 @item -freplace-objc-classes
2518 @opindex freplace-objc-classes
2519 Emit a special marker instructing @command{ld(1)} not to statically link in
2520 the resulting object file, and allow @command{dyld(1)} to load it in at
2521 run time instead.  This is used in conjunction with the Fix-and-Continue
2522 debugging mode, where the object file in question may be recompiled and
2523 dynamically reloaded in the course of program execution, without the need
2524 to restart the program itself.  Currently, Fix-and-Continue functionality
2525 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
2526 and later.
2527
2528 @item -fzero-link
2529 @opindex fzero-link
2530 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
2531 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
2532 compile time) with static class references that get initialized at load time,
2533 which improves run-time performance.  Specifying the @option{-fzero-link} flag
2534 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
2535 to be retained.  This is useful in Zero-Link debugging mode, since it allows
2536 for individual class implementations to be modified during program execution.
2537
2538 @item -gen-decls
2539 @opindex gen-decls
2540 Dump interface declarations for all classes seen in the source file to a
2541 file named @file{@var{sourcename}.decl}.
2542
2543 @item -Wassign-intercept @r{(Objective-C and Objective-C++ only)}
2544 @opindex Wassign-intercept
2545 @opindex Wno-assign-intercept
2546 Warn whenever an Objective-C assignment is being intercepted by the
2547 garbage collector.
2548
2549 @item -Wno-protocol @r{(Objective-C and Objective-C++ only)}
2550 @opindex Wno-protocol
2551 @opindex Wprotocol
2552 If a class is declared to implement a protocol, a warning is issued for
2553 every method in the protocol that is not implemented by the class.  The
2554 default behavior is to issue a warning for every method not explicitly
2555 implemented in the class, even if a method implementation is inherited
2556 from the superclass.  If you use the @option{-Wno-protocol} option, then
2557 methods inherited from the superclass are considered to be implemented,
2558 and no warning is issued for them.
2559
2560 @item -Wselector @r{(Objective-C and Objective-C++ only)}
2561 @opindex Wselector
2562 @opindex Wno-selector
2563 Warn if multiple methods of different types for the same selector are
2564 found during compilation.  The check is performed on the list of methods
2565 in the final stage of compilation.  Additionally, a check is performed
2566 for each selector appearing in a @code{@@selector(@dots{})}
2567 expression, and a corresponding method for that selector has been found
2568 during compilation.  Because these checks scan the method table only at
2569 the end of compilation, these warnings are not produced if the final
2570 stage of compilation is not reached, for example because an error is
2571 found during compilation, or because the @option{-fsyntax-only} option is
2572 being used.
2573
2574 @item -Wstrict-selector-match @r{(Objective-C and Objective-C++ only)}
2575 @opindex Wstrict-selector-match
2576 @opindex Wno-strict-selector-match
2577 Warn if multiple methods with differing argument and/or return types are
2578 found for a given selector when attempting to send a message using this
2579 selector to a receiver of type @code{id} or @code{Class}.  When this flag
2580 is off (which is the default behavior), the compiler will omit such warnings
2581 if any differences found are confined to types which share the same size
2582 and alignment.
2583
2584 @item -Wundeclared-selector @r{(Objective-C and Objective-C++ only)}
2585 @opindex Wundeclared-selector
2586 @opindex Wno-undeclared-selector
2587 Warn if a @code{@@selector(@dots{})} expression referring to an
2588 undeclared selector is found.  A selector is considered undeclared if no
2589 method with that name has been declared before the
2590 @code{@@selector(@dots{})} expression, either explicitly in an
2591 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
2592 an @code{@@implementation} section.  This option always performs its
2593 checks as soon as a @code{@@selector(@dots{})} expression is found,
2594 while @option{-Wselector} only performs its checks in the final stage of
2595 compilation.  This also enforces the coding style convention
2596 that methods and selectors must be declared before being used.
2597
2598 @item -print-objc-runtime-info
2599 @opindex print-objc-runtime-info
2600 Generate C header describing the largest structure that is passed by
2601 value, if any.
2602
2603 @end table
2604
2605 @node Language Independent Options
2606 @section Options to Control Diagnostic Messages Formatting
2607 @cindex options to control diagnostics formatting
2608 @cindex diagnostic messages
2609 @cindex message formatting
2610
2611 Traditionally, diagnostic messages have been formatted irrespective of
2612 the output device's aspect (e.g.@: its width, @dots{}).  The options described
2613 below can be used to control the diagnostic messages formatting
2614 algorithm, e.g.@: how many characters per line, how often source location
2615 information should be reported.  Right now, only the C++ front end can
2616 honor these options.  However it is expected, in the near future, that
2617 the remaining front ends would be able to digest them correctly.
2618
2619 @table @gcctabopt
2620 @item -fmessage-length=@var{n}
2621 @opindex fmessage-length
2622 Try to format error messages so that they fit on lines of about @var{n}
2623 characters.  The default is 72 characters for @command{g++} and 0 for the rest of
2624 the front ends supported by GCC@.  If @var{n} is zero, then no
2625 line-wrapping will be done; each error message will appear on a single
2626 line.
2627
2628 @opindex fdiagnostics-show-location
2629 @item -fdiagnostics-show-location=once
2630 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
2631 reporter to emit @emph{once} source location information; that is, in
2632 case the message is too long to fit on a single physical line and has to
2633 be wrapped, the source location won't be emitted (as prefix) again,
2634 over and over, in subsequent continuation lines.  This is the default
2635 behavior.
2636
2637 @item -fdiagnostics-show-location=every-line
2638 Only meaningful in line-wrapping mode.  Instructs the diagnostic
2639 messages reporter to emit the same source location information (as
2640 prefix) for physical lines that result from the process of breaking
2641 a message which is too long to fit on a single line.
2642
2643 @item -fdiagnostics-show-option
2644 @opindex fdiagnostics-show-option
2645 This option instructs the diagnostic machinery to add text to each
2646 diagnostic emitted, which indicates which command line option directly
2647 controls that diagnostic, when such an option is known to the
2648 diagnostic machinery.
2649
2650 @item -Wcoverage-mismatch
2651 @opindex Wcoverage-mismatch
2652 Warn if feedback profiles do not match when using the
2653 @option{-fprofile-use} option.
2654 If a source file was changed between @option{-fprofile-gen} and
2655 @option{-fprofile-use}, the files with the profile feedback can fail
2656 to match the source file and GCC can not use the profile feedback
2657 information.  By default, GCC emits an error message in this case.
2658 The option @option{-Wcoverage-mismatch} emits a warning instead of an
2659 error.  GCC does not use appropriate feedback profiles, so using this
2660 option can result in poorly optimized code.  This option is useful
2661 only in the case of very minor changes such as bug fixes to an
2662 existing code-base.
2663
2664 @end table
2665
2666 @node Warning Options
2667 @section Options to Request or Suppress Warnings
2668 @cindex options to control warnings
2669 @cindex warning messages
2670 @cindex messages, warning
2671 @cindex suppressing warnings
2672
2673 Warnings are diagnostic messages that report constructions which
2674 are not inherently erroneous but which are risky or suggest there
2675 may have been an error.
2676
2677 The following language-independent options do not enable specific
2678 warnings but control the kinds of diagnostics produced by GCC.
2679
2680 @table @gcctabopt
2681 @cindex syntax checking
2682 @item -fsyntax-only
2683 @opindex fsyntax-only
2684 Check the code for syntax errors, but don't do anything beyond that.
2685
2686 @item -w
2687 @opindex w
2688 Inhibit all warning messages.
2689
2690 @item -Werror
2691 @opindex Werror
2692 @opindex Wno-error
2693 Make all warnings into errors.
2694
2695 @item -Werror=
2696 @opindex Werror=
2697 @opindex Wno-error=
2698 Make the specified warning into an error.  The specifier for a warning
2699 is appended, for example @option{-Werror=switch} turns the warnings
2700 controlled by @option{-Wswitch} into errors.  This switch takes a
2701 negative form, to be used to negate @option{-Werror} for specific
2702 warnings, for example @option{-Wno-error=switch} makes
2703 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
2704 is in effect.  You can use the @option{-fdiagnostics-show-option}
2705 option to have each controllable warning amended with the option which
2706 controls it, to determine what to use with this option.
2707
2708 Note that specifying @option{-Werror=}@var{foo} automatically implies
2709 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
2710 imply anything.
2711
2712 @item -Wfatal-errors
2713 @opindex Wfatal-errors
2714 @opindex Wno-fatal-errors
2715 This option causes the compiler to abort compilation on the first error
2716 occurred rather than trying to keep going and printing further error
2717 messages.
2718
2719 @end table
2720
2721 You can request many specific warnings with options beginning
2722 @samp{-W}, for example @option{-Wimplicit} to request warnings on
2723 implicit declarations.  Each of these specific warning options also
2724 has a negative form beginning @samp{-Wno-} to turn off warnings; for
2725 example, @option{-Wno-implicit}.  This manual lists only one of the
2726 two forms, whichever is not the default.  For further,
2727 language-specific options also refer to @ref{C++ Dialect Options} and
2728 @ref{Objective-C and Objective-C++ Dialect Options}.
2729
2730 @table @gcctabopt
2731 @item -pedantic
2732 @opindex pedantic
2733 Issue all the warnings demanded by strict ISO C and ISO C++;
2734 reject all programs that use forbidden extensions, and some other
2735 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
2736 version of the ISO C standard specified by any @option{-std} option used.
2737
2738 Valid ISO C and ISO C++ programs should compile properly with or without
2739 this option (though a rare few will require @option{-ansi} or a
2740 @option{-std} option specifying the required version of ISO C)@.  However,
2741 without this option, certain GNU extensions and traditional C and C++
2742 features are supported as well.  With this option, they are rejected.
2743
2744 @option{-pedantic} does not cause warning messages for use of the
2745 alternate keywords whose names begin and end with @samp{__}.  Pedantic
2746 warnings are also disabled in the expression that follows
2747 @code{__extension__}.  However, only system header files should use
2748 these escape routes; application programs should avoid them.
2749 @xref{Alternate Keywords}.
2750
2751 Some users try to use @option{-pedantic} to check programs for strict ISO
2752 C conformance.  They soon find that it does not do quite what they want:
2753 it finds some non-ISO practices, but not all---only those for which
2754 ISO C @emph{requires} a diagnostic, and some others for which
2755 diagnostics have been added.
2756
2757 A feature to report any failure to conform to ISO C might be useful in
2758 some instances, but would require considerable additional work and would
2759 be quite different from @option{-pedantic}.  We don't have plans to
2760 support such a feature in the near future.
2761
2762 Where the standard specified with @option{-std} represents a GNU
2763 extended dialect of C, such as @samp{gnu89} or @samp{gnu99}, there is a
2764 corresponding @dfn{base standard}, the version of ISO C on which the GNU
2765 extended dialect is based.  Warnings from @option{-pedantic} are given
2766 where they are required by the base standard.  (It would not make sense
2767 for such warnings to be given only for features not in the specified GNU
2768 C dialect, since by definition the GNU dialects of C include all
2769 features the compiler supports with the given option, and there would be
2770 nothing to warn about.)
2771
2772 @item -pedantic-errors
2773 @opindex pedantic-errors
2774 Like @option{-pedantic}, except that errors are produced rather than
2775 warnings.
2776
2777 @item -Wall
2778 @opindex Wall
2779 @opindex Wno-all
2780 This enables all the warnings about constructions that some users
2781 consider questionable, and that are easy to avoid (or modify to
2782 prevent the warning), even in conjunction with macros.  This also
2783 enables some language-specific warnings described in @ref{C++ Dialect
2784 Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
2785
2786 @option{-Wall} turns on the following warning flags:
2787
2788 @gccoptlist{-Waddress   @gol
2789 -Warray-bounds @r{(only with} @option{-O2}@r{)}  @gol
2790 -Wc++0x-compat  @gol
2791 -Wchar-subscripts  @gol
2792 -Wenum-compare @r{(in C/Objc; this is on by default in C++)} @gol
2793 -Wimplicit-int  @gol
2794 -Wimplicit-function-declaration  @gol
2795 -Wcomment  @gol
2796 -Wformat   @gol
2797 -Wmain @r{(only for C/ObjC and unless} @option{-ffreestanding}@r{)}  @gol
2798 -Wmissing-braces  @gol
2799 -Wnonnull  @gol
2800 -Wparentheses  @gol
2801 -Wpointer-sign  @gol
2802 -Wreorder   @gol
2803 -Wreturn-type  @gol
2804 -Wsequence-point  @gol
2805 -Wsign-compare @r{(only in C++)}  @gol
2806 -Wstrict-aliasing  @gol
2807 -Wstrict-overflow=1  @gol
2808 -Wswitch  @gol
2809 -Wtrigraphs  @gol
2810 -Wuninitialized  @gol
2811 -Wunknown-pragmas  @gol
2812 -Wunused-function  @gol
2813 -Wunused-label     @gol
2814 -Wunused-value     @gol
2815 -Wunused-variable  @gol
2816 -Wvolatile-register-var @gol
2817 }
2818
2819 Note that some warning flags are not implied by @option{-Wall}.  Some of
2820 them warn about constructions that users generally do not consider
2821 questionable, but which occasionally you might wish to check for;
2822 others warn about constructions that are necessary or hard to avoid in
2823 some cases, and there is no simple way to modify the code to suppress
2824 the warning. Some of them are enabled by @option{-Wextra} but many of
2825 them must be enabled individually.
2826
2827 @item -Wextra
2828 @opindex W
2829 @opindex Wextra
2830 @opindex Wno-extra
2831 This enables some extra warning flags that are not enabled by
2832 @option{-Wall}. (This option used to be called @option{-W}.  The older
2833 name is still supported, but the newer name is more descriptive.)
2834
2835 @gccoptlist{-Wclobbered  @gol
2836 -Wempty-body  @gol
2837 -Wignored-qualifiers @gol
2838 -Wmissing-field-initializers  @gol
2839 -Wmissing-parameter-type @r{(C only)}  @gol
2840 -Wold-style-declaration @r{(C only)}  @gol
2841 -Woverride-init  @gol
2842 -Wsign-compare  @gol
2843 -Wtype-limits  @gol
2844 -Wuninitialized  @gol
2845 -Wunused-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)}  @gol
2846 }
2847
2848 The option @option{-Wextra} also prints warning messages for the
2849 following cases:
2850
2851 @itemize @bullet
2852
2853 @item
2854 A pointer is compared against integer zero with @samp{<}, @samp{<=},
2855 @samp{>}, or @samp{>=}.
2856
2857 @item
2858 (C++ only) An enumerator and a non-enumerator both appear in a
2859 conditional expression.
2860
2861 @item
2862 (C++ only) Ambiguous virtual bases.
2863
2864 @item
2865 (C++ only) Subscripting an array which has been declared @samp{register}.
2866
2867 @item
2868 (C++ only) Taking the address of a variable which has been declared
2869 @samp{register}.
2870
2871 @item
2872 (C++ only) A base class is not initialized in a derived class' copy
2873 constructor.
2874
2875 @end itemize
2876
2877 @item -Wchar-subscripts
2878 @opindex Wchar-subscripts
2879 @opindex Wno-char-subscripts
2880 Warn if an array subscript has type @code{char}.  This is a common cause
2881 of error, as programmers often forget that this type is signed on some
2882 machines.
2883 This warning is enabled by @option{-Wall}.
2884
2885 @item -Wcomment
2886 @opindex Wcomment
2887 @opindex Wno-comment
2888 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
2889 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
2890 This warning is enabled by @option{-Wall}.
2891
2892 @item -Wformat
2893 @opindex Wformat
2894 @opindex Wno-format
2895 @opindex ffreestanding
2896 @opindex fno-builtin
2897 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
2898 the arguments supplied have types appropriate to the format string
2899 specified, and that the conversions specified in the format string make
2900 sense.  This includes standard functions, and others specified by format
2901 attributes (@pxref{Function Attributes}), in the @code{printf},
2902 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
2903 not in the C standard) families (or other target-specific families).
2904 Which functions are checked without format attributes having been
2905 specified depends on the standard version selected, and such checks of
2906 functions without the attribute specified are disabled by
2907 @option{-ffreestanding} or @option{-fno-builtin}.
2908
2909 The formats are checked against the format features supported by GNU
2910 libc version 2.2.  These include all ISO C90 and C99 features, as well
2911 as features from the Single Unix Specification and some BSD and GNU
2912 extensions.  Other library implementations may not support all these
2913 features; GCC does not support warning about features that go beyond a
2914 particular library's limitations.  However, if @option{-pedantic} is used
2915 with @option{-Wformat}, warnings will be given about format features not
2916 in the selected standard version (but not for @code{strfmon} formats,
2917 since those are not in any version of the C standard).  @xref{C Dialect
2918 Options,,Options Controlling C Dialect}.
2919
2920 Since @option{-Wformat} also checks for null format arguments for
2921 several functions, @option{-Wformat} also implies @option{-Wnonnull}.
2922
2923 @option{-Wformat} is included in @option{-Wall}.  For more control over some
2924 aspects of format checking, the options @option{-Wformat-y2k},
2925 @option{-Wno-format-extra-args}, @option{-Wno-format-zero-length},
2926 @option{-Wformat-nonliteral}, @option{-Wformat-security}, and
2927 @option{-Wformat=2} are available, but are not included in @option{-Wall}.
2928
2929 @item -Wformat-y2k
2930 @opindex Wformat-y2k
2931 @opindex Wno-format-y2k
2932 If @option{-Wformat} is specified, also warn about @code{strftime}
2933 formats which may yield only a two-digit year.
2934
2935 @item -Wno-format-contains-nul
2936 @opindex Wno-format-contains-nul
2937 @opindex Wformat-contains-nul
2938 If @option{-Wformat} is specified, do not warn about format strings that
2939 contain NUL bytes.
2940
2941 @item -Wno-format-extra-args
2942 @opindex Wno-format-extra-args
2943 @opindex Wformat-extra-args
2944 If @option{-Wformat} is specified, do not warn about excess arguments to a
2945 @code{printf} or @code{scanf} format function.  The C standard specifies
2946 that such arguments are ignored.
2947
2948 Where the unused arguments lie between used arguments that are
2949 specified with @samp{$} operand number specifications, normally
2950 warnings are still given, since the implementation could not know what
2951 type to pass to @code{va_arg} to skip the unused arguments.  However,
2952 in the case of @code{scanf} formats, this option will suppress the
2953 warning if the unused arguments are all pointers, since the Single
2954 Unix Specification says that such unused arguments are allowed.
2955
2956 @item -Wno-format-zero-length @r{(C and Objective-C only)}
2957 @opindex Wno-format-zero-length
2958 @opindex Wformat-zero-length
2959 If @option{-Wformat} is specified, do not warn about zero-length formats.
2960 The C standard specifies that zero-length formats are allowed.
2961
2962 @item -Wformat-nonliteral
2963 @opindex Wformat-nonliteral
2964 @opindex Wno-format-nonliteral
2965 If @option{-Wformat} is specified, also warn if the format string is not a
2966 string literal and so cannot be checked, unless the format function
2967 takes its format arguments as a @code{va_list}.
2968
2969 @item -Wformat-security
2970 @opindex Wformat-security
2971 @opindex Wno-format-security
2972 If @option{-Wformat} is specified, also warn about uses of format
2973 functions that represent possible security problems.  At present, this
2974 warns about calls to @code{printf} and @code{scanf} functions where the
2975 format string is not a string literal and there are no format arguments,
2976 as in @code{printf (foo);}.  This may be a security hole if the format
2977 string came from untrusted input and contains @samp{%n}.  (This is
2978 currently a subset of what @option{-Wformat-nonliteral} warns about, but
2979 in future warnings may be added to @option{-Wformat-security} that are not
2980 included in @option{-Wformat-nonliteral}.)
2981
2982 @item -Wformat=2
2983 @opindex Wformat=2
2984 @opindex Wno-format=2
2985 Enable @option{-Wformat} plus format checks not included in
2986 @option{-Wformat}.  Currently equivalent to @samp{-Wformat
2987 -Wformat-nonliteral -Wformat-security -Wformat-y2k}.
2988
2989 @item -Wnonnull @r{(C and Objective-C only)}
2990 @opindex Wnonnull
2991 @opindex Wno-nonnull
2992 Warn about passing a null pointer for arguments marked as
2993 requiring a non-null value by the @code{nonnull} function attribute.
2994
2995 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
2996 can be disabled with the @option{-Wno-nonnull} option.
2997
2998 @item -Wjump-misses-init @r{(C, Objective-C only)}
2999 @opindex Wjump-misses-init
3000 @opindex Wno-jump-misses-init
3001 Warn if a @code{goto} statement or a @code{switch} statement jumps
3002 forward across the initialization of a variable, or jumps backward to a
3003 label after the variable has been initialized.  This only warns about
3004 variables which are initialized when they are declared.  This warning is
3005 only supported for C and Objective C; in C++ this sort of branch is an
3006 error in any case.
3007
3008 @option{-Wjump-misses-init} is included in @option{-Wall} and
3009 @option{-Wc++-compat}.  It can be disabled with the
3010 @option{-Wno-jump-misses-init} option.
3011
3012 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
3013 @opindex Winit-self
3014 @opindex Wno-init-self
3015 Warn about uninitialized variables which are initialized with themselves.
3016 Note this option can only be used with the @option{-Wuninitialized} option.
3017
3018 For example, GCC will warn about @code{i} being uninitialized in the
3019 following snippet only when @option{-Winit-self} has been specified:
3020 @smallexample
3021 @group
3022 int f()
3023 @{
3024   int i = i;
3025   return i;
3026 @}
3027 @end group
3028 @end smallexample
3029
3030 @item -Wimplicit-int @r{(C and Objective-C only)}
3031 @opindex Wimplicit-int
3032 @opindex Wno-implicit-int
3033 Warn when a declaration does not specify a type.
3034 This warning is enabled by @option{-Wall}.
3035
3036 @item -Wimplicit-function-declaration @r{(C and Objective-C only)}
3037 @opindex Wimplicit-function-declaration
3038 @opindex Wno-implicit-function-declaration
3039 Give a warning whenever a function is used before being declared. In
3040 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
3041 enabled by default and it is made into an error by
3042 @option{-pedantic-errors}. This warning is also enabled by
3043 @option{-Wall}.
3044
3045 @item -Wimplicit
3046 @opindex Wimplicit
3047 @opindex Wno-implicit
3048 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
3049 This warning is enabled by @option{-Wall}.
3050
3051 @item -Wignored-qualifiers @r{(C and C++ only)}
3052 @opindex Wignored-qualifiers
3053 @opindex Wno-ignored-qualifiers
3054 Warn if the return type of a function has a type qualifier
3055 such as @code{const}.  For ISO C such a type qualifier has no effect,
3056 since the value returned by a function is not an lvalue.
3057 For C++, the warning is only emitted for scalar types or @code{void}.
3058 ISO C prohibits qualified @code{void} return types on function
3059 definitions, so such return types always receive a warning
3060 even without this option.
3061
3062 This warning is also enabled by @option{-Wextra}.
3063
3064 @item -Wmain
3065 @opindex Wmain
3066 @opindex Wno-main
3067 Warn if the type of @samp{main} is suspicious.  @samp{main} should be
3068 a function with external linkage, returning int, taking either zero
3069 arguments, two, or three arguments of appropriate types.  This warning
3070 is enabled by default in C++ and is enabled by either @option{-Wall}
3071 or @option{-pedantic}.
3072
3073 @item -Wmissing-braces
3074 @opindex Wmissing-braces
3075 @opindex Wno-missing-braces
3076 Warn if an aggregate or union initializer is not fully bracketed.  In
3077 the following example, the initializer for @samp{a} is not fully
3078 bracketed, but that for @samp{b} is fully bracketed.
3079
3080 @smallexample
3081 int a[2][2] = @{ 0, 1, 2, 3 @};
3082 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
3083 @end smallexample
3084
3085 This warning is enabled by @option{-Wall}.
3086
3087 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
3088 @opindex Wmissing-include-dirs
3089 @opindex Wno-missing-include-dirs
3090 Warn if a user-supplied include directory does not exist.
3091
3092 @item -Wparentheses
3093 @opindex Wparentheses
3094 @opindex Wno-parentheses
3095 Warn if parentheses are omitted in certain contexts, such
3096 as when there is an assignment in a context where a truth value
3097 is expected, or when operators are nested whose precedence people
3098 often get confused about.
3099
3100 Also warn if a comparison like @samp{x<=y<=z} appears; this is
3101 equivalent to @samp{(x<=y ? 1 : 0) <= z}, which is a different
3102 interpretation from that of ordinary mathematical notation.
3103
3104 Also warn about constructions where there may be confusion to which
3105 @code{if} statement an @code{else} branch belongs.  Here is an example of
3106 such a case:
3107
3108 @smallexample
3109 @group
3110 @{
3111   if (a)
3112     if (b)
3113       foo ();
3114   else
3115     bar ();
3116 @}
3117 @end group
3118 @end smallexample
3119
3120 In C/C++, every @code{else} branch belongs to the innermost possible
3121 @code{if} statement, which in this example is @code{if (b)}.  This is
3122 often not what the programmer expected, as illustrated in the above
3123 example by indentation the programmer chose.  When there is the
3124 potential for this confusion, GCC will issue a warning when this flag
3125 is specified.  To eliminate the warning, add explicit braces around
3126 the innermost @code{if} statement so there is no way the @code{else}
3127 could belong to the enclosing @code{if}.  The resulting code would
3128 look like this:
3129
3130 @smallexample
3131 @group
3132 @{
3133   if (a)
3134     @{
3135       if (b)
3136         foo ();
3137       else
3138         bar ();
3139     @}
3140 @}
3141 @end group
3142 @end smallexample
3143
3144 This warning is enabled by @option{-Wall}.
3145
3146 @item -Wsequence-point
3147 @opindex Wsequence-point
3148 @opindex Wno-sequence-point
3149 Warn about code that may have undefined semantics because of violations
3150 of sequence point rules in the C and C++ standards.
3151
3152 The C and C++ standards defines the order in which expressions in a C/C++
3153 program are evaluated in terms of @dfn{sequence points}, which represent
3154 a partial ordering between the execution of parts of the program: those
3155 executed before the sequence point, and those executed after it.  These
3156 occur after the evaluation of a full expression (one which is not part
3157 of a larger expression), after the evaluation of the first operand of a
3158 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
3159 function is called (but after the evaluation of its arguments and the
3160 expression denoting the called function), and in certain other places.
3161 Other than as expressed by the sequence point rules, the order of
3162 evaluation of subexpressions of an expression is not specified.  All
3163 these rules describe only a partial order rather than a total order,
3164 since, for example, if two functions are called within one expression
3165 with no sequence point between them, the order in which the functions
3166 are called is not specified.  However, the standards committee have
3167 ruled that function calls do not overlap.
3168
3169 It is not specified when between sequence points modifications to the
3170 values of objects take effect.  Programs whose behavior depends on this
3171 have undefined behavior; the C and C++ standards specify that ``Between
3172 the previous and next sequence point an object shall have its stored
3173 value modified at most once by the evaluation of an expression.
3174 Furthermore, the prior value shall be read only to determine the value
3175 to be stored.''.  If a program breaks these rules, the results on any
3176 particular implementation are entirely unpredictable.
3177
3178 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
3179 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
3180 diagnosed by this option, and it may give an occasional false positive
3181 result, but in general it has been found fairly effective at detecting
3182 this sort of problem in programs.
3183
3184 The standard is worded confusingly, therefore there is some debate
3185 over the precise meaning of the sequence point rules in subtle cases.
3186 Links to discussions of the problem, including proposed formal
3187 definitions, may be found on the GCC readings page, at
3188 @w{@uref{http://gcc.gnu.org/readings.html}}.
3189
3190 This warning is enabled by @option{-Wall} for C and C++.
3191
3192 @item -Wreturn-type
3193 @opindex Wreturn-type
3194 @opindex Wno-return-type
3195 Warn whenever a function is defined with a return-type that defaults
3196 to @code{int}.  Also warn about any @code{return} statement with no
3197 return-value in a function whose return-type is not @code{void}
3198 (falling off the end of the function body is considered returning
3199 without a value), and about a @code{return} statement with an
3200 expression in a function whose return-type is @code{void}.
3201
3202 For C++, a function without return type always produces a diagnostic
3203 message, even when @option{-Wno-return-type} is specified.  The only
3204 exceptions are @samp{main} and functions defined in system headers.
3205
3206 This warning is enabled by @option{-Wall}.
3207
3208 @item -Wswitch
3209 @opindex Wswitch
3210 @opindex Wno-switch
3211 Warn whenever a @code{switch} statement has an index of enumerated type
3212 and lacks a @code{case} for one or more of the named codes of that
3213 enumeration.  (The presence of a @code{default} label prevents this
3214 warning.)  @code{case} labels outside the enumeration range also
3215 provoke warnings when this option is used (even if there is a
3216 @code{default} label).
3217 This warning is enabled by @option{-Wall}.
3218
3219 @item -Wswitch-default
3220 @opindex Wswitch-default
3221 @opindex Wno-switch-default
3222 Warn whenever a @code{switch} statement does not have a @code{default}
3223 case.
3224
3225 @item -Wswitch-enum
3226 @opindex Wswitch-enum
3227 @opindex Wno-switch-enum
3228 Warn whenever a @code{switch} statement has an index of enumerated type
3229 and lacks a @code{case} for one or more of the named codes of that
3230 enumeration.  @code{case} labels outside the enumeration range also
3231 provoke warnings when this option is used.  The only difference
3232 between @option{-Wswitch} and this option is that this option gives a
3233 warning about an omitted enumeration code even if there is a
3234 @code{default} label.
3235
3236 @item -Wsync-nand @r{(C and C++ only)}
3237 @opindex Wsync-nand
3238 @opindex Wno-sync-nand
3239 Warn when @code{__sync_fetch_and_nand} and @code{__sync_nand_and_fetch}
3240 built-in functions are used.  These functions changed semantics in GCC 4.4.
3241
3242 @item -Wtrigraphs
3243 @opindex Wtrigraphs
3244 @opindex Wno-trigraphs
3245 Warn if any trigraphs are encountered that might change the meaning of
3246 the program (trigraphs within comments are not warned about).
3247 This warning is enabled by @option{-Wall}.
3248
3249 @item -Wunused-function
3250 @opindex Wunused-function
3251 @opindex Wno-unused-function
3252 Warn whenever a static function is declared but not defined or a
3253 non-inline static function is unused.
3254 This warning is enabled by @option{-Wall}.
3255
3256 @item -Wunused-label
3257 @opindex Wunused-label
3258 @opindex Wno-unused-label
3259 Warn whenever a label is declared but not used.
3260 This warning is enabled by @option{-Wall}.
3261
3262 To suppress this warning use the @samp{unused} attribute
3263 (@pxref{Variable Attributes}).
3264
3265 @item -Wunused-parameter
3266 @opindex Wunused-parameter
3267 @opindex Wno-unused-parameter
3268 Warn whenever a function parameter is unused aside from its declaration.
3269
3270 To suppress this warning use the @samp{unused} attribute
3271 (@pxref{Variable Attributes}).
3272
3273 @item -Wno-unused-result
3274 @opindex Wunused-result
3275 @opindex Wno-unused-result
3276 Do not warn if a caller of a function marked with attribute
3277 @code{warn_unused_result} (@pxref{Variable Attributes}) does not use
3278 its return value. The default is @option{-Wunused-result}.
3279
3280 @item -Wunused-variable
3281 @opindex Wunused-variable
3282 @opindex Wno-unused-variable
3283 Warn whenever a local variable or non-constant static variable is unused
3284 aside from its declaration.
3285 This warning is enabled by @option{-Wall}.
3286
3287 To suppress this warning use the @samp{unused} attribute
3288 (@pxref{Variable Attributes}).
3289
3290 @item -Wunused-value
3291 @opindex Wunused-value
3292 @opindex Wno-unused-value
3293 Warn whenever a statement computes a result that is explicitly not
3294 used. To suppress this warning cast the unused expression to
3295 @samp{void}. This includes an expression-statement or the left-hand
3296 side of a comma expression that contains no side effects. For example,
3297 an expression such as @samp{x[i,j]} will cause a warning, while
3298 @samp{x[(void)i,j]} will not.
3299
3300 This warning is enabled by @option{-Wall}.
3301
3302 @item -Wunused
3303 @opindex Wunused
3304 @opindex Wno-unused
3305 All the above @option{-Wunused} options combined.
3306
3307 In order to get a warning about an unused function parameter, you must
3308 either specify @samp{-Wextra -Wunused} (note that @samp{-Wall} implies
3309 @samp{-Wunused}), or separately specify @option{-Wunused-parameter}.
3310
3311 @item -Wuninitialized
3312 @opindex Wuninitialized
3313 @opindex Wno-uninitialized
3314 Warn if an automatic variable is used without first being initialized
3315 or if a variable may be clobbered by a @code{setjmp} call. In C++,
3316 warn if a non-static reference or non-static @samp{const} member
3317 appears in a class without constructors.
3318
3319 If you want to warn about code which uses the uninitialized value of the
3320 variable in its own initializer, use the @option{-Winit-self} option.
3321
3322 These warnings occur for individual uninitialized or clobbered
3323 elements of structure, union or array variables as well as for
3324 variables which are uninitialized or clobbered as a whole.  They do
3325 not occur for variables or elements declared @code{volatile}.  Because
3326 these warnings depend on optimization, the exact variables or elements
3327 for which there are warnings will depend on the precise optimization
3328 options and version of GCC used.
3329
3330 Note that there may be no warning about a variable that is used only
3331 to compute a value that itself is never used, because such
3332 computations may be deleted by data flow analysis before the warnings
3333 are printed.
3334
3335 These warnings are made optional because GCC is not smart
3336 enough to see all the reasons why the code might be correct
3337 despite appearing to have an error.  Here is one example of how
3338 this can happen:
3339
3340 @smallexample
3341 @group
3342 @{
3343   int x;
3344   switch (y)
3345     @{
3346     case 1: x = 1;
3347       break;
3348     case 2: x = 4;
3349       break;
3350     case 3: x = 5;
3351     @}
3352   foo (x);
3353 @}
3354 @end group
3355 @end smallexample
3356
3357 @noindent
3358 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
3359 always initialized, but GCC doesn't know this.  Here is
3360 another common case:
3361
3362 @smallexample
3363 @{
3364   int save_y;
3365   if (change_y) save_y = y, y = new_y;
3366   @dots{}
3367   if (change_y) y = save_y;
3368 @}
3369 @end smallexample
3370
3371 @noindent
3372 This has no bug because @code{save_y} is used only if it is set.
3373
3374 @cindex @code{longjmp} warnings
3375 This option also warns when a non-volatile automatic variable might be
3376 changed by a call to @code{longjmp}.  These warnings as well are possible
3377 only in optimizing compilation.
3378
3379 The compiler sees only the calls to @code{setjmp}.  It cannot know
3380 where @code{longjmp} will be called; in fact, a signal handler could
3381 call it at any point in the code.  As a result, you may get a warning
3382 even when there is in fact no problem because @code{longjmp} cannot
3383 in fact be called at the place which would cause a problem.
3384
3385 Some spurious warnings can be avoided if you declare all the functions
3386 you use that never return as @code{noreturn}.  @xref{Function
3387 Attributes}.
3388
3389 This warning is enabled by @option{-Wall} or @option{-Wextra}.
3390
3391 @item -Wunknown-pragmas
3392 @opindex Wunknown-pragmas
3393 @opindex Wno-unknown-pragmas
3394 @cindex warning for unknown pragmas
3395 @cindex unknown pragmas, warning
3396 @cindex pragmas, warning of unknown
3397 Warn when a #pragma directive is encountered which is not understood by
3398 GCC@.  If this command line option is used, warnings will even be issued
3399 for unknown pragmas in system header files.  This is not the case if
3400 the warnings were only enabled by the @option{-Wall} command line option.
3401
3402 @item -Wno-pragmas
3403 @opindex Wno-pragmas
3404 @opindex Wpragmas
3405 Do not warn about misuses of pragmas, such as incorrect parameters,
3406 invalid syntax, or conflicts between pragmas.  See also
3407 @samp{-Wunknown-pragmas}.
3408
3409 @item -Wstrict-aliasing
3410 @opindex Wstrict-aliasing
3411 @opindex Wno-strict-aliasing
3412 This option is only active when @option{-fstrict-aliasing} is active.
3413 It warns about code which might break the strict aliasing rules that the
3414 compiler is using for optimization.  The warning does not catch all
3415 cases, but does attempt to catch the more common pitfalls.  It is
3416 included in @option{-Wall}.
3417 It is equivalent to @option{-Wstrict-aliasing=3}
3418
3419 @item -Wstrict-aliasing=n
3420 @opindex Wstrict-aliasing=n
3421 @opindex Wno-strict-aliasing=n
3422 This option is only active when @option{-fstrict-aliasing} is active.
3423 It warns about code which might break the strict aliasing rules that the
3424 compiler is using for optimization.
3425 Higher levels correspond to higher accuracy (fewer false positives).
3426 Higher levels also correspond to more effort, similar to the way -O works.
3427 @option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=n},
3428 with n=3.
3429
3430 Level 1: Most aggressive, quick, least accurate.
3431 Possibly useful when higher levels
3432 do not warn but -fstrict-aliasing still breaks the code, as it has very few
3433 false negatives.  However, it has many false positives.
3434 Warns for all pointer conversions between possibly incompatible types,
3435 even if never dereferenced.  Runs in the frontend only.
3436
3437 Level 2: Aggressive, quick, not too precise.
3438 May still have many false positives (not as many as level 1 though),
3439 and few false negatives (but possibly more than level 1).
3440 Unlike level 1, it only warns when an address is taken.  Warns about
3441 incomplete types.  Runs in the frontend only.
3442
3443 Level 3 (default for @option{-Wstrict-aliasing}):
3444 Should have very few false positives and few false
3445 negatives.  Slightly slower than levels 1 or 2 when optimization is enabled.
3446 Takes care of the common punn+dereference pattern in the frontend:
3447 @code{*(int*)&some_float}.
3448 If optimization is enabled, it also runs in the backend, where it deals
3449 with multiple statement cases using flow-sensitive points-to information.
3450 Only warns when the converted pointer is dereferenced.
3451 Does not warn about incomplete types.
3452
3453 @item -Wstrict-overflow
3454 @itemx -Wstrict-overflow=@var{n}
3455 @opindex Wstrict-overflow
3456 @opindex Wno-strict-overflow
3457 This option is only active when @option{-fstrict-overflow} is active.
3458 It warns about cases where the compiler optimizes based on the
3459 assumption that signed overflow does not occur.  Note that it does not
3460 warn about all cases where the code might overflow: it only warns
3461 about cases where the compiler implements some optimization.  Thus
3462 this warning depends on the optimization level.
3463
3464 An optimization which assumes that signed overflow does not occur is
3465 perfectly safe if the values of the variables involved are such that
3466 overflow never does, in fact, occur.  Therefore this warning can
3467 easily give a false positive: a warning about code which is not
3468 actually a problem.  To help focus on important issues, several
3469 warning levels are defined.  No warnings are issued for the use of
3470 undefined signed overflow when estimating how many iterations a loop
3471 will require, in particular when determining whether a loop will be
3472 executed at all.
3473
3474 @table @gcctabopt
3475 @item -Wstrict-overflow=1
3476 Warn about cases which are both questionable and easy to avoid.  For
3477 example: @code{x + 1 > x}; with @option{-fstrict-overflow}, the
3478 compiler will simplify this to @code{1}.  This level of
3479 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
3480 are not, and must be explicitly requested.
3481
3482 @item -Wstrict-overflow=2
3483 Also warn about other cases where a comparison is simplified to a
3484 constant.  For example: @code{abs (x) >= 0}.  This can only be
3485 simplified when @option{-fstrict-overflow} is in effect, because
3486 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
3487 zero.  @option{-Wstrict-overflow} (with no level) is the same as
3488 @option{-Wstrict-overflow=2}.
3489
3490 @item -Wstrict-overflow=3
3491 Also warn about other cases where a comparison is simplified.  For
3492 example: @code{x + 1 > 1} will be simplified to @code{x > 0}.
3493
3494 @item -Wstrict-overflow=4
3495 Also warn about other simplifications not covered by the above cases.
3496 For example: @code{(x * 10) / 5} will be simplified to @code{x * 2}.
3497
3498 @item -Wstrict-overflow=5
3499 Also warn about cases where the compiler reduces the magnitude of a
3500 constant involved in a comparison.  For example: @code{x + 2 > y} will
3501 be simplified to @code{x + 1 >= y}.  This is reported only at the
3502 highest warning level because this simplification applies to many
3503 comparisons, so this warning level will give a very large number of
3504 false positives.
3505 @end table
3506
3507 @item -Warray-bounds
3508 @opindex Wno-array-bounds
3509 @opindex Warray-bounds
3510 This option is only active when @option{-ftree-vrp} is active
3511 (default for -O2 and above). It warns about subscripts to arrays
3512 that are always out of bounds. This warning is enabled by @option{-Wall}.
3513
3514 @item -Wno-div-by-zero
3515 @opindex Wno-div-by-zero
3516 @opindex Wdiv-by-zero
3517 Do not warn about compile-time integer division by zero.  Floating point
3518 division by zero is not warned about, as it can be a legitimate way of
3519 obtaining infinities and NaNs.
3520
3521 @item -Wsystem-headers
3522 @opindex Wsystem-headers
3523 @opindex Wno-system-headers
3524 @cindex warnings from system headers
3525 @cindex system headers, warnings from
3526 Print warning messages for constructs found in system header files.
3527 Warnings from system headers are normally suppressed, on the assumption
3528 that they usually do not indicate real problems and would only make the
3529 compiler output harder to read.  Using this command line option tells
3530 GCC to emit warnings from system headers as if they occurred in user
3531 code.  However, note that using @option{-Wall} in conjunction with this
3532 option will @emph{not} warn about unknown pragmas in system
3533 headers---for that, @option{-Wunknown-pragmas} must also be used.
3534
3535 @item -Wfloat-equal
3536 @opindex Wfloat-equal
3537 @opindex Wno-float-equal
3538 Warn if floating point values are used in equality comparisons.
3539
3540 The idea behind this is that sometimes it is convenient (for the
3541 programmer) to consider floating-point values as approximations to
3542 infinitely precise real numbers.  If you are doing this, then you need
3543 to compute (by analyzing the code, or in some other way) the maximum or
3544 likely maximum error that the computation introduces, and allow for it
3545 when performing comparisons (and when producing output, but that's a
3546 different problem).  In particular, instead of testing for equality, you
3547 would check to see whether the two values have ranges that overlap; and
3548 this is done with the relational operators, so equality comparisons are
3549 probably mistaken.
3550
3551 @item -Wtraditional @r{(C and Objective-C only)}
3552 @opindex Wtraditional
3553 @opindex Wno-traditional
3554 Warn about certain constructs that behave differently in traditional and
3555 ISO C@.  Also warn about ISO C constructs that have no traditional C
3556 equivalent, and/or problematic constructs which should be avoided.
3557
3558 @itemize @bullet
3559 @item
3560 Macro parameters that appear within string literals in the macro body.
3561 In traditional C macro replacement takes place within string literals,
3562 but does not in ISO C@.
3563
3564 @item
3565 In traditional C, some preprocessor directives did not exist.
3566 Traditional preprocessors would only consider a line to be a directive
3567 if the @samp{#} appeared in column 1 on the line.  Therefore
3568 @option{-Wtraditional} warns about directives that traditional C
3569 understands but would ignore because the @samp{#} does not appear as the
3570 first character on the line.  It also suggests you hide directives like
3571 @samp{#pragma} not understood by traditional C by indenting them.  Some
3572 traditional implementations would not recognize @samp{#elif}, so it
3573 suggests avoiding it altogether.
3574
3575 @item
3576 A function-like macro that appears without arguments.
3577
3578 @item
3579 The unary plus operator.
3580
3581 @item
3582 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating point
3583 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
3584 constants.)  Note, these suffixes appear in macros defined in the system
3585 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
3586 Use of these macros in user code might normally lead to spurious
3587 warnings, however GCC's integrated preprocessor has enough context to
3588 avoid warning in these cases.
3589
3590 @item
3591 A function declared external in one block and then used after the end of
3592 the block.
3593
3594 @item
3595 A @code{switch} statement has an operand of type @code{long}.
3596
3597 @item
3598 A non-@code{static} function declaration follows a @code{static} one.
3599 This construct is not accepted by some traditional C compilers.
3600
3601 @item
3602 The ISO type of an integer constant has a different width or
3603 signedness from its traditional type.  This warning is only issued if
3604 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
3605 typically represent bit patterns, are not warned about.
3606
3607 @item
3608 Usage of ISO string concatenation is detected.
3609
3610 @item
3611 Initialization of automatic aggregates.
3612
3613 @item
3614 Identifier conflicts with labels.  Traditional C lacks a separate
3615 namespace for labels.
3616
3617 @item
3618 Initialization of unions.  If the initializer is zero, the warning is
3619 omitted.  This is done under the assumption that the zero initializer in
3620 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
3621 initializer warnings and relies on default initialization to zero in the
3622 traditional C case.
3623
3624 @item
3625 Conversions by prototypes between fixed/floating point values and vice
3626 versa.  The absence of these prototypes when compiling with traditional
3627 C would cause serious problems.  This is a subset of the possible
3628 conversion warnings, for the full set use @option{-Wtraditional-conversion}.
3629
3630 @item
3631 Use of ISO C style function definitions.  This warning intentionally is
3632 @emph{not} issued for prototype declarations or variadic functions
3633 because these ISO C features will appear in your code when using
3634 libiberty's traditional C compatibility macros, @code{PARAMS} and
3635 @code{VPARAMS}.  This warning is also bypassed for nested functions
3636 because that feature is already a GCC extension and thus not relevant to
3637 traditional C compatibility.
3638 @end itemize
3639
3640 @item -Wtraditional-conversion @r{(C and Objective-C only)}
3641 @opindex Wtraditional-conversion
3642 @opindex Wno-traditional-conversion
3643 Warn if a prototype causes a type conversion that is different from what
3644 would happen to the same argument in the absence of a prototype.  This
3645 includes conversions of fixed point to floating and vice versa, and
3646 conversions changing the width or signedness of a fixed point argument
3647 except when the same as the default promotion.
3648
3649 @item -Wdeclaration-after-statement @r{(C and Objective-C only)}
3650 @opindex Wdeclaration-after-statement
3651 @opindex Wno-declaration-after-statement
3652 Warn when a declaration is found after a statement in a block.  This
3653 construct, known from C++, was introduced with ISO C99 and is by default
3654 allowed in GCC@.  It is not supported by ISO C90 and was not supported by
3655 GCC versions before GCC 3.0.  @xref{Mixed Declarations}.
3656
3657 @item -Wundef
3658 @opindex Wundef
3659 @opindex Wno-undef
3660 Warn if an undefined identifier is evaluated in an @samp{#if} directive.
3661
3662 @item -Wno-endif-labels
3663 @opindex Wno-endif-labels
3664 @opindex Wendif-labels
3665 Do not warn whenever an @samp{#else} or an @samp{#endif} are followed by text.
3666
3667 @item -Wshadow
3668 @opindex Wshadow
3669 @opindex Wno-shadow
3670 Warn whenever a local variable shadows another local variable, parameter or
3671 global variable or whenever a built-in function is shadowed.
3672
3673 @item -Wlarger-than=@var{len}
3674 @opindex Wlarger-than=@var{len}
3675 @opindex Wlarger-than-@var{len}
3676 Warn whenever an object of larger than @var{len} bytes is defined.
3677
3678 @item -Wframe-larger-than=@var{len}
3679 @opindex Wframe-larger-than
3680 Warn if the size of a function frame is larger than @var{len} bytes.
3681 The computation done to determine the stack frame size is approximate
3682 and not conservative.
3683 The actual requirements may be somewhat greater than @var{len}
3684 even if you do not get a warning.  In addition, any space allocated
3685 via @code{alloca}, variable-length arrays, or related constructs
3686 is not included by the compiler when determining
3687 whether or not to issue a warning.
3688
3689 @item -Wunsafe-loop-optimizations
3690 @opindex Wunsafe-loop-optimizations
3691 @opindex Wno-unsafe-loop-optimizations
3692 Warn if the loop cannot be optimized because the compiler could not
3693 assume anything on the bounds of the loop indices.  With
3694 @option{-funsafe-loop-optimizations} warn if the compiler made
3695 such assumptions.
3696
3697 @item -Wno-pedantic-ms-format @r{(MinGW targets only)}
3698 @opindex Wno-pedantic-ms-format
3699 @opindex Wpedantic-ms-format
3700 Disables the warnings about non-ISO @code{printf} / @code{scanf} format
3701 width specifiers @code{I32}, @code{I64}, and @code{I} used on Windows targets
3702 depending on the MS runtime, when you are using the options @option{-Wformat}
3703 and @option{-pedantic} without gnu-extensions.
3704
3705 @item -Wpointer-arith
3706 @opindex Wpointer-arith
3707 @opindex Wno-pointer-arith
3708 Warn about anything that depends on the ``size of'' a function type or
3709 of @code{void}.  GNU C assigns these types a size of 1, for
3710 convenience in calculations with @code{void *} pointers and pointers
3711 to functions.  In C++, warn also when an arithmetic operation involves
3712 @code{NULL}.  This warning is also enabled by @option{-pedantic}.
3713
3714 @item -Wtype-limits
3715 @opindex Wtype-limits
3716 @opindex Wno-type-limits
3717 Warn if a comparison is always true or always false due to the limited
3718 range of the data type, but do not warn for constant expressions.  For
3719 example, warn if an unsigned variable is compared against zero with
3720 @samp{<} or @samp{>=}.  This warning is also enabled by
3721 @option{-Wextra}.
3722
3723 @item -Wbad-function-cast @r{(C and Objective-C only)}
3724 @opindex Wbad-function-cast
3725 @opindex Wno-bad-function-cast
3726 Warn whenever a function call is cast to a non-matching type.
3727 For example, warn if @code{int malloc()} is cast to @code{anything *}.
3728
3729 @item -Wc++-compat @r{(C and Objective-C only)}
3730 Warn about ISO C constructs that are outside of the common subset of
3731 ISO C and ISO C++, e.g.@: request for implicit conversion from
3732 @code{void *} to a pointer to non-@code{void} type.
3733
3734 @item -Wc++0x-compat @r{(C++ and Objective-C++ only)}
3735 Warn about C++ constructs whose meaning differs between ISO C++ 1998 and
3736 ISO C++ 200x, e.g., identifiers in ISO C++ 1998 that will become keywords
3737 in ISO C++ 200x.  This warning is enabled by @option{-Wall}.
3738
3739 @item -Wcast-qual
3740 @opindex Wcast-qual
3741 @opindex Wno-cast-qual
3742 Warn whenever a pointer is cast so as to remove a type qualifier from
3743 the target type.  For example, warn if a @code{const char *} is cast
3744 to an ordinary @code{char *}.
3745
3746 Also warn when making a cast which introduces a type qualifier in an
3747 unsafe way.  For example, casting @code{char **} to @code{const char **}
3748 is unsafe, as in this example:
3749
3750 @smallexample
3751   /* p is char ** value.  */
3752   const char **q = (const char **) p;
3753   /* Assignment of readonly string to const char * is OK.  */
3754   *q = "string";
3755   /* Now char** pointer points to read-only memory.  */
3756   **p = 'b';
3757 @end smallexample
3758
3759 @item -Wcast-align
3760 @opindex Wcast-align
3761 @opindex Wno-cast-align
3762 Warn whenever a pointer is cast such that the required alignment of the
3763 target is increased.  For example, warn if a @code{char *} is cast to
3764 an @code{int *} on machines where integers can only be accessed at
3765 two- or four-byte boundaries.
3766
3767 @item -Wwrite-strings
3768 @opindex Wwrite-strings
3769 @opindex Wno-write-strings
3770 When compiling C, give string constants the type @code{const
3771 char[@var{length}]} so that copying the address of one into a
3772 non-@code{const} @code{char *} pointer will get a warning.  These
3773 warnings will help you find at compile time code that can try to write
3774 into a string constant, but only if you have been very careful about
3775 using @code{const} in declarations and prototypes.  Otherwise, it will
3776 just be a nuisance. This is why we did not make @option{-Wall} request
3777 these warnings.
3778
3779 When compiling C++, warn about the deprecated conversion from string
3780 literals to @code{char *}.  This warning is enabled by default for C++
3781 programs.
3782
3783 @item -Wclobbered
3784 @opindex Wclobbered
3785 @opindex Wno-clobbered
3786 Warn for variables that might be changed by @samp{longjmp} or
3787 @samp{vfork}.  This warning is also enabled by @option{-Wextra}.
3788
3789 @item -Wconversion
3790 @opindex Wconversion
3791 @opindex Wno-conversion
3792 Warn for implicit conversions that may alter a value. This includes
3793 conversions between real and integer, like @code{abs (x)} when
3794 @code{x} is @code{double}; conversions between signed and unsigned,
3795 like @code{unsigned ui = -1}; and conversions to smaller types, like
3796 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
3797 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
3798 changed by the conversion like in @code{abs (2.0)}.  Warnings about
3799 conversions between signed and unsigned integers can be disabled by
3800 using @option{-Wno-sign-conversion}.
3801
3802 For C++, also warn for conversions between @code{NULL} and non-pointer
3803 types; confusing overload resolution for user-defined conversions; and
3804 conversions that will never use a type conversion operator:
3805 conversions to @code{void}, the same type, a base class or a reference
3806 to them. Warnings about conversions between signed and unsigned
3807 integers are disabled by default in C++ unless
3808 @option{-Wsign-conversion} is explicitly enabled.
3809
3810 @item -Wempty-body
3811 @opindex Wempty-body
3812 @opindex Wno-empty-body
3813 Warn if an empty body occurs in an @samp{if}, @samp{else} or @samp{do
3814 while} statement.  This warning is also enabled by @option{-Wextra}.
3815
3816 @item -Wenum-compare
3817 @opindex Wenum-compare
3818 @opindex Wno-enum-compare
3819 Warn about a comparison between values of different enum types. In C++
3820 this warning is enabled by default.  In C this warning is enabled by
3821 @option{-Wall}.
3822
3823 @item -Wsign-compare
3824 @opindex Wsign-compare
3825 @opindex Wno-sign-compare
3826 @cindex warning for comparison of signed and unsigned values
3827 @cindex comparison of signed and unsigned values, warning
3828 @cindex signed and unsigned values, comparison warning
3829 Warn when a comparison between signed and unsigned values could produce
3830 an incorrect result when the signed value is converted to unsigned.
3831 This warning is also enabled by @option{-Wextra}; to get the other warnings
3832 of @option{-Wextra} without this warning, use @samp{-Wextra -Wno-sign-compare}.
3833
3834 @item -Wsign-conversion
3835 @opindex Wsign-conversion
3836 @opindex Wno-sign-conversion
3837 Warn for implicit conversions that may change the sign of an integer
3838 value, like assigning a signed integer expression to an unsigned
3839 integer variable. An explicit cast silences the warning. In C, this
3840 option is enabled also by @option{-Wconversion}.
3841
3842 @item -Waddress
3843 @opindex Waddress
3844 @opindex Wno-address
3845 Warn about suspicious uses of memory addresses. These include using
3846 the address of a function in a conditional expression, such as
3847 @code{void func(void); if (func)}, and comparisons against the memory
3848 address of a string literal, such as @code{if (x == "abc")}.  Such
3849 uses typically indicate a programmer error: the address of a function
3850 always evaluates to true, so their use in a conditional usually
3851 indicate that the programmer forgot the parentheses in a function
3852 call; and comparisons against string literals result in unspecified
3853 behavior and are not portable in C, so they usually indicate that the
3854 programmer intended to use @code{strcmp}.  This warning is enabled by
3855 @option{-Wall}.
3856
3857 @item -Wlogical-op
3858 @opindex Wlogical-op
3859 @opindex Wno-logical-op
3860 Warn about suspicious uses of logical operators in expressions.
3861 This includes using logical operators in contexts where a
3862 bit-wise operator is likely to be expected.
3863
3864 @item -Waggregate-return
3865 @opindex Waggregate-return
3866 @opindex Wno-aggregate-return
3867 Warn if any functions that return structures or unions are defined or
3868 called.  (In languages where you can return an array, this also elicits
3869 a warning.)
3870
3871 @item -Wno-attributes
3872 @opindex Wno-attributes
3873 @opindex Wattributes
3874 Do not warn if an unexpected @code{__attribute__} is used, such as
3875 unrecognized attributes, function attributes applied to variables,
3876 etc.  This will not stop errors for incorrect use of supported
3877 attributes.
3878
3879 @item -Wno-builtin-macro-redefined
3880 @opindex Wno-builtin-macro-redefined
3881 @opindex Wbuiltin-macro-redefined
3882 Do not warn if certain built-in macros are redefined.  This suppresses
3883 warnings for redefinition of @code{__TIMESTAMP__}, @code{__TIME__},
3884 @code{__DATE__}, @code{__FILE__}, and @code{__BASE_FILE__}.
3885
3886 @item -Wstrict-prototypes @r{(C and Objective-C only)}
3887 @opindex Wstrict-prototypes
3888 @opindex Wno-strict-prototypes
3889 Warn if a function is declared or defined without specifying the
3890 argument types.  (An old-style function definition is permitted without
3891 a warning if preceded by a declaration which specifies the argument
3892 types.)
3893
3894 @item -Wold-style-declaration @r{(C and Objective-C only)}
3895 @opindex Wold-style-declaration
3896 @opindex Wno-old-style-declaration
3897 Warn for obsolescent usages, according to the C Standard, in a
3898 declaration. For example, warn if storage-class specifiers like
3899 @code{static} are not the first things in a declaration.  This warning
3900 is also enabled by @option{-Wextra}.
3901
3902 @item -Wold-style-definition @r{(C and Objective-C only)}
3903 @opindex Wold-style-definition
3904 @opindex Wno-old-style-definition
3905 Warn if an old-style function definition is used.  A warning is given
3906 even if there is a previous prototype.
3907
3908 @item -Wmissing-parameter-type @r{(C and Objective-C only)}
3909 @opindex Wmissing-parameter-type
3910 @opindex Wno-missing-parameter-type
3911 A function parameter is declared without a type specifier in K&R-style
3912 functions:
3913
3914 @smallexample
3915 void foo(bar) @{ @}
3916 @end smallexample
3917
3918 This warning is also enabled by @option{-Wextra}.
3919
3920 @item -Wmissing-prototypes @r{(C and Objective-C only)}
3921 @opindex Wmissing-prototypes
3922 @opindex Wno-missing-prototypes
3923 Warn if a global function is defined without a previous prototype
3924 declaration.  This warning is issued even if the definition itself
3925 provides a prototype.  The aim is to detect global functions that fail
3926 to be declared in header files.
3927
3928 @item -Wmissing-declarations
3929 @opindex Wmissing-declarations
3930 @opindex Wno-missing-declarations
3931 Warn if a global function is defined without a previous declaration.
3932 Do so even if the definition itself provides a prototype.
3933 Use this option to detect global functions that are not declared in
3934 header files.  In C++, no warnings are issued for function templates,
3935 or for inline functions, or for functions in anonymous namespaces.
3936
3937 @item -Wmissing-field-initializers
3938 @opindex Wmissing-field-initializers
3939 @opindex Wno-missing-field-initializers
3940 @opindex W
3941 @opindex Wextra
3942 @opindex Wno-extra
3943 Warn if a structure's initializer has some fields missing.  For
3944 example, the following code would cause such a warning, because
3945 @code{x.h} is implicitly zero:
3946
3947 @smallexample
3948 struct s @{ int f, g, h; @};
3949 struct s x = @{ 3, 4 @};
3950 @end smallexample
3951
3952 This option does not warn about designated initializers, so the following
3953 modification would not trigger a warning:
3954
3955 @smallexample
3956 struct s @{ int f, g, h; @};
3957 struct s x = @{ .f = 3, .g = 4 @};
3958 @end smallexample
3959
3960 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
3961 warnings without this one, use @samp{-Wextra -Wno-missing-field-initializers}.
3962
3963 @item -Wmissing-noreturn
3964 @opindex Wmissing-noreturn
3965 @opindex Wno-missing-noreturn
3966 Warn about functions which might be candidates for attribute @code{noreturn}.
3967 Note these are only possible candidates, not absolute ones.  Care should
3968 be taken to manually verify functions actually do not ever return before
3969 adding the @code{noreturn} attribute, otherwise subtle code generation
3970 bugs could be introduced.  You will not get a warning for @code{main} in
3971 hosted C environments.
3972
3973 @item -Wmissing-format-attribute
3974 @opindex Wmissing-format-attribute
3975 @opindex Wno-missing-format-attribute
3976 @opindex Wformat
3977 @opindex Wno-format
3978 Warn about function pointers which might be candidates for @code{format}
3979 attributes.  Note these are only possible candidates, not absolute ones.
3980 GCC will guess that function pointers with @code{format} attributes that
3981 are used in assignment, initialization, parameter passing or return
3982 statements should have a corresponding @code{format} attribute in the
3983 resulting type.  I.e.@: the left-hand side of the assignment or
3984 initialization, the type of the parameter variable, or the return type
3985 of the containing function respectively should also have a @code{format}
3986 attribute to avoid the warning.
3987
3988 GCC will also warn about function definitions which might be
3989 candidates for @code{format} attributes.  Again, these are only
3990 possible candidates.  GCC will guess that @code{format} attributes
3991 might be appropriate for any function that calls a function like
3992 @code{vprintf} or @code{vscanf}, but this might not always be the
3993 case, and some functions for which @code{format} attributes are
3994 appropriate may not be detected.
3995
3996 @item -Wno-multichar
3997 @opindex Wno-multichar
3998 @opindex Wmultichar
3999 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
4000 Usually they indicate a typo in the user's code, as they have
4001 implementation-defined values, and should not be used in portable code.
4002
4003 @item -Wnormalized=<none|id|nfc|nfkc>
4004 @opindex Wnormalized=
4005 @cindex NFC
4006 @cindex NFKC
4007 @cindex character set, input normalization
4008 In ISO C and ISO C++, two identifiers are different if they are
4009 different sequences of characters.  However, sometimes when characters
4010 outside the basic ASCII character set are used, you can have two
4011 different character sequences that look the same.  To avoid confusion,
4012 the ISO 10646 standard sets out some @dfn{normalization rules} which
4013 when applied ensure that two sequences that look the same are turned into
4014 the same sequence.  GCC can warn you if you are using identifiers which
4015 have not been normalized; this option controls that warning.
4016
4017 There are four levels of warning that GCC supports.  The default is
4018 @option{-Wnormalized=nfc}, which warns about any identifier which is
4019 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
4020 recommended form for most uses.
4021
4022 Unfortunately, there are some characters which ISO C and ISO C++ allow
4023 in identifiers that when turned into NFC aren't allowable as
4024 identifiers.  That is, there's no way to use these symbols in portable
4025 ISO C or C++ and have all your identifiers in NFC@.
4026 @option{-Wnormalized=id} suppresses the warning for these characters.
4027 It is hoped that future versions of the standards involved will correct
4028 this, which is why this option is not the default.
4029
4030 You can switch the warning off for all characters by writing
4031 @option{-Wnormalized=none}.  You would only want to do this if you
4032 were using some other normalization scheme (like ``D''), because
4033 otherwise you can easily create bugs that are literally impossible to see.
4034
4035 Some characters in ISO 10646 have distinct meanings but look identical
4036 in some fonts or display methodologies, especially once formatting has
4037 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
4038 LETTER N'', will display just like a regular @code{n} which has been
4039 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
4040 normalization scheme to convert all these into a standard form as
4041 well, and GCC will warn if your code is not in NFKC if you use
4042 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
4043 about every identifier that contains the letter O because it might be
4044 confused with the digit 0, and so is not the default, but may be
4045 useful as a local coding convention if the programming environment is
4046 unable to be fixed to display these characters distinctly.
4047
4048 @item -Wno-deprecated
4049 @opindex Wno-deprecated
4050 @opindex Wdeprecated
4051 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
4052
4053 @item -Wno-deprecated-declarations
4054 @opindex Wno-deprecated-declarations
4055 @opindex Wdeprecated-declarations
4056 Do not warn about uses of functions (@pxref{Function Attributes}),
4057 variables (@pxref{Variable Attributes}), and types (@pxref{Type
4058 Attributes}) marked as deprecated by using the @code{deprecated}
4059 attribute.
4060
4061 @item -Wno-overflow
4062 @opindex Wno-overflow
4063 @opindex Woverflow
4064 Do not warn about compile-time overflow in constant expressions.
4065
4066 @item -Woverride-init @r{(C and Objective-C only)}
4067 @opindex Woverride-init
4068 @opindex Wno-override-init
4069 @opindex W
4070 @opindex Wextra
4071 @opindex Wno-extra
4072 Warn if an initialized field without side effects is overridden when
4073 using designated initializers (@pxref{Designated Inits, , Designated
4074 Initializers}).
4075
4076 This warning is included in @option{-Wextra}.  To get other
4077 @option{-Wextra} warnings without this one, use @samp{-Wextra
4078 -Wno-override-init}.
4079
4080 @item -Wpacked
4081 @opindex Wpacked
4082 @opindex Wno-packed
4083 Warn if a structure is given the packed attribute, but the packed
4084 attribute has no effect on the layout or size of the structure.
4085 Such structures may be mis-aligned for little benefit.  For
4086 instance, in this code, the variable @code{f.x} in @code{struct bar}
4087 will be misaligned even though @code{struct bar} does not itself
4088 have the packed attribute:
4089
4090 @smallexample
4091 @group
4092 struct foo @{
4093   int x;
4094   char a, b, c, d;
4095 @} __attribute__((packed));
4096 struct bar @{
4097   char z;
4098   struct foo f;
4099 @};
4100 @end group
4101 @end smallexample
4102
4103 @item -Wpacked-bitfield-compat
4104 @opindex Wpacked-bitfield-compat
4105 @opindex Wno-packed-bitfield-compat
4106 The 4.1, 4.2 and 4.3 series of GCC ignore the @code{packed} attribute
4107 on bit-fields of type @code{char}.  This has been fixed in GCC 4.4 but
4108 the change can lead to differences in the structure layout.  GCC
4109 informs you when the offset of such a field has changed in GCC 4.4.
4110 For example there is no longer a 4-bit padding between field @code{a}
4111 and @code{b} in this structure:
4112
4113 @smallexample
4114 struct foo
4115 @{
4116   char a:4;
4117   char b:8;
4118 @} __attribute__ ((packed));
4119 @end smallexample
4120
4121 This warning is enabled by default.  Use
4122 @option{-Wno-packed-bitfield-compat} to disable this warning.
4123
4124 @item -Wpadded
4125 @opindex Wpadded
4126 @opindex Wno-padded
4127 Warn if padding is included in a structure, either to align an element
4128 of the structure or to align the whole structure.  Sometimes when this
4129 happens it is possible to rearrange the fields of the structure to
4130 reduce the padding and so make the structure smaller.
4131
4132 @item -Wredundant-decls
4133 @opindex Wredundant-decls
4134 @opindex Wno-redundant-decls
4135 Warn if anything is declared more than once in the same scope, even in
4136 cases where multiple declaration is valid and changes nothing.
4137
4138 @item -Wnested-externs @r{(C and Objective-C only)}
4139 @opindex Wnested-externs
4140 @opindex Wno-nested-externs
4141 Warn if an @code{extern} declaration is encountered within a function.
4142
4143 @item -Wunreachable-code
4144 @opindex Wunreachable-code
4145 @opindex Wno-unreachable-code
4146 Warn if the compiler detects that code will never be executed.
4147
4148 This option is intended to warn when the compiler detects that at
4149 least a whole line of source code will never be executed, because
4150 some condition is never satisfied or because it is after a
4151 procedure that never returns.
4152
4153 It is possible for this option to produce a warning even though there
4154 are circumstances under which part of the affected line can be executed,
4155 so care should be taken when removing apparently-unreachable code.
4156
4157 For instance, when a function is inlined, a warning may mean that the
4158 line is unreachable in only one inlined copy of the function.
4159
4160 This option is not made part of @option{-Wall} because in a debugging
4161 version of a program there is often substantial code which checks
4162 correct functioning of the program and is, hopefully, unreachable
4163 because the program does work.  Another common use of unreachable
4164 code is to provide behavior which is selectable at compile-time.
4165
4166 @item -Winline
4167 @opindex Winline
4168 @opindex Wno-inline
4169 Warn if a function can not be inlined and it was declared as inline.
4170 Even with this option, the compiler will not warn about failures to
4171 inline functions declared in system headers.
4172
4173 The compiler uses a variety of heuristics to determine whether or not
4174 to inline a function.  For example, the compiler takes into account
4175 the size of the function being inlined and the amount of inlining
4176 that has already been done in the current function.  Therefore,
4177 seemingly insignificant changes in the source program can cause the
4178 warnings produced by @option{-Winline} to appear or disappear.
4179
4180 @item -Wno-invalid-offsetof @r{(C++ and Objective-C++ only)}
4181 @opindex Wno-invalid-offsetof
4182 @opindex Winvalid-offsetof
4183 Suppress warnings from applying the @samp{offsetof} macro to a non-POD
4184 type.  According to the 1998 ISO C++ standard, applying @samp{offsetof}
4185 to a non-POD type is undefined.  In existing C++ implementations,
4186 however, @samp{offsetof} typically gives meaningful results even when
4187 applied to certain kinds of non-POD types. (Such as a simple
4188 @samp{struct} that fails to be a POD type only by virtue of having a
4189 constructor.)  This flag is for users who are aware that they are
4190 writing nonportable code and who have deliberately chosen to ignore the
4191 warning about it.
4192
4193 The restrictions on @samp{offsetof} may be relaxed in a future version
4194 of the C++ standard.
4195
4196 @item -Wno-int-to-pointer-cast @r{(C and Objective-C only)}
4197 @opindex Wno-int-to-pointer-cast
4198 @opindex Wint-to-pointer-cast
4199 Suppress warnings from casts to pointer type of an integer of a
4200 different size.
4201
4202 @item -Wno-pointer-to-int-cast @r{(C and Objective-C only)}
4203 @opindex Wno-pointer-to-int-cast
4204 @opindex Wpointer-to-int-cast
4205 Suppress warnings from casts from a pointer to an integer type of a
4206 different size.
4207
4208 @item -Winvalid-pch
4209 @opindex Winvalid-pch
4210 @opindex Wno-invalid-pch
4211 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
4212 the search path but can't be used.
4213
4214 @item -Wlong-long
4215 @opindex Wlong-long
4216 @opindex Wno-long-long
4217 Warn if @samp{long long} type is used.  This is enabled by either
4218 @option{-pedantic} or @option{-Wtraditional} in ISO C90 and C++98
4219 modes.  To inhibit the warning messages, use @option{-Wno-long-long}.
4220
4221 @item -Wvariadic-macros
4222 @opindex Wvariadic-macros
4223 @opindex Wno-variadic-macros
4224 Warn if variadic macros are used in pedantic ISO C90 mode, or the GNU
4225 alternate syntax when in pedantic ISO C99 mode.  This is default.
4226 To inhibit the warning messages, use @option{-Wno-variadic-macros}.
4227
4228 @item -Wvla
4229 @opindex Wvla
4230 @opindex Wno-vla
4231 Warn if variable length array is used in the code.
4232 @option{-Wno-vla} will prevent the @option{-pedantic} warning of
4233 the variable length array.
4234
4235 @item -Wvolatile-register-var
4236 @opindex Wvolatile-register-var
4237 @opindex Wno-volatile-register-var
4238 Warn if a register variable is declared volatile.  The volatile
4239 modifier does not inhibit all optimizations that may eliminate reads
4240 and/or writes to register variables.  This warning is enabled by
4241 @option{-Wall}.
4242
4243 @item -Wdisabled-optimization
4244 @opindex Wdisabled-optimization
4245 @opindex Wno-disabled-optimization
4246 Warn if a requested optimization pass is disabled.  This warning does
4247 not generally indicate that there is anything wrong with your code; it
4248 merely indicates that GCC's optimizers were unable to handle the code
4249 effectively.  Often, the problem is that your code is too big or too
4250 complex; GCC will refuse to optimize programs when the optimization
4251 itself is likely to take inordinate amounts of time.
4252
4253 @item -Wpointer-sign @r{(C and Objective-C only)}
4254 @opindex Wpointer-sign
4255 @opindex Wno-pointer-sign
4256 Warn for pointer argument passing or assignment with different signedness.
4257 This option is only supported for C and Objective-C@.  It is implied by
4258 @option{-Wall} and by @option{-pedantic}, which can be disabled with
4259 @option{-Wno-pointer-sign}.
4260
4261 @item -Wstack-protector
4262 @opindex Wstack-protector
4263 @opindex Wno-stack-protector
4264 This option is only active when @option{-fstack-protector} is active.  It
4265 warns about functions that will not be protected against stack smashing.
4266
4267 @item -Wno-mudflap
4268 @opindex Wno-mudflap
4269 Suppress warnings about constructs that cannot be instrumented by
4270 @option{-fmudflap}.
4271
4272 @item -Woverlength-strings
4273 @opindex Woverlength-strings
4274 @opindex Wno-overlength-strings
4275 Warn about string constants which are longer than the ``minimum
4276 maximum'' length specified in the C standard.  Modern compilers
4277 generally allow string constants which are much longer than the
4278 standard's minimum limit, but very portable programs should avoid
4279 using longer strings.
4280
4281 The limit applies @emph{after} string constant concatenation, and does
4282 not count the trailing NUL@.  In C89, the limit was 509 characters; in
4283 C99, it was raised to 4095.  C++98 does not specify a normative
4284 minimum maximum, so we do not diagnose overlength strings in C++@.
4285
4286 This option is implied by @option{-pedantic}, and can be disabled with
4287 @option{-Wno-overlength-strings}.
4288
4289 @item -Wunsuffixed-float-constants
4290 @opindex Wunsuffixed-float-constants
4291
4292 GCC will issue a warning for any floating constant that does not have
4293 a suffix.  When used together with @option{-Wsystem-headers} it will
4294 warn about such constants in system header files.  This can be useful
4295 when preparing code to use with the @code{FLOAT_CONST_DECIMAL64} pragma
4296 from the decimal floating-point extension to C99.
4297 @end table
4298
4299 @node Debugging Options
4300 @section Options for Debugging Your Program or GCC
4301 @cindex options, debugging
4302 @cindex debugging information options
4303
4304 GCC has various special options that are used for debugging
4305 either your program or GCC:
4306
4307 @table @gcctabopt
4308 @item -g
4309 @opindex g
4310 Produce debugging information in the operating system's native format
4311 (stabs, COFF, XCOFF, or DWARF 2)@.  GDB can work with this debugging
4312 information.
4313
4314 On most systems that use stabs format, @option{-g} enables use of extra
4315 debugging information that only GDB can use; this extra information
4316 makes debugging work better in GDB but will probably make other debuggers
4317 crash or
4318 refuse to read the program.  If you want to control for certain whether
4319 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
4320 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
4321
4322 GCC allows you to use @option{-g} with
4323 @option{-O}.  The shortcuts taken by optimized code may occasionally
4324 produce surprising results: some variables you declared may not exist
4325 at all; flow of control may briefly move where you did not expect it;
4326 some statements may not be executed because they compute constant
4327 results or their values were already at hand; some statements may
4328 execute in different places because they were moved out of loops.
4329
4330 Nevertheless it proves possible to debug optimized output.  This makes
4331 it reasonable to use the optimizer for programs that might have bugs.
4332
4333 The following options are useful when GCC is generated with the
4334 capability for more than one debugging format.
4335
4336 @item -ggdb
4337 @opindex ggdb
4338 Produce debugging information for use by GDB@.  This means to use the
4339 most expressive format available (DWARF 2, stabs, or the native format
4340 if neither of those are supported), including GDB extensions if at all
4341 possible.
4342
4343 @item -gstabs
4344 @opindex gstabs
4345 Produce debugging information in stabs format (if that is supported),
4346 without GDB extensions.  This is the format used by DBX on most BSD
4347 systems.  On MIPS, Alpha and System V Release 4 systems this option
4348 produces stabs debugging output which is not understood by DBX or SDB@.
4349 On System V Release 4 systems this option requires the GNU assembler.
4350
4351 @item -feliminate-unused-debug-symbols
4352 @opindex feliminate-unused-debug-symbols
4353 Produce debugging information in stabs format (if that is supported),
4354 for only symbols that are actually used.
4355
4356 @item -femit-class-debug-always
4357 Instead of emitting debugging information for a C++ class in only one
4358 object file, emit it in all object files using the class.  This option
4359 should be used only with debuggers that are unable to handle the way GCC
4360 normally emits debugging information for classes because using this
4361 option will increase the size of debugging information by as much as a
4362 factor of two.
4363
4364 @item -gstabs+
4365 @opindex gstabs+
4366 Produce debugging information in stabs format (if that is supported),
4367 using GNU extensions understood only by the GNU debugger (GDB)@.  The
4368 use of these extensions is likely to make other debuggers crash or
4369 refuse to read the program.
4370
4371 @item -gcoff
4372 @opindex gcoff
4373 Produce debugging information in COFF format (if that is supported).
4374 This is the format used by SDB on most System V systems prior to
4375 System V Release 4.
4376
4377 @item -gxcoff
4378 @opindex gxcoff
4379 Produce debugging information in XCOFF format (if that is supported).
4380 This is the format used by the DBX debugger on IBM RS/6000 systems.
4381
4382 @item -gxcoff+
4383 @opindex gxcoff+
4384 Produce debugging information in XCOFF format (if that is supported),
4385 using GNU extensions understood only by the GNU debugger (GDB)@.  The
4386 use of these extensions is likely to make other debuggers crash or
4387 refuse to read the program, and may cause assemblers other than the GNU
4388 assembler (GAS) to fail with an error.
4389
4390 @item -gdwarf-@var{version}
4391 @opindex gdwarf-@var{version}
4392 Produce debugging information in DWARF format (if that is
4393 supported).  This is the format used by DBX on IRIX 6.  The value
4394 of @var{version} may be either 2 or 3; the default version is 2.
4395
4396 Note that with DWARF version 2 some ports require, and will always
4397 use, some non-conflicting DWARF 3 extensions in the unwind tables.
4398
4399 @item -gvms
4400 @opindex gvms
4401 Produce debugging information in VMS debug format (if that is
4402 supported).  This is the format used by DEBUG on VMS systems.
4403
4404 @item -g@var{level}
4405 @itemx -ggdb@var{level}
4406 @itemx -gstabs@var{level}
4407 @itemx -gcoff@var{level}
4408 @itemx -gxcoff@var{level}
4409 @itemx -gvms@var{level}
4410 Request debugging information and also use @var{level} to specify how
4411 much information.  The default level is 2.
4412
4413 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
4414 @option{-g}.
4415
4416 Level 1 produces minimal information, enough for making backtraces in
4417 parts of the program that you don't plan to debug.  This includes
4418 descriptions of functions and external variables, but no information
4419 about local variables and no line numbers.
4420
4421 Level 3 includes extra information, such as all the macro definitions
4422 present in the program.  Some debuggers support macro expansion when
4423 you use @option{-g3}.
4424
4425 @option{-gdwarf-2} does not accept a concatenated debug level, because
4426 GCC used to support an option @option{-gdwarf} that meant to generate
4427 debug information in version 1 of the DWARF format (which is very
4428 different from version 2), and it would have been too confusing.  That
4429 debug format is long obsolete, but the option cannot be changed now.
4430 Instead use an additional @option{-g@var{level}} option to change the
4431 debug level for DWARF.
4432
4433 @item -gtoggle
4434 @opindex gtoggle
4435 Turn off generation of debug info, if leaving out this option would have
4436 generated it, or turn it on at level 2 otherwise.  The position of this
4437 argument in the command line does not matter, it takes effect after all
4438 other options are processed, and it does so only once, no matter how
4439 many times it is given.  This is mainly intended to be used with
4440 @option{-fcompare-debug}.
4441
4442 @item -fdump-final-insns=@var{file}
4443 @opindex fdump-final-insns=
4444 Dump the final internal representation (RTL) to @var{file}.
4445
4446 @item -fcompare-debug@r{[}=@var{opts}@r{]}
4447 @opindex fcompare-debug
4448 @opindex fno-compare-debug
4449 If no error occurs during compilation, run the compiler a second time,
4450 adding @var{opts} and @option{-fcompare-debug-second} to the arguments
4451 passed to the second compilation.  Dump the final internal
4452 representation in both compilations, and print an error if they differ.
4453
4454 If the equal sign is omitted, the default @option{-gtoggle} is used.
4455
4456 The environment variable @env{GCC_COMPARE_DEBUG}, if defined, non-empty
4457 and nonzero, implicitly enables @option{-fcompare-debug}.  If
4458 @env{GCC_COMPARE_DEBUG} is defined to a string starting with a dash,
4459 then it is used for @var{opts}, otherwise the default @option{-gtoggle}
4460 is used.
4461
4462 @option{-fcompare-debug=}, with the equal sign but without @var{opts},
4463 is equivalent to @option{-fno-compare-debug}, which disables the dumping
4464 of the final representation and the second compilation, preventing even
4465 @env{GCC_COMPARE_DEBUG} from taking effect.
4466
4467 To verify full coverage during @option{-fcompare-debug} testing, set
4468 @env{GCC_COMPARE_DEBUG} to say @samp{-fcompare-debug-not-overridden},
4469 which GCC will reject as an invalid option in any actual compilation
4470 (rather than preprocessing, assembly or linking).  To get just a
4471 warning, setting @env{GCC_COMPARE_DEBUG} to @samp{-w%n-fcompare-debug
4472 not overridden} will do.
4473
4474 @item -fcompare-debug-second
4475 @opindex fcompare-debug-second
4476 This option is implicitly passed to the compiler for the second
4477 compilation requested by @option{-fcompare-debug}, along with options to
4478 silence warnings, and omitting other options that would cause
4479 side-effect compiler outputs to files or to the standard output.  Dump
4480 files and preserved temporary files are renamed so as to contain the
4481 @code{.gk} additional extension during the second compilation, to avoid
4482 overwriting those generated by the first.
4483
4484 When this option is passed to the compiler driver, it causes the
4485 @emph{first} compilation to be skipped, which makes it useful for little
4486 other than debugging the compiler proper.
4487
4488 @item -feliminate-dwarf2-dups
4489 @opindex feliminate-dwarf2-dups
4490 Compress DWARF2 debugging information by eliminating duplicated
4491 information about each symbol.  This option only makes sense when
4492 generating DWARF2 debugging information with @option{-gdwarf-2}.
4493
4494 @item -femit-struct-debug-baseonly
4495 Emit debug information for struct-like types
4496 only when the base name of the compilation source file
4497 matches the base name of file in which the struct was defined.
4498
4499 This option substantially reduces the size of debugging information,
4500 but at significant potential loss in type information to the debugger.
4501 See @option{-femit-struct-debug-reduced} for a less aggressive option.
4502 See @option{-femit-struct-debug-detailed} for more detailed control.
4503
4504 This option works only with DWARF 2.
4505
4506 @item -femit-struct-debug-reduced
4507 Emit debug information for struct-like types
4508 only when the base name of the compilation source file
4509 matches the base name of file in which the type was defined,
4510 unless the struct is a template or defined in a system header.
4511
4512 This option significantly reduces the size of debugging information,
4513 with some potential loss in type information to the debugger.
4514 See @option{-femit-struct-debug-baseonly} for a more aggressive option.
4515 See @option{-femit-struct-debug-detailed} for more detailed control.
4516
4517 This option works only with DWARF 2.
4518
4519 @item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
4520 Specify the struct-like types
4521 for which the compiler will generate debug information.
4522 The intent is to reduce duplicate struct debug information
4523 between different object files within the same program.
4524
4525 This option is a detailed version of
4526 @option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
4527 which will serve for most needs.
4528
4529 A specification has the syntax
4530 [@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
4531
4532 The optional first word limits the specification to
4533 structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
4534 A struct type is used directly when it is the type of a variable, member.
4535 Indirect uses arise through pointers to structs.
4536 That is, when use of an incomplete struct would be legal, the use is indirect.
4537 An example is
4538 @samp{struct one direct; struct two * indirect;}.
4539
4540 The optional second word limits the specification to
4541 ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
4542 Generic structs are a bit complicated to explain.
4543 For C++, these are non-explicit specializations of template classes,
4544 or non-template classes within the above.
4545 Other programming languages have generics,
4546 but @samp{-femit-struct-debug-detailed} does not yet implement them.
4547
4548 The third word specifies the source files for those
4549 structs for which the compiler will emit debug information.
4550 The values @samp{none} and @samp{any} have the normal meaning.
4551 The value @samp{base} means that
4552 the base of name of the file in which the type declaration appears
4553 must match the base of the name of the main compilation file.
4554 In practice, this means that
4555 types declared in @file{foo.c} and @file{foo.h} will have debug information,
4556 but types declared in other header will not.
4557 The value @samp{sys} means those types satisfying @samp{base}
4558 or declared in system or compiler headers.
4559
4560 You may need to experiment to determine the best settings for your application.
4561
4562 The default is @samp{-femit-struct-debug-detailed=all}.
4563
4564 This option works only with DWARF 2.
4565
4566 @item -fno-merge-debug-strings
4567 @opindex fmerge-debug-strings
4568 @opindex fno-merge-debug-strings
4569 Direct the linker to not merge together strings in the debugging
4570 information which are identical in different object files.  Merging is
4571 not supported by all assemblers or linkers.  Merging decreases the size
4572 of the debug information in the output file at the cost of increasing
4573 link processing time.  Merging is enabled by default.
4574
4575 @item -fdebug-prefix-map=@var{old}=@var{new}
4576 @opindex fdebug-prefix-map
4577 When compiling files in directory @file{@var{old}}, record debugging
4578 information describing them as in @file{@var{new}} instead.
4579
4580 @item -fno-dwarf2-cfi-asm
4581 @opindex fdwarf2-cfi-asm
4582 @opindex fno-dwarf2-cfi-asm
4583 Emit DWARF 2 unwind info as compiler generated @code{.eh_frame} section
4584 instead of using GAS @code{.cfi_*} directives.
4585
4586 @cindex @command{prof}
4587 @item -p
4588 @opindex p
4589 Generate extra code to write profile information suitable for the
4590 analysis program @command{prof}.  You must use this option when compiling
4591 the source files you want data about, and you must also use it when
4592 linking.
4593
4594 @cindex @command{gprof}
4595 @item -pg
4596 @opindex pg
4597 Generate extra code to write profile information suitable for the
4598 analysis program @command{gprof}.  You must use this option when compiling
4599 the source files you want data about, and you must also use it when
4600 linking.
4601
4602 @item -Q
4603 @opindex Q
4604 Makes the compiler print out each function name as it is compiled, and
4605 print some statistics about each pass when it finishes.
4606
4607 @item -ftime-report
4608 @opindex ftime-report
4609 Makes the compiler print some statistics about the time consumed by each
4610 pass when it finishes.
4611
4612 @item -fmem-report
4613 @opindex fmem-report
4614 Makes the compiler print some statistics about permanent memory
4615 allocation when it finishes.
4616
4617 @item -fpre-ipa-mem-report
4618 @opindex fpre-ipa-mem-report
4619 @item -fpost-ipa-mem-report
4620 @opindex fpost-ipa-mem-report
4621 Makes the compiler print some statistics about permanent memory
4622 allocation before or after interprocedural optimization.
4623
4624 @item -fprofile-arcs
4625 @opindex fprofile-arcs
4626 Add code so that program flow @dfn{arcs} are instrumented.  During
4627 execution the program records how many times each branch and call is
4628 executed and how many times it is taken or returns.  When the compiled
4629 program exits it saves this data to a file called
4630 @file{@var{auxname}.gcda} for each source file.  The data may be used for
4631 profile-directed optimizations (@option{-fbranch-probabilities}), or for
4632 test coverage analysis (@option{-ftest-coverage}).  Each object file's
4633 @var{auxname} is generated from the name of the output file, if
4634 explicitly specified and it is not the final executable, otherwise it is
4635 the basename of the source file.  In both cases any suffix is removed
4636 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
4637 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
4638 @xref{Cross-profiling}.
4639
4640 @cindex @command{gcov}
4641 @item --coverage
4642 @opindex coverage
4643
4644 This option is used to compile and link code instrumented for coverage
4645 analysis.  The option is a synonym for @option{-fprofile-arcs}
4646 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
4647 linking).  See the documentation for those options for more details.
4648
4649 @itemize
4650
4651 @item
4652 Compile the source files with @option{-fprofile-arcs} plus optimization
4653 and code generation options.  For test coverage analysis, use the
4654 additional @option{-ftest-coverage} option.  You do not need to profile
4655 every source file in a program.
4656
4657 @item
4658 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
4659 (the latter implies the former).
4660
4661 @item
4662 Run the program on a representative workload to generate the arc profile
4663 information.  This may be repeated any number of times.  You can run
4664 concurrent instances of your program, and provided that the file system
4665 supports locking, the data files will be correctly updated.  Also
4666 @code{fork} calls are detected and correctly handled (double counting
4667 will not happen).
4668
4669 @item
4670 For profile-directed optimizations, compile the source files again with
4671 the same optimization and code generation options plus
4672 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
4673 Control Optimization}).
4674
4675 @item
4676 For test coverage analysis, use @command{gcov} to produce human readable
4677 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
4678 @command{gcov} documentation for further information.
4679
4680 @end itemize
4681
4682 With @option{-fprofile-arcs}, for each function of your program GCC
4683 creates a program flow graph, then finds a spanning tree for the graph.
4684 Only arcs that are not on the spanning tree have to be instrumented: the
4685 compiler adds code to count the number of times that these arcs are
4686 executed.  When an arc is the only exit or only entrance to a block, the
4687 instrumentation code can be added to the block; otherwise, a new basic
4688 block must be created to hold the instrumentation code.
4689
4690 @need 2000
4691 @item -ftest-coverage
4692 @opindex ftest-coverage
4693 Produce a notes file that the @command{gcov} code-coverage utility
4694 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
4695 show program coverage.  Each source file's note file is called
4696 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
4697 above for a description of @var{auxname} and instructions on how to
4698 generate test coverage data.  Coverage data will match the source files
4699 more closely, if you do not optimize.
4700
4701 @item -fdbg-cnt-list
4702 @opindex fdbg-cnt-list
4703 Print the name and the counter upperbound for all debug counters.
4704
4705 @item -fdbg-cnt=@var{counter-value-list}
4706 @opindex fdbg-cnt
4707 Set the internal debug counter upperbound. @var{counter-value-list}
4708 is a comma-separated list of @var{name}:@var{value} pairs
4709 which sets the upperbound of each debug counter @var{name} to @var{value}.
4710 All debug counters have the initial upperbound of @var{UINT_MAX},
4711 thus dbg_cnt() returns true always unless the upperbound is set by this option.
4712 e.g. With -fdbg-cnt=dce:10,tail_call:0
4713 dbg_cnt(dce) will return true only for first 10 invocations
4714 and dbg_cnt(tail_call) will return false always.
4715
4716 @item -d@var{letters}
4717 @itemx -fdump-rtl-@var{pass}
4718 @opindex d
4719 Says to make debugging dumps during compilation at times specified by
4720 @var{letters}.  This is used for debugging the RTL-based passes of the
4721 compiler.  The file names for most of the dumps are made by appending
4722 a pass number and a word to the @var{dumpname}, and the files are
4723 created in the directory of the output file.  @var{dumpname} is
4724 generated from the name of the output file, if explicitly specified
4725 and it is not an executable, otherwise it is the basename of the
4726 source file. These switches may have different effects when
4727 @option{-E} is used for preprocessing.
4728
4729 Debug dumps can be enabled with a @option{-fdump-rtl} switch or some
4730 @option{-d} option @var{letters}.  Here are the possible
4731 letters for use in @var{pass} and @var{letters}, and their meanings:
4732
4733 @table @gcctabopt
4734
4735 @item -fdump-rtl-alignments
4736 @opindex fdump-rtl-alignments
4737 Dump after branch alignments have been computed.
4738
4739 @item -fdump-rtl-asmcons
4740 @opindex fdump-rtl-asmcons
4741 Dump after fixing rtl statements that have unsatisfied in/out constraints.
4742
4743 @item -fdump-rtl-auto_inc_dec
4744 @opindex fdump-rtl-auto_inc_dec
4745 Dump after auto-inc-dec discovery.  This pass is only run on
4746 architectures that have auto inc or auto dec instructions.
4747
4748 @item -fdump-rtl-barriers
4749 @opindex fdump-rtl-barriers
4750 Dump after cleaning up the barrier instructions.
4751
4752 @item -fdump-rtl-bbpart
4753 @opindex fdump-rtl-bbpart
4754 Dump after partitioning hot and cold basic blocks.
4755
4756 @item -fdump-rtl-bbro
4757 @opindex fdump-rtl-bbro
4758 Dump after block reordering.
4759
4760 @item -fdump-rtl-btl1
4761 @itemx -fdump-rtl-btl2
4762 @opindex fdump-rtl-btl2
4763 @opindex fdump-rtl-btl2
4764 @option{-fdump-rtl-btl1} and @option{-fdump-rtl-btl2} enable dumping
4765 after the two branch
4766 target load optimization passes.
4767
4768 @item -fdump-rtl-bypass
4769 @opindex fdump-rtl-bypass
4770 Dump after jump bypassing and control flow optimizations.
4771
4772 @item -fdump-rtl-combine
4773 @opindex fdump-rtl-combine
4774 Dump after the RTL instruction combination pass.
4775
4776 @item -fdump-rtl-compgotos
4777 @opindex fdump-rtl-compgotos
4778 Dump after duplicating the computed gotos.
4779
4780 @item -fdump-rtl-ce1
4781 @itemx -fdump-rtl-ce2
4782 @itemx -fdump-rtl-ce3
4783 @opindex fdump-rtl-ce1
4784 @opindex fdump-rtl-ce2
4785 @opindex fdump-rtl-ce3
4786 @option{-fdump-rtl-ce1}, @option{-fdump-rtl-ce2}, and
4787 @option{-fdump-rtl-ce3} enable dumping after the three
4788 if conversion passes.
4789
4790 @itemx -fdump-rtl-cprop_hardreg
4791 @opindex fdump-rtl-cprop_hardreg
4792 Dump after hard register copy propagation.
4793
4794 @itemx -fdump-rtl-csa
4795 @opindex fdump-rtl-csa
4796 Dump after combining stack adjustments.
4797
4798 @item -fdump-rtl-cse1
4799 @itemx -fdump-rtl-cse2
4800 @opindex fdump-rtl-cse1
4801 @opindex fdump-rtl-cse2
4802 @option{-fdump-rtl-cse1} and @option{-fdump-rtl-cse2} enable dumping after
4803 the two common sub-expression elimination passes.
4804
4805 @itemx -fdump-rtl-dce
4806 @opindex fdump-rtl-dce
4807 Dump after the standalone dead code elimination passes.
4808
4809 @itemx -fdump-rtl-dbr
4810 @opindex fdump-rtl-dbr
4811 Dump after delayed branch scheduling.
4812
4813 @item -fdump-rtl-dce1
4814 @itemx -fdump-rtl-dce2
4815 @opindex fdump-rtl-dce1
4816 @opindex fdump-rtl-dce2
4817 @option{-fdump-rtl-dce1} and @option{-fdump-rtl-dce2} enable dumping after
4818 the two dead store elimination passes.
4819
4820 @item -fdump-rtl-eh
4821 @opindex fdump-rtl-eh
4822 Dump after finalization of EH handling code.
4823
4824 @item -fdump-rtl-eh_ranges
4825 @opindex fdump-rtl-eh_ranges
4826 Dump after conversion of EH handling range regions.
4827
4828 @item -fdump-rtl-expand
4829 @opindex fdump-rtl-expand
4830 Dump after RTL generation.
4831
4832 @item -fdump-rtl-fwprop1
4833 @itemx -fdump-rtl-fwprop2
4834 @opindex fdump-rtl-fwprop1
4835 @opindex fdump-rtl-fwprop2
4836 @option{-fdump-rtl-fwprop1} and @option{-fdump-rtl-fwprop2} enable
4837 dumping after the two forward propagation passes.
4838
4839 @item -fdump-rtl-gcse1
4840 @itemx -fdump-rtl-gcse2
4841 @opindex fdump-rtl-gcse1
4842 @opindex fdump-rtl-gcse2
4843 @option{-fdump-rtl-gcse1} and @option{-fdump-rtl-gcse2} enable dumping
4844 after global common subexpression elimination.
4845
4846 @item -fdump-rtl-init-regs
4847 @opindex fdump-rtl-init-regs
4848 Dump after the initialization of the registers.
4849
4850 @item -fdump-rtl-initvals
4851 @opindex fdump-rtl-initvals
4852 Dump after the computation of the initial value sets.
4853
4854 @itemx -fdump-rtl-into_cfglayout
4855 @opindex fdump-rtl-into_cfglayout
4856 Dump after converting to cfglayout mode.
4857
4858 @item -fdump-rtl-ira
4859 @opindex fdump-rtl-ira
4860 Dump after iterated register allocation.
4861
4862 @item -fdump-rtl-jump
4863 @opindex fdump-rtl-jump
4864 Dump after the second jump optimization.
4865
4866 @item -fdump-rtl-loop2
4867 @opindex fdump-rtl-loop2
4868 @option{-fdump-rtl-loop2} enables dumping after the rtl
4869 loop optimization passes.
4870
4871 @item -fdump-rtl-mach
4872 @opindex fdump-rtl-mach
4873 Dump after performing the machine dependent reorganization pass, if that
4874 pass exists.
4875
4876 @item -fdump-rtl-mode_sw
4877 @opindex fdump-rtl-mode_sw
4878 Dump after removing redundant mode switches.
4879
4880 @item -fdump-rtl-rnreg
4881 @opindex fdump-rtl-rnreg
4882 Dump after register renumbering.
4883
4884 @itemx -fdump-rtl-outof_cfglayout
4885 @opindex fdump-rtl-outof_cfglayout
4886 Dump after converting from cfglayout mode.
4887
4888 @item -fdump-rtl-peephole2
4889 @opindex fdump-rtl-peephole2
4890 Dump after the peephole pass.
4891
4892 @item -fdump-rtl-postreload
4893 @opindex fdump-rtl-postreload
4894 Dump after post-reload optimizations.
4895
4896 @itemx -fdump-rtl-pro_and_epilogue
4897 @opindex fdump-rtl-pro_and_epilogue
4898 Dump after generating the function pro and epilogues.
4899
4900 @item -fdump-rtl-regmove
4901 @opindex fdump-rtl-regmove
4902 Dump after the register move pass.
4903
4904 @item -fdump-rtl-sched1
4905 @itemx -fdump-rtl-sched2
4906 @opindex fdump-rtl-sched1
4907 @opindex fdump-rtl-sched2
4908 @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2} enable dumping
4909 after the basic block scheduling passes.
4910
4911 @item -fdump-rtl-see
4912 @opindex fdump-rtl-see
4913 Dump after sign extension elimination.
4914
4915 @item -fdump-rtl-seqabstr
4916 @opindex fdump-rtl-seqabstr
4917 Dump after common sequence discovery.
4918
4919 @item -fdump-rtl-shorten
4920 @opindex fdump-rtl-shorten
4921 Dump after shortening branches.
4922
4923 @item -fdump-rtl-sibling
4924 @opindex fdump-rtl-sibling
4925 Dump after sibling call optimizations.
4926
4927 @item -fdump-rtl-split1
4928 @itemx -fdump-rtl-split2
4929 @itemx -fdump-rtl-split3
4930 @itemx -fdump-rtl-split4
4931 @itemx -fdump-rtl-split5
4932 @opindex fdump-rtl-split1
4933 @opindex fdump-rtl-split2
4934 @opindex fdump-rtl-split3
4935 @opindex fdump-rtl-split4
4936 @opindex fdump-rtl-split5
4937 @option{-fdump-rtl-split1}, @option{-fdump-rtl-split2},
4938 @option{-fdump-rtl-split3}, @option{-fdump-rtl-split4} and
4939 @option{-fdump-rtl-split5} enable dumping after five rounds of
4940 instruction splitting.
4941
4942 @item -fdump-rtl-sms
4943 @opindex fdump-rtl-sms
4944 Dump after modulo scheduling.  This pass is only run on some
4945 architectures.
4946
4947 @item -fdump-rtl-stack
4948 @opindex fdump-rtl-stack
4949 Dump after conversion from GCC's "flat register file" registers to the
4950 x87's stack-like registers.  This pass is only run on x86 variants.
4951
4952 @item -fdump-rtl-subreg1
4953 @itemx -fdump-rtl-subreg2
4954 @opindex fdump-rtl-subreg1
4955 @opindex fdump-rtl-subreg2
4956 @option{-fdump-rtl-subreg1} and @option{-fdump-rtl-subreg2} enable dumping after
4957 the two subreg expansion passes.
4958
4959 @item -fdump-rtl-unshare
4960 @opindex fdump-rtl-unshare
4961 Dump after all rtl has been unshared.
4962
4963 @item -fdump-rtl-vartrack
4964 @opindex fdump-rtl-vartrack
4965 Dump after variable tracking.
4966
4967 @item -fdump-rtl-vregs
4968 @opindex fdump-rtl-vregs
4969 Dump after converting virtual registers to hard registers.
4970
4971 @item -fdump-rtl-web
4972 @opindex fdump-rtl-web
4973 Dump after live range splitting.
4974
4975 @item -fdump-rtl-regclass
4976 @itemx -fdump-rtl-subregs_of_mode_init
4977 @itemx -fdump-rtl-subregs_of_mode_finish
4978 @itemx -fdump-rtl-dfinit
4979 @itemx -fdump-rtl-dfinish
4980 @opindex fdump-rtl-regclass
4981 @opindex fdump-rtl-subregs_of_mode_init
4982 @opindex fdump-rtl-subregs_of_mode_finish
4983 @opindex fdump-rtl-dfinit
4984 @opindex fdump-rtl-dfinish
4985 These dumps are defined but always produce empty files.
4986
4987 @item -fdump-rtl-all
4988 @opindex fdump-rtl-all
4989 Produce all the dumps listed above.
4990
4991 @item -dA
4992 @opindex dA
4993 Annotate the assembler output with miscellaneous debugging information.
4994
4995 @item -dD
4996 @opindex dD
4997 Dump all macro definitions, at the end of preprocessing, in addition to
4998 normal output.
4999
5000 @item -dH
5001 @opindex dH
5002 Produce a core dump whenever an error occurs.
5003
5004 @item -dm
5005 @opindex dm
5006 Print statistics on memory usage, at the end of the run, to
5007 standard error.
5008
5009 @item -dp
5010 @opindex dp
5011 Annotate the assembler output with a comment indicating which
5012 pattern and alternative was used.  The length of each instruction is
5013 also printed.
5014
5015 @item -dP
5016 @opindex dP
5017 Dump the RTL in the assembler output as a comment before each instruction.
5018 Also turns on @option{-dp} annotation.
5019
5020 @item -dv
5021 @opindex dv
5022 For each of the other indicated dump files (@option{-fdump-rtl-@var{pass}}),
5023 dump a representation of the control flow graph suitable for viewing with VCG
5024 to @file{@var{file}.@var{pass}.vcg}.
5025
5026 @item -dx
5027 @opindex dx
5028 Just generate RTL for a function instead of compiling it.  Usually used
5029 with @option{-fdump-rtl-expand}.
5030
5031 @item -dy
5032 @opindex dy
5033 Dump debugging information during parsing, to standard error.
5034 @end table
5035
5036 @item -fdump-noaddr
5037 @opindex fdump-noaddr
5038 When doing debugging dumps, suppress address output.  This makes it more
5039 feasible to use diff on debugging dumps for compiler invocations with
5040 different compiler binaries and/or different
5041 text / bss / data / heap / stack / dso start locations.
5042
5043 @item -fdump-unnumbered
5044 @opindex fdump-unnumbered
5045 When doing debugging dumps, suppress instruction numbers and address output.
5046 This makes it more feasible to use diff on debugging dumps for compiler
5047 invocations with different options, in particular with and without
5048 @option{-g}.
5049
5050 @item -fdump-unnumbered-links
5051 @opindex fdump-unnumbered-links
5052 When doing debugging dumps (see @option{-d} option above), suppress
5053 instruction numbers for the links to the previous and next instructions
5054 in a sequence.
5055
5056 @item -fdump-translation-unit @r{(C++ only)}
5057 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
5058 @opindex fdump-translation-unit
5059 Dump a representation of the tree structure for the entire translation
5060 unit to a file.  The file name is made by appending @file{.tu} to the
5061 source file name, and the file is created in the same directory as the
5062 output file.  If the @samp{-@var{options}} form is used, @var{options}
5063 controls the details of the dump as described for the
5064 @option{-fdump-tree} options.
5065
5066 @item -fdump-class-hierarchy @r{(C++ only)}
5067 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
5068 @opindex fdump-class-hierarchy
5069 Dump a representation of each class's hierarchy and virtual function
5070 table layout to a file.  The file name is made by appending
5071 @file{.class} to the source file name, and the file is created in the
5072 same directory as the output file.  If the @samp{-@var{options}} form
5073 is used, @var{options} controls the details of the dump as described
5074 for the @option{-fdump-tree} options.
5075
5076 @item -fdump-ipa-@var{switch}
5077 @opindex fdump-ipa
5078 Control the dumping at various stages of inter-procedural analysis
5079 language tree to a file.  The file name is generated by appending a
5080 switch specific suffix to the source file name, and the file is created
5081 in the same directory as the output file.  The following dumps are
5082 possible:
5083
5084 @table @samp
5085 @item all
5086 Enables all inter-procedural analysis dumps.
5087
5088 @item cgraph
5089 Dumps information about call-graph optimization, unused function removal,
5090 and inlining decisions.
5091
5092 @item inline
5093 Dump after function inlining.
5094
5095 @end table
5096
5097 @item -fdump-statistics-@var{option}
5098 @opindex fdump-statistics
5099 Enable and control dumping of pass statistics in a separate file.  The
5100 file name is generated by appending a suffix ending in
5101 @samp{.statistics} to the source file name, and the file is created in
5102 the same directory as the output file.  If the @samp{-@var{option}}
5103 form is used, @samp{-stats} will cause counters to be summed over the
5104 whole compilation unit while @samp{-details} will dump every event as
5105 the passes generate them.  The default with no option is to sum
5106 counters for each function compiled.
5107
5108 @item -fdump-tree-@var{switch}
5109 @itemx -fdump-tree-@var{switch}-@var{options}
5110 @opindex fdump-tree
5111 Control the dumping at various stages of processing the intermediate
5112 language tree to a file.  The file name is generated by appending a
5113 switch specific suffix to the source file name, and the file is
5114 created in the same directory as the output file.  If the
5115 @samp{-@var{options}} form is used, @var{options} is a list of
5116 @samp{-} separated options that control the details of the dump.  Not
5117 all options are applicable to all dumps, those which are not
5118 meaningful will be ignored.  The following options are available
5119
5120 @table @samp
5121 @item address
5122 Print the address of each node.  Usually this is not meaningful as it
5123 changes according to the environment and source file.  Its primary use
5124 is for tying up a dump file with a debug environment.
5125 @item asmname
5126 If @code{DECL_ASSEMBLER_NAME} has been set for a given decl, use that
5127 in the dump instead of @code{DECL_NAME}.  Its primary use is ease of
5128 use working backward from mangled names in the assembly file.
5129 @item slim
5130 Inhibit dumping of members of a scope or body of a function merely
5131 because that scope has been reached.  Only dump such items when they
5132 are directly reachable by some other path.  When dumping pretty-printed
5133 trees, this option inhibits dumping the bodies of control structures.
5134 @item raw
5135 Print a raw representation of the tree.  By default, trees are
5136 pretty-printed into a C-like representation.
5137 @item details
5138 Enable more detailed dumps (not honored by every dump option).
5139 @item stats
5140 Enable dumping various statistics about the pass (not honored by every dump
5141 option).
5142 @item blocks
5143 Enable showing basic block boundaries (disabled in raw dumps).
5144 @item vops
5145 Enable showing virtual operands for every statement.
5146 @item lineno
5147 Enable showing line numbers for statements.
5148 @item uid
5149 Enable showing the unique ID (@code{DECL_UID}) for each variable.
5150 @item verbose
5151 Enable showing the tree dump for each statement.
5152 @item all
5153 Turn on all options, except @option{raw}, @option{slim}, @option{verbose}
5154 and @option{lineno}.
5155 @end table
5156
5157 The following tree dumps are possible:
5158 @table @samp
5159
5160 @item original
5161 @opindex fdump-tree-original
5162 Dump before any tree based optimization, to @file{@var{file}.original}.
5163
5164 @item optimized
5165 @opindex fdump-tree-optimized
5166 Dump after all tree based optimization, to @file{@var{file}.optimized}.
5167
5168 @item gimple
5169 @opindex fdump-tree-gimple
5170 Dump each function before and after the gimplification pass to a file.  The
5171 file name is made by appending @file{.gimple} to the source file name.
5172
5173 @item cfg
5174 @opindex fdump-tree-cfg
5175 Dump the control flow graph of each function to a file.  The file name is
5176 made by appending @file{.cfg} to the source file name.
5177
5178 @item vcg
5179 @opindex fdump-tree-vcg
5180 Dump the control flow graph of each function to a file in VCG format.  The
5181 file name is made by appending @file{.vcg} to the source file name.  Note
5182 that if the file contains more than one function, the generated file cannot
5183 be used directly by VCG@.  You will need to cut and paste each function's
5184 graph into its own separate file first.
5185
5186 @item ch
5187 @opindex fdump-tree-ch
5188 Dump each function after copying loop headers.  The file name is made by
5189 appending @file{.ch} to the source file name.
5190
5191 @item ssa
5192 @opindex fdump-tree-ssa
5193 Dump SSA related information to a file.  The file name is made by appending
5194 @file{.ssa} to the source file name.
5195
5196 @item alias
5197 @opindex fdump-tree-alias
5198 Dump aliasing information for each function.  The file name is made by
5199 appending @file{.alias} to the source file name.
5200
5201 @item ccp
5202 @opindex fdump-tree-ccp
5203 Dump each function after CCP@.  The file name is made by appending
5204 @file{.ccp} to the source file name.
5205
5206 @item storeccp
5207 @opindex fdump-tree-storeccp
5208 Dump each function after STORE-CCP@.  The file name is made by appending
5209 @file{.storeccp} to the source file name.
5210
5211 @item pre
5212 @opindex fdump-tree-pre
5213 Dump trees after partial redundancy elimination.  The file name is made
5214 by appending @file{.pre} to the source file name.
5215
5216 @item fre
5217 @opindex fdump-tree-fre
5218 Dump trees after full redundancy elimination.  The file name is made
5219 by appending @file{.fre} to the source file name.
5220
5221 @item copyprop
5222 @opindex fdump-tree-copyprop
5223 Dump trees after copy propagation.  The file name is made
5224 by appending @file{.copyprop} to the source file name.
5225
5226 @item store_copyprop
5227 @opindex fdump-tree-store_copyprop
5228 Dump trees after store copy-propagation.  The file name is made
5229 by appending @file{.store_copyprop} to the source file name.
5230
5231 @item dce
5232 @opindex fdump-tree-dce
5233 Dump each function after dead code elimination.  The file name is made by
5234 appending @file{.dce} to the source file name.
5235
5236 @item mudflap
5237 @opindex fdump-tree-mudflap
5238 Dump each function after adding mudflap instrumentation.  The file name is
5239 made by appending @file{.mudflap} to the source file name.
5240
5241 @item sra
5242 @opindex fdump-tree-sra
5243 Dump each function after performing scalar replacement of aggregates.  The
5244 file name is made by appending @file{.sra} to the source file name.
5245
5246 @item sink
5247 @opindex fdump-tree-sink
5248 Dump each function after performing code sinking.  The file name is made
5249 by appending @file{.sink} to the source file name.
5250
5251 @item dom
5252 @opindex fdump-tree-dom
5253 Dump each function after applying dominator tree optimizations.  The file
5254 name is made by appending @file{.dom} to the source file name.
5255
5256 @item dse
5257 @opindex fdump-tree-dse
5258 Dump each function after applying dead store elimination.  The file
5259 name is made by appending @file{.dse} to the source file name.
5260
5261 @item phiopt
5262 @opindex fdump-tree-phiopt
5263 Dump each function after optimizing PHI nodes into straightline code.  The file
5264 name is made by appending @file{.phiopt} to the source file name.
5265
5266 @item forwprop
5267 @opindex fdump-tree-forwprop
5268 Dump each function after forward propagating single use variables.  The file
5269 name is made by appending @file{.forwprop} to the source file name.
5270
5271 @item copyrename
5272 @opindex fdump-tree-copyrename
5273 Dump each function after applying the copy rename optimization.  The file
5274 name is made by appending @file{.copyrename} to the source file name.
5275
5276 @item nrv
5277 @opindex fdump-tree-nrv
5278 Dump each function after applying the named return value optimization on
5279 generic trees.  The file name is made by appending @file{.nrv} to the source
5280 file name.
5281
5282 @item vect
5283 @opindex fdump-tree-vect
5284 Dump each function after applying vectorization of loops.  The file name is
5285 made by appending @file{.vect} to the source file name.
5286
5287 @item vrp
5288 @opindex fdump-tree-vrp
5289 Dump each function after Value Range Propagation (VRP).  The file name
5290 is made by appending @file{.vrp} to the source file name.
5291
5292 @item all
5293 @opindex fdump-tree-all
5294 Enable all the available tree dumps with the flags provided in this option.
5295 @end table
5296
5297 @item -ftree-vectorizer-verbose=@var{n}
5298 @opindex ftree-vectorizer-verbose
5299 This option controls the amount of debugging output the vectorizer prints.
5300 This information is written to standard error, unless
5301 @option{-fdump-tree-all} or @option{-fdump-tree-vect} is specified,
5302 in which case it is output to the usual dump listing file, @file{.vect}.
5303 For @var{n}=0 no diagnostic information is reported.
5304 If @var{n}=1 the vectorizer reports each loop that got vectorized,
5305 and the total number of loops that got vectorized.
5306 If @var{n}=2 the vectorizer also reports non-vectorized loops that passed
5307 the first analysis phase (vect_analyze_loop_form) - i.e.@: countable,
5308 inner-most, single-bb, single-entry/exit loops.  This is the same verbosity
5309 level that @option{-fdump-tree-vect-stats} uses.
5310 Higher verbosity levels mean either more information dumped for each
5311 reported loop, or same amount of information reported for more loops:
5312 If @var{n}=3, alignment related information is added to the reports.
5313 If @var{n}=4, data-references related information (e.g.@: memory dependences,
5314 memory access-patterns) is added to the reports.
5315 If @var{n}=5, the vectorizer reports also non-vectorized inner-most loops
5316 that did not pass the first analysis phase (i.e., may not be countable, or
5317 may have complicated control-flow).
5318 If @var{n}=6, the vectorizer reports also non-vectorized nested loops.
5319 For @var{n}=7, all the information the vectorizer generates during its
5320 analysis and transformation is reported.  This is the same verbosity level
5321 that @option{-fdump-tree-vect-details} uses.
5322
5323 @item -frandom-seed=@var{string}
5324 @opindex frandom-seed
5325 This option provides a seed that GCC uses when it would otherwise use
5326 random numbers.  It is used to generate certain symbol names
5327 that have to be different in every compiled file.  It is also used to
5328 place unique stamps in coverage data files and the object files that
5329 produce them.  You can use the @option{-frandom-seed} option to produce
5330 reproducibly identical object files.
5331
5332 The @var{string} should be different for every file you compile.
5333
5334 @item -fsched-verbose=@var{n}
5335 @opindex fsched-verbose
5336 On targets that use instruction scheduling, this option controls the
5337 amount of debugging output the scheduler prints.  This information is
5338 written to standard error, unless @option{-fdump-rtl-sched1} or
5339 @option{-fdump-rtl-sched2} is specified, in which case it is output
5340 to the usual dump listing file, @file{.sched} or @file{.sched2}
5341 respectively.  However for @var{n} greater than nine, the output is
5342 always printed to standard error.
5343
5344 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
5345 same information as @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2}.
5346 For @var{n} greater than one, it also output basic block probabilities,
5347 detailed ready list information and unit/insn info.  For @var{n} greater
5348 than two, it includes RTL at abort point, control-flow and regions info.
5349 And for @var{n} over four, @option{-fsched-verbose} also includes
5350 dependence info.
5351
5352 @item -save-temps
5353 @itemx -save-temps=cwd
5354 @opindex save-temps
5355 Store the usual ``temporary'' intermediate files permanently; place them
5356 in the current directory and name them based on the source file.  Thus,
5357 compiling @file{foo.c} with @samp{-c -save-temps} would produce files
5358 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
5359 preprocessed @file{foo.i} output file even though the compiler now
5360 normally uses an integrated preprocessor.
5361
5362 When used in combination with the @option{-x} command line option,
5363 @option{-save-temps} is sensible enough to avoid over writing an
5364 input source file with the same extension as an intermediate file.
5365 The corresponding intermediate file may be obtained by renaming the
5366 source file before using @option{-save-temps}.
5367
5368 If you invoke GCC in parallel, compiling several different source
5369 files that share a common base name in different subdirectories or the
5370 same source file compiled for multiple output destinations, it is
5371 likely that the different parallel compilers will interfere with each
5372 other, and overwrite the temporary files.  For instance:
5373
5374 @smallexample
5375 gcc -save-temps -o outdir1/foo.o indir1/foo.c&
5376 gcc -save-temps -o outdir2/foo.o indir2/foo.c&
5377 @end smallexample
5378
5379 may result in @file{foo.i} and @file{foo.o} being written to
5380 simultaneously by both compilers.
5381
5382 @item -save-temps=obj
5383 @opindex save-temps=obj
5384 Store the usual ``temporary'' intermediate files permanently.  If the
5385 @option{-o} option is used, the temporary files are based on the
5386 object file.  If the @option{-o} option is not used, the
5387 @option{-save-temps=obj} switch behaves like @option{-save-temps}.
5388
5389 For example:
5390
5391 @smallexample
5392 gcc -save-temps=obj -c foo.c
5393 gcc -save-temps=obj -c bar.c -o dir/xbar.o
5394 gcc -save-temps=obj foobar.c -o dir2/yfoobar
5395 @end smallexample
5396
5397 would create @file{foo.i}, @file{foo.s}, @file{dir/xbar.i},
5398 @file{dir/xbar.s}, @file{dir2/yfoobar.i}, @file{dir2/yfoobar.s}, and
5399 @file{dir2/yfoobar.o}.
5400
5401 @item -time@r{[}=@var{file}@r{]}
5402 @opindex time
5403 Report the CPU time taken by each subprocess in the compilation
5404 sequence.  For C source files, this is the compiler proper and assembler
5405 (plus the linker if linking is done).
5406
5407 Without the specification of an output file, the output looks like this:
5408
5409 @smallexample
5410 # cc1 0.12 0.01
5411 # as 0.00 0.01
5412 @end smallexample
5413
5414 The first number on each line is the ``user time'', that is time spent
5415 executing the program itself.  The second number is ``system time'',
5416 time spent executing operating system routines on behalf of the program.
5417 Both numbers are in seconds.
5418
5419 With the specification of an output file, the output is appended to the
5420 named file, and it looks like this:
5421
5422 @smallexample
5423 0.12 0.01 cc1 @var{options}
5424 0.00 0.01 as @var{options}
5425 @end smallexample
5426
5427 The ``user time'' and the ``system time'' are moved before the program
5428 name, and the options passed to the program are displayed, so that one
5429 can later tell what file was being compiled, and with which options.
5430
5431 @item -fvar-tracking
5432 @opindex fvar-tracking
5433 Run variable tracking pass.  It computes where variables are stored at each
5434 position in code.  Better debugging information is then generated
5435 (if the debugging information format supports this information).
5436
5437 It is enabled by default when compiling with optimization (@option{-Os},
5438 @option{-O}, @option{-O2}, @dots{}), debugging information (@option{-g}) and
5439 the debug info format supports it.
5440
5441 @item -print-file-name=@var{library}
5442 @opindex print-file-name
5443 Print the full absolute name of the library file @var{library} that
5444 would be used when linking---and don't do anything else.  With this
5445 option, GCC does not compile or link anything; it just prints the
5446 file name.
5447
5448 @item -print-multi-directory
5449 @opindex print-multi-directory
5450 Print the directory name corresponding to the multilib selected by any
5451 other switches present in the command line.  This directory is supposed
5452 to exist in @env{GCC_EXEC_PREFIX}.
5453
5454 @item -print-multi-lib
5455 @opindex print-multi-lib
5456 Print the mapping from multilib directory names to compiler switches
5457 that enable them.  The directory name is separated from the switches by
5458 @samp{;}, and each switch starts with an @samp{@@} instead of the
5459 @samp{-}, without spaces between multiple switches.  This is supposed to
5460 ease shell-processing.
5461
5462 @item -print-prog-name=@var{program}
5463 @opindex print-prog-name
5464 Like @option{-print-file-name}, but searches for a program such as @samp{cpp}.
5465
5466 @item -print-libgcc-file-name
5467 @opindex print-libgcc-file-name
5468 Same as @option{-print-file-name=libgcc.a}.
5469
5470 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
5471 but you do want to link with @file{libgcc.a}.  You can do
5472
5473 @smallexample
5474 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
5475 @end smallexample
5476
5477 @item -print-search-dirs
5478 @opindex print-search-dirs
5479 Print the name of the configured installation directory and a list of
5480 program and library directories @command{gcc} will search---and don't do anything else.
5481
5482 This is useful when @command{gcc} prints the error message
5483 @samp{installation problem, cannot exec cpp0: No such file or directory}.
5484 To resolve this you either need to put @file{cpp0} and the other compiler
5485 components where @command{gcc} expects to find them, or you can set the environment
5486 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
5487 Don't forget the trailing @samp{/}.
5488 @xref{Environment Variables}.
5489
5490 @item -print-sysroot
5491 @opindex print-sysroot
5492 Print the target sysroot directory that will be used during
5493 compilation.  This is the target sysroot specified either at configure
5494 time or using the @option{--sysroot} option, possibly with an extra
5495 suffix that depends on compilation options.  If no target sysroot is
5496 specified, the option prints nothing.
5497
5498 @item -print-sysroot-headers-suffix
5499 @opindex print-sysroot-headers-suffix
5500 Print the suffix added to the target sysroot when searching for
5501 headers, or give an error if the compiler is not configured with such
5502 a suffix---and don't do anything else.
5503
5504 @item -dumpmachine
5505 @opindex dumpmachine
5506 Print the compiler's target machine (for example,
5507 @samp{i686-pc-linux-gnu})---and don't do anything else.
5508
5509 @item -dumpversion
5510 @opindex dumpversion
5511 Print the compiler version (for example, @samp{3.0})---and don't do
5512 anything else.
5513
5514 @item -dumpspecs
5515 @opindex dumpspecs
5516 Print the compiler's built-in specs---and don't do anything else.  (This
5517 is used when GCC itself is being built.)  @xref{Spec Files}.
5518
5519 @item -feliminate-unused-debug-types
5520 @opindex feliminate-unused-debug-types
5521 Normally, when producing DWARF2 output, GCC will emit debugging
5522 information for all types declared in a compilation
5523 unit, regardless of whether or not they are actually used
5524 in that compilation unit.  Sometimes this is useful, such as
5525 if, in the debugger, you want to cast a value to a type that is
5526 not actually used in your program (but is declared).  More often,
5527 however, this results in a significant amount of wasted space.
5528 With this option, GCC will avoid producing debug symbol output
5529 for types that are nowhere used in the source file being compiled.
5530 @end table
5531
5532 @node Optimize Options
5533 @section Options That Control Optimization
5534 @cindex optimize options
5535 @cindex options, optimization
5536
5537 These options control various sorts of optimizations.
5538
5539 Without any optimization option, the compiler's goal is to reduce the
5540 cost of compilation and to make debugging produce the expected
5541 results.  Statements are independent: if you stop the program with a
5542 breakpoint between statements, you can then assign a new value to any
5543 variable or change the program counter to any other statement in the
5544 function and get exactly the results you would expect from the source
5545 code.
5546
5547 Turning on optimization flags makes the compiler attempt to improve
5548 the performance and/or code size at the expense of compilation time
5549 and possibly the ability to debug the program.
5550
5551 The compiler performs optimization based on the knowledge it has of the
5552 program.  Compiling multiple files at once to a single output file mode allows
5553 the compiler to use information gained from all of the files when compiling
5554 each of them.
5555
5556 Not all optimizations are controlled directly by a flag.  Only
5557 optimizations that have a flag are listed in this section.
5558
5559 Depending on the target and how GCC was configured, a slightly different
5560 set of optimizations may be enabled at each @option{-O} level than
5561 those listed here.  You can invoke GCC with @samp{-Q --help=optimizers}
5562 to find out the exact set of optimizations that are enabled at each level.
5563 @xref{Overall Options}, for examples.
5564
5565 @table @gcctabopt
5566 @item -O
5567 @itemx -O1
5568 @opindex O
5569 @opindex O1
5570 Optimize.  Optimizing compilation takes somewhat more time, and a lot
5571 more memory for a large function.
5572
5573 With @option{-O}, the compiler tries to reduce code size and execution
5574 time, without performing any optimizations that take a great deal of
5575 compilation time.
5576
5577 @option{-O} turns on the following optimization flags:
5578 @gccoptlist{
5579 -fauto-inc-dec @gol
5580 -fcprop-registers @gol
5581 -fdce @gol
5582 -fdefer-pop @gol
5583 -fdelayed-branch @gol
5584 -fdse @gol
5585 -fguess-branch-probability @gol
5586 -fif-conversion2 @gol
5587 -fif-conversion @gol
5588 -finline-small-functions @gol
5589 -fipa-pure-const @gol
5590 -fipa-reference @gol
5591 -fmerge-constants
5592 -fsplit-wide-types @gol
5593 -ftree-builtin-call-dce @gol
5594 -ftree-ccp @gol
5595 -ftree-ch @gol
5596 -ftree-copyrename @gol
5597 -ftree-dce @gol
5598 -ftree-dominator-opts @gol
5599 -ftree-dse @gol
5600 -ftree-forwprop @gol
5601 -ftree-fre @gol
5602 -ftree-phiprop @gol
5603 -ftree-sra @gol
5604 -ftree-pta @gol
5605 -ftree-ter @gol
5606 -funit-at-a-time}
5607
5608 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
5609 where doing so does not interfere with debugging.
5610
5611 @item -O2
5612 @opindex O2
5613 Optimize even more.  GCC performs nearly all supported optimizations
5614 that do not involve a space-speed tradeoff.
5615 As compared to @option{-O}, this option increases both compilation time
5616 and the performance of the generated code.
5617
5618 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
5619 also turns on the following optimization flags:
5620 @gccoptlist{-fthread-jumps @gol
5621 -falign-functions  -falign-jumps @gol
5622 -falign-loops  -falign-labels @gol
5623 -fcaller-saves @gol
5624 -fcrossjumping @gol
5625 -fcse-follow-jumps  -fcse-skip-blocks @gol
5626 -fdelete-null-pointer-checks @gol
5627 -fexpensive-optimizations @gol
5628 -fgcse  -fgcse-lm  @gol
5629 -findirect-inlining @gol
5630 -foptimize-sibling-calls @gol
5631 -fpeephole2 @gol
5632 -fregmove @gol
5633 -freorder-blocks  -freorder-functions @gol
5634 -frerun-cse-after-loop  @gol
5635 -fsched-interblock  -fsched-spec @gol
5636 -fschedule-insns  -fschedule-insns2 @gol
5637 -fstrict-aliasing -fstrict-overflow @gol
5638 -ftree-switch-conversion @gol
5639 -ftree-pre @gol
5640 -ftree-vrp}
5641
5642 Please note the warning under @option{-fgcse} about
5643 invoking @option{-O2} on programs that use computed gotos.
5644
5645 @item -O3
5646 @opindex O3
5647 Optimize yet more.  @option{-O3} turns on all optimizations specified
5648 by @option{-O2} and also turns on the @option{-finline-functions},
5649 @option{-funswitch-loops}, @option{-fpredictive-commoning},
5650 @option{-fgcse-after-reload} and @option{-ftree-vectorize} options.
5651
5652 @item -O0
5653 @opindex O0
5654 Reduce compilation time and make debugging produce the expected
5655 results.  This is the default.
5656
5657 @item -Os
5658 @opindex Os
5659 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
5660 do not typically increase code size.  It also performs further
5661 optimizations designed to reduce code size.
5662
5663 @option{-Os} disables the following optimization flags:
5664 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
5665 -falign-labels  -freorder-blocks  -freorder-blocks-and-partition @gol
5666 -fprefetch-loop-arrays  -ftree-vect-loop-version}
5667
5668 If you use multiple @option{-O} options, with or without level numbers,
5669 the last such option is the one that is effective.
5670 @end table
5671
5672 Options of the form @option{-f@var{flag}} specify machine-independent
5673 flags.  Most flags have both positive and negative forms; the negative
5674 form of @option{-ffoo} would be @option{-fno-foo}.  In the table
5675 below, only one of the forms is listed---the one you typically will
5676 use.  You can figure out the other form by either removing @samp{no-}
5677 or adding it.
5678
5679 The following options control specific optimizations.  They are either
5680 activated by @option{-O} options or are related to ones that are.  You
5681 can use the following flags in the rare cases when ``fine-tuning'' of
5682 optimizations to be performed is desired.
5683
5684 @table @gcctabopt
5685 @item -fno-default-inline
5686 @opindex fno-default-inline
5687 Do not make member functions inline by default merely because they are
5688 defined inside the class scope (C++ only).  Otherwise, when you specify
5689 @w{@option{-O}}, member functions defined inside class scope are compiled
5690 inline by default; i.e., you don't need to add @samp{inline} in front of
5691 the member function name.
5692
5693 @item -fno-defer-pop
5694 @opindex fno-defer-pop
5695 Always pop the arguments to each function call as soon as that function
5696 returns.  For machines which must pop arguments after a function call,
5697 the compiler normally lets arguments accumulate on the stack for several
5698 function calls and pops them all at once.
5699
5700 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5701
5702 @item -fforward-propagate
5703 @opindex fforward-propagate
5704 Perform a forward propagation pass on RTL@.  The pass tries to combine two
5705 instructions and checks if the result can be simplified.  If loop unrolling
5706 is active, two passes are performed and the second is scheduled after
5707 loop unrolling.
5708
5709 This option is enabled by default at optimization levels @option{-O},
5710 @option{-O2}, @option{-O3}, @option{-Os}.
5711
5712 @item -fomit-frame-pointer
5713 @opindex fomit-frame-pointer
5714 Don't keep the frame pointer in a register for functions that
5715 don't need one.  This avoids the instructions to save, set up and
5716 restore frame pointers; it also makes an extra register available
5717 in many functions.  @strong{It also makes debugging impossible on
5718 some machines.}
5719
5720 On some machines, such as the VAX, this flag has no effect, because
5721 the standard calling sequence automatically handles the frame pointer
5722 and nothing is saved by pretending it doesn't exist.  The
5723 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
5724 whether a target machine supports this flag.  @xref{Registers,,Register
5725 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
5726
5727 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5728
5729 @item -foptimize-sibling-calls
5730 @opindex foptimize-sibling-calls
5731 Optimize sibling and tail recursive calls.
5732
5733 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5734
5735 @item -fno-inline
5736 @opindex fno-inline
5737 Don't pay attention to the @code{inline} keyword.  Normally this option
5738 is used to keep the compiler from expanding any functions inline.
5739 Note that if you are not optimizing, no functions can be expanded inline.
5740
5741 @item -finline-small-functions
5742 @opindex finline-small-functions
5743 Integrate functions into their callers when their body is smaller than expected
5744 function call code (so overall size of program gets smaller).  The compiler
5745 heuristically decides which functions are simple enough to be worth integrating
5746 in this way.
5747
5748 Enabled at level @option{-O2}.
5749
5750 @item -findirect-inlining
5751 @opindex findirect-inlining
5752 Inline also indirect calls that are discovered to be known at compile
5753 time thanks to previous inlining.  This option has any effect only
5754 when inlining itself is turned on by the @option{-finline-functions}
5755 or @option{-finline-small-functions} options.
5756
5757 Enabled at level @option{-O2}.
5758
5759 @item -finline-functions
5760 @opindex finline-functions
5761 Integrate all simple functions into their callers.  The compiler
5762 heuristically decides which functions are simple enough to be worth
5763 integrating in this way.
5764
5765 If all calls to a given function are integrated, and the function is
5766 declared @code{static}, then the function is normally not output as
5767 assembler code in its own right.
5768
5769 Enabled at level @option{-O3}.
5770
5771 @item -finline-functions-called-once
5772 @opindex finline-functions-called-once
5773 Consider all @code{static} functions called once for inlining into their
5774 caller even if they are not marked @code{inline}.  If a call to a given
5775 function is integrated, then the function is not output as assembler code
5776 in its own right.
5777
5778 Enabled at levels @option{-O1}, @option{-O2}, @option{-O3} and @option{-Os}.
5779
5780 @item -fearly-inlining
5781 @opindex fearly-inlining
5782 Inline functions marked by @code{always_inline} and functions whose body seems
5783 smaller than the function call overhead early before doing
5784 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
5785 makes profiling significantly cheaper and usually inlining faster on programs
5786 having large chains of nested wrapper functions.
5787
5788 Enabled by default.
5789
5790 @item -finline-limit=@var{n}
5791 @opindex finline-limit
5792 By default, GCC limits the size of functions that can be inlined.  This flag
5793 allows coarse control of this limit.  @var{n} is the size of functions that
5794 can be inlined in number of pseudo instructions.
5795
5796 Inlining is actually controlled by a number of parameters, which may be
5797 specified individually by using @option{--param @var{name}=@var{value}}.
5798 The @option{-finline-limit=@var{n}} option sets some of these parameters
5799 as follows:
5800
5801 @table @gcctabopt
5802 @item max-inline-insns-single
5803 is set to @var{n}/2.
5804 @item max-inline-insns-auto
5805 is set to @var{n}/2.
5806 @end table
5807
5808 See below for a documentation of the individual
5809 parameters controlling inlining and for the defaults of these parameters.
5810
5811 @emph{Note:} there may be no value to @option{-finline-limit} that results
5812 in default behavior.
5813
5814 @emph{Note:} pseudo instruction represents, in this particular context, an
5815 abstract measurement of function's size.  In no way does it represent a count
5816 of assembly instructions and as such its exact meaning might change from one
5817 release to an another.
5818
5819 @item -fkeep-inline-functions
5820 @opindex fkeep-inline-functions
5821 In C, emit @code{static} functions that are declared @code{inline}
5822 into the object file, even if the function has been inlined into all
5823 of its callers.  This switch does not affect functions using the
5824 @code{extern inline} extension in GNU C89@.  In C++, emit any and all
5825 inline functions into the object file.
5826
5827 @item -fkeep-static-consts
5828 @opindex fkeep-static-consts
5829 Emit variables declared @code{static const} when optimization isn't turned
5830 on, even if the variables aren't referenced.
5831
5832 GCC enables this option by default.  If you want to force the compiler to
5833 check if the variable was referenced, regardless of whether or not
5834 optimization is turned on, use the @option{-fno-keep-static-consts} option.
5835
5836 @item -fmerge-constants
5837 @opindex fmerge-constants
5838 Attempt to merge identical constants (string constants and floating point
5839 constants) across compilation units.
5840
5841 This option is the default for optimized compilation if the assembler and
5842 linker support it.  Use @option{-fno-merge-constants} to inhibit this
5843 behavior.
5844
5845 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
5846
5847 @item -fmerge-all-constants
5848 @opindex fmerge-all-constants
5849 Attempt to merge identical constants and identical variables.
5850
5851 This option implies @option{-fmerge-constants}.  In addition to
5852 @option{-fmerge-constants} this considers e.g.@: even constant initialized
5853 arrays or initialized constant variables with integral or floating point
5854 types.  Languages like C or C++ require each variable, including multiple
5855 instances of the same variable in recursive calls, to have distinct locations,
5856 so using this option will result in non-conforming
5857 behavior.
5858
5859 @item -fmodulo-sched
5860 @opindex fmodulo-sched
5861 Perform swing modulo scheduling immediately before the first scheduling
5862 pass.  This pass looks at innermost loops and reorders their
5863 instructions by overlapping different iterations.
5864
5865 @item -fmodulo-sched-allow-regmoves
5866 @opindex fmodulo-sched-allow-regmoves
5867 Perform more aggressive SMS based modulo scheduling with register moves
5868 allowed.  By setting this flag certain anti-dependences edges will be
5869 deleted which will trigger the generation of reg-moves based on the
5870 life-range analysis.  This option is effective only with
5871 @option{-fmodulo-sched} enabled.
5872
5873 @item -fno-branch-count-reg
5874 @opindex fno-branch-count-reg
5875 Do not use ``decrement and branch'' instructions on a count register,
5876 but instead generate a sequence of instructions that decrement a
5877 register, compare it against zero, then branch based upon the result.
5878 This option is only meaningful on architectures that support such
5879 instructions, which include x86, PowerPC, IA-64 and S/390.
5880
5881 The default is @option{-fbranch-count-reg}.
5882
5883 @item -fno-function-cse
5884 @opindex fno-function-cse
5885 Do not put function addresses in registers; make each instruction that
5886 calls a constant function contain the function's address explicitly.
5887
5888 This option results in less efficient code, but some strange hacks
5889 that alter the assembler output may be confused by the optimizations
5890 performed when this option is not used.
5891
5892 The default is @option{-ffunction-cse}
5893
5894 @item -fno-zero-initialized-in-bss
5895 @opindex fno-zero-initialized-in-bss
5896 If the target supports a BSS section, GCC by default puts variables that
5897 are initialized to zero into BSS@.  This can save space in the resulting
5898 code.
5899
5900 This option turns off this behavior because some programs explicitly
5901 rely on variables going to the data section.  E.g., so that the
5902 resulting executable can find the beginning of that section and/or make
5903 assumptions based on that.
5904
5905 The default is @option{-fzero-initialized-in-bss}.
5906
5907 @item -fmudflap -fmudflapth -fmudflapir
5908 @opindex fmudflap
5909 @opindex fmudflapth
5910 @opindex fmudflapir
5911 @cindex bounds checking
5912 @cindex mudflap
5913 For front-ends that support it (C and C++), instrument all risky
5914 pointer/array dereferencing operations, some standard library
5915 string/heap functions, and some other associated constructs with
5916 range/validity tests.  Modules so instrumented should be immune to
5917 buffer overflows, invalid heap use, and some other classes of C/C++
5918 programming errors.  The instrumentation relies on a separate runtime
5919 library (@file{libmudflap}), which will be linked into a program if
5920 @option{-fmudflap} is given at link time.  Run-time behavior of the
5921 instrumented program is controlled by the @env{MUDFLAP_OPTIONS}
5922 environment variable.  See @code{env MUDFLAP_OPTIONS=-help a.out}
5923 for its options.
5924
5925 Use @option{-fmudflapth} instead of @option{-fmudflap} to compile and to
5926 link if your program is multi-threaded.  Use @option{-fmudflapir}, in
5927 addition to @option{-fmudflap} or @option{-fmudflapth}, if
5928 instrumentation should ignore pointer reads.  This produces less
5929 instrumentation (and therefore faster execution) and still provides
5930 some protection against outright memory corrupting writes, but allows
5931 erroneously read data to propagate within a program.
5932
5933 @item -fthread-jumps
5934 @opindex fthread-jumps
5935 Perform optimizations where we check to see if a jump branches to a
5936 location where another comparison subsumed by the first is found.  If
5937 so, the first branch is redirected to either the destination of the
5938 second branch or a point immediately following it, depending on whether
5939 the condition is known to be true or false.
5940
5941 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5942
5943 @item -fsplit-wide-types
5944 @opindex fsplit-wide-types
5945 When using a type that occupies multiple registers, such as @code{long
5946 long} on a 32-bit system, split the registers apart and allocate them
5947 independently.  This normally generates better code for those types,
5948 but may make debugging more difficult.
5949
5950 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
5951 @option{-Os}.
5952
5953 @item -fcse-follow-jumps
5954 @opindex fcse-follow-jumps
5955 In common subexpression elimination (CSE), scan through jump instructions
5956 when the target of the jump is not reached by any other path.  For
5957 example, when CSE encounters an @code{if} statement with an
5958 @code{else} clause, CSE will follow the jump when the condition
5959 tested is false.
5960
5961 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5962
5963 @item -fcse-skip-blocks
5964 @opindex fcse-skip-blocks
5965 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
5966 follow jumps which conditionally skip over blocks.  When CSE
5967 encounters a simple @code{if} statement with no else clause,
5968 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
5969 body of the @code{if}.
5970
5971 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5972
5973 @item -frerun-cse-after-loop
5974 @opindex frerun-cse-after-loop
5975 Re-run common subexpression elimination after loop optimizations has been
5976 performed.
5977
5978 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5979
5980 @item -fgcse
5981 @opindex fgcse
5982 Perform a global common subexpression elimination pass.
5983 This pass also performs global constant and copy propagation.
5984
5985 @emph{Note:} When compiling a program using computed gotos, a GCC
5986 extension, you may get better runtime performance if you disable
5987 the global common subexpression elimination pass by adding
5988 @option{-fno-gcse} to the command line.
5989
5990 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
5991
5992 @item -fgcse-lm
5993 @opindex fgcse-lm
5994 When @option{-fgcse-lm} is enabled, global common subexpression elimination will
5995 attempt to move loads which are only killed by stores into themselves.  This
5996 allows a loop containing a load/store sequence to be changed to a load outside
5997 the loop, and a copy/store within the loop.
5998
5999 Enabled by default when gcse is enabled.
6000
6001 @item -fgcse-sm
6002 @opindex fgcse-sm
6003 When @option{-fgcse-sm} is enabled, a store motion pass is run after
6004 global common subexpression elimination.  This pass will attempt to move
6005 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
6006 loops containing a load/store sequence can be changed to a load before
6007 the loop and a store after the loop.
6008
6009 Not enabled at any optimization level.
6010
6011 @item -fgcse-las
6012 @opindex fgcse-las
6013 When @option{-fgcse-las} is enabled, the global common subexpression
6014 elimination pass eliminates redundant loads that come after stores to the
6015 same memory location (both partial and full redundancies).
6016
6017 Not enabled at any optimization level.
6018
6019 @item -fgcse-after-reload
6020 @opindex fgcse-after-reload
6021 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
6022 pass is performed after reload.  The purpose of this pass is to cleanup
6023 redundant spilling.
6024
6025 @item -funsafe-loop-optimizations
6026 @opindex funsafe-loop-optimizations
6027 If given, the loop optimizer will assume that loop indices do not
6028 overflow, and that the loops with nontrivial exit condition are not
6029 infinite.  This enables a wider range of loop optimizations even if
6030 the loop optimizer itself cannot prove that these assumptions are valid.
6031 Using @option{-Wunsafe-loop-optimizations}, the compiler will warn you
6032 if it finds this kind of loop.
6033
6034 @item -fcrossjumping
6035 @opindex fcrossjumping
6036 Perform cross-jumping transformation.  This transformation unifies equivalent code and save code size.  The
6037 resulting code may or may not perform better than without cross-jumping.
6038
6039 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6040
6041 @item -fauto-inc-dec
6042 @opindex fauto-inc-dec
6043 Combine increments or decrements of addresses with memory accesses.
6044 This pass is always skipped on architectures that do not have
6045 instructions to support this.  Enabled by default at @option{-O} and
6046 higher on architectures that support this.
6047
6048 @item -fdce
6049 @opindex fdce
6050 Perform dead code elimination (DCE) on RTL@.
6051 Enabled by default at @option{-O} and higher.
6052
6053 @item -fdse
6054 @opindex fdse
6055 Perform dead store elimination (DSE) on RTL@.
6056 Enabled by default at @option{-O} and higher.
6057
6058 @item -fif-conversion
6059 @opindex fif-conversion
6060 Attempt to transform conditional jumps into branch-less equivalents.  This
6061 include use of conditional moves, min, max, set flags and abs instructions, and
6062 some tricks doable by standard arithmetics.  The use of conditional execution
6063 on chips where it is available is controlled by @code{if-conversion2}.
6064
6065 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6066
6067 @item -fif-conversion2
6068 @opindex fif-conversion2
6069 Use conditional execution (where available) to transform conditional jumps into
6070 branch-less equivalents.
6071
6072 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6073
6074 @item -fdelete-null-pointer-checks
6075 @opindex fdelete-null-pointer-checks
6076 Assume that programs cannot safely dereference null pointers, and that
6077 no code or data element resides there.  This enables simple constant
6078 folding optimizations at all optimization levels.  In addition, other
6079 optimization passes in GCC use this flag to control global dataflow
6080 analyses that eliminate useless checks for null pointers; these assume
6081 that if a pointer is checked after it has already been dereferenced,
6082 it cannot be null.
6083
6084 Note however that in some environments this assumption is not true.
6085 Use @option{-fno-delete-null-pointer-checks} to disable this optimization
6086 for programs which depend on that behavior.
6087
6088 Some targets, especially embedded ones, disable this option at all levels.
6089 Otherwise it is enabled at all levels: @option{-O0}, @option{-O1},
6090 @option{-O2}, @option{-O3}, @option{-Os}.  Passes that use the information
6091 are enabled independently at different optimization levels.
6092
6093 @item -fexpensive-optimizations
6094 @opindex fexpensive-optimizations
6095 Perform a number of minor optimizations that are relatively expensive.
6096
6097 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6098
6099 @item -foptimize-register-move
6100 @itemx -fregmove
6101 @opindex foptimize-register-move
6102 @opindex fregmove
6103 Attempt to reassign register numbers in move instructions and as
6104 operands of other simple instructions in order to maximize the amount of
6105 register tying.  This is especially helpful on machines with two-operand
6106 instructions.
6107
6108 Note @option{-fregmove} and @option{-foptimize-register-move} are the same
6109 optimization.
6110
6111 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6112
6113 @item -fira-algorithm=@var{algorithm}
6114 Use specified coloring algorithm for the integrated register
6115 allocator.  The @var{algorithm} argument should be @code{priority} or
6116 @code{CB}.  The first algorithm specifies Chow's priority coloring,
6117 the second one specifies Chaitin-Briggs coloring.  The second
6118 algorithm can be unimplemented for some architectures.  If it is
6119 implemented, it is the default because Chaitin-Briggs coloring as a
6120 rule generates a better code.
6121
6122 @item -fira-region=@var{region}
6123 Use specified regions for the integrated register allocator.  The
6124 @var{region} argument should be one of @code{all}, @code{mixed}, or
6125 @code{one}.  The first value means using all loops as register
6126 allocation regions, the second value which is the default means using
6127 all loops except for loops with small register pressure as the
6128 regions, and third one means using all function as a single region.
6129 The first value can give best result for machines with small size and
6130 irregular register set, the third one results in faster and generates
6131 decent code and the smallest size code, and the default value usually
6132 give the best results in most cases and for most architectures.
6133
6134 @item -fira-coalesce
6135 @opindex fira-coalesce
6136 Do optimistic register coalescing.  This option might be profitable for
6137 architectures with big regular register files.
6138
6139 @item -fno-ira-share-save-slots
6140 @opindex fno-ira-share-save-slots
6141 Switch off sharing stack slots used for saving call used hard
6142 registers living through a call.  Each hard register will get a
6143 separate stack slot and as a result function stack frame will be
6144 bigger.
6145
6146 @item -fno-ira-share-spill-slots
6147 @opindex fno-ira-share-spill-slots
6148 Switch off sharing stack slots allocated for pseudo-registers.  Each
6149 pseudo-register which did not get a hard register will get a separate
6150 stack slot and as a result function stack frame will be bigger.
6151
6152 @item -fira-verbose=@var{n}
6153 @opindex fira-verbose
6154 Set up how verbose dump file for the integrated register allocator
6155 will be.  Default value is 5.  If the value is greater or equal to 10,
6156 the dump file will be stderr as if the value were @var{n} minus 10.
6157
6158 @item -fdelayed-branch
6159 @opindex fdelayed-branch
6160 If supported for the target machine, attempt to reorder instructions
6161 to exploit instruction slots available after delayed branch
6162 instructions.
6163
6164 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6165
6166 @item -fschedule-insns
6167 @opindex fschedule-insns
6168 If supported for the target machine, attempt to reorder instructions to
6169 eliminate execution stalls due to required data being unavailable.  This
6170 helps machines that have slow floating point or memory load instructions
6171 by allowing other instructions to be issued until the result of the load
6172 or floating point instruction is required.
6173
6174 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6175
6176 @item -fschedule-insns2
6177 @opindex fschedule-insns2
6178 Similar to @option{-fschedule-insns}, but requests an additional pass of
6179 instruction scheduling after register allocation has been done.  This is
6180 especially useful on machines with a relatively small number of
6181 registers and where memory load instructions take more than one cycle.
6182
6183 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6184
6185 @item -fno-sched-interblock
6186 @opindex fno-sched-interblock
6187 Don't schedule instructions across basic blocks.  This is normally
6188 enabled by default when scheduling before register allocation, i.e.@:
6189 with @option{-fschedule-insns} or at @option{-O2} or higher.
6190
6191 @item -fno-sched-spec
6192 @opindex fno-sched-spec
6193 Don't allow speculative motion of non-load instructions.  This is normally
6194 enabled by default when scheduling before register allocation, i.e.@:
6195 with @option{-fschedule-insns} or at @option{-O2} or higher.
6196
6197 @item -fsched-spec-load
6198 @opindex fsched-spec-load
6199 Allow speculative motion of some load instructions.  This only makes
6200 sense when scheduling before register allocation, i.e.@: with
6201 @option{-fschedule-insns} or at @option{-O2} or higher.
6202
6203 @item -fsched-spec-load-dangerous
6204 @opindex fsched-spec-load-dangerous
6205 Allow speculative motion of more load instructions.  This only makes
6206 sense when scheduling before register allocation, i.e.@: with
6207 @option{-fschedule-insns} or at @option{-O2} or higher.
6208
6209 @item -fsched-stalled-insns
6210 @itemx -fsched-stalled-insns=@var{n}
6211 @opindex fsched-stalled-insns
6212 Define how many insns (if any) can be moved prematurely from the queue
6213 of stalled insns into the ready list, during the second scheduling pass.
6214 @option{-fno-sched-stalled-insns} means that no insns will be moved
6215 prematurely, @option{-fsched-stalled-insns=0} means there is no limit
6216 on how many queued insns can be moved prematurely.
6217 @option{-fsched-stalled-insns} without a value is equivalent to
6218 @option{-fsched-stalled-insns=1}.
6219
6220 @item -fsched-stalled-insns-dep
6221 @itemx -fsched-stalled-insns-dep=@var{n}
6222 @opindex fsched-stalled-insns-dep
6223 Define how many insn groups (cycles) will be examined for a dependency
6224 on a stalled insn that is candidate for premature removal from the queue
6225 of stalled insns.  This has an effect only during the second scheduling pass,
6226 and only if @option{-fsched-stalled-insns} is used.
6227 @option{-fno-sched-stalled-insns-dep} is equivalent to
6228 @option{-fsched-stalled-insns-dep=0}.
6229 @option{-fsched-stalled-insns-dep} without a value is equivalent to
6230 @option{-fsched-stalled-insns-dep=1}.
6231
6232 @item -fsched2-use-superblocks
6233 @opindex fsched2-use-superblocks
6234 When scheduling after register allocation, do use superblock scheduling
6235 algorithm.  Superblock scheduling allows motion across basic block boundaries
6236 resulting on faster schedules.  This option is experimental, as not all machine
6237 descriptions used by GCC model the CPU closely enough to avoid unreliable
6238 results from the algorithm.
6239
6240 This only makes sense when scheduling after register allocation, i.e.@: with
6241 @option{-fschedule-insns2} or at @option{-O2} or higher.
6242
6243 @item -fsched-group-heuristic
6244 @opindex fsched-group-heuristic
6245 Enable the group heuristic in the scheduler.  This heuristic favors 
6246 the instruction that belongs to a schedule group.  This is enabled 
6247 by default when scheduling is enabled, i.e.@: with @option{-fschedule-insns} 
6248 or @option{-fschedule-insns2} or at @option{-O2} or higher.
6249
6250 @item -fsched-critical-path-heuristic
6251 @opindex fsched-critical-path-heuristic
6252 Enable the critical-path heuristic in the scheduler.  This heuristic favors 
6253 instructions on the critical path.  This is enabled by default when 
6254 scheduling is enabled, i.e.@: with @option{-fschedule-insns} 
6255 or @option{-fschedule-insns2} or at @option{-O2} or higher.
6256
6257 @item -fsched-spec-insn-heuristic
6258 @opindex fsched-spec-insn-heuristic
6259 Enable the speculative instruction heuristic in the scheduler.  This 
6260 heuristic favors speculative instructions with greater dependency weakness.  
6261 This is enabled by default when scheduling is enabled, i.e.@: 
6262 with @option{-fschedule-insns} or @option{-fschedule-insns2} 
6263 or at @option{-O2} or higher.
6264
6265 @item -fsched-reg-pressure-heuristic
6266 @opindex fsched-reg-pressure-heuristic
6267 Enable the register pressure heuristic in the scheduler.  This heuristic
6268 favors the instruction with smaller contribution to register pressure.  
6269 This only makes sense when scheduling before register allocation, i.e.@: 
6270 with @option{-fschedule-insns} or at @option{-O2} or higher.
6271
6272 @item -fsched-rank-heuristic
6273 @opindex fsched-rank-heuristic
6274 Enable the rank heuristic in the scheduler.  This heuristic favors 
6275 the instruction belonging to a basic block with greater size or frequency.  
6276 This is enabled by default when scheduling is enabled, i.e.@: 
6277 with @option{-fschedule-insns} or @option{-fschedule-insns2} or 
6278 at @option{-O2} or higher.
6279
6280 @item -fsched-last-insn-heuristic
6281 @opindex fsched-last-insn-heuristic
6282 Enable the last-instruction heuristic in the scheduler.  This heuristic 
6283 favors the instruction that is less dependent on the last instruction
6284 scheduled.  This is enabled by default when scheduling is enabled, 
6285 i.e.@: with @option{-fschedule-insns} or @option{-fschedule-insns2} or 
6286 at @option{-O2} or higher.
6287
6288 @item -fsched-dep-count-heuristic
6289 @opindex fsched-dep-count-heuristic
6290 Enable the dependent-count heuristic in the scheduler.  This heuristic 
6291 favors the instruction that has more instructions depending on it.  
6292 This is enabled by default when scheduling is enabled, i.e.@: 
6293 with @option{-fschedule-insns} or @option{-fschedule-insns2} or 
6294 at @option{-O2} or higher.
6295
6296 @item -fsched2-use-traces
6297 @opindex fsched2-use-traces
6298 Use @option{-fsched2-use-superblocks} algorithm when scheduling after register
6299 allocation and additionally perform code duplication in order to increase the
6300 size of superblocks using tracer pass.  See @option{-ftracer} for details on
6301 trace formation.
6302
6303 This mode should produce faster but significantly longer programs.  Also
6304 without @option{-fbranch-probabilities} the traces constructed may not
6305 match the reality and hurt the performance.  This only makes
6306 sense when scheduling after register allocation, i.e.@: with
6307 @option{-fschedule-insns2} or at @option{-O2} or higher.
6308
6309 @item -freschedule-modulo-scheduled-loops
6310 @opindex freschedule-modulo-scheduled-loops
6311 The modulo scheduling comes before the traditional scheduling, if a loop
6312 was modulo scheduled we may want to prevent the later scheduling passes
6313 from changing its schedule, we use this option to control that.
6314
6315 @item -fselective-scheduling
6316 @opindex fselective-scheduling
6317 Schedule instructions using selective scheduling algorithm.  Selective
6318 scheduling runs instead of the first scheduler pass.
6319
6320 @item -fselective-scheduling2
6321 @opindex fselective-scheduling2
6322 Schedule instructions using selective scheduling algorithm.  Selective
6323 scheduling runs instead of the second scheduler pass.
6324
6325 @item -fsel-sched-pipelining
6326 @opindex fsel-sched-pipelining
6327 Enable software pipelining of innermost loops during selective scheduling.
6328 This option has no effect until one of @option{-fselective-scheduling} or
6329 @option{-fselective-scheduling2} is turned on.
6330
6331 @item -fsel-sched-pipelining-outer-loops
6332 @opindex fsel-sched-pipelining-outer-loops
6333 When pipelining loops during selective scheduling, also pipeline outer loops.
6334 This option has no effect until @option{-fsel-sched-pipelining} is turned on.
6335
6336 @item -fcaller-saves
6337 @opindex fcaller-saves
6338 Enable values to be allocated in registers that will be clobbered by
6339 function calls, by emitting extra instructions to save and restore the
6340 registers around such calls.  Such allocation is done only when it
6341 seems to result in better code than would otherwise be produced.
6342
6343 This option is always enabled by default on certain machines, usually
6344 those which have no call-preserved registers to use instead.
6345
6346 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6347
6348 @item -fconserve-stack
6349 @opindex fconserve-stack
6350 Attempt to minimize stack usage.  The compiler will attempt to use less
6351 stack space, even if that makes the program slower.  This option
6352 implies setting the @option{large-stack-frame} parameter to 100
6353 and the @option{large-stack-frame-growth} parameter to 400.
6354
6355 @item -ftree-reassoc
6356 @opindex ftree-reassoc
6357 Perform reassociation on trees.  This flag is enabled by default
6358 at @option{-O} and higher.
6359
6360 @item -ftree-pre
6361 @opindex ftree-pre
6362 Perform partial redundancy elimination (PRE) on trees.  This flag is
6363 enabled by default at @option{-O2} and @option{-O3}.
6364
6365 @item -ftree-forwprop
6366 @opindex ftree-forwprop
6367 Perform forward propagation on trees.  This flag is enabled by default
6368 at @option{-O} and higher.
6369
6370 @item -ftree-fre
6371 @opindex ftree-fre
6372 Perform full redundancy elimination (FRE) on trees.  The difference
6373 between FRE and PRE is that FRE only considers expressions
6374 that are computed on all paths leading to the redundant computation.
6375 This analysis is faster than PRE, though it exposes fewer redundancies.
6376 This flag is enabled by default at @option{-O} and higher.
6377
6378 @item -ftree-phiprop
6379 @opindex ftree-phiprop
6380 Perform hoisting of loads from conditional pointers on trees.  This
6381 pass is enabled by default at @option{-O} and higher.
6382
6383 @item -ftree-copy-prop
6384 @opindex ftree-copy-prop
6385 Perform copy propagation on trees.  This pass eliminates unnecessary
6386 copy operations.  This flag is enabled by default at @option{-O} and
6387 higher.
6388
6389 @item -fipa-pure-const
6390 @opindex fipa-pure-const
6391 Discover which functions are pure or constant.
6392 Enabled by default at @option{-O} and higher.
6393
6394 @item -fipa-reference
6395 @opindex fipa-reference
6396 Discover which static variables do not escape cannot escape the
6397 compilation unit.
6398 Enabled by default at @option{-O} and higher.
6399
6400 @item -fipa-struct-reorg
6401 @opindex fipa-struct-reorg
6402 Perform structure reorganization optimization, that change C-like structures
6403 layout in order to better utilize spatial locality.  This transformation is
6404 affective for programs containing arrays of structures.  Available in two
6405 compilation modes: profile-based (enabled with @option{-fprofile-generate})
6406 or static (which uses built-in heuristics).  Require @option{-fipa-type-escape}
6407 to provide the safety of this transformation.  It works only in whole program
6408 mode, so it requires @option{-fwhole-program} and @option{-combine} to be
6409 enabled.  Structures considered @samp{cold} by this transformation are not
6410 affected (see @option{--param struct-reorg-cold-struct-ratio=@var{value}}).
6411
6412 With this flag, the program debug info reflects a new structure layout.
6413
6414 @item -fipa-pta
6415 @opindex fipa-pta
6416 Perform interprocedural pointer analysis.  This option is experimental
6417 and does not affect generated code.
6418
6419 @item -fipa-cp
6420 @opindex fipa-cp
6421 Perform interprocedural constant propagation.
6422 This optimization analyzes the program to determine when values passed
6423 to functions are constants and then optimizes accordingly.
6424 This optimization can substantially increase performance
6425 if the application has constants passed to functions.
6426 This flag is enabled by default at @option{-O2}, @option{-Os} and @option{-O3}.
6427
6428 @item -fipa-cp-clone
6429 @opindex fipa-cp-clone
6430 Perform function cloning to make interprocedural constant propagation stronger.
6431 When enabled, interprocedural constant propagation will perform function cloning
6432 when externally visible function can be called with constant arguments.
6433 Because this optimization can create multiple copies of functions,
6434 it may significantly increase code size
6435 (see @option{--param ipcp-unit-growth=@var{value}}).
6436 This flag is enabled by default at @option{-O3}.
6437
6438 @item -fipa-matrix-reorg
6439 @opindex fipa-matrix-reorg
6440 Perform matrix flattening and transposing.
6441 Matrix flattening tries to replace an @math{m}-dimensional matrix
6442 with its equivalent @math{n}-dimensional matrix, where @math{n < m}.
6443 This reduces the level of indirection needed for accessing the elements
6444 of the matrix. The second optimization is matrix transposing that
6445 attempts to change the order of the matrix's dimensions in order to
6446 improve cache locality.
6447 Both optimizations need the @option{-fwhole-program} flag.
6448 Transposing is enabled only if profiling information is available.
6449
6450 @item -ftree-sink
6451 @opindex ftree-sink
6452 Perform forward store motion  on trees.  This flag is
6453 enabled by default at @option{-O} and higher.
6454
6455 @item -ftree-ccp
6456 @opindex ftree-ccp
6457 Perform sparse conditional constant propagation (CCP) on trees.  This
6458 pass only operates on local scalar variables and is enabled by default
6459 at @option{-O} and higher.
6460
6461 @item -ftree-switch-conversion
6462 Perform conversion of simple initializations in a switch to
6463 initializations from a scalar array.  This flag is enabled by default
6464 at @option{-O2} and higher.
6465
6466 @item -ftree-dce
6467 @opindex ftree-dce
6468 Perform dead code elimination (DCE) on trees.  This flag is enabled by
6469 default at @option{-O} and higher.
6470
6471 @item -ftree-builtin-call-dce
6472 @opindex ftree-builtin-call-dce
6473 Perform conditional dead code elimination (DCE) for calls to builtin functions
6474 that may set @code{errno} but are otherwise side-effect free.  This flag is
6475 enabled by default at @option{-O2} and higher if @option{-Os} is not also
6476 specified.
6477
6478 @item -ftree-dominator-opts
6479 @opindex ftree-dominator-opts
6480 Perform a variety of simple scalar cleanups (constant/copy
6481 propagation, redundancy elimination, range propagation and expression
6482 simplification) based on a dominator tree traversal.  This also
6483 performs jump threading (to reduce jumps to jumps). This flag is
6484 enabled by default at @option{-O} and higher.
6485
6486 @item -ftree-dse
6487 @opindex ftree-dse
6488 Perform dead store elimination (DSE) on trees.  A dead store is a store into
6489 a memory location which will later be overwritten by another store without
6490 any intervening loads.  In this case the earlier store can be deleted.  This
6491 flag is enabled by default at @option{-O} and higher.
6492
6493 @item -ftree-ch
6494 @opindex ftree-ch
6495 Perform loop header copying on trees.  This is beneficial since it increases
6496 effectiveness of code motion optimizations.  It also saves one jump.  This flag
6497 is enabled by default at @option{-O} and higher.  It is not enabled
6498 for @option{-Os}, since it usually increases code size.
6499
6500 @item -ftree-loop-optimize
6501 @opindex ftree-loop-optimize
6502 Perform loop optimizations on trees.  This flag is enabled by default
6503 at @option{-O} and higher.
6504
6505 @item -ftree-loop-linear
6506 @opindex ftree-loop-linear
6507 Perform linear loop transformations on tree.  This flag can improve cache
6508 performance and allow further loop optimizations to take place.
6509
6510 @item -floop-interchange
6511 Perform loop interchange transformations on loops.  Interchanging two
6512 nested loops switches the inner and outer loops.  For example, given a
6513 loop like:
6514 @smallexample
6515 DO J = 1, M
6516   DO I = 1, N
6517     A(J, I) = A(J, I) * C
6518   ENDDO
6519 ENDDO
6520 @end smallexample
6521 loop interchange will transform the loop as if the user had written:
6522 @smallexample
6523 DO I = 1, N
6524   DO J = 1, M
6525     A(J, I) = A(J, I) * C
6526   ENDDO
6527 ENDDO
6528 @end smallexample
6529 which can be beneficial when @code{N} is larger than the caches,
6530 because in Fortran, the elements of an array are stored in memory
6531 contiguously by column, and the original loop iterates over rows,
6532 potentially creating at each access a cache miss.  This optimization
6533 applies to all the languages supported by GCC and is not limited to
6534 Fortran.  To use this code transformation, GCC has to be configured
6535 with @option{--with-ppl} and @option{--with-cloog} to enable the
6536 Graphite loop transformation infrastructure.
6537
6538 @item -floop-strip-mine
6539 Perform loop strip mining transformations on loops.  Strip mining
6540 splits a loop into two nested loops.  The outer loop has strides
6541 equal to the strip size and the inner loop has strides of the
6542 original loop within a strip.  For example, given a loop like:
6543 @smallexample
6544 DO I = 1, N
6545   A(I) = A(I) + C
6546 ENDDO
6547 @end smallexample
6548 loop strip mining will transform the loop as if the user had written:
6549 @smallexample
6550 DO II = 1, N, 4
6551   DO I = II, min (II + 3, N)
6552     A(I) = A(I) + C
6553   ENDDO
6554 ENDDO
6555 @end smallexample
6556 This optimization applies to all the languages supported by GCC and is
6557 not limited to Fortran.  To use this code transformation, GCC has to
6558 be configured with @option{--with-ppl} and @option{--with-cloog} to
6559 enable the Graphite loop transformation infrastructure.
6560
6561 @item -floop-block
6562 Perform loop blocking transformations on loops.  Blocking strip mines
6563 each loop in the loop nest such that the memory accesses of the
6564 element loops fit inside caches.  For example, given a loop like:
6565 @smallexample
6566 DO I = 1, N
6567   DO J = 1, M
6568     A(J, I) = B(I) + C(J)
6569   ENDDO
6570 ENDDO
6571 @end smallexample
6572 loop blocking will transform the loop as if the user had written:
6573 @smallexample
6574 DO II = 1, N, 64
6575   DO JJ = 1, M, 64
6576     DO I = II, min (II + 63, N)
6577       DO J = JJ, min (JJ + 63, M)
6578         A(J, I) = B(I) + C(J)
6579       ENDDO
6580     ENDDO
6581   ENDDO
6582 ENDDO
6583 @end smallexample
6584 which can be beneficial when @code{M} is larger than the caches,
6585 because the innermost loop will iterate over a smaller amount of data
6586 that can be kept in the caches.  This optimization applies to all the
6587 languages supported by GCC and is not limited to Fortran.  To use this
6588 code transformation, GCC has to be configured with @option{--with-ppl}
6589 and @option{--with-cloog} to enable the Graphite loop transformation
6590 infrastructure.
6591
6592 @item -fcheck-data-deps
6593 @opindex fcheck-data-deps
6594 Compare the results of several data dependence analyzers.  This option
6595 is used for debugging the data dependence analyzers.
6596
6597 @item -ftree-loop-distribution
6598 Perform loop distribution.  This flag can improve cache performance on
6599 big loop bodies and allow further loop optimizations, like
6600 parallelization or vectorization, to take place.  For example, the loop
6601 @smallexample
6602 DO I = 1, N
6603   A(I) = B(I) + C
6604   D(I) = E(I) * F
6605 ENDDO
6606 @end smallexample
6607 is transformed to
6608 @smallexample
6609 DO I = 1, N
6610    A(I) = B(I) + C
6611 ENDDO
6612 DO I = 1, N
6613    D(I) = E(I) * F
6614 ENDDO
6615 @end smallexample
6616
6617 @item -ftree-loop-im
6618 @opindex ftree-loop-im
6619 Perform loop invariant motion on trees.  This pass moves only invariants that
6620 would be hard to handle at RTL level (function calls, operations that expand to
6621 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
6622 operands of conditions that are invariant out of the loop, so that we can use
6623 just trivial invariantness analysis in loop unswitching.  The pass also includes
6624 store motion.
6625
6626 @item -ftree-loop-ivcanon
6627 @opindex ftree-loop-ivcanon
6628 Create a canonical counter for number of iterations in the loop for that
6629 determining number of iterations requires complicated analysis.  Later
6630 optimizations then may determine the number easily.  Useful especially
6631 in connection with unrolling.
6632
6633 @item -fivopts
6634 @opindex fivopts
6635 Perform induction variable optimizations (strength reduction, induction
6636 variable merging and induction variable elimination) on trees.
6637
6638 @item -ftree-parallelize-loops=n
6639 @opindex ftree-parallelize-loops
6640 Parallelize loops, i.e., split their iteration space to run in n threads.
6641 This is only possible for loops whose iterations are independent
6642 and can be arbitrarily reordered.  The optimization is only
6643 profitable on multiprocessor machines, for loops that are CPU-intensive,
6644 rather than constrained e.g.@: by memory bandwidth.  This option
6645 implies @option{-pthread}, and thus is only supported on targets
6646 that have support for @option{-pthread}.
6647
6648 @item -ftree-pta
6649 @opindex ftree-pta
6650 Perform function-local points-to analysis on trees.  This flag is
6651 enabled by default at @option{-O} and higher.
6652
6653 @item -ftree-sra
6654 @opindex ftree-sra
6655 Perform scalar replacement of aggregates.  This pass replaces structure
6656 references with scalars to prevent committing structures to memory too
6657 early.  This flag is enabled by default at @option{-O} and higher.
6658
6659 @item -ftree-copyrename
6660 @opindex ftree-copyrename
6661 Perform copy renaming on trees.  This pass attempts to rename compiler
6662 temporaries to other variables at copy locations, usually resulting in
6663 variable names which more closely resemble the original variables.  This flag
6664 is enabled by default at @option{-O} and higher.
6665
6666 @item -ftree-ter
6667 @opindex ftree-ter
6668 Perform temporary expression replacement during the SSA->normal phase.  Single
6669 use/single def temporaries are replaced at their use location with their
6670 defining expression.  This results in non-GIMPLE code, but gives the expanders
6671 much more complex trees to work on resulting in better RTL generation.  This is
6672 enabled by default at @option{-O} and higher.
6673
6674 @item -ftree-vectorize
6675 @opindex ftree-vectorize
6676 Perform loop vectorization on trees. This flag is enabled by default at
6677 @option{-O3}.
6678
6679 @item -ftree-vect-loop-version
6680 @opindex ftree-vect-loop-version
6681 Perform loop versioning when doing loop vectorization on trees.  When a loop
6682 appears to be vectorizable except that data alignment or data dependence cannot
6683 be determined at compile time then vectorized and non-vectorized versions of
6684 the loop are generated along with runtime checks for alignment or dependence
6685 to control which version is executed.  This option is enabled by default
6686 except at level @option{-Os} where it is disabled.
6687
6688 @item -fvect-cost-model
6689 @opindex fvect-cost-model
6690 Enable cost model for vectorization.
6691
6692 @item -ftree-vrp
6693 @opindex ftree-vrp
6694 Perform Value Range Propagation on trees.  This is similar to the
6695 constant propagation pass, but instead of values, ranges of values are
6696 propagated.  This allows the optimizers to remove unnecessary range
6697 checks like array bound checks and null pointer checks.  This is
6698 enabled by default at @option{-O2} and higher.  Null pointer check
6699 elimination is only done if @option{-fdelete-null-pointer-checks} is
6700 enabled.
6701
6702 @item -ftracer
6703 @opindex ftracer
6704 Perform tail duplication to enlarge superblock size.  This transformation
6705 simplifies the control flow of the function allowing other optimizations to do
6706 better job.
6707
6708 @item -funroll-loops
6709 @opindex funroll-loops
6710 Unroll loops whose number of iterations can be determined at compile
6711 time or upon entry to the loop.  @option{-funroll-loops} implies
6712 @option{-frerun-cse-after-loop}.  This option makes code larger,
6713 and may or may not make it run faster.
6714
6715 @item -funroll-all-loops
6716 @opindex funroll-all-loops
6717 Unroll all loops, even if their number of iterations is uncertain when
6718 the loop is entered.  This usually makes programs run more slowly.
6719 @option{-funroll-all-loops} implies the same options as
6720 @option{-funroll-loops},
6721
6722 @item -fsplit-ivs-in-unroller
6723 @opindex fsplit-ivs-in-unroller
6724 Enables expressing of values of induction variables in later iterations
6725 of the unrolled loop using the value in the first iteration.  This breaks
6726 long dependency chains, thus improving efficiency of the scheduling passes.
6727
6728 Combination of @option{-fweb} and CSE is often sufficient to obtain the
6729 same effect.  However in cases the loop body is more complicated than
6730 a single basic block, this is not reliable.  It also does not work at all
6731 on some of the architectures due to restrictions in the CSE pass.
6732
6733 This optimization is enabled by default.
6734
6735 @item -fvariable-expansion-in-unroller
6736 @opindex fvariable-expansion-in-unroller
6737 With this option, the compiler will create multiple copies of some
6738 local variables when unrolling a loop which can result in superior code.
6739
6740 @item -fpredictive-commoning
6741 @opindex fpredictive-commoning
6742 Perform predictive commoning optimization, i.e., reusing computations
6743 (especially memory loads and stores) performed in previous
6744 iterations of loops.
6745
6746 This option is enabled at level @option{-O3}.
6747
6748 @item -fprefetch-loop-arrays
6749 @opindex fprefetch-loop-arrays
6750 If supported by the target machine, generate instructions to prefetch
6751 memory to improve the performance of loops that access large arrays.
6752
6753 This option may generate better or worse code; results are highly
6754 dependent on the structure of loops within the source code.
6755
6756 Disabled at level @option{-Os}.
6757
6758 @item -fno-peephole
6759 @itemx -fno-peephole2
6760 @opindex fno-peephole
6761 @opindex fno-peephole2
6762 Disable any machine-specific peephole optimizations.  The difference
6763 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
6764 are implemented in the compiler; some targets use one, some use the
6765 other, a few use both.
6766
6767 @option{-fpeephole} is enabled by default.
6768 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6769
6770 @item -fno-guess-branch-probability
6771 @opindex fno-guess-branch-probability
6772 Do not guess branch probabilities using heuristics.
6773
6774 GCC will use heuristics to guess branch probabilities if they are
6775 not provided by profiling feedback (@option{-fprofile-arcs}).  These
6776 heuristics are based on the control flow graph.  If some branch probabilities
6777 are specified by @samp{__builtin_expect}, then the heuristics will be
6778 used to guess branch probabilities for the rest of the control flow graph,
6779 taking the @samp{__builtin_expect} info into account.  The interactions
6780 between the heuristics and @samp{__builtin_expect} can be complex, and in
6781 some cases, it may be useful to disable the heuristics so that the effects
6782 of @samp{__builtin_expect} are easier to understand.
6783
6784 The default is @option{-fguess-branch-probability} at levels
6785 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6786
6787 @item -freorder-blocks
6788 @opindex freorder-blocks
6789 Reorder basic blocks in the compiled function in order to reduce number of
6790 taken branches and improve code locality.
6791
6792 Enabled at levels @option{-O2}, @option{-O3}.
6793
6794 @item -freorder-blocks-and-partition
6795 @opindex freorder-blocks-and-partition
6796 In addition to reordering basic blocks in the compiled function, in order
6797 to reduce number of taken branches, partitions hot and cold basic blocks
6798 into separate sections of the assembly and .o files, to improve
6799 paging and cache locality performance.
6800
6801 This optimization is automatically turned off in the presence of
6802 exception handling, for linkonce sections, for functions with a user-defined
6803 section attribute and on any architecture that does not support named
6804 sections.
6805
6806 @item -freorder-functions
6807 @opindex freorder-functions
6808 Reorder functions in the object file in order to
6809 improve code locality.  This is implemented by using special
6810 subsections @code{.text.hot} for most frequently executed functions and
6811 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
6812 the linker so object file format must support named sections and linker must
6813 place them in a reasonable way.
6814
6815 Also profile feedback must be available in to make this option effective.  See
6816 @option{-fprofile-arcs} for details.
6817
6818 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6819
6820 @item -fstrict-aliasing
6821 @opindex fstrict-aliasing
6822 Allows the compiler to assume the strictest aliasing rules applicable to
6823 the language being compiled.  For C (and C++), this activates
6824 optimizations based on the type of expressions.  In particular, an
6825 object of one type is assumed never to reside at the same address as an
6826 object of a different type, unless the types are almost the same.  For
6827 example, an @code{unsigned int} can alias an @code{int}, but not a
6828 @code{void*} or a @code{double}.  A character type may alias any other
6829 type.
6830
6831 @anchor{Type-punning}Pay special attention to code like this:
6832 @smallexample
6833 union a_union @{
6834   int i;
6835   double d;
6836 @};
6837
6838 int f() @{
6839   a_union t;
6840   t.d = 3.0;
6841   return t.i;
6842 @}
6843 @end smallexample
6844 The practice of reading from a different union member than the one most
6845 recently written to (called ``type-punning'') is common.  Even with
6846 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
6847 is accessed through the union type.  So, the code above will work as
6848 expected.  @xref{Structures unions enumerations and bit-fields
6849 implementation}.  However, this code might not:
6850 @smallexample
6851 int f() @{
6852   a_union t;
6853   int* ip;
6854   t.d = 3.0;
6855   ip = &t.i;
6856   return *ip;
6857 @}
6858 @end smallexample
6859
6860 Similarly, access by taking the address, casting the resulting pointer
6861 and dereferencing the result has undefined behavior, even if the cast
6862 uses a union type, e.g.:
6863 @smallexample
6864 int f() @{
6865   double d = 3.0;
6866   return ((union a_union *) &d)->i;
6867 @}
6868 @end smallexample
6869
6870 The @option{-fstrict-aliasing} option is enabled at levels
6871 @option{-O2}, @option{-O3}, @option{-Os}.
6872
6873 @item -fstrict-overflow
6874 @opindex fstrict-overflow
6875 Allow the compiler to assume strict signed overflow rules, depending
6876 on the language being compiled.  For C (and C++) this means that
6877 overflow when doing arithmetic with signed numbers is undefined, which
6878 means that the compiler may assume that it will not happen.  This
6879 permits various optimizations.  For example, the compiler will assume
6880 that an expression like @code{i + 10 > i} will always be true for
6881 signed @code{i}.  This assumption is only valid if signed overflow is
6882 undefined, as the expression is false if @code{i + 10} overflows when
6883 using twos complement arithmetic.  When this option is in effect any
6884 attempt to determine whether an operation on signed numbers will
6885 overflow must be written carefully to not actually involve overflow.
6886
6887 This option also allows the compiler to assume strict pointer
6888 semantics: given a pointer to an object, if adding an offset to that
6889 pointer does not produce a pointer to the same object, the addition is
6890 undefined.  This permits the compiler to conclude that @code{p + u >
6891 p} is always true for a pointer @code{p} and unsigned integer
6892 @code{u}.  This assumption is only valid because pointer wraparound is
6893 undefined, as the expression is false if @code{p + u} overflows using
6894 twos complement arithmetic.
6895
6896 See also the @option{-fwrapv} option.  Using @option{-fwrapv} means
6897 that integer signed overflow is fully defined: it wraps.  When
6898 @option{-fwrapv} is used, there is no difference between
6899 @option{-fstrict-overflow} and @option{-fno-strict-overflow} for
6900 integers.  With @option{-fwrapv} certain types of overflow are
6901 permitted.  For example, if the compiler gets an overflow when doing
6902 arithmetic on constants, the overflowed value can still be used with
6903 @option{-fwrapv}, but not otherwise.
6904
6905 The @option{-fstrict-overflow} option is enabled at levels
6906 @option{-O2}, @option{-O3}, @option{-Os}.
6907
6908 @item -falign-functions
6909 @itemx -falign-functions=@var{n}
6910 @opindex falign-functions
6911 Align the start of functions to the next power-of-two greater than
6912 @var{n}, skipping up to @var{n} bytes.  For instance,
6913 @option{-falign-functions=32} aligns functions to the next 32-byte
6914 boundary, but @option{-falign-functions=24} would align to the next
6915 32-byte boundary only if this can be done by skipping 23 bytes or less.
6916
6917 @option{-fno-align-functions} and @option{-falign-functions=1} are
6918 equivalent and mean that functions will not be aligned.
6919
6920 Some assemblers only support this flag when @var{n} is a power of two;
6921 in that case, it is rounded up.
6922
6923 If @var{n} is not specified or is zero, use a machine-dependent default.
6924
6925 Enabled at levels @option{-O2}, @option{-O3}.
6926
6927 @item -falign-labels
6928 @itemx -falign-labels=@var{n}
6929 @opindex falign-labels
6930 Align all branch targets to a power-of-two boundary, skipping up to
6931 @var{n} bytes like @option{-falign-functions}.  This option can easily
6932 make code slower, because it must insert dummy operations for when the
6933 branch target is reached in the usual flow of the code.
6934
6935 @option{-fno-align-labels} and @option{-falign-labels=1} are
6936 equivalent and mean that labels will not be aligned.
6937
6938 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
6939 are greater than this value, then their values are used instead.
6940
6941 If @var{n} is not specified or is zero, use a machine-dependent default
6942 which is very likely to be @samp{1}, meaning no alignment.
6943
6944 Enabled at levels @option{-O2}, @option{-O3}.
6945
6946 @item -falign-loops
6947 @itemx -falign-loops=@var{n}
6948 @opindex falign-loops
6949 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
6950 like @option{-falign-functions}.  The hope is that the loop will be
6951 executed many times, which will make up for any execution of the dummy
6952 operations.
6953
6954 @option{-fno-align-loops} and @option{-falign-loops=1} are
6955 equivalent and mean that loops will not be aligned.
6956
6957 If @var{n} is not specified or is zero, use a machine-dependent default.
6958
6959 Enabled at levels @option{-O2}, @option{-O3}.
6960
6961 @item -falign-jumps
6962 @itemx -falign-jumps=@var{n}
6963 @opindex falign-jumps
6964 Align branch targets to a power-of-two boundary, for branch targets
6965 where the targets can only be reached by jumping, skipping up to @var{n}
6966 bytes like @option{-falign-functions}.  In this case, no dummy operations
6967 need be executed.
6968
6969 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
6970 equivalent and mean that loops will not be aligned.
6971
6972 If @var{n} is not specified or is zero, use a machine-dependent default.
6973
6974 Enabled at levels @option{-O2}, @option{-O3}.
6975
6976 @item -funit-at-a-time
6977 @opindex funit-at-a-time
6978 This option is left for compatibility reasons. @option{-funit-at-a-time}
6979 has no effect, while @option{-fno-unit-at-a-time} implies
6980 @option{-fno-toplevel-reorder} and @option{-fno-section-anchors}.
6981
6982 Enabled by default.
6983
6984 @item -fno-toplevel-reorder
6985 @opindex fno-toplevel-reorder
6986 Do not reorder top-level functions, variables, and @code{asm}
6987 statements.  Output them in the same order that they appear in the
6988 input file.  When this option is used, unreferenced static variables
6989 will not be removed.  This option is intended to support existing code
6990 which relies on a particular ordering.  For new code, it is better to
6991 use attributes.
6992
6993 Enabled at level @option{-O0}.  When disabled explicitly, it also imply
6994 @option{-fno-section-anchors} that is otherwise enabled at @option{-O0} on some
6995 targets.
6996
6997 @item -fweb
6998 @opindex fweb
6999 Constructs webs as commonly used for register allocation purposes and assign
7000 each web individual pseudo register.  This allows the register allocation pass
7001 to operate on pseudos directly, but also strengthens several other optimization
7002 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
7003 however, make debugging impossible, since variables will no longer stay in a
7004 ``home register''.
7005
7006 Enabled by default with @option{-funroll-loops}.
7007
7008 @item -fwhole-program
7009 @opindex fwhole-program
7010 Assume that the current compilation unit represents the whole program being
7011 compiled.  All public functions and variables with the exception of @code{main}
7012 and those merged by attribute @code{externally_visible} become static functions
7013 and in effect are optimized more aggressively by interprocedural optimizers.
7014 While this option is equivalent to proper use of the @code{static} keyword for
7015 programs consisting of a single file, in combination with option
7016 @option{--combine} this flag can be used to compile many smaller scale C
7017 programs since the functions and variables become local for the whole combined
7018 compilation unit, not for the single source file itself.
7019
7020 This option implies @option{-fwhole-file} for Fortran programs.
7021
7022 @item -fcprop-registers
7023 @opindex fcprop-registers
7024 After register allocation and post-register allocation instruction splitting,
7025 we perform a copy-propagation pass to try to reduce scheduling dependencies
7026 and occasionally eliminate the copy.
7027
7028 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7029
7030 @item -fprofile-correction
7031 @opindex fprofile-correction
7032 Profiles collected using an instrumented binary for multi-threaded programs may
7033 be inconsistent due to missed counter updates. When this option is specified,
7034 GCC will use heuristics to correct or smooth out such inconsistencies. By
7035 default, GCC will emit an error message when an inconsistent profile is detected.
7036
7037 @item -fprofile-dir=@var{path}
7038 @opindex fprofile-dir
7039
7040 Set the directory to search the profile data files in to @var{path}.
7041 This option affects only the profile data generated by
7042 @option{-fprofile-generate}, @option{-ftest-coverage}, @option{-fprofile-arcs}
7043 and used by @option{-fprofile-use} and @option{-fbranch-probabilities}
7044 and its related options.
7045 By default, GCC will use the current directory as @var{path}
7046 thus the profile data file will appear in the same directory as the object file.
7047
7048 @item -fprofile-generate
7049 @itemx -fprofile-generate=@var{path}
7050 @opindex fprofile-generate
7051
7052 Enable options usually used for instrumenting application to produce
7053 profile useful for later recompilation with profile feedback based
7054 optimization.  You must use @option{-fprofile-generate} both when
7055 compiling and when linking your program.
7056
7057 The following options are enabled: @code{-fprofile-arcs}, @code{-fprofile-values}, @code{-fvpt}.
7058
7059 If @var{path} is specified, GCC will look at the @var{path} to find
7060 the profile feedback data files. See @option{-fprofile-dir}.
7061
7062 @item -fprofile-use
7063 @itemx -fprofile-use=@var{path}
7064 @opindex fprofile-use
7065 Enable profile feedback directed optimizations, and optimizations
7066 generally profitable only with profile feedback available.
7067
7068 The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt},
7069 @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}
7070
7071 By default, GCC emits an error message if the feedback profiles do not
7072 match the source code.  This error can be turned into a warning by using
7073 @option{-Wcoverage-mismatch}.  Note this may result in poorly optimized
7074 code.
7075
7076 If @var{path} is specified, GCC will look at the @var{path} to find
7077 the profile feedback data files. See @option{-fprofile-dir}.
7078 @end table
7079
7080 The following options control compiler behavior regarding floating
7081 point arithmetic.  These options trade off between speed and
7082 correctness.  All must be specifically enabled.
7083
7084 @table @gcctabopt
7085 @item -ffloat-store
7086 @opindex ffloat-store
7087 Do not store floating point variables in registers, and inhibit other
7088 options that might change whether a floating point value is taken from a
7089 register or memory.
7090
7091 @cindex floating point precision
7092 This option prevents undesirable excess precision on machines such as
7093 the 68000 where the floating registers (of the 68881) keep more
7094 precision than a @code{double} is supposed to have.  Similarly for the
7095 x86 architecture.  For most programs, the excess precision does only
7096 good, but a few programs rely on the precise definition of IEEE floating
7097 point.  Use @option{-ffloat-store} for such programs, after modifying
7098 them to store all pertinent intermediate computations into variables.
7099
7100 @item -fexcess-precision=@var{style}
7101 @opindex fexcess-precision
7102 This option allows further control over excess precision on machines
7103 where floating-point registers have more precision than the IEEE
7104 @code{float} and @code{double} types and the processor does not
7105 support operations rounding to those types.  By default,
7106 @option{-fexcess-precision=fast} is in effect; this means that
7107 operations are carried out in the precision of the registers and that
7108 it is unpredictable when rounding to the types specified in the source
7109 code takes place.  When compiling C, if
7110 @option{-fexcess-precision=standard} is specified then excess
7111 precision will follow the rules specified in ISO C99; in particular,
7112 both casts and assignments cause values to be rounded to their
7113 semantic types (whereas @option{-ffloat-store} only affects
7114 assignments).  This option is enabled by default for C if a strict
7115 conformance option such as @option{-std=c99} is used.
7116
7117 @opindex mfpmath
7118 @option{-fexcess-precision=standard} is not implemented for languages
7119 other than C, and has no effect if
7120 @option{-funsafe-math-optimizations} or @option{-ffast-math} is
7121 specified.  On the x86, it also has no effect if @option{-mfpmath=sse}
7122 or @option{-mfpmath=sse+387} is specified; in the former case, IEEE
7123 semantics apply without excess precision, and in the latter, rounding
7124 is unpredictable.
7125
7126 @item -ffast-math
7127 @opindex ffast-math
7128 Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations},
7129 @option{-ffinite-math-only}, @option{-fno-rounding-math},
7130 @option{-fno-signaling-nans} and @option{-fcx-limited-range}.
7131
7132 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
7133
7134 This option is not turned on by any @option{-O} option since
7135 it can result in incorrect output for programs which depend on
7136 an exact implementation of IEEE or ISO rules/specifications for
7137 math functions. It may, however, yield faster code for programs
7138 that do not require the guarantees of these specifications.
7139
7140 @item -fno-math-errno
7141 @opindex fno-math-errno
7142 Do not set ERRNO after calling math functions that are executed
7143 with a single instruction, e.g., sqrt.  A program that relies on
7144 IEEE exceptions for math error handling may want to use this flag
7145 for speed while maintaining IEEE arithmetic compatibility.
7146
7147 This option is not turned on by any @option{-O} option since
7148 it can result in incorrect output for programs which depend on
7149 an exact implementation of IEEE or ISO rules/specifications for
7150 math functions. It may, however, yield faster code for programs
7151 that do not require the guarantees of these specifications.
7152
7153 The default is @option{-fmath-errno}.
7154
7155 On Darwin systems, the math library never sets @code{errno}.  There is
7156 therefore no reason for the compiler to consider the possibility that
7157 it might, and @option{-fno-math-errno} is the default.
7158
7159 @item -funsafe-math-optimizations
7160 @opindex funsafe-math-optimizations
7161
7162 Allow optimizations for floating-point arithmetic that (a) assume
7163 that arguments and results are valid and (b) may violate IEEE or
7164 ANSI standards.  When used at link-time, it may include libraries
7165 or startup files that change the default FPU control word or other
7166 similar optimizations.
7167
7168 This option is not turned on by any @option{-O} option since
7169 it can result in incorrect output for programs which depend on
7170 an exact implementation of IEEE or ISO rules/specifications for
7171 math functions. It may, however, yield faster code for programs
7172 that do not require the guarantees of these specifications.
7173 Enables @option{-fno-signed-zeros}, @option{-fno-trapping-math},
7174 @option{-fassociative-math} and @option{-freciprocal-math}.
7175
7176 The default is @option{-fno-unsafe-math-optimizations}.
7177
7178 @item -fassociative-math
7179 @opindex fassociative-math
7180
7181 Allow re-association of operands in series of floating-point operations.
7182 This violates the ISO C and C++ language standard by possibly changing
7183 computation result.  NOTE: re-ordering may change the sign of zero as
7184 well as ignore NaNs and inhibit or create underflow or overflow (and
7185 thus cannot be used on a code which relies on rounding behavior like
7186 @code{(x + 2**52) - 2**52)}.  May also reorder floating-point comparisons
7187 and thus may not be used when ordered comparisons are required.
7188 This option requires that both @option{-fno-signed-zeros} and
7189 @option{-fno-trapping-math} be in effect.  Moreover, it doesn't make
7190 much sense with @option{-frounding-math}.
7191
7192 The default is @option{-fno-associative-math}.
7193
7194 @item -freciprocal-math
7195 @opindex freciprocal-math
7196
7197 Allow the reciprocal of a value to be used instead of dividing by
7198 the value if this enables optimizations.  For example @code{x / y}
7199 can be replaced with @code{x * (1/y)} which is useful if @code{(1/y)}
7200 is subject to common subexpression elimination.  Note that this loses
7201 precision and increases the number of flops operating on the value.
7202
7203 The default is @option{-fno-reciprocal-math}.
7204
7205 @item -ffinite-math-only
7206 @opindex ffinite-math-only
7207 Allow optimizations for floating-point arithmetic that assume
7208 that arguments and results are not NaNs or +-Infs.
7209
7210 This option is not turned on by any @option{-O} option since
7211 it can result in incorrect output for programs which depend on
7212 an exact implementation of IEEE or ISO rules/specifications for
7213 math functions. It may, however, yield faster code for programs
7214 that do not require the guarantees of these specifications.
7215
7216 The default is @option{-fno-finite-math-only}.
7217
7218 @item -fno-signed-zeros
7219 @opindex fno-signed-zeros
7220 Allow optimizations for floating point arithmetic that ignore the
7221 signedness of zero.  IEEE arithmetic specifies the behavior of
7222 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
7223 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
7224 This option implies that the sign of a zero result isn't significant.
7225
7226 The default is @option{-fsigned-zeros}.
7227
7228 @item -fno-trapping-math
7229 @opindex fno-trapping-math
7230 Compile code assuming that floating-point operations cannot generate
7231 user-visible traps.  These traps include division by zero, overflow,
7232 underflow, inexact result and invalid operation.  This option requires
7233 that @option{-fno-signaling-nans} be in effect.  Setting this option may
7234 allow faster code if one relies on ``non-stop'' IEEE arithmetic, for example.
7235
7236 This option should never be turned on by any @option{-O} option since
7237 it can result in incorrect output for programs which depend on
7238 an exact implementation of IEEE or ISO rules/specifications for
7239 math functions.
7240
7241 The default is @option{-ftrapping-math}.
7242
7243 @item -frounding-math
7244 @opindex frounding-math
7245 Disable transformations and optimizations that assume default floating
7246 point rounding behavior.  This is round-to-zero for all floating point
7247 to integer conversions, and round-to-nearest for all other arithmetic
7248 truncations.  This option should be specified for programs that change
7249 the FP rounding mode dynamically, or that may be executed with a
7250 non-default rounding mode.  This option disables constant folding of
7251 floating point expressions at compile-time (which may be affected by
7252 rounding mode) and arithmetic transformations that are unsafe in the
7253 presence of sign-dependent rounding modes.
7254
7255 The default is @option{-fno-rounding-math}.
7256
7257 This option is experimental and does not currently guarantee to
7258 disable all GCC optimizations that are affected by rounding mode.
7259 Future versions of GCC may provide finer control of this setting
7260 using C99's @code{FENV_ACCESS} pragma.  This command line option
7261 will be used to specify the default state for @code{FENV_ACCESS}.
7262
7263 @item -fsignaling-nans
7264 @opindex fsignaling-nans
7265 Compile code assuming that IEEE signaling NaNs may generate user-visible
7266 traps during floating-point operations.  Setting this option disables
7267 optimizations that may change the number of exceptions visible with
7268 signaling NaNs.  This option implies @option{-ftrapping-math}.
7269
7270 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
7271 be defined.
7272
7273 The default is @option{-fno-signaling-nans}.
7274
7275 This option is experimental and does not currently guarantee to
7276 disable all GCC optimizations that affect signaling NaN behavior.
7277
7278 @item -fsingle-precision-constant
7279 @opindex fsingle-precision-constant
7280 Treat floating point constant as single precision constant instead of
7281 implicitly converting it to double precision constant.
7282
7283 @item -fcx-limited-range
7284 @opindex fcx-limited-range
7285 When enabled, this option states that a range reduction step is not
7286 needed when performing complex division.  Also, there is no checking
7287 whether the result of a complex multiplication or division is @code{NaN
7288 + I*NaN}, with an attempt to rescue the situation in that case.  The
7289 default is @option{-fno-cx-limited-range}, but is enabled by
7290 @option{-ffast-math}.
7291
7292 This option controls the default setting of the ISO C99
7293 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
7294 all languages.
7295
7296 @item -fcx-fortran-rules
7297 @opindex fcx-fortran-rules
7298 Complex multiplication and division follow Fortran rules.  Range
7299 reduction is done as part of complex division, but there is no checking
7300 whether the result of a complex multiplication or division is @code{NaN
7301 + I*NaN}, with an attempt to rescue the situation in that case.
7302
7303 The default is @option{-fno-cx-fortran-rules}.
7304
7305 @end table
7306
7307 The following options control optimizations that may improve
7308 performance, but are not enabled by any @option{-O} options.  This
7309 section includes experimental options that may produce broken code.
7310
7311 @table @gcctabopt
7312 @item -fbranch-probabilities
7313 @opindex fbranch-probabilities
7314 After running a program compiled with @option{-fprofile-arcs}
7315 (@pxref{Debugging Options,, Options for Debugging Your Program or
7316 @command{gcc}}), you can compile it a second time using
7317 @option{-fbranch-probabilities}, to improve optimizations based on
7318 the number of times each branch was taken.  When the program
7319 compiled with @option{-fprofile-arcs} exits it saves arc execution
7320 counts to a file called @file{@var{sourcename}.gcda} for each source
7321 file.  The information in this data file is very dependent on the
7322 structure of the generated code, so you must use the same source code
7323 and the same optimization options for both compilations.
7324
7325 With @option{-fbranch-probabilities}, GCC puts a
7326 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
7327 These can be used to improve optimization.  Currently, they are only
7328 used in one place: in @file{reorg.c}, instead of guessing which path a
7329 branch is mostly to take, the @samp{REG_BR_PROB} values are used to
7330 exactly determine which path is taken more often.
7331
7332 @item -fprofile-values
7333 @opindex fprofile-values
7334 If combined with @option{-fprofile-arcs}, it adds code so that some
7335 data about values of expressions in the program is gathered.
7336
7337 With @option{-fbranch-probabilities}, it reads back the data gathered
7338 from profiling values of expressions and adds @samp{REG_VALUE_PROFILE}
7339 notes to instructions for their later usage in optimizations.
7340
7341 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
7342
7343 @item -fvpt
7344 @opindex fvpt
7345 If combined with @option{-fprofile-arcs}, it instructs the compiler to add
7346 a code to gather information about values of expressions.
7347
7348 With @option{-fbranch-probabilities}, it reads back the data gathered
7349 and actually performs the optimizations based on them.
7350 Currently the optimizations include specialization of division operation
7351 using the knowledge about the value of the denominator.
7352
7353 @item -frename-registers
7354 @opindex frename-registers
7355 Attempt to avoid false dependencies in scheduled code by making use
7356 of registers left over after register allocation.  This optimization
7357 will most benefit processors with lots of registers.  Depending on the
7358 debug information format adopted by the target, however, it can
7359 make debugging impossible, since variables will no longer stay in
7360 a ``home register''.
7361
7362 Enabled by default with @option{-funroll-loops}.
7363
7364 @item -ftracer
7365 @opindex ftracer
7366 Perform tail duplication to enlarge superblock size.  This transformation
7367 simplifies the control flow of the function allowing other optimizations to do
7368 better job.
7369
7370 Enabled with @option{-fprofile-use}.
7371
7372 @item -funroll-loops
7373 @opindex funroll-loops
7374 Unroll loops whose number of iterations can be determined at compile time or
7375 upon entry to the loop.  @option{-funroll-loops} implies
7376 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
7377 It also turns on complete loop peeling (i.e.@: complete removal of loops with
7378 small constant number of iterations).  This option makes code larger, and may
7379 or may not make it run faster.
7380
7381 Enabled with @option{-fprofile-use}.
7382
7383 @item -funroll-all-loops
7384 @opindex funroll-all-loops
7385 Unroll all loops, even if their number of iterations is uncertain when
7386 the loop is entered.  This usually makes programs run more slowly.
7387 @option{-funroll-all-loops} implies the same options as
7388 @option{-funroll-loops}.
7389
7390 @item -fpeel-loops
7391 @opindex fpeel-loops
7392 Peels the loops for that there is enough information that they do not
7393 roll much (from profile feedback).  It also turns on complete loop peeling
7394 (i.e.@: complete removal of loops with small constant number of iterations).
7395
7396 Enabled with @option{-fprofile-use}.
7397
7398 @item -fmove-loop-invariants
7399 @opindex fmove-loop-invariants
7400 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
7401 at level @option{-O1}
7402
7403 @item -funswitch-loops
7404 @opindex funswitch-loops
7405 Move branches with loop invariant conditions out of the loop, with duplicates
7406 of the loop on both branches (modified according to result of the condition).
7407
7408 @item -ffunction-sections
7409 @itemx -fdata-sections
7410 @opindex ffunction-sections
7411 @opindex fdata-sections
7412 Place each function or data item into its own section in the output
7413 file if the target supports arbitrary sections.  The name of the
7414 function or the name of the data item determines the section's name
7415 in the output file.
7416
7417 Use these options on systems where the linker can perform optimizations
7418 to improve locality of reference in the instruction space.  Most systems
7419 using the ELF object format and SPARC processors running Solaris 2 have
7420 linkers with such optimizations.  AIX may have these optimizations in
7421 the future.
7422
7423 Only use these options when there are significant benefits from doing
7424 so.  When you specify these options, the assembler and linker will
7425 create larger object and executable files and will also be slower.
7426 You will not be able to use @code{gprof} on all systems if you
7427 specify this option and you may have problems with debugging if
7428 you specify both this option and @option{-g}.
7429
7430 @item -fbranch-target-load-optimize
7431 @opindex fbranch-target-load-optimize
7432 Perform branch target register load optimization before prologue / epilogue
7433 threading.
7434 The use of target registers can typically be exposed only during reload,
7435 thus hoisting loads out of loops and doing inter-block scheduling needs
7436 a separate optimization pass.
7437
7438 @item -fbranch-target-load-optimize2
7439 @opindex fbranch-target-load-optimize2
7440 Perform branch target register load optimization after prologue / epilogue
7441 threading.
7442
7443 @item -fbtr-bb-exclusive
7444 @opindex fbtr-bb-exclusive
7445 When performing branch target register load optimization, don't reuse
7446 branch target registers in within any basic block.
7447
7448 @item -fstack-protector
7449 @opindex fstack-protector
7450 Emit extra code to check for buffer overflows, such as stack smashing
7451 attacks.  This is done by adding a guard variable to functions with
7452 vulnerable objects.  This includes functions that call alloca, and
7453 functions with buffers larger than 8 bytes.  The guards are initialized
7454 when a function is entered and then checked when the function exits.
7455 If a guard check fails, an error message is printed and the program exits.
7456
7457 @item -fstack-protector-all
7458 @opindex fstack-protector-all
7459 Like @option{-fstack-protector} except that all functions are protected.
7460
7461 @item -fsection-anchors
7462 @opindex fsection-anchors
7463 Try to reduce the number of symbolic address calculations by using
7464 shared ``anchor'' symbols to address nearby objects.  This transformation
7465 can help to reduce the number of GOT entries and GOT accesses on some
7466 targets.
7467
7468 For example, the implementation of the following function @code{foo}:
7469
7470 @smallexample
7471 static int a, b, c;
7472 int foo (void) @{ return a + b + c; @}
7473 @end smallexample
7474
7475 would usually calculate the addresses of all three variables, but if you
7476 compile it with @option{-fsection-anchors}, it will access the variables
7477 from a common anchor point instead.  The effect is similar to the
7478 following pseudocode (which isn't valid C):
7479
7480 @smallexample
7481 int foo (void)
7482 @{
7483   register int *xr = &x;
7484   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
7485 @}
7486 @end smallexample
7487
7488 Not all targets support this option.
7489
7490 @item --param @var{name}=@var{value}
7491 @opindex param
7492 In some places, GCC uses various constants to control the amount of
7493 optimization that is done.  For example, GCC will not inline functions
7494 that contain more that a certain number of instructions.  You can
7495 control some of these constants on the command-line using the
7496 @option{--param} option.
7497
7498 The names of specific parameters, and the meaning of the values, are
7499 tied to the internals of the compiler, and are subject to change
7500 without notice in future releases.
7501
7502 In each case, the @var{value} is an integer.  The allowable choices for
7503 @var{name} are given in the following table:
7504
7505 @table @gcctabopt
7506 @item struct-reorg-cold-struct-ratio
7507 The threshold ratio (as a percentage) between a structure frequency
7508 and the frequency of the hottest structure in the program.  This parameter
7509 is used by struct-reorg optimization enabled by @option{-fipa-struct-reorg}.
7510 We say that if the ratio of a structure frequency, calculated by profiling,
7511 to the hottest structure frequency in the program is less than this
7512 parameter, then structure reorganization is not applied to this structure.
7513 The default is 10.
7514
7515 @item predictable-branch-cost-outcome
7516 When branch is predicted to be taken with probability lower than this threshold
7517 (in percent), then it is considered well predictable. The default is 10.
7518
7519 @item max-crossjump-edges
7520 The maximum number of incoming edges to consider for crossjumping.
7521 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
7522 the number of edges incoming to each block.  Increasing values mean
7523 more aggressive optimization, making the compile time increase with
7524 probably small improvement in executable size.
7525
7526 @item min-crossjump-insns
7527 The minimum number of instructions which must be matched at the end
7528 of two blocks before crossjumping will be performed on them.  This
7529 value is ignored in the case where all instructions in the block being
7530 crossjumped from are matched.  The default value is 5.
7531
7532 @item max-grow-copy-bb-insns
7533 The maximum code size expansion factor when copying basic blocks
7534 instead of jumping.  The expansion is relative to a jump instruction.
7535 The default value is 8.
7536
7537 @item max-goto-duplication-insns
7538 The maximum number of instructions to duplicate to a block that jumps
7539 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
7540 passes, GCC factors computed gotos early in the compilation process,
7541 and unfactors them as late as possible.  Only computed jumps at the
7542 end of a basic blocks with no more than max-goto-duplication-insns are
7543 unfactored.  The default value is 8.
7544
7545 @item max-delay-slot-insn-search
7546 The maximum number of instructions to consider when looking for an
7547 instruction to fill a delay slot.  If more than this arbitrary number of
7548 instructions is searched, the time savings from filling the delay slot
7549 will be minimal so stop searching.  Increasing values mean more
7550 aggressive optimization, making the compile time increase with probably
7551 small improvement in executable run time.
7552
7553 @item max-delay-slot-live-search
7554 When trying to fill delay slots, the maximum number of instructions to
7555 consider when searching for a block with valid live register
7556 information.  Increasing this arbitrarily chosen value means more
7557 aggressive optimization, increasing the compile time.  This parameter
7558 should be removed when the delay slot code is rewritten to maintain the
7559 control-flow graph.
7560
7561 @item max-gcse-memory
7562 The approximate maximum amount of memory that will be allocated in
7563 order to perform the global common subexpression elimination
7564 optimization.  If more memory than specified is required, the
7565 optimization will not be done.
7566
7567 @item max-pending-list-length
7568 The maximum number of pending dependencies scheduling will allow
7569 before flushing the current state and starting over.  Large functions
7570 with few branches or calls can create excessively large lists which
7571 needlessly consume memory and resources.
7572
7573 @item max-inline-insns-single
7574 Several parameters control the tree inliner used in gcc.
7575 This number sets the maximum number of instructions (counted in GCC's
7576 internal representation) in a single function that the tree inliner
7577 will consider for inlining.  This only affects functions declared
7578 inline and methods implemented in a class declaration (C++).
7579 The default value is 300.
7580
7581 @item max-inline-insns-auto
7582 When you use @option{-finline-functions} (included in @option{-O3}),
7583 a lot of functions that would otherwise not be considered for inlining
7584 by the compiler will be investigated.  To those functions, a different
7585 (more restrictive) limit compared to functions declared inline can
7586 be applied.
7587 The default value is 60.
7588
7589 @item large-function-insns
7590 The limit specifying really large functions.  For functions larger than this
7591 limit after inlining, inlining is constrained by
7592 @option{--param large-function-growth}.  This parameter is useful primarily
7593 to avoid extreme compilation time caused by non-linear algorithms used by the
7594 backend.
7595 The default value is 2700.
7596
7597 @item large-function-growth
7598 Specifies maximal growth of large function caused by inlining in percents.
7599 The default value is 100 which limits large function growth to 2.0 times
7600 the original size.
7601
7602 @item large-unit-insns
7603 The limit specifying large translation unit.  Growth caused by inlining of
7604 units larger than this limit is limited by @option{--param inline-unit-growth}.
7605 For small units this might be too tight (consider unit consisting of function A
7606 that is inline and B that just calls A three time.  If B is small relative to
7607 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
7608 large units consisting of small inlineable functions however the overall unit
7609 growth limit is needed to avoid exponential explosion of code size.  Thus for
7610 smaller units, the size is increased to @option{--param large-unit-insns}
7611 before applying @option{--param inline-unit-growth}.  The default is 10000
7612
7613 @item inline-unit-growth
7614 Specifies maximal overall growth of the compilation unit caused by inlining.
7615 The default value is 30 which limits unit growth to 1.3 times the original
7616 size.
7617
7618 @item ipcp-unit-growth
7619 Specifies maximal overall growth of the compilation unit caused by
7620 interprocedural constant propagation.  The default value is 10 which limits
7621 unit growth to 1.1 times the original size.
7622
7623 @item large-stack-frame
7624 The limit specifying large stack frames.  While inlining the algorithm is trying
7625 to not grow past this limit too much.  Default value is 256 bytes.
7626
7627 @item large-stack-frame-growth
7628 Specifies maximal growth of large stack frames caused by inlining in percents.
7629 The default value is 1000 which limits large stack frame growth to 11 times
7630 the original size.
7631
7632 @item max-inline-insns-recursive
7633 @itemx max-inline-insns-recursive-auto
7634 Specifies maximum number of instructions out-of-line copy of self recursive inline
7635 function can grow into by performing recursive inlining.
7636
7637 For functions declared inline @option{--param max-inline-insns-recursive} is
7638 taken into account.  For function not declared inline, recursive inlining
7639 happens only when @option{-finline-functions} (included in @option{-O3}) is
7640 enabled and @option{--param max-inline-insns-recursive-auto} is used.  The
7641 default value is 450.
7642
7643 @item max-inline-recursive-depth
7644 @itemx max-inline-recursive-depth-auto
7645 Specifies maximum recursion depth used by the recursive inlining.
7646
7647 For functions declared inline @option{--param max-inline-recursive-depth} is
7648 taken into account.  For function not declared inline, recursive inlining
7649 happens only when @option{-finline-functions} (included in @option{-O3}) is
7650 enabled and @option{--param max-inline-recursive-depth-auto} is used.  The
7651 default value is 8.
7652
7653 @item min-inline-recursive-probability
7654 Recursive inlining is profitable only for function having deep recursion
7655 in average and can hurt for function having little recursion depth by
7656 increasing the prologue size or complexity of function body to other
7657 optimizers.
7658
7659 When profile feedback is available (see @option{-fprofile-generate}) the actual
7660 recursion depth can be guessed from probability that function will recurse via
7661 given call expression.  This parameter limits inlining only to call expression
7662 whose probability exceeds given threshold (in percents).  The default value is
7663 10.
7664
7665 @item early-inlining-insns
7666 Specify growth that early inliner can make.  In effect it increases amount of
7667 inlining for code having large abstraction penalty.  The default value is 12.
7668
7669 @item max-early-inliner-iterations
7670 @itemx max-early-inliner-iterations
7671 Limit of iterations of early inliner.  This basically bounds number of nested
7672 indirect calls early inliner can resolve.  Deeper chains are still handled by
7673 late inlining.
7674
7675 @item min-vect-loop-bound
7676 The minimum number of iterations under which a loop will not get vectorized
7677 when @option{-ftree-vectorize} is used.  The number of iterations after
7678 vectorization needs to be greater than the value specified by this option
7679 to allow vectorization.  The default value is 0.
7680
7681 @item max-unrolled-insns
7682 The maximum number of instructions that a loop should have if that loop
7683 is unrolled, and if the loop is unrolled, it determines how many times
7684 the loop code is unrolled.
7685
7686 @item max-average-unrolled-insns
7687 The maximum number of instructions biased by probabilities of their execution
7688 that a loop should have if that loop is unrolled, and if the loop is unrolled,
7689 it determines how many times the loop code is unrolled.
7690
7691 @item max-unroll-times
7692 The maximum number of unrollings of a single loop.
7693
7694 @item max-peeled-insns
7695 The maximum number of instructions that a loop should have if that loop
7696 is peeled, and if the loop is peeled, it determines how many times
7697 the loop code is peeled.
7698
7699 @item max-peel-times
7700 The maximum number of peelings of a single loop.
7701
7702 @item max-completely-peeled-insns
7703 The maximum number of insns of a completely peeled loop.
7704
7705 @item max-completely-peel-times
7706 The maximum number of iterations of a loop to be suitable for complete peeling.
7707
7708 @item max-unswitch-insns
7709 The maximum number of insns of an unswitched loop.
7710
7711 @item max-unswitch-level
7712 The maximum number of branches unswitched in a single loop.
7713
7714 @item lim-expensive
7715 The minimum cost of an expensive expression in the loop invariant motion.
7716
7717 @item iv-consider-all-candidates-bound
7718 Bound on number of candidates for induction variables below that
7719 all candidates are considered for each use in induction variable
7720 optimizations.  Only the most relevant candidates are considered
7721 if there are more candidates, to avoid quadratic time complexity.
7722
7723 @item iv-max-considered-uses
7724 The induction variable optimizations give up on loops that contain more
7725 induction variable uses.
7726
7727 @item iv-always-prune-cand-set-bound
7728 If number of candidates in the set is smaller than this value,
7729 we always try to remove unnecessary ivs from the set during its
7730 optimization when a new iv is added to the set.
7731
7732 @item scev-max-expr-size
7733 Bound on size of expressions used in the scalar evolutions analyzer.
7734 Large expressions slow the analyzer.
7735
7736 @item omega-max-vars
7737 The maximum number of variables in an Omega constraint system.
7738 The default value is 128.
7739
7740 @item omega-max-geqs
7741 The maximum number of inequalities in an Omega constraint system.
7742 The default value is 256.
7743
7744 @item omega-max-eqs
7745 The maximum number of equalities in an Omega constraint system.
7746 The default value is 128.
7747
7748 @item omega-max-wild-cards
7749 The maximum number of wildcard variables that the Omega solver will
7750 be able to insert.  The default value is 18.
7751
7752 @item omega-hash-table-size
7753 The size of the hash table in the Omega solver.  The default value is
7754 550.
7755
7756 @item omega-max-keys
7757 The maximal number of keys used by the Omega solver.  The default
7758 value is 500.
7759
7760 @item omega-eliminate-redundant-constraints
7761 When set to 1, use expensive methods to eliminate all redundant
7762 constraints.  The default value is 0.
7763
7764 @item vect-max-version-for-alignment-checks
7765 The maximum number of runtime checks that can be performed when
7766 doing loop versioning for alignment in the vectorizer.  See option
7767 ftree-vect-loop-version for more information.
7768
7769 @item vect-max-version-for-alias-checks
7770 The maximum number of runtime checks that can be performed when
7771 doing loop versioning for alias in the vectorizer.  See option
7772 ftree-vect-loop-version for more information.
7773
7774 @item max-iterations-to-track
7775
7776 The maximum number of iterations of a loop the brute force algorithm
7777 for analysis of # of iterations of the loop tries to evaluate.
7778
7779 @item hot-bb-count-fraction
7780 Select fraction of the maximal count of repetitions of basic block in program
7781 given basic block needs to have to be considered hot.
7782
7783 @item hot-bb-frequency-fraction
7784 Select fraction of the maximal frequency of executions of basic block in
7785 function given basic block needs to have to be considered hot
7786
7787 @item max-predicted-iterations
7788 The maximum number of loop iterations we predict statically.  This is useful
7789 in cases where function contain single loop with known bound and other loop
7790 with unknown.  We predict the known number of iterations correctly, while
7791 the unknown number of iterations average to roughly 10.  This means that the
7792 loop without bounds would appear artificially cold relative to the other one.
7793
7794 @item align-threshold
7795
7796 Select fraction of the maximal frequency of executions of basic block in
7797 function given basic block will get aligned.
7798
7799 @item align-loop-iterations
7800
7801 A loop expected to iterate at lest the selected number of iterations will get
7802 aligned.
7803
7804 @item tracer-dynamic-coverage
7805 @itemx tracer-dynamic-coverage-feedback
7806
7807 This value is used to limit superblock formation once the given percentage of
7808 executed instructions is covered.  This limits unnecessary code size
7809 expansion.
7810
7811 The @option{tracer-dynamic-coverage-feedback} is used only when profile
7812 feedback is available.  The real profiles (as opposed to statically estimated
7813 ones) are much less balanced allowing the threshold to be larger value.
7814
7815 @item tracer-max-code-growth
7816 Stop tail duplication once code growth has reached given percentage.  This is
7817 rather hokey argument, as most of the duplicates will be eliminated later in
7818 cross jumping, so it may be set to much higher values than is the desired code
7819 growth.
7820
7821 @item tracer-min-branch-ratio
7822
7823 Stop reverse growth when the reverse probability of best edge is less than this
7824 threshold (in percent).
7825
7826 @item tracer-min-branch-ratio
7827 @itemx tracer-min-branch-ratio-feedback
7828
7829 Stop forward growth if the best edge do have probability lower than this
7830 threshold.
7831
7832 Similarly to @option{tracer-dynamic-coverage} two values are present, one for
7833 compilation for profile feedback and one for compilation without.  The value
7834 for compilation with profile feedback needs to be more conservative (higher) in
7835 order to make tracer effective.
7836
7837 @item max-cse-path-length
7838
7839 Maximum number of basic blocks on path that cse considers.  The default is 10.
7840
7841 @item max-cse-insns
7842 The maximum instructions CSE process before flushing. The default is 1000.
7843
7844 @item ggc-min-expand
7845
7846 GCC uses a garbage collector to manage its own memory allocation.  This
7847 parameter specifies the minimum percentage by which the garbage
7848 collector's heap should be allowed to expand between collections.
7849 Tuning this may improve compilation speed; it has no effect on code
7850 generation.
7851
7852 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
7853 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of "RAM" is
7854 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
7855 GCC is not able to calculate RAM on a particular platform, the lower
7856 bound of 30% is used.  Setting this parameter and
7857 @option{ggc-min-heapsize} to zero causes a full collection to occur at
7858 every opportunity.  This is extremely slow, but can be useful for
7859 debugging.
7860
7861 @item ggc-min-heapsize
7862
7863 Minimum size of the garbage collector's heap before it begins bothering
7864 to collect garbage.  The first collection occurs after the heap expands
7865 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
7866 tuning this may improve compilation speed, and has no effect on code
7867 generation.
7868
7869 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit which
7870 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
7871 with a lower bound of 4096 (four megabytes) and an upper bound of
7872 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
7873 particular platform, the lower bound is used.  Setting this parameter
7874 very large effectively disables garbage collection.  Setting this
7875 parameter and @option{ggc-min-expand} to zero causes a full collection
7876 to occur at every opportunity.
7877
7878 @item max-reload-search-insns
7879 The maximum number of instruction reload should look backward for equivalent
7880 register.  Increasing values mean more aggressive optimization, making the
7881 compile time increase with probably slightly better performance.  The default
7882 value is 100.
7883
7884 @item max-cselib-memory-locations
7885 The maximum number of memory locations cselib should take into account.
7886 Increasing values mean more aggressive optimization, making the compile time
7887 increase with probably slightly better performance.  The default value is 500.
7888
7889 @item reorder-blocks-duplicate
7890 @itemx reorder-blocks-duplicate-feedback
7891
7892 Used by basic block reordering pass to decide whether to use unconditional
7893 branch or duplicate the code on its destination.  Code is duplicated when its
7894 estimated size is smaller than this value multiplied by the estimated size of
7895 unconditional jump in the hot spots of the program.
7896
7897 The @option{reorder-block-duplicate-feedback} is used only when profile
7898 feedback is available and may be set to higher values than
7899 @option{reorder-block-duplicate} since information about the hot spots is more
7900 accurate.
7901
7902 @item max-sched-ready-insns
7903 The maximum number of instructions ready to be issued the scheduler should
7904 consider at any given time during the first scheduling pass.  Increasing
7905 values mean more thorough searches, making the compilation time increase
7906 with probably little benefit.  The default value is 100.
7907
7908 @item max-sched-region-blocks
7909 The maximum number of blocks in a region to be considered for
7910 interblock scheduling.  The default value is 10.
7911
7912 @item max-pipeline-region-blocks
7913 The maximum number of blocks in a region to be considered for
7914 pipelining in the selective scheduler.  The default value is 15.
7915
7916 @item max-sched-region-insns
7917 The maximum number of insns in a region to be considered for
7918 interblock scheduling.  The default value is 100.
7919
7920 @item max-pipeline-region-insns
7921 The maximum number of insns in a region to be considered for
7922 pipelining in the selective scheduler.  The default value is 200.
7923
7924 @item min-spec-prob
7925 The minimum probability (in percents) of reaching a source block
7926 for interblock speculative scheduling.  The default value is 40.
7927
7928 @item max-sched-extend-regions-iters
7929 The maximum number of iterations through CFG to extend regions.
7930 0 - disable region extension,
7931 N - do at most N iterations.
7932 The default value is 0.
7933
7934 @item max-sched-insn-conflict-delay
7935 The maximum conflict delay for an insn to be considered for speculative motion.
7936 The default value is 3.
7937
7938 @item sched-spec-prob-cutoff
7939 The minimal probability of speculation success (in percents), so that
7940 speculative insn will be scheduled.
7941 The default value is 40.
7942
7943 @item sched-mem-true-dep-cost
7944 Minimal distance (in CPU cycles) between store and load targeting same
7945 memory locations.  The default value is 1.
7946
7947 @item selsched-max-lookahead
7948 The maximum size of the lookahead window of selective scheduling.  It is a
7949 depth of search for available instructions.
7950 The default value is 50.
7951
7952 @item selsched-max-sched-times
7953 The maximum number of times that an instruction will be scheduled during
7954 selective scheduling.  This is the limit on the number of iterations
7955 through which the instruction may be pipelined.  The default value is 2.
7956
7957 @item selsched-max-insns-to-rename
7958 The maximum number of best instructions in the ready list that are considered
7959 for renaming in the selective scheduler.  The default value is 2.
7960
7961 @item max-last-value-rtl
7962 The maximum size measured as number of RTLs that can be recorded in an expression
7963 in combiner for a pseudo register as last known value of that register.  The default
7964 is 10000.
7965
7966 @item integer-share-limit
7967 Small integer constants can use a shared data structure, reducing the
7968 compiler's memory usage and increasing its speed.  This sets the maximum
7969 value of a shared integer constant.  The default value is 256.
7970
7971 @item min-virtual-mappings
7972 Specifies the minimum number of virtual mappings in the incremental
7973 SSA updater that should be registered to trigger the virtual mappings
7974 heuristic defined by virtual-mappings-ratio.  The default value is
7975 100.
7976
7977 @item virtual-mappings-ratio
7978 If the number of virtual mappings is virtual-mappings-ratio bigger
7979 than the number of virtual symbols to be updated, then the incremental
7980 SSA updater switches to a full update for those symbols.  The default
7981 ratio is 3.
7982
7983 @item ssp-buffer-size
7984 The minimum size of buffers (i.e.@: arrays) that will receive stack smashing
7985 protection when @option{-fstack-protection} is used.
7986
7987 @item max-jump-thread-duplication-stmts
7988 Maximum number of statements allowed in a block that needs to be
7989 duplicated when threading jumps.
7990
7991 @item max-fields-for-field-sensitive
7992 Maximum number of fields in a structure we will treat in
7993 a field sensitive manner during pointer analysis.  The default is zero
7994 for -O0, and -O1 and 100 for -Os, -O2, and -O3.
7995
7996 @item prefetch-latency
7997 Estimate on average number of instructions that are executed before
7998 prefetch finishes.  The distance we prefetch ahead is proportional
7999 to this constant.  Increasing this number may also lead to less
8000 streams being prefetched (see @option{simultaneous-prefetches}).
8001
8002 @item simultaneous-prefetches
8003 Maximum number of prefetches that can run at the same time.
8004
8005 @item l1-cache-line-size
8006 The size of cache line in L1 cache, in bytes.
8007
8008 @item l1-cache-size
8009 The size of L1 cache, in kilobytes.
8010
8011 @item l2-cache-size
8012 The size of L2 cache, in kilobytes.
8013
8014 @item min-insn-to-prefetch-ratio
8015 The minimum ratio between the number of instructions and the
8016 number of prefetches to enable prefetching in a loop with an
8017 unknown trip count.
8018
8019 @item prefetch-min-insn-to-mem-ratio
8020 The minimum ratio between the number of instructions and the
8021 number of memory references to enable prefetching in a loop.
8022
8023 @item use-canonical-types
8024 Whether the compiler should use the ``canonical'' type system.  By
8025 default, this should always be 1, which uses a more efficient internal
8026 mechanism for comparing types in C++ and Objective-C++.  However, if
8027 bugs in the canonical type system are causing compilation failures,
8028 set this value to 0 to disable canonical types.
8029
8030 @item switch-conversion-max-branch-ratio
8031 Switch initialization conversion will refuse to create arrays that are
8032 bigger than @option{switch-conversion-max-branch-ratio} times the number of
8033 branches in the switch.
8034
8035 @item max-partial-antic-length
8036 Maximum length of the partial antic set computed during the tree
8037 partial redundancy elimination optimization (@option{-ftree-pre}) when
8038 optimizing at @option{-O3} and above.  For some sorts of source code
8039 the enhanced partial redundancy elimination optimization can run away,
8040 consuming all of the memory available on the host machine.  This
8041 parameter sets a limit on the length of the sets that are computed,
8042 which prevents the runaway behavior.  Setting a value of 0 for
8043 this parameter will allow an unlimited set length.
8044
8045 @item sccvn-max-scc-size
8046 Maximum size of a strongly connected component (SCC) during SCCVN
8047 processing.  If this limit is hit, SCCVN processing for the whole
8048 function will not be done and optimizations depending on it will
8049 be disabled.  The default maximum SCC size is 10000.
8050
8051 @item ira-max-loops-num
8052 IRA uses a regional register allocation by default.  If a function
8053 contains loops more than number given by the parameter, only at most
8054 given number of the most frequently executed loops will form regions
8055 for the regional register allocation.  The default value of the
8056 parameter is 100.
8057
8058 @item ira-max-conflict-table-size
8059 Although IRA uses a sophisticated algorithm of compression conflict
8060 table, the table can be still big for huge functions.  If the conflict
8061 table for a function could be more than size in MB given by the
8062 parameter, the conflict table is not built and faster, simpler, and
8063 lower quality register allocation algorithm will be used.  The
8064 algorithm do not use pseudo-register conflicts.  The default value of
8065 the parameter is 2000.
8066
8067 @item loop-invariant-max-bbs-in-loop
8068 Loop invariant motion can be very expensive, both in compile time and
8069 in amount of needed compile time memory, with very large loops.  Loops
8070 with more basic blocks than this parameter won't have loop invariant
8071 motion optimization performed on them.  The default value of the
8072 parameter is 1000 for -O1 and 10000 for -O2 and above.
8073
8074 @end table
8075 @end table
8076
8077 @node Preprocessor Options
8078 @section Options Controlling the Preprocessor
8079 @cindex preprocessor options
8080 @cindex options, preprocessor
8081
8082 These options control the C preprocessor, which is run on each C source
8083 file before actual compilation.
8084
8085 If you use the @option{-E} option, nothing is done except preprocessing.
8086 Some of these options make sense only together with @option{-E} because
8087 they cause the preprocessor output to be unsuitable for actual
8088 compilation.
8089
8090 @table @gcctabopt
8091 @item -Wp,@var{option}
8092 @opindex Wp
8093 You can use @option{-Wp,@var{option}} to bypass the compiler driver
8094 and pass @var{option} directly through to the preprocessor.  If
8095 @var{option} contains commas, it is split into multiple options at the
8096 commas.  However, many options are modified, translated or interpreted
8097 by the compiler driver before being passed to the preprocessor, and
8098 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
8099 interface is undocumented and subject to change, so whenever possible
8100 you should avoid using @option{-Wp} and let the driver handle the
8101 options instead.
8102
8103 @item -Xpreprocessor @var{option}
8104 @opindex Xpreprocessor
8105 Pass @var{option} as an option to the preprocessor.  You can use this to
8106 supply system-specific preprocessor options which GCC does not know how to
8107 recognize.
8108
8109 If you want to pass an option that takes an argument, you must use
8110 @option{-Xpreprocessor} twice, once for the option and once for the argument.
8111 @end table
8112
8113 @include cppopts.texi
8114
8115 @node Assembler Options
8116 @section Passing Options to the Assembler
8117
8118 @c prevent bad page break with this line
8119 You can pass options to the assembler.
8120
8121 @table @gcctabopt
8122 @item -Wa,@var{option}
8123 @opindex Wa
8124 Pass @var{option} as an option to the assembler.  If @var{option}
8125 contains commas, it is split into multiple options at the commas.
8126
8127 @item -Xassembler @var{option}
8128 @opindex Xassembler
8129 Pass @var{option} as an option to the assembler.  You can use this to
8130 supply system-specific assembler options which GCC does not know how to
8131 recognize.
8132
8133 If you want to pass an option that takes an argument, you must use
8134 @option{-Xassembler} twice, once for the option and once for the argument.
8135
8136 @end table
8137
8138 @node Link Options
8139 @section Options for Linking
8140 @cindex link options
8141 @cindex options, linking
8142
8143 These options come into play when the compiler links object files into
8144 an executable output file.  They are meaningless if the compiler is
8145 not doing a link step.
8146
8147 @table @gcctabopt
8148 @cindex file names
8149 @item @var{object-file-name}
8150 A file name that does not end in a special recognized suffix is
8151 considered to name an object file or library.  (Object files are
8152 distinguished from libraries by the linker according to the file
8153 contents.)  If linking is done, these object files are used as input
8154 to the linker.
8155
8156 @item -c
8157 @itemx -S
8158 @itemx -E
8159 @opindex c
8160 @opindex S
8161 @opindex E
8162 If any of these options is used, then the linker is not run, and
8163 object file names should not be used as arguments.  @xref{Overall
8164 Options}.
8165
8166 @cindex Libraries
8167 @item -l@var{library}
8168 @itemx -l @var{library}
8169 @opindex l
8170 Search the library named @var{library} when linking.  (The second
8171 alternative with the library as a separate argument is only for
8172 POSIX compliance and is not recommended.)
8173
8174 It makes a difference where in the command you write this option; the
8175 linker searches and processes libraries and object files in the order they
8176 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
8177 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
8178 to functions in @samp{z}, those functions may not be loaded.
8179
8180 The linker searches a standard list of directories for the library,
8181 which is actually a file named @file{lib@var{library}.a}.  The linker
8182 then uses this file as if it had been specified precisely by name.
8183
8184 The directories searched include several standard system directories
8185 plus any that you specify with @option{-L}.
8186
8187 Normally the files found this way are library files---archive files
8188 whose members are object files.  The linker handles an archive file by
8189 scanning through it for members which define symbols that have so far
8190 been referenced but not defined.  But if the file that is found is an
8191 ordinary object file, it is linked in the usual fashion.  The only
8192 difference between using an @option{-l} option and specifying a file name
8193 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
8194 and searches several directories.
8195
8196 @item -lobjc
8197 @opindex lobjc
8198 You need this special case of the @option{-l} option in order to
8199 link an Objective-C or Objective-C++ program.
8200
8201 @item -nostartfiles
8202 @opindex nostartfiles
8203 Do not use the standard system startup files when linking.
8204 The standard system libraries are used normally, unless @option{-nostdlib}
8205 or @option{-nodefaultlibs} is used.
8206
8207 @item -nodefaultlibs
8208 @opindex nodefaultlibs
8209 Do not use the standard system libraries when linking.
8210 Only the libraries you specify will be passed to the linker, options
8211 specifying linkage of the system libraries, such as @code{-static-libgcc}
8212 or @code{-shared-libgcc}, will be ignored.
8213 The standard startup files are used normally, unless @option{-nostartfiles}
8214 is used.  The compiler may generate calls to @code{memcmp},
8215 @code{memset}, @code{memcpy} and @code{memmove}.
8216 These entries are usually resolved by entries in
8217 libc.  These entry points should be supplied through some other
8218 mechanism when this option is specified.
8219
8220 @item -nostdlib
8221 @opindex nostdlib
8222 Do not use the standard system startup files or libraries when linking.
8223 No startup files and only the libraries you specify will be passed to
8224 the linker, options specifying linkage of the system libraries, such as
8225 @code{-static-libgcc} or @code{-shared-libgcc}, will be ignored.
8226 The compiler may generate calls to @code{memcmp}, @code{memset},
8227 @code{memcpy} and @code{memmove}.
8228 These entries are usually resolved by entries in
8229 libc.  These entry points should be supplied through some other
8230 mechanism when this option is specified.
8231
8232 @cindex @option{-lgcc}, use with @option{-nostdlib}
8233 @cindex @option{-nostdlib} and unresolved references
8234 @cindex unresolved references and @option{-nostdlib}
8235 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
8236 @cindex @option{-nodefaultlibs} and unresolved references
8237 @cindex unresolved references and @option{-nodefaultlibs}
8238 One of the standard libraries bypassed by @option{-nostdlib} and
8239 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
8240 that GCC uses to overcome shortcomings of particular machines, or special
8241 needs for some languages.
8242 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
8243 Collection (GCC) Internals},
8244 for more discussion of @file{libgcc.a}.)
8245 In most cases, you need @file{libgcc.a} even when you want to avoid
8246 other standard libraries.  In other words, when you specify @option{-nostdlib}
8247 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
8248 This ensures that you have no unresolved references to internal GCC
8249 library subroutines.  (For example, @samp{__main}, used to ensure C++
8250 constructors will be called; @pxref{Collect2,,@code{collect2}, gccint,
8251 GNU Compiler Collection (GCC) Internals}.)
8252
8253 @item -pie
8254 @opindex pie
8255 Produce a position independent executable on targets which support it.
8256 For predictable results, you must also specify the same set of options
8257 that were used to generate code (@option{-fpie}, @option{-fPIE},
8258 or model suboptions) when you specify this option.
8259
8260 @item -rdynamic
8261 @opindex rdynamic
8262 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
8263 that support it. This instructs the linker to add all symbols, not
8264 only used ones, to the dynamic symbol table. This option is needed
8265 for some uses of @code{dlopen} or to allow obtaining backtraces
8266 from within a program.
8267
8268 @item -s
8269 @opindex s
8270 Remove all symbol table and relocation information from the executable.
8271
8272 @item -static
8273 @opindex static
8274 On systems that support dynamic linking, this prevents linking with the shared
8275 libraries.  On other systems, this option has no effect.
8276
8277 @item -shared
8278 @opindex shared
8279 Produce a shared object which can then be linked with other objects to
8280 form an executable.  Not all systems support this option.  For predictable
8281 results, you must also specify the same set of options that were used to
8282 generate code (@option{-fpic}, @option{-fPIC}, or model suboptions)
8283 when you specify this option.@footnote{On some systems, @samp{gcc -shared}
8284 needs to build supplementary stub code for constructors to work.  On
8285 multi-libbed systems, @samp{gcc -shared} must select the correct support
8286 libraries to link against.  Failing to supply the correct flags may lead
8287 to subtle defects.  Supplying them in cases where they are not necessary
8288 is innocuous.}
8289
8290 @item -shared-libgcc
8291 @itemx -static-libgcc
8292 @opindex shared-libgcc
8293 @opindex static-libgcc
8294 On systems that provide @file{libgcc} as a shared library, these options
8295 force the use of either the shared or static version respectively.
8296 If no shared version of @file{libgcc} was built when the compiler was
8297 configured, these options have no effect.
8298
8299 There are several situations in which an application should use the
8300 shared @file{libgcc} instead of the static version.  The most common
8301 of these is when the application wishes to throw and catch exceptions
8302 across different shared libraries.  In that case, each of the libraries
8303 as well as the application itself should use the shared @file{libgcc}.
8304
8305 Therefore, the G++ and GCJ drivers automatically add
8306 @option{-shared-libgcc} whenever you build a shared library or a main
8307 executable, because C++ and Java programs typically use exceptions, so
8308 this is the right thing to do.
8309
8310 If, instead, you use the GCC driver to create shared libraries, you may
8311 find that they will not always be linked with the shared @file{libgcc}.
8312 If GCC finds, at its configuration time, that you have a non-GNU linker
8313 or a GNU linker that does not support option @option{--eh-frame-hdr},
8314 it will link the shared version of @file{libgcc} into shared libraries
8315 by default.  Otherwise, it will take advantage of the linker and optimize
8316 away the linking with the shared version of @file{libgcc}, linking with
8317 the static version of libgcc by default.  This allows exceptions to
8318 propagate through such shared libraries, without incurring relocation
8319 costs at library load time.
8320
8321 However, if a library or main executable is supposed to throw or catch
8322 exceptions, you must link it using the G++ or GCJ driver, as appropriate
8323 for the languages used in the program, or using the option
8324 @option{-shared-libgcc}, such that it is linked with the shared
8325 @file{libgcc}.
8326
8327 @item -static-libstdc++
8328 When the @command{g++} program is used to link a C++ program, it will
8329 normally automatically link against @option{libstdc++}.  If
8330 @file{libstdc++} is available as a shared library, and the
8331 @option{-static} option is not used, then this will link against the
8332 shared version of @file{libstdc++}.  That is normally fine.  However, it
8333 is sometimes useful to freeze the version of @file{libstdc++} used by
8334 the program without going all the way to a fully static link.  The
8335 @option{-static-libstdc++} option directs the @command{g++} driver to
8336 link @file{libstdc++} statically, without necessarily linking other
8337 libraries statically.
8338
8339 @item -symbolic
8340 @opindex symbolic
8341 Bind references to global symbols when building a shared object.  Warn
8342 about any unresolved references (unless overridden by the link editor
8343 option @samp{-Xlinker -z -Xlinker defs}).  Only a few systems support
8344 this option.
8345
8346 @item -T @var{script}
8347 @opindex T
8348 @cindex linker script
8349 Use @var{script} as the linker script.  This option is supported by most
8350 systems using the GNU linker.  On some targets, such as bare-board
8351 targets without an operating system, the @option{-T} option may be required
8352 when linking to avoid references to undefined symbols.
8353
8354 @item -Xlinker @var{option}
8355 @opindex Xlinker
8356 Pass @var{option} as an option to the linker.  You can use this to
8357 supply system-specific linker options which GCC does not know how to
8358 recognize.
8359
8360 If you want to pass an option that takes a separate argument, you must use
8361 @option{-Xlinker} twice, once for the option and once for the argument.
8362 For example, to pass @option{-assert definitions}, you must write
8363 @samp{-Xlinker -assert -Xlinker definitions}.  It does not work to write
8364 @option{-Xlinker "-assert definitions"}, because this passes the entire
8365 string as a single argument, which is not what the linker expects.
8366
8367 When using the GNU linker, it is usually more convenient to pass
8368 arguments to linker options using the @option{@var{option}=@var{value}}
8369 syntax than as separate arguments.  For example, you can specify
8370 @samp{-Xlinker -Map=output.map} rather than
8371 @samp{-Xlinker -Map -Xlinker output.map}.  Other linkers may not support
8372 this syntax for command-line options.
8373
8374 @item -Wl,@var{option}
8375 @opindex Wl
8376 Pass @var{option} as an option to the linker.  If @var{option} contains
8377 commas, it is split into multiple options at the commas.  You can use this
8378 syntax to pass an argument to the option.
8379 For example, @samp{-Wl,-Map,output.map} passes @samp{-Map output.map} to the
8380 linker.  When using the GNU linker, you can also get the same effect with
8381 @samp{-Wl,-Map=output.map}.
8382
8383 @item -u @var{symbol}
8384 @opindex u
8385 Pretend the symbol @var{symbol} is undefined, to force linking of
8386 library modules to define it.  You can use @option{-u} multiple times with
8387 different symbols to force loading of additional library modules.
8388 @end table
8389
8390 @node Directory Options
8391 @section Options for Directory Search
8392 @cindex directory options
8393 @cindex options, directory search
8394 @cindex search path
8395
8396 These options specify directories to search for header files, for
8397 libraries and for parts of the compiler:
8398
8399 @table @gcctabopt
8400 @item -I@var{dir}
8401 @opindex I
8402 Add the directory @var{dir} to the head of the list of directories to be
8403 searched for header files.  This can be used to override a system header
8404 file, substituting your own version, since these directories are
8405 searched before the system header file directories.  However, you should
8406 not use this option to add directories that contain vendor-supplied
8407 system header files (use @option{-isystem} for that).  If you use more than
8408 one @option{-I} option, the directories are scanned in left-to-right
8409 order; the standard system directories come after.
8410
8411 If a standard system include directory, or a directory specified with
8412 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
8413 option will be ignored.  The directory will still be searched but as a
8414 system directory at its normal position in the system include chain.
8415 This is to ensure that GCC's procedure to fix buggy system headers and
8416 the ordering for the include_next directive are not inadvertently changed.
8417 If you really need to change the search order for system directories,
8418 use the @option{-nostdinc} and/or @option{-isystem} options.
8419
8420 @item -iquote@var{dir}
8421 @opindex iquote
8422 Add the directory @var{dir} to the head of the list of directories to
8423 be searched for header files only for the case of @samp{#include
8424 "@var{file}"}; they are not searched for @samp{#include <@var{file}>},
8425 otherwise just like @option{-I}.
8426
8427 @item -L@var{dir}
8428 @opindex L
8429 Add directory @var{dir} to the list of directories to be searched
8430 for @option{-l}.
8431
8432 @item -B@var{prefix}
8433 @opindex B
8434 This option specifies where to find the executables, libraries,
8435 include files, and data files of the compiler itself.
8436
8437 The compiler driver program runs one or more of the subprograms
8438 @file{cpp}, @file{cc1}, @file{as} and @file{ld}.  It tries
8439 @var{prefix} as a prefix for each program it tries to run, both with and
8440 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
8441
8442 For each subprogram to be run, the compiler driver first tries the
8443 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
8444 was not specified, the driver tries two standard prefixes, which are
8445 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
8446 those results in a file name that is found, the unmodified program
8447 name is searched for using the directories specified in your
8448 @env{PATH} environment variable.
8449
8450 The compiler will check to see if the path provided by the @option{-B}
8451 refers to a directory, and if necessary it will add a directory
8452 separator character at the end of the path.
8453
8454 @option{-B} prefixes that effectively specify directory names also apply
8455 to libraries in the linker, because the compiler translates these
8456 options into @option{-L} options for the linker.  They also apply to
8457 includes files in the preprocessor, because the compiler translates these
8458 options into @option{-isystem} options for the preprocessor.  In this case,
8459 the compiler appends @samp{include} to the prefix.
8460
8461 The run-time support file @file{libgcc.a} can also be searched for using
8462 the @option{-B} prefix, if needed.  If it is not found there, the two
8463 standard prefixes above are tried, and that is all.  The file is left
8464 out of the link if it is not found by those means.
8465
8466 Another way to specify a prefix much like the @option{-B} prefix is to use
8467 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
8468 Variables}.
8469
8470 As a special kludge, if the path provided by @option{-B} is
8471 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
8472 9, then it will be replaced by @file{[dir/]include}.  This is to help
8473 with boot-strapping the compiler.
8474
8475 @item -specs=@var{file}
8476 @opindex specs
8477 Process @var{file} after the compiler reads in the standard @file{specs}
8478 file, in order to override the defaults that the @file{gcc} driver
8479 program uses when determining what switches to pass to @file{cc1},
8480 @file{cc1plus}, @file{as}, @file{ld}, etc.  More than one
8481 @option{-specs=@var{file}} can be specified on the command line, and they
8482 are processed in order, from left to right.
8483
8484 @item --sysroot=@var{dir}
8485 @opindex sysroot
8486 Use @var{dir} as the logical root directory for headers and libraries.
8487 For example, if the compiler would normally search for headers in
8488 @file{/usr/include} and libraries in @file{/usr/lib}, it will instead
8489 search @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
8490
8491 If you use both this option and the @option{-isysroot} option, then
8492 the @option{--sysroot} option will apply to libraries, but the
8493 @option{-isysroot} option will apply to header files.
8494
8495 The GNU linker (beginning with version 2.16) has the necessary support
8496 for this option.  If your linker does not support this option, the
8497 header file aspect of @option{--sysroot} will still work, but the
8498 library aspect will not.
8499
8500 @item -I-
8501 @opindex I-
8502 This option has been deprecated.  Please use @option{-iquote} instead for
8503 @option{-I} directories before the @option{-I-} and remove the @option{-I-}.
8504 Any directories you specify with @option{-I} options before the @option{-I-}
8505 option are searched only for the case of @samp{#include "@var{file}"};
8506 they are not searched for @samp{#include <@var{file}>}.
8507
8508 If additional directories are specified with @option{-I} options after
8509 the @option{-I-}, these directories are searched for all @samp{#include}
8510 directives.  (Ordinarily @emph{all} @option{-I} directories are used
8511 this way.)
8512
8513 In addition, the @option{-I-} option inhibits the use of the current
8514 directory (where the current input file came from) as the first search
8515 directory for @samp{#include "@var{file}"}.  There is no way to
8516 override this effect of @option{-I-}.  With @option{-I.} you can specify
8517 searching the directory which was current when the compiler was
8518 invoked.  That is not exactly the same as what the preprocessor does
8519 by default, but it is often satisfactory.
8520
8521 @option{-I-} does not inhibit the use of the standard system directories
8522 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
8523 independent.
8524 @end table
8525
8526 @c man end
8527
8528 @node Spec Files
8529 @section Specifying subprocesses and the switches to pass to them
8530 @cindex Spec Files
8531
8532 @command{gcc} is a driver program.  It performs its job by invoking a
8533 sequence of other programs to do the work of compiling, assembling and
8534 linking.  GCC interprets its command-line parameters and uses these to
8535 deduce which programs it should invoke, and which command-line options
8536 it ought to place on their command lines.  This behavior is controlled
8537 by @dfn{spec strings}.  In most cases there is one spec string for each
8538 program that GCC can invoke, but a few programs have multiple spec
8539 strings to control their behavior.  The spec strings built into GCC can
8540 be overridden by using the @option{-specs=} command-line switch to specify
8541 a spec file.
8542
8543 @dfn{Spec files} are plaintext files that are used to construct spec
8544 strings.  They consist of a sequence of directives separated by blank
8545 lines.  The type of directive is determined by the first non-whitespace
8546 character on the line and it can be one of the following:
8547
8548 @table @code
8549 @item %@var{command}
8550 Issues a @var{command} to the spec file processor.  The commands that can
8551 appear here are:
8552
8553 @table @code
8554 @item %include <@var{file}>
8555 @cindex %include
8556 Search for @var{file} and insert its text at the current point in the
8557 specs file.
8558
8559 @item %include_noerr <@var{file}>
8560 @cindex %include_noerr
8561 Just like @samp{%include}, but do not generate an error message if the include
8562 file cannot be found.
8563
8564 @item %rename @var{old_name} @var{new_name}
8565 @cindex %rename
8566 Rename the spec string @var{old_name} to @var{new_name}.
8567
8568 @end table
8569
8570 @item *[@var{spec_name}]:
8571 This tells the compiler to create, override or delete the named spec
8572 string.  All lines after this directive up to the next directive or
8573 blank line are considered to be the text for the spec string.  If this
8574 results in an empty string then the spec will be deleted.  (Or, if the
8575 spec did not exist, then nothing will happened.)  Otherwise, if the spec
8576 does not currently exist a new spec will be created.  If the spec does
8577 exist then its contents will be overridden by the text of this
8578 directive, unless the first character of that text is the @samp{+}
8579 character, in which case the text will be appended to the spec.
8580
8581 @item [@var{suffix}]:
8582 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
8583 and up to the next directive or blank line are considered to make up the
8584 spec string for the indicated suffix.  When the compiler encounters an
8585 input file with the named suffix, it will processes the spec string in
8586 order to work out how to compile that file.  For example:
8587
8588 @smallexample
8589 .ZZ:
8590 z-compile -input %i
8591 @end smallexample
8592
8593 This says that any input file whose name ends in @samp{.ZZ} should be
8594 passed to the program @samp{z-compile}, which should be invoked with the
8595 command-line switch @option{-input} and with the result of performing the
8596 @samp{%i} substitution.  (See below.)
8597
8598 As an alternative to providing a spec string, the text that follows a
8599 suffix directive can be one of the following:
8600
8601 @table @code
8602 @item @@@var{language}
8603 This says that the suffix is an alias for a known @var{language}.  This is
8604 similar to using the @option{-x} command-line switch to GCC to specify a
8605 language explicitly.  For example:
8606
8607 @smallexample
8608 .ZZ:
8609 @@c++
8610 @end smallexample
8611
8612 Says that .ZZ files are, in fact, C++ source files.
8613
8614 @item #@var{name}
8615 This causes an error messages saying:
8616
8617 @smallexample
8618 @var{name} compiler not installed on this system.
8619 @end smallexample
8620 @end table
8621
8622 GCC already has an extensive list of suffixes built into it.
8623 This directive will add an entry to the end of the list of suffixes, but
8624 since the list is searched from the end backwards, it is effectively
8625 possible to override earlier entries using this technique.
8626
8627 @end table
8628
8629 GCC has the following spec strings built into it.  Spec files can
8630 override these strings or create their own.  Note that individual
8631 targets can also add their own spec strings to this list.
8632
8633 @smallexample
8634 asm          Options to pass to the assembler
8635 asm_final    Options to pass to the assembler post-processor
8636 cpp          Options to pass to the C preprocessor
8637 cc1          Options to pass to the C compiler
8638 cc1plus      Options to pass to the C++ compiler
8639 endfile      Object files to include at the end of the link
8640 link         Options to pass to the linker
8641 lib          Libraries to include on the command line to the linker
8642 libgcc       Decides which GCC support library to pass to the linker
8643 linker       Sets the name of the linker
8644 predefines   Defines to be passed to the C preprocessor
8645 signed_char  Defines to pass to CPP to say whether @code{char} is signed
8646              by default
8647 startfile    Object files to include at the start of the link
8648 @end smallexample
8649
8650 Here is a small example of a spec file:
8651
8652 @smallexample
8653 %rename lib                 old_lib
8654
8655 *lib:
8656 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
8657 @end smallexample
8658
8659 This example renames the spec called @samp{lib} to @samp{old_lib} and
8660 then overrides the previous definition of @samp{lib} with a new one.
8661 The new definition adds in some extra command-line options before
8662 including the text of the old definition.
8663
8664 @dfn{Spec strings} are a list of command-line options to be passed to their
8665 corresponding program.  In addition, the spec strings can contain
8666 @samp{%}-prefixed sequences to substitute variable text or to
8667 conditionally insert text into the command line.  Using these constructs
8668 it is possible to generate quite complex command lines.
8669
8670 Here is a table of all defined @samp{%}-sequences for spec
8671 strings.  Note that spaces are not generated automatically around the
8672 results of expanding these sequences.  Therefore you can concatenate them
8673 together or combine them with constant text in a single argument.
8674
8675 @table @code
8676 @item %%
8677 Substitute one @samp{%} into the program name or argument.
8678
8679 @item %i
8680 Substitute the name of the input file being processed.
8681
8682 @item %b
8683 Substitute the basename of the input file being processed.
8684 This is the substring up to (and not including) the last period
8685 and not including the directory.
8686
8687 @item %B
8688 This is the same as @samp{%b}, but include the file suffix (text after
8689 the last period).
8690
8691 @item %d
8692 Marks the argument containing or following the @samp{%d} as a
8693 temporary file name, so that that file will be deleted if GCC exits
8694 successfully.  Unlike @samp{%g}, this contributes no text to the
8695 argument.
8696
8697 @item %g@var{suffix}
8698 Substitute a file name that has suffix @var{suffix} and is chosen
8699 once per compilation, and mark the argument in the same way as
8700 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
8701 name is now chosen in a way that is hard to predict even when previously
8702 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
8703 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
8704 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
8705 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
8706 was simply substituted with a file name chosen once per compilation,
8707 without regard to any appended suffix (which was therefore treated
8708 just like ordinary text), making such attacks more likely to succeed.
8709
8710 @item %u@var{suffix}
8711 Like @samp{%g}, but generates a new temporary file name even if
8712 @samp{%u@var{suffix}} was already seen.
8713
8714 @item %U@var{suffix}
8715 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
8716 new one if there is no such last file name.  In the absence of any
8717 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
8718 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
8719 would involve the generation of two distinct file names, one
8720 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
8721 simply substituted with a file name chosen for the previous @samp{%u},
8722 without regard to any appended suffix.
8723
8724 @item %j@var{suffix}
8725 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
8726 writable, and if save-temps is off; otherwise, substitute the name
8727 of a temporary file, just like @samp{%u}.  This temporary file is not
8728 meant for communication between processes, but rather as a junk
8729 disposal mechanism.
8730
8731 @item %|@var{suffix}
8732 @itemx %m@var{suffix}
8733 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
8734 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
8735 all.  These are the two most common ways to instruct a program that it
8736 should read from standard input or write to standard output.  If you
8737 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
8738 construct: see for example @file{f/lang-specs.h}.
8739
8740 @item %.@var{SUFFIX}
8741 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
8742 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
8743 terminated by the next space or %.
8744
8745 @item %w
8746 Marks the argument containing or following the @samp{%w} as the
8747 designated output file of this compilation.  This puts the argument
8748 into the sequence of arguments that @samp{%o} will substitute later.
8749
8750 @item %o
8751 Substitutes the names of all the output files, with spaces
8752 automatically placed around them.  You should write spaces
8753 around the @samp{%o} as well or the results are undefined.
8754 @samp{%o} is for use in the specs for running the linker.
8755 Input files whose names have no recognized suffix are not compiled
8756 at all, but they are included among the output files, so they will
8757 be linked.
8758
8759 @item %O
8760 Substitutes the suffix for object files.  Note that this is
8761 handled specially when it immediately follows @samp{%g, %u, or %U},
8762 because of the need for those to form complete file names.  The
8763 handling is such that @samp{%O} is treated exactly as if it had already
8764 been substituted, except that @samp{%g, %u, and %U} do not currently
8765 support additional @var{suffix} characters following @samp{%O} as they would
8766 following, for example, @samp{.o}.
8767
8768 @item %p
8769 Substitutes the standard macro predefinitions for the
8770 current target machine.  Use this when running @code{cpp}.
8771
8772 @item %P
8773 Like @samp{%p}, but puts @samp{__} before and after the name of each
8774 predefined macro, except for macros that start with @samp{__} or with
8775 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
8776 C@.
8777
8778 @item %I
8779 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
8780 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
8781 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
8782 and @option{-imultilib} as necessary.
8783
8784 @item %s
8785 Current argument is the name of a library or startup file of some sort.
8786 Search for that file in a standard list of directories and substitute
8787 the full name found.
8788
8789 @item %e@var{str}
8790 Print @var{str} as an error message.  @var{str} is terminated by a newline.
8791 Use this when inconsistent options are detected.
8792
8793 @item %(@var{name})
8794 Substitute the contents of spec string @var{name} at this point.
8795
8796 @item %[@var{name}]
8797 Like @samp{%(@dots{})} but put @samp{__} around @option{-D} arguments.
8798
8799 @item %x@{@var{option}@}
8800 Accumulate an option for @samp{%X}.
8801
8802 @item %X
8803 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
8804 spec string.
8805
8806 @item %Y
8807 Output the accumulated assembler options specified by @option{-Wa}.
8808
8809 @item %Z
8810 Output the accumulated preprocessor options specified by @option{-Wp}.
8811
8812 @item %a
8813 Process the @code{asm} spec.  This is used to compute the
8814 switches to be passed to the assembler.
8815
8816 @item %A
8817 Process the @code{asm_final} spec.  This is a spec string for
8818 passing switches to an assembler post-processor, if such a program is
8819 needed.
8820
8821 @item %l
8822 Process the @code{link} spec.  This is the spec for computing the
8823 command line passed to the linker.  Typically it will make use of the
8824 @samp{%L %G %S %D and %E} sequences.
8825
8826 @item %D
8827 Dump out a @option{-L} option for each directory that GCC believes might
8828 contain startup files.  If the target supports multilibs then the
8829 current multilib directory will be prepended to each of these paths.
8830
8831 @item %L
8832 Process the @code{lib} spec.  This is a spec string for deciding which
8833 libraries should be included on the command line to the linker.
8834
8835 @item %G
8836 Process the @code{libgcc} spec.  This is a spec string for deciding
8837 which GCC support library should be included on the command line to the linker.
8838
8839 @item %S
8840 Process the @code{startfile} spec.  This is a spec for deciding which
8841 object files should be the first ones passed to the linker.  Typically
8842 this might be a file named @file{crt0.o}.
8843
8844 @item %E
8845 Process the @code{endfile} spec.  This is a spec string that specifies
8846 the last object files that will be passed to the linker.
8847
8848 @item %C
8849 Process the @code{cpp} spec.  This is used to construct the arguments
8850 to be passed to the C preprocessor.
8851
8852 @item %1
8853 Process the @code{cc1} spec.  This is used to construct the options to be
8854 passed to the actual C compiler (@samp{cc1}).
8855
8856 @item %2
8857 Process the @code{cc1plus} spec.  This is used to construct the options to be
8858 passed to the actual C++ compiler (@samp{cc1plus}).
8859
8860 @item %*
8861 Substitute the variable part of a matched option.  See below.
8862 Note that each comma in the substituted string is replaced by
8863 a single space.
8864
8865 @item %<@code{S}
8866 Remove all occurrences of @code{-S} from the command line.  Note---this
8867 command is position dependent.  @samp{%} commands in the spec string
8868 before this one will see @code{-S}, @samp{%} commands in the spec string
8869 after this one will not.
8870
8871 @item %:@var{function}(@var{args})
8872 Call the named function @var{function}, passing it @var{args}.
8873 @var{args} is first processed as a nested spec string, then split
8874 into an argument vector in the usual fashion.  The function returns
8875 a string which is processed as if it had appeared literally as part
8876 of the current spec.
8877
8878 The following built-in spec functions are provided:
8879
8880 @table @code
8881 @item @code{getenv}
8882 The @code{getenv} spec function takes two arguments: an environment
8883 variable name and a string.  If the environment variable is not
8884 defined, a fatal error is issued.  Otherwise, the return value is the
8885 value of the environment variable concatenated with the string.  For
8886 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
8887
8888 @smallexample
8889 %:getenv(TOPDIR /include)
8890 @end smallexample
8891
8892 expands to @file{/path/to/top/include}.
8893
8894 @item @code{if-exists}
8895 The @code{if-exists} spec function takes one argument, an absolute
8896 pathname to a file.  If the file exists, @code{if-exists} returns the
8897 pathname.  Here is a small example of its usage:
8898
8899 @smallexample
8900 *startfile:
8901 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
8902 @end smallexample
8903
8904 @item @code{if-exists-else}
8905 The @code{if-exists-else} spec function is similar to the @code{if-exists}
8906 spec function, except that it takes two arguments.  The first argument is
8907 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
8908 returns the pathname.  If it does not exist, it returns the second argument.
8909 This way, @code{if-exists-else} can be used to select one file or another,
8910 based on the existence of the first.  Here is a small example of its usage:
8911
8912 @smallexample
8913 *startfile:
8914 crt0%O%s %:if-exists(crti%O%s) \
8915 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
8916 @end smallexample
8917
8918 @item @code{replace-outfile}
8919 The @code{replace-outfile} spec function takes two arguments.  It looks for the
8920 first argument in the outfiles array and replaces it with the second argument.  Here
8921 is a small example of its usage:
8922
8923 @smallexample
8924 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
8925 @end smallexample
8926
8927 @item @code{print-asm-header}
8928 The @code{print-asm-header} function takes no arguments and simply
8929 prints a banner like:
8930
8931 @smallexample
8932 Assembler options
8933 =================
8934
8935 Use "-Wa,OPTION" to pass "OPTION" to the assembler.
8936 @end smallexample
8937
8938 It is used to separate compiler options from assembler options
8939 in the @option{--target-help} output.
8940 @end table
8941
8942 @item %@{@code{S}@}
8943 Substitutes the @code{-S} switch, if that switch was given to GCC@.
8944 If that switch was not specified, this substitutes nothing.  Note that
8945 the leading dash is omitted when specifying this option, and it is
8946 automatically inserted if the substitution is performed.  Thus the spec
8947 string @samp{%@{foo@}} would match the command-line option @option{-foo}
8948 and would output the command line option @option{-foo}.
8949
8950 @item %W@{@code{S}@}
8951 Like %@{@code{S}@} but mark last argument supplied within as a file to be
8952 deleted on failure.
8953
8954 @item %@{@code{S}*@}
8955 Substitutes all the switches specified to GCC whose names start
8956 with @code{-S}, but which also take an argument.  This is used for
8957 switches like @option{-o}, @option{-D}, @option{-I}, etc.
8958 GCC considers @option{-o foo} as being
8959 one switch whose names starts with @samp{o}.  %@{o*@} would substitute this
8960 text, including the space.  Thus two arguments would be generated.
8961
8962 @item %@{@code{S}*&@code{T}*@}
8963 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
8964 (the order of @code{S} and @code{T} in the spec is not significant).
8965 There can be any number of ampersand-separated variables; for each the
8966 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
8967
8968 @item %@{@code{S}:@code{X}@}
8969 Substitutes @code{X}, if the @samp{-S} switch was given to GCC@.
8970
8971 @item %@{!@code{S}:@code{X}@}
8972 Substitutes @code{X}, if the @samp{-S} switch was @emph{not} given to GCC@.
8973
8974 @item %@{@code{S}*:@code{X}@}
8975 Substitutes @code{X} if one or more switches whose names start with
8976 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
8977 once, no matter how many such switches appeared.  However, if @code{%*}
8978 appears somewhere in @code{X}, then @code{X} will be substituted once
8979 for each matching switch, with the @code{%*} replaced by the part of
8980 that switch that matched the @code{*}.
8981
8982 @item %@{.@code{S}:@code{X}@}
8983 Substitutes @code{X}, if processing a file with suffix @code{S}.
8984
8985 @item %@{!.@code{S}:@code{X}@}
8986 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
8987
8988 @item %@{,@code{S}:@code{X}@}
8989 Substitutes @code{X}, if processing a file for language @code{S}.
8990
8991 @item %@{!,@code{S}:@code{X}@}
8992 Substitutes @code{X}, if not processing a file for language @code{S}.
8993
8994 @item %@{@code{S}|@code{P}:@code{X}@}
8995 Substitutes @code{X} if either @code{-S} or @code{-P} was given to
8996 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
8997 @code{*} sequences as well, although they have a stronger binding than
8998 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
8999 alternatives must be starred, and only the first matching alternative
9000 is substituted.
9001
9002 For example, a spec string like this:
9003
9004 @smallexample
9005 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
9006 @end smallexample
9007
9008 will output the following command-line options from the following input
9009 command-line options:
9010
9011 @smallexample
9012 fred.c        -foo -baz
9013 jim.d         -bar -boggle
9014 -d fred.c     -foo -baz -boggle
9015 -d jim.d      -bar -baz -boggle
9016 @end smallexample
9017
9018 @item %@{S:X; T:Y; :D@}
9019
9020 If @code{S} was given to GCC, substitutes @code{X}; else if @code{T} was
9021 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
9022 be as many clauses as you need.  This may be combined with @code{.},
9023 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
9024
9025
9026 @end table
9027
9028 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
9029 construct may contain other nested @samp{%} constructs or spaces, or
9030 even newlines.  They are processed as usual, as described above.
9031 Trailing white space in @code{X} is ignored.  White space may also
9032 appear anywhere on the left side of the colon in these constructs,
9033 except between @code{.} or @code{*} and the corresponding word.
9034
9035 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
9036 handled specifically in these constructs.  If another value of
9037 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
9038 @option{-W} switch is found later in the command line, the earlier
9039 switch value is ignored, except with @{@code{S}*@} where @code{S} is
9040 just one letter, which passes all matching options.
9041
9042 The character @samp{|} at the beginning of the predicate text is used to
9043 indicate that a command should be piped to the following command, but
9044 only if @option{-pipe} is specified.
9045
9046 It is built into GCC which switches take arguments and which do not.
9047 (You might think it would be useful to generalize this to allow each
9048 compiler's spec to say which switches take arguments.  But this cannot
9049 be done in a consistent fashion.  GCC cannot even decide which input
9050 files have been specified without knowing which switches take arguments,
9051 and it must know which input files to compile in order to tell which
9052 compilers to run).
9053
9054 GCC also knows implicitly that arguments starting in @option{-l} are to be
9055 treated as compiler output files, and passed to the linker in their
9056 proper position among the other output files.
9057
9058 @c man begin OPTIONS
9059
9060 @node Target Options
9061 @section Specifying Target Machine and Compiler Version
9062 @cindex target options
9063 @cindex cross compiling
9064 @cindex specifying machine version
9065 @cindex specifying compiler version and target machine
9066 @cindex compiler version, specifying
9067 @cindex target machine, specifying
9068
9069 The usual way to run GCC is to run the executable called @file{gcc}, or
9070 @file{<machine>-gcc} when cross-compiling, or
9071 @file{<machine>-gcc-<version>} to run a version other than the one that
9072 was installed last.  Sometimes this is inconvenient, so GCC provides
9073 options that will switch to another cross-compiler or version.
9074
9075 @table @gcctabopt
9076 @item -b @var{machine}
9077 @opindex b
9078 The argument @var{machine} specifies the target machine for compilation.
9079
9080 The value to use for @var{machine} is the same as was specified as the
9081 machine type when configuring GCC as a cross-compiler.  For
9082 example, if a cross-compiler was configured with @samp{configure
9083 arm-elf}, meaning to compile for an arm processor with elf binaries,
9084 then you would specify @option{-b arm-elf} to run that cross compiler.
9085 Because there are other options beginning with @option{-b}, the
9086 configuration must contain a hyphen, or @option{-b} alone should be one
9087 argument followed by the configuration in the next argument.
9088
9089 @item -V @var{version}
9090 @opindex V
9091 The argument @var{version} specifies which version of GCC to run.
9092 This is useful when multiple versions are installed.  For example,
9093 @var{version} might be @samp{4.0}, meaning to run GCC version 4.0.
9094 @end table
9095
9096 The @option{-V} and @option{-b} options work by running the
9097 @file{<machine>-gcc-<version>} executable, so there's no real reason to
9098 use them if you can just run that directly.
9099
9100 @node Submodel Options
9101 @section Hardware Models and Configurations
9102 @cindex submodel options
9103 @cindex specifying hardware config
9104 @cindex hardware models and configurations, specifying
9105 @cindex machine dependent options
9106
9107 Earlier we discussed the standard option @option{-b} which chooses among
9108 different installed compilers for completely different target
9109 machines, such as VAX vs.@: 68000 vs.@: 80386.
9110
9111 In addition, each of these target machine types can have its own
9112 special options, starting with @samp{-m}, to choose among various
9113 hardware models or configurations---for example, 68010 vs 68020,
9114 floating coprocessor or none.  A single installed version of the
9115 compiler can compile for any model or configuration, according to the
9116 options specified.
9117
9118 Some configurations of the compiler also support additional special
9119 options, usually for compatibility with other compilers on the same
9120 platform.
9121
9122 @c This list is ordered alphanumerically by subsection name.
9123 @c It should be the same order and spelling as these options are listed
9124 @c in Machine Dependent Options
9125
9126 @menu
9127 * ARC Options::
9128 * ARM Options::
9129 * AVR Options::
9130 * Blackfin Options::
9131 * CRIS Options::
9132 * CRX Options::
9133 * Darwin Options::
9134 * DEC Alpha Options::
9135 * DEC Alpha/VMS Options::
9136 * FR30 Options::
9137 * FRV Options::
9138 * GNU/Linux Options::
9139 * H8/300 Options::
9140 * HPPA Options::
9141 * i386 and x86-64 Options::
9142 * i386 and x86-64 Windows Options::
9143 * IA-64 Options::
9144 * M32C Options::
9145 * M32R/D Options::
9146 * M680x0 Options::
9147 * M68hc1x Options::
9148 * MCore Options::
9149 * MeP Options::
9150 * MIPS Options::
9151 * MMIX Options::
9152 * MN10300 Options::
9153 * PDP-11 Options::
9154 * picoChip Options::
9155 * PowerPC Options::
9156 * RS/6000 and PowerPC Options::
9157 * S/390 and zSeries Options::
9158 * Score Options::
9159 * SH Options::
9160 * SPARC Options::
9161 * SPU Options::
9162 * System V Options::
9163 * V850 Options::
9164 * VAX Options::
9165 * VxWorks Options::
9166 * x86-64 Options::
9167 * Xstormy16 Options::
9168 * Xtensa Options::
9169 * zSeries Options::
9170 @end menu
9171
9172 @node ARC Options
9173 @subsection ARC Options
9174 @cindex ARC Options
9175
9176 These options are defined for ARC implementations:
9177
9178 @table @gcctabopt
9179 @item -EL
9180 @opindex EL
9181 Compile code for little endian mode.  This is the default.
9182
9183 @item -EB
9184 @opindex EB
9185 Compile code for big endian mode.
9186
9187 @item -mmangle-cpu
9188 @opindex mmangle-cpu
9189 Prepend the name of the cpu to all public symbol names.
9190 In multiple-processor systems, there are many ARC variants with different
9191 instruction and register set characteristics.  This flag prevents code
9192 compiled for one cpu to be linked with code compiled for another.
9193 No facility exists for handling variants that are ``almost identical''.
9194 This is an all or nothing option.
9195
9196 @item -mcpu=@var{cpu}
9197 @opindex mcpu
9198 Compile code for ARC variant @var{cpu}.
9199 Which variants are supported depend on the configuration.
9200 All variants support @option{-mcpu=base}, this is the default.
9201
9202 @item -mtext=@var{text-section}
9203 @itemx -mdata=@var{data-section}
9204 @itemx -mrodata=@var{readonly-data-section}
9205 @opindex mtext
9206 @opindex mdata
9207 @opindex mrodata
9208 Put functions, data, and readonly data in @var{text-section},
9209 @var{data-section}, and @var{readonly-data-section} respectively
9210 by default.  This can be overridden with the @code{section} attribute.
9211 @xref{Variable Attributes}.
9212
9213 @item -mfix-cortex-m3-ldrd
9214 @opindex mfix-cortex-m3-ldrd
9215 Some Cortex-M3 cores can cause data corruption when @code{ldrd} instructions
9216 with overlapping destination and base registers are used.  This option avoids
9217 generating these instructions.  This option is enabled by default when
9218 @option{-mcpu=cortex-m3} is specified.
9219
9220 @end table
9221
9222 @node ARM Options
9223 @subsection ARM Options
9224 @cindex ARM options
9225
9226 These @samp{-m} options are defined for Advanced RISC Machines (ARM)
9227 architectures:
9228
9229 @table @gcctabopt
9230 @item -mabi=@var{name}
9231 @opindex mabi
9232 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
9233 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
9234
9235 @item -mapcs-frame
9236 @opindex mapcs-frame
9237 Generate a stack frame that is compliant with the ARM Procedure Call
9238 Standard for all functions, even if this is not strictly necessary for
9239 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
9240 with this option will cause the stack frames not to be generated for
9241 leaf functions.  The default is @option{-mno-apcs-frame}.
9242
9243 @item -mapcs
9244 @opindex mapcs
9245 This is a synonym for @option{-mapcs-frame}.
9246
9247 @ignore
9248 @c not currently implemented
9249 @item -mapcs-stack-check
9250 @opindex mapcs-stack-check
9251 Generate code to check the amount of stack space available upon entry to
9252 every function (that actually uses some stack space).  If there is
9253 insufficient space available then either the function
9254 @samp{__rt_stkovf_split_small} or @samp{__rt_stkovf_split_big} will be
9255 called, depending upon the amount of stack space required.  The run time
9256 system is required to provide these functions.  The default is
9257 @option{-mno-apcs-stack-check}, since this produces smaller code.
9258
9259 @c not currently implemented
9260 @item -mapcs-float
9261 @opindex mapcs-float
9262 Pass floating point arguments using the float point registers.  This is
9263 one of the variants of the APCS@.  This option is recommended if the
9264 target hardware has a floating point unit or if a lot of floating point
9265 arithmetic is going to be performed by the code.  The default is
9266 @option{-mno-apcs-float}, since integer only code is slightly increased in
9267 size if @option{-mapcs-float} is used.
9268
9269 @c not currently implemented
9270 @item -mapcs-reentrant
9271 @opindex mapcs-reentrant
9272 Generate reentrant, position independent code.  The default is
9273 @option{-mno-apcs-reentrant}.
9274 @end ignore
9275
9276 @item -mthumb-interwork
9277 @opindex mthumb-interwork
9278 Generate code which supports calling between the ARM and Thumb
9279 instruction sets.  Without this option the two instruction sets cannot
9280 be reliably used inside one program.  The default is
9281 @option{-mno-thumb-interwork}, since slightly larger code is generated
9282 when @option{-mthumb-interwork} is specified.
9283
9284 @item -mno-sched-prolog
9285 @opindex mno-sched-prolog
9286 Prevent the reordering of instructions in the function prolog, or the
9287 merging of those instruction with the instructions in the function's
9288 body.  This means that all functions will start with a recognizable set
9289 of instructions (or in fact one of a choice from a small set of
9290 different function prologues), and this information can be used to
9291 locate the start if functions inside an executable piece of code.  The
9292 default is @option{-msched-prolog}.
9293
9294 @item -mfloat-abi=@var{name}
9295 @opindex mfloat-abi
9296 Specifies which floating-point ABI to use.  Permissible values
9297 are: @samp{soft}, @samp{softfp} and @samp{hard}.
9298
9299 Specifying @samp{soft} causes GCC to generate output containing
9300 library calls for floating-point operations.
9301 @samp{softfp} allows the generation of code using hardware floating-point
9302 instructions, but still uses the soft-float calling conventions.
9303 @samp{hard} allows generation of floating-point instructions
9304 and uses FPU-specific calling conventions.
9305
9306 Using @option{-mfloat-abi=hard} with VFP coprocessors is not supported.
9307 Use @option{-mfloat-abi=softfp} with the appropriate @option{-mfpu} option
9308 to allow the compiler to generate code that makes use of the hardware
9309 floating-point capabilities for these CPUs.
9310
9311 The default depends on the specific target configuration.  Note that
9312 the hard-float and soft-float ABIs are not link-compatible; you must
9313 compile your entire program with the same ABI, and link with a
9314 compatible set of libraries.
9315
9316 @item -mhard-float
9317 @opindex mhard-float
9318 Equivalent to @option{-mfloat-abi=hard}.
9319
9320 @item -msoft-float
9321 @opindex msoft-float
9322 Equivalent to @option{-mfloat-abi=soft}.
9323
9324 @item -mlittle-endian
9325 @opindex mlittle-endian
9326 Generate code for a processor running in little-endian mode.  This is
9327 the default for all standard configurations.
9328
9329 @item -mbig-endian
9330 @opindex mbig-endian
9331 Generate code for a processor running in big-endian mode; the default is
9332 to compile code for a little-endian processor.
9333
9334 @item -mwords-little-endian
9335 @opindex mwords-little-endian
9336 This option only applies when generating code for big-endian processors.
9337 Generate code for a little-endian word order but a big-endian byte
9338 order.  That is, a byte order of the form @samp{32107654}.  Note: this
9339 option should only be used if you require compatibility with code for
9340 big-endian ARM processors generated by versions of the compiler prior to
9341 2.8.
9342
9343 @item -mcpu=@var{name}
9344 @opindex mcpu
9345 This specifies the name of the target ARM processor.  GCC uses this name
9346 to determine what kind of instructions it can emit when generating
9347 assembly code.  Permissible names are: @samp{arm2}, @samp{arm250},
9348 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
9349 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
9350 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
9351 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
9352 @samp{arm720},
9353 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
9354 @samp{arm710t}, @samp{arm720t}, @samp{arm740t},
9355 @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
9356 @samp{strongarm1110},
9357 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
9358 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
9359 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
9360 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
9361 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
9362 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
9363 @samp{arm1156t2-s}, @samp{arm1156t2f-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
9364 @samp{cortex-a8}, @samp{cortex-a9},
9365 @samp{cortex-r4}, @samp{cortex-r4f}, @samp{cortex-m3},
9366 @samp{cortex-m1},
9367 @samp{cortex-m0},
9368 @samp{xscale}, @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312}.
9369
9370 @item -mtune=@var{name}
9371 @opindex mtune
9372 This option is very similar to the @option{-mcpu=} option, except that
9373 instead of specifying the actual target processor type, and hence
9374 restricting which instructions can be used, it specifies that GCC should
9375 tune the performance of the code as if the target were of the type
9376 specified in this option, but still choosing the instructions that it
9377 will generate based on the cpu specified by a @option{-mcpu=} option.
9378 For some ARM implementations better performance can be obtained by using
9379 this option.
9380
9381 @item -march=@var{name}
9382 @opindex march
9383 This specifies the name of the target ARM architecture.  GCC uses this
9384 name to determine what kind of instructions it can emit when generating
9385 assembly code.  This option can be used in conjunction with or instead
9386 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
9387 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
9388 @samp{armv5}, @samp{armv5t}, @samp{armv5e}, @samp{armv5te},
9389 @samp{armv6}, @samp{armv6j},
9390 @samp{armv6t2}, @samp{armv6z}, @samp{armv6zk}, @samp{armv6-m},
9391 @samp{armv7}, @samp{armv7-a}, @samp{armv7-r}, @samp{armv7-m},
9392 @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312}.
9393
9394 @item -mfpu=@var{name}
9395 @itemx -mfpe=@var{number}
9396 @itemx -mfp=@var{number}
9397 @opindex mfpu
9398 @opindex mfpe
9399 @opindex mfp
9400 This specifies what floating point hardware (or hardware emulation) is
9401 available on the target.  Permissible names are: @samp{fpa}, @samp{fpe2},
9402 @samp{fpe3}, @samp{maverick}, @samp{vfp}, @samp{vfpv3}, @samp{vfpv3-d16},
9403 @samp{neon}, and @samp{neon-fp16}.  @option{-mfp} and @option{-mfpe}
9404 are synonyms for @option{-mfpu}=@samp{fpe}@var{number}, for compatibility
9405 with older versions of GCC@.
9406
9407 If @option{-msoft-float} is specified this specifies the format of
9408 floating point values.
9409
9410 @item -mfp16-format=@var{name}
9411 @opindex mfp16-format
9412 Specify the format of the @code{__fp16} half-precision floating-point type.
9413 Permissible names are @samp{none}, @samp{ieee}, and @samp{alternative};
9414 the default is @samp{none}, in which case the @code{__fp16} type is not
9415 defined.  @xref{Half-Precision}, for more information.
9416
9417 @item -mstructure-size-boundary=@var{n}
9418 @opindex mstructure-size-boundary
9419 The size of all structures and unions will be rounded up to a multiple
9420 of the number of bits set by this option.  Permissible values are 8, 32
9421 and 64.  The default value varies for different toolchains.  For the COFF
9422 targeted toolchain the default value is 8.  A value of 64 is only allowed
9423 if the underlying ABI supports it.
9424
9425 Specifying the larger number can produce faster, more efficient code, but
9426 can also increase the size of the program.  Different values are potentially
9427 incompatible.  Code compiled with one value cannot necessarily expect to
9428 work with code or libraries compiled with another value, if they exchange
9429 information using structures or unions.
9430
9431 @item -mabort-on-noreturn
9432 @opindex mabort-on-noreturn
9433 Generate a call to the function @code{abort} at the end of a
9434 @code{noreturn} function.  It will be executed if the function tries to
9435 return.
9436
9437 @item -mlong-calls
9438 @itemx -mno-long-calls
9439 @opindex mlong-calls
9440 @opindex mno-long-calls
9441 Tells the compiler to perform function calls by first loading the
9442 address of the function into a register and then performing a subroutine
9443 call on this register.  This switch is needed if the target function
9444 will lie outside of the 64 megabyte addressing range of the offset based
9445 version of subroutine call instruction.
9446
9447 Even if this switch is enabled, not all function calls will be turned
9448 into long calls.  The heuristic is that static functions, functions
9449 which have the @samp{short-call} attribute, functions that are inside
9450 the scope of a @samp{#pragma no_long_calls} directive and functions whose
9451 definitions have already been compiled within the current compilation
9452 unit, will not be turned into long calls.  The exception to this rule is
9453 that weak function definitions, functions with the @samp{long-call}
9454 attribute or the @samp{section} attribute, and functions that are within
9455 the scope of a @samp{#pragma long_calls} directive, will always be
9456 turned into long calls.
9457
9458 This feature is not enabled by default.  Specifying
9459 @option{-mno-long-calls} will restore the default behavior, as will
9460 placing the function calls within the scope of a @samp{#pragma
9461 long_calls_off} directive.  Note these switches have no effect on how
9462 the compiler generates code to handle function calls via function
9463 pointers.
9464
9465 @item -msingle-pic-base
9466 @opindex msingle-pic-base
9467 Treat the register used for PIC addressing as read-only, rather than
9468 loading it in the prologue for each function.  The run-time system is
9469 responsible for initializing this register with an appropriate value
9470 before execution begins.
9471
9472 @item -mpic-register=@var{reg}
9473 @opindex mpic-register
9474 Specify the register to be used for PIC addressing.  The default is R10
9475 unless stack-checking is enabled, when R9 is used.
9476
9477 @item -mcirrus-fix-invalid-insns
9478 @opindex mcirrus-fix-invalid-insns
9479 @opindex mno-cirrus-fix-invalid-insns
9480 Insert NOPs into the instruction stream to in order to work around
9481 problems with invalid Maverick instruction combinations.  This option
9482 is only valid if the @option{-mcpu=ep9312} option has been used to
9483 enable generation of instructions for the Cirrus Maverick floating
9484 point co-processor.  This option is not enabled by default, since the
9485 problem is only present in older Maverick implementations.  The default
9486 can be re-enabled by use of the @option{-mno-cirrus-fix-invalid-insns}
9487 switch.
9488
9489 @item -mpoke-function-name
9490 @opindex mpoke-function-name
9491 Write the name of each function into the text section, directly
9492 preceding the function prologue.  The generated code is similar to this:
9493
9494 @smallexample
9495      t0
9496          .ascii "arm_poke_function_name", 0
9497          .align
9498      t1
9499          .word 0xff000000 + (t1 - t0)
9500      arm_poke_function_name
9501          mov     ip, sp
9502          stmfd   sp!, @{fp, ip, lr, pc@}
9503          sub     fp, ip, #4
9504 @end smallexample
9505
9506 When performing a stack backtrace, code can inspect the value of
9507 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
9508 location @code{pc - 12} and the top 8 bits are set, then we know that
9509 there is a function name embedded immediately preceding this location
9510 and has length @code{((pc[-3]) & 0xff000000)}.
9511
9512 @item -mthumb
9513 @opindex mthumb
9514 Generate code for the Thumb instruction set.  The default is to
9515 use the 32-bit ARM instruction set.
9516 This option automatically enables either 16-bit Thumb-1 or
9517 mixed 16/32-bit Thumb-2 instructions based on the @option{-mcpu=@var{name}}
9518 and @option{-march=@var{name}} options.  This option is not passed to the
9519 assembler. If you want to force assembler files to be interpreted as Thumb code,
9520 either add a @samp{.thumb} directive to the source or pass the @option{-mthumb}
9521 option directly to the assembler by prefixing it with @option{-Wa}.
9522
9523 @item -mtpcs-frame
9524 @opindex mtpcs-frame
9525 Generate a stack frame that is compliant with the Thumb Procedure Call
9526 Standard for all non-leaf functions.  (A leaf function is one that does
9527 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
9528
9529 @item -mtpcs-leaf-frame
9530 @opindex mtpcs-leaf-frame
9531 Generate a stack frame that is compliant with the Thumb Procedure Call
9532 Standard for all leaf functions.  (A leaf function is one that does
9533 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
9534
9535 @item -mcallee-super-interworking
9536 @opindex mcallee-super-interworking
9537 Gives all externally visible functions in the file being compiled an ARM
9538 instruction set header which switches to Thumb mode before executing the
9539 rest of the function.  This allows these functions to be called from
9540 non-interworking code.  This option is not valid in AAPCS configurations
9541 because interworking is enabled by default.
9542
9543 @item -mcaller-super-interworking
9544 @opindex mcaller-super-interworking
9545 Allows calls via function pointers (including virtual functions) to
9546 execute correctly regardless of whether the target code has been
9547 compiled for interworking or not.  There is a small overhead in the cost
9548 of executing a function pointer if this option is enabled.  This option
9549 is not valid in AAPCS configurations because interworking is enabled
9550 by default.
9551
9552 @item -mtp=@var{name}
9553 @opindex mtp
9554 Specify the access model for the thread local storage pointer.  The valid
9555 models are @option{soft}, which generates calls to @code{__aeabi_read_tp},
9556 @option{cp15}, which fetches the thread pointer from @code{cp15} directly
9557 (supported in the arm6k architecture), and @option{auto}, which uses the
9558 best available method for the selected processor.  The default setting is
9559 @option{auto}.
9560
9561 @item -mword-relocations
9562 @opindex mword-relocations
9563 Only generate absolute relocations on word sized values (i.e. R_ARM_ABS32).
9564 This is enabled by default on targets (uClinux, SymbianOS) where the runtime
9565 loader imposes this restriction, and when @option{-fpic} or @option{-fPIC}
9566 is specified.
9567
9568 @end table
9569
9570 @node AVR Options
9571 @subsection AVR Options
9572 @cindex AVR Options
9573
9574 These options are defined for AVR implementations:
9575
9576 @table @gcctabopt
9577 @item -mmcu=@var{mcu}
9578 @opindex mmcu
9579 Specify ATMEL AVR instruction set or MCU type.
9580
9581 Instruction set avr1 is for the minimal AVR core, not supported by the C
9582 compiler, only for assembler programs (MCU types: at90s1200, attiny10,
9583 attiny11, attiny12, attiny15, attiny28).
9584
9585 Instruction set avr2 (default) is for the classic AVR core with up to
9586 8K program memory space (MCU types: at90s2313, at90s2323, attiny22,
9587 at90s2333, at90s2343, at90s4414, at90s4433, at90s4434, at90s8515,
9588 at90c8534, at90s8535).
9589
9590 Instruction set avr3 is for the classic AVR core with up to 128K program
9591 memory space (MCU types: atmega103, atmega603, at43usb320, at76c711).
9592
9593 Instruction set avr4 is for the enhanced AVR core with up to 8K program
9594 memory space (MCU types: atmega8, atmega83, atmega85).
9595
9596 Instruction set avr5 is for the enhanced AVR core with up to 128K program
9597 memory space (MCU types: atmega16, atmega161, atmega163, atmega32, atmega323,
9598 atmega64, atmega128, at43usb355, at94k).
9599
9600 @item -msize
9601 @opindex msize
9602 Output instruction sizes to the asm file.
9603
9604 @item -minit-stack=@var{N}
9605 @opindex minit-stack
9606 Specify the initial stack address, which may be a symbol or numeric value,
9607 @samp{__stack} is the default.
9608
9609 @item -mno-interrupts
9610 @opindex mno-interrupts
9611 Generated code is not compatible with hardware interrupts.
9612 Code size will be smaller.
9613
9614 @item -mcall-prologues
9615 @opindex mcall-prologues
9616 Functions prologues/epilogues expanded as call to appropriate
9617 subroutines.  Code size will be smaller.
9618
9619 @item -mtiny-stack
9620 @opindex mtiny-stack
9621 Change only the low 8 bits of the stack pointer.
9622
9623 @item -mint8
9624 @opindex mint8
9625 Assume int to be 8 bit integer.  This affects the sizes of all types: A
9626 char will be 1 byte, an int will be 1 byte, a long will be 2 bytes
9627 and long long will be 4 bytes.  Please note that this option does not
9628 comply to the C standards, but it will provide you with smaller code
9629 size.
9630 @end table
9631
9632 @node Blackfin Options
9633 @subsection Blackfin Options
9634 @cindex Blackfin Options
9635
9636 @table @gcctabopt
9637 @item -mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]}
9638 @opindex mcpu=
9639 Specifies the name of the target Blackfin processor.  Currently, @var{cpu}
9640 can be one of @samp{bf512}, @samp{bf514}, @samp{bf516}, @samp{bf518},
9641 @samp{bf522}, @samp{bf523}, @samp{bf524}, @samp{bf525}, @samp{bf526},
9642 @samp{bf527}, @samp{bf531}, @samp{bf532}, @samp{bf533},
9643 @samp{bf534}, @samp{bf536}, @samp{bf537}, @samp{bf538}, @samp{bf539},
9644 @samp{bf542}, @samp{bf544}, @samp{bf547}, @samp{bf548}, @samp{bf549},
9645 @samp{bf561}.
9646 The optional @var{sirevision} specifies the silicon revision of the target
9647 Blackfin processor.  Any workarounds available for the targeted silicon revision
9648 will be enabled.  If @var{sirevision} is @samp{none}, no workarounds are enabled.
9649 If @var{sirevision} is @samp{any}, all workarounds for the targeted processor
9650 will be enabled.  The @code{__SILICON_REVISION__} macro is defined to two
9651 hexadecimal digits representing the major and minor numbers in the silicon
9652 revision.  If @var{sirevision} is @samp{none}, the @code{__SILICON_REVISION__}
9653 is not defined.  If @var{sirevision} is @samp{any}, the
9654 @code{__SILICON_REVISION__} is defined to be @code{0xffff}.
9655 If this optional @var{sirevision} is not used, GCC assumes the latest known
9656 silicon revision of the targeted Blackfin processor.
9657
9658 Support for @samp{bf561} is incomplete.  For @samp{bf561},
9659 Only the processor macro is defined.
9660 Without this option, @samp{bf532} is used as the processor by default.
9661 The corresponding predefined processor macros for @var{cpu} is to
9662 be defined.  And for @samp{bfin-elf} toolchain, this causes the hardware BSP
9663 provided by libgloss to be linked in if @option{-msim} is not given.
9664
9665 @item -msim
9666 @opindex msim
9667 Specifies that the program will be run on the simulator.  This causes
9668 the simulator BSP provided by libgloss to be linked in.  This option
9669 has effect only for @samp{bfin-elf} toolchain.
9670 Certain other options, such as @option{-mid-shared-library} and
9671 @option{-mfdpic}, imply @option{-msim}.
9672
9673 @item -momit-leaf-frame-pointer
9674 @opindex momit-leaf-frame-pointer
9675 Don't keep the frame pointer in a register for leaf functions.  This
9676 avoids the instructions to save, set up and restore frame pointers and
9677 makes an extra register available in leaf functions.  The option
9678 @option{-fomit-frame-pointer} removes the frame pointer for all functions
9679 which might make debugging harder.
9680
9681 @item -mspecld-anomaly
9682 @opindex mspecld-anomaly
9683 When enabled, the compiler will ensure that the generated code does not
9684 contain speculative loads after jump instructions. If this option is used,
9685 @code{__WORKAROUND_SPECULATIVE_LOADS} is defined.
9686
9687 @item -mno-specld-anomaly
9688 @opindex mno-specld-anomaly
9689 Don't generate extra code to prevent speculative loads from occurring.
9690
9691 @item -mcsync-anomaly
9692 @opindex mcsync-anomaly
9693 When enabled, the compiler will ensure that the generated code does not
9694 contain CSYNC or SSYNC instructions too soon after conditional branches.
9695 If this option is used, @code{__WORKAROUND_SPECULATIVE_SYNCS} is defined.
9696
9697 @item -mno-csync-anomaly
9698 @opindex mno-csync-anomaly
9699 Don't generate extra code to prevent CSYNC or SSYNC instructions from
9700 occurring too soon after a conditional branch.
9701
9702 @item -mlow-64k
9703 @opindex mlow-64k
9704 When enabled, the compiler is free to take advantage of the knowledge that
9705 the entire program fits into the low 64k of memory.
9706
9707 @item -mno-low-64k
9708 @opindex mno-low-64k
9709 Assume that the program is arbitrarily large.  This is the default.
9710
9711 @item -mstack-check-l1
9712 @opindex mstack-check-l1
9713 Do stack checking using information placed into L1 scratchpad memory by the
9714 uClinux kernel.
9715
9716 @item -mid-shared-library
9717 @opindex mid-shared-library
9718 Generate code that supports shared libraries via the library ID method.
9719 This allows for execute in place and shared libraries in an environment
9720 without virtual memory management.  This option implies @option{-fPIC}.
9721 With a @samp{bfin-elf} target, this option implies @option{-msim}.
9722
9723 @item -mno-id-shared-library
9724 @opindex mno-id-shared-library
9725 Generate code that doesn't assume ID based shared libraries are being used.
9726 This is the default.
9727
9728 @item -mleaf-id-shared-library
9729 @opindex mleaf-id-shared-library
9730 Generate code that supports shared libraries via the library ID method,
9731 but assumes that this library or executable won't link against any other
9732 ID shared libraries.  That allows the compiler to use faster code for jumps
9733 and calls.
9734
9735 @item -mno-leaf-id-shared-library
9736 @opindex mno-leaf-id-shared-library
9737 Do not assume that the code being compiled won't link against any ID shared
9738 libraries.  Slower code will be generated for jump and call insns.
9739
9740 @item -mshared-library-id=n
9741 @opindex mshared-library-id
9742 Specified the identification number of the ID based shared library being
9743 compiled.  Specifying a value of 0 will generate more compact code, specifying
9744 other values will force the allocation of that number to the current
9745 library but is no more space or time efficient than omitting this option.
9746
9747 @item -msep-data
9748 @opindex msep-data
9749 Generate code that allows the data segment to be located in a different
9750 area of memory from the text segment.  This allows for execute in place in
9751 an environment without virtual memory management by eliminating relocations
9752 against the text section.
9753
9754 @item -mno-sep-data
9755 @opindex mno-sep-data
9756 Generate code that assumes that the data segment follows the text segment.
9757 This is the default.
9758
9759 @item -mlong-calls
9760 @itemx -mno-long-calls
9761 @opindex mlong-calls
9762 @opindex mno-long-calls
9763 Tells the compiler to perform function calls by first loading the
9764 address of the function into a register and then performing a subroutine
9765 call on this register.  This switch is needed if the target function
9766 will lie outside of the 24 bit addressing range of the offset based
9767 version of subroutine call instruction.
9768
9769 This feature is not enabled by default.  Specifying
9770 @option{-mno-long-calls} will restore the default behavior.  Note these
9771 switches have no effect on how the compiler generates code to handle
9772 function calls via function pointers.
9773
9774 @item -mfast-fp
9775 @opindex mfast-fp
9776 Link with the fast floating-point library. This library relaxes some of
9777 the IEEE floating-point standard's rules for checking inputs against
9778 Not-a-Number (NAN), in the interest of performance.
9779
9780 @item -minline-plt
9781 @opindex minline-plt
9782 Enable inlining of PLT entries in function calls to functions that are
9783 not known to bind locally.  It has no effect without @option{-mfdpic}.
9784
9785 @item -mmulticore
9786 @opindex mmulticore
9787 Build standalone application for multicore Blackfin processor. Proper
9788 start files and link scripts will be used to support multicore.
9789 This option defines @code{__BFIN_MULTICORE}. It can only be used with
9790 @option{-mcpu=bf561@r{[}-@var{sirevision}@r{]}}. It can be used with
9791 @option{-mcorea} or @option{-mcoreb}. If it's used without
9792 @option{-mcorea} or @option{-mcoreb}, single application/dual core
9793 programming model is used. In this model, the main function of Core B
9794 should be named as coreb_main. If it's used with @option{-mcorea} or
9795 @option{-mcoreb}, one application per core programming model is used.
9796 If this option is not used, single core application programming
9797 model is used.
9798
9799 @item -mcorea
9800 @opindex mcorea
9801 Build standalone application for Core A of BF561 when using
9802 one application per core programming model. Proper start files
9803 and link scripts will be used to support Core A. This option
9804 defines @code{__BFIN_COREA}. It must be used with @option{-mmulticore}.
9805
9806 @item -mcoreb
9807 @opindex mcoreb
9808 Build standalone application for Core B of BF561 when using
9809 one application per core programming model. Proper start files
9810 and link scripts will be used to support Core B. This option
9811 defines @code{__BFIN_COREB}. When this option is used, coreb_main
9812 should be used instead of main. It must be used with
9813 @option{-mmulticore}.
9814
9815 @item -msdram
9816 @opindex msdram
9817 Build standalone application for SDRAM. Proper start files and
9818 link scripts will be used to put the application into SDRAM.
9819 Loader should initialize SDRAM before loading the application
9820 into SDRAM. This option defines @code{__BFIN_SDRAM}.
9821
9822 @item -micplb
9823 @opindex micplb
9824 Assume that ICPLBs are enabled at runtime.  This has an effect on certain
9825 anomaly workarounds.  For Linux targets, the default is to assume ICPLBs
9826 are enabled; for standalone applications the default is off.
9827 @end table
9828
9829 @node CRIS Options
9830 @subsection CRIS Options
9831 @cindex CRIS Options
9832
9833 These options are defined specifically for the CRIS ports.
9834
9835 @table @gcctabopt
9836 @item -march=@var{architecture-type}
9837 @itemx -mcpu=@var{architecture-type}
9838 @opindex march
9839 @opindex mcpu
9840 Generate code for the specified architecture.  The choices for
9841 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
9842 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
9843 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
9844 @samp{v10}.
9845
9846 @item -mtune=@var{architecture-type}
9847 @opindex mtune
9848 Tune to @var{architecture-type} everything applicable about the generated
9849 code, except for the ABI and the set of available instructions.  The
9850 choices for @var{architecture-type} are the same as for
9851 @option{-march=@var{architecture-type}}.
9852
9853 @item -mmax-stack-frame=@var{n}
9854 @opindex mmax-stack-frame
9855 Warn when the stack frame of a function exceeds @var{n} bytes.
9856
9857 @item -metrax4
9858 @itemx -metrax100
9859 @opindex metrax4
9860 @opindex metrax100
9861 The options @option{-metrax4} and @option{-metrax100} are synonyms for
9862 @option{-march=v3} and @option{-march=v8} respectively.
9863
9864 @item -mmul-bug-workaround
9865 @itemx -mno-mul-bug-workaround
9866 @opindex mmul-bug-workaround
9867 @opindex mno-mul-bug-workaround
9868 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
9869 models where it applies.  This option is active by default.
9870
9871 @item -mpdebug
9872 @opindex mpdebug
9873 Enable CRIS-specific verbose debug-related information in the assembly
9874 code.  This option also has the effect to turn off the @samp{#NO_APP}
9875 formatted-code indicator to the assembler at the beginning of the
9876 assembly file.
9877
9878 @item -mcc-init
9879 @opindex mcc-init
9880 Do not use condition-code results from previous instruction; always emit
9881 compare and test instructions before use of condition codes.
9882
9883 @item -mno-side-effects
9884 @opindex mno-side-effects
9885 Do not emit instructions with side-effects in addressing modes other than
9886 post-increment.
9887
9888 @item -mstack-align
9889 @itemx -mno-stack-align
9890 @itemx -mdata-align
9891 @itemx -mno-data-align
9892 @itemx -mconst-align
9893 @itemx -mno-const-align
9894 @opindex mstack-align
9895 @opindex mno-stack-align
9896 @opindex mdata-align
9897 @opindex mno-data-align
9898 @opindex mconst-align
9899 @opindex mno-const-align
9900 These options (no-options) arranges (eliminate arrangements) for the
9901 stack-frame, individual data and constants to be aligned for the maximum
9902 single data access size for the chosen CPU model.  The default is to
9903 arrange for 32-bit alignment.  ABI details such as structure layout are
9904 not affected by these options.
9905
9906 @item -m32-bit
9907 @itemx -m16-bit
9908 @itemx -m8-bit
9909 @opindex m32-bit
9910 @opindex m16-bit
9911 @opindex m8-bit
9912 Similar to the stack- data- and const-align options above, these options
9913 arrange for stack-frame, writable data and constants to all be 32-bit,
9914 16-bit or 8-bit aligned.  The default is 32-bit alignment.
9915
9916 @item -mno-prologue-epilogue
9917 @itemx -mprologue-epilogue
9918 @opindex mno-prologue-epilogue
9919 @opindex mprologue-epilogue
9920 With @option{-mno-prologue-epilogue}, the normal function prologue and
9921 epilogue that sets up the stack-frame are omitted and no return
9922 instructions or return sequences are generated in the code.  Use this
9923 option only together with visual inspection of the compiled code: no
9924 warnings or errors are generated when call-saved registers must be saved,
9925 or storage for local variable needs to be allocated.
9926
9927 @item -mno-gotplt
9928 @itemx -mgotplt
9929 @opindex mno-gotplt
9930 @opindex mgotplt
9931 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
9932 instruction sequences that load addresses for functions from the PLT part
9933 of the GOT rather than (traditional on other architectures) calls to the
9934 PLT@.  The default is @option{-mgotplt}.
9935
9936 @item -melf
9937 @opindex melf
9938 Legacy no-op option only recognized with the cris-axis-elf and
9939 cris-axis-linux-gnu targets.
9940
9941 @item -mlinux
9942 @opindex mlinux
9943 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
9944
9945 @item -sim
9946 @opindex sim
9947 This option, recognized for the cris-axis-elf arranges
9948 to link with input-output functions from a simulator library.  Code,
9949 initialized data and zero-initialized data are allocated consecutively.
9950
9951 @item -sim2
9952 @opindex sim2
9953 Like @option{-sim}, but pass linker options to locate initialized data at
9954 0x40000000 and zero-initialized data at 0x80000000.
9955 @end table
9956
9957 @node CRX Options
9958 @subsection CRX Options
9959 @cindex CRX Options
9960
9961 These options are defined specifically for the CRX ports.
9962
9963 @table @gcctabopt
9964
9965 @item -mmac
9966 @opindex mmac
9967 Enable the use of multiply-accumulate instructions. Disabled by default.
9968
9969 @item -mpush-args
9970 @opindex mpush-args
9971 Push instructions will be used to pass outgoing arguments when functions
9972 are called. Enabled by default.
9973 @end table
9974
9975 @node Darwin Options
9976 @subsection Darwin Options
9977 @cindex Darwin options
9978
9979 These options are defined for all architectures running the Darwin operating
9980 system.
9981
9982 FSF GCC on Darwin does not create ``fat'' object files; it will create
9983 an object file for the single architecture that it was built to
9984 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
9985 @option{-arch} options are used; it does so by running the compiler or
9986 linker multiple times and joining the results together with
9987 @file{lipo}.
9988
9989 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
9990 @samp{i686}) is determined by the flags that specify the ISA
9991 that GCC is targetting, like @option{-mcpu} or @option{-march}.  The
9992 @option{-force_cpusubtype_ALL} option can be used to override this.
9993
9994 The Darwin tools vary in their behavior when presented with an ISA
9995 mismatch.  The assembler, @file{as}, will only permit instructions to
9996 be used that are valid for the subtype of the file it is generating,
9997 so you cannot put 64-bit instructions in a @samp{ppc750} object file.
9998 The linker for shared libraries, @file{/usr/bin/libtool}, will fail
9999 and print an error if asked to create a shared library with a less
10000 restrictive subtype than its input files (for instance, trying to put
10001 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
10002 for executables, @file{ld}, will quietly give the executable the most
10003 restrictive subtype of any of its input files.
10004
10005 @table @gcctabopt
10006 @item -F@var{dir}
10007 @opindex F
10008 Add the framework directory @var{dir} to the head of the list of
10009 directories to be searched for header files.  These directories are
10010 interleaved with those specified by @option{-I} options and are
10011 scanned in a left-to-right order.
10012
10013 A framework directory is a directory with frameworks in it.  A
10014 framework is a directory with a @samp{"Headers"} and/or
10015 @samp{"PrivateHeaders"} directory contained directly in it that ends
10016 in @samp{".framework"}.  The name of a framework is the name of this
10017 directory excluding the @samp{".framework"}.  Headers associated with
10018 the framework are found in one of those two directories, with
10019 @samp{"Headers"} being searched first.  A subframework is a framework
10020 directory that is in a framework's @samp{"Frameworks"} directory.
10021 Includes of subframework headers can only appear in a header of a
10022 framework that contains the subframework, or in a sibling subframework
10023 header.  Two subframeworks are siblings if they occur in the same
10024 framework.  A subframework should not have the same name as a
10025 framework, a warning will be issued if this is violated.  Currently a
10026 subframework cannot have subframeworks, in the future, the mechanism
10027 may be extended to support this.  The standard frameworks can be found
10028 in @samp{"/System/Library/Frameworks"} and
10029 @samp{"/Library/Frameworks"}.  An example include looks like
10030 @code{#include <Framework/header.h>}, where @samp{Framework} denotes
10031 the name of the framework and header.h is found in the
10032 @samp{"PrivateHeaders"} or @samp{"Headers"} directory.
10033
10034 @item -iframework@var{dir}
10035 @opindex iframework
10036 Like @option{-F} except the directory is a treated as a system
10037 directory.  The main difference between this @option{-iframework} and
10038 @option{-F} is that with @option{-iframework} the compiler does not
10039 warn about constructs contained within header files found via
10040 @var{dir}.  This option is valid only for the C family of languages.
10041
10042 @item -gused
10043 @opindex gused
10044 Emit debugging information for symbols that are used.  For STABS
10045 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
10046 This is by default ON@.
10047
10048 @item -gfull
10049 @opindex gfull
10050 Emit debugging information for all symbols and types.
10051
10052 @item -mmacosx-version-min=@var{version}
10053 The earliest version of MacOS X that this executable will run on
10054 is @var{version}.  Typical values of @var{version} include @code{10.1},
10055 @code{10.2}, and @code{10.3.9}.
10056
10057 If the compiler was built to use the system's headers by default,
10058 then the default for this option is the system version on which the
10059 compiler is running, otherwise the default is to make choices which
10060 are compatible with as many systems and code bases as possible.
10061
10062 @item -mkernel
10063 @opindex mkernel
10064 Enable kernel development mode.  The @option{-mkernel} option sets
10065 @option{-static}, @option{-fno-common}, @option{-fno-cxa-atexit},
10066 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
10067 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
10068 applicable.  This mode also sets @option{-mno-altivec},
10069 @option{-msoft-float}, @option{-fno-builtin} and
10070 @option{-mlong-branch} for PowerPC targets.
10071
10072 @item -mone-byte-bool
10073 @opindex mone-byte-bool
10074 Override the defaults for @samp{bool} so that @samp{sizeof(bool)==1}.
10075 By default @samp{sizeof(bool)} is @samp{4} when compiling for
10076 Darwin/PowerPC and @samp{1} when compiling for Darwin/x86, so this
10077 option has no effect on x86.
10078
10079 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
10080 to generate code that is not binary compatible with code generated
10081 without that switch.  Using this switch may require recompiling all
10082 other modules in a program, including system libraries.  Use this
10083 switch to conform to a non-default data model.
10084
10085 @item -mfix-and-continue
10086 @itemx -ffix-and-continue
10087 @itemx -findirect-data
10088 @opindex mfix-and-continue
10089 @opindex ffix-and-continue
10090 @opindex findirect-data
10091 Generate code suitable for fast turn around development.  Needed to
10092 enable gdb to dynamically load @code{.o} files into already running
10093 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
10094 are provided for backwards compatibility.
10095
10096 @item -all_load
10097 @opindex all_load
10098 Loads all members of static archive libraries.
10099 See man ld(1) for more information.
10100
10101 @item -arch_errors_fatal
10102 @opindex arch_errors_fatal
10103 Cause the errors having to do with files that have the wrong architecture
10104 to be fatal.
10105
10106 @item -bind_at_load
10107 @opindex bind_at_load
10108 Causes the output file to be marked such that the dynamic linker will
10109 bind all undefined references when the file is loaded or launched.
10110
10111 @item -bundle
10112 @opindex bundle
10113 Produce a Mach-o bundle format file.
10114 See man ld(1) for more information.
10115
10116 @item -bundle_loader @var{executable}
10117 @opindex bundle_loader
10118 This option specifies the @var{executable} that will be loading the build
10119 output file being linked.  See man ld(1) for more information.
10120
10121 @item -dynamiclib
10122 @opindex dynamiclib
10123 When passed this option, GCC will produce a dynamic library instead of
10124 an executable when linking, using the Darwin @file{libtool} command.
10125
10126 @item -force_cpusubtype_ALL
10127 @opindex force_cpusubtype_ALL
10128 This causes GCC's output file to have the @var{ALL} subtype, instead of
10129 one controlled by the @option{-mcpu} or @option{-march} option.
10130
10131 @item -allowable_client  @var{client_name}
10132 @itemx -client_name
10133 @itemx -compatibility_version
10134 @itemx -current_version
10135 @itemx -dead_strip
10136 @itemx -dependency-file
10137 @itemx -dylib_file
10138 @itemx -dylinker_install_name
10139 @itemx -dynamic
10140 @itemx -exported_symbols_list
10141 @itemx -filelist
10142 @itemx -flat_namespace
10143 @itemx -force_flat_namespace
10144 @itemx -headerpad_max_install_names
10145 @itemx -image_base
10146 @itemx -init
10147 @itemx -install_name
10148 @itemx -keep_private_externs
10149 @itemx -multi_module
10150 @itemx -multiply_defined
10151 @itemx -multiply_defined_unused
10152 @itemx -noall_load
10153 @itemx -no_dead_strip_inits_and_terms
10154 @itemx -nofixprebinding
10155 @itemx -nomultidefs
10156 @itemx -noprebind
10157 @itemx -noseglinkedit
10158 @itemx -pagezero_size
10159 @itemx -prebind
10160 @itemx -prebind_all_twolevel_modules
10161 @itemx -private_bundle
10162 @itemx -read_only_relocs
10163 @itemx -sectalign
10164 @itemx -sectobjectsymbols
10165 @itemx -whyload
10166 @itemx -seg1addr
10167 @itemx -sectcreate
10168 @itemx -sectobjectsymbols
10169 @itemx -sectorder
10170 @itemx -segaddr
10171 @itemx -segs_read_only_addr
10172 @itemx -segs_read_write_addr
10173 @itemx -seg_addr_table
10174 @itemx -seg_addr_table_filename
10175 @itemx -seglinkedit
10176 @itemx -segprot
10177 @itemx -segs_read_only_addr
10178 @itemx -segs_read_write_addr
10179 @itemx -single_module
10180 @itemx -static
10181 @itemx -sub_library
10182 @itemx -sub_umbrella
10183 @itemx -twolevel_namespace
10184 @itemx -umbrella
10185 @itemx -undefined
10186 @itemx -unexported_symbols_list
10187 @itemx -weak_reference_mismatches
10188 @itemx -whatsloaded
10189 @opindex allowable_client
10190 @opindex client_name
10191 @opindex compatibility_version
10192 @opindex current_version
10193 @opindex dead_strip
10194 @opindex dependency-file
10195 @opindex dylib_file
10196 @opindex dylinker_install_name
10197 @opindex dynamic
10198 @opindex exported_symbols_list
10199 @opindex filelist
10200 @opindex flat_namespace
10201 @opindex force_flat_namespace
10202 @opindex headerpad_max_install_names
10203 @opindex image_base
10204 @opindex init
10205 @opindex install_name
10206 @opindex keep_private_externs
10207 @opindex multi_module
10208 @opindex multiply_defined
10209 @opindex multiply_defined_unused
10210 @opindex noall_load
10211 @opindex no_dead_strip_inits_and_terms
10212 @opindex nofixprebinding
10213 @opindex nomultidefs
10214 @opindex noprebind
10215 @opindex noseglinkedit
10216 @opindex pagezero_size
10217 @opindex prebind
10218 @opindex prebind_all_twolevel_modules
10219 @opindex private_bundle
10220 @opindex read_only_relocs
10221 @opindex sectalign
10222 @opindex sectobjectsymbols
10223 @opindex whyload
10224 @opindex seg1addr
10225 @opindex sectcreate
10226 @opindex sectobjectsymbols
10227 @opindex sectorder
10228 @opindex segaddr
10229 @opindex segs_read_only_addr
10230 @opindex segs_read_write_addr
10231 @opindex seg_addr_table
10232 @opindex seg_addr_table_filename
10233 @opindex seglinkedit
10234 @opindex segprot
10235 @opindex segs_read_only_addr
10236 @opindex segs_read_write_addr
10237 @opindex single_module
10238 @opindex static
10239 @opindex sub_library
10240 @opindex sub_umbrella
10241 @opindex twolevel_namespace
10242 @opindex umbrella
10243 @opindex undefined
10244 @opindex unexported_symbols_list
10245 @opindex weak_reference_mismatches
10246 @opindex whatsloaded
10247 These options are passed to the Darwin linker.  The Darwin linker man page
10248 describes them in detail.
10249 @end table
10250
10251 @node DEC Alpha Options
10252 @subsection DEC Alpha Options
10253
10254 These @samp{-m} options are defined for the DEC Alpha implementations:
10255
10256 @table @gcctabopt
10257 @item -mno-soft-float
10258 @itemx -msoft-float
10259 @opindex mno-soft-float
10260 @opindex msoft-float
10261 Use (do not use) the hardware floating-point instructions for
10262 floating-point operations.  When @option{-msoft-float} is specified,
10263 functions in @file{libgcc.a} will be used to perform floating-point
10264 operations.  Unless they are replaced by routines that emulate the
10265 floating-point operations, or compiled in such a way as to call such
10266 emulations routines, these routines will issue floating-point
10267 operations.   If you are compiling for an Alpha without floating-point
10268 operations, you must ensure that the library is built so as not to call
10269 them.
10270
10271 Note that Alpha implementations without floating-point operations are
10272 required to have floating-point registers.
10273
10274 @item -mfp-reg
10275 @itemx -mno-fp-regs
10276 @opindex mfp-reg
10277 @opindex mno-fp-regs
10278 Generate code that uses (does not use) the floating-point register set.
10279 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
10280 register set is not used, floating point operands are passed in integer
10281 registers as if they were integers and floating-point results are passed
10282 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
10283 so any function with a floating-point argument or return value called by code
10284 compiled with @option{-mno-fp-regs} must also be compiled with that
10285 option.
10286
10287 A typical use of this option is building a kernel that does not use,
10288 and hence need not save and restore, any floating-point registers.
10289
10290 @item -mieee
10291 @opindex mieee
10292 The Alpha architecture implements floating-point hardware optimized for
10293 maximum performance.  It is mostly compliant with the IEEE floating
10294 point standard.  However, for full compliance, software assistance is
10295 required.  This option generates code fully IEEE compliant code
10296 @emph{except} that the @var{inexact-flag} is not maintained (see below).
10297 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
10298 defined during compilation.  The resulting code is less efficient but is
10299 able to correctly support denormalized numbers and exceptional IEEE
10300 values such as not-a-number and plus/minus infinity.  Other Alpha
10301 compilers call this option @option{-ieee_with_no_inexact}.
10302
10303 @item -mieee-with-inexact
10304 @opindex mieee-with-inexact
10305 This is like @option{-mieee} except the generated code also maintains
10306 the IEEE @var{inexact-flag}.  Turning on this option causes the
10307 generated code to implement fully-compliant IEEE math.  In addition to
10308 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
10309 macro.  On some Alpha implementations the resulting code may execute
10310 significantly slower than the code generated by default.  Since there is
10311 very little code that depends on the @var{inexact-flag}, you should
10312 normally not specify this option.  Other Alpha compilers call this
10313 option @option{-ieee_with_inexact}.
10314
10315 @item -mfp-trap-mode=@var{trap-mode}
10316 @opindex mfp-trap-mode
10317 This option controls what floating-point related traps are enabled.
10318 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
10319 The trap mode can be set to one of four values:
10320
10321 @table @samp
10322 @item n
10323 This is the default (normal) setting.  The only traps that are enabled
10324 are the ones that cannot be disabled in software (e.g., division by zero
10325 trap).
10326
10327 @item u
10328 In addition to the traps enabled by @samp{n}, underflow traps are enabled
10329 as well.
10330
10331 @item su
10332 Like @samp{u}, but the instructions are marked to be safe for software
10333 completion (see Alpha architecture manual for details).
10334
10335 @item sui
10336 Like @samp{su}, but inexact traps are enabled as well.
10337 @end table
10338
10339 @item -mfp-rounding-mode=@var{rounding-mode}
10340 @opindex mfp-rounding-mode
10341 Selects the IEEE rounding mode.  Other Alpha compilers call this option
10342 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
10343 of:
10344
10345 @table @samp
10346 @item n
10347 Normal IEEE rounding mode.  Floating point numbers are rounded towards
10348 the nearest machine number or towards the even machine number in case
10349 of a tie.
10350
10351 @item m
10352 Round towards minus infinity.
10353
10354 @item c
10355 Chopped rounding mode.  Floating point numbers are rounded towards zero.
10356
10357 @item d
10358 Dynamic rounding mode.  A field in the floating point control register
10359 (@var{fpcr}, see Alpha architecture reference manual) controls the
10360 rounding mode in effect.  The C library initializes this register for
10361 rounding towards plus infinity.  Thus, unless your program modifies the
10362 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
10363 @end table
10364
10365 @item -mtrap-precision=@var{trap-precision}
10366 @opindex mtrap-precision
10367 In the Alpha architecture, floating point traps are imprecise.  This
10368 means without software assistance it is impossible to recover from a
10369 floating trap and program execution normally needs to be terminated.
10370 GCC can generate code that can assist operating system trap handlers
10371 in determining the exact location that caused a floating point trap.
10372 Depending on the requirements of an application, different levels of
10373 precisions can be selected:
10374
10375 @table @samp
10376 @item p
10377 Program precision.  This option is the default and means a trap handler
10378 can only identify which program caused a floating point exception.
10379
10380 @item f
10381 Function precision.  The trap handler can determine the function that
10382 caused a floating point exception.
10383
10384 @item i
10385 Instruction precision.  The trap handler can determine the exact
10386 instruction that caused a floating point exception.
10387 @end table
10388
10389 Other Alpha compilers provide the equivalent options called
10390 @option{-scope_safe} and @option{-resumption_safe}.
10391
10392 @item -mieee-conformant
10393 @opindex mieee-conformant
10394 This option marks the generated code as IEEE conformant.  You must not
10395 use this option unless you also specify @option{-mtrap-precision=i} and either
10396 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
10397 is to emit the line @samp{.eflag 48} in the function prologue of the
10398 generated assembly file.  Under DEC Unix, this has the effect that
10399 IEEE-conformant math library routines will be linked in.
10400
10401 @item -mbuild-constants
10402 @opindex mbuild-constants
10403 Normally GCC examines a 32- or 64-bit integer constant to
10404 see if it can construct it from smaller constants in two or three
10405 instructions.  If it cannot, it will output the constant as a literal and
10406 generate code to load it from the data segment at runtime.
10407
10408 Use this option to require GCC to construct @emph{all} integer constants
10409 using code, even if it takes more instructions (the maximum is six).
10410
10411 You would typically use this option to build a shared library dynamic
10412 loader.  Itself a shared library, it must relocate itself in memory
10413 before it can find the variables and constants in its own data segment.
10414
10415 @item -malpha-as
10416 @itemx -mgas
10417 @opindex malpha-as
10418 @opindex mgas
10419 Select whether to generate code to be assembled by the vendor-supplied
10420 assembler (@option{-malpha-as}) or by the GNU assembler @option{-mgas}.
10421
10422 @item -mbwx
10423 @itemx -mno-bwx
10424 @itemx -mcix
10425 @itemx -mno-cix
10426 @itemx -mfix
10427 @itemx -mno-fix
10428 @itemx -mmax
10429 @itemx -mno-max
10430 @opindex mbwx
10431 @opindex mno-bwx
10432 @opindex mcix
10433 @opindex mno-cix
10434 @opindex mfix
10435 @opindex mno-fix
10436 @opindex mmax
10437 @opindex mno-max
10438 Indicate whether GCC should generate code to use the optional BWX,
10439 CIX, FIX and MAX instruction sets.  The default is to use the instruction
10440 sets supported by the CPU type specified via @option{-mcpu=} option or that
10441 of the CPU on which GCC was built if none was specified.
10442
10443 @item -mfloat-vax
10444 @itemx -mfloat-ieee
10445 @opindex mfloat-vax
10446 @opindex mfloat-ieee
10447 Generate code that uses (does not use) VAX F and G floating point
10448 arithmetic instead of IEEE single and double precision.
10449
10450 @item -mexplicit-relocs
10451 @itemx -mno-explicit-relocs
10452 @opindex mexplicit-relocs
10453 @opindex mno-explicit-relocs
10454 Older Alpha assemblers provided no way to generate symbol relocations
10455 except via assembler macros.  Use of these macros does not allow
10456 optimal instruction scheduling.  GNU binutils as of version 2.12
10457 supports a new syntax that allows the compiler to explicitly mark
10458 which relocations should apply to which instructions.  This option
10459 is mostly useful for debugging, as GCC detects the capabilities of
10460 the assembler when it is built and sets the default accordingly.
10461
10462 @item -msmall-data
10463 @itemx -mlarge-data
10464 @opindex msmall-data
10465 @opindex mlarge-data
10466 When @option{-mexplicit-relocs} is in effect, static data is
10467 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
10468 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
10469 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
10470 16-bit relocations off of the @code{$gp} register.  This limits the
10471 size of the small data area to 64KB, but allows the variables to be
10472 directly accessed via a single instruction.
10473
10474 The default is @option{-mlarge-data}.  With this option the data area
10475 is limited to just below 2GB@.  Programs that require more than 2GB of
10476 data must use @code{malloc} or @code{mmap} to allocate the data in the
10477 heap instead of in the program's data segment.
10478
10479 When generating code for shared libraries, @option{-fpic} implies
10480 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
10481
10482 @item -msmall-text
10483 @itemx -mlarge-text
10484 @opindex msmall-text
10485 @opindex mlarge-text
10486 When @option{-msmall-text} is used, the compiler assumes that the
10487 code of the entire program (or shared library) fits in 4MB, and is
10488 thus reachable with a branch instruction.  When @option{-msmall-data}
10489 is used, the compiler can assume that all local symbols share the
10490 same @code{$gp} value, and thus reduce the number of instructions
10491 required for a function call from 4 to 1.
10492
10493 The default is @option{-mlarge-text}.
10494
10495 @item -mcpu=@var{cpu_type}
10496 @opindex mcpu
10497 Set the instruction set and instruction scheduling parameters for
10498 machine type @var{cpu_type}.  You can specify either the @samp{EV}
10499 style name or the corresponding chip number.  GCC supports scheduling
10500 parameters for the EV4, EV5 and EV6 family of processors and will
10501 choose the default values for the instruction set from the processor
10502 you specify.  If you do not specify a processor type, GCC will default
10503 to the processor on which the compiler was built.
10504
10505 Supported values for @var{cpu_type} are
10506
10507 @table @samp
10508 @item ev4
10509 @itemx ev45
10510 @itemx 21064
10511 Schedules as an EV4 and has no instruction set extensions.
10512
10513 @item ev5
10514 @itemx 21164
10515 Schedules as an EV5 and has no instruction set extensions.
10516
10517 @item ev56
10518 @itemx 21164a
10519 Schedules as an EV5 and supports the BWX extension.
10520
10521 @item pca56
10522 @itemx 21164pc
10523 @itemx 21164PC
10524 Schedules as an EV5 and supports the BWX and MAX extensions.
10525
10526 @item ev6
10527 @itemx 21264
10528 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
10529
10530 @item ev67
10531 @itemx 21264a
10532 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
10533 @end table
10534
10535 Native Linux/GNU toolchains also support the value @samp{native},
10536 which selects the best architecture option for the host processor.
10537 @option{-mcpu=native} has no effect if GCC does not recognize
10538 the processor.
10539
10540 @item -mtune=@var{cpu_type}
10541 @opindex mtune
10542 Set only the instruction scheduling parameters for machine type
10543 @var{cpu_type}.  The instruction set is not changed.
10544
10545 Native Linux/GNU toolchains also support the value @samp{native},
10546 which selects the best architecture option for the host processor.
10547 @option{-mtune=native} has no effect if GCC does not recognize
10548 the processor.
10549
10550 @item -mmemory-latency=@var{time}
10551 @opindex mmemory-latency
10552 Sets the latency the scheduler should assume for typical memory
10553 references as seen by the application.  This number is highly
10554 dependent on the memory access patterns used by the application
10555 and the size of the external cache on the machine.
10556
10557 Valid options for @var{time} are
10558
10559 @table @samp
10560 @item @var{number}
10561 A decimal number representing clock cycles.
10562
10563 @item L1
10564 @itemx L2
10565 @itemx L3
10566 @itemx main
10567 The compiler contains estimates of the number of clock cycles for
10568 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
10569 (also called Dcache, Scache, and Bcache), as well as to main memory.
10570 Note that L3 is only valid for EV5.
10571
10572 @end table
10573 @end table
10574
10575 @node DEC Alpha/VMS Options
10576 @subsection DEC Alpha/VMS Options
10577
10578 These @samp{-m} options are defined for the DEC Alpha/VMS implementations:
10579
10580 @table @gcctabopt
10581 @item -mvms-return-codes
10582 @opindex mvms-return-codes
10583 Return VMS condition codes from main.  The default is to return POSIX
10584 style condition (e.g.@: error) codes.
10585 @end table
10586
10587 @node FR30 Options
10588 @subsection FR30 Options
10589 @cindex FR30 Options
10590
10591 These options are defined specifically for the FR30 port.
10592
10593 @table @gcctabopt
10594
10595 @item -msmall-model
10596 @opindex msmall-model
10597 Use the small address space model.  This can produce smaller code, but
10598 it does assume that all symbolic values and addresses will fit into a
10599 20-bit range.
10600
10601 @item -mno-lsim
10602 @opindex mno-lsim
10603 Assume that run-time support has been provided and so there is no need
10604 to include the simulator library (@file{libsim.a}) on the linker
10605 command line.
10606
10607 @end table
10608
10609 @node FRV Options
10610 @subsection FRV Options
10611 @cindex FRV Options
10612
10613 @table @gcctabopt
10614 @item -mgpr-32
10615 @opindex mgpr-32
10616
10617 Only use the first 32 general purpose registers.
10618
10619 @item -mgpr-64
10620 @opindex mgpr-64
10621
10622 Use all 64 general purpose registers.
10623
10624 @item -mfpr-32
10625 @opindex mfpr-32
10626
10627 Use only the first 32 floating point registers.
10628
10629 @item -mfpr-64
10630 @opindex mfpr-64
10631
10632 Use all 64 floating point registers
10633
10634 @item -mhard-float
10635 @opindex mhard-float
10636
10637 Use hardware instructions for floating point operations.
10638
10639 @item -msoft-float
10640 @opindex msoft-float
10641
10642 Use library routines for floating point operations.
10643
10644 @item -malloc-cc
10645 @opindex malloc-cc
10646
10647 Dynamically allocate condition code registers.
10648
10649 @item -mfixed-cc
10650 @opindex mfixed-cc
10651
10652 Do not try to dynamically allocate condition code registers, only
10653 use @code{icc0} and @code{fcc0}.
10654
10655 @item -mdword
10656 @opindex mdword
10657
10658 Change ABI to use double word insns.
10659
10660 @item -mno-dword
10661 @opindex mno-dword
10662
10663 Do not use double word instructions.
10664
10665 @item -mdouble
10666 @opindex mdouble
10667
10668 Use floating point double instructions.
10669
10670 @item -mno-double
10671 @opindex mno-double
10672
10673 Do not use floating point double instructions.
10674
10675 @item -mmedia
10676 @opindex mmedia
10677
10678 Use media instructions.
10679
10680 @item -mno-media
10681 @opindex mno-media
10682
10683 Do not use media instructions.
10684
10685 @item -mmuladd
10686 @opindex mmuladd
10687
10688 Use multiply and add/subtract instructions.
10689
10690 @item -mno-muladd
10691 @opindex mno-muladd
10692
10693 Do not use multiply and add/subtract instructions.
10694
10695 @item -mfdpic
10696 @opindex mfdpic
10697
10698 Select the FDPIC ABI, that uses function descriptors to represent
10699 pointers to functions.  Without any PIC/PIE-related options, it
10700 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
10701 assumes GOT entries and small data are within a 12-bit range from the
10702 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
10703 are computed with 32 bits.
10704 With a @samp{bfin-elf} target, this option implies @option{-msim}.
10705
10706 @item -minline-plt
10707 @opindex minline-plt
10708
10709 Enable inlining of PLT entries in function calls to functions that are
10710 not known to bind locally.  It has no effect without @option{-mfdpic}.
10711 It's enabled by default if optimizing for speed and compiling for
10712 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
10713 optimization option such as @option{-O3} or above is present in the
10714 command line.
10715
10716 @item -mTLS
10717 @opindex mTLS
10718
10719 Assume a large TLS segment when generating thread-local code.
10720
10721 @item -mtls
10722 @opindex mtls
10723
10724 Do not assume a large TLS segment when generating thread-local code.
10725
10726 @item -mgprel-ro
10727 @opindex mgprel-ro
10728
10729 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
10730 that is known to be in read-only sections.  It's enabled by default,
10731 except for @option{-fpic} or @option{-fpie}: even though it may help
10732 make the global offset table smaller, it trades 1 instruction for 4.
10733 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
10734 one of which may be shared by multiple symbols, and it avoids the need
10735 for a GOT entry for the referenced symbol, so it's more likely to be a
10736 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
10737
10738 @item -multilib-library-pic
10739 @opindex multilib-library-pic
10740
10741 Link with the (library, not FD) pic libraries.  It's implied by
10742 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
10743 @option{-fpic} without @option{-mfdpic}.  You should never have to use
10744 it explicitly.
10745
10746 @item -mlinked-fp
10747 @opindex mlinked-fp
10748
10749 Follow the EABI requirement of always creating a frame pointer whenever
10750 a stack frame is allocated.  This option is enabled by default and can
10751 be disabled with @option{-mno-linked-fp}.
10752
10753 @item -mlong-calls
10754 @opindex mlong-calls
10755
10756 Use indirect addressing to call functions outside the current
10757 compilation unit.  This allows the functions to be placed anywhere
10758 within the 32-bit address space.
10759
10760 @item -malign-labels
10761 @opindex malign-labels
10762
10763 Try to align labels to an 8-byte boundary by inserting nops into the
10764 previous packet.  This option only has an effect when VLIW packing
10765 is enabled.  It doesn't create new packets; it merely adds nops to
10766 existing ones.
10767
10768 @item -mlibrary-pic
10769 @opindex mlibrary-pic
10770
10771 Generate position-independent EABI code.
10772
10773 @item -macc-4
10774 @opindex macc-4
10775
10776 Use only the first four media accumulator registers.
10777
10778 @item -macc-8
10779 @opindex macc-8
10780
10781 Use all eight media accumulator registers.
10782
10783 @item -mpack
10784 @opindex mpack
10785
10786 Pack VLIW instructions.
10787
10788 @item -mno-pack
10789 @opindex mno-pack
10790
10791 Do not pack VLIW instructions.
10792
10793 @item -mno-eflags
10794 @opindex mno-eflags
10795
10796 Do not mark ABI switches in e_flags.
10797
10798 @item -mcond-move
10799 @opindex mcond-move
10800
10801 Enable the use of conditional-move instructions (default).
10802
10803 This switch is mainly for debugging the compiler and will likely be removed
10804 in a future version.
10805
10806 @item -mno-cond-move
10807 @opindex mno-cond-move
10808
10809 Disable the use of conditional-move instructions.
10810
10811 This switch is mainly for debugging the compiler and will likely be removed
10812 in a future version.
10813
10814 @item -mscc
10815 @opindex mscc
10816
10817 Enable the use of conditional set instructions (default).
10818
10819 This switch is mainly for debugging the compiler and will likely be removed
10820 in a future version.
10821
10822 @item -mno-scc
10823 @opindex mno-scc
10824
10825 Disable the use of conditional set instructions.
10826
10827 This switch is mainly for debugging the compiler and will likely be removed
10828 in a future version.
10829
10830 @item -mcond-exec
10831 @opindex mcond-exec
10832
10833 Enable the use of conditional execution (default).
10834
10835 This switch is mainly for debugging the compiler and will likely be removed
10836 in a future version.
10837
10838 @item -mno-cond-exec
10839 @opindex mno-cond-exec
10840
10841 Disable the use of conditional execution.
10842
10843 This switch is mainly for debugging the compiler and will likely be removed
10844 in a future version.
10845
10846 @item -mvliw-branch
10847 @opindex mvliw-branch
10848
10849 Run a pass to pack branches into VLIW instructions (default).
10850
10851 This switch is mainly for debugging the compiler and will likely be removed
10852 in a future version.
10853
10854 @item -mno-vliw-branch
10855 @opindex mno-vliw-branch
10856
10857 Do not run a pass to pack branches into VLIW instructions.
10858
10859 This switch is mainly for debugging the compiler and will likely be removed
10860 in a future version.
10861
10862 @item -mmulti-cond-exec
10863 @opindex mmulti-cond-exec
10864
10865 Enable optimization of @code{&&} and @code{||} in conditional execution
10866 (default).
10867
10868 This switch is mainly for debugging the compiler and will likely be removed
10869 in a future version.
10870
10871 @item -mno-multi-cond-exec
10872 @opindex mno-multi-cond-exec
10873
10874 Disable optimization of @code{&&} and @code{||} in conditional execution.
10875
10876 This switch is mainly for debugging the compiler and will likely be removed
10877 in a future version.
10878
10879 @item -mnested-cond-exec
10880 @opindex mnested-cond-exec
10881
10882 Enable nested conditional execution optimizations (default).
10883
10884 This switch is mainly for debugging the compiler and will likely be removed
10885 in a future version.
10886
10887 @item -mno-nested-cond-exec
10888 @opindex mno-nested-cond-exec
10889
10890 Disable nested conditional execution optimizations.
10891
10892 This switch is mainly for debugging the compiler and will likely be removed
10893 in a future version.
10894
10895 @item -moptimize-membar
10896 @opindex moptimize-membar
10897
10898 This switch removes redundant @code{membar} instructions from the
10899 compiler generated code.  It is enabled by default.
10900
10901 @item -mno-optimize-membar
10902 @opindex mno-optimize-membar
10903
10904 This switch disables the automatic removal of redundant @code{membar}
10905 instructions from the generated code.
10906
10907 @item -mtomcat-stats
10908 @opindex mtomcat-stats
10909
10910 Cause gas to print out tomcat statistics.
10911
10912 @item -mcpu=@var{cpu}
10913 @opindex mcpu
10914
10915 Select the processor type for which to generate code.  Possible values are
10916 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
10917 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
10918
10919 @end table
10920
10921 @node GNU/Linux Options
10922 @subsection GNU/Linux Options
10923
10924 These @samp{-m} options are defined for GNU/Linux targets:
10925
10926 @table @gcctabopt
10927 @item -mglibc
10928 @opindex mglibc
10929 Use the GNU C library instead of uClibc.  This is the default except
10930 on @samp{*-*-linux-*uclibc*} targets.
10931
10932 @item -muclibc
10933 @opindex muclibc
10934 Use uClibc instead of the GNU C library.  This is the default on
10935 @samp{*-*-linux-*uclibc*} targets.
10936 @end table
10937
10938 @node H8/300 Options
10939 @subsection H8/300 Options
10940
10941 These @samp{-m} options are defined for the H8/300 implementations:
10942
10943 @table @gcctabopt
10944 @item -mrelax
10945 @opindex mrelax
10946 Shorten some address references at link time, when possible; uses the
10947 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
10948 ld, Using ld}, for a fuller description.
10949
10950 @item -mh
10951 @opindex mh
10952 Generate code for the H8/300H@.
10953
10954 @item -ms
10955 @opindex ms
10956 Generate code for the H8S@.
10957
10958 @item -mn
10959 @opindex mn
10960 Generate code for the H8S and H8/300H in the normal mode.  This switch
10961 must be used either with @option{-mh} or @option{-ms}.
10962
10963 @item -ms2600
10964 @opindex ms2600
10965 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
10966
10967 @item -mint32
10968 @opindex mint32
10969 Make @code{int} data 32 bits by default.
10970
10971 @item -malign-300
10972 @opindex malign-300
10973 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
10974 The default for the H8/300H and H8S is to align longs and floats on 4
10975 byte boundaries.
10976 @option{-malign-300} causes them to be aligned on 2 byte boundaries.
10977 This option has no effect on the H8/300.
10978 @end table
10979
10980 @node HPPA Options
10981 @subsection HPPA Options
10982 @cindex HPPA Options
10983
10984 These @samp{-m} options are defined for the HPPA family of computers:
10985
10986 @table @gcctabopt
10987 @item -march=@var{architecture-type}
10988 @opindex march
10989 Generate code for the specified architecture.  The choices for
10990 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
10991 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
10992 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
10993 architecture option for your machine.  Code compiled for lower numbered
10994 architectures will run on higher numbered architectures, but not the
10995 other way around.
10996
10997 @item -mpa-risc-1-0
10998 @itemx -mpa-risc-1-1
10999 @itemx -mpa-risc-2-0
11000 @opindex mpa-risc-1-0
11001 @opindex mpa-risc-1-1
11002 @opindex mpa-risc-2-0
11003 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
11004
11005 @item -mbig-switch
11006 @opindex mbig-switch
11007 Generate code suitable for big switch tables.  Use this option only if
11008 the assembler/linker complain about out of range branches within a switch
11009 table.
11010
11011 @item -mjump-in-delay
11012 @opindex mjump-in-delay
11013 Fill delay slots of function calls with unconditional jump instructions
11014 by modifying the return pointer for the function call to be the target
11015 of the conditional jump.
11016
11017 @item -mdisable-fpregs
11018 @opindex mdisable-fpregs
11019 Prevent floating point registers from being used in any manner.  This is
11020 necessary for compiling kernels which perform lazy context switching of
11021 floating point registers.  If you use this option and attempt to perform
11022 floating point operations, the compiler will abort.
11023
11024 @item -mdisable-indexing
11025 @opindex mdisable-indexing
11026 Prevent the compiler from using indexing address modes.  This avoids some
11027 rather obscure problems when compiling MIG generated code under MACH@.
11028
11029 @item -mno-space-regs
11030 @opindex mno-space-regs
11031 Generate code that assumes the target has no space registers.  This allows
11032 GCC to generate faster indirect calls and use unscaled index address modes.
11033
11034 Such code is suitable for level 0 PA systems and kernels.
11035
11036 @item -mfast-indirect-calls
11037 @opindex mfast-indirect-calls
11038 Generate code that assumes calls never cross space boundaries.  This
11039 allows GCC to emit code which performs faster indirect calls.
11040
11041 This option will not work in the presence of shared libraries or nested
11042 functions.
11043
11044 @item -mfixed-range=@var{register-range}
11045 @opindex mfixed-range
11046 Generate code treating the given register range as fixed registers.
11047 A fixed register is one that the register allocator can not use.  This is
11048 useful when compiling kernel code.  A register range is specified as
11049 two registers separated by a dash.  Multiple register ranges can be
11050 specified separated by a comma.
11051
11052 @item -mlong-load-store
11053 @opindex mlong-load-store
11054 Generate 3-instruction load and store sequences as sometimes required by
11055 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
11056 the HP compilers.
11057
11058 @item -mportable-runtime
11059 @opindex mportable-runtime
11060 Use the portable calling conventions proposed by HP for ELF systems.
11061
11062 @item -mgas
11063 @opindex mgas
11064 Enable the use of assembler directives only GAS understands.
11065
11066 @item -mschedule=@var{cpu-type}
11067 @opindex mschedule
11068 Schedule code according to the constraints for the machine type
11069 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
11070 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
11071 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
11072 proper scheduling option for your machine.  The default scheduling is
11073 @samp{8000}.
11074
11075 @item -mlinker-opt
11076 @opindex mlinker-opt
11077 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
11078 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
11079 linkers in which they give bogus error messages when linking some programs.
11080
11081 @item -msoft-float
11082 @opindex msoft-float
11083 Generate output containing library calls for floating point.
11084 @strong{Warning:} the requisite libraries are not available for all HPPA
11085 targets.  Normally the facilities of the machine's usual C compiler are
11086 used, but this cannot be done directly in cross-compilation.  You must make
11087 your own arrangements to provide suitable library functions for
11088 cross-compilation.
11089
11090 @option{-msoft-float} changes the calling convention in the output file;
11091 therefore, it is only useful if you compile @emph{all} of a program with
11092 this option.  In particular, you need to compile @file{libgcc.a}, the
11093 library that comes with GCC, with @option{-msoft-float} in order for
11094 this to work.
11095
11096 @item -msio
11097 @opindex msio
11098 Generate the predefine, @code{_SIO}, for server IO@.  The default is
11099 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
11100 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
11101 options are available under HP-UX and HI-UX@.
11102
11103 @item -mgnu-ld
11104 @opindex mgnu-ld
11105 Use GNU ld specific options.  This passes @option{-shared} to ld when
11106 building a shared library.  It is the default when GCC is configured,
11107 explicitly or implicitly, with the GNU linker.  This option does not
11108 have any affect on which ld is called, it only changes what parameters
11109 are passed to that ld.  The ld that is called is determined by the
11110 @option{--with-ld} configure option, GCC's program search path, and
11111 finally by the user's @env{PATH}.  The linker used by GCC can be printed
11112 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
11113 on the 64 bit HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
11114
11115 @item -mhp-ld
11116 @opindex mhp-ld
11117 Use HP ld specific options.  This passes @option{-b} to ld when building
11118 a shared library and passes @option{+Accept TypeMismatch} to ld on all
11119 links.  It is the default when GCC is configured, explicitly or
11120 implicitly, with the HP linker.  This option does not have any affect on
11121 which ld is called, it only changes what parameters are passed to that
11122 ld.  The ld that is called is determined by the @option{--with-ld}
11123 configure option, GCC's program search path, and finally by the user's
11124 @env{PATH}.  The linker used by GCC can be printed using @samp{which
11125 `gcc -print-prog-name=ld`}.  This option is only available on the 64 bit
11126 HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
11127
11128 @item -mlong-calls
11129 @opindex mno-long-calls
11130 Generate code that uses long call sequences.  This ensures that a call
11131 is always able to reach linker generated stubs.  The default is to generate
11132 long calls only when the distance from the call site to the beginning
11133 of the function or translation unit, as the case may be, exceeds a
11134 predefined limit set by the branch type being used.  The limits for
11135 normal calls are 7,600,000 and 240,000 bytes, respectively for the
11136 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
11137 240,000 bytes.
11138
11139 Distances are measured from the beginning of functions when using the
11140 @option{-ffunction-sections} option, or when using the @option{-mgas}
11141 and @option{-mno-portable-runtime} options together under HP-UX with
11142 the SOM linker.
11143
11144 It is normally not desirable to use this option as it will degrade
11145 performance.  However, it may be useful in large applications,
11146 particularly when partial linking is used to build the application.
11147
11148 The types of long calls used depends on the capabilities of the
11149 assembler and linker, and the type of code being generated.  The
11150 impact on systems that support long absolute calls, and long pic
11151 symbol-difference or pc-relative calls should be relatively small.
11152 However, an indirect call is used on 32-bit ELF systems in pic code
11153 and it is quite long.
11154
11155 @item -munix=@var{unix-std}
11156 @opindex march
11157 Generate compiler predefines and select a startfile for the specified
11158 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
11159 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
11160 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
11161 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
11162 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
11163 and later.
11164
11165 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
11166 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
11167 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
11168 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
11169 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
11170 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
11171
11172 It is @emph{important} to note that this option changes the interfaces
11173 for various library routines.  It also affects the operational behavior
11174 of the C library.  Thus, @emph{extreme} care is needed in using this
11175 option.
11176
11177 Library code that is intended to operate with more than one UNIX
11178 standard must test, set and restore the variable @var{__xpg4_extended_mask}
11179 as appropriate.  Most GNU software doesn't provide this capability.
11180
11181 @item -nolibdld
11182 @opindex nolibdld
11183 Suppress the generation of link options to search libdld.sl when the
11184 @option{-static} option is specified on HP-UX 10 and later.
11185
11186 @item -static
11187 @opindex static
11188 The HP-UX implementation of setlocale in libc has a dependency on
11189 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
11190 when the @option{-static} option is specified, special link options
11191 are needed to resolve this dependency.
11192
11193 On HP-UX 10 and later, the GCC driver adds the necessary options to
11194 link with libdld.sl when the @option{-static} option is specified.
11195 This causes the resulting binary to be dynamic.  On the 64-bit port,
11196 the linkers generate dynamic binaries by default in any case.  The
11197 @option{-nolibdld} option can be used to prevent the GCC driver from
11198 adding these link options.
11199
11200 @item -threads
11201 @opindex threads
11202 Add support for multithreading with the @dfn{dce thread} library
11203 under HP-UX@.  This option sets flags for both the preprocessor and
11204 linker.
11205 @end table
11206
11207 @node i386 and x86-64 Options
11208 @subsection Intel 386 and AMD x86-64 Options
11209 @cindex i386 Options
11210 @cindex x86-64 Options
11211 @cindex Intel 386 Options
11212 @cindex AMD x86-64 Options
11213
11214 These @samp{-m} options are defined for the i386 and x86-64 family of
11215 computers:
11216
11217 @table @gcctabopt
11218 @item -mtune=@var{cpu-type}
11219 @opindex mtune
11220 Tune to @var{cpu-type} everything applicable about the generated code, except
11221 for the ABI and the set of available instructions.  The choices for
11222 @var{cpu-type} are:
11223 @table @emph
11224 @item generic
11225 Produce code optimized for the most common IA32/AMD64/EM64T processors.
11226 If you know the CPU on which your code will run, then you should use
11227 the corresponding @option{-mtune} option instead of
11228 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
11229 of your application will have, then you should use this option.
11230
11231 As new processors are deployed in the marketplace, the behavior of this
11232 option will change.  Therefore, if you upgrade to a newer version of
11233 GCC, the code generated option will change to reflect the processors
11234 that were most common when that version of GCC was released.
11235
11236 There is no @option{-march=generic} option because @option{-march}
11237 indicates the instruction set the compiler can use, and there is no
11238 generic instruction set applicable to all processors.  In contrast,
11239 @option{-mtune} indicates the processor (or, in this case, collection of
11240 processors) for which the code is optimized.
11241 @item native
11242 This selects the CPU to tune for at compilation time by determining
11243 the processor type of the compiling machine.  Using @option{-mtune=native}
11244 will produce code optimized for the local machine under the constraints
11245 of the selected instruction set.  Using @option{-march=native} will
11246 enable all instruction subsets supported by the local machine (hence
11247 the result might not run on different machines).
11248 @item i386
11249 Original Intel's i386 CPU@.
11250 @item i486
11251 Intel's i486 CPU@.  (No scheduling is implemented for this chip.)
11252 @item i586, pentium
11253 Intel Pentium CPU with no MMX support.
11254 @item pentium-mmx
11255 Intel PentiumMMX CPU based on Pentium core with MMX instruction set support.
11256 @item pentiumpro
11257 Intel PentiumPro CPU@.
11258 @item i686
11259 Same as @code{generic}, but when used as @code{march} option, PentiumPro
11260 instruction set will be used, so the code will run on all i686 family chips.
11261 @item pentium2
11262 Intel Pentium2 CPU based on PentiumPro core with MMX instruction set support.
11263 @item pentium3, pentium3m
11264 Intel Pentium3 CPU based on PentiumPro core with MMX and SSE instruction set
11265 support.
11266 @item pentium-m
11267 Low power version of Intel Pentium3 CPU with MMX, SSE and SSE2 instruction set
11268 support.  Used by Centrino notebooks.
11269 @item pentium4, pentium4m
11270 Intel Pentium4 CPU with MMX, SSE and SSE2 instruction set support.
11271 @item prescott
11272 Improved version of Intel Pentium4 CPU with MMX, SSE, SSE2 and SSE3 instruction
11273 set support.
11274 @item nocona
11275 Improved version of Intel Pentium4 CPU with 64-bit extensions, MMX, SSE,
11276 SSE2 and SSE3 instruction set support.
11277 @item core2
11278 Intel Core2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
11279 instruction set support.
11280 @item atom
11281 Intel Atom CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
11282 instruction set support.
11283 @item k6
11284 AMD K6 CPU with MMX instruction set support.
11285 @item k6-2, k6-3
11286 Improved versions of AMD K6 CPU with MMX and 3dNOW!@: instruction set support.
11287 @item athlon, athlon-tbird
11288 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW!@: and SSE prefetch instructions
11289 support.
11290 @item athlon-4, athlon-xp, athlon-mp
11291 Improved AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW!@: and full SSE
11292 instruction set support.
11293 @item k8, opteron, athlon64, athlon-fx
11294 AMD K8 core based CPUs with x86-64 instruction set support.  (This supersets
11295 MMX, SSE, SSE2, 3dNOW!, enhanced 3dNOW!@: and 64-bit instruction set extensions.)
11296 @item k8-sse3, opteron-sse3, athlon64-sse3
11297 Improved versions of k8, opteron and athlon64 with SSE3 instruction set support.
11298 @item amdfam10, barcelona
11299 AMD Family 10h core based CPUs with x86-64 instruction set support.  (This
11300 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3dNOW!, enhanced 3dNOW!, ABM and 64-bit
11301 instruction set extensions.)
11302 @item winchip-c6
11303 IDT Winchip C6 CPU, dealt in same way as i486 with additional MMX instruction
11304 set support.
11305 @item winchip2
11306 IDT Winchip2 CPU, dealt in same way as i486 with additional MMX and 3dNOW!@:
11307 instruction set support.
11308 @item c3
11309 Via C3 CPU with MMX and 3dNOW!@: instruction set support.  (No scheduling is
11310 implemented for this chip.)
11311 @item c3-2
11312 Via C3-2 CPU with MMX and SSE instruction set support.  (No scheduling is
11313 implemented for this chip.)
11314 @item geode
11315 Embedded AMD CPU with MMX and 3dNOW! instruction set support.
11316 @end table
11317
11318 While picking a specific @var{cpu-type} will schedule things appropriately
11319 for that particular chip, the compiler will not generate any code that
11320 does not run on the i386 without the @option{-march=@var{cpu-type}} option
11321 being used.
11322
11323 @item -march=@var{cpu-type}
11324 @opindex march
11325 Generate instructions for the machine type @var{cpu-type}.  The choices
11326 for @var{cpu-type} are the same as for @option{-mtune}.  Moreover,
11327 specifying @option{-march=@var{cpu-type}} implies @option{-mtune=@var{cpu-type}}.
11328
11329 @item -mcpu=@var{cpu-type}
11330 @opindex mcpu
11331 A deprecated synonym for @option{-mtune}.
11332
11333 @item -mfpmath=@var{unit}
11334 @opindex mfpmath
11335 Generate floating point arithmetics for selected unit @var{unit}.  The choices
11336 for @var{unit} are:
11337
11338 @table @samp
11339 @item 387
11340 Use the standard 387 floating point coprocessor present majority of chips and
11341 emulated otherwise.  Code compiled with this option will run almost everywhere.
11342 The temporary results are computed in 80bit precision instead of precision
11343 specified by the type resulting in slightly different results compared to most
11344 of other chips.  See @option{-ffloat-store} for more detailed description.
11345
11346 This is the default choice for i386 compiler.
11347
11348 @item sse
11349 Use scalar floating point instructions present in the SSE instruction set.
11350 This instruction set is supported by Pentium3 and newer chips, in the AMD line
11351 by Athlon-4, Athlon-xp and Athlon-mp chips.  The earlier version of SSE
11352 instruction set supports only single precision arithmetics, thus the double and
11353 extended precision arithmetics is still done using 387.  Later version, present
11354 only in Pentium4 and the future AMD x86-64 chips supports double precision
11355 arithmetics too.
11356
11357 For the i386 compiler, you need to use @option{-march=@var{cpu-type}}, @option{-msse}
11358 or @option{-msse2} switches to enable SSE extensions and make this option
11359 effective.  For the x86-64 compiler, these extensions are enabled by default.
11360
11361 The resulting code should be considerably faster in the majority of cases and avoid
11362 the numerical instability problems of 387 code, but may break some existing
11363 code that expects temporaries to be 80bit.
11364
11365 This is the default choice for the x86-64 compiler.
11366
11367 @item sse,387
11368 @itemx sse+387
11369 @itemx both
11370 Attempt to utilize both instruction sets at once.  This effectively double the
11371 amount of available registers and on chips with separate execution units for
11372 387 and SSE the execution resources too.  Use this option with care, as it is
11373 still experimental, because the GCC register allocator does not model separate
11374 functional units well resulting in instable performance.
11375 @end table
11376
11377 @item -masm=@var{dialect}
11378 @opindex masm=@var{dialect}
11379 Output asm instructions using selected @var{dialect}.  Supported
11380 choices are @samp{intel} or @samp{att} (the default one).  Darwin does
11381 not support @samp{intel}.
11382
11383 @item -mieee-fp
11384 @itemx -mno-ieee-fp
11385 @opindex mieee-fp
11386 @opindex mno-ieee-fp
11387 Control whether or not the compiler uses IEEE floating point
11388 comparisons.  These handle correctly the case where the result of a
11389 comparison is unordered.
11390
11391 @item -msoft-float
11392 @opindex msoft-float
11393 Generate output containing library calls for floating point.
11394 @strong{Warning:} the requisite libraries are not part of GCC@.
11395 Normally the facilities of the machine's usual C compiler are used, but
11396 this can't be done directly in cross-compilation.  You must make your
11397 own arrangements to provide suitable library functions for
11398 cross-compilation.
11399
11400 On machines where a function returns floating point results in the 80387
11401 register stack, some floating point opcodes may be emitted even if
11402 @option{-msoft-float} is used.
11403
11404 @item -mno-fp-ret-in-387
11405 @opindex mno-fp-ret-in-387
11406 Do not use the FPU registers for return values of functions.
11407
11408 The usual calling convention has functions return values of types
11409 @code{float} and @code{double} in an FPU register, even if there
11410 is no FPU@.  The idea is that the operating system should emulate
11411 an FPU@.
11412
11413 The option @option{-mno-fp-ret-in-387} causes such values to be returned
11414 in ordinary CPU registers instead.
11415
11416 @item -mno-fancy-math-387
11417 @opindex mno-fancy-math-387
11418 Some 387 emulators do not support the @code{sin}, @code{cos} and
11419 @code{sqrt} instructions for the 387.  Specify this option to avoid
11420 generating those instructions.  This option is the default on FreeBSD,
11421 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
11422 indicates that the target cpu will always have an FPU and so the
11423 instruction will not need emulation.  As of revision 2.6.1, these
11424 instructions are not generated unless you also use the
11425 @option{-funsafe-math-optimizations} switch.
11426
11427 @item -malign-double
11428 @itemx -mno-align-double
11429 @opindex malign-double
11430 @opindex mno-align-double
11431 Control whether GCC aligns @code{double}, @code{long double}, and
11432 @code{long long} variables on a two word boundary or a one word
11433 boundary.  Aligning @code{double} variables on a two word boundary will
11434 produce code that runs somewhat faster on a @samp{Pentium} at the
11435 expense of more memory.
11436
11437 On x86-64, @option{-malign-double} is enabled by default.
11438
11439 @strong{Warning:} if you use the @option{-malign-double} switch,
11440 structures containing the above types will be aligned differently than
11441 the published application binary interface specifications for the 386
11442 and will not be binary compatible with structures in code compiled
11443 without that switch.
11444
11445 @item -m96bit-long-double
11446 @itemx -m128bit-long-double
11447 @opindex m96bit-long-double
11448 @opindex m128bit-long-double
11449 These switches control the size of @code{long double} type.  The i386
11450 application binary interface specifies the size to be 96 bits,
11451 so @option{-m96bit-long-double} is the default in 32 bit mode.
11452
11453 Modern architectures (Pentium and newer) would prefer @code{long double}
11454 to be aligned to an 8 or 16 byte boundary.  In arrays or structures
11455 conforming to the ABI, this would not be possible.  So specifying a
11456 @option{-m128bit-long-double} will align @code{long double}
11457 to a 16 byte boundary by padding the @code{long double} with an additional
11458 32 bit zero.
11459
11460 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
11461 its ABI specifies that @code{long double} is to be aligned on 16 byte boundary.
11462
11463 Notice that neither of these options enable any extra precision over the x87
11464 standard of 80 bits for a @code{long double}.
11465
11466 @strong{Warning:} if you override the default value for your target ABI, the
11467 structures and arrays containing @code{long double} variables will change
11468 their size as well as function calling convention for function taking
11469 @code{long double} will be modified.  Hence they will not be binary
11470 compatible with arrays or structures in code compiled without that switch.
11471
11472 @item -mlarge-data-threshold=@var{number}
11473 @opindex mlarge-data-threshold=@var{number}
11474 When @option{-mcmodel=medium} is specified, the data greater than
11475 @var{threshold} are placed in large data section.  This value must be the
11476 same across all object linked into the binary and defaults to 65535.
11477
11478 @item -mrtd
11479 @opindex mrtd
11480 Use a different function-calling convention, in which functions that
11481 take a fixed number of arguments return with the @code{ret} @var{num}
11482 instruction, which pops their arguments while returning.  This saves one
11483 instruction in the caller since there is no need to pop the arguments
11484 there.
11485
11486 You can specify that an individual function is called with this calling
11487 sequence with the function attribute @samp{stdcall}.  You can also
11488 override the @option{-mrtd} option by using the function attribute
11489 @samp{cdecl}.  @xref{Function Attributes}.
11490
11491 @strong{Warning:} this calling convention is incompatible with the one
11492 normally used on Unix, so you cannot use it if you need to call
11493 libraries compiled with the Unix compiler.
11494
11495 Also, you must provide function prototypes for all functions that
11496 take variable numbers of arguments (including @code{printf});
11497 otherwise incorrect code will be generated for calls to those
11498 functions.
11499
11500 In addition, seriously incorrect code will result if you call a
11501 function with too many arguments.  (Normally, extra arguments are
11502 harmlessly ignored.)
11503
11504 @item -mregparm=@var{num}
11505 @opindex mregparm
11506 Control how many registers are used to pass integer arguments.  By
11507 default, no registers are used to pass arguments, and at most 3
11508 registers can be used.  You can control this behavior for a specific
11509 function by using the function attribute @samp{regparm}.
11510 @xref{Function Attributes}.
11511
11512 @strong{Warning:} if you use this switch, and
11513 @var{num} is nonzero, then you must build all modules with the same
11514 value, including any libraries.  This includes the system libraries and
11515 startup modules.
11516
11517 @item -msseregparm
11518 @opindex msseregparm
11519 Use SSE register passing conventions for float and double arguments
11520 and return values.  You can control this behavior for a specific
11521 function by using the function attribute @samp{sseregparm}.
11522 @xref{Function Attributes}.
11523
11524 @strong{Warning:} if you use this switch then you must build all
11525 modules with the same value, including any libraries.  This includes
11526 the system libraries and startup modules.
11527
11528 @item -mpc32
11529 @itemx -mpc64
11530 @itemx -mpc80
11531 @opindex mpc32
11532 @opindex mpc64
11533 @opindex mpc80
11534
11535 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
11536 is specified, the significands of results of floating-point operations are
11537 rounded to 24 bits (single precision); @option{-mpc64} rounds the
11538 significands of results of floating-point operations to 53 bits (double
11539 precision) and @option{-mpc80} rounds the significands of results of
11540 floating-point operations to 64 bits (extended double precision), which is
11541 the default.  When this option is used, floating-point operations in higher
11542 precisions are not available to the programmer without setting the FPU
11543 control word explicitly.
11544
11545 Setting the rounding of floating-point operations to less than the default
11546 80 bits can speed some programs by 2% or more.  Note that some mathematical
11547 libraries assume that extended precision (80 bit) floating-point operations
11548 are enabled by default; routines in such libraries could suffer significant
11549 loss of accuracy, typically through so-called "catastrophic cancellation",
11550 when this option is used to set the precision to less than extended precision.
11551
11552 @item -mstackrealign
11553 @opindex mstackrealign
11554 Realign the stack at entry.  On the Intel x86, the @option{-mstackrealign}
11555 option will generate an alternate prologue and epilogue that realigns the
11556 runtime stack if necessary.  This supports mixing legacy codes that keep
11557 a 4-byte aligned stack with modern codes that keep a 16-byte stack for
11558 SSE compatibility.  See also the attribute @code{force_align_arg_pointer},
11559 applicable to individual functions.
11560
11561 @item -mpreferred-stack-boundary=@var{num}
11562 @opindex mpreferred-stack-boundary
11563 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
11564 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
11565 the default is 4 (16 bytes or 128 bits).
11566
11567 @item -mincoming-stack-boundary=@var{num}
11568 @opindex mincoming-stack-boundary
11569 Assume the incoming stack is aligned to a 2 raised to @var{num} byte
11570 boundary.  If @option{-mincoming-stack-boundary} is not specified,
11571 the one specified by @option{-mpreferred-stack-boundary} will be used.
11572
11573 On Pentium and PentiumPro, @code{double} and @code{long double} values
11574 should be aligned to an 8 byte boundary (see @option{-malign-double}) or
11575 suffer significant run time performance penalties.  On Pentium III, the
11576 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
11577 properly if it is not 16 byte aligned.
11578
11579 To ensure proper alignment of this values on the stack, the stack boundary
11580 must be as aligned as that required by any value stored on the stack.
11581 Further, every function must be generated such that it keeps the stack
11582 aligned.  Thus calling a function compiled with a higher preferred
11583 stack boundary from a function compiled with a lower preferred stack
11584 boundary will most likely misalign the stack.  It is recommended that
11585 libraries that use callbacks always use the default setting.
11586
11587 This extra alignment does consume extra stack space, and generally
11588 increases code size.  Code that is sensitive to stack space usage, such
11589 as embedded systems and operating system kernels, may want to reduce the
11590 preferred alignment to @option{-mpreferred-stack-boundary=2}.
11591
11592 @item -mmmx
11593 @itemx -mno-mmx
11594 @itemx -msse
11595 @itemx -mno-sse
11596 @itemx -msse2
11597 @itemx -mno-sse2
11598 @itemx -msse3
11599 @itemx -mno-sse3
11600 @itemx -mssse3
11601 @itemx -mno-ssse3
11602 @itemx -msse4.1
11603 @itemx -mno-sse4.1
11604 @itemx -msse4.2
11605 @itemx -mno-sse4.2
11606 @itemx -msse4
11607 @itemx -mno-sse4
11608 @itemx -mavx
11609 @itemx -mno-avx
11610 @itemx -maes
11611 @itemx -mno-aes
11612 @itemx -mpclmul
11613 @itemx -mno-pclmul
11614 @itemx -msse4a
11615 @itemx -mno-sse4a
11616 @itemx -msse5
11617 @itemx -mno-sse5
11618 @itemx -m3dnow
11619 @itemx -mno-3dnow
11620 @itemx -mpopcnt
11621 @itemx -mno-popcnt
11622 @itemx -mabm
11623 @itemx -mno-abm
11624 @opindex mmmx
11625 @opindex mno-mmx
11626 @opindex msse
11627 @opindex mno-sse
11628 @opindex m3dnow
11629 @opindex mno-3dnow
11630 These switches enable or disable the use of instructions in the MMX,
11631 SSE, SSE2, SSE3, SSSE3, SSE4.1, AVX, AES, PCLMUL, SSE4A, SSE5, ABM or
11632 3DNow!@: extended instruction sets.
11633 These extensions are also available as built-in functions: see
11634 @ref{X86 Built-in Functions}, for details of the functions enabled and
11635 disabled by these switches.
11636
11637 To have SSE/SSE2 instructions generated automatically from floating-point
11638 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
11639
11640 GCC depresses SSEx instructions when @option{-mavx} is used. Instead, it
11641 generates new AVX instructions or AVX equivalence for all SSEx instructions
11642 when needed.
11643
11644 These options will enable GCC to use these extended instructions in
11645 generated code, even without @option{-mfpmath=sse}.  Applications which
11646 perform runtime CPU detection must compile separate files for each
11647 supported architecture, using the appropriate flags.  In particular,
11648 the file containing the CPU detection code should be compiled without
11649 these options.
11650
11651 @item -mcld
11652 @opindex mcld
11653 This option instructs GCC to emit a @code{cld} instruction in the prologue
11654 of functions that use string instructions.  String instructions depend on
11655 the DF flag to select between autoincrement or autodecrement mode.  While the
11656 ABI specifies the DF flag to be cleared on function entry, some operating
11657 systems violate this specification by not clearing the DF flag in their
11658 exception dispatchers.  The exception handler can be invoked with the DF flag
11659 set which leads to wrong direction mode, when string instructions are used.
11660 This option can be enabled by default on 32-bit x86 targets by configuring
11661 GCC with the @option{--enable-cld} configure option.  Generation of @code{cld}
11662 instructions can be suppressed with the @option{-mno-cld} compiler option
11663 in this case.
11664
11665 @item -mcx16
11666 @opindex mcx16
11667 This option will enable GCC to use CMPXCHG16B instruction in generated code.
11668 CMPXCHG16B allows for atomic operations on 128-bit double quadword (or oword)
11669 data types.  This is useful for high resolution counters that could be updated
11670 by multiple processors (or cores).  This instruction is generated as part of
11671 atomic built-in functions: see @ref{Atomic Builtins} for details.
11672
11673 @item -msahf
11674 @opindex msahf
11675 This option will enable GCC to use SAHF instruction in generated 64-bit code.
11676 Early Intel CPUs with Intel 64 lacked LAHF and SAHF instructions supported
11677 by AMD64 until introduction of Pentium 4 G1 step in December 2005.  LAHF and
11678 SAHF are load and store instructions, respectively, for certain status flags.
11679 In 64-bit mode, SAHF instruction is used to optimize @code{fmod}, @code{drem}
11680 or @code{remainder} built-in functions: see @ref{Other Builtins} for details.
11681
11682 @item -mmovbe
11683 @opindex mmovbe
11684 This option will enable GCC to use movbe instruction to implement
11685 @code{__builtin_bswap32} and @code{__builtin_bswap64}.
11686
11687 @item -mcrc32
11688 @opindex mcrc32
11689 This option will enable built-in functions, @code{__builtin_ia32_crc32qi},
11690 @code{__builtin_ia32_crc32hi}. @code{__builtin_ia32_crc32si} and
11691 @code{__builtin_ia32_crc32di} to generate the crc32 machine instruction.
11692
11693 @item -mrecip
11694 @opindex mrecip
11695 This option will enable GCC to use RCPSS and RSQRTSS instructions (and their
11696 vectorized variants RCPPS and RSQRTPS) with an additional Newton-Raphson step
11697 to increase precision instead of DIVSS and SQRTSS (and their vectorized
11698 variants) for single precision floating point arguments.  These instructions
11699 are generated only when @option{-funsafe-math-optimizations} is enabled
11700 together with @option{-finite-math-only} and @option{-fno-trapping-math}.
11701 Note that while the throughput of the sequence is higher than the throughput
11702 of the non-reciprocal instruction, the precision of the sequence can be
11703 decreased by up to 2 ulp (i.e. the inverse of 1.0 equals 0.99999994).
11704
11705 @item -mveclibabi=@var{type}
11706 @opindex mveclibabi
11707 Specifies the ABI type to use for vectorizing intrinsics using an
11708 external library.  Supported types are @code{svml} for the Intel short
11709 vector math library and @code{acml} for the AMD math core library style
11710 of interfacing.  GCC will currently emit calls to @code{vmldExp2},
11711 @code{vmldLn2}, @code{vmldLog102}, @code{vmldLog102}, @code{vmldPow2},
11712 @code{vmldTanh2}, @code{vmldTan2}, @code{vmldAtan2}, @code{vmldAtanh2},
11713 @code{vmldCbrt2}, @code{vmldSinh2}, @code{vmldSin2}, @code{vmldAsinh2},
11714 @code{vmldAsin2}, @code{vmldCosh2}, @code{vmldCos2}, @code{vmldAcosh2},
11715 @code{vmldAcos2}, @code{vmlsExp4}, @code{vmlsLn4}, @code{vmlsLog104},
11716 @code{vmlsLog104}, @code{vmlsPow4}, @code{vmlsTanh4}, @code{vmlsTan4},
11717 @code{vmlsAtan4}, @code{vmlsAtanh4}, @code{vmlsCbrt4}, @code{vmlsSinh4},
11718 @code{vmlsSin4}, @code{vmlsAsinh4}, @code{vmlsAsin4}, @code{vmlsCosh4},
11719 @code{vmlsCos4}, @code{vmlsAcosh4} and @code{vmlsAcos4} for corresponding
11720 function type when @option{-mveclibabi=svml} is used and @code{__vrd2_sin},
11721 @code{__vrd2_cos}, @code{__vrd2_exp}, @code{__vrd2_log}, @code{__vrd2_log2},
11722 @code{__vrd2_log10}, @code{__vrs4_sinf}, @code{__vrs4_cosf},
11723 @code{__vrs4_expf}, @code{__vrs4_logf}, @code{__vrs4_log2f},
11724 @code{__vrs4_log10f} and @code{__vrs4_powf} for corresponding function type
11725 when @option{-mveclibabi=acml} is used. Both @option{-ftree-vectorize} and
11726 @option{-funsafe-math-optimizations} have to be enabled. A SVML or ACML ABI
11727 compatible library will have to be specified at link time.
11728
11729 @item -mabi=@var{name}
11730 @opindex mabi
11731 Generate code for the specified calling convention.  Permissible values
11732 are: @samp{sysv} for the ABI used on GNU/Linux and other systems and
11733 @samp{ms} for the Microsoft ABI.  The default is to use the Microsoft
11734 ABI when targeting Windows.  On all other systems, the default is the
11735 SYSV ABI.  You can control this behavior for a specific function by
11736 using the function attribute @samp{ms_abi}/@samp{sysv_abi}.
11737 @xref{Function Attributes}.
11738
11739 @item -mpush-args
11740 @itemx -mno-push-args
11741 @opindex mpush-args
11742 @opindex mno-push-args
11743 Use PUSH operations to store outgoing parameters.  This method is shorter
11744 and usually equally fast as method using SUB/MOV operations and is enabled
11745 by default.  In some cases disabling it may improve performance because of
11746 improved scheduling and reduced dependencies.
11747
11748 @item -maccumulate-outgoing-args
11749 @opindex maccumulate-outgoing-args
11750 If enabled, the maximum amount of space required for outgoing arguments will be
11751 computed in the function prologue.  This is faster on most modern CPUs
11752 because of reduced dependencies, improved scheduling and reduced stack usage
11753 when preferred stack boundary is not equal to 2.  The drawback is a notable
11754 increase in code size.  This switch implies @option{-mno-push-args}.
11755
11756 @item -mthreads
11757 @opindex mthreads
11758 Support thread-safe exception handling on @samp{Mingw32}.  Code that relies
11759 on thread-safe exception handling must compile and link all code with the
11760 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
11761 @option{-D_MT}; when linking, it links in a special thread helper library
11762 @option{-lmingwthrd} which cleans up per thread exception handling data.
11763
11764 @item -mno-align-stringops
11765 @opindex mno-align-stringops
11766 Do not align destination of inlined string operations.  This switch reduces
11767 code size and improves performance in case the destination is already aligned,
11768 but GCC doesn't know about it.
11769
11770 @item -minline-all-stringops
11771 @opindex minline-all-stringops
11772 By default GCC inlines string operations only when destination is known to be
11773 aligned at least to 4 byte boundary.  This enables more inlining, increase code
11774 size, but may improve performance of code that depends on fast memcpy, strlen
11775 and memset for short lengths.
11776
11777 @item -minline-stringops-dynamically
11778 @opindex minline-stringops-dynamically
11779 For string operation of unknown size, inline runtime checks so for small
11780 blocks inline code is used, while for large blocks library call is used.
11781
11782 @item -mstringop-strategy=@var{alg}
11783 @opindex mstringop-strategy=@var{alg}
11784 Overwrite internal decision heuristic about particular algorithm to inline
11785 string operation with.  The allowed values are @code{rep_byte},
11786 @code{rep_4byte}, @code{rep_8byte} for expanding using i386 @code{rep} prefix
11787 of specified size, @code{byte_loop}, @code{loop}, @code{unrolled_loop} for
11788 expanding inline loop, @code{libcall} for always expanding library call.
11789
11790 @item -momit-leaf-frame-pointer
11791 @opindex momit-leaf-frame-pointer
11792 Don't keep the frame pointer in a register for leaf functions.  This
11793 avoids the instructions to save, set up and restore frame pointers and
11794 makes an extra register available in leaf functions.  The option
11795 @option{-fomit-frame-pointer} removes the frame pointer for all functions
11796 which might make debugging harder.
11797
11798 @item -mtls-direct-seg-refs
11799 @itemx -mno-tls-direct-seg-refs
11800 @opindex mtls-direct-seg-refs
11801 Controls whether TLS variables may be accessed with offsets from the
11802 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
11803 or whether the thread base pointer must be added.  Whether or not this
11804 is legal depends on the operating system, and whether it maps the
11805 segment to cover the entire TLS area.
11806
11807 For systems that use GNU libc, the default is on.
11808
11809 @item -mfused-madd
11810 @itemx -mno-fused-madd
11811 @opindex mfused-madd
11812 Enable automatic generation of fused floating point multiply-add instructions
11813 if the ISA supports such instructions.  The -mfused-madd option is on by
11814 default.  The fused multiply-add instructions have a different
11815 rounding behavior compared to executing a multiply followed by an add.
11816
11817 @item -msse2avx
11818 @itemx -mno-sse2avx
11819 @opindex msse2avx
11820 Specify that the assembler should encode SSE instructions with VEX
11821 prefix.  The option @option{-mavx} turns this on by default.
11822 @end table
11823
11824 These @samp{-m} switches are supported in addition to the above
11825 on AMD x86-64 processors in 64-bit environments.
11826
11827 @table @gcctabopt
11828 @item -m32
11829 @itemx -m64
11830 @opindex m32
11831 @opindex m64
11832 Generate code for a 32-bit or 64-bit environment.
11833 The 32-bit environment sets int, long and pointer to 32 bits and
11834 generates code that runs on any i386 system.
11835 The 64-bit environment sets int to 32 bits and long and pointer
11836 to 64 bits and generates code for AMD's x86-64 architecture. For
11837 darwin only the -m64 option turns off the @option{-fno-pic} and
11838 @option{-mdynamic-no-pic} options.
11839
11840 @item -mno-red-zone
11841 @opindex mno-red-zone
11842 Do not use a so called red zone for x86-64 code.  The red zone is mandated
11843 by the x86-64 ABI, it is a 128-byte area beyond the location of the
11844 stack pointer that will not be modified by signal or interrupt handlers
11845 and therefore can be used for temporary data without adjusting the stack
11846 pointer.  The flag @option{-mno-red-zone} disables this red zone.
11847
11848 @item -mcmodel=small
11849 @opindex mcmodel=small
11850 Generate code for the small code model: the program and its symbols must
11851 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
11852 Programs can be statically or dynamically linked.  This is the default
11853 code model.
11854
11855 @item -mcmodel=kernel
11856 @opindex mcmodel=kernel
11857 Generate code for the kernel code model.  The kernel runs in the
11858 negative 2 GB of the address space.
11859 This model has to be used for Linux kernel code.
11860
11861 @item -mcmodel=medium
11862 @opindex mcmodel=medium
11863 Generate code for the medium model: The program is linked in the lower 2
11864 GB of the address space.  Small symbols are also placed there.  Symbols
11865 with sizes larger than @option{-mlarge-data-threshold} are put into
11866 large data or bss sections and can be located above 2GB.  Programs can
11867 be statically or dynamically linked.
11868
11869 @item -mcmodel=large
11870 @opindex mcmodel=large
11871 Generate code for the large model: This model makes no assumptions
11872 about addresses and sizes of sections.
11873 @end table
11874
11875 @node IA-64 Options
11876 @subsection IA-64 Options
11877 @cindex IA-64 Options
11878
11879 These are the @samp{-m} options defined for the Intel IA-64 architecture.
11880
11881 @table @gcctabopt
11882 @item -mbig-endian
11883 @opindex mbig-endian
11884 Generate code for a big endian target.  This is the default for HP-UX@.
11885
11886 @item -mlittle-endian
11887 @opindex mlittle-endian
11888 Generate code for a little endian target.  This is the default for AIX5
11889 and GNU/Linux.
11890
11891 @item -mgnu-as
11892 @itemx -mno-gnu-as
11893 @opindex mgnu-as
11894 @opindex mno-gnu-as
11895 Generate (or don't) code for the GNU assembler.  This is the default.
11896 @c Also, this is the default if the configure option @option{--with-gnu-as}
11897 @c is used.
11898
11899 @item -mgnu-ld
11900 @itemx -mno-gnu-ld
11901 @opindex mgnu-ld
11902 @opindex mno-gnu-ld
11903 Generate (or don't) code for the GNU linker.  This is the default.
11904 @c Also, this is the default if the configure option @option{--with-gnu-ld}
11905 @c is used.
11906
11907 @item -mno-pic
11908 @opindex mno-pic
11909 Generate code that does not use a global pointer register.  The result
11910 is not position independent code, and violates the IA-64 ABI@.
11911
11912 @item -mvolatile-asm-stop
11913 @itemx -mno-volatile-asm-stop
11914 @opindex mvolatile-asm-stop
11915 @opindex mno-volatile-asm-stop
11916 Generate (or don't) a stop bit immediately before and after volatile asm
11917 statements.
11918
11919 @item -mregister-names
11920 @itemx -mno-register-names
11921 @opindex mregister-names
11922 @opindex mno-register-names
11923 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
11924 the stacked registers.  This may make assembler output more readable.
11925
11926 @item -mno-sdata
11927 @itemx -msdata
11928 @opindex mno-sdata
11929 @opindex msdata
11930 Disable (or enable) optimizations that use the small data section.  This may
11931 be useful for working around optimizer bugs.
11932
11933 @item -mconstant-gp
11934 @opindex mconstant-gp
11935 Generate code that uses a single constant global pointer value.  This is
11936 useful when compiling kernel code.
11937
11938 @item -mauto-pic
11939 @opindex mauto-pic
11940 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
11941 This is useful when compiling firmware code.
11942
11943 @item -minline-float-divide-min-latency
11944 @opindex minline-float-divide-min-latency
11945 Generate code for inline divides of floating point values
11946 using the minimum latency algorithm.
11947
11948 @item -minline-float-divide-max-throughput
11949 @opindex minline-float-divide-max-throughput
11950 Generate code for inline divides of floating point values
11951 using the maximum throughput algorithm.
11952
11953 @item -mno-inline-float-divide
11954 @opindex mno-inline-float-divide
11955 Do not generate inline code for divides of floating point values.
11956
11957 @item -minline-int-divide-min-latency
11958 @opindex minline-int-divide-min-latency
11959 Generate code for inline divides of integer values
11960 using the minimum latency algorithm.
11961
11962 @item -minline-int-divide-max-throughput
11963 @opindex minline-int-divide-max-throughput
11964 Generate code for inline divides of integer values
11965 using the maximum throughput algorithm.
11966
11967 @item -mno-inline-int-divide
11968 @opindex mno-inline-int-divide
11969 Do not generate inline code for divides of integer values.
11970
11971 @item -minline-sqrt-min-latency
11972 @opindex minline-sqrt-min-latency
11973 Generate code for inline square roots
11974 using the minimum latency algorithm.
11975
11976 @item -minline-sqrt-max-throughput
11977 @opindex minline-sqrt-max-throughput
11978 Generate code for inline square roots
11979 using the maximum throughput algorithm.
11980
11981 @item -mno-inline-sqrt
11982 @opindex mno-inline-sqrt
11983 Do not generate inline code for sqrt.
11984
11985 @item -mfused-madd
11986 @itemx -mno-fused-madd
11987 @opindex mfused-madd
11988 @opindex mno-fused-madd
11989 Do (don't) generate code that uses the fused multiply/add or multiply/subtract
11990 instructions.    The default is to use these instructions.
11991
11992 @item -mno-dwarf2-asm
11993 @itemx -mdwarf2-asm
11994 @opindex mno-dwarf2-asm
11995 @opindex mdwarf2-asm
11996 Don't (or do) generate assembler code for the DWARF2 line number debugging
11997 info.  This may be useful when not using the GNU assembler.
11998
11999 @item -mearly-stop-bits
12000 @itemx -mno-early-stop-bits
12001 @opindex mearly-stop-bits
12002 @opindex mno-early-stop-bits
12003 Allow stop bits to be placed earlier than immediately preceding the
12004 instruction that triggered the stop bit.  This can improve instruction
12005 scheduling, but does not always do so.
12006
12007 @item -mfixed-range=@var{register-range}
12008 @opindex mfixed-range
12009 Generate code treating the given register range as fixed registers.
12010 A fixed register is one that the register allocator can not use.  This is
12011 useful when compiling kernel code.  A register range is specified as
12012 two registers separated by a dash.  Multiple register ranges can be
12013 specified separated by a comma.
12014
12015 @item -mtls-size=@var{tls-size}
12016 @opindex mtls-size
12017 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
12018 64.
12019
12020 @item -mtune=@var{cpu-type}
12021 @opindex mtune
12022 Tune the instruction scheduling for a particular CPU, Valid values are
12023 itanium, itanium1, merced, itanium2, and mckinley.
12024
12025 @item -milp32
12026 @itemx -mlp64
12027 @opindex milp32
12028 @opindex mlp64
12029 Generate code for a 32-bit or 64-bit environment.
12030 The 32-bit environment sets int, long and pointer to 32 bits.
12031 The 64-bit environment sets int to 32 bits and long and pointer
12032 to 64 bits.  These are HP-UX specific flags.
12033
12034 @item -mno-sched-br-data-spec
12035 @itemx -msched-br-data-spec
12036 @opindex mno-sched-br-data-spec
12037 @opindex msched-br-data-spec
12038 (Dis/En)able data speculative scheduling before reload.
12039 This will result in generation of the ld.a instructions and
12040 the corresponding check instructions (ld.c / chk.a).
12041 The default is 'disable'.
12042
12043 @item -msched-ar-data-spec
12044 @itemx -mno-sched-ar-data-spec
12045 @opindex msched-ar-data-spec
12046 @opindex mno-sched-ar-data-spec
12047 (En/Dis)able data speculative scheduling after reload.
12048 This will result in generation of the ld.a instructions and
12049 the corresponding check instructions (ld.c / chk.a).
12050 The default is 'enable'.
12051
12052 @item -mno-sched-control-spec
12053 @itemx -msched-control-spec
12054 @opindex mno-sched-control-spec
12055 @opindex msched-control-spec
12056 (Dis/En)able control speculative scheduling.  This feature is
12057 available only during region scheduling (i.e.@: before reload).
12058 This will result in generation of the ld.s instructions and
12059 the corresponding check instructions chk.s .
12060 The default is 'disable'.
12061
12062 @item -msched-br-in-data-spec
12063 @itemx -mno-sched-br-in-data-spec
12064 @opindex msched-br-in-data-spec
12065 @opindex mno-sched-br-in-data-spec
12066 (En/Dis)able speculative scheduling of the instructions that
12067 are dependent on the data speculative loads before reload.
12068 This is effective only with @option{-msched-br-data-spec} enabled.
12069 The default is 'enable'.
12070
12071 @item -msched-ar-in-data-spec
12072 @itemx -mno-sched-ar-in-data-spec
12073 @opindex msched-ar-in-data-spec
12074 @opindex mno-sched-ar-in-data-spec
12075 (En/Dis)able speculative scheduling of the instructions that
12076 are dependent on the data speculative loads after reload.
12077 This is effective only with @option{-msched-ar-data-spec} enabled.
12078 The default is 'enable'.
12079
12080 @item -msched-in-control-spec
12081 @itemx -mno-sched-in-control-spec
12082 @opindex msched-in-control-spec
12083 @opindex mno-sched-in-control-spec
12084 (En/Dis)able speculative scheduling of the instructions that
12085 are dependent on the control speculative loads.
12086 This is effective only with @option{-msched-control-spec} enabled.
12087 The default is 'enable'.
12088
12089 @item -mno-sched-prefer-non-data-spec-insns
12090 @itemx -msched-prefer-non-data-spec-insns
12091 @opindex mno-sched-prefer-non-data-spec-insns
12092 @opindex msched-prefer-non-data-spec-insns
12093 If enabled, data speculative instructions will be chosen for schedule
12094 only if there are no other choices at the moment.  This will make
12095 the use of the data speculation much more conservative.
12096 The default is 'disable'.
12097
12098 @item -mno-sched-prefer-non-control-spec-insns
12099 @itemx -msched-prefer-non-control-spec-insns
12100 @opindex mno-sched-prefer-non-control-spec-insns
12101 @opindex msched-prefer-non-control-spec-insns
12102 If enabled, control speculative instructions will be chosen for schedule
12103 only if there are no other choices at the moment.  This will make
12104 the use of the control speculation much more conservative.
12105 The default is 'disable'.
12106
12107 @item -mno-sched-count-spec-in-critical-path
12108 @itemx -msched-count-spec-in-critical-path
12109 @opindex mno-sched-count-spec-in-critical-path
12110 @opindex msched-count-spec-in-critical-path
12111 If enabled, speculative dependencies will be considered during
12112 computation of the instructions priorities.  This will make the use of the
12113 speculation a bit more conservative.
12114 The default is 'disable'.
12115
12116 @item -msched-spec-ldc
12117 @opindex msched-spec-ldc
12118 Use a simple data speculation check.  This option is on by default.
12119
12120 @item -msched-control-spec-ldc
12121 @opindex msched-spec-ldc
12122 Use a simple check for control speculation.  This option is on by default.
12123
12124 @item -msched-stop-bits-after-every-cycle
12125 @opindex msched-stop-bits-after-every-cycle
12126 Place a stop bit after every cycle when scheduling.  This option is on
12127 by default.
12128
12129 @item -msched-fp-mem-deps-zero-cost
12130 @opindex msched-fp-mem-deps-zero-cost
12131 Assume that floating-point stores and loads are not likely to cause a conflict
12132 when placed into the same instruction group.  This option is disabled by
12133 default.
12134
12135 @item -msel-sched-dont-check-control-spec
12136 @opindex msel-sched-dont-check-control-spec
12137 Generate checks for control speculation in selective scheduling.
12138 This flag is disabled by default.
12139
12140 @item -msched-max-memory-insns=@var{max-insns}
12141 @opindex msched-max-memory-insns
12142 Limit on the number of memory insns per instruction group, giving lower
12143 priority to subsequent memory insns attempting to schedule in the same
12144 instruction group. Frequently useful to prevent cache bank conflicts.
12145 The default value is 1.
12146
12147 @item -msched-max-memory-insns-hard-limit
12148 @opindex msched-max-memory-insns-hard-limit
12149 Disallow more than `msched-max-memory-insns' in instruction group.
12150 Otherwise, limit is `soft' meaning that we would prefer non-memory operations
12151 when limit is reached but may still schedule memory operations.
12152
12153 @end table
12154
12155 @node M32C Options
12156 @subsection M32C Options
12157 @cindex M32C options
12158
12159 @table @gcctabopt
12160 @item -mcpu=@var{name}
12161 @opindex mcpu=
12162 Select the CPU for which code is generated.  @var{name} may be one of
12163 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
12164 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
12165 the M32C/80 series.
12166
12167 @item -msim
12168 @opindex msim
12169 Specifies that the program will be run on the simulator.  This causes
12170 an alternate runtime library to be linked in which supports, for
12171 example, file I/O@.  You must not use this option when generating
12172 programs that will run on real hardware; you must provide your own
12173 runtime library for whatever I/O functions are needed.
12174
12175 @item -memregs=@var{number}
12176 @opindex memregs=
12177 Specifies the number of memory-based pseudo-registers GCC will use
12178 during code generation.  These pseudo-registers will be used like real
12179 registers, so there is a tradeoff between GCC's ability to fit the
12180 code into available registers, and the performance penalty of using
12181 memory instead of registers.  Note that all modules in a program must
12182 be compiled with the same value for this option.  Because of that, you
12183 must not use this option with the default runtime libraries gcc
12184 builds.
12185
12186 @end table
12187
12188 @node M32R/D Options
12189 @subsection M32R/D Options
12190 @cindex M32R/D options
12191
12192 These @option{-m} options are defined for Renesas M32R/D architectures:
12193
12194 @table @gcctabopt
12195 @item -m32r2
12196 @opindex m32r2
12197 Generate code for the M32R/2@.
12198
12199 @item -m32rx
12200 @opindex m32rx
12201 Generate code for the M32R/X@.
12202
12203 @item -m32r
12204 @opindex m32r
12205 Generate code for the M32R@.  This is the default.
12206
12207 @item -mmodel=small
12208 @opindex mmodel=small
12209 Assume all objects live in the lower 16MB of memory (so that their addresses
12210 can be loaded with the @code{ld24} instruction), and assume all subroutines
12211 are reachable with the @code{bl} instruction.
12212 This is the default.
12213
12214 The addressability of a particular object can be set with the
12215 @code{model} attribute.
12216
12217 @item -mmodel=medium
12218 @opindex mmodel=medium
12219 Assume objects may be anywhere in the 32-bit address space (the compiler
12220 will generate @code{seth/add3} instructions to load their addresses), and
12221 assume all subroutines are reachable with the @code{bl} instruction.
12222
12223 @item -mmodel=large
12224 @opindex mmodel=large
12225 Assume objects may be anywhere in the 32-bit address space (the compiler
12226 will generate @code{seth/add3} instructions to load their addresses), and
12227 assume subroutines may not be reachable with the @code{bl} instruction
12228 (the compiler will generate the much slower @code{seth/add3/jl}
12229 instruction sequence).
12230
12231 @item -msdata=none
12232 @opindex msdata=none
12233 Disable use of the small data area.  Variables will be put into
12234 one of @samp{.data}, @samp{bss}, or @samp{.rodata} (unless the
12235 @code{section} attribute has been specified).
12236 This is the default.
12237
12238 The small data area consists of sections @samp{.sdata} and @samp{.sbss}.
12239 Objects may be explicitly put in the small data area with the
12240 @code{section} attribute using one of these sections.
12241
12242 @item -msdata=sdata
12243 @opindex msdata=sdata
12244 Put small global and static data in the small data area, but do not
12245 generate special code to reference them.
12246
12247 @item -msdata=use
12248 @opindex msdata=use
12249 Put small global and static data in the small data area, and generate
12250 special instructions to reference them.
12251
12252 @item -G @var{num}
12253 @opindex G
12254 @cindex smaller data references
12255 Put global and static objects less than or equal to @var{num} bytes
12256 into the small data or bss sections instead of the normal data or bss
12257 sections.  The default value of @var{num} is 8.
12258 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
12259 for this option to have any effect.
12260
12261 All modules should be compiled with the same @option{-G @var{num}} value.
12262 Compiling with different values of @var{num} may or may not work; if it
12263 doesn't the linker will give an error message---incorrect code will not be
12264 generated.
12265
12266 @item -mdebug
12267 @opindex mdebug
12268 Makes the M32R specific code in the compiler display some statistics
12269 that might help in debugging programs.
12270
12271 @item -malign-loops
12272 @opindex malign-loops
12273 Align all loops to a 32-byte boundary.
12274
12275 @item -mno-align-loops
12276 @opindex mno-align-loops
12277 Do not enforce a 32-byte alignment for loops.  This is the default.
12278
12279 @item -missue-rate=@var{number}
12280 @opindex missue-rate=@var{number}
12281 Issue @var{number} instructions per cycle.  @var{number} can only be 1
12282 or 2.
12283
12284 @item -mbranch-cost=@var{number}
12285 @opindex mbranch-cost=@var{number}
12286 @var{number} can only be 1 or 2.  If it is 1 then branches will be
12287 preferred over conditional code, if it is 2, then the opposite will
12288 apply.
12289
12290 @item -mflush-trap=@var{number}
12291 @opindex mflush-trap=@var{number}
12292 Specifies the trap number to use to flush the cache.  The default is
12293 12.  Valid numbers are between 0 and 15 inclusive.
12294
12295 @item -mno-flush-trap
12296 @opindex mno-flush-trap
12297 Specifies that the cache cannot be flushed by using a trap.
12298
12299 @item -mflush-func=@var{name}
12300 @opindex mflush-func=@var{name}
12301 Specifies the name of the operating system function to call to flush
12302 the cache.  The default is @emph{_flush_cache}, but a function call
12303 will only be used if a trap is not available.
12304
12305 @item -mno-flush-func
12306 @opindex mno-flush-func
12307 Indicates that there is no OS function for flushing the cache.
12308
12309 @end table
12310
12311 @node M680x0 Options
12312 @subsection M680x0 Options
12313 @cindex M680x0 options
12314
12315 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
12316 The default settings depend on which architecture was selected when
12317 the compiler was configured; the defaults for the most common choices
12318 are given below.
12319
12320 @table @gcctabopt
12321 @item -march=@var{arch}
12322 @opindex march
12323 Generate code for a specific M680x0 or ColdFire instruction set
12324 architecture.  Permissible values of @var{arch} for M680x0
12325 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
12326 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
12327 architectures are selected according to Freescale's ISA classification
12328 and the permissible values are: @samp{isaa}, @samp{isaaplus},
12329 @samp{isab} and @samp{isac}.
12330
12331 gcc defines a macro @samp{__mcf@var{arch}__} whenever it is generating
12332 code for a ColdFire target.  The @var{arch} in this macro is one of the
12333 @option{-march} arguments given above.
12334
12335 When used together, @option{-march} and @option{-mtune} select code
12336 that runs on a family of similar processors but that is optimized
12337 for a particular microarchitecture.
12338
12339 @item -mcpu=@var{cpu}
12340 @opindex mcpu
12341 Generate code for a specific M680x0 or ColdFire processor.
12342 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
12343 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
12344 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
12345 below, which also classifies the CPUs into families:
12346
12347 @multitable @columnfractions 0.20 0.80
12348 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
12349 @item @samp{51} @tab @samp{51} @samp{51ac} @samp{51cn} @samp{51em} @samp{51qe}
12350 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
12351 @item @samp{5206e} @tab @samp{5206e}
12352 @item @samp{5208} @tab @samp{5207} @samp{5208}
12353 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
12354 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
12355 @item @samp{5216} @tab @samp{5214} @samp{5216}
12356 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
12357 @item @samp{5225} @tab @samp{5224} @samp{5225}
12358 @item @samp{52259} @tab @samp{52252} @samp{52254} @samp{52255} @samp{52256} @samp{52258} @samp{52259}
12359 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
12360 @item @samp{5249} @tab @samp{5249}
12361 @item @samp{5250} @tab @samp{5250}
12362 @item @samp{5271} @tab @samp{5270} @samp{5271}
12363 @item @samp{5272} @tab @samp{5272}
12364 @item @samp{5275} @tab @samp{5274} @samp{5275}
12365 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
12366 @item @samp{53017} @tab @samp{53011} @samp{53012} @samp{53013} @samp{53014} @samp{53015} @samp{53016} @samp{53017}
12367 @item @samp{5307} @tab @samp{5307}
12368 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
12369 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
12370 @item @samp{5407} @tab @samp{5407}
12371 @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}
12372 @end multitable
12373
12374 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
12375 @var{arch} is compatible with @var{cpu}.  Other combinations of
12376 @option{-mcpu} and @option{-march} are rejected.
12377
12378 gcc defines the macro @samp{__mcf_cpu_@var{cpu}} when ColdFire target
12379 @var{cpu} is selected.  It also defines @samp{__mcf_family_@var{family}},
12380 where the value of @var{family} is given by the table above.
12381
12382 @item -mtune=@var{tune}
12383 @opindex mtune
12384 Tune the code for a particular microarchitecture, within the
12385 constraints set by @option{-march} and @option{-mcpu}.
12386 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
12387 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
12388 and @samp{cpu32}.  The ColdFire microarchitectures
12389 are: @samp{cfv1}, @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
12390
12391 You can also use @option{-mtune=68020-40} for code that needs
12392 to run relatively well on 68020, 68030 and 68040 targets.
12393 @option{-mtune=68020-60} is similar but includes 68060 targets
12394 as well.  These two options select the same tuning decisions as
12395 @option{-m68020-40} and @option{-m68020-60} respectively.
12396
12397 gcc defines the macros @samp{__mc@var{arch}} and @samp{__mc@var{arch}__}
12398 when tuning for 680x0 architecture @var{arch}.  It also defines
12399 @samp{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
12400 option is used.  If gcc is tuning for a range of architectures,
12401 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
12402 it defines the macros for every architecture in the range.
12403
12404 gcc also defines the macro @samp{__m@var{uarch}__} when tuning for
12405 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
12406 of the arguments given above.
12407
12408 @item -m68000
12409 @itemx -mc68000
12410 @opindex m68000
12411 @opindex mc68000
12412 Generate output for a 68000.  This is the default
12413 when the compiler is configured for 68000-based systems.
12414 It is equivalent to @option{-march=68000}.
12415
12416 Use this option for microcontrollers with a 68000 or EC000 core,
12417 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
12418
12419 @item -m68010
12420 @opindex m68010
12421 Generate output for a 68010.  This is the default
12422 when the compiler is configured for 68010-based systems.
12423 It is equivalent to @option{-march=68010}.
12424
12425 @item -m68020
12426 @itemx -mc68020
12427 @opindex m68020
12428 @opindex mc68020
12429 Generate output for a 68020.  This is the default
12430 when the compiler is configured for 68020-based systems.
12431 It is equivalent to @option{-march=68020}.
12432
12433 @item -m68030
12434 @opindex m68030
12435 Generate output for a 68030.  This is the default when the compiler is
12436 configured for 68030-based systems.  It is equivalent to
12437 @option{-march=68030}.
12438
12439 @item -m68040
12440 @opindex m68040
12441 Generate output for a 68040.  This is the default when the compiler is
12442 configured for 68040-based systems.  It is equivalent to
12443 @option{-march=68040}.
12444
12445 This option inhibits the use of 68881/68882 instructions that have to be
12446 emulated by software on the 68040.  Use this option if your 68040 does not
12447 have code to emulate those instructions.
12448
12449 @item -m68060
12450 @opindex m68060
12451 Generate output for a 68060.  This is the default when the compiler is
12452 configured for 68060-based systems.  It is equivalent to
12453 @option{-march=68060}.
12454
12455 This option inhibits the use of 68020 and 68881/68882 instructions that
12456 have to be emulated by software on the 68060.  Use this option if your 68060
12457 does not have code to emulate those instructions.
12458
12459 @item -mcpu32
12460 @opindex mcpu32
12461 Generate output for a CPU32.  This is the default
12462 when the compiler is configured for CPU32-based systems.
12463 It is equivalent to @option{-march=cpu32}.
12464
12465 Use this option for microcontrollers with a
12466 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
12467 68336, 68340, 68341, 68349 and 68360.
12468
12469 @item -m5200
12470 @opindex m5200
12471 Generate output for a 520X ColdFire CPU@.  This is the default
12472 when the compiler is configured for 520X-based systems.
12473 It is equivalent to @option{-mcpu=5206}, and is now deprecated
12474 in favor of that option.
12475
12476 Use this option for microcontroller with a 5200 core, including
12477 the MCF5202, MCF5203, MCF5204 and MCF5206.
12478
12479 @item -m5206e
12480 @opindex m5206e
12481 Generate output for a 5206e ColdFire CPU@.  The option is now
12482 deprecated in favor of the equivalent @option{-mcpu=5206e}.
12483
12484 @item -m528x
12485 @opindex m528x
12486 Generate output for a member of the ColdFire 528X family.
12487 The option is now deprecated in favor of the equivalent
12488 @option{-mcpu=528x}.
12489
12490 @item -m5307
12491 @opindex m5307
12492 Generate output for a ColdFire 5307 CPU@.  The option is now deprecated
12493 in favor of the equivalent @option{-mcpu=5307}.
12494
12495 @item -m5407
12496 @opindex m5407
12497 Generate output for a ColdFire 5407 CPU@.  The option is now deprecated
12498 in favor of the equivalent @option{-mcpu=5407}.
12499
12500 @item -mcfv4e
12501 @opindex mcfv4e
12502 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
12503 This includes use of hardware floating point instructions.
12504 The option is equivalent to @option{-mcpu=547x}, and is now
12505 deprecated in favor of that option.
12506
12507 @item -m68020-40
12508 @opindex m68020-40
12509 Generate output for a 68040, without using any of the new instructions.
12510 This results in code which can run relatively efficiently on either a
12511 68020/68881 or a 68030 or a 68040.  The generated code does use the
12512 68881 instructions that are emulated on the 68040.
12513
12514 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
12515
12516 @item -m68020-60
12517 @opindex m68020-60
12518 Generate output for a 68060, without using any of the new instructions.
12519 This results in code which can run relatively efficiently on either a
12520 68020/68881 or a 68030 or a 68040.  The generated code does use the
12521 68881 instructions that are emulated on the 68060.
12522
12523 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
12524
12525 @item -mhard-float
12526 @itemx -m68881
12527 @opindex mhard-float
12528 @opindex m68881
12529 Generate floating-point instructions.  This is the default for 68020
12530 and above, and for ColdFire devices that have an FPU@.  It defines the
12531 macro @samp{__HAVE_68881__} on M680x0 targets and @samp{__mcffpu__}
12532 on ColdFire targets.
12533
12534 @item -msoft-float
12535 @opindex msoft-float
12536 Do not generate floating-point instructions; use library calls instead.
12537 This is the default for 68000, 68010, and 68832 targets.  It is also
12538 the default for ColdFire devices that have no FPU.
12539
12540 @item -mdiv
12541 @itemx -mno-div
12542 @opindex mdiv
12543 @opindex mno-div
12544 Generate (do not generate) ColdFire hardware divide and remainder
12545 instructions.  If @option{-march} is used without @option{-mcpu},
12546 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
12547 architectures.  Otherwise, the default is taken from the target CPU
12548 (either the default CPU, or the one specified by @option{-mcpu}).  For
12549 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
12550 @option{-mcpu=5206e}.
12551
12552 gcc defines the macro @samp{__mcfhwdiv__} when this option is enabled.
12553
12554 @item -mshort
12555 @opindex mshort
12556 Consider type @code{int} to be 16 bits wide, like @code{short int}.
12557 Additionally, parameters passed on the stack are also aligned to a
12558 16-bit boundary even on targets whose API mandates promotion to 32-bit.
12559
12560 @item -mno-short
12561 @opindex mno-short
12562 Do not consider type @code{int} to be 16 bits wide.  This is the default.
12563
12564 @item -mnobitfield
12565 @itemx -mno-bitfield
12566 @opindex mnobitfield
12567 @opindex mno-bitfield
12568 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
12569 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
12570
12571 @item -mbitfield
12572 @opindex mbitfield
12573 Do use the bit-field instructions.  The @option{-m68020} option implies
12574 @option{-mbitfield}.  This is the default if you use a configuration
12575 designed for a 68020.
12576
12577 @item -mrtd
12578 @opindex mrtd
12579 Use a different function-calling convention, in which functions
12580 that take a fixed number of arguments return with the @code{rtd}
12581 instruction, which pops their arguments while returning.  This
12582 saves one instruction in the caller since there is no need to pop
12583 the arguments there.
12584
12585 This calling convention is incompatible with the one normally
12586 used on Unix, so you cannot use it if you need to call libraries
12587 compiled with the Unix compiler.
12588
12589 Also, you must provide function prototypes for all functions that
12590 take variable numbers of arguments (including @code{printf});
12591 otherwise incorrect code will be generated for calls to those
12592 functions.
12593
12594 In addition, seriously incorrect code will result if you call a
12595 function with too many arguments.  (Normally, extra arguments are
12596 harmlessly ignored.)
12597
12598 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
12599 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
12600
12601 @item -mno-rtd
12602 @opindex mno-rtd
12603 Do not use the calling conventions selected by @option{-mrtd}.
12604 This is the default.
12605
12606 @item -malign-int
12607 @itemx -mno-align-int
12608 @opindex malign-int
12609 @opindex mno-align-int
12610 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
12611 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
12612 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
12613 Aligning variables on 32-bit boundaries produces code that runs somewhat
12614 faster on processors with 32-bit busses at the expense of more memory.
12615
12616 @strong{Warning:} if you use the @option{-malign-int} switch, GCC will
12617 align structures containing the above types  differently than
12618 most published application binary interface specifications for the m68k.
12619
12620 @item -mpcrel
12621 @opindex mpcrel
12622 Use the pc-relative addressing mode of the 68000 directly, instead of
12623 using a global offset table.  At present, this option implies @option{-fpic},
12624 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
12625 not presently supported with @option{-mpcrel}, though this could be supported for
12626 68020 and higher processors.
12627
12628 @item -mno-strict-align
12629 @itemx -mstrict-align
12630 @opindex mno-strict-align
12631 @opindex mstrict-align
12632 Do not (do) assume that unaligned memory references will be handled by
12633 the system.
12634
12635 @item -msep-data
12636 Generate code that allows the data segment to be located in a different
12637 area of memory from the text segment.  This allows for execute in place in
12638 an environment without virtual memory management.  This option implies
12639 @option{-fPIC}.
12640
12641 @item -mno-sep-data
12642 Generate code that assumes that the data segment follows the text segment.
12643 This is the default.
12644
12645 @item -mid-shared-library
12646 Generate code that supports shared libraries via the library ID method.
12647 This allows for execute in place and shared libraries in an environment
12648 without virtual memory management.  This option implies @option{-fPIC}.
12649
12650 @item -mno-id-shared-library
12651 Generate code that doesn't assume ID based shared libraries are being used.
12652 This is the default.
12653
12654 @item -mshared-library-id=n
12655 Specified the identification number of the ID based shared library being
12656 compiled.  Specifying a value of 0 will generate more compact code, specifying
12657 other values will force the allocation of that number to the current
12658 library but is no more space or time efficient than omitting this option.
12659
12660 @item -mxgot
12661 @itemx -mno-xgot
12662 @opindex mxgot
12663 @opindex mno-xgot
12664 When generating position-independent code for ColdFire, generate code
12665 that works if the GOT has more than 8192 entries.  This code is
12666 larger and slower than code generated without this option.  On M680x0
12667 processors, this option is not needed; @option{-fPIC} suffices.
12668
12669 GCC normally uses a single instruction to load values from the GOT@.
12670 While this is relatively efficient, it only works if the GOT
12671 is smaller than about 64k.  Anything larger causes the linker
12672 to report an error such as:
12673
12674 @cindex relocation truncated to fit (ColdFire)
12675 @smallexample
12676 relocation truncated to fit: R_68K_GOT16O foobar
12677 @end smallexample
12678
12679 If this happens, you should recompile your code with @option{-mxgot}.
12680 It should then work with very large GOTs.  However, code generated with
12681 @option{-mxgot} is less efficient, since it takes 4 instructions to fetch
12682 the value of a global symbol.
12683
12684 Note that some linkers, including newer versions of the GNU linker,
12685 can create multiple GOTs and sort GOT entries.  If you have such a linker,
12686 you should only need to use @option{-mxgot} when compiling a single
12687 object file that accesses more than 8192 GOT entries.  Very few do.
12688
12689 These options have no effect unless GCC is generating
12690 position-independent code.
12691
12692 @end table
12693
12694 @node M68hc1x Options
12695 @subsection M68hc1x Options
12696 @cindex M68hc1x options
12697
12698 These are the @samp{-m} options defined for the 68hc11 and 68hc12
12699 microcontrollers.  The default values for these options depends on
12700 which style of microcontroller was selected when the compiler was configured;
12701 the defaults for the most common choices are given below.
12702
12703 @table @gcctabopt
12704 @item -m6811
12705 @itemx -m68hc11
12706 @opindex m6811
12707 @opindex m68hc11
12708 Generate output for a 68HC11.  This is the default
12709 when the compiler is configured for 68HC11-based systems.
12710
12711 @item -m6812
12712 @itemx -m68hc12
12713 @opindex m6812
12714 @opindex m68hc12
12715 Generate output for a 68HC12.  This is the default
12716 when the compiler is configured for 68HC12-based systems.
12717
12718 @item -m68S12
12719 @itemx -m68hcs12
12720 @opindex m68S12
12721 @opindex m68hcs12
12722 Generate output for a 68HCS12.
12723
12724 @item -mauto-incdec
12725 @opindex mauto-incdec
12726 Enable the use of 68HC12 pre and post auto-increment and auto-decrement
12727 addressing modes.
12728
12729 @item -minmax
12730 @itemx -mnominmax
12731 @opindex minmax
12732 @opindex mnominmax
12733 Enable the use of 68HC12 min and max instructions.
12734
12735 @item -mlong-calls
12736 @itemx -mno-long-calls
12737 @opindex mlong-calls
12738 @opindex mno-long-calls
12739 Treat all calls as being far away (near).  If calls are assumed to be
12740 far away, the compiler will use the @code{call} instruction to
12741 call a function and the @code{rtc} instruction for returning.
12742
12743 @item -mshort
12744 @opindex mshort
12745 Consider type @code{int} to be 16 bits wide, like @code{short int}.
12746
12747 @item -msoft-reg-count=@var{count}
12748 @opindex msoft-reg-count
12749 Specify the number of pseudo-soft registers which are used for the
12750 code generation.  The maximum number is 32.  Using more pseudo-soft
12751 register may or may not result in better code depending on the program.
12752 The default is 4 for 68HC11 and 2 for 68HC12.
12753
12754 @end table
12755
12756 @node MCore Options
12757 @subsection MCore Options
12758 @cindex MCore options
12759
12760 These are the @samp{-m} options defined for the Motorola M*Core
12761 processors.
12762
12763 @table @gcctabopt
12764
12765 @item -mhardlit
12766 @itemx -mno-hardlit
12767 @opindex mhardlit
12768 @opindex mno-hardlit
12769 Inline constants into the code stream if it can be done in two
12770 instructions or less.
12771
12772 @item -mdiv
12773 @itemx -mno-div
12774 @opindex mdiv
12775 @opindex mno-div
12776 Use the divide instruction.  (Enabled by default).
12777
12778 @item -mrelax-immediate
12779 @itemx -mno-relax-immediate
12780 @opindex mrelax-immediate
12781 @opindex mno-relax-immediate
12782 Allow arbitrary sized immediates in bit operations.
12783
12784 @item -mwide-bitfields
12785 @itemx -mno-wide-bitfields
12786 @opindex mwide-bitfields
12787 @opindex mno-wide-bitfields
12788 Always treat bit-fields as int-sized.
12789
12790 @item -m4byte-functions
12791 @itemx -mno-4byte-functions
12792 @opindex m4byte-functions
12793 @opindex mno-4byte-functions
12794 Force all functions to be aligned to a four byte boundary.
12795
12796 @item -mcallgraph-data
12797 @itemx -mno-callgraph-data
12798 @opindex mcallgraph-data
12799 @opindex mno-callgraph-data
12800 Emit callgraph information.
12801
12802 @item -mslow-bytes
12803 @itemx -mno-slow-bytes
12804 @opindex mslow-bytes
12805 @opindex mno-slow-bytes
12806 Prefer word access when reading byte quantities.
12807
12808 @item -mlittle-endian
12809 @itemx -mbig-endian
12810 @opindex mlittle-endian
12811 @opindex mbig-endian
12812 Generate code for a little endian target.
12813
12814 @item -m210
12815 @itemx -m340
12816 @opindex m210
12817 @opindex m340
12818 Generate code for the 210 processor.
12819
12820 @item -mno-lsim
12821 @opindex mno-lsim
12822 Assume that run-time support has been provided and so omit the
12823 simulator library (@file{libsim.a)} from the linker command line.
12824
12825 @item -mstack-increment=@var{size}
12826 @opindex mstack-increment
12827 Set the maximum amount for a single stack increment operation.  Large
12828 values can increase the speed of programs which contain functions
12829 that need a large amount of stack space, but they can also trigger a
12830 segmentation fault if the stack is extended too much.  The default
12831 value is 0x1000.
12832
12833 @end table
12834
12835 @node MeP Options
12836 @subsection MeP Options
12837 @cindex MeP options
12838
12839 @table @gcctabopt
12840
12841 @item -mabsdiff
12842 @opindex mabsdiff
12843 Enables the @code{abs} instruction, which is the absolute difference
12844 between two registers.
12845
12846 @item -mall-opts
12847 @opindex mall-opts
12848 Enables all the optional instructions - average, multiply, divide, bit
12849 operations, leading zero, absolute difference, min/max, clip, and
12850 saturation.
12851
12852
12853 @item -maverage
12854 @opindex maverage
12855 Enables the @code{ave} instruction, which computes the average of two
12856 registers.
12857
12858 @item -mbased=@var{n}
12859 @opindex mbased=
12860 Variables of size @var{n} bytes or smaller will be placed in the
12861 @code{.based} section by default.  Based variables use the @code{$tp}
12862 register as a base register, and there is a 128 byte limit to the
12863 @code{.based} section.
12864
12865 @item -mbitops
12866 @opindex mbitops
12867 Enables the bit operation instructions - bit test (@code{btstm}), set
12868 (@code{bsetm}), clear (@code{bclrm}), invert (@code{bnotm}), and
12869 test-and-set (@code{tas}).
12870
12871 @item -mc=@var{name}
12872 @opindex mc=
12873 Selects which section constant data will be placed in.  @var{name} may
12874 be @code{tiny}, @code{near}, or @code{far}.
12875
12876 @item -mclip
12877 @opindex mclip
12878 Enables the @code{clip} instruction.  Note that @code{-mclip} is not
12879 useful unless you also provide @code{-mminmax}.
12880
12881 @item -mconfig=@var{name}
12882 @opindex mconfig=
12883 Selects one of the build-in core configurations.  Each MeP chip has
12884 one or more modules in it; each module has a core CPU and a variety of
12885 coprocessors, optional instructions, and peripherals.  The
12886 @code{MeP-Integrator} tool, not part of GCC, provides these
12887 configurations through this option; using this option is the same as
12888 using all the corresponding command line options.  The default
12889 configuration is @code{default}.
12890
12891 @item -mcop
12892 @opindex mcop
12893 Enables the coprocessor instructions.  By default, this is a 32-bit
12894 coprocessor.  Note that the coprocessor is normally enabled via the
12895 @code{-mconfig=} option.
12896
12897 @item -mcop32
12898 @opindex mcop32
12899 Enables the 32-bit coprocessor's instructions.
12900
12901 @item -mcop64
12902 @opindex mcop64
12903 Enables the 64-bit coprocessor's instructions.
12904
12905 @item -mivc2
12906 @opindex mivc2
12907 Enables IVC2 scheduling.  IVC2 is a 64-bit VLIW coprocessor.
12908
12909 @item -mdc
12910 @opindex mdc
12911 Causes constant variables to be placed in the @code{.near} section.
12912
12913 @item -mdiv
12914 @opindex mdiv
12915 Enables the @code{div} and @code{divu} instructions.
12916
12917 @item -meb
12918 @opindex meb
12919 Generate big-endian code.
12920
12921 @item -mel
12922 @opindex mel
12923 Generate little-endian code.
12924
12925 @item -mio-volatile
12926 @opindex mio-volatile
12927 Tells the compiler that any variable marked with the @code{io}
12928 attribute is to be considered volatile.
12929
12930 @item -ml
12931 @opindex ml
12932 Causes variables to be assigned to the @code{.far} section by default.
12933
12934 @item -mleadz
12935 @opindex mleadz
12936 Enables the @code{leadz} (leading zero) instruction.
12937
12938 @item -mm
12939 @opindex mm
12940 Causes variables to be assigned to the @code{.near} section by default.
12941
12942 @item -mminmax
12943 @opindex mminmax
12944 Enables the @code{min} and @code{max} instructions.
12945
12946 @item -mmult
12947 @opindex mmult
12948 Enables the multiplication and multiply-accumulate instructions.
12949
12950 @item -mno-opts
12951 @opindex mno-opts
12952 Disables all the optional instructions enabled by @code{-mall-opts}.
12953
12954 @item -mrepeat
12955 @opindex mrepeat
12956 Enables the @code{repeat} and @code{erepeat} instructions, used for
12957 low-overhead looping.
12958
12959 @item -ms
12960 @opindex ms
12961 Causes all variables to default to the @code{.tiny} section.  Note
12962 that there is a 65536 byte limit to this section.  Accesses to these
12963 variables use the @code{%gp} base register.
12964
12965 @item -msatur
12966 @opindex msatur
12967 Enables the saturation instructions.  Note that the compiler does not
12968 currently generate these itself, but this option is included for
12969 compatibility with other tools, like @code{as}.
12970
12971 @item -msdram
12972 @opindex msdram
12973 Link the SDRAM-based runtime instead of the default ROM-based runtime.
12974
12975 @item -msim
12976 @opindex msim
12977 Link the simulator runtime libraries.
12978
12979 @item -msimnovec
12980 @opindex msimnovec
12981 Link the simulator runtime libraries, excluding built-in support
12982 for reset and exception vectors and tables.
12983
12984 @item -mtf
12985 @opindex mtf
12986 Causes all functions to default to the @code{.far} section.  Without
12987 this option, functions default to the @code{.near} section.
12988
12989 @item -mtiny=@var{n}
12990 @opindex mtiny=
12991 Variables that are @var{n} bytes or smaller will be allocated to the
12992 @code{.tiny} section.  These variables use the @code{$gp} base
12993 register.  The default for this option is 4, but note that there's a
12994 65536 byte limit to the @code{.tiny} section.
12995
12996 @end table
12997
12998 @node MIPS Options
12999 @subsection MIPS Options
13000 @cindex MIPS options
13001
13002 @table @gcctabopt
13003
13004 @item -EB
13005 @opindex EB
13006 Generate big-endian code.
13007
13008 @item -EL
13009 @opindex EL
13010 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
13011 configurations.
13012
13013 @item -march=@var{arch}
13014 @opindex march
13015 Generate code that will run on @var{arch}, which can be the name of a
13016 generic MIPS ISA, or the name of a particular processor.
13017 The ISA names are:
13018 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
13019 @samp{mips32}, @samp{mips32r2}, @samp{mips64} and @samp{mips64r2}.
13020 The processor names are:
13021 @samp{4kc}, @samp{4km}, @samp{4kp}, @samp{4ksc},
13022 @samp{4kec}, @samp{4kem}, @samp{4kep}, @samp{4ksd},
13023 @samp{5kc}, @samp{5kf},
13024 @samp{20kc},
13025 @samp{24kc}, @samp{24kf2_1}, @samp{24kf1_1},
13026 @samp{24kec}, @samp{24kef2_1}, @samp{24kef1_1},
13027 @samp{34kc}, @samp{34kf2_1}, @samp{34kf1_1},
13028 @samp{74kc}, @samp{74kf2_1}, @samp{74kf1_1}, @samp{74kf3_2},
13029 @samp{loongson2e}, @samp{loongson2f},
13030 @samp{m4k},
13031 @samp{octeon},
13032 @samp{orion},
13033 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
13034 @samp{r4600}, @samp{r4650}, @samp{r6000}, @samp{r8000},
13035 @samp{rm7000}, @samp{rm9000},
13036 @samp{r10000}, @samp{r12000}, @samp{r14000}, @samp{r16000},
13037 @samp{sb1},
13038 @samp{sr71000},
13039 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
13040 @samp{vr5000}, @samp{vr5400}, @samp{vr5500}
13041 and @samp{xlr}.
13042 The special value @samp{from-abi} selects the
13043 most compatible architecture for the selected ABI (that is,
13044 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
13045
13046 Native Linux/GNU toolchains also support the value @samp{native},
13047 which selects the best architecture option for the host processor.
13048 @option{-march=native} has no effect if GCC does not recognize
13049 the processor.
13050
13051 In processor names, a final @samp{000} can be abbreviated as @samp{k}
13052 (for example, @samp{-march=r2k}).  Prefixes are optional, and
13053 @samp{vr} may be written @samp{r}.
13054
13055 Names of the form @samp{@var{n}f2_1} refer to processors with
13056 FPUs clocked at half the rate of the core, names of the form
13057 @samp{@var{n}f1_1} refer to processors with FPUs clocked at the same
13058 rate as the core, and names of the form @samp{@var{n}f3_2} refer to
13059 processors with FPUs clocked a ratio of 3:2 with respect to the core.
13060 For compatibility reasons, @samp{@var{n}f} is accepted as a synonym
13061 for @samp{@var{n}f2_1} while @samp{@var{n}x} and @samp{@var{b}fx} are
13062 accepted as synonyms for @samp{@var{n}f1_1}.
13063
13064 GCC defines two macros based on the value of this option.  The first
13065 is @samp{_MIPS_ARCH}, which gives the name of target architecture, as
13066 a string.  The second has the form @samp{_MIPS_ARCH_@var{foo}},
13067 where @var{foo} is the capitalized value of @samp{_MIPS_ARCH}@.
13068 For example, @samp{-march=r2000} will set @samp{_MIPS_ARCH}
13069 to @samp{"r2000"} and define the macro @samp{_MIPS_ARCH_R2000}.
13070
13071 Note that the @samp{_MIPS_ARCH} macro uses the processor names given
13072 above.  In other words, it will have the full prefix and will not
13073 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
13074 the macro names the resolved architecture (either @samp{"mips1"} or
13075 @samp{"mips3"}).  It names the default architecture when no
13076 @option{-march} option is given.
13077
13078 @item -mtune=@var{arch}
13079 @opindex mtune
13080 Optimize for @var{arch}.  Among other things, this option controls
13081 the way instructions are scheduled, and the perceived cost of arithmetic
13082 operations.  The list of @var{arch} values is the same as for
13083 @option{-march}.
13084
13085 When this option is not used, GCC will optimize for the processor
13086 specified by @option{-march}.  By using @option{-march} and
13087 @option{-mtune} together, it is possible to generate code that will
13088 run on a family of processors, but optimize the code for one
13089 particular member of that family.
13090
13091 @samp{-mtune} defines the macros @samp{_MIPS_TUNE} and
13092 @samp{_MIPS_TUNE_@var{foo}}, which work in the same way as the
13093 @samp{-march} ones described above.
13094
13095 @item -mips1
13096 @opindex mips1
13097 Equivalent to @samp{-march=mips1}.
13098
13099 @item -mips2
13100 @opindex mips2
13101 Equivalent to @samp{-march=mips2}.
13102
13103 @item -mips3
13104 @opindex mips3
13105 Equivalent to @samp{-march=mips3}.
13106
13107 @item -mips4
13108 @opindex mips4
13109 Equivalent to @samp{-march=mips4}.
13110
13111 @item -mips32
13112 @opindex mips32
13113 Equivalent to @samp{-march=mips32}.
13114
13115 @item -mips32r2
13116 @opindex mips32r2
13117 Equivalent to @samp{-march=mips32r2}.
13118
13119 @item -mips64
13120 @opindex mips64
13121 Equivalent to @samp{-march=mips64}.
13122
13123 @item -mips64r2
13124 @opindex mips64r2
13125 Equivalent to @samp{-march=mips64r2}.
13126
13127 @item -mips16
13128 @itemx -mno-mips16
13129 @opindex mips16
13130 @opindex mno-mips16
13131 Generate (do not generate) MIPS16 code.  If GCC is targetting a
13132 MIPS32 or MIPS64 architecture, it will make use of the MIPS16e ASE@.
13133
13134 MIPS16 code generation can also be controlled on a per-function basis
13135 by means of @code{mips16} and @code{nomips16} attributes.
13136 @xref{Function Attributes}, for more information.
13137
13138 @item -mflip-mips16
13139 @opindex mflip-mips16
13140 Generate MIPS16 code on alternating functions.  This option is provided
13141 for regression testing of mixed MIPS16/non-MIPS16 code generation, and is
13142 not intended for ordinary use in compiling user code.
13143
13144 @item -minterlink-mips16
13145 @itemx -mno-interlink-mips16
13146 @opindex minterlink-mips16
13147 @opindex mno-interlink-mips16
13148 Require (do not require) that non-MIPS16 code be link-compatible with
13149 MIPS16 code.
13150
13151 For example, non-MIPS16 code cannot jump directly to MIPS16 code;
13152 it must either use a call or an indirect jump.  @option{-minterlink-mips16}
13153 therefore disables direct jumps unless GCC knows that the target of the
13154 jump is not MIPS16.
13155
13156 @item -mabi=32
13157 @itemx -mabi=o64
13158 @itemx -mabi=n32
13159 @itemx -mabi=64
13160 @itemx -mabi=eabi
13161 @opindex mabi=32
13162 @opindex mabi=o64
13163 @opindex mabi=n32
13164 @opindex mabi=64
13165 @opindex mabi=eabi
13166 Generate code for the given ABI@.
13167
13168 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
13169 generates 64-bit code when you select a 64-bit architecture, but you
13170 can use @option{-mgp32} to get 32-bit code instead.
13171
13172 For information about the O64 ABI, see
13173 @w{@uref{http://gcc.gnu.org/projects/mipso64-abi.html}}.
13174
13175 GCC supports a variant of the o32 ABI in which floating-point registers
13176 are 64 rather than 32 bits wide.  You can select this combination with
13177 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @samp{mthc1}
13178 and @samp{mfhc1} instructions and is therefore only supported for
13179 MIPS32R2 processors.
13180
13181 The register assignments for arguments and return values remain the
13182 same, but each scalar value is passed in a single 64-bit register
13183 rather than a pair of 32-bit registers.  For example, scalar
13184 floating-point values are returned in @samp{$f0} only, not a
13185 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
13186 remains the same, but all 64 bits are saved.
13187
13188 @item -mabicalls
13189 @itemx -mno-abicalls
13190 @opindex mabicalls
13191 @opindex mno-abicalls
13192 Generate (do not generate) code that is suitable for SVR4-style
13193 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
13194 systems.
13195
13196 @item -mshared
13197 @itemx -mno-shared
13198 Generate (do not generate) code that is fully position-independent,
13199 and that can therefore be linked into shared libraries.  This option
13200 only affects @option{-mabicalls}.
13201
13202 All @option{-mabicalls} code has traditionally been position-independent,
13203 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
13204 as an extension, the GNU toolchain allows executables to use absolute
13205 accesses for locally-binding symbols.  It can also use shorter GP
13206 initialization sequences and generate direct calls to locally-defined
13207 functions.  This mode is selected by @option{-mno-shared}.
13208
13209 @option{-mno-shared} depends on binutils 2.16 or higher and generates
13210 objects that can only be linked by the GNU linker.  However, the option
13211 does not affect the ABI of the final executable; it only affects the ABI
13212 of relocatable objects.  Using @option{-mno-shared} will generally make
13213 executables both smaller and quicker.
13214
13215 @option{-mshared} is the default.
13216
13217 @item -mplt
13218 @itemx -mno-plt
13219 @opindex mplt
13220 @opindex mno-plt
13221 Assume (do not assume) that the static and dynamic linkers
13222 support PLTs and copy relocations.  This option only affects
13223 @samp{-mno-shared -mabicalls}.  For the n64 ABI, this option
13224 has no effect without @samp{-msym32}.
13225
13226 You can make @option{-mplt} the default by configuring
13227 GCC with @option{--with-mips-plt}.  The default is
13228 @option{-mno-plt} otherwise.
13229
13230 @item -mxgot
13231 @itemx -mno-xgot
13232 @opindex mxgot
13233 @opindex mno-xgot
13234 Lift (do not lift) the usual restrictions on the size of the global
13235 offset table.
13236
13237 GCC normally uses a single instruction to load values from the GOT@.
13238 While this is relatively efficient, it will only work if the GOT
13239 is smaller than about 64k.  Anything larger will cause the linker
13240 to report an error such as:
13241
13242 @cindex relocation truncated to fit (MIPS)
13243 @smallexample
13244 relocation truncated to fit: R_MIPS_GOT16 foobar
13245 @end smallexample
13246
13247 If this happens, you should recompile your code with @option{-mxgot}.
13248 It should then work with very large GOTs, although it will also be
13249 less efficient, since it will take three instructions to fetch the
13250 value of a global symbol.
13251
13252 Note that some linkers can create multiple GOTs.  If you have such a
13253 linker, you should only need to use @option{-mxgot} when a single object
13254 file accesses more than 64k's worth of GOT entries.  Very few do.
13255
13256 These options have no effect unless GCC is generating position
13257 independent code.
13258
13259 @item -mgp32
13260 @opindex mgp32
13261 Assume that general-purpose registers are 32 bits wide.
13262
13263 @item -mgp64
13264 @opindex mgp64
13265 Assume that general-purpose registers are 64 bits wide.
13266
13267 @item -mfp32
13268 @opindex mfp32
13269 Assume that floating-point registers are 32 bits wide.
13270
13271 @item -mfp64
13272 @opindex mfp64
13273 Assume that floating-point registers are 64 bits wide.
13274
13275 @item -mhard-float
13276 @opindex mhard-float
13277 Use floating-point coprocessor instructions.
13278
13279 @item -msoft-float
13280 @opindex msoft-float
13281 Do not use floating-point coprocessor instructions.  Implement
13282 floating-point calculations using library calls instead.
13283
13284 @item -msingle-float
13285 @opindex msingle-float
13286 Assume that the floating-point coprocessor only supports single-precision
13287 operations.
13288
13289 @item -mdouble-float
13290 @opindex mdouble-float
13291 Assume that the floating-point coprocessor supports double-precision
13292 operations.  This is the default.
13293
13294 @item -mllsc
13295 @itemx -mno-llsc
13296 @opindex mllsc
13297 @opindex mno-llsc
13298 Use (do not use) @samp{ll}, @samp{sc}, and @samp{sync} instructions to
13299 implement atomic memory built-in functions.  When neither option is
13300 specified, GCC will use the instructions if the target architecture
13301 supports them.
13302
13303 @option{-mllsc} is useful if the runtime environment can emulate the
13304 instructions and @option{-mno-llsc} can be useful when compiling for
13305 nonstandard ISAs.  You can make either option the default by
13306 configuring GCC with @option{--with-llsc} and @option{--without-llsc}
13307 respectively.  @option{--with-llsc} is the default for some
13308 configurations; see the installation documentation for details.
13309
13310 @item -mdsp
13311 @itemx -mno-dsp
13312 @opindex mdsp
13313 @opindex mno-dsp
13314 Use (do not use) revision 1 of the MIPS DSP ASE@.
13315 @xref{MIPS DSP Built-in Functions}.  This option defines the
13316 preprocessor macro @samp{__mips_dsp}.  It also defines
13317 @samp{__mips_dsp_rev} to 1.
13318
13319 @item -mdspr2
13320 @itemx -mno-dspr2
13321 @opindex mdspr2
13322 @opindex mno-dspr2
13323 Use (do not use) revision 2 of the MIPS DSP ASE@.
13324 @xref{MIPS DSP Built-in Functions}.  This option defines the
13325 preprocessor macros @samp{__mips_dsp} and @samp{__mips_dspr2}.
13326 It also defines @samp{__mips_dsp_rev} to 2.
13327
13328 @item -msmartmips
13329 @itemx -mno-smartmips
13330 @opindex msmartmips
13331 @opindex mno-smartmips
13332 Use (do not use) the MIPS SmartMIPS ASE.
13333
13334 @item -mpaired-single
13335 @itemx -mno-paired-single
13336 @opindex mpaired-single
13337 @opindex mno-paired-single
13338 Use (do not use) paired-single floating-point instructions.
13339 @xref{MIPS Paired-Single Support}.  This option requires
13340 hardware floating-point support to be enabled.
13341
13342 @item -mdmx
13343 @itemx -mno-mdmx
13344 @opindex mdmx
13345 @opindex mno-mdmx
13346 Use (do not use) MIPS Digital Media Extension instructions.
13347 This option can only be used when generating 64-bit code and requires
13348 hardware floating-point support to be enabled.
13349
13350 @item -mips3d
13351 @itemx -mno-mips3d
13352 @opindex mips3d
13353 @opindex mno-mips3d
13354 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
13355 The option @option{-mips3d} implies @option{-mpaired-single}.
13356
13357 @item -mmt
13358 @itemx -mno-mt
13359 @opindex mmt
13360 @opindex mno-mt
13361 Use (do not use) MT Multithreading instructions.
13362
13363 @item -mlong64
13364 @opindex mlong64
13365 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
13366 an explanation of the default and the way that the pointer size is
13367 determined.
13368
13369 @item -mlong32
13370 @opindex mlong32
13371 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
13372
13373 The default size of @code{int}s, @code{long}s and pointers depends on
13374 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
13375 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
13376 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
13377 or the same size as integer registers, whichever is smaller.
13378
13379 @item -msym32
13380 @itemx -mno-sym32
13381 @opindex msym32
13382 @opindex mno-sym32
13383 Assume (do not assume) that all symbols have 32-bit values, regardless
13384 of the selected ABI@.  This option is useful in combination with
13385 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
13386 to generate shorter and faster references to symbolic addresses.
13387
13388 @item -G @var{num}
13389 @opindex G
13390 Put definitions of externally-visible data in a small data section
13391 if that data is no bigger than @var{num} bytes.  GCC can then access
13392 the data more efficiently; see @option{-mgpopt} for details.
13393
13394 The default @option{-G} option depends on the configuration.
13395
13396 @item -mlocal-sdata
13397 @itemx -mno-local-sdata
13398 @opindex mlocal-sdata
13399 @opindex mno-local-sdata
13400 Extend (do not extend) the @option{-G} behavior to local data too,
13401 such as to static variables in C@.  @option{-mlocal-sdata} is the
13402 default for all configurations.
13403
13404 If the linker complains that an application is using too much small data,
13405 you might want to try rebuilding the less performance-critical parts with
13406 @option{-mno-local-sdata}.  You might also want to build large
13407 libraries with @option{-mno-local-sdata}, so that the libraries leave
13408 more room for the main program.
13409
13410 @item -mextern-sdata
13411 @itemx -mno-extern-sdata
13412 @opindex mextern-sdata
13413 @opindex mno-extern-sdata
13414 Assume (do not assume) that externally-defined data will be in
13415 a small data section if that data is within the @option{-G} limit.
13416 @option{-mextern-sdata} is the default for all configurations.
13417
13418 If you compile a module @var{Mod} with @option{-mextern-sdata} @option{-G
13419 @var{num}} @option{-mgpopt}, and @var{Mod} references a variable @var{Var}
13420 that is no bigger than @var{num} bytes, you must make sure that @var{Var}
13421 is placed in a small data section.  If @var{Var} is defined by another
13422 module, you must either compile that module with a high-enough
13423 @option{-G} setting or attach a @code{section} attribute to @var{Var}'s
13424 definition.  If @var{Var} is common, you must link the application
13425 with a high-enough @option{-G} setting.
13426
13427 The easiest way of satisfying these restrictions is to compile
13428 and link every module with the same @option{-G} option.  However,
13429 you may wish to build a library that supports several different
13430 small data limits.  You can do this by compiling the library with
13431 the highest supported @option{-G} setting and additionally using
13432 @option{-mno-extern-sdata} to stop the library from making assumptions
13433 about externally-defined data.
13434
13435 @item -mgpopt
13436 @itemx -mno-gpopt
13437 @opindex mgpopt
13438 @opindex mno-gpopt
13439 Use (do not use) GP-relative accesses for symbols that are known to be
13440 in a small data section; see @option{-G}, @option{-mlocal-sdata} and
13441 @option{-mextern-sdata}.  @option{-mgpopt} is the default for all
13442 configurations.
13443
13444 @option{-mno-gpopt} is useful for cases where the @code{$gp} register
13445 might not hold the value of @code{_gp}.  For example, if the code is
13446 part of a library that might be used in a boot monitor, programs that
13447 call boot monitor routines will pass an unknown value in @code{$gp}.
13448 (In such situations, the boot monitor itself would usually be compiled
13449 with @option{-G0}.)
13450
13451 @option{-mno-gpopt} implies @option{-mno-local-sdata} and
13452 @option{-mno-extern-sdata}.
13453
13454 @item -membedded-data
13455 @itemx -mno-embedded-data
13456 @opindex membedded-data
13457 @opindex mno-embedded-data
13458 Allocate variables to the read-only data section first if possible, then
13459 next in the small data section if possible, otherwise in data.  This gives
13460 slightly slower code than the default, but reduces the amount of RAM required
13461 when executing, and thus may be preferred for some embedded systems.
13462
13463 @item -muninit-const-in-rodata
13464 @itemx -mno-uninit-const-in-rodata
13465 @opindex muninit-const-in-rodata
13466 @opindex mno-uninit-const-in-rodata
13467 Put uninitialized @code{const} variables in the read-only data section.
13468 This option is only meaningful in conjunction with @option{-membedded-data}.
13469
13470 @item -mcode-readable=@var{setting}
13471 @opindex mcode-readable
13472 Specify whether GCC may generate code that reads from executable sections.
13473 There are three possible settings:
13474
13475 @table @gcctabopt
13476 @item -mcode-readable=yes
13477 Instructions may freely access executable sections.  This is the
13478 default setting.
13479
13480 @item -mcode-readable=pcrel
13481 MIPS16 PC-relative load instructions can access executable sections,
13482 but other instructions must not do so.  This option is useful on 4KSc
13483 and 4KSd processors when the code TLBs have the Read Inhibit bit set.
13484 It is also useful on processors that can be configured to have a dual
13485 instruction/data SRAM interface and that, like the M4K, automatically
13486 redirect PC-relative loads to the instruction RAM.
13487
13488 @item -mcode-readable=no
13489 Instructions must not access executable sections.  This option can be
13490 useful on targets that are configured to have a dual instruction/data
13491 SRAM interface but that (unlike the M4K) do not automatically redirect
13492 PC-relative loads to the instruction RAM.
13493 @end table
13494
13495 @item -msplit-addresses
13496 @itemx -mno-split-addresses
13497 @opindex msplit-addresses
13498 @opindex mno-split-addresses
13499 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
13500 relocation operators.  This option has been superseded by
13501 @option{-mexplicit-relocs} but is retained for backwards compatibility.
13502
13503 @item -mexplicit-relocs
13504 @itemx -mno-explicit-relocs
13505 @opindex mexplicit-relocs
13506 @opindex mno-explicit-relocs
13507 Use (do not use) assembler relocation operators when dealing with symbolic
13508 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
13509 is to use assembler macros instead.
13510
13511 @option{-mexplicit-relocs} is the default if GCC was configured
13512 to use an assembler that supports relocation operators.
13513
13514 @item -mcheck-zero-division
13515 @itemx -mno-check-zero-division
13516 @opindex mcheck-zero-division
13517 @opindex mno-check-zero-division
13518 Trap (do not trap) on integer division by zero.
13519
13520 The default is @option{-mcheck-zero-division}.
13521
13522 @item -mdivide-traps
13523 @itemx -mdivide-breaks
13524 @opindex mdivide-traps
13525 @opindex mdivide-breaks
13526 MIPS systems check for division by zero by generating either a
13527 conditional trap or a break instruction.  Using traps results in
13528 smaller code, but is only supported on MIPS II and later.  Also, some
13529 versions of the Linux kernel have a bug that prevents trap from
13530 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
13531 allow conditional traps on architectures that support them and
13532 @option{-mdivide-breaks} to force the use of breaks.
13533
13534 The default is usually @option{-mdivide-traps}, but this can be
13535 overridden at configure time using @option{--with-divide=breaks}.
13536 Divide-by-zero checks can be completely disabled using
13537 @option{-mno-check-zero-division}.
13538
13539 @item -mmemcpy
13540 @itemx -mno-memcpy
13541 @opindex mmemcpy
13542 @opindex mno-memcpy
13543 Force (do not force) the use of @code{memcpy()} for non-trivial block
13544 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
13545 most constant-sized copies.
13546
13547 @item -mlong-calls
13548 @itemx -mno-long-calls
13549 @opindex mlong-calls
13550 @opindex mno-long-calls
13551 Disable (do not disable) use of the @code{jal} instruction.  Calling
13552 functions using @code{jal} is more efficient but requires the caller
13553 and callee to be in the same 256 megabyte segment.
13554
13555 This option has no effect on abicalls code.  The default is
13556 @option{-mno-long-calls}.
13557
13558 @item -mmad
13559 @itemx -mno-mad
13560 @opindex mmad
13561 @opindex mno-mad
13562 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
13563 instructions, as provided by the R4650 ISA@.
13564
13565 @item -mfused-madd
13566 @itemx -mno-fused-madd
13567 @opindex mfused-madd
13568 @opindex mno-fused-madd
13569 Enable (disable) use of the floating point multiply-accumulate
13570 instructions, when they are available.  The default is
13571 @option{-mfused-madd}.
13572
13573 When multiply-accumulate instructions are used, the intermediate
13574 product is calculated to infinite precision and is not subject to
13575 the FCSR Flush to Zero bit.  This may be undesirable in some
13576 circumstances.
13577
13578 @item -nocpp
13579 @opindex nocpp
13580 Tell the MIPS assembler to not run its preprocessor over user
13581 assembler files (with a @samp{.s} suffix) when assembling them.
13582
13583 @item -mfix-r4000
13584 @itemx -mno-fix-r4000
13585 @opindex mfix-r4000
13586 @opindex mno-fix-r4000
13587 Work around certain R4000 CPU errata:
13588 @itemize @minus
13589 @item
13590 A double-word or a variable shift may give an incorrect result if executed
13591 immediately after starting an integer division.
13592 @item
13593 A double-word or a variable shift may give an incorrect result if executed
13594 while an integer multiplication is in progress.
13595 @item
13596 An integer division may give an incorrect result if started in a delay slot
13597 of a taken branch or a jump.
13598 @end itemize
13599
13600 @item -mfix-r4400
13601 @itemx -mno-fix-r4400
13602 @opindex mfix-r4400
13603 @opindex mno-fix-r4400
13604 Work around certain R4400 CPU errata:
13605 @itemize @minus
13606 @item
13607 A double-word or a variable shift may give an incorrect result if executed
13608 immediately after starting an integer division.
13609 @end itemize
13610
13611 @item -mfix-r10000
13612 @itemx -mno-fix-r10000
13613 @opindex mfix-r10000
13614 @opindex mno-fix-r10000
13615 Work around certain R10000 errata:
13616 @itemize @minus
13617 @item
13618 @code{ll}/@code{sc} sequences may not behave atomically on revisions
13619 prior to 3.0.  They may deadlock on revisions 2.6 and earlier.
13620 @end itemize
13621
13622 This option can only be used if the target architecture supports
13623 branch-likely instructions.  @option{-mfix-r10000} is the default when
13624 @option{-march=r10000} is used; @option{-mno-fix-r10000} is the default
13625 otherwise.
13626
13627 @item -mfix-vr4120
13628 @itemx -mno-fix-vr4120
13629 @opindex mfix-vr4120
13630 Work around certain VR4120 errata:
13631 @itemize @minus
13632 @item
13633 @code{dmultu} does not always produce the correct result.
13634 @item
13635 @code{div} and @code{ddiv} do not always produce the correct result if one
13636 of the operands is negative.
13637 @end itemize
13638 The workarounds for the division errata rely on special functions in
13639 @file{libgcc.a}.  At present, these functions are only provided by
13640 the @code{mips64vr*-elf} configurations.
13641
13642 Other VR4120 errata require a nop to be inserted between certain pairs of
13643 instructions.  These errata are handled by the assembler, not by GCC itself.
13644
13645 @item -mfix-vr4130
13646 @opindex mfix-vr4130
13647 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
13648 workarounds are implemented by the assembler rather than by GCC,
13649 although GCC will avoid using @code{mflo} and @code{mfhi} if the
13650 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
13651 instructions are available instead.
13652
13653 @item -mfix-sb1
13654 @itemx -mno-fix-sb1
13655 @opindex mfix-sb1
13656 Work around certain SB-1 CPU core errata.
13657 (This flag currently works around the SB-1 revision 2
13658 ``F1'' and ``F2'' floating point errata.)
13659
13660 @item -mr10k-cache-barrier=@var{setting}
13661 @opindex mr10k-cache-barrier
13662 Specify whether GCC should insert cache barriers to avoid the
13663 side-effects of speculation on R10K processors.
13664
13665 In common with many processors, the R10K tries to predict the outcome
13666 of a conditional branch and speculatively executes instructions from
13667 the ``taken'' branch.  It later aborts these instructions if the
13668 predicted outcome was wrong.  However, on the R10K, even aborted
13669 instructions can have side effects.
13670
13671 This problem only affects kernel stores and, depending on the system,
13672 kernel loads.  As an example, a speculatively-executed store may load
13673 the target memory into cache and mark the cache line as dirty, even if
13674 the store itself is later aborted.  If a DMA operation writes to the
13675 same area of memory before the ``dirty'' line is flushed, the cached
13676 data will overwrite the DMA-ed data.  See the R10K processor manual
13677 for a full description, including other potential problems.
13678
13679 One workaround is to insert cache barrier instructions before every memory
13680 access that might be speculatively executed and that might have side
13681 effects even if aborted.  @option{-mr10k-cache-barrier=@var{setting}}
13682 controls GCC's implementation of this workaround.  It assumes that
13683 aborted accesses to any byte in the following regions will not have
13684 side effects:
13685
13686 @enumerate
13687 @item
13688 the memory occupied by the current function's stack frame;
13689
13690 @item
13691 the memory occupied by an incoming stack argument;
13692
13693 @item
13694 the memory occupied by an object with a link-time-constant address.
13695 @end enumerate
13696
13697 It is the kernel's responsibility to ensure that speculative
13698 accesses to these regions are indeed safe.
13699
13700 If the input program contains a function declaration such as:
13701
13702 @smallexample
13703 void foo (void);
13704 @end smallexample
13705
13706 then the implementation of @code{foo} must allow @code{j foo} and
13707 @code{jal foo} to be executed speculatively.  GCC honors this
13708 restriction for functions it compiles itself.  It expects non-GCC
13709 functions (such as hand-written assembly code) to do the same.
13710
13711 The option has three forms:
13712
13713 @table @gcctabopt
13714 @item -mr10k-cache-barrier=load-store
13715 Insert a cache barrier before a load or store that might be
13716 speculatively executed and that might have side effects even
13717 if aborted.
13718
13719 @item -mr10k-cache-barrier=store
13720 Insert a cache barrier before a store that might be speculatively
13721 executed and that might have side effects even if aborted.
13722
13723 @item -mr10k-cache-barrier=none
13724 Disable the insertion of cache barriers.  This is the default setting.
13725 @end table
13726
13727 @item -mflush-func=@var{func}
13728 @itemx -mno-flush-func
13729 @opindex mflush-func
13730 Specifies the function to call to flush the I and D caches, or to not
13731 call any such function.  If called, the function must take the same
13732 arguments as the common @code{_flush_func()}, that is, the address of the
13733 memory range for which the cache is being flushed, the size of the
13734 memory range, and the number 3 (to flush both caches).  The default
13735 depends on the target GCC was configured for, but commonly is either
13736 @samp{_flush_func} or @samp{__cpu_flush}.
13737
13738 @item mbranch-cost=@var{num}
13739 @opindex mbranch-cost
13740 Set the cost of branches to roughly @var{num} ``simple'' instructions.
13741 This cost is only a heuristic and is not guaranteed to produce
13742 consistent results across releases.  A zero cost redundantly selects
13743 the default, which is based on the @option{-mtune} setting.
13744
13745 @item -mbranch-likely
13746 @itemx -mno-branch-likely
13747 @opindex mbranch-likely
13748 @opindex mno-branch-likely
13749 Enable or disable use of Branch Likely instructions, regardless of the
13750 default for the selected architecture.  By default, Branch Likely
13751 instructions may be generated if they are supported by the selected
13752 architecture.  An exception is for the MIPS32 and MIPS64 architectures
13753 and processors which implement those architectures; for those, Branch
13754 Likely instructions will not be generated by default because the MIPS32
13755 and MIPS64 architectures specifically deprecate their use.
13756
13757 @item -mfp-exceptions
13758 @itemx -mno-fp-exceptions
13759 @opindex mfp-exceptions
13760 Specifies whether FP exceptions are enabled.  This affects how we schedule
13761 FP instructions for some processors.  The default is that FP exceptions are
13762 enabled.
13763
13764 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
13765 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
13766 FP pipe.
13767
13768 @item -mvr4130-align
13769 @itemx -mno-vr4130-align
13770 @opindex mvr4130-align
13771 The VR4130 pipeline is two-way superscalar, but can only issue two
13772 instructions together if the first one is 8-byte aligned.  When this
13773 option is enabled, GCC will align pairs of instructions that it
13774 thinks should execute in parallel.
13775
13776 This option only has an effect when optimizing for the VR4130.
13777 It normally makes code faster, but at the expense of making it bigger.
13778 It is enabled by default at optimization level @option{-O3}.
13779
13780 @item -msynci
13781 @itemx -mno-synci
13782 @opindex msynci
13783 Enable (disable) generation of @code{synci} instructions on
13784 architectures that support it.  The @code{synci} instructions (if
13785 enabled) will be generated when @code{__builtin___clear_cache()} is
13786 compiled.
13787
13788 This option defaults to @code{-mno-synci}, but the default can be
13789 overridden by configuring with @code{--with-synci}.
13790
13791 When compiling code for single processor systems, it is generally safe
13792 to use @code{synci}.  However, on many multi-core (SMP) systems, it
13793 will not invalidate the instruction caches on all cores and may lead
13794 to undefined behavior.
13795 @end table
13796
13797 @node MMIX Options
13798 @subsection MMIX Options
13799 @cindex MMIX Options
13800
13801 These options are defined for the MMIX:
13802
13803 @table @gcctabopt
13804 @item -mlibfuncs
13805 @itemx -mno-libfuncs
13806 @opindex mlibfuncs
13807 @opindex mno-libfuncs
13808 Specify that intrinsic library functions are being compiled, passing all
13809 values in registers, no matter the size.
13810
13811 @item -mepsilon
13812 @itemx -mno-epsilon
13813 @opindex mepsilon
13814 @opindex mno-epsilon
13815 Generate floating-point comparison instructions that compare with respect
13816 to the @code{rE} epsilon register.
13817
13818 @item -mabi=mmixware
13819 @itemx -mabi=gnu
13820 @opindex mabi=mmixware
13821 @opindex mabi=gnu
13822 Generate code that passes function parameters and return values that (in
13823 the called function) are seen as registers @code{$0} and up, as opposed to
13824 the GNU ABI which uses global registers @code{$231} and up.
13825
13826 @item -mzero-extend
13827 @itemx -mno-zero-extend
13828 @opindex mzero-extend
13829 @opindex mno-zero-extend
13830 When reading data from memory in sizes shorter than 64 bits, use (do not
13831 use) zero-extending load instructions by default, rather than
13832 sign-extending ones.
13833
13834 @item -mknuthdiv
13835 @itemx -mno-knuthdiv
13836 @opindex mknuthdiv
13837 @opindex mno-knuthdiv
13838 Make the result of a division yielding a remainder have the same sign as
13839 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
13840 remainder follows the sign of the dividend.  Both methods are
13841 arithmetically valid, the latter being almost exclusively used.
13842
13843 @item -mtoplevel-symbols
13844 @itemx -mno-toplevel-symbols
13845 @opindex mtoplevel-symbols
13846 @opindex mno-toplevel-symbols
13847 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
13848 code can be used with the @code{PREFIX} assembly directive.
13849
13850 @item -melf
13851 @opindex melf
13852 Generate an executable in the ELF format, rather than the default
13853 @samp{mmo} format used by the @command{mmix} simulator.
13854
13855 @item -mbranch-predict
13856 @itemx -mno-branch-predict
13857 @opindex mbranch-predict
13858 @opindex mno-branch-predict
13859 Use (do not use) the probable-branch instructions, when static branch
13860 prediction indicates a probable branch.
13861
13862 @item -mbase-addresses
13863 @itemx -mno-base-addresses
13864 @opindex mbase-addresses
13865 @opindex mno-base-addresses
13866 Generate (do not generate) code that uses @emph{base addresses}.  Using a
13867 base address automatically generates a request (handled by the assembler
13868 and the linker) for a constant to be set up in a global register.  The
13869 register is used for one or more base address requests within the range 0
13870 to 255 from the value held in the register.  The generally leads to short
13871 and fast code, but the number of different data items that can be
13872 addressed is limited.  This means that a program that uses lots of static
13873 data may require @option{-mno-base-addresses}.
13874
13875 @item -msingle-exit
13876 @itemx -mno-single-exit
13877 @opindex msingle-exit
13878 @opindex mno-single-exit
13879 Force (do not force) generated code to have a single exit point in each
13880 function.
13881 @end table
13882
13883 @node MN10300 Options
13884 @subsection MN10300 Options
13885 @cindex MN10300 options
13886
13887 These @option{-m} options are defined for Matsushita MN10300 architectures:
13888
13889 @table @gcctabopt
13890 @item -mmult-bug
13891 @opindex mmult-bug
13892 Generate code to avoid bugs in the multiply instructions for the MN10300
13893 processors.  This is the default.
13894
13895 @item -mno-mult-bug
13896 @opindex mno-mult-bug
13897 Do not generate code to avoid bugs in the multiply instructions for the
13898 MN10300 processors.
13899
13900 @item -mam33
13901 @opindex mam33
13902 Generate code which uses features specific to the AM33 processor.
13903
13904 @item -mno-am33
13905 @opindex mno-am33
13906 Do not generate code which uses features specific to the AM33 processor.  This
13907 is the default.
13908
13909 @item -mreturn-pointer-on-d0
13910 @opindex mreturn-pointer-on-d0
13911 When generating a function which returns a pointer, return the pointer
13912 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
13913 only in a0, and attempts to call such functions without a prototype
13914 would result in errors.  Note that this option is on by default; use
13915 @option{-mno-return-pointer-on-d0} to disable it.
13916
13917 @item -mno-crt0
13918 @opindex mno-crt0
13919 Do not link in the C run-time initialization object file.
13920
13921 @item -mrelax
13922 @opindex mrelax
13923 Indicate to the linker that it should perform a relaxation optimization pass
13924 to shorten branches, calls and absolute memory addresses.  This option only
13925 has an effect when used on the command line for the final link step.
13926
13927 This option makes symbolic debugging impossible.
13928 @end table
13929
13930 @node PDP-11 Options
13931 @subsection PDP-11 Options
13932 @cindex PDP-11 Options
13933
13934 These options are defined for the PDP-11:
13935
13936 @table @gcctabopt
13937 @item -mfpu
13938 @opindex mfpu
13939 Use hardware FPP floating point.  This is the default.  (FIS floating
13940 point on the PDP-11/40 is not supported.)
13941
13942 @item -msoft-float
13943 @opindex msoft-float
13944 Do not use hardware floating point.
13945
13946 @item -mac0
13947 @opindex mac0
13948 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
13949
13950 @item -mno-ac0
13951 @opindex mno-ac0
13952 Return floating-point results in memory.  This is the default.
13953
13954 @item -m40
13955 @opindex m40
13956 Generate code for a PDP-11/40.
13957
13958 @item -m45
13959 @opindex m45
13960 Generate code for a PDP-11/45.  This is the default.
13961
13962 @item -m10
13963 @opindex m10
13964 Generate code for a PDP-11/10.
13965
13966 @item -mbcopy-builtin
13967 @opindex mbcopy-builtin
13968 Use inline @code{movmemhi} patterns for copying memory.  This is the
13969 default.
13970
13971 @item -mbcopy
13972 @opindex mbcopy
13973 Do not use inline @code{movmemhi} patterns for copying memory.
13974
13975 @item -mint16
13976 @itemx -mno-int32
13977 @opindex mint16
13978 @opindex mno-int32
13979 Use 16-bit @code{int}.  This is the default.
13980
13981 @item -mint32
13982 @itemx -mno-int16
13983 @opindex mint32
13984 @opindex mno-int16
13985 Use 32-bit @code{int}.
13986
13987 @item -mfloat64
13988 @itemx -mno-float32
13989 @opindex mfloat64
13990 @opindex mno-float32
13991 Use 64-bit @code{float}.  This is the default.
13992
13993 @item -mfloat32
13994 @itemx -mno-float64
13995 @opindex mfloat32
13996 @opindex mno-float64
13997 Use 32-bit @code{float}.
13998
13999 @item -mabshi
14000 @opindex mabshi
14001 Use @code{abshi2} pattern.  This is the default.
14002
14003 @item -mno-abshi
14004 @opindex mno-abshi
14005 Do not use @code{abshi2} pattern.
14006
14007 @item -mbranch-expensive
14008 @opindex mbranch-expensive
14009 Pretend that branches are expensive.  This is for experimenting with
14010 code generation only.
14011
14012 @item -mbranch-cheap
14013 @opindex mbranch-cheap
14014 Do not pretend that branches are expensive.  This is the default.
14015
14016 @item -msplit
14017 @opindex msplit
14018 Generate code for a system with split I&D@.
14019
14020 @item -mno-split
14021 @opindex mno-split
14022 Generate code for a system without split I&D@.  This is the default.
14023
14024 @item -munix-asm
14025 @opindex munix-asm
14026 Use Unix assembler syntax.  This is the default when configured for
14027 @samp{pdp11-*-bsd}.
14028
14029 @item -mdec-asm
14030 @opindex mdec-asm
14031 Use DEC assembler syntax.  This is the default when configured for any
14032 PDP-11 target other than @samp{pdp11-*-bsd}.
14033 @end table
14034
14035 @node picoChip Options
14036 @subsection picoChip Options
14037 @cindex picoChip options
14038
14039 These @samp{-m} options are defined for picoChip implementations:
14040
14041 @table @gcctabopt
14042
14043 @item -mae=@var{ae_type}
14044 @opindex mcpu
14045 Set the instruction set, register set, and instruction scheduling
14046 parameters for array element type @var{ae_type}.  Supported values
14047 for @var{ae_type} are @samp{ANY}, @samp{MUL}, and @samp{MAC}.
14048
14049 @option{-mae=ANY} selects a completely generic AE type.  Code
14050 generated with this option will run on any of the other AE types.  The
14051 code will not be as efficient as it would be if compiled for a specific
14052 AE type, and some types of operation (e.g., multiplication) will not
14053 work properly on all types of AE.
14054
14055 @option{-mae=MUL} selects a MUL AE type.  This is the most useful AE type
14056 for compiled code, and is the default.
14057
14058 @option{-mae=MAC} selects a DSP-style MAC AE.  Code compiled with this
14059 option may suffer from poor performance of byte (char) manipulation,
14060 since the DSP AE does not provide hardware support for byte load/stores.
14061
14062 @item -msymbol-as-address
14063 Enable the compiler to directly use a symbol name as an address in a
14064 load/store instruction, without first loading it into a
14065 register.  Typically, the use of this option will generate larger
14066 programs, which run faster than when the option isn't used.  However, the
14067 results vary from program to program, so it is left as a user option,
14068 rather than being permanently enabled.
14069
14070 @item -mno-inefficient-warnings
14071 Disables warnings about the generation of inefficient code.  These
14072 warnings can be generated, for example, when compiling code which
14073 performs byte-level memory operations on the MAC AE type.  The MAC AE has
14074 no hardware support for byte-level memory operations, so all byte
14075 load/stores must be synthesized from word load/store operations.  This is
14076 inefficient and a warning will be generated indicating to the programmer
14077 that they should rewrite the code to avoid byte operations, or to target
14078 an AE type which has the necessary hardware support.  This option enables
14079 the warning to be turned off.
14080
14081 @end table
14082
14083 @node PowerPC Options
14084 @subsection PowerPC Options
14085 @cindex PowerPC options
14086
14087 These are listed under @xref{RS/6000 and PowerPC Options}.
14088
14089 @node RS/6000 and PowerPC Options
14090 @subsection IBM RS/6000 and PowerPC Options
14091 @cindex RS/6000 and PowerPC Options
14092 @cindex IBM RS/6000 and PowerPC Options
14093
14094 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
14095 @table @gcctabopt
14096 @item -mpower
14097 @itemx -mno-power
14098 @itemx -mpower2
14099 @itemx -mno-power2
14100 @itemx -mpowerpc
14101 @itemx -mno-powerpc
14102 @itemx -mpowerpc-gpopt
14103 @itemx -mno-powerpc-gpopt
14104 @itemx -mpowerpc-gfxopt
14105 @itemx -mno-powerpc-gfxopt
14106 @itemx -mpowerpc64
14107 @itemx -mno-powerpc64
14108 @itemx -mmfcrf
14109 @itemx -mno-mfcrf
14110 @itemx -mpopcntb
14111 @itemx -mno-popcntb
14112 @itemx -mfprnd
14113 @itemx -mno-fprnd
14114 @itemx -mcmpb
14115 @itemx -mno-cmpb
14116 @itemx -mmfpgpr
14117 @itemx -mno-mfpgpr
14118 @itemx -mhard-dfp
14119 @itemx -mno-hard-dfp
14120 @opindex mpower
14121 @opindex mno-power
14122 @opindex mpower2
14123 @opindex mno-power2
14124 @opindex mpowerpc
14125 @opindex mno-powerpc
14126 @opindex mpowerpc-gpopt
14127 @opindex mno-powerpc-gpopt
14128 @opindex mpowerpc-gfxopt
14129 @opindex mno-powerpc-gfxopt
14130 @opindex mpowerpc64
14131 @opindex mno-powerpc64
14132 @opindex mmfcrf
14133 @opindex mno-mfcrf
14134 @opindex mpopcntb
14135 @opindex mno-popcntb
14136 @opindex mfprnd
14137 @opindex mno-fprnd
14138 @opindex mcmpb
14139 @opindex mno-cmpb
14140 @opindex mmfpgpr
14141 @opindex mno-mfpgpr
14142 @opindex mhard-dfp
14143 @opindex mno-hard-dfp
14144 GCC supports two related instruction set architectures for the
14145 RS/6000 and PowerPC@.  The @dfn{POWER} instruction set are those
14146 instructions supported by the @samp{rios} chip set used in the original
14147 RS/6000 systems and the @dfn{PowerPC} instruction set is the
14148 architecture of the Freescale MPC5xx, MPC6xx, MPC8xx microprocessors, and
14149 the IBM 4xx, 6xx, and follow-on microprocessors.
14150
14151 Neither architecture is a subset of the other.  However there is a
14152 large common subset of instructions supported by both.  An MQ
14153 register is included in processors supporting the POWER architecture.
14154
14155 You use these options to specify which instructions are available on the
14156 processor you are using.  The default value of these options is
14157 determined when configuring GCC@.  Specifying the
14158 @option{-mcpu=@var{cpu_type}} overrides the specification of these
14159 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
14160 rather than the options listed above.
14161
14162 The @option{-mpower} option allows GCC to generate instructions that
14163 are found only in the POWER architecture and to use the MQ register.
14164 Specifying @option{-mpower2} implies @option{-power} and also allows GCC
14165 to generate instructions that are present in the POWER2 architecture but
14166 not the original POWER architecture.
14167
14168 The @option{-mpowerpc} option allows GCC to generate instructions that
14169 are found only in the 32-bit subset of the PowerPC architecture.
14170 Specifying @option{-mpowerpc-gpopt} implies @option{-mpowerpc} and also allows
14171 GCC to use the optional PowerPC architecture instructions in the
14172 General Purpose group, including floating-point square root.  Specifying
14173 @option{-mpowerpc-gfxopt} implies @option{-mpowerpc} and also allows GCC to
14174 use the optional PowerPC architecture instructions in the Graphics
14175 group, including floating-point select.
14176
14177 The @option{-mmfcrf} option allows GCC to generate the move from
14178 condition register field instruction implemented on the POWER4
14179 processor and other processors that support the PowerPC V2.01
14180 architecture.
14181 The @option{-mpopcntb} option allows GCC to generate the popcount and
14182 double precision FP reciprocal estimate instruction implemented on the
14183 POWER5 processor and other processors that support the PowerPC V2.02
14184 architecture.
14185 The @option{-mfprnd} option allows GCC to generate the FP round to
14186 integer instructions implemented on the POWER5+ processor and other
14187 processors that support the PowerPC V2.03 architecture.
14188 The @option{-mcmpb} option allows GCC to generate the compare bytes
14189 instruction implemented on the POWER6 processor and other processors
14190 that support the PowerPC V2.05 architecture.
14191 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
14192 general purpose register instructions implemented on the POWER6X
14193 processor and other processors that support the extended PowerPC V2.05
14194 architecture.
14195 The @option{-mhard-dfp} option allows GCC to generate the decimal floating
14196 point instructions implemented on some POWER processors.
14197
14198 The @option{-mpowerpc64} option allows GCC to generate the additional
14199 64-bit instructions that are found in the full PowerPC64 architecture
14200 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
14201 @option{-mno-powerpc64}.
14202
14203 If you specify both @option{-mno-power} and @option{-mno-powerpc}, GCC
14204 will use only the instructions in the common subset of both
14205 architectures plus some special AIX common-mode calls, and will not use
14206 the MQ register.  Specifying both @option{-mpower} and @option{-mpowerpc}
14207 permits GCC to use any instruction from either architecture and to
14208 allow use of the MQ register; specify this for the Motorola MPC601.
14209
14210 @item -mnew-mnemonics
14211 @itemx -mold-mnemonics
14212 @opindex mnew-mnemonics
14213 @opindex mold-mnemonics
14214 Select which mnemonics to use in the generated assembler code.  With
14215 @option{-mnew-mnemonics}, GCC uses the assembler mnemonics defined for
14216 the PowerPC architecture.  With @option{-mold-mnemonics} it uses the
14217 assembler mnemonics defined for the POWER architecture.  Instructions
14218 defined in only one architecture have only one mnemonic; GCC uses that
14219 mnemonic irrespective of which of these options is specified.
14220
14221 GCC defaults to the mnemonics appropriate for the architecture in
14222 use.  Specifying @option{-mcpu=@var{cpu_type}} sometimes overrides the
14223 value of these option.  Unless you are building a cross-compiler, you
14224 should normally not specify either @option{-mnew-mnemonics} or
14225 @option{-mold-mnemonics}, but should instead accept the default.
14226
14227 @item -mcpu=@var{cpu_type}
14228 @opindex mcpu
14229 Set architecture type, register usage, choice of mnemonics, and
14230 instruction scheduling parameters for machine type @var{cpu_type}.
14231 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
14232 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{464}, @samp{464fp},
14233 @samp{505}, @samp{601}, @samp{602}, @samp{603}, @samp{603e}, @samp{604},
14234 @samp{604e}, @samp{620}, @samp{630}, @samp{740}, @samp{7400},
14235 @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
14236 @samp{860}, @samp{970}, @samp{8540}, @samp{e300c2}, @samp{e300c3},
14237 @samp{e500mc}, @samp{ec603e}, @samp{G3}, @samp{G4}, @samp{G5},
14238 @samp{power}, @samp{power2}, @samp{power3}, @samp{power4},
14239 @samp{power5}, @samp{power5+}, @samp{power6}, @samp{power6x}, @samp{power7}
14240 @samp{common}, @samp{powerpc}, @samp{powerpc64}, @samp{rios},
14241 @samp{rios1}, @samp{rios2}, @samp{rsc}, and @samp{rs64}.
14242
14243 @option{-mcpu=common} selects a completely generic processor.  Code
14244 generated under this option will run on any POWER or PowerPC processor.
14245 GCC will use only the instructions in the common subset of both
14246 architectures, and will not use the MQ register.  GCC assumes a generic
14247 processor model for scheduling purposes.
14248
14249 @option{-mcpu=power}, @option{-mcpu=power2}, @option{-mcpu=powerpc}, and
14250 @option{-mcpu=powerpc64} specify generic POWER, POWER2, pure 32-bit
14251 PowerPC (i.e., not MPC601), and 64-bit PowerPC architecture machine
14252 types, with an appropriate, generic processor model assumed for
14253 scheduling purposes.
14254
14255 The other options specify a specific processor.  Code generated under
14256 those options will run best on that processor, and may not run at all on
14257 others.
14258
14259 The @option{-mcpu} options automatically enable or disable the
14260 following options:
14261
14262 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
14263 -mnew-mnemonics  -mpopcntb  -mpower  -mpower2  -mpowerpc64 @gol
14264 -mpowerpc-gpopt  -mpowerpc-gfxopt  -msingle-float -mdouble-float @gol
14265 -msimple-fpu -mstring  -mmulhw  -mdlmzb  -mmfpgpr}
14266
14267 The particular options set for any particular CPU will vary between
14268 compiler versions, depending on what setting seems to produce optimal
14269 code for that CPU; it doesn't necessarily reflect the actual hardware's
14270 capabilities.  If you wish to set an individual option to a particular
14271 value, you may specify it after the @option{-mcpu} option, like
14272 @samp{-mcpu=970 -mno-altivec}.
14273
14274 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
14275 not enabled or disabled by the @option{-mcpu} option at present because
14276 AIX does not have full support for these options.  You may still
14277 enable or disable them individually if you're sure it'll work in your
14278 environment.
14279
14280 @item -mtune=@var{cpu_type}
14281 @opindex mtune
14282 Set the instruction scheduling parameters for machine type
14283 @var{cpu_type}, but do not set the architecture type, register usage, or
14284 choice of mnemonics, as @option{-mcpu=@var{cpu_type}} would.  The same
14285 values for @var{cpu_type} are used for @option{-mtune} as for
14286 @option{-mcpu}.  If both are specified, the code generated will use the
14287 architecture, registers, and mnemonics set by @option{-mcpu}, but the
14288 scheduling parameters set by @option{-mtune}.
14289
14290 @item -mswdiv
14291 @itemx -mno-swdiv
14292 @opindex mswdiv
14293 @opindex mno-swdiv
14294 Generate code to compute division as reciprocal estimate and iterative
14295 refinement, creating opportunities for increased throughput.  This
14296 feature requires: optional PowerPC Graphics instruction set for single
14297 precision and FRE instruction for double precision, assuming divides
14298 cannot generate user-visible traps, and the domain values not include
14299 Infinities, denormals or zero denominator.
14300
14301 @item -maltivec
14302 @itemx -mno-altivec
14303 @opindex maltivec
14304 @opindex mno-altivec
14305 Generate code that uses (does not use) AltiVec instructions, and also
14306 enable the use of built-in functions that allow more direct access to
14307 the AltiVec instruction set.  You may also need to set
14308 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
14309 enhancements.
14310
14311 @item -mvrsave
14312 @itemx -mno-vrsave
14313 @opindex mvrsave
14314 @opindex mno-vrsave
14315 Generate VRSAVE instructions when generating AltiVec code.
14316
14317 @item -mgen-cell-microcode
14318 @opindex mgen-cell-microcode
14319 Generate Cell microcode instructions
14320
14321 @item -mwarn-cell-microcode
14322 @opindex mwarn-cell-microcode
14323 Warning when a Cell microcode instruction is going to emitted.  An example
14324 of a Cell microcode instruction is a variable shift.
14325
14326 @item -msecure-plt
14327 @opindex msecure-plt
14328 Generate code that allows ld and ld.so to build executables and shared
14329 libraries with non-exec .plt and .got sections.  This is a PowerPC
14330 32-bit SYSV ABI option.
14331
14332 @item -mbss-plt
14333 @opindex mbss-plt
14334 Generate code that uses a BSS .plt section that ld.so fills in, and
14335 requires .plt and .got sections that are both writable and executable.
14336 This is a PowerPC 32-bit SYSV ABI option.
14337
14338 @item -misel
14339 @itemx -mno-isel
14340 @opindex misel
14341 @opindex mno-isel
14342 This switch enables or disables the generation of ISEL instructions.
14343
14344 @item -misel=@var{yes/no}
14345 This switch has been deprecated.  Use @option{-misel} and
14346 @option{-mno-isel} instead.
14347
14348 @item -mspe
14349 @itemx -mno-spe
14350 @opindex mspe
14351 @opindex mno-spe
14352 This switch enables or disables the generation of SPE simd
14353 instructions.
14354
14355 @item -mpaired
14356 @itemx -mno-paired
14357 @opindex mpaired
14358 @opindex mno-paired
14359 This switch enables or disables the generation of PAIRED simd
14360 instructions.
14361
14362 @item -mspe=@var{yes/no}
14363 This option has been deprecated.  Use @option{-mspe} and
14364 @option{-mno-spe} instead.
14365
14366 @item -mfloat-gprs=@var{yes/single/double/no}
14367 @itemx -mfloat-gprs
14368 @opindex mfloat-gprs
14369 This switch enables or disables the generation of floating point
14370 operations on the general purpose registers for architectures that
14371 support it.
14372
14373 The argument @var{yes} or @var{single} enables the use of
14374 single-precision floating point operations.
14375
14376 The argument @var{double} enables the use of single and
14377 double-precision floating point operations.
14378
14379 The argument @var{no} disables floating point operations on the
14380 general purpose registers.
14381
14382 This option is currently only available on the MPC854x.
14383
14384 @item -m32
14385 @itemx -m64
14386 @opindex m32
14387 @opindex m64
14388 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
14389 targets (including GNU/Linux).  The 32-bit environment sets int, long
14390 and pointer to 32 bits and generates code that runs on any PowerPC
14391 variant.  The 64-bit environment sets int to 32 bits and long and
14392 pointer to 64 bits, and generates code for PowerPC64, as for
14393 @option{-mpowerpc64}.
14394
14395 @item -mfull-toc
14396 @itemx -mno-fp-in-toc
14397 @itemx -mno-sum-in-toc
14398 @itemx -mminimal-toc
14399 @opindex mfull-toc
14400 @opindex mno-fp-in-toc
14401 @opindex mno-sum-in-toc
14402 @opindex mminimal-toc
14403 Modify generation of the TOC (Table Of Contents), which is created for
14404 every executable file.  The @option{-mfull-toc} option is selected by
14405 default.  In that case, GCC will allocate at least one TOC entry for
14406 each unique non-automatic variable reference in your program.  GCC
14407 will also place floating-point constants in the TOC@.  However, only
14408 16,384 entries are available in the TOC@.
14409
14410 If you receive a linker error message that saying you have overflowed
14411 the available TOC space, you can reduce the amount of TOC space used
14412 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
14413 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
14414 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
14415 generate code to calculate the sum of an address and a constant at
14416 run-time instead of putting that sum into the TOC@.  You may specify one
14417 or both of these options.  Each causes GCC to produce very slightly
14418 slower and larger code at the expense of conserving TOC space.
14419
14420 If you still run out of space in the TOC even when you specify both of
14421 these options, specify @option{-mminimal-toc} instead.  This option causes
14422 GCC to make only one TOC entry for every file.  When you specify this
14423 option, GCC will produce code that is slower and larger but which
14424 uses extremely little TOC space.  You may wish to use this option
14425 only on files that contain less frequently executed code.
14426
14427 @item -maix64
14428 @itemx -maix32
14429 @opindex maix64
14430 @opindex maix32
14431 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
14432 @code{long} type, and the infrastructure needed to support them.
14433 Specifying @option{-maix64} implies @option{-mpowerpc64} and
14434 @option{-mpowerpc}, while @option{-maix32} disables the 64-bit ABI and
14435 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
14436
14437 @item -mxl-compat
14438 @itemx -mno-xl-compat
14439 @opindex mxl-compat
14440 @opindex mno-xl-compat
14441 Produce code that conforms more closely to IBM XL compiler semantics
14442 when using AIX-compatible ABI@.  Pass floating-point arguments to
14443 prototyped functions beyond the register save area (RSA) on the stack
14444 in addition to argument FPRs.  Do not assume that most significant
14445 double in 128-bit long double value is properly rounded when comparing
14446 values and converting to double.  Use XL symbol names for long double
14447 support routines.
14448
14449 The AIX calling convention was extended but not initially documented to
14450 handle an obscure K&R C case of calling a function that takes the
14451 address of its arguments with fewer arguments than declared.  IBM XL
14452 compilers access floating point arguments which do not fit in the
14453 RSA from the stack when a subroutine is compiled without
14454 optimization.  Because always storing floating-point arguments on the
14455 stack is inefficient and rarely needed, this option is not enabled by
14456 default and only is necessary when calling subroutines compiled by IBM
14457 XL compilers without optimization.
14458
14459 @item -mpe
14460 @opindex mpe
14461 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
14462 application written to use message passing with special startup code to
14463 enable the application to run.  The system must have PE installed in the
14464 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
14465 must be overridden with the @option{-specs=} option to specify the
14466 appropriate directory location.  The Parallel Environment does not
14467 support threads, so the @option{-mpe} option and the @option{-pthread}
14468 option are incompatible.
14469
14470 @item -malign-natural
14471 @itemx -malign-power
14472 @opindex malign-natural
14473 @opindex malign-power
14474 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
14475 @option{-malign-natural} overrides the ABI-defined alignment of larger
14476 types, such as floating-point doubles, on their natural size-based boundary.
14477 The option @option{-malign-power} instructs GCC to follow the ABI-specified
14478 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
14479
14480 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
14481 is not supported.
14482
14483 @item -msoft-float
14484 @itemx -mhard-float
14485 @opindex msoft-float
14486 @opindex mhard-float
14487 Generate code that does not use (uses) the floating-point register set.
14488 Software floating point emulation is provided if you use the
14489 @option{-msoft-float} option, and pass the option to GCC when linking.
14490
14491 @item -msingle-float
14492 @itemx -mdouble-float
14493 @opindex msingle-float
14494 @opindex mdouble-float
14495 Generate code for single or double-precision floating point operations.
14496 @option{-mdouble-float} implies @option{-msingle-float}.
14497
14498 @item -msimple-fpu
14499 @opindex msimple-fpu
14500 Do not generate sqrt and div instructions for hardware floating point unit.
14501
14502 @item -mfpu
14503 @opindex mfpu
14504 Specify type of floating point unit.  Valid values are @var{sp_lite}
14505 (equivalent to -msingle-float -msimple-fpu), @var{dp_lite} (equivalent
14506 to -mdouble-float -msimple-fpu), @var{sp_full} (equivalent to -msingle-float),
14507 and @var{dp_full} (equivalent to -mdouble-float).
14508
14509 @item -mxilinx-fpu
14510 @opindex mxilinx-fpu
14511 Perform optimizations for floating point unit on Xilinx PPC 405/440.
14512
14513 @item -mmultiple
14514 @itemx -mno-multiple
14515 @opindex mmultiple
14516 @opindex mno-multiple
14517 Generate code that uses (does not use) the load multiple word
14518 instructions and the store multiple word instructions.  These
14519 instructions are generated by default on POWER systems, and not
14520 generated on PowerPC systems.  Do not use @option{-mmultiple} on little
14521 endian PowerPC systems, since those instructions do not work when the
14522 processor is in little endian mode.  The exceptions are PPC740 and
14523 PPC750 which permit the instructions usage in little endian mode.
14524
14525 @item -mstring
14526 @itemx -mno-string
14527 @opindex mstring
14528 @opindex mno-string
14529 Generate code that uses (does not use) the load string instructions
14530 and the store string word instructions to save multiple registers and
14531 do small block moves.  These instructions are generated by default on
14532 POWER systems, and not generated on PowerPC systems.  Do not use
14533 @option{-mstring} on little endian PowerPC systems, since those
14534 instructions do not work when the processor is in little endian mode.
14535 The exceptions are PPC740 and PPC750 which permit the instructions
14536 usage in little endian mode.
14537
14538 @item -mupdate
14539 @itemx -mno-update
14540 @opindex mupdate
14541 @opindex mno-update
14542 Generate code that uses (does not use) the load or store instructions
14543 that update the base register to the address of the calculated memory
14544 location.  These instructions are generated by default.  If you use
14545 @option{-mno-update}, there is a small window between the time that the
14546 stack pointer is updated and the address of the previous frame is
14547 stored, which means code that walks the stack frame across interrupts or
14548 signals may get corrupted data.
14549
14550 @item -mavoid-indexed-addresses
14551 @item -mno-avoid-indexed-addresses
14552 @opindex mavoid-indexed-addresses
14553 @opindex mno-avoid-indexed-addresses
14554 Generate code that tries to avoid (not avoid) the use of indexed load
14555 or store instructions. These instructions can incur a performance
14556 penalty on Power6 processors in certain situations, such as when
14557 stepping through large arrays that cross a 16M boundary.  This option
14558 is enabled by default when targetting Power6 and disabled otherwise.
14559
14560 @item -mfused-madd
14561 @itemx -mno-fused-madd
14562 @opindex mfused-madd
14563 @opindex mno-fused-madd
14564 Generate code that uses (does not use) the floating point multiply and
14565 accumulate instructions.  These instructions are generated by default if
14566 hardware floating is used.
14567
14568 @item -mmulhw
14569 @itemx -mno-mulhw
14570 @opindex mmulhw
14571 @opindex mno-mulhw
14572 Generate code that uses (does not use) the half-word multiply and
14573 multiply-accumulate instructions on the IBM 405, 440 and 464 processors.
14574 These instructions are generated by default when targetting those
14575 processors.
14576
14577 @item -mdlmzb
14578 @itemx -mno-dlmzb
14579 @opindex mdlmzb
14580 @opindex mno-dlmzb
14581 Generate code that uses (does not use) the string-search @samp{dlmzb}
14582 instruction on the IBM 405, 440 and 464 processors.  This instruction is
14583 generated by default when targetting those processors.
14584
14585 @item -mno-bit-align
14586 @itemx -mbit-align
14587 @opindex mno-bit-align
14588 @opindex mbit-align
14589 On System V.4 and embedded PowerPC systems do not (do) force structures
14590 and unions that contain bit-fields to be aligned to the base type of the
14591 bit-field.
14592
14593 For example, by default a structure containing nothing but 8
14594 @code{unsigned} bit-fields of length 1 would be aligned to a 4 byte
14595 boundary and have a size of 4 bytes.  By using @option{-mno-bit-align},
14596 the structure would be aligned to a 1 byte boundary and be one byte in
14597 size.
14598
14599 @item -mno-strict-align
14600 @itemx -mstrict-align
14601 @opindex mno-strict-align
14602 @opindex mstrict-align
14603 On System V.4 and embedded PowerPC systems do not (do) assume that
14604 unaligned memory references will be handled by the system.
14605
14606 @item -mrelocatable
14607 @itemx -mno-relocatable
14608 @opindex mrelocatable
14609 @opindex mno-relocatable
14610 On embedded PowerPC systems generate code that allows (does not allow)
14611 the program to be relocated to a different address at runtime.  If you
14612 use @option{-mrelocatable} on any module, all objects linked together must
14613 be compiled with @option{-mrelocatable} or @option{-mrelocatable-lib}.
14614
14615 @item -mrelocatable-lib
14616 @itemx -mno-relocatable-lib
14617 @opindex mrelocatable-lib
14618 @opindex mno-relocatable-lib
14619 On embedded PowerPC systems generate code that allows (does not allow)
14620 the program to be relocated to a different address at runtime.  Modules
14621 compiled with @option{-mrelocatable-lib} can be linked with either modules
14622 compiled without @option{-mrelocatable} and @option{-mrelocatable-lib} or
14623 with modules compiled with the @option{-mrelocatable} options.
14624
14625 @item -mno-toc
14626 @itemx -mtoc
14627 @opindex mno-toc
14628 @opindex mtoc
14629 On System V.4 and embedded PowerPC systems do not (do) assume that
14630 register 2 contains a pointer to a global area pointing to the addresses
14631 used in the program.
14632
14633 @item -mlittle
14634 @itemx -mlittle-endian
14635 @opindex mlittle
14636 @opindex mlittle-endian
14637 On System V.4 and embedded PowerPC systems compile code for the
14638 processor in little endian mode.  The @option{-mlittle-endian} option is
14639 the same as @option{-mlittle}.
14640
14641 @item -mbig
14642 @itemx -mbig-endian
14643 @opindex mbig
14644 @opindex mbig-endian
14645 On System V.4 and embedded PowerPC systems compile code for the
14646 processor in big endian mode.  The @option{-mbig-endian} option is
14647 the same as @option{-mbig}.
14648
14649 @item -mdynamic-no-pic
14650 @opindex mdynamic-no-pic
14651 On Darwin and Mac OS X systems, compile code so that it is not
14652 relocatable, but that its external references are relocatable.  The
14653 resulting code is suitable for applications, but not shared
14654 libraries.
14655
14656 @item -mprioritize-restricted-insns=@var{priority}
14657 @opindex mprioritize-restricted-insns
14658 This option controls the priority that is assigned to
14659 dispatch-slot restricted instructions during the second scheduling
14660 pass.  The argument @var{priority} takes the value @var{0/1/2} to assign
14661 @var{no/highest/second-highest} priority to dispatch slot restricted
14662 instructions.
14663
14664 @item -msched-costly-dep=@var{dependence_type}
14665 @opindex msched-costly-dep
14666 This option controls which dependences are considered costly
14667 by the target during instruction scheduling.  The argument
14668 @var{dependence_type} takes one of the following values:
14669 @var{no}: no dependence is costly,
14670 @var{all}: all dependences are costly,
14671 @var{true_store_to_load}: a true dependence from store to load is costly,
14672 @var{store_to_load}: any dependence from store to load is costly,
14673 @var{number}: any dependence which latency >= @var{number} is costly.
14674
14675 @item -minsert-sched-nops=@var{scheme}
14676 @opindex minsert-sched-nops
14677 This option controls which nop insertion scheme will be used during
14678 the second scheduling pass.  The argument @var{scheme} takes one of the
14679 following values:
14680 @var{no}: Don't insert nops.
14681 @var{pad}: Pad with nops any dispatch group which has vacant issue slots,
14682 according to the scheduler's grouping.
14683 @var{regroup_exact}: Insert nops to force costly dependent insns into
14684 separate groups.  Insert exactly as many nops as needed to force an insn
14685 to a new group, according to the estimated processor grouping.
14686 @var{number}: Insert nops to force costly dependent insns into
14687 separate groups.  Insert @var{number} nops to force an insn to a new group.
14688
14689 @item -mcall-sysv
14690 @opindex mcall-sysv
14691 On System V.4 and embedded PowerPC systems compile code using calling
14692 conventions that adheres to the March 1995 draft of the System V
14693 Application Binary Interface, PowerPC processor supplement.  This is the
14694 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
14695
14696 @item -mcall-sysv-eabi
14697 @itemx -mcall-eabi
14698 @opindex mcall-sysv-eabi
14699 @opindex mcall-eabi
14700 Specify both @option{-mcall-sysv} and @option{-meabi} options.
14701
14702 @item -mcall-sysv-noeabi
14703 @opindex mcall-sysv-noeabi
14704 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
14705
14706 @item -mcall-aixdesc
14707 @opindex m
14708 On System V.4 and embedded PowerPC systems compile code for the AIX
14709 operating system.
14710
14711 @item -mcall-linux
14712 @opindex mcall-linux
14713 On System V.4 and embedded PowerPC systems compile code for the
14714 Linux-based GNU system.
14715
14716 @item -mcall-gnu
14717 @opindex mcall-gnu
14718 On System V.4 and embedded PowerPC systems compile code for the
14719 Hurd-based GNU system.
14720
14721 @item -mcall-freebsd
14722 @opindex mcall-freebsd
14723 On System V.4 and embedded PowerPC systems compile code for the
14724 FreeBSD operating system.
14725
14726 @item -mcall-netbsd
14727 @opindex mcall-netbsd
14728 On System V.4 and embedded PowerPC systems compile code for the
14729 NetBSD operating system.
14730
14731 @item -mcall-openbsd
14732 @opindex mcall-netbsd
14733 On System V.4 and embedded PowerPC systems compile code for the
14734 OpenBSD operating system.
14735
14736 @item -maix-struct-return
14737 @opindex maix-struct-return
14738 Return all structures in memory (as specified by the AIX ABI)@.
14739
14740 @item -msvr4-struct-return
14741 @opindex msvr4-struct-return
14742 Return structures smaller than 8 bytes in registers (as specified by the
14743 SVR4 ABI)@.
14744
14745 @item -mabi=@var{abi-type}
14746 @opindex mabi
14747 Extend the current ABI with a particular extension, or remove such extension.
14748 Valid values are @var{altivec}, @var{no-altivec}, @var{spe},
14749 @var{no-spe}, @var{ibmlongdouble}, @var{ieeelongdouble}@.
14750
14751 @item -mabi=spe
14752 @opindex mabi=spe
14753 Extend the current ABI with SPE ABI extensions.  This does not change
14754 the default ABI, instead it adds the SPE ABI extensions to the current
14755 ABI@.
14756
14757 @item -mabi=no-spe
14758 @opindex mabi=no-spe
14759 Disable Booke SPE ABI extensions for the current ABI@.
14760
14761 @item -mabi=ibmlongdouble
14762 @opindex mabi=ibmlongdouble
14763 Change the current ABI to use IBM extended precision long double.
14764 This is a PowerPC 32-bit SYSV ABI option.
14765
14766 @item -mabi=ieeelongdouble
14767 @opindex mabi=ieeelongdouble
14768 Change the current ABI to use IEEE extended precision long double.
14769 This is a PowerPC 32-bit Linux ABI option.
14770
14771 @item -mprototype
14772 @itemx -mno-prototype
14773 @opindex mprototype
14774 @opindex mno-prototype
14775 On System V.4 and embedded PowerPC systems assume that all calls to
14776 variable argument functions are properly prototyped.  Otherwise, the
14777 compiler must insert an instruction before every non prototyped call to
14778 set or clear bit 6 of the condition code register (@var{CR}) to
14779 indicate whether floating point values were passed in the floating point
14780 registers in case the function takes a variable arguments.  With
14781 @option{-mprototype}, only calls to prototyped variable argument functions
14782 will set or clear the bit.
14783
14784 @item -msim
14785 @opindex msim
14786 On embedded PowerPC systems, assume that the startup module is called
14787 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
14788 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}
14789 configurations.
14790
14791 @item -mmvme
14792 @opindex mmvme
14793 On embedded PowerPC systems, assume that the startup module is called
14794 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
14795 @file{libc.a}.
14796
14797 @item -mads
14798 @opindex mads
14799 On embedded PowerPC systems, assume that the startup module is called
14800 @file{crt0.o} and the standard C libraries are @file{libads.a} and
14801 @file{libc.a}.
14802
14803 @item -myellowknife
14804 @opindex myellowknife
14805 On embedded PowerPC systems, assume that the startup module is called
14806 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
14807 @file{libc.a}.
14808
14809 @item -mvxworks
14810 @opindex mvxworks
14811 On System V.4 and embedded PowerPC systems, specify that you are
14812 compiling for a VxWorks system.
14813
14814 @item -memb
14815 @opindex memb
14816 On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
14817 header to indicate that @samp{eabi} extended relocations are used.
14818
14819 @item -meabi
14820 @itemx -mno-eabi
14821 @opindex meabi
14822 @opindex mno-eabi
14823 On System V.4 and embedded PowerPC systems do (do not) adhere to the
14824 Embedded Applications Binary Interface (eabi) which is a set of
14825 modifications to the System V.4 specifications.  Selecting @option{-meabi}
14826 means that the stack is aligned to an 8 byte boundary, a function
14827 @code{__eabi} is called to from @code{main} to set up the eabi
14828 environment, and the @option{-msdata} option can use both @code{r2} and
14829 @code{r13} to point to two separate small data areas.  Selecting
14830 @option{-mno-eabi} means that the stack is aligned to a 16 byte boundary,
14831 do not call an initialization function from @code{main}, and the
14832 @option{-msdata} option will only use @code{r13} to point to a single
14833 small data area.  The @option{-meabi} option is on by default if you
14834 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
14835
14836 @item -msdata=eabi
14837 @opindex msdata=eabi
14838 On System V.4 and embedded PowerPC systems, put small initialized
14839 @code{const} global and static data in the @samp{.sdata2} section, which
14840 is pointed to by register @code{r2}.  Put small initialized
14841 non-@code{const} global and static data in the @samp{.sdata} section,
14842 which is pointed to by register @code{r13}.  Put small uninitialized
14843 global and static data in the @samp{.sbss} section, which is adjacent to
14844 the @samp{.sdata} section.  The @option{-msdata=eabi} option is
14845 incompatible with the @option{-mrelocatable} option.  The
14846 @option{-msdata=eabi} option also sets the @option{-memb} option.
14847
14848 @item -msdata=sysv
14849 @opindex msdata=sysv
14850 On System V.4 and embedded PowerPC systems, put small global and static
14851 data in the @samp{.sdata} section, which is pointed to by register
14852 @code{r13}.  Put small uninitialized global and static data in the
14853 @samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
14854 The @option{-msdata=sysv} option is incompatible with the
14855 @option{-mrelocatable} option.
14856
14857 @item -msdata=default
14858 @itemx -msdata
14859 @opindex msdata=default
14860 @opindex msdata
14861 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
14862 compile code the same as @option{-msdata=eabi}, otherwise compile code the
14863 same as @option{-msdata=sysv}.
14864
14865 @item -msdata=data
14866 @opindex msdata=data
14867 On System V.4 and embedded PowerPC systems, put small global
14868 data in the @samp{.sdata} section.  Put small uninitialized global
14869 data in the @samp{.sbss} section.  Do not use register @code{r13}
14870 to address small data however.  This is the default behavior unless
14871 other @option{-msdata} options are used.
14872
14873 @item -msdata=none
14874 @itemx -mno-sdata
14875 @opindex msdata=none
14876 @opindex mno-sdata
14877 On embedded PowerPC systems, put all initialized global and static data
14878 in the @samp{.data} section, and all uninitialized data in the
14879 @samp{.bss} section.
14880
14881 @item -G @var{num}
14882 @opindex G
14883 @cindex smaller data references (PowerPC)
14884 @cindex .sdata/.sdata2 references (PowerPC)
14885 On embedded PowerPC systems, put global and static items less than or
14886 equal to @var{num} bytes into the small data or bss sections instead of
14887 the normal data or bss section.  By default, @var{num} is 8.  The
14888 @option{-G @var{num}} switch is also passed to the linker.
14889 All modules should be compiled with the same @option{-G @var{num}} value.
14890
14891 @item -mregnames
14892 @itemx -mno-regnames
14893 @opindex mregnames
14894 @opindex mno-regnames
14895 On System V.4 and embedded PowerPC systems do (do not) emit register
14896 names in the assembly language output using symbolic forms.
14897
14898 @item -mlongcall
14899 @itemx -mno-longcall
14900 @opindex mlongcall
14901 @opindex mno-longcall
14902 By default assume that all calls are far away so that a longer more
14903 expensive calling sequence is required.  This is required for calls
14904 further than 32 megabytes (33,554,432 bytes) from the current location.
14905 A short call will be generated if the compiler knows
14906 the call cannot be that far away.  This setting can be overridden by
14907 the @code{shortcall} function attribute, or by @code{#pragma
14908 longcall(0)}.
14909
14910 Some linkers are capable of detecting out-of-range calls and generating
14911 glue code on the fly.  On these systems, long calls are unnecessary and
14912 generate slower code.  As of this writing, the AIX linker can do this,
14913 as can the GNU linker for PowerPC/64.  It is planned to add this feature
14914 to the GNU linker for 32-bit PowerPC systems as well.
14915
14916 On Darwin/PPC systems, @code{#pragma longcall} will generate ``jbsr
14917 callee, L42'', plus a ``branch island'' (glue code).  The two target
14918 addresses represent the callee and the ``branch island''.  The
14919 Darwin/PPC linker will prefer the first address and generate a ``bl
14920 callee'' if the PPC ``bl'' instruction will reach the callee directly;
14921 otherwise, the linker will generate ``bl L42'' to call the ``branch
14922 island''.  The ``branch island'' is appended to the body of the
14923 calling function; it computes the full 32-bit address of the callee
14924 and jumps to it.
14925
14926 On Mach-O (Darwin) systems, this option directs the compiler emit to
14927 the glue for every direct call, and the Darwin linker decides whether
14928 to use or discard it.
14929
14930 In the future, we may cause GCC to ignore all longcall specifications
14931 when the linker is known to generate glue.
14932
14933 @item -mtls-markers
14934 @itemx -mno-tls-markers
14935 @opindex mtls-markers
14936 @opindex mno-tls-markers
14937 Mark (do not mark) calls to @code{__tls_get_addr} with a relocation
14938 specifying the function argument.  The relocation allows ld to
14939 reliably associate function call with argument setup instructions for
14940 TLS optimization, which in turn allows gcc to better schedule the
14941 sequence.
14942
14943 @item -pthread
14944 @opindex pthread
14945 Adds support for multithreading with the @dfn{pthreads} library.
14946 This option sets flags for both the preprocessor and linker.
14947
14948 @end table
14949
14950 @node S/390 and zSeries Options
14951 @subsection S/390 and zSeries Options
14952 @cindex S/390 and zSeries Options
14953
14954 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
14955
14956 @table @gcctabopt
14957 @item -mhard-float
14958 @itemx -msoft-float
14959 @opindex mhard-float
14960 @opindex msoft-float
14961 Use (do not use) the hardware floating-point instructions and registers
14962 for floating-point operations.  When @option{-msoft-float} is specified,
14963 functions in @file{libgcc.a} will be used to perform floating-point
14964 operations.  When @option{-mhard-float} is specified, the compiler
14965 generates IEEE floating-point instructions.  This is the default.
14966
14967 @item -mhard-dfp
14968 @itemx -mno-hard-dfp
14969 @opindex mhard-dfp
14970 @opindex mno-hard-dfp
14971 Use (do not use) the hardware decimal-floating-point instructions for
14972 decimal-floating-point operations.  When @option{-mno-hard-dfp} is
14973 specified, functions in @file{libgcc.a} will be used to perform
14974 decimal-floating-point operations.  When @option{-mhard-dfp} is
14975 specified, the compiler generates decimal-floating-point hardware
14976 instructions.  This is the default for @option{-march=z9-ec} or higher.
14977
14978 @item -mlong-double-64
14979 @itemx -mlong-double-128
14980 @opindex mlong-double-64
14981 @opindex mlong-double-128
14982 These switches control the size of @code{long double} type. A size
14983 of 64bit makes the @code{long double} type equivalent to the @code{double}
14984 type. This is the default.
14985
14986 @item -mbackchain
14987 @itemx -mno-backchain
14988 @opindex mbackchain
14989 @opindex mno-backchain
14990 Store (do not store) the address of the caller's frame as backchain pointer
14991 into the callee's stack frame.
14992 A backchain may be needed to allow debugging using tools that do not understand
14993 DWARF-2 call frame information.
14994 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
14995 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
14996 the backchain is placed into the topmost word of the 96/160 byte register
14997 save area.
14998
14999 In general, code compiled with @option{-mbackchain} is call-compatible with
15000 code compiled with @option{-mmo-backchain}; however, use of the backchain
15001 for debugging purposes usually requires that the whole binary is built with
15002 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
15003 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
15004 to build a linux kernel use @option{-msoft-float}.
15005
15006 The default is to not maintain the backchain.
15007
15008 @item -mpacked-stack
15009 @itemx -mno-packed-stack
15010 @opindex mpacked-stack
15011 @opindex mno-packed-stack
15012 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
15013 specified, the compiler uses the all fields of the 96/160 byte register save
15014 area only for their default purpose; unused fields still take up stack space.
15015 When @option{-mpacked-stack} is specified, register save slots are densely
15016 packed at the top of the register save area; unused space is reused for other
15017 purposes, allowing for more efficient use of the available stack space.
15018 However, when @option{-mbackchain} is also in effect, the topmost word of
15019 the save area is always used to store the backchain, and the return address
15020 register is always saved two words below the backchain.
15021
15022 As long as the stack frame backchain is not used, code generated with
15023 @option{-mpacked-stack} is call-compatible with code generated with
15024 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
15025 S/390 or zSeries generated code that uses the stack frame backchain at run
15026 time, not just for debugging purposes.  Such code is not call-compatible
15027 with code compiled with @option{-mpacked-stack}.  Also, note that the
15028 combination of @option{-mbackchain},
15029 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
15030 to build a linux kernel use @option{-msoft-float}.
15031
15032 The default is to not use the packed stack layout.
15033
15034 @item -msmall-exec
15035 @itemx -mno-small-exec
15036 @opindex msmall-exec
15037 @opindex mno-small-exec
15038 Generate (or do not generate) code using the @code{bras} instruction
15039 to do subroutine calls.
15040 This only works reliably if the total executable size does not
15041 exceed 64k.  The default is to use the @code{basr} instruction instead,
15042 which does not have this limitation.
15043
15044 @item -m64
15045 @itemx -m31
15046 @opindex m64
15047 @opindex m31
15048 When @option{-m31} is specified, generate code compliant to the
15049 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
15050 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
15051 particular to generate 64-bit instructions.  For the @samp{s390}
15052 targets, the default is @option{-m31}, while the @samp{s390x}
15053 targets default to @option{-m64}.
15054
15055 @item -mzarch
15056 @itemx -mesa
15057 @opindex mzarch
15058 @opindex mesa
15059 When @option{-mzarch} is specified, generate code using the
15060 instructions available on z/Architecture.
15061 When @option{-mesa} is specified, generate code using the
15062 instructions available on ESA/390.  Note that @option{-mesa} is
15063 not possible with @option{-m64}.
15064 When generating code compliant to the GNU/Linux for S/390 ABI,
15065 the default is @option{-mesa}.  When generating code compliant
15066 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
15067
15068 @item -mmvcle
15069 @itemx -mno-mvcle
15070 @opindex mmvcle
15071 @opindex mno-mvcle
15072 Generate (or do not generate) code using the @code{mvcle} instruction
15073 to perform block moves.  When @option{-mno-mvcle} is specified,
15074 use a @code{mvc} loop instead.  This is the default unless optimizing for
15075 size.
15076
15077 @item -mdebug
15078 @itemx -mno-debug
15079 @opindex mdebug
15080 @opindex mno-debug
15081 Print (or do not print) additional debug information when compiling.
15082 The default is to not print debug information.
15083
15084 @item -march=@var{cpu-type}
15085 @opindex march
15086 Generate code that will run on @var{cpu-type}, which is the name of a system
15087 representing a certain processor type.  Possible values for
15088 @var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, @samp{z990},
15089 @samp{z9-109}, @samp{z9-ec} and @samp{z10}.
15090 When generating code using the instructions available on z/Architecture,
15091 the default is @option{-march=z900}.  Otherwise, the default is
15092 @option{-march=g5}.
15093
15094 @item -mtune=@var{cpu-type}
15095 @opindex mtune
15096 Tune to @var{cpu-type} everything applicable about the generated code,
15097 except for the ABI and the set of available instructions.
15098 The list of @var{cpu-type} values is the same as for @option{-march}.
15099 The default is the value used for @option{-march}.
15100
15101 @item -mtpf-trace
15102 @itemx -mno-tpf-trace
15103 @opindex mtpf-trace
15104 @opindex mno-tpf-trace
15105 Generate code that adds (does not add) in TPF OS specific branches to trace
15106 routines in the operating system.  This option is off by default, even
15107 when compiling for the TPF OS@.
15108
15109 @item -mfused-madd
15110 @itemx -mno-fused-madd
15111 @opindex mfused-madd
15112 @opindex mno-fused-madd
15113 Generate code that uses (does not use) the floating point multiply and
15114 accumulate instructions.  These instructions are generated by default if
15115 hardware floating point is used.
15116
15117 @item -mwarn-framesize=@var{framesize}
15118 @opindex mwarn-framesize
15119 Emit a warning if the current function exceeds the given frame size.  Because
15120 this is a compile time check it doesn't need to be a real problem when the program
15121 runs.  It is intended to identify functions which most probably cause
15122 a stack overflow.  It is useful to be used in an environment with limited stack
15123 size e.g.@: the linux kernel.
15124
15125 @item -mwarn-dynamicstack
15126 @opindex mwarn-dynamicstack
15127 Emit a warning if the function calls alloca or uses dynamically
15128 sized arrays.  This is generally a bad idea with a limited stack size.
15129
15130 @item -mstack-guard=@var{stack-guard}
15131 @itemx -mstack-size=@var{stack-size}
15132 @opindex mstack-guard
15133 @opindex mstack-size
15134 If these options are provided the s390 back end emits additional instructions in
15135 the function prologue which trigger a trap if the stack size is @var{stack-guard}
15136 bytes above the @var{stack-size} (remember that the stack on s390 grows downward).
15137 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
15138 the frame size of the compiled function is chosen.
15139 These options are intended to be used to help debugging stack overflow problems.
15140 The additionally emitted code causes only little overhead and hence can also be
15141 used in production like systems without greater performance degradation.  The given
15142 values have to be exact powers of 2 and @var{stack-size} has to be greater than
15143 @var{stack-guard} without exceeding 64k.
15144 In order to be efficient the extra code makes the assumption that the stack starts
15145 at an address aligned to the value given by @var{stack-size}.
15146 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
15147 @end table
15148
15149 @node Score Options
15150 @subsection Score Options
15151 @cindex Score Options
15152
15153 These options are defined for Score implementations:
15154
15155 @table @gcctabopt
15156 @item -meb
15157 @opindex meb
15158 Compile code for big endian mode.  This is the default.
15159
15160 @item -mel
15161 @opindex mel
15162 Compile code for little endian mode.
15163
15164 @item -mnhwloop
15165 @opindex mnhwloop
15166 Disable generate bcnz instruction.
15167
15168 @item -muls
15169 @opindex muls
15170 Enable generate unaligned load and store instruction.
15171
15172 @item -mmac
15173 @opindex mmac
15174 Enable the use of multiply-accumulate instructions. Disabled by default.
15175
15176 @item -mscore5
15177 @opindex mscore5
15178 Specify the SCORE5 as the target architecture.
15179
15180 @item -mscore5u
15181 @opindex mscore5u
15182 Specify the SCORE5U of the target architecture.
15183
15184 @item -mscore7
15185 @opindex mscore7
15186 Specify the SCORE7 as the target architecture. This is the default.
15187
15188 @item -mscore7d
15189 @opindex mscore7d
15190 Specify the SCORE7D as the target architecture.
15191 @end table
15192
15193 @node SH Options
15194 @subsection SH Options
15195
15196 These @samp{-m} options are defined for the SH implementations:
15197
15198 @table @gcctabopt
15199 @item -m1
15200 @opindex m1
15201 Generate code for the SH1.
15202
15203 @item -m2
15204 @opindex m2
15205 Generate code for the SH2.
15206
15207 @item -m2e
15208 Generate code for the SH2e.
15209
15210 @item -m2a-nofpu
15211 @opindex m2a-nofpu
15212 Generate code for the SH2a without FPU, or for a SH2a-FPU in such a way
15213 that the floating-point unit is not used.
15214
15215 @item -m2a-single-only
15216 @opindex m2a-single-only
15217 Generate code for the SH2a-FPU, in such a way that no double-precision
15218 floating point operations are used.
15219
15220 @item -m2a-single
15221 @opindex m2a-single
15222 Generate code for the SH2a-FPU assuming the floating-point unit is in
15223 single-precision mode by default.
15224
15225 @item -m2a
15226 @opindex m2a
15227 Generate code for the SH2a-FPU assuming the floating-point unit is in
15228 double-precision mode by default.
15229
15230 @item -m3
15231 @opindex m3
15232 Generate code for the SH3.
15233
15234 @item -m3e
15235 @opindex m3e
15236 Generate code for the SH3e.
15237
15238 @item -m4-nofpu
15239 @opindex m4-nofpu
15240 Generate code for the SH4 without a floating-point unit.
15241
15242 @item -m4-single-only
15243 @opindex m4-single-only
15244 Generate code for the SH4 with a floating-point unit that only
15245 supports single-precision arithmetic.
15246
15247 @item -m4-single
15248 @opindex m4-single
15249 Generate code for the SH4 assuming the floating-point unit is in
15250 single-precision mode by default.
15251
15252 @item -m4
15253 @opindex m4
15254 Generate code for the SH4.
15255
15256 @item -m4a-nofpu
15257 @opindex m4a-nofpu
15258 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
15259 floating-point unit is not used.
15260
15261 @item -m4a-single-only
15262 @opindex m4a-single-only
15263 Generate code for the SH4a, in such a way that no double-precision
15264 floating point operations are used.
15265
15266 @item -m4a-single
15267 @opindex m4a-single
15268 Generate code for the SH4a assuming the floating-point unit is in
15269 single-precision mode by default.
15270
15271 @item -m4a
15272 @opindex m4a
15273 Generate code for the SH4a.
15274
15275 @item -m4al
15276 @opindex m4al
15277 Same as @option{-m4a-nofpu}, except that it implicitly passes
15278 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
15279 instructions at the moment.
15280
15281 @item -mb
15282 @opindex mb
15283 Compile code for the processor in big endian mode.
15284
15285 @item -ml
15286 @opindex ml
15287 Compile code for the processor in little endian mode.
15288
15289 @item -mdalign
15290 @opindex mdalign
15291 Align doubles at 64-bit boundaries.  Note that this changes the calling
15292 conventions, and thus some functions from the standard C library will
15293 not work unless you recompile it first with @option{-mdalign}.
15294
15295 @item -mrelax
15296 @opindex mrelax
15297 Shorten some address references at link time, when possible; uses the
15298 linker option @option{-relax}.
15299
15300 @item -mbigtable
15301 @opindex mbigtable
15302 Use 32-bit offsets in @code{switch} tables.  The default is to use
15303 16-bit offsets.
15304
15305 @item -mbitops
15306 @opindex mbitops
15307 Enable the use of bit manipulation instructions on SH2A.
15308
15309 @item -mhitachi
15310 @opindex mhitachi
15311 Comply with the calling conventions defined by Renesas.
15312
15313 @item -mrenesas
15314 @opindex mhitachi
15315 Comply with the calling conventions defined by Renesas.
15316
15317 @item -mno-renesas
15318 @opindex mhitachi
15319 Comply with the calling conventions defined for GCC before the Renesas
15320 conventions were available.  This option is the default for all
15321 targets of the SH toolchain except for @samp{sh-symbianelf}.
15322
15323 @item -mnomacsave
15324 @opindex mnomacsave
15325 Mark the @code{MAC} register as call-clobbered, even if
15326 @option{-mhitachi} is given.
15327
15328 @item -mieee
15329 @opindex mieee
15330 Increase IEEE-compliance of floating-point code.
15331 At the moment, this is equivalent to @option{-fno-finite-math-only}.
15332 When generating 16 bit SH opcodes, getting IEEE-conforming results for
15333 comparisons of NANs / infinities incurs extra overhead in every
15334 floating point comparison, therefore the default is set to
15335 @option{-ffinite-math-only}.
15336
15337 @item -minline-ic_invalidate
15338 @opindex minline-ic_invalidate
15339 Inline code to invalidate instruction cache entries after setting up
15340 nested function trampolines.
15341 This option has no effect if -musermode is in effect and the selected
15342 code generation option (e.g. -m4) does not allow the use of the icbi
15343 instruction.
15344 If the selected code generation option does not allow the use of the icbi
15345 instruction, and -musermode is not in effect, the inlined code will
15346 manipulate the instruction cache address array directly with an associative
15347 write.  This not only requires privileged mode, but it will also
15348 fail if the cache line had been mapped via the TLB and has become unmapped.
15349
15350 @item -misize
15351 @opindex misize
15352 Dump instruction size and location in the assembly code.
15353
15354 @item -mpadstruct
15355 @opindex mpadstruct
15356 This option is deprecated.  It pads structures to multiple of 4 bytes,
15357 which is incompatible with the SH ABI@.
15358
15359 @item -mspace
15360 @opindex mspace
15361 Optimize for space instead of speed.  Implied by @option{-Os}.
15362
15363 @item -mprefergot
15364 @opindex mprefergot
15365 When generating position-independent code, emit function calls using
15366 the Global Offset Table instead of the Procedure Linkage Table.
15367
15368 @item -musermode
15369 @opindex musermode
15370 Don't generate privileged mode only code; implies -mno-inline-ic_invalidate
15371 if the inlined code would not work in user mode.
15372 This is the default when the target is @code{sh-*-linux*}.
15373
15374 @item -multcost=@var{number}
15375 @opindex multcost=@var{number}
15376 Set the cost to assume for a multiply insn.
15377
15378 @item -mdiv=@var{strategy}
15379 @opindex mdiv=@var{strategy}
15380 Set the division strategy to use for SHmedia code.  @var{strategy} must be
15381 one of: call, call2, fp, inv, inv:minlat, inv20u, inv20l, inv:call,
15382 inv:call2, inv:fp .
15383 "fp" performs the operation in floating point.  This has a very high latency,
15384 but needs only a few instructions, so it might be a good choice if
15385 your code has enough easily exploitable ILP to allow the compiler to
15386 schedule the floating point instructions together with other instructions.
15387 Division by zero causes a floating point exception.
15388 "inv" uses integer operations to calculate the inverse of the divisor,
15389 and then multiplies the dividend with the inverse.  This strategy allows
15390 cse and hoisting of the inverse calculation.  Division by zero calculates
15391 an unspecified result, but does not trap.
15392 "inv:minlat" is a variant of "inv" where if no cse / hoisting opportunities
15393 have been found, or if the entire operation has been hoisted to the same
15394 place, the last stages of the inverse calculation are intertwined with the
15395 final multiply to reduce the overall latency, at the expense of using a few
15396 more instructions, and thus offering fewer scheduling opportunities with
15397 other code.
15398 "call" calls a library function that usually implements the inv:minlat
15399 strategy.
15400 This gives high code density for m5-*media-nofpu compilations.
15401 "call2" uses a different entry point of the same library function, where it
15402 assumes that a pointer to a lookup table has already been set up, which
15403 exposes the pointer load to cse / code hoisting optimizations.
15404 "inv:call", "inv:call2" and "inv:fp" all use the "inv" algorithm for initial
15405 code generation, but if the code stays unoptimized, revert to the "call",
15406 "call2", or "fp" strategies, respectively.  Note that the
15407 potentially-trapping side effect of division by zero is carried by a
15408 separate instruction, so it is possible that all the integer instructions
15409 are hoisted out, but the marker for the side effect stays where it is.
15410 A recombination to fp operations or a call is not possible in that case.
15411 "inv20u" and "inv20l" are variants of the "inv:minlat" strategy.  In the case
15412 that the inverse calculation was nor separated from the multiply, they speed
15413 up division where the dividend fits into 20 bits (plus sign where applicable),
15414 by inserting a test to skip a number of operations in this case; this test
15415 slows down the case of larger dividends.  inv20u assumes the case of a such
15416 a small dividend to be unlikely, and inv20l assumes it to be likely.
15417
15418 @item -mdivsi3_libfunc=@var{name}
15419 @opindex mdivsi3_libfunc=@var{name}
15420 Set the name of the library function used for 32 bit signed division to
15421 @var{name}.  This only affect the name used in the call and inv:call
15422 division strategies, and the compiler will still expect the same
15423 sets of input/output/clobbered registers as if this option was not present.
15424
15425 @item -mfixed-range=@var{register-range}
15426 @opindex mfixed-range
15427 Generate code treating the given register range as fixed registers.
15428 A fixed register is one that the register allocator can not use.  This is
15429 useful when compiling kernel code.  A register range is specified as
15430 two registers separated by a dash.  Multiple register ranges can be
15431 specified separated by a comma.
15432
15433 @item -madjust-unroll
15434 @opindex madjust-unroll
15435 Throttle unrolling to avoid thrashing target registers.
15436 This option only has an effect if the gcc code base supports the
15437 TARGET_ADJUST_UNROLL_MAX target hook.
15438
15439 @item -mindexed-addressing
15440 @opindex mindexed-addressing
15441 Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
15442 This is only safe if the hardware and/or OS implement 32 bit wrap-around
15443 semantics for the indexed addressing mode.  The architecture allows the
15444 implementation of processors with 64 bit MMU, which the OS could use to
15445 get 32 bit addressing, but since no current hardware implementation supports
15446 this or any other way to make the indexed addressing mode safe to use in
15447 the 32 bit ABI, the default is -mno-indexed-addressing.
15448
15449 @item -mgettrcost=@var{number}
15450 @opindex mgettrcost=@var{number}
15451 Set the cost assumed for the gettr instruction to @var{number}.
15452 The default is 2 if @option{-mpt-fixed} is in effect, 100 otherwise.
15453
15454 @item -mpt-fixed
15455 @opindex mpt-fixed
15456 Assume pt* instructions won't trap.  This will generally generate better
15457 scheduled code, but is unsafe on current hardware.  The current architecture
15458 definition says that ptabs and ptrel trap when the target anded with 3 is 3.
15459 This has the unintentional effect of making it unsafe to schedule ptabs /
15460 ptrel before a branch, or hoist it out of a loop.  For example,
15461 __do_global_ctors, a part of libgcc that runs constructors at program
15462 startup, calls functions in a list which is delimited by @minus{}1.  With the
15463 -mpt-fixed option, the ptabs will be done before testing against @minus{}1.
15464 That means that all the constructors will be run a bit quicker, but when
15465 the loop comes to the end of the list, the program crashes because ptabs
15466 loads @minus{}1 into a target register.  Since this option is unsafe for any
15467 hardware implementing the current architecture specification, the default
15468 is -mno-pt-fixed.  Unless the user specifies a specific cost with
15469 @option{-mgettrcost}, -mno-pt-fixed also implies @option{-mgettrcost=100};
15470 this deters register allocation using target registers for storing
15471 ordinary integers.
15472
15473 @item -minvalid-symbols
15474 @opindex minvalid-symbols
15475 Assume symbols might be invalid.  Ordinary function symbols generated by
15476 the compiler will always be valid to load with movi/shori/ptabs or
15477 movi/shori/ptrel, but with assembler and/or linker tricks it is possible
15478 to generate symbols that will cause ptabs / ptrel to trap.
15479 This option is only meaningful when @option{-mno-pt-fixed} is in effect.
15480 It will then prevent cross-basic-block cse, hoisting and most scheduling
15481 of symbol loads.  The default is @option{-mno-invalid-symbols}.
15482 @end table
15483
15484 @node SPARC Options
15485 @subsection SPARC Options
15486 @cindex SPARC options
15487
15488 These @samp{-m} options are supported on the SPARC:
15489
15490 @table @gcctabopt
15491 @item -mno-app-regs
15492 @itemx -mapp-regs
15493 @opindex mno-app-regs
15494 @opindex mapp-regs
15495 Specify @option{-mapp-regs} to generate output using the global registers
15496 2 through 4, which the SPARC SVR4 ABI reserves for applications.  This
15497 is the default.
15498
15499 To be fully SVR4 ABI compliant at the cost of some performance loss,
15500 specify @option{-mno-app-regs}.  You should compile libraries and system
15501 software with this option.
15502
15503 @item -mfpu
15504 @itemx -mhard-float
15505 @opindex mfpu
15506 @opindex mhard-float
15507 Generate output containing floating point instructions.  This is the
15508 default.
15509
15510 @item -mno-fpu
15511 @itemx -msoft-float
15512 @opindex mno-fpu
15513 @opindex msoft-float
15514 Generate output containing library calls for floating point.
15515 @strong{Warning:} the requisite libraries are not available for all SPARC
15516 targets.  Normally the facilities of the machine's usual C compiler are
15517 used, but this cannot be done directly in cross-compilation.  You must make
15518 your own arrangements to provide suitable library functions for
15519 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
15520 @samp{sparclite-*-*} do provide software floating point support.
15521
15522 @option{-msoft-float} changes the calling convention in the output file;
15523 therefore, it is only useful if you compile @emph{all} of a program with
15524 this option.  In particular, you need to compile @file{libgcc.a}, the
15525 library that comes with GCC, with @option{-msoft-float} in order for
15526 this to work.
15527
15528 @item -mhard-quad-float
15529 @opindex mhard-quad-float
15530 Generate output containing quad-word (long double) floating point
15531 instructions.
15532
15533 @item -msoft-quad-float
15534 @opindex msoft-quad-float
15535 Generate output containing library calls for quad-word (long double)
15536 floating point instructions.  The functions called are those specified
15537 in the SPARC ABI@.  This is the default.
15538
15539 As of this writing, there are no SPARC implementations that have hardware
15540 support for the quad-word floating point instructions.  They all invoke
15541 a trap handler for one of these instructions, and then the trap handler
15542 emulates the effect of the instruction.  Because of the trap handler overhead,
15543 this is much slower than calling the ABI library routines.  Thus the
15544 @option{-msoft-quad-float} option is the default.
15545
15546 @item -mno-unaligned-doubles
15547 @itemx -munaligned-doubles
15548 @opindex mno-unaligned-doubles
15549 @opindex munaligned-doubles
15550 Assume that doubles have 8 byte alignment.  This is the default.
15551
15552 With @option{-munaligned-doubles}, GCC assumes that doubles have 8 byte
15553 alignment only if they are contained in another type, or if they have an
15554 absolute address.  Otherwise, it assumes they have 4 byte alignment.
15555 Specifying this option avoids some rare compatibility problems with code
15556 generated by other compilers.  It is not the default because it results
15557 in a performance loss, especially for floating point code.
15558
15559 @item -mno-faster-structs
15560 @itemx -mfaster-structs
15561 @opindex mno-faster-structs
15562 @opindex mfaster-structs
15563 With @option{-mfaster-structs}, the compiler assumes that structures
15564 should have 8 byte alignment.  This enables the use of pairs of
15565 @code{ldd} and @code{std} instructions for copies in structure
15566 assignment, in place of twice as many @code{ld} and @code{st} pairs.
15567 However, the use of this changed alignment directly violates the SPARC
15568 ABI@.  Thus, it's intended only for use on targets where the developer
15569 acknowledges that their resulting code will not be directly in line with
15570 the rules of the ABI@.
15571
15572 @item -mimpure-text
15573 @opindex mimpure-text
15574 @option{-mimpure-text}, used in addition to @option{-shared}, tells
15575 the compiler to not pass @option{-z text} to the linker when linking a
15576 shared object.  Using this option, you can link position-dependent
15577 code into a shared object.
15578
15579 @option{-mimpure-text} suppresses the ``relocations remain against
15580 allocatable but non-writable sections'' linker error message.
15581 However, the necessary relocations will trigger copy-on-write, and the
15582 shared object is not actually shared across processes.  Instead of
15583 using @option{-mimpure-text}, you should compile all source code with
15584 @option{-fpic} or @option{-fPIC}.
15585
15586 This option is only available on SunOS and Solaris.
15587
15588 @item -mcpu=@var{cpu_type}
15589 @opindex mcpu
15590 Set the instruction set, register set, and instruction scheduling parameters
15591 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
15592 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{sparclite},
15593 @samp{f930}, @samp{f934}, @samp{hypersparc}, @samp{sparclite86x},
15594 @samp{sparclet}, @samp{tsc701}, @samp{v9}, @samp{ultrasparc},
15595 @samp{ultrasparc3}, @samp{niagara} and @samp{niagara2}.
15596
15597 Default instruction scheduling parameters are used for values that select
15598 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
15599 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
15600
15601 Here is a list of each supported architecture and their supported
15602 implementations.
15603
15604 @smallexample
15605     v7:             cypress
15606     v8:             supersparc, hypersparc
15607     sparclite:      f930, f934, sparclite86x
15608     sparclet:       tsc701
15609     v9:             ultrasparc, ultrasparc3, niagara, niagara2
15610 @end smallexample
15611
15612 By default (unless configured otherwise), GCC generates code for the V7
15613 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
15614 additionally optimizes it for the Cypress CY7C602 chip, as used in the
15615 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
15616 SPARCStation 1, 2, IPX etc.
15617
15618 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
15619 architecture.  The only difference from V7 code is that the compiler emits
15620 the integer multiply and integer divide instructions which exist in SPARC-V8
15621 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
15622 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
15623 2000 series.
15624
15625 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
15626 the SPARC architecture.  This adds the integer multiply, integer divide step
15627 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
15628 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
15629 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
15630 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
15631 MB86934 chip, which is the more recent SPARClite with FPU@.
15632
15633 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
15634 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
15635 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
15636 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
15637 optimizes it for the TEMIC SPARClet chip.
15638
15639 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
15640 architecture.  This adds 64-bit integer and floating-point move instructions,
15641 3 additional floating-point condition code registers and conditional move
15642 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
15643 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
15644 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
15645 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
15646 @option{-mcpu=niagara}, the compiler additionally optimizes it for
15647 Sun UltraSPARC T1 chips.  With @option{-mcpu=niagara2}, the compiler
15648 additionally optimizes it for Sun UltraSPARC T2 chips.
15649
15650 @item -mtune=@var{cpu_type}
15651 @opindex mtune
15652 Set the instruction scheduling parameters for machine type
15653 @var{cpu_type}, but do not set the instruction set or register set that the
15654 option @option{-mcpu=@var{cpu_type}} would.
15655
15656 The same values for @option{-mcpu=@var{cpu_type}} can be used for
15657 @option{-mtune=@var{cpu_type}}, but the only useful values are those
15658 that select a particular cpu implementation.  Those are @samp{cypress},
15659 @samp{supersparc}, @samp{hypersparc}, @samp{f930}, @samp{f934},
15660 @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc},
15661 @samp{ultrasparc3}, @samp{niagara}, and @samp{niagara2}.
15662
15663 @item -mv8plus
15664 @itemx -mno-v8plus
15665 @opindex mv8plus
15666 @opindex mno-v8plus
15667 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
15668 difference from the V8 ABI is that the global and out registers are
15669 considered 64-bit wide.  This is enabled by default on Solaris in 32-bit
15670 mode for all SPARC-V9 processors.
15671
15672 @item -mvis
15673 @itemx -mno-vis
15674 @opindex mvis
15675 @opindex mno-vis
15676 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
15677 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
15678 @end table
15679
15680 These @samp{-m} options are supported in addition to the above
15681 on SPARC-V9 processors in 64-bit environments:
15682
15683 @table @gcctabopt
15684 @item -mlittle-endian
15685 @opindex mlittle-endian
15686 Generate code for a processor running in little-endian mode.  It is only
15687 available for a few configurations and most notably not on Solaris and Linux.
15688
15689 @item -m32
15690 @itemx -m64
15691 @opindex m32
15692 @opindex m64
15693 Generate code for a 32-bit or 64-bit environment.
15694 The 32-bit environment sets int, long and pointer to 32 bits.
15695 The 64-bit environment sets int to 32 bits and long and pointer
15696 to 64 bits.
15697
15698 @item -mcmodel=medlow
15699 @opindex mcmodel=medlow
15700 Generate code for the Medium/Low code model: 64-bit addresses, programs
15701 must be linked in the low 32 bits of memory.  Programs can be statically
15702 or dynamically linked.
15703
15704 @item -mcmodel=medmid
15705 @opindex mcmodel=medmid
15706 Generate code for the Medium/Middle code model: 64-bit addresses, programs
15707 must be linked in the low 44 bits of memory, the text and data segments must
15708 be less than 2GB in size and the data segment must be located within 2GB of
15709 the text segment.
15710
15711 @item -mcmodel=medany
15712 @opindex mcmodel=medany
15713 Generate code for the Medium/Anywhere code model: 64-bit addresses, programs
15714 may be linked anywhere in memory, the text and data segments must be less
15715 than 2GB in size and the data segment must be located within 2GB of the
15716 text segment.
15717
15718 @item -mcmodel=embmedany
15719 @opindex mcmodel=embmedany
15720 Generate code for the Medium/Anywhere code model for embedded systems:
15721 64-bit addresses, the text and data segments must be less than 2GB in
15722 size, both starting anywhere in memory (determined at link time).  The
15723 global register %g4 points to the base of the data segment.  Programs
15724 are statically linked and PIC is not supported.
15725
15726 @item -mstack-bias
15727 @itemx -mno-stack-bias
15728 @opindex mstack-bias
15729 @opindex mno-stack-bias
15730 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
15731 frame pointer if present, are offset by @minus{}2047 which must be added back
15732 when making stack frame references.  This is the default in 64-bit mode.
15733 Otherwise, assume no such offset is present.
15734 @end table
15735
15736 These switches are supported in addition to the above on Solaris:
15737
15738 @table @gcctabopt
15739 @item -threads
15740 @opindex threads
15741 Add support for multithreading using the Solaris threads library.  This
15742 option sets flags for both the preprocessor and linker.  This option does
15743 not affect the thread safety of object code produced by the compiler or
15744 that of libraries supplied with it.
15745
15746 @item -pthreads
15747 @opindex pthreads
15748 Add support for multithreading using the POSIX threads library.  This
15749 option sets flags for both the preprocessor and linker.  This option does
15750 not affect the thread safety of object code produced  by the compiler or
15751 that of libraries supplied with it.
15752
15753 @item -pthread
15754 @opindex pthread
15755 This is a synonym for @option{-pthreads}.
15756 @end table
15757
15758 @node SPU Options
15759 @subsection SPU Options
15760 @cindex SPU options
15761
15762 These @samp{-m} options are supported on the SPU:
15763
15764 @table @gcctabopt
15765 @item -mwarn-reloc
15766 @itemx -merror-reloc
15767 @opindex mwarn-reloc
15768 @opindex merror-reloc
15769
15770 The loader for SPU does not handle dynamic relocations.  By default, GCC
15771 will give an error when it generates code that requires a dynamic
15772 relocation.  @option{-mno-error-reloc} disables the error,
15773 @option{-mwarn-reloc} will generate a warning instead.
15774
15775 @item -msafe-dma
15776 @itemx -munsafe-dma
15777 @opindex msafe-dma
15778 @opindex munsafe-dma
15779
15780 Instructions which initiate or test completion of DMA must not be
15781 reordered with respect to loads and stores of the memory which is being
15782 accessed.  Users typically address this problem using the volatile
15783 keyword, but that can lead to inefficient code in places where the
15784 memory is known to not change.  Rather than mark the memory as volatile
15785 we treat the DMA instructions as potentially effecting all memory.  With
15786 @option{-munsafe-dma} users must use the volatile keyword to protect
15787 memory accesses.
15788
15789 @item -mbranch-hints
15790 @opindex mbranch-hints
15791
15792 By default, GCC will generate a branch hint instruction to avoid
15793 pipeline stalls for always taken or probably taken branches.  A hint
15794 will not be generated closer than 8 instructions away from its branch.
15795 There is little reason to disable them, except for debugging purposes,
15796 or to make an object a little bit smaller.
15797
15798 @item -msmall-mem
15799 @itemx -mlarge-mem
15800 @opindex msmall-mem
15801 @opindex mlarge-mem
15802
15803 By default, GCC generates code assuming that addresses are never larger
15804 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
15805 a full 32 bit address.
15806
15807 @item -mstdmain
15808 @opindex mstdmain
15809
15810 By default, GCC links against startup code that assumes the SPU-style
15811 main function interface (which has an unconventional parameter list).
15812 With @option{-mstdmain}, GCC will link your program against startup
15813 code that assumes a C99-style interface to @code{main}, including a
15814 local copy of @code{argv} strings.
15815
15816 @item -mfixed-range=@var{register-range}
15817 @opindex mfixed-range
15818 Generate code treating the given register range as fixed registers.
15819 A fixed register is one that the register allocator can not use.  This is
15820 useful when compiling kernel code.  A register range is specified as
15821 two registers separated by a dash.  Multiple register ranges can be
15822 specified separated by a comma.
15823
15824 @item -mdual-nops
15825 @itemx -mdual-nops=@var{n}
15826 @opindex mdual-nops
15827 By default, GCC will insert nops to increase dual issue when it expects
15828 it to increase performance.  @var{n} can be a value from 0 to 10.  A
15829 smaller @var{n} will insert fewer nops.  10 is the default, 0 is the
15830 same as @option{-mno-dual-nops}.  Disabled with @option{-Os}.
15831
15832 @item -mhint-max-nops=@var{n}
15833 @opindex mhint-max-nops
15834 Maximum number of nops to insert for a branch hint.  A branch hint must
15835 be at least 8 instructions away from the branch it is effecting.  GCC
15836 will insert up to @var{n} nops to enforce this, otherwise it will not
15837 generate the branch hint.
15838
15839 @item -mhint-max-distance=@var{n}
15840 @opindex mhint-max-distance
15841 The encoding of the branch hint instruction limits the hint to be within
15842 256 instructions of the branch it is effecting.  By default, GCC makes
15843 sure it is within 125.
15844
15845 @item -msafe-hints
15846 @opindex msafe-hints
15847 Work around a hardware bug which causes the SPU to stall indefinitely.
15848 By default, GCC will insert the @code{hbrp} instruction to make sure
15849 this stall won't happen.
15850
15851 @end table
15852
15853 @node System V Options
15854 @subsection Options for System V
15855
15856 These additional options are available on System V Release 4 for
15857 compatibility with other compilers on those systems:
15858
15859 @table @gcctabopt
15860 @item -G
15861 @opindex G
15862 Create a shared object.
15863 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
15864
15865 @item -Qy
15866 @opindex Qy
15867 Identify the versions of each tool used by the compiler, in a
15868 @code{.ident} assembler directive in the output.
15869
15870 @item -Qn
15871 @opindex Qn
15872 Refrain from adding @code{.ident} directives to the output file (this is
15873 the default).
15874
15875 @item -YP,@var{dirs}
15876 @opindex YP
15877 Search the directories @var{dirs}, and no others, for libraries
15878 specified with @option{-l}.
15879
15880 @item -Ym,@var{dir}
15881 @opindex Ym
15882 Look in the directory @var{dir} to find the M4 preprocessor.
15883 The assembler uses this option.
15884 @c This is supposed to go with a -Yd for predefined M4 macro files, but
15885 @c the generic assembler that comes with Solaris takes just -Ym.
15886 @end table
15887
15888 @node V850 Options
15889 @subsection V850 Options
15890 @cindex V850 Options
15891
15892 These @samp{-m} options are defined for V850 implementations:
15893
15894 @table @gcctabopt
15895 @item -mlong-calls
15896 @itemx -mno-long-calls
15897 @opindex mlong-calls
15898 @opindex mno-long-calls
15899 Treat all calls as being far away (near).  If calls are assumed to be
15900 far away, the compiler will always load the functions address up into a
15901 register, and call indirect through the pointer.
15902
15903 @item -mno-ep
15904 @itemx -mep
15905 @opindex mno-ep
15906 @opindex mep
15907 Do not optimize (do optimize) basic blocks that use the same index
15908 pointer 4 or more times to copy pointer into the @code{ep} register, and
15909 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
15910 option is on by default if you optimize.
15911
15912 @item -mno-prolog-function
15913 @itemx -mprolog-function
15914 @opindex mno-prolog-function
15915 @opindex mprolog-function
15916 Do not use (do use) external functions to save and restore registers
15917 at the prologue and epilogue of a function.  The external functions
15918 are slower, but use less code space if more than one function saves
15919 the same number of registers.  The @option{-mprolog-function} option
15920 is on by default if you optimize.
15921
15922 @item -mspace
15923 @opindex mspace
15924 Try to make the code as small as possible.  At present, this just turns
15925 on the @option{-mep} and @option{-mprolog-function} options.
15926
15927 @item -mtda=@var{n}
15928 @opindex mtda
15929 Put static or global variables whose size is @var{n} bytes or less into
15930 the tiny data area that register @code{ep} points to.  The tiny data
15931 area can hold up to 256 bytes in total (128 bytes for byte references).
15932
15933 @item -msda=@var{n}
15934 @opindex msda
15935 Put static or global variables whose size is @var{n} bytes or less into
15936 the small data area that register @code{gp} points to.  The small data
15937 area can hold up to 64 kilobytes.
15938
15939 @item -mzda=@var{n}
15940 @opindex mzda
15941 Put static or global variables whose size is @var{n} bytes or less into
15942 the first 32 kilobytes of memory.
15943
15944 @item -mv850
15945 @opindex mv850
15946 Specify that the target processor is the V850.
15947
15948 @item -mbig-switch
15949 @opindex mbig-switch
15950 Generate code suitable for big switch tables.  Use this option only if
15951 the assembler/linker complain about out of range branches within a switch
15952 table.
15953
15954 @item -mapp-regs
15955 @opindex mapp-regs
15956 This option will cause r2 and r5 to be used in the code generated by
15957 the compiler.  This setting is the default.
15958
15959 @item -mno-app-regs
15960 @opindex mno-app-regs
15961 This option will cause r2 and r5 to be treated as fixed registers.
15962
15963 @item -mv850e1
15964 @opindex mv850e1
15965 Specify that the target processor is the V850E1.  The preprocessor
15966 constants @samp{__v850e1__} and @samp{__v850e__} will be defined if
15967 this option is used.
15968
15969 @item -mv850e
15970 @opindex mv850e
15971 Specify that the target processor is the V850E@.  The preprocessor
15972 constant @samp{__v850e__} will be defined if this option is used.
15973
15974 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
15975 are defined then a default target processor will be chosen and the
15976 relevant @samp{__v850*__} preprocessor constant will be defined.
15977
15978 The preprocessor constants @samp{__v850} and @samp{__v851__} are always
15979 defined, regardless of which processor variant is the target.
15980
15981 @item -mdisable-callt
15982 @opindex mdisable-callt
15983 This option will suppress generation of the CALLT instruction for the
15984 v850e and v850e1 flavors of the v850 architecture.  The default is
15985 @option{-mno-disable-callt} which allows the CALLT instruction to be used.
15986
15987 @end table
15988
15989 @node VAX Options
15990 @subsection VAX Options
15991 @cindex VAX options
15992
15993 These @samp{-m} options are defined for the VAX:
15994
15995 @table @gcctabopt
15996 @item -munix
15997 @opindex munix
15998 Do not output certain jump instructions (@code{aobleq} and so on)
15999 that the Unix assembler for the VAX cannot handle across long
16000 ranges.
16001
16002 @item -mgnu
16003 @opindex mgnu
16004 Do output those jump instructions, on the assumption that you
16005 will assemble with the GNU assembler.
16006
16007 @item -mg
16008 @opindex mg
16009 Output code for g-format floating point numbers instead of d-format.
16010 @end table
16011
16012 @node VxWorks Options
16013 @subsection VxWorks Options
16014 @cindex VxWorks Options
16015
16016 The options in this section are defined for all VxWorks targets.
16017 Options specific to the target hardware are listed with the other
16018 options for that target.
16019
16020 @table @gcctabopt
16021 @item -mrtp
16022 @opindex mrtp
16023 GCC can generate code for both VxWorks kernels and real time processes
16024 (RTPs).  This option switches from the former to the latter.  It also
16025 defines the preprocessor macro @code{__RTP__}.
16026
16027 @item -non-static
16028 @opindex non-static
16029 Link an RTP executable against shared libraries rather than static
16030 libraries.  The options @option{-static} and @option{-shared} can
16031 also be used for RTPs (@pxref{Link Options}); @option{-static}
16032 is the default.
16033
16034 @item -Bstatic
16035 @itemx -Bdynamic
16036 @opindex Bstatic
16037 @opindex Bdynamic
16038 These options are passed down to the linker.  They are defined for
16039 compatibility with Diab.
16040
16041 @item -Xbind-lazy
16042 @opindex Xbind-lazy
16043 Enable lazy binding of function calls.  This option is equivalent to
16044 @option{-Wl,-z,now} and is defined for compatibility with Diab.
16045
16046 @item -Xbind-now
16047 @opindex Xbind-now
16048 Disable lazy binding of function calls.  This option is the default and
16049 is defined for compatibility with Diab.
16050 @end table
16051
16052 @node x86-64 Options
16053 @subsection x86-64 Options
16054 @cindex x86-64 options
16055
16056 These are listed under @xref{i386 and x86-64 Options}.
16057
16058 @node i386 and x86-64 Windows Options
16059 @subsection i386 and x86-64 Windows Options
16060 @cindex i386 and x86-64 Windows Options
16061
16062 These additional options are available for Windows targets:
16063
16064 @table @gcctabopt
16065 @item -mconsole
16066 @opindex mconsole
16067 This option is available for Cygwin and MinGW targets.  It
16068 specifies that a console application is to be generated, by
16069 instructing the linker to set the PE header subsystem type
16070 required for console applications.
16071 This is the default behavior for Cygwin and MinGW targets.
16072
16073 @item -mcygwin
16074 @opindex mcygwin
16075 This option is available for Cygwin targets.  It specifies that
16076 the Cygwin internal interface is to be used for predefined
16077 preprocessor macros, C runtime libraries and related linker
16078 paths and options.  For Cygwin targets this is the default behavior.
16079 This option is deprecated and will be removed in a future release.
16080
16081 @item -mno-cygwin
16082 @opindex mno-cygwin
16083 This option is available for Cygwin targets.  It specifies that
16084 the MinGW internal interface is to be used instead of Cygwin's, by
16085 setting MinGW-related predefined macros and linker paths and default
16086 library options.
16087 This option is deprecated and will be removed in a future release.
16088
16089 @item -mdll
16090 @opindex mdll
16091 This option is available for Cygwin and MinGW targets.  It
16092 specifies that a DLL - a dynamic link library - is to be
16093 generated, enabling the selection of the required runtime
16094 startup object and entry point.
16095
16096 @item -mnop-fun-dllimport
16097 @opindex mnop-fun-dllimport
16098 This option is available for Cygwin and MinGW targets.  It
16099 specifies that the dllimport attribute should be ignored.
16100
16101 @item -mthread
16102 @opindex mthread
16103 This option is available for MinGW targets. It specifies
16104 that MinGW-specific thread support is to be used.
16105
16106 @item -municode
16107 @opindex municode
16108 This option is available for mingw-w64 targets.  It specifies
16109 that the UNICODE macro is getting pre-defined and that the
16110 unicode capable runtime startup code is choosen.
16111
16112 @item -mwin32
16113 @opindex mwin32
16114 This option is available for Cygwin and MinGW targets.  It
16115 specifies that the typical Windows pre-defined macros are to
16116 be set in the pre-processor, but does not influence the choice
16117 of runtime library/startup code.
16118
16119 @item -mwindows
16120 @opindex mwindows
16121 This option is available for Cygwin and MinGW targets.  It
16122 specifies that a GUI application is to be generated by
16123 instructing the linker to set the PE header subsystem type
16124 appropriately.
16125
16126 @item -mpe-aligned-commons
16127 @opindex mpe-aligned-commons
16128 This option is available for Cygwin and MinGW targets.  It
16129 specifies that the GNU extension to the PE file format that
16130 permits the correct alignment of COMMON variables should be
16131 used when generating code.  It will be enabled by default if
16132 GCC detects that the target assembler found during configuration
16133 supports the feature.
16134 @end table
16135
16136 See also under @ref{i386 and x86-64 Options} for standard options.
16137
16138 @node Xstormy16 Options
16139 @subsection Xstormy16 Options
16140 @cindex Xstormy16 Options
16141
16142 These options are defined for Xstormy16:
16143
16144 @table @gcctabopt
16145 @item -msim
16146 @opindex msim
16147 Choose startup files and linker script suitable for the simulator.
16148 @end table
16149
16150 @node Xtensa Options
16151 @subsection Xtensa Options
16152 @cindex Xtensa Options
16153
16154 These options are supported for Xtensa targets:
16155
16156 @table @gcctabopt
16157 @item -mconst16
16158 @itemx -mno-const16
16159 @opindex mconst16
16160 @opindex mno-const16
16161 Enable or disable use of @code{CONST16} instructions for loading
16162 constant values.  The @code{CONST16} instruction is currently not a
16163 standard option from Tensilica.  When enabled, @code{CONST16}
16164 instructions are always used in place of the standard @code{L32R}
16165 instructions.  The use of @code{CONST16} is enabled by default only if
16166 the @code{L32R} instruction is not available.
16167
16168 @item -mfused-madd
16169 @itemx -mno-fused-madd
16170 @opindex mfused-madd
16171 @opindex mno-fused-madd
16172 Enable or disable use of fused multiply/add and multiply/subtract
16173 instructions in the floating-point option.  This has no effect if the
16174 floating-point option is not also enabled.  Disabling fused multiply/add
16175 and multiply/subtract instructions forces the compiler to use separate
16176 instructions for the multiply and add/subtract operations.  This may be
16177 desirable in some cases where strict IEEE 754-compliant results are
16178 required: the fused multiply add/subtract instructions do not round the
16179 intermediate result, thereby producing results with @emph{more} bits of
16180 precision than specified by the IEEE standard.  Disabling fused multiply
16181 add/subtract instructions also ensures that the program output is not
16182 sensitive to the compiler's ability to combine multiply and add/subtract
16183 operations.
16184
16185 @item -mserialize-volatile
16186 @itemx -mno-serialize-volatile
16187 @opindex mserialize-volatile
16188 @opindex mno-serialize-volatile
16189 When this option is enabled, GCC inserts @code{MEMW} instructions before
16190 @code{volatile} memory references to guarantee sequential consistency.
16191 The default is @option{-mserialize-volatile}.  Use
16192 @option{-mno-serialize-volatile} to omit the @code{MEMW} instructions.
16193
16194 @item -mtext-section-literals
16195 @itemx -mno-text-section-literals
16196 @opindex mtext-section-literals
16197 @opindex mno-text-section-literals
16198 Control the treatment of literal pools.  The default is
16199 @option{-mno-text-section-literals}, which places literals in a separate
16200 section in the output file.  This allows the literal pool to be placed
16201 in a data RAM/ROM, and it also allows the linker to combine literal
16202 pools from separate object files to remove redundant literals and
16203 improve code size.  With @option{-mtext-section-literals}, the literals
16204 are interspersed in the text section in order to keep them as close as
16205 possible to their references.  This may be necessary for large assembly
16206 files.
16207
16208 @item -mtarget-align
16209 @itemx -mno-target-align
16210 @opindex mtarget-align
16211 @opindex mno-target-align
16212 When this option is enabled, GCC instructs the assembler to
16213 automatically align instructions to reduce branch penalties at the
16214 expense of some code density.  The assembler attempts to widen density
16215 instructions to align branch targets and the instructions following call
16216 instructions.  If there are not enough preceding safe density
16217 instructions to align a target, no widening will be performed.  The
16218 default is @option{-mtarget-align}.  These options do not affect the
16219 treatment of auto-aligned instructions like @code{LOOP}, which the
16220 assembler will always align, either by widening density instructions or
16221 by inserting no-op instructions.
16222
16223 @item -mlongcalls
16224 @itemx -mno-longcalls
16225 @opindex mlongcalls
16226 @opindex mno-longcalls
16227 When this option is enabled, GCC instructs the assembler to translate
16228 direct calls to indirect calls unless it can determine that the target
16229 of a direct call is in the range allowed by the call instruction.  This
16230 translation typically occurs for calls to functions in other source
16231 files.  Specifically, the assembler translates a direct @code{CALL}
16232 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
16233 The default is @option{-mno-longcalls}.  This option should be used in
16234 programs where the call target can potentially be out of range.  This
16235 option is implemented in the assembler, not the compiler, so the
16236 assembly code generated by GCC will still show direct call
16237 instructions---look at the disassembled object code to see the actual
16238 instructions.  Note that the assembler will use an indirect call for
16239 every cross-file call, not just those that really will be out of range.
16240 @end table
16241
16242 @node zSeries Options
16243 @subsection zSeries Options
16244 @cindex zSeries options
16245
16246 These are listed under @xref{S/390 and zSeries Options}.
16247
16248 @node Code Gen Options
16249 @section Options for Code Generation Conventions
16250 @cindex code generation conventions
16251 @cindex options, code generation
16252 @cindex run-time options
16253
16254 These machine-independent options control the interface conventions
16255 used in code generation.
16256
16257 Most of them have both positive and negative forms; the negative form
16258 of @option{-ffoo} would be @option{-fno-foo}.  In the table below, only
16259 one of the forms is listed---the one which is not the default.  You
16260 can figure out the other form by either removing @samp{no-} or adding
16261 it.
16262
16263 @table @gcctabopt
16264 @item -fbounds-check
16265 @opindex fbounds-check
16266 For front-ends that support it, generate additional code to check that
16267 indices used to access arrays are within the declared range.  This is
16268 currently only supported by the Java and Fortran front-ends, where
16269 this option defaults to true and false respectively.
16270
16271 @item -ftrapv
16272 @opindex ftrapv
16273 This option generates traps for signed overflow on addition, subtraction,
16274 multiplication operations.
16275
16276 @item -fwrapv
16277 @opindex fwrapv
16278 This option instructs the compiler to assume that signed arithmetic
16279 overflow of addition, subtraction and multiplication wraps around
16280 using twos-complement representation.  This flag enables some optimizations
16281 and disables others.  This option is enabled by default for the Java
16282 front-end, as required by the Java language specification.
16283
16284 @item -fexceptions
16285 @opindex fexceptions
16286 Enable exception handling.  Generates extra code needed to propagate
16287 exceptions.  For some targets, this implies GCC will generate frame
16288 unwind information for all functions, which can produce significant data
16289 size overhead, although it does not affect execution.  If you do not
16290 specify this option, GCC will enable it by default for languages like
16291 C++ which normally require exception handling, and disable it for
16292 languages like C that do not normally require it.  However, you may need
16293 to enable this option when compiling C code that needs to interoperate
16294 properly with exception handlers written in C++.  You may also wish to
16295 disable this option if you are compiling older C++ programs that don't
16296 use exception handling.
16297
16298 @item -fnon-call-exceptions
16299 @opindex fnon-call-exceptions
16300 Generate code that allows trapping instructions to throw exceptions.
16301 Note that this requires platform-specific runtime support that does
16302 not exist everywhere.  Moreover, it only allows @emph{trapping}
16303 instructions to throw exceptions, i.e.@: memory references or floating
16304 point instructions.  It does not allow exceptions to be thrown from
16305 arbitrary signal handlers such as @code{SIGALRM}.
16306
16307 @item -funwind-tables
16308 @opindex funwind-tables
16309 Similar to @option{-fexceptions}, except that it will just generate any needed
16310 static data, but will not affect the generated code in any other way.
16311 You will normally not enable this option; instead, a language processor
16312 that needs this handling would enable it on your behalf.
16313
16314 @item -fasynchronous-unwind-tables
16315 @opindex fasynchronous-unwind-tables
16316 Generate unwind table in dwarf2 format, if supported by target machine.  The
16317 table is exact at each instruction boundary, so it can be used for stack
16318 unwinding from asynchronous events (such as debugger or garbage collector).
16319
16320 @item -fpcc-struct-return
16321 @opindex fpcc-struct-return
16322 Return ``short'' @code{struct} and @code{union} values in memory like
16323 longer ones, rather than in registers.  This convention is less
16324 efficient, but it has the advantage of allowing intercallability between
16325 GCC-compiled files and files compiled with other compilers, particularly
16326 the Portable C Compiler (pcc).
16327
16328 The precise convention for returning structures in memory depends
16329 on the target configuration macros.
16330
16331 Short structures and unions are those whose size and alignment match
16332 that of some integer type.
16333
16334 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
16335 switch is not binary compatible with code compiled with the
16336 @option{-freg-struct-return} switch.
16337 Use it to conform to a non-default application binary interface.
16338
16339 @item -freg-struct-return
16340 @opindex freg-struct-return
16341 Return @code{struct} and @code{union} values in registers when possible.
16342 This is more efficient for small structures than
16343 @option{-fpcc-struct-return}.
16344
16345 If you specify neither @option{-fpcc-struct-return} nor
16346 @option{-freg-struct-return}, GCC defaults to whichever convention is
16347 standard for the target.  If there is no standard convention, GCC
16348 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
16349 the principal compiler.  In those cases, we can choose the standard, and
16350 we chose the more efficient register return alternative.
16351
16352 @strong{Warning:} code compiled with the @option{-freg-struct-return}
16353 switch is not binary compatible with code compiled with the
16354 @option{-fpcc-struct-return} switch.
16355 Use it to conform to a non-default application binary interface.
16356
16357 @item -fshort-enums
16358 @opindex fshort-enums
16359 Allocate to an @code{enum} type only as many bytes as it needs for the
16360 declared range of possible values.  Specifically, the @code{enum} type
16361 will be equivalent to the smallest integer type which has enough room.
16362
16363 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
16364 code that is not binary compatible with code generated without that switch.
16365 Use it to conform to a non-default application binary interface.
16366
16367 @item -fshort-double
16368 @opindex fshort-double
16369 Use the same size for @code{double} as for @code{float}.
16370
16371 @strong{Warning:} the @option{-fshort-double} switch causes GCC to generate
16372 code that is not binary compatible with code generated without that switch.
16373 Use it to conform to a non-default application binary interface.
16374
16375 @item -fshort-wchar
16376 @opindex fshort-wchar
16377 Override the underlying type for @samp{wchar_t} to be @samp{short
16378 unsigned int} instead of the default for the target.  This option is
16379 useful for building programs to run under WINE@.
16380
16381 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
16382 code that is not binary compatible with code generated without that switch.
16383 Use it to conform to a non-default application binary interface.
16384
16385 @item -fno-common
16386 @opindex fno-common
16387 In C code, controls the placement of uninitialized global variables.
16388 Unix C compilers have traditionally permitted multiple definitions of
16389 such variables in different compilation units by placing the variables
16390 in a common block.
16391 This is the behavior specified by @option{-fcommon}, and is the default
16392 for GCC on most targets.
16393 On the other hand, this behavior is not required by ISO C, and on some
16394 targets may carry a speed or code size penalty on variable references.
16395 The @option{-fno-common} option specifies that the compiler should place
16396 uninitialized global variables in the data section of the object file,
16397 rather than generating them as common blocks.
16398 This has the effect that if the same variable is declared
16399 (without @code{extern}) in two different compilations,
16400 you will get a multiple-definition error when you link them.
16401 In this case, you must compile with @option{-fcommon} instead.
16402 Compiling with @option{-fno-common} is useful on targets for which
16403 it provides better performance, or if you wish to verify that the
16404 program will work on other systems which always treat uninitialized
16405 variable declarations this way.
16406
16407 @item -fno-ident
16408 @opindex fno-ident
16409 Ignore the @samp{#ident} directive.
16410
16411 @item -finhibit-size-directive
16412 @opindex finhibit-size-directive
16413 Don't output a @code{.size} assembler directive, or anything else that
16414 would cause trouble if the function is split in the middle, and the
16415 two halves are placed at locations far apart in memory.  This option is
16416 used when compiling @file{crtstuff.c}; you should not need to use it
16417 for anything else.
16418
16419 @item -fverbose-asm
16420 @opindex fverbose-asm
16421 Put extra commentary information in the generated assembly code to
16422 make it more readable.  This option is generally only of use to those
16423 who actually need to read the generated assembly code (perhaps while
16424 debugging the compiler itself).
16425
16426 @option{-fno-verbose-asm}, the default, causes the
16427 extra information to be omitted and is useful when comparing two assembler
16428 files.
16429
16430 @item -frecord-gcc-switches
16431 @opindex frecord-gcc-switches
16432 This switch causes the command line that was used to invoke the
16433 compiler to be recorded into the object file that is being created.
16434 This switch is only implemented on some targets and the exact format
16435 of the recording is target and binary file format dependent, but it
16436 usually takes the form of a section containing ASCII text.  This
16437 switch is related to the @option{-fverbose-asm} switch, but that
16438 switch only records information in the assembler output file as
16439 comments, so it never reaches the object file.
16440
16441 @item -fpic
16442 @opindex fpic
16443 @cindex global offset table
16444 @cindex PIC
16445 Generate position-independent code (PIC) suitable for use in a shared
16446 library, if supported for the target machine.  Such code accesses all
16447 constant addresses through a global offset table (GOT)@.  The dynamic
16448 loader resolves the GOT entries when the program starts (the dynamic
16449 loader is not part of GCC; it is part of the operating system).  If
16450 the GOT size for the linked executable exceeds a machine-specific
16451 maximum size, you get an error message from the linker indicating that
16452 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
16453 instead.  (These maximums are 8k on the SPARC and 32k
16454 on the m68k and RS/6000.  The 386 has no such limit.)
16455
16456 Position-independent code requires special support, and therefore works
16457 only on certain machines.  For the 386, GCC supports PIC for System V
16458 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
16459 position-independent.
16460
16461 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
16462 are defined to 1.
16463
16464 @item -fPIC
16465 @opindex fPIC
16466 If supported for the target machine, emit position-independent code,
16467 suitable for dynamic linking and avoiding any limit on the size of the
16468 global offset table.  This option makes a difference on the m68k,
16469 PowerPC and SPARC@.
16470
16471 Position-independent code requires special support, and therefore works
16472 only on certain machines.
16473
16474 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
16475 are defined to 2.
16476
16477 @item -fpie
16478 @itemx -fPIE
16479 @opindex fpie
16480 @opindex fPIE
16481 These options are similar to @option{-fpic} and @option{-fPIC}, but
16482 generated position independent code can be only linked into executables.
16483 Usually these options are used when @option{-pie} GCC option will be
16484 used during linking.
16485
16486 @option{-fpie} and @option{-fPIE} both define the macros
16487 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
16488 for @option{-fpie} and 2 for @option{-fPIE}.
16489
16490 @item -fno-jump-tables
16491 @opindex fno-jump-tables
16492 Do not use jump tables for switch statements even where it would be
16493 more efficient than other code generation strategies.  This option is
16494 of use in conjunction with @option{-fpic} or @option{-fPIC} for
16495 building code which forms part of a dynamic linker and cannot
16496 reference the address of a jump table.  On some targets, jump tables
16497 do not require a GOT and this option is not needed.
16498
16499 @item -ffixed-@var{reg}
16500 @opindex ffixed
16501 Treat the register named @var{reg} as a fixed register; generated code
16502 should never refer to it (except perhaps as a stack pointer, frame
16503 pointer or in some other fixed role).
16504
16505 @var{reg} must be the name of a register.  The register names accepted
16506 are machine-specific and are defined in the @code{REGISTER_NAMES}
16507 macro in the machine description macro file.
16508
16509 This flag does not have a negative form, because it specifies a
16510 three-way choice.
16511
16512 @item -fcall-used-@var{reg}
16513 @opindex fcall-used
16514 Treat the register named @var{reg} as an allocable register that is
16515 clobbered by function calls.  It may be allocated for temporaries or
16516 variables that do not live across a call.  Functions compiled this way
16517 will not save and restore the register @var{reg}.
16518
16519 It is an error to used this flag with the frame pointer or stack pointer.
16520 Use of this flag for other registers that have fixed pervasive roles in
16521 the machine's execution model will produce disastrous results.
16522
16523 This flag does not have a negative form, because it specifies a
16524 three-way choice.
16525
16526 @item -fcall-saved-@var{reg}
16527 @opindex fcall-saved
16528 Treat the register named @var{reg} as an allocable register saved by
16529 functions.  It may be allocated even for temporaries or variables that
16530 live across a call.  Functions compiled this way will save and restore
16531 the register @var{reg} if they use it.
16532
16533 It is an error to used this flag with the frame pointer or stack pointer.
16534 Use of this flag for other registers that have fixed pervasive roles in
16535 the machine's execution model will produce disastrous results.
16536
16537 A different sort of disaster will result from the use of this flag for
16538 a register in which function values may be returned.
16539
16540 This flag does not have a negative form, because it specifies a
16541 three-way choice.
16542
16543 @item -fpack-struct[=@var{n}]
16544 @opindex fpack-struct
16545 Without a value specified, pack all structure members together without
16546 holes.  When a value is specified (which must be a small power of two), pack
16547 structure members according to this value, representing the maximum
16548 alignment (that is, objects with default alignment requirements larger than
16549 this will be output potentially unaligned at the next fitting location.
16550
16551 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
16552 code that is not binary compatible with code generated without that switch.
16553 Additionally, it makes the code suboptimal.
16554 Use it to conform to a non-default application binary interface.
16555
16556 @item -finstrument-functions
16557 @opindex finstrument-functions
16558 Generate instrumentation calls for entry and exit to functions.  Just
16559 after function entry and just before function exit, the following
16560 profiling functions will be called with the address of the current
16561 function and its call site.  (On some platforms,
16562 @code{__builtin_return_address} does not work beyond the current
16563 function, so the call site information may not be available to the
16564 profiling functions otherwise.)
16565
16566 @smallexample
16567 void __cyg_profile_func_enter (void *this_fn,
16568                                void *call_site);
16569 void __cyg_profile_func_exit  (void *this_fn,
16570                                void *call_site);
16571 @end smallexample
16572
16573 The first argument is the address of the start of the current function,
16574 which may be looked up exactly in the symbol table.
16575
16576 This instrumentation is also done for functions expanded inline in other
16577 functions.  The profiling calls will indicate where, conceptually, the
16578 inline function is entered and exited.  This means that addressable
16579 versions of such functions must be available.  If all your uses of a
16580 function are expanded inline, this may mean an additional expansion of
16581 code size.  If you use @samp{extern inline} in your C code, an
16582 addressable version of such functions must be provided.  (This is
16583 normally the case anyways, but if you get lucky and the optimizer always
16584 expands the functions inline, you might have gotten away without
16585 providing static copies.)
16586
16587 A function may be given the attribute @code{no_instrument_function}, in
16588 which case this instrumentation will not be done.  This can be used, for
16589 example, for the profiling functions listed above, high-priority
16590 interrupt routines, and any functions from which the profiling functions
16591 cannot safely be called (perhaps signal handlers, if the profiling
16592 routines generate output or allocate memory).
16593
16594 @item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
16595 @opindex finstrument-functions-exclude-file-list
16596
16597 Set the list of functions that are excluded from instrumentation (see
16598 the description of @code{-finstrument-functions}).  If the file that
16599 contains a function definition matches with one of @var{file}, then
16600 that function is not instrumented.  The match is done on substrings:
16601 if the @var{file} parameter is a substring of the file name, it is
16602 considered to be a match.
16603
16604 For example,
16605 @code{-finstrument-functions-exclude-file-list=/bits/stl,include/sys}
16606 will exclude any inline function defined in files whose pathnames
16607 contain @code{/bits/stl} or @code{include/sys}.
16608
16609 If, for some reason, you want to include letter @code{','} in one of
16610 @var{sym}, write @code{'\,'}. For example,
16611 @code{-finstrument-functions-exclude-file-list='\,\,tmp'}
16612 (note the single quote surrounding the option).
16613
16614 @item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{}
16615 @opindex finstrument-functions-exclude-function-list
16616
16617 This is similar to @code{-finstrument-functions-exclude-file-list},
16618 but this option sets the list of function names to be excluded from
16619 instrumentation.  The function name to be matched is its user-visible
16620 name, such as @code{vector<int> blah(const vector<int> &)}, not the
16621 internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}).  The
16622 match is done on substrings: if the @var{sym} parameter is a substring
16623 of the function name, it is considered to be a match.  For C99 and C++
16624 extended identifiers, the function name must be given in UTF-8, not
16625 using universal character names.
16626
16627 @item -fstack-check
16628 @opindex fstack-check
16629 Generate code to verify that you do not go beyond the boundary of the
16630 stack.  You should specify this flag if you are running in an
16631 environment with multiple threads, but only rarely need to specify it in
16632 a single-threaded environment since stack overflow is automatically
16633 detected on nearly all systems if there is only one stack.
16634
16635 Note that this switch does not actually cause checking to be done; the
16636 operating system or the language runtime must do that.  The switch causes
16637 generation of code to ensure that they see the stack being extended.
16638
16639 You can additionally specify a string parameter: @code{no} means no
16640 checking, @code{generic} means force the use of old-style checking,
16641 @code{specific} means use the best checking method and is equivalent
16642 to bare @option{-fstack-check}.
16643
16644 Old-style checking is a generic mechanism that requires no specific
16645 target support in the compiler but comes with the following drawbacks:
16646
16647 @enumerate
16648 @item
16649 Modified allocation strategy for large objects: they will always be
16650 allocated dynamically if their size exceeds a fixed threshold.
16651
16652 @item
16653 Fixed limit on the size of the static frame of functions: when it is
16654 topped by a particular function, stack checking is not reliable and
16655 a warning is issued by the compiler.
16656
16657 @item
16658 Inefficiency: because of both the modified allocation strategy and the
16659 generic implementation, the performances of the code are hampered.
16660 @end enumerate
16661
16662 Note that old-style stack checking is also the fallback method for
16663 @code{specific} if no target support has been added in the compiler.
16664
16665 @item -fstack-limit-register=@var{reg}
16666 @itemx -fstack-limit-symbol=@var{sym}
16667 @itemx -fno-stack-limit
16668 @opindex fstack-limit-register
16669 @opindex fstack-limit-symbol
16670 @opindex fno-stack-limit
16671 Generate code to ensure that the stack does not grow beyond a certain value,
16672 either the value of a register or the address of a symbol.  If the stack
16673 would grow beyond the value, a signal is raised.  For most targets,
16674 the signal is raised before the stack overruns the boundary, so
16675 it is possible to catch the signal without taking special precautions.
16676
16677 For instance, if the stack starts at absolute address @samp{0x80000000}
16678 and grows downwards, you can use the flags
16679 @option{-fstack-limit-symbol=__stack_limit} and
16680 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
16681 of 128KB@.  Note that this may only work with the GNU linker.
16682
16683 @cindex aliasing of parameters
16684 @cindex parameters, aliased
16685 @item -fargument-alias
16686 @itemx -fargument-noalias
16687 @itemx -fargument-noalias-global
16688 @itemx -fargument-noalias-anything
16689 @opindex fargument-alias
16690 @opindex fargument-noalias
16691 @opindex fargument-noalias-global
16692 @opindex fargument-noalias-anything
16693 Specify the possible relationships among parameters and between
16694 parameters and global data.
16695
16696 @option{-fargument-alias} specifies that arguments (parameters) may
16697 alias each other and may alias global storage.@*
16698 @option{-fargument-noalias} specifies that arguments do not alias
16699 each other, but may alias global storage.@*
16700 @option{-fargument-noalias-global} specifies that arguments do not
16701 alias each other and do not alias global storage.
16702 @option{-fargument-noalias-anything} specifies that arguments do not
16703 alias any other storage.
16704
16705 Each language will automatically use whatever option is required by
16706 the language standard.  You should not need to use these options yourself.
16707
16708 @item -fleading-underscore
16709 @opindex fleading-underscore
16710 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
16711 change the way C symbols are represented in the object file.  One use
16712 is to help link with legacy assembly code.
16713
16714 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
16715 generate code that is not binary compatible with code generated without that
16716 switch.  Use it to conform to a non-default application binary interface.
16717 Not all targets provide complete support for this switch.
16718
16719 @item -ftls-model=@var{model}
16720 @opindex ftls-model
16721 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
16722 The @var{model} argument should be one of @code{global-dynamic},
16723 @code{local-dynamic}, @code{initial-exec} or @code{local-exec}.
16724
16725 The default without @option{-fpic} is @code{initial-exec}; with
16726 @option{-fpic} the default is @code{global-dynamic}.
16727
16728 @item -fvisibility=@var{default|internal|hidden|protected}
16729 @opindex fvisibility
16730 Set the default ELF image symbol visibility to the specified option---all
16731 symbols will be marked with this unless overridden within the code.
16732 Using this feature can very substantially improve linking and
16733 load times of shared object libraries, produce more optimized
16734 code, provide near-perfect API export and prevent symbol clashes.
16735 It is @strong{strongly} recommended that you use this in any shared objects
16736 you distribute.
16737
16738 Despite the nomenclature, @code{default} always means public ie;
16739 available to be linked against from outside the shared object.
16740 @code{protected} and @code{internal} are pretty useless in real-world
16741 usage so the only other commonly used option will be @code{hidden}.
16742 The default if @option{-fvisibility} isn't specified is
16743 @code{default}, i.e., make every
16744 symbol public---this causes the same behavior as previous versions of
16745 GCC@.
16746
16747 A good explanation of the benefits offered by ensuring ELF
16748 symbols have the correct visibility is given by ``How To Write
16749 Shared Libraries'' by Ulrich Drepper (which can be found at
16750 @w{@uref{http://people.redhat.com/~drepper/}})---however a superior
16751 solution made possible by this option to marking things hidden when
16752 the default is public is to make the default hidden and mark things
16753 public.  This is the norm with DLL's on Windows and with @option{-fvisibility=hidden}
16754 and @code{__attribute__ ((visibility("default")))} instead of
16755 @code{__declspec(dllexport)} you get almost identical semantics with
16756 identical syntax.  This is a great boon to those working with
16757 cross-platform projects.
16758
16759 For those adding visibility support to existing code, you may find
16760 @samp{#pragma GCC visibility} of use.  This works by you enclosing
16761 the declarations you wish to set visibility for with (for example)
16762 @samp{#pragma GCC visibility push(hidden)} and
16763 @samp{#pragma GCC visibility pop}.
16764 Bear in mind that symbol visibility should be viewed @strong{as
16765 part of the API interface contract} and thus all new code should
16766 always specify visibility when it is not the default ie; declarations
16767 only for use within the local DSO should @strong{always} be marked explicitly
16768 as hidden as so to avoid PLT indirection overheads---making this
16769 abundantly clear also aids readability and self-documentation of the code.
16770 Note that due to ISO C++ specification requirements, operator new and
16771 operator delete must always be of default visibility.
16772
16773 Be aware that headers from outside your project, in particular system
16774 headers and headers from any other library you use, may not be
16775 expecting to be compiled with visibility other than the default.  You
16776 may need to explicitly say @samp{#pragma GCC visibility push(default)}
16777 before including any such headers.
16778
16779 @samp{extern} declarations are not affected by @samp{-fvisibility}, so
16780 a lot of code can be recompiled with @samp{-fvisibility=hidden} with
16781 no modifications.  However, this means that calls to @samp{extern}
16782 functions with no explicit visibility will use the PLT, so it is more
16783 effective to use @samp{__attribute ((visibility))} and/or
16784 @samp{#pragma GCC visibility} to tell the compiler which @samp{extern}
16785 declarations should be treated as hidden.
16786
16787 Note that @samp{-fvisibility} does affect C++ vague linkage
16788 entities. This means that, for instance, an exception class that will
16789 be thrown between DSOs must be explicitly marked with default
16790 visibility so that the @samp{type_info} nodes will be unified between
16791 the DSOs.
16792
16793 An overview of these techniques, their benefits and how to use them
16794 is at @w{@uref{http://gcc.gnu.org/wiki/Visibility}}.
16795
16796 @end table
16797
16798 @c man end
16799
16800 @node Environment Variables
16801 @section Environment Variables Affecting GCC
16802 @cindex environment variables
16803
16804 @c man begin ENVIRONMENT
16805 This section describes several environment variables that affect how GCC
16806 operates.  Some of them work by specifying directories or prefixes to use
16807 when searching for various kinds of files.  Some are used to specify other
16808 aspects of the compilation environment.
16809
16810 Note that you can also specify places to search using options such as
16811 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
16812 take precedence over places specified using environment variables, which
16813 in turn take precedence over those specified by the configuration of GCC@.
16814 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
16815 GNU Compiler Collection (GCC) Internals}.
16816
16817 @table @env
16818 @item LANG
16819 @itemx LC_CTYPE
16820 @c @itemx LC_COLLATE
16821 @itemx LC_MESSAGES
16822 @c @itemx LC_MONETARY
16823 @c @itemx LC_NUMERIC
16824 @c @itemx LC_TIME
16825 @itemx LC_ALL
16826 @findex LANG
16827 @findex LC_CTYPE
16828 @c @findex LC_COLLATE
16829 @findex LC_MESSAGES
16830 @c @findex LC_MONETARY
16831 @c @findex LC_NUMERIC
16832 @c @findex LC_TIME
16833 @findex LC_ALL
16834 @cindex locale
16835 These environment variables control the way that GCC uses
16836 localization information that allow GCC to work with different
16837 national conventions.  GCC inspects the locale categories
16838 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
16839 so.  These locale categories can be set to any value supported by your
16840 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
16841 Kingdom encoded in UTF-8.
16842
16843 The @env{LC_CTYPE} environment variable specifies character
16844 classification.  GCC uses it to determine the character boundaries in
16845 a string; this is needed for some multibyte encodings that contain quote
16846 and escape characters that would otherwise be interpreted as a string
16847 end or escape.
16848
16849 The @env{LC_MESSAGES} environment variable specifies the language to
16850 use in diagnostic messages.
16851
16852 If the @env{LC_ALL} environment variable is set, it overrides the value
16853 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
16854 and @env{LC_MESSAGES} default to the value of the @env{LANG}
16855 environment variable.  If none of these variables are set, GCC
16856 defaults to traditional C English behavior.
16857
16858 @item TMPDIR
16859 @findex TMPDIR
16860 If @env{TMPDIR} is set, it specifies the directory to use for temporary
16861 files.  GCC uses temporary files to hold the output of one stage of
16862 compilation which is to be used as input to the next stage: for example,
16863 the output of the preprocessor, which is the input to the compiler
16864 proper.
16865
16866 @item GCC_EXEC_PREFIX
16867 @findex GCC_EXEC_PREFIX
16868 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
16869 names of the subprograms executed by the compiler.  No slash is added
16870 when this prefix is combined with the name of a subprogram, but you can
16871 specify a prefix that ends with a slash if you wish.
16872
16873 If @env{GCC_EXEC_PREFIX} is not set, GCC will attempt to figure out
16874 an appropriate prefix to use based on the pathname it was invoked with.
16875
16876 If GCC cannot find the subprogram using the specified prefix, it
16877 tries looking in the usual places for the subprogram.
16878
16879 The default value of @env{GCC_EXEC_PREFIX} is
16880 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
16881 the installed compiler. In many cases @var{prefix} is the value
16882 of @code{prefix} when you ran the @file{configure} script.
16883
16884 Other prefixes specified with @option{-B} take precedence over this prefix.
16885
16886 This prefix is also used for finding files such as @file{crt0.o} that are
16887 used for linking.
16888
16889 In addition, the prefix is used in an unusual way in finding the
16890 directories to search for header files.  For each of the standard
16891 directories whose name normally begins with @samp{/usr/local/lib/gcc}
16892 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
16893 replacing that beginning with the specified prefix to produce an
16894 alternate directory name.  Thus, with @option{-Bfoo/}, GCC will search
16895 @file{foo/bar} where it would normally search @file{/usr/local/lib/bar}.
16896 These alternate directories are searched first; the standard directories
16897 come next. If a standard directory begins with the configured
16898 @var{prefix} then the value of @var{prefix} is replaced by
16899 @env{GCC_EXEC_PREFIX} when looking for header files.
16900
16901 @item COMPILER_PATH
16902 @findex COMPILER_PATH
16903 The value of @env{COMPILER_PATH} is a colon-separated list of
16904 directories, much like @env{PATH}.  GCC tries the directories thus
16905 specified when searching for subprograms, if it can't find the
16906 subprograms using @env{GCC_EXEC_PREFIX}.
16907
16908 @item LIBRARY_PATH
16909 @findex LIBRARY_PATH
16910 The value of @env{LIBRARY_PATH} is a colon-separated list of
16911 directories, much like @env{PATH}.  When configured as a native compiler,
16912 GCC tries the directories thus specified when searching for special
16913 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
16914 using GCC also uses these directories when searching for ordinary
16915 libraries for the @option{-l} option (but directories specified with
16916 @option{-L} come first).
16917
16918 @item LANG
16919 @findex LANG
16920 @cindex locale definition
16921 This variable is used to pass locale information to the compiler.  One way in
16922 which this information is used is to determine the character set to be used
16923 when character literals, string literals and comments are parsed in C and C++.
16924 When the compiler is configured to allow multibyte characters,
16925 the following values for @env{LANG} are recognized:
16926
16927 @table @samp
16928 @item C-JIS
16929 Recognize JIS characters.
16930 @item C-SJIS
16931 Recognize SJIS characters.
16932 @item C-EUCJP
16933 Recognize EUCJP characters.
16934 @end table
16935
16936 If @env{LANG} is not defined, or if it has some other value, then the
16937 compiler will use mblen and mbtowc as defined by the default locale to
16938 recognize and translate multibyte characters.
16939 @end table
16940
16941 @noindent
16942 Some additional environments variables affect the behavior of the
16943 preprocessor.
16944
16945 @include cppenv.texi
16946
16947 @c man end
16948
16949 @node Precompiled Headers
16950 @section Using Precompiled Headers
16951 @cindex precompiled headers
16952 @cindex speed of compilation
16953
16954 Often large projects have many header files that are included in every
16955 source file.  The time the compiler takes to process these header files
16956 over and over again can account for nearly all of the time required to
16957 build the project.  To make builds faster, GCC allows users to
16958 `precompile' a header file; then, if builds can use the precompiled
16959 header file they will be much faster.
16960
16961 To create a precompiled header file, simply compile it as you would any
16962 other file, if necessary using the @option{-x} option to make the driver
16963 treat it as a C or C++ header file.  You will probably want to use a
16964 tool like @command{make} to keep the precompiled header up-to-date when
16965 the headers it contains change.
16966
16967 A precompiled header file will be searched for when @code{#include} is
16968 seen in the compilation.  As it searches for the included file
16969 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
16970 compiler looks for a precompiled header in each directory just before it
16971 looks for the include file in that directory.  The name searched for is
16972 the name specified in the @code{#include} with @samp{.gch} appended.  If
16973 the precompiled header file can't be used, it is ignored.
16974
16975 For instance, if you have @code{#include "all.h"}, and you have
16976 @file{all.h.gch} in the same directory as @file{all.h}, then the
16977 precompiled header file will be used if possible, and the original
16978 header will be used otherwise.
16979
16980 Alternatively, you might decide to put the precompiled header file in a
16981 directory and use @option{-I} to ensure that directory is searched
16982 before (or instead of) the directory containing the original header.
16983 Then, if you want to check that the precompiled header file is always
16984 used, you can put a file of the same name as the original header in this
16985 directory containing an @code{#error} command.
16986
16987 This also works with @option{-include}.  So yet another way to use
16988 precompiled headers, good for projects not designed with precompiled
16989 header files in mind, is to simply take most of the header files used by
16990 a project, include them from another header file, precompile that header
16991 file, and @option{-include} the precompiled header.  If the header files
16992 have guards against multiple inclusion, they will be skipped because
16993 they've already been included (in the precompiled header).
16994
16995 If you need to precompile the same header file for different
16996 languages, targets, or compiler options, you can instead make a
16997 @emph{directory} named like @file{all.h.gch}, and put each precompiled
16998 header in the directory, perhaps using @option{-o}.  It doesn't matter
16999 what you call the files in the directory, every precompiled header in
17000 the directory will be considered.  The first precompiled header
17001 encountered in the directory that is valid for this compilation will
17002 be used; they're searched in no particular order.
17003
17004 There are many other possibilities, limited only by your imagination,
17005 good sense, and the constraints of your build system.
17006
17007 A precompiled header file can be used only when these conditions apply:
17008
17009 @itemize
17010 @item
17011 Only one precompiled header can be used in a particular compilation.
17012
17013 @item
17014 A precompiled header can't be used once the first C token is seen.  You
17015 can have preprocessor directives before a precompiled header; you can
17016 even include a precompiled header from inside another header, so long as
17017 there are no C tokens before the @code{#include}.
17018
17019 @item
17020 The precompiled header file must be produced for the same language as
17021 the current compilation.  You can't use a C precompiled header for a C++
17022 compilation.
17023
17024 @item
17025 The precompiled header file must have been produced by the same compiler
17026 binary as the current compilation is using.
17027
17028 @item
17029 Any macros defined before the precompiled header is included must
17030 either be defined in the same way as when the precompiled header was
17031 generated, or must not affect the precompiled header, which usually
17032 means that they don't appear in the precompiled header at all.
17033
17034 The @option{-D} option is one way to define a macro before a
17035 precompiled header is included; using a @code{#define} can also do it.
17036 There are also some options that define macros implicitly, like
17037 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
17038 defined this way.
17039
17040 @item If debugging information is output when using the precompiled
17041 header, using @option{-g} or similar, the same kind of debugging information
17042 must have been output when building the precompiled header.  However,
17043 a precompiled header built using @option{-g} can be used in a compilation
17044 when no debugging information is being output.
17045
17046 @item The same @option{-m} options must generally be used when building
17047 and using the precompiled header.  @xref{Submodel Options},
17048 for any cases where this rule is relaxed.
17049
17050 @item Each of the following options must be the same when building and using
17051 the precompiled header:
17052
17053 @gccoptlist{-fexceptions}
17054
17055 @item
17056 Some other command-line options starting with @option{-f},
17057 @option{-p}, or @option{-O} must be defined in the same way as when
17058 the precompiled header was generated.  At present, it's not clear
17059 which options are safe to change and which are not; the safest choice
17060 is to use exactly the same options when generating and using the
17061 precompiled header.  The following are known to be safe:
17062
17063 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
17064 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
17065 -fsched-verbose=<number>  -fschedule-insns  -fvisibility= @gol
17066 -pedantic-errors}
17067
17068 @end itemize
17069
17070 For all of these except the last, the compiler will automatically
17071 ignore the precompiled header if the conditions aren't met.  If you
17072 find an option combination that doesn't work and doesn't cause the
17073 precompiled header to be ignored, please consider filing a bug report,
17074 see @ref{Bugs}.
17075
17076 If you do use differing options when generating and using the
17077 precompiled header, the actual behavior will be a mixture of the
17078 behavior for the options.  For instance, if you use @option{-g} to
17079 generate the precompiled header but not when using it, you may or may
17080 not get debugging information for routines in the precompiled header.