Handle assembler name in -fdisable/enable options
[official-gcc.git] / gcc / doc / invoke.texi
blob5f4c66a1dc161ce7c59327de466fa0542a082c04
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, 2010, 2011
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.
7 @ignore
8 @c man begin INCLUDE
9 @include gcc-vers.texi
10 @c man end
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, 2010
15 Free Software Foundation, Inc.
17 Permission is granted to copy, distribute and/or modify this document
18 under the terms of the GNU Free Documentation License, Version 1.3 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.
25 (a) The FSF's Front-Cover Text is:
27      A GNU Manual
29 (b) The FSF's Back-Cover Text is:
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{}
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
67 @node Invoking GCC
68 @chapter GCC Command Options
69 @cindex GCC command options
70 @cindex command options
71 @cindex options, GCC command
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.
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.
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.
92 @cindex C++ compilation options
93 @xref{Invoking G++,,Compiling C++ Programs}, for a summary of special
94 options for compiling C++ programs.
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}}.
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.
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.
118 @c man end
120 @xref{Option Index}, for an index to GCC's options.
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
153 @c man begin OPTIONS
155 @node Option Summary
156 @section Option Summary
158 Here is a summary of all the options, grouped by type.  Explanations are
159 in the following sections.
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}  -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}  @gol
168 -fdump-ada-spec@r{[}-slim@r{]} -fdump-go-spec=@var{file}}
170 @item C Language Options
171 @xref{C Dialect Options,,Options Controlling C Dialect}.
172 @gccoptlist{-ansi  -std=@var{standard}  -fgnu89-inline @gol
173 -aux-info @var{filename} @gol
174 -fno-asm  -fno-builtin  -fno-builtin-@var{function} @gol
175 -fhosted  -ffreestanding -fopenmp -fms-extensions -fplan9-extensions @gol
176 -trigraphs  -no-integrated-cpp  -traditional  -traditional-cpp @gol
177 -fallow-single-precision  -fcond-mismatch -flax-vector-conversions @gol
178 -fsigned-bitfields  -fsigned-char @gol
179 -funsigned-bitfields  -funsigned-char}
181 @item C++ Language Options
182 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}.
183 @gccoptlist{-fabi-version=@var{n}  -fno-access-control  -fcheck-new @gol
184 -fconserve-space  -fconstexpr-depth=@var{n}  -ffriend-injection @gol
185 -fno-elide-constructors @gol
186 -fno-enforce-eh-specs @gol
187 -ffor-scope  -fno-for-scope  -fno-gnu-keywords @gol
188 -fno-implicit-templates @gol
189 -fno-implicit-inline-templates @gol
190 -fno-implement-inlines  -fms-extensions @gol
191 -fno-nonansi-builtins  -fnothrow-opt  -fno-operator-names @gol
192 -fno-optional-diags  -fpermissive @gol
193 -fno-pretty-templates @gol
194 -frepo  -fno-rtti  -fstats  -ftemplate-depth=@var{n} @gol
195 -fno-threadsafe-statics -fuse-cxa-atexit  -fno-weak  -nostdinc++ @gol
196 -fno-default-inline  -fvisibility-inlines-hidden @gol
197 -fvisibility-ms-compat @gol
198 -Wabi  -Wconversion-null  -Wctor-dtor-privacy @gol
199 -Wnoexcept -Wnon-virtual-dtor  -Wreorder @gol
200 -Weffc++  -Wstrict-null-sentinel @gol
201 -Wno-non-template-friend  -Wold-style-cast @gol
202 -Woverloaded-virtual  -Wno-pmf-conversions @gol
203 -Wsign-promo}
205 @item Objective-C and Objective-C++ Language Options
206 @xref{Objective-C and Objective-C++ Dialect Options,,Options Controlling
207 Objective-C and Objective-C++ Dialects}.
208 @gccoptlist{-fconstant-string-class=@var{class-name} @gol
209 -fgnu-runtime  -fnext-runtime @gol
210 -fno-nil-receivers @gol
211 -fobjc-abi-version=@var{n} @gol
212 -fobjc-call-cxx-cdtors @gol
213 -fobjc-direct-dispatch @gol
214 -fobjc-exceptions @gol
215 -fobjc-gc @gol
216 -fobjc-nilcheck @gol
217 -fobjc-std=objc1 @gol
218 -freplace-objc-classes @gol
219 -fzero-link @gol
220 -gen-decls @gol
221 -Wassign-intercept @gol
222 -Wno-protocol  -Wselector @gol
223 -Wstrict-selector-match @gol
224 -Wundeclared-selector}
226 @item Language Independent Options
227 @xref{Language Independent Options,,Options to Control Diagnostic Messages Formatting}.
228 @gccoptlist{-fmessage-length=@var{n}  @gol
229 -fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]}  @gol
230 -fno-diagnostics-show-option}
232 @item Warning Options
233 @xref{Warning Options,,Options to Request or Suppress Warnings}.
234 @gccoptlist{-fsyntax-only  -fmax-errors=@var{n}  -pedantic @gol
235 -pedantic-errors @gol
236 -w  -Wextra  -Wall  -Waddress  -Waggregate-return  -Warray-bounds @gol
237 -Wno-attributes -Wno-builtin-macro-redefined @gol
238 -Wc++-compat -Wc++0x-compat -Wcast-align  -Wcast-qual  @gol
239 -Wchar-subscripts -Wclobbered  -Wcomment @gol
240 -Wconversion  -Wcoverage-mismatch  -Wno-cpp  -Wno-deprecated  @gol
241 -Wno-deprecated-declarations -Wdisabled-optimization  @gol
242 -Wno-div-by-zero -Wdouble-promotion -Wempty-body  -Wenum-compare @gol
243 -Wno-endif-labels -Werror  -Werror=* @gol
244 -Wfatal-errors  -Wfloat-equal  -Wformat  -Wformat=2 @gol
245 -Wno-format-contains-nul -Wno-format-extra-args -Wformat-nonliteral @gol
246 -Wformat-security  -Wformat-y2k @gol
247 -Wframe-larger-than=@var{len} -Wjump-misses-init -Wignored-qualifiers @gol
248 -Wimplicit  -Wimplicit-function-declaration  -Wimplicit-int @gol
249 -Winit-self  -Winline -Wmaybe-uninitialized @gol
250 -Wno-int-to-pointer-cast -Wno-invalid-offsetof @gol
251 -Winvalid-pch -Wlarger-than=@var{len}  -Wunsafe-loop-optimizations @gol
252 -Wlogical-op -Wlong-long @gol
253 -Wmain -Wmaybe-uninitialized -Wmissing-braces  -Wmissing-field-initializers @gol
254 -Wmissing-format-attribute  -Wmissing-include-dirs @gol
255 -Wno-mudflap @gol
256 -Wno-multichar  -Wnonnull  -Wno-overflow @gol
257 -Woverlength-strings  -Wpacked  -Wpacked-bitfield-compat  -Wpadded @gol
258 -Wparentheses  -Wpedantic-ms-format -Wno-pedantic-ms-format @gol
259 -Wpointer-arith  -Wno-pointer-to-int-cast @gol
260 -Wredundant-decls @gol
261 -Wreturn-type  -Wsequence-point  -Wshadow @gol
262 -Wsign-compare  -Wsign-conversion  -Wstack-protector @gol
263 -Wstack-usage=@var{len} -Wstrict-aliasing -Wstrict-aliasing=n @gol
264 -Wstrict-overflow -Wstrict-overflow=@var{n} @gol
265 -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{]} @gol
266 -Wswitch  -Wswitch-default  -Wswitch-enum -Wsync-nand @gol
267 -Wsystem-headers  -Wtrampolines  -Wtrigraphs  -Wtype-limits  -Wundef @gol
268 -Wuninitialized  -Wunknown-pragmas  -Wno-pragmas @gol
269 -Wunsuffixed-float-constants  -Wunused  -Wunused-function @gol
270 -Wunused-label  -Wunused-parameter -Wno-unused-result -Wunused-value @gol
271 -Wunused-variable -Wunused-but-set-parameter -Wunused-but-set-variable @gol
272 -Wvariadic-macros -Wvla -Wvolatile-register-var  -Wwrite-strings}
274 @item C and Objective-C-only Warning Options
275 @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
276 -Wmissing-parameter-type  -Wmissing-prototypes  -Wnested-externs @gol
277 -Wold-style-declaration  -Wold-style-definition @gol
278 -Wstrict-prototypes  -Wtraditional  -Wtraditional-conversion @gol
279 -Wdeclaration-after-statement -Wpointer-sign}
281 @item Debugging Options
282 @xref{Debugging Options,,Options for Debugging Your Program or GCC}.
283 @gccoptlist{-d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
284 -fdbg-cnt-list -fdbg-cnt=@var{counter-value-list} @gol
285 -fdisable-ipa-@var{pass_name} @gol
286 -fdisable-rtl-@var{pass_name} @gol
287 -fdisable-rtl-@var{pass-name}=@var{range-list} @gol
288 -fdisable-tree-@var{pass_name} @gol
289 -fdisable-tree-@var{pass-name}=@var{range-list} @gol
290 -fdump-noaddr -fdump-unnumbered -fdump-unnumbered-links @gol
291 -fdump-translation-unit@r{[}-@var{n}@r{]} @gol
292 -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
293 -fdump-ipa-all -fdump-ipa-cgraph -fdump-ipa-inline @gol
294 -fdump-statistics @gol
295 -fdump-tree-all @gol
296 -fdump-tree-original@r{[}-@var{n}@r{]}  @gol
297 -fdump-tree-optimized@r{[}-@var{n}@r{]} @gol
298 -fdump-tree-cfg -fdump-tree-vcg -fdump-tree-alias @gol
299 -fdump-tree-ch @gol
300 -fdump-tree-ssa@r{[}-@var{n}@r{]} -fdump-tree-pre@r{[}-@var{n}@r{]} @gol
301 -fdump-tree-ccp@r{[}-@var{n}@r{]} -fdump-tree-dce@r{[}-@var{n}@r{]} @gol
302 -fdump-tree-gimple@r{[}-raw@r{]} -fdump-tree-mudflap@r{[}-@var{n}@r{]} @gol
303 -fdump-tree-dom@r{[}-@var{n}@r{]} @gol
304 -fdump-tree-dse@r{[}-@var{n}@r{]} @gol
305 -fdump-tree-phiprop@r{[}-@var{n}@r{]} @gol
306 -fdump-tree-phiopt@r{[}-@var{n}@r{]} @gol
307 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
308 -fdump-tree-copyrename@r{[}-@var{n}@r{]} @gol
309 -fdump-tree-nrv -fdump-tree-vect @gol
310 -fdump-tree-sink @gol
311 -fdump-tree-sra@r{[}-@var{n}@r{]} @gol
312 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
313 -fdump-tree-fre@r{[}-@var{n}@r{]} @gol
314 -fdump-tree-vrp@r{[}-@var{n}@r{]} @gol
315 -ftree-vectorizer-verbose=@var{n} @gol
316 -fdump-tree-storeccp@r{[}-@var{n}@r{]} @gol
317 -fdump-final-insns=@var{file} @gol
318 -fcompare-debug@r{[}=@var{opts}@r{]}  -fcompare-debug-second @gol
319 -feliminate-dwarf2-dups -feliminate-unused-debug-types @gol
320 -feliminate-unused-debug-symbols -femit-class-debug-always @gol
321 -fenable-@var{kind}-@var{pass} @gol
322 -fenable-@var{kind}-@var{pass}=@var{range-list} @gol
323 -fdebug-types-section @gol
324 -fmem-report -fpre-ipa-mem-report -fpost-ipa-mem-report -fprofile-arcs @gol
325 -frandom-seed=@var{string} -fsched-verbose=@var{n} @gol
326 -fsel-sched-verbose -fsel-sched-dump-cfg -fsel-sched-pipelining-verbose @gol
327 -fstack-usage  -ftest-coverage  -ftime-report -fvar-tracking @gol
328 -fvar-tracking-assignments  -fvar-tracking-assignments-toggle @gol
329 -g  -g@var{level}  -gtoggle  -gcoff  -gdwarf-@var{version} @gol
330 -ggdb  -gstabs  -gstabs+  -gstrict-dwarf  -gno-strict-dwarf @gol
331 -gvms  -gxcoff  -gxcoff+ @gol
332 -fno-merge-debug-strings -fno-dwarf2-cfi-asm @gol
333 -fdebug-prefix-map=@var{old}=@var{new} @gol
334 -femit-struct-debug-baseonly -femit-struct-debug-reduced @gol
335 -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol
336 -p  -pg  -print-file-name=@var{library}  -print-libgcc-file-name @gol
337 -print-multi-directory  -print-multi-lib  -print-multi-os-directory @gol
338 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
339 -print-sysroot -print-sysroot-headers-suffix @gol
340 -save-temps -save-temps=cwd -save-temps=obj -time@r{[}=@var{file}@r{]}}
342 @item Optimization Options
343 @xref{Optimize Options,,Options that Control Optimization}.
344 @gccoptlist{-falign-functions[=@var{n}] -falign-jumps[=@var{n}] @gol
345 -falign-labels[=@var{n}] -falign-loops[=@var{n}] -fassociative-math @gol
346 -fauto-inc-dec -fbranch-probabilities -fbranch-target-load-optimize @gol
347 -fbranch-target-load-optimize2 -fbtr-bb-exclusive -fcaller-saves @gol
348 -fcheck-data-deps -fcombine-stack-adjustments -fconserve-stack @gol
349 -fcompare-elim -fcprop-registers -fcrossjumping @gol
350 -fcse-follow-jumps -fcse-skip-blocks -fcx-fortran-rules @gol
351 -fcx-limited-range @gol
352 -fdata-sections -fdce -fdce -fdelayed-branch @gol
353 -fdelete-null-pointer-checks -fdse -fdevirtualize -fdse @gol
354 -fearly-inlining -fipa-sra -fexpensive-optimizations -ffast-math @gol
355 -ffinite-math-only -ffloat-store -fexcess-precision=@var{style} @gol
356 -fforward-propagate -ffp-contract=@var{style} -ffunction-sections @gol
357 -fgcse -fgcse-after-reload -fgcse-las -fgcse-lm -fgraphite-identity @gol
358 -fgcse-sm -fif-conversion -fif-conversion2 -findirect-inlining @gol
359 -finline-functions -finline-functions-called-once -finline-limit=@var{n} @gol
360 -finline-small-functions -fipa-cp -fipa-cp-clone -fipa-matrix-reorg @gol
361 -fipa-pta -fipa-profile -fipa-pure-const -fipa-reference @gol
362 -fira-algorithm=@var{algorithm} @gol
363 -fira-region=@var{region} @gol
364 -fira-loop-pressure -fno-ira-share-save-slots @gol
365 -fno-ira-share-spill-slots -fira-verbose=@var{n} @gol
366 -fivopts -fkeep-inline-functions -fkeep-static-consts @gol
367 -floop-block -floop-flatten -floop-interchange -floop-strip-mine @gol
368 -floop-parallelize-all -flto -flto-compression-level @gol
369 -flto-partition=@var{alg} -flto-report -fmerge-all-constants @gol
370 -fmerge-constants -fmodulo-sched -fmodulo-sched-allow-regmoves @gol
371 -fmove-loop-invariants fmudflap -fmudflapir -fmudflapth -fno-branch-count-reg @gol
372 -fno-default-inline @gol
373 -fno-defer-pop -fno-function-cse -fno-guess-branch-probability @gol
374 -fno-inline -fno-math-errno -fno-peephole -fno-peephole2 @gol
375 -fno-sched-interblock -fno-sched-spec -fno-signed-zeros @gol
376 -fno-toplevel-reorder -fno-trapping-math -fno-zero-initialized-in-bss @gol
377 -fomit-frame-pointer -foptimize-register-move -foptimize-sibling-calls @gol
378 -fpartial-inlining -fpeel-loops -fpredictive-commoning @gol
379 -fprefetch-loop-arrays @gol
380 -fprofile-correction -fprofile-dir=@var{path} -fprofile-generate @gol
381 -fprofile-generate=@var{path} @gol
382 -fprofile-use -fprofile-use=@var{path} -fprofile-values @gol
383 -freciprocal-math -fregmove -frename-registers -freorder-blocks @gol
384 -freorder-blocks-and-partition -freorder-functions @gol
385 -frerun-cse-after-loop -freschedule-modulo-scheduled-loops @gol
386 -frounding-math -fsched2-use-superblocks -fsched-pressure @gol
387 -fsched-spec-load -fsched-spec-load-dangerous @gol
388 -fsched-stalled-insns-dep[=@var{n}] -fsched-stalled-insns[=@var{n}] @gol
389 -fsched-group-heuristic -fsched-critical-path-heuristic @gol
390 -fsched-spec-insn-heuristic -fsched-rank-heuristic @gol
391 -fsched-last-insn-heuristic -fsched-dep-count-heuristic @gol
392 -fschedule-insns -fschedule-insns2 -fsection-anchors @gol
393 -fselective-scheduling -fselective-scheduling2 @gol
394 -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops @gol
395 -fsignaling-nans -fsingle-precision-constant -fsplit-ivs-in-unroller @gol
396 -fsplit-wide-types -fstack-protector -fstack-protector-all @gol
397 -fstrict-aliasing -fstrict-overflow -fthread-jumps -ftracer @gol
398 -ftree-bit-ccp @gol
399 -ftree-builtin-call-dce -ftree-ccp -ftree-ch -ftree-copy-prop @gol
400 -ftree-copyrename -ftree-dce -ftree-dominator-opts -ftree-dse @gol
401 -ftree-forwprop -ftree-fre -ftree-loop-if-convert @gol
402 -ftree-loop-if-convert-stores -ftree-loop-im @gol
403 -ftree-phiprop -ftree-loop-distribution -ftree-loop-distribute-patterns @gol
404 -ftree-loop-ivcanon -ftree-loop-linear -ftree-loop-optimize @gol
405 -ftree-parallelize-loops=@var{n} -ftree-pre -ftree-pta -ftree-reassoc @gol
406 -ftree-sink -ftree-sra -ftree-switch-conversion @gol
407 -ftree-ter -ftree-vect-loop-version -ftree-vectorize -ftree-vrp @gol
408 -funit-at-a-time -funroll-all-loops -funroll-loops @gol
409 -funsafe-loop-optimizations -funsafe-math-optimizations -funswitch-loops @gol
410 -fvariable-expansion-in-unroller -fvect-cost-model -fvpt -fweb @gol
411 -fwhole-program -fwpa -fuse-linker-plugin @gol
412 --param @var{name}=@var{value}
413 -O  -O0  -O1  -O2  -O3  -Os -Ofast}
415 @item Preprocessor Options
416 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
417 @gccoptlist{-A@var{question}=@var{answer} @gol
418 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
419 -C  -dD  -dI  -dM  -dN @gol
420 -D@var{macro}@r{[}=@var{defn}@r{]}  -E  -H @gol
421 -idirafter @var{dir} @gol
422 -include @var{file}  -imacros @var{file} @gol
423 -iprefix @var{file}  -iwithprefix @var{dir} @gol
424 -iwithprefixbefore @var{dir}  -isystem @var{dir} @gol
425 -imultilib @var{dir} -isysroot @var{dir} @gol
426 -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  @gol
427 -P  -fworking-directory  -remap @gol
428 -trigraphs  -undef  -U@var{macro}  -Wp,@var{option} @gol
429 -Xpreprocessor @var{option}}
431 @item Assembler Option
432 @xref{Assembler Options,,Passing Options to the Assembler}.
433 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
435 @item Linker Options
436 @xref{Link Options,,Options for Linking}.
437 @gccoptlist{@var{object-file-name}  -l@var{library} @gol
438 -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic @gol
439 -s  -static  -static-libgcc  -static-libstdc++ -shared  @gol
440 -shared-libgcc  -symbolic @gol
441 -T @var{script}  -Wl,@var{option}  -Xlinker @var{option} @gol
442 -u @var{symbol}}
444 @item Directory Options
445 @xref{Directory Options,,Options for Directory Search}.
446 @gccoptlist{-B@var{prefix} -I@var{dir} -iplugindir=@var{dir} @gol
447 -iquote@var{dir} -L@var{dir} -specs=@var{file} -I- @gol
448 --sysroot=@var{dir}}
450 @item Machine Dependent Options
451 @xref{Submodel Options,,Hardware Models and Configurations}.
452 @c This list is ordered alphanumerically by subsection name.
453 @c Try and put the significant identifier (CPU or system) first,
454 @c so users have a clue at guessing where the ones they want will be.
456 @emph{ARM Options}
457 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
458 -mabi=@var{name} @gol
459 -mapcs-stack-check  -mno-apcs-stack-check @gol
460 -mapcs-float  -mno-apcs-float @gol
461 -mapcs-reentrant  -mno-apcs-reentrant @gol
462 -msched-prolog  -mno-sched-prolog @gol
463 -mlittle-endian  -mbig-endian  -mwords-little-endian @gol
464 -mfloat-abi=@var{name}  -mfpe @gol
465 -mfp16-format=@var{name}
466 -mthumb-interwork  -mno-thumb-interwork @gol
467 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
468 -mstructure-size-boundary=@var{n} @gol
469 -mabort-on-noreturn @gol
470 -mlong-calls  -mno-long-calls @gol
471 -msingle-pic-base  -mno-single-pic-base @gol
472 -mpic-register=@var{reg} @gol
473 -mnop-fun-dllimport @gol
474 -mcirrus-fix-invalid-insns -mno-cirrus-fix-invalid-insns @gol
475 -mpoke-function-name @gol
476 -mthumb  -marm @gol
477 -mtpcs-frame  -mtpcs-leaf-frame @gol
478 -mcaller-super-interworking  -mcallee-super-interworking @gol
479 -mtp=@var{name} @gol
480 -mword-relocations @gol
481 -mfix-cortex-m3-ldrd}
483 @emph{AVR Options}
484 @gccoptlist{-mmcu=@var{mcu}  -mno-interrupts @gol
485 -mcall-prologues  -mtiny-stack  -mint8}
487 @emph{Blackfin Options}
488 @gccoptlist{-mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]} @gol
489 -msim -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
490 -mspecld-anomaly  -mno-specld-anomaly  -mcsync-anomaly  -mno-csync-anomaly @gol
491 -mlow-64k -mno-low64k  -mstack-check-l1  -mid-shared-library @gol
492 -mno-id-shared-library  -mshared-library-id=@var{n} @gol
493 -mleaf-id-shared-library  -mno-leaf-id-shared-library @gol
494 -msep-data  -mno-sep-data  -mlong-calls  -mno-long-calls @gol
495 -mfast-fp -minline-plt -mmulticore  -mcorea  -mcoreb  -msdram @gol
496 -micplb}
498 @emph{CRIS Options}
499 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
500 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
501 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
502 -mstack-align  -mdata-align  -mconst-align @gol
503 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
504 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
505 -mmul-bug-workaround  -mno-mul-bug-workaround}
507 @emph{Darwin Options}
508 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
509 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
510 -client_name  -compatibility_version  -current_version @gol
511 -dead_strip @gol
512 -dependency-file  -dylib_file  -dylinker_install_name @gol
513 -dynamic  -dynamiclib  -exported_symbols_list @gol
514 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
515 -force_flat_namespace  -headerpad_max_install_names @gol
516 -iframework @gol
517 -image_base  -init  -install_name  -keep_private_externs @gol
518 -multi_module  -multiply_defined  -multiply_defined_unused @gol
519 -noall_load   -no_dead_strip_inits_and_terms @gol
520 -nofixprebinding -nomultidefs  -noprebind  -noseglinkedit @gol
521 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
522 -private_bundle  -read_only_relocs  -sectalign @gol
523 -sectobjectsymbols  -whyload  -seg1addr @gol
524 -sectcreate  -sectobjectsymbols  -sectorder @gol
525 -segaddr -segs_read_only_addr -segs_read_write_addr @gol
526 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
527 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
528 -single_module  -static  -sub_library  -sub_umbrella @gol
529 -twolevel_namespace  -umbrella  -undefined @gol
530 -unexported_symbols_list  -weak_reference_mismatches @gol
531 -whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} @gol
532 -mkernel -mone-byte-bool}
534 @emph{DEC Alpha Options}
535 @gccoptlist{-mno-fp-regs  -msoft-float  -malpha-as  -mgas @gol
536 -mieee  -mieee-with-inexact  -mieee-conformant @gol
537 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
538 -mtrap-precision=@var{mode}  -mbuild-constants @gol
539 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
540 -mbwx  -mmax  -mfix  -mcix @gol
541 -mfloat-vax  -mfloat-ieee @gol
542 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
543 -msmall-text  -mlarge-text @gol
544 -mmemory-latency=@var{time}}
546 @emph{DEC Alpha/VMS Options}
547 @gccoptlist{-mvms-return-codes -mdebug-main=@var{prefix} -mmalloc64}
549 @emph{FR30 Options}
550 @gccoptlist{-msmall-model -mno-lsim}
552 @emph{FRV Options}
553 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
554 -mhard-float  -msoft-float @gol
555 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
556 -mdouble  -mno-double @gol
557 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
558 -mfdpic  -minline-plt -mgprel-ro  -multilib-library-pic @gol
559 -mlinked-fp  -mlong-calls  -malign-labels @gol
560 -mlibrary-pic  -macc-4  -macc-8 @gol
561 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
562 -moptimize-membar -mno-optimize-membar @gol
563 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
564 -mvliw-branch  -mno-vliw-branch @gol
565 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
566 -mno-nested-cond-exec  -mtomcat-stats @gol
567 -mTLS -mtls @gol
568 -mcpu=@var{cpu}}
570 @emph{GNU/Linux Options}
571 @gccoptlist{-mglibc -muclibc -mbionic -mandroid @gol
572 -tno-android-cc -tno-android-ld}
574 @emph{H8/300 Options}
575 @gccoptlist{-mrelax  -mh  -ms  -mn  -mint32  -malign-300}
577 @emph{HPPA Options}
578 @gccoptlist{-march=@var{architecture-type} @gol
579 -mbig-switch  -mdisable-fpregs  -mdisable-indexing @gol
580 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
581 -mfixed-range=@var{register-range} @gol
582 -mjump-in-delay -mlinker-opt -mlong-calls @gol
583 -mlong-load-store  -mno-big-switch  -mno-disable-fpregs @gol
584 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
585 -mno-jump-in-delay  -mno-long-load-store @gol
586 -mno-portable-runtime  -mno-soft-float @gol
587 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
588 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
589 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
590 -munix=@var{unix-std}  -nolibdld  -static  -threads}
592 @emph{i386 and x86-64 Options}
593 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
594 -mfpmath=@var{unit} @gol
595 -masm=@var{dialect}  -mno-fancy-math-387 @gol
596 -mno-fp-ret-in-387  -msoft-float @gol
597 -mno-wide-multiply  -mrtd  -malign-double @gol
598 -mpreferred-stack-boundary=@var{num} @gol
599 -mincoming-stack-boundary=@var{num} @gol
600 -mcld -mcx16 -msahf -mmovbe -mcrc32 -mrecip -mvzeroupper @gol
601 -mmmx  -msse  -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -msse4 -mavx @gol
602 -maes -mpclmul -mfsgsbase -mrdrnd -mf16c -mfused-madd @gol
603 -msse4a -m3dnow -mpopcnt -mabm -mbmi -mtbm -mfma4 -mxop -mlwp @gol
604 -mthreads  -mno-align-stringops  -minline-all-stringops @gol
605 -minline-stringops-dynamically -mstringop-strategy=@var{alg} @gol
606 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
607 -m96bit-long-double  -mregparm=@var{num}  -msseregparm @gol
608 -mveclibabi=@var{type} -mvect8-ret-in-mem @gol
609 -mpc32 -mpc64 -mpc80 -mstackrealign @gol
610 -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs @gol
611 -mcmodel=@var{code-model} -mabi=@var{name} @gol
612 -m32  -m64 -mlarge-data-threshold=@var{num} @gol
613 -msse2avx -mfentry -m8bit-idiv @gol
614 -mavx256-split-unaligned-load -mavx256-split-unaligned-store}
616 @emph{i386 and x86-64 Windows Options}
617 @gccoptlist{-mconsole -mcygwin -mno-cygwin -mdll @gol
618 -mnop-fun-dllimport -mthread @gol
619 -municode -mwin32 -mwindows -fno-set-stack-executable}
621 @emph{IA-64 Options}
622 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
623 -mvolatile-asm-stop  -mregister-names  -msdata -mno-sdata @gol
624 -mconstant-gp  -mauto-pic  -mfused-madd @gol
625 -minline-float-divide-min-latency @gol
626 -minline-float-divide-max-throughput @gol
627 -mno-inline-float-divide @gol
628 -minline-int-divide-min-latency @gol
629 -minline-int-divide-max-throughput  @gol
630 -mno-inline-int-divide @gol
631 -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
632 -mno-inline-sqrt @gol
633 -mdwarf2-asm -mearly-stop-bits @gol
634 -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
635 -mtune=@var{cpu-type} -milp32 -mlp64 @gol
636 -msched-br-data-spec -msched-ar-data-spec -msched-control-spec @gol
637 -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec @gol
638 -msched-spec-ldc -msched-spec-control-ldc @gol
639 -msched-prefer-non-data-spec-insns -msched-prefer-non-control-spec-insns @gol
640 -msched-stop-bits-after-every-cycle -msched-count-spec-in-critical-path @gol
641 -msel-sched-dont-check-control-spec -msched-fp-mem-deps-zero-cost @gol
642 -msched-max-memory-insns-hard-limit -msched-max-memory-insns=@var{max-insns}}
644 @emph{IA-64/VMS Options}
645 @gccoptlist{-mvms-return-codes -mdebug-main=@var{prefix} -mmalloc64}
647 @emph{LM32 Options}
648 @gccoptlist{-mbarrel-shift-enabled -mdivide-enabled -mmultiply-enabled @gol
649 -msign-extend-enabled -muser-enabled}
651 @emph{M32R/D Options}
652 @gccoptlist{-m32r2 -m32rx -m32r @gol
653 -mdebug @gol
654 -malign-loops -mno-align-loops @gol
655 -missue-rate=@var{number} @gol
656 -mbranch-cost=@var{number} @gol
657 -mmodel=@var{code-size-model-type} @gol
658 -msdata=@var{sdata-type} @gol
659 -mno-flush-func -mflush-func=@var{name} @gol
660 -mno-flush-trap -mflush-trap=@var{number} @gol
661 -G @var{num}}
663 @emph{M32C Options}
664 @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
666 @emph{M680x0 Options}
667 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu}  -mtune=@var{tune}
668 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
669 -m68060  -mcpu32  -m5200  -m5206e  -m528x  -m5307  -m5407 @gol
670 -mcfv4e  -mbitfield  -mno-bitfield  -mc68000  -mc68020 @gol
671 -mnobitfield  -mrtd  -mno-rtd  -mdiv  -mno-div  -mshort @gol
672 -mno-short  -mhard-float  -m68881  -msoft-float  -mpcrel @gol
673 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
674 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library @gol
675 -mxgot -mno-xgot}
677 @emph{MCore Options}
678 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
679 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
680 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
681 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
682 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
684 @emph{MeP Options}
685 @gccoptlist{-mabsdiff -mall-opts -maverage -mbased=@var{n} -mbitops @gol
686 -mc=@var{n} -mclip -mconfig=@var{name} -mcop -mcop32 -mcop64 -mivc2 @gol
687 -mdc -mdiv -meb -mel -mio-volatile -ml -mleadz -mm -mminmax @gol
688 -mmult -mno-opts -mrepeat -ms -msatur -msdram -msim -msimnovec -mtf @gol
689 -mtiny=@var{n}}
691 @emph{MicroBlaze Options}
692 @gccoptlist{-msoft-float -mhard-float -msmall-divides -mcpu=@var{cpu} @gol
693 -mmemcpy -mxl-soft-mul -mxl-soft-div -mxl-barrel-shift @gol
694 -mxl-pattern-compare -mxl-stack-check -mxl-gp-opt -mno-clearbss @gol
695 -mxl-multiply-high -mxl-float-convert -mxl-float-sqrt @gol
696 -mxl-mode-@var{app-model}}
698 @emph{MIPS Options}
699 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
700 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2 @gol
701 -mips64  -mips64r2 @gol
702 -mips16  -mno-mips16  -mflip-mips16 @gol
703 -minterlink-mips16  -mno-interlink-mips16 @gol
704 -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
705 -mshared  -mno-shared  -mplt  -mno-plt  -mxgot  -mno-xgot @gol
706 -mgp32  -mgp64  -mfp32  -mfp64  -mhard-float  -msoft-float @gol
707 -msingle-float  -mdouble-float  -mdsp  -mno-dsp  -mdspr2  -mno-dspr2 @gol
708 -mfpu=@var{fpu-type} @gol
709 -msmartmips  -mno-smartmips @gol
710 -mpaired-single  -mno-paired-single  -mdmx  -mno-mdmx @gol
711 -mips3d  -mno-mips3d  -mmt  -mno-mt  -mllsc  -mno-llsc @gol
712 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
713 -G@var{num}  -mlocal-sdata  -mno-local-sdata @gol
714 -mextern-sdata  -mno-extern-sdata  -mgpopt  -mno-gopt @gol
715 -membedded-data  -mno-embedded-data @gol
716 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
717 -mcode-readable=@var{setting} @gol
718 -msplit-addresses  -mno-split-addresses @gol
719 -mexplicit-relocs  -mno-explicit-relocs @gol
720 -mcheck-zero-division  -mno-check-zero-division @gol
721 -mdivide-traps  -mdivide-breaks @gol
722 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
723 -mmad  -mno-mad  -mfused-madd  -mno-fused-madd  -nocpp @gol
724 -mfix-24k -mno-fix-24k @gol
725 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
726 -mfix-r10000 -mno-fix-r10000  -mfix-vr4120  -mno-fix-vr4120 @gol
727 -mfix-vr4130  -mno-fix-vr4130  -mfix-sb1  -mno-fix-sb1 @gol
728 -mflush-func=@var{func}  -mno-flush-func @gol
729 -mbranch-cost=@var{num}  -mbranch-likely  -mno-branch-likely @gol
730 -mfp-exceptions -mno-fp-exceptions @gol
731 -mvr4130-align -mno-vr4130-align -msynci -mno-synci @gol
732 -mrelax-pic-calls -mno-relax-pic-calls -mmcount-ra-address}
734 @emph{MMIX Options}
735 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
736 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
737 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
738 -mno-base-addresses  -msingle-exit  -mno-single-exit}
740 @emph{MN10300 Options}
741 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
742 -mno-am33 -mam33 -mam33-2 -mam34 @gol
743 -mtune=@var{cpu-type} @gol
744 -mreturn-pointer-on-d0 @gol
745 -mno-crt0  -mrelax -mliw -msetlb}
747 @emph{PDP-11 Options}
748 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
749 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
750 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
751 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
752 -mbranch-expensive  -mbranch-cheap @gol
753 -munix-asm  -mdec-asm}
755 @emph{picoChip Options}
756 @gccoptlist{-mae=@var{ae_type} -mvliw-lookahead=@var{N} @gol
757 -msymbol-as-address -mno-inefficient-warnings}
759 @emph{PowerPC Options}
760 See RS/6000 and PowerPC Options.
762 @emph{RS/6000 and PowerPC Options}
763 @gccoptlist{-mcpu=@var{cpu-type} @gol
764 -mtune=@var{cpu-type} @gol
765 -mcmodel=@var{code-model} @gol
766 -mpower  -mno-power  -mpower2  -mno-power2 @gol
767 -mpowerpc  -mpowerpc64  -mno-powerpc @gol
768 -maltivec  -mno-altivec @gol
769 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
770 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
771 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb -mpopcntd -mno-popcntd @gol
772 -mfprnd  -mno-fprnd @gol
773 -mcmpb -mno-cmpb -mmfpgpr -mno-mfpgpr -mhard-dfp -mno-hard-dfp @gol
774 -mnew-mnemonics  -mold-mnemonics @gol
775 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
776 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
777 -malign-power  -malign-natural @gol
778 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
779 -msingle-float -mdouble-float -msimple-fpu @gol
780 -mstring  -mno-string  -mupdate  -mno-update @gol
781 -mavoid-indexed-addresses  -mno-avoid-indexed-addresses @gol
782 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
783 -mstrict-align  -mno-strict-align  -mrelocatable @gol
784 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
785 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
786 -mdynamic-no-pic  -maltivec -mswdiv  -msingle-pic-base @gol
787 -mprioritize-restricted-insns=@var{priority} @gol
788 -msched-costly-dep=@var{dependence_type} @gol
789 -minsert-sched-nops=@var{scheme} @gol
790 -mcall-sysv  -mcall-netbsd @gol
791 -maix-struct-return  -msvr4-struct-return @gol
792 -mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
793 -mblock-move-inline-limit=@var{num} @gol
794 -misel -mno-isel @gol
795 -misel=yes  -misel=no @gol
796 -mspe -mno-spe @gol
797 -mspe=yes  -mspe=no @gol
798 -mpaired @gol
799 -mgen-cell-microcode -mwarn-cell-microcode @gol
800 -mvrsave -mno-vrsave @gol
801 -mmulhw -mno-mulhw @gol
802 -mdlmzb -mno-dlmzb @gol
803 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
804 -mprototype  -mno-prototype @gol
805 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
806 -msdata=@var{opt}  -mvxworks  -G @var{num}  -pthread @gol
807 -mrecip -mrecip=@var{opt} -mno-recip -mrecip-precision @gol
808 -mno-recip-precision @gol
809 -mveclibabi=@var{type} -mfriz -mno-friz}
811 @emph{RX Options}
812 @gccoptlist{-m64bit-doubles  -m32bit-doubles  -fpu  -nofpu@gol
813 -mcpu=@gol
814 -mbig-endian-data -mlittle-endian-data @gol
815 -msmall-data @gol
816 -msim  -mno-sim@gol
817 -mas100-syntax -mno-as100-syntax@gol
818 -mrelax@gol
819 -mmax-constant-size=@gol
820 -mint-register=@gol
821 -msave-acc-in-interrupts}
823 @emph{S/390 and zSeries Options}
824 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
825 -mhard-float  -msoft-float  -mhard-dfp -mno-hard-dfp @gol
826 -mlong-double-64 -mlong-double-128 @gol
827 -mbackchain  -mno-backchain -mpacked-stack  -mno-packed-stack @gol
828 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
829 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
830 -mtpf-trace -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
831 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size -mstack-guard}
833 @emph{Score Options}
834 @gccoptlist{-meb -mel @gol
835 -mnhwloop @gol
836 -muls @gol
837 -mmac @gol
838 -mscore5 -mscore5u -mscore7 -mscore7d}
840 @emph{SH Options}
841 @gccoptlist{-m1  -m2  -m2e @gol
842 -m2a-nofpu -m2a-single-only -m2a-single -m2a @gol
843 -m3  -m3e @gol
844 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
845 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol
846 -m5-64media  -m5-64media-nofpu @gol
847 -m5-32media  -m5-32media-nofpu @gol
848 -m5-compact  -m5-compact-nofpu @gol
849 -mb  -ml  -mdalign  -mrelax @gol
850 -mbigtable -mfmovd -mhitachi -mrenesas -mno-renesas -mnomacsave @gol
851 -mieee  -mbitops  -misize  -minline-ic_invalidate -mpadstruct  -mspace @gol
852 -mprefergot  -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
853 -mdivsi3_libfunc=@var{name} -mfixed-range=@var{register-range} @gol
854 -madjust-unroll -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol
855 -maccumulate-outgoing-args -minvalid-symbols}
857 @emph{Solaris 2 Options}
858 @gccoptlist{-mimpure-text  -mno-impure-text @gol
859 -pthreads -pthread}
861 @emph{SPARC Options}
862 @gccoptlist{-mcpu=@var{cpu-type} @gol
863 -mtune=@var{cpu-type} @gol
864 -mcmodel=@var{code-model} @gol
865 -m32  -m64  -mapp-regs  -mno-app-regs @gol
866 -mfaster-structs  -mno-faster-structs @gol
867 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
868 -mhard-quad-float  -msoft-quad-float @gol
869 -mlittle-endian @gol
870 -mstack-bias  -mno-stack-bias @gol
871 -munaligned-doubles  -mno-unaligned-doubles @gol
872 -mv8plus  -mno-v8plus  -mvis  -mno-vis}
874 @emph{SPU Options}
875 @gccoptlist{-mwarn-reloc -merror-reloc @gol
876 -msafe-dma -munsafe-dma @gol
877 -mbranch-hints @gol
878 -msmall-mem -mlarge-mem -mstdmain @gol
879 -mfixed-range=@var{register-range} @gol
880 -mea32 -mea64 @gol
881 -maddress-space-conversion -mno-address-space-conversion @gol
882 -mcache-size=@var{cache-size} @gol
883 -matomic-updates -mno-atomic-updates}
885 @emph{System V Options}
886 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
888 @emph{V850 Options}
889 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
890 -mprolog-function  -mno-prolog-function  -mspace @gol
891 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
892 -mapp-regs  -mno-app-regs @gol
893 -mdisable-callt  -mno-disable-callt @gol
894 -mv850e2v3 @gol
895 -mv850e2 @gol
896 -mv850e1 -mv850es @gol
897 -mv850e @gol
898 -mv850  -mbig-switch}
900 @emph{VAX Options}
901 @gccoptlist{-mg  -mgnu  -munix}
903 @emph{VxWorks Options}
904 @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
905 -Xbind-lazy  -Xbind-now}
907 @emph{x86-64 Options}
908 See i386 and x86-64 Options.
910 @emph{Xstormy16 Options}
911 @gccoptlist{-msim}
913 @emph{Xtensa Options}
914 @gccoptlist{-mconst16 -mno-const16 @gol
915 -mfused-madd  -mno-fused-madd @gol
916 -mforce-no-pic @gol
917 -mserialize-volatile  -mno-serialize-volatile @gol
918 -mtext-section-literals  -mno-text-section-literals @gol
919 -mtarget-align  -mno-target-align @gol
920 -mlongcalls  -mno-longcalls}
922 @emph{zSeries Options}
923 See S/390 and zSeries Options.
925 @item Code Generation Options
926 @xref{Code Gen Options,,Options for Code Generation Conventions}.
927 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
928 -ffixed-@var{reg}  -fexceptions @gol
929 -fnon-call-exceptions  -funwind-tables @gol
930 -fasynchronous-unwind-tables @gol
931 -finhibit-size-directive  -finstrument-functions @gol
932 -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol
933 -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{} @gol
934 -fno-common  -fno-ident @gol
935 -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE @gol
936 -fno-jump-tables @gol
937 -frecord-gcc-switches @gol
938 -freg-struct-return  -fshort-enums @gol
939 -fshort-double  -fshort-wchar @gol
940 -fverbose-asm  -fpack-struct[=@var{n}]  -fstack-check @gol
941 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
942 -fno-stack-limit -fsplit-stack @gol
943 -fleading-underscore  -ftls-model=@var{model} @gol
944 -ftrapv  -fwrapv  -fbounds-check @gol
945 -fvisibility -fstrict-volatile-bitfields}
946 @end table
948 @menu
949 * Overall Options::     Controlling the kind of output:
950                         an executable, object files, assembler files,
951                         or preprocessed source.
952 * C Dialect Options::   Controlling the variant of C language compiled.
953 * C++ Dialect Options:: Variations on C++.
954 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
955                         and Objective-C++.
956 * Language Independent Options:: Controlling how diagnostics should be
957                         formatted.
958 * Warning Options::     How picky should the compiler be?
959 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
960 * Optimize Options::    How much optimization?
961 * Preprocessor Options:: Controlling header files and macro definitions.
962                          Also, getting dependency information for Make.
963 * Assembler Options::   Passing options to the assembler.
964 * Link Options::        Specifying libraries and so on.
965 * Directory Options::   Where to find header files and libraries.
966                         Where to find the compiler executable files.
967 * Spec Files::          How to pass switches to sub-processes.
968 * Target Options::      Running a cross-compiler, or an old version of GCC.
969 @end menu
971 @node Overall Options
972 @section Options Controlling the Kind of Output
974 Compilation can involve up to four stages: preprocessing, compilation
975 proper, assembly and linking, always in that order.  GCC is capable of
976 preprocessing and compiling several files either into several
977 assembler input files, or into one assembler input file; then each
978 assembler input file produces an object file, and linking combines all
979 the object files (those newly compiled, and those specified as input)
980 into an executable file.
982 @cindex file name suffix
983 For any given input file, the file name suffix determines what kind of
984 compilation is done:
986 @table @gcctabopt
987 @item @var{file}.c
988 C source code which must be preprocessed.
990 @item @var{file}.i
991 C source code which should not be preprocessed.
993 @item @var{file}.ii
994 C++ source code which should not be preprocessed.
996 @item @var{file}.m
997 Objective-C source code.  Note that you must link with the @file{libobjc}
998 library to make an Objective-C program work.
1000 @item @var{file}.mi
1001 Objective-C source code which should not be preprocessed.
1003 @item @var{file}.mm
1004 @itemx @var{file}.M
1005 Objective-C++ source code.  Note that you must link with the @file{libobjc}
1006 library to make an Objective-C++ program work.  Note that @samp{.M} refers
1007 to a literal capital M@.
1009 @item @var{file}.mii
1010 Objective-C++ source code which should not be preprocessed.
1012 @item @var{file}.h
1013 C, C++, Objective-C or Objective-C++ header file to be turned into a
1014 precompiled header (default), or C, C++ header file to be turned into an
1015 Ada spec (via the @option{-fdump-ada-spec} switch).
1017 @item @var{file}.cc
1018 @itemx @var{file}.cp
1019 @itemx @var{file}.cxx
1020 @itemx @var{file}.cpp
1021 @itemx @var{file}.CPP
1022 @itemx @var{file}.c++
1023 @itemx @var{file}.C
1024 C++ source code which must be preprocessed.  Note that in @samp{.cxx},
1025 the last two letters must both be literally @samp{x}.  Likewise,
1026 @samp{.C} refers to a literal capital C@.
1028 @item @var{file}.mm
1029 @itemx @var{file}.M
1030 Objective-C++ source code which must be preprocessed.
1032 @item @var{file}.mii
1033 Objective-C++ source code which should not be preprocessed.
1035 @item @var{file}.hh
1036 @itemx @var{file}.H
1037 @itemx @var{file}.hp
1038 @itemx @var{file}.hxx
1039 @itemx @var{file}.hpp
1040 @itemx @var{file}.HPP
1041 @itemx @var{file}.h++
1042 @itemx @var{file}.tcc
1043 C++ header file to be turned into a precompiled header or Ada spec.
1045 @item @var{file}.f
1046 @itemx @var{file}.for
1047 @itemx @var{file}.ftn
1048 Fixed form Fortran source code which should not be preprocessed.
1050 @item @var{file}.F
1051 @itemx @var{file}.FOR
1052 @itemx @var{file}.fpp
1053 @itemx @var{file}.FPP
1054 @itemx @var{file}.FTN
1055 Fixed form Fortran source code which must be preprocessed (with the traditional
1056 preprocessor).
1058 @item @var{file}.f90
1059 @itemx @var{file}.f95
1060 @itemx @var{file}.f03
1061 @itemx @var{file}.f08
1062 Free form Fortran source code which should not be preprocessed.
1064 @item @var{file}.F90
1065 @itemx @var{file}.F95
1066 @itemx @var{file}.F03
1067 @itemx @var{file}.F08
1068 Free form Fortran source code which must be preprocessed (with the
1069 traditional preprocessor).
1071 @item @var{file}.go
1072 Go source code.
1074 @c FIXME: Descriptions of Java file types.
1075 @c @var{file}.java
1076 @c @var{file}.class
1077 @c @var{file}.zip
1078 @c @var{file}.jar
1080 @item @var{file}.ads
1081 Ada source code file which contains a library unit declaration (a
1082 declaration of a package, subprogram, or generic, or a generic
1083 instantiation), or a library unit renaming declaration (a package,
1084 generic, or subprogram renaming declaration).  Such files are also
1085 called @dfn{specs}.
1087 @item @var{file}.adb
1088 Ada source code file containing a library unit body (a subprogram or
1089 package body).  Such files are also called @dfn{bodies}.
1091 @c GCC also knows about some suffixes for languages not yet included:
1092 @c Pascal:
1093 @c @var{file}.p
1094 @c @var{file}.pas
1095 @c Ratfor:
1096 @c @var{file}.r
1098 @item @var{file}.s
1099 Assembler code.
1101 @item @var{file}.S
1102 @itemx @var{file}.sx
1103 Assembler code which must be preprocessed.
1105 @item @var{other}
1106 An object file to be fed straight into linking.
1107 Any file name with no recognized suffix is treated this way.
1108 @end table
1110 @opindex x
1111 You can specify the input language explicitly with the @option{-x} option:
1113 @table @gcctabopt
1114 @item -x @var{language}
1115 Specify explicitly the @var{language} for the following input files
1116 (rather than letting the compiler choose a default based on the file
1117 name suffix).  This option applies to all following input files until
1118 the next @option{-x} option.  Possible values for @var{language} are:
1119 @smallexample
1120 c  c-header  cpp-output
1121 c++  c++-header  c++-cpp-output
1122 objective-c  objective-c-header  objective-c-cpp-output
1123 objective-c++ objective-c++-header objective-c++-cpp-output
1124 assembler  assembler-with-cpp
1126 f77  f77-cpp-input f95  f95-cpp-input
1128 java
1129 @end smallexample
1131 @item -x none
1132 Turn off any specification of a language, so that subsequent files are
1133 handled according to their file name suffixes (as they are if @option{-x}
1134 has not been used at all).
1136 @item -pass-exit-codes
1137 @opindex pass-exit-codes
1138 Normally the @command{gcc} program will exit with the code of 1 if any
1139 phase of the compiler returns a non-success return code.  If you specify
1140 @option{-pass-exit-codes}, the @command{gcc} program will instead return with
1141 numerically highest error produced by any phase that returned an error
1142 indication.  The C, C++, and Fortran frontends return 4, if an internal
1143 compiler error is encountered.
1144 @end table
1146 If you only want some of the stages of compilation, you can use
1147 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
1148 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
1149 @command{gcc} is to stop.  Note that some combinations (for example,
1150 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
1152 @table @gcctabopt
1153 @item -c
1154 @opindex c
1155 Compile or assemble the source files, but do not link.  The linking
1156 stage simply is not done.  The ultimate output is in the form of an
1157 object file for each source file.
1159 By default, the object file name for a source file is made by replacing
1160 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1162 Unrecognized input files, not requiring compilation or assembly, are
1163 ignored.
1165 @item -S
1166 @opindex S
1167 Stop after the stage of compilation proper; do not assemble.  The output
1168 is in the form of an assembler code file for each non-assembler input
1169 file specified.
1171 By default, the assembler file name for a source file is made by
1172 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1174 Input files that don't require compilation are ignored.
1176 @item -E
1177 @opindex E
1178 Stop after the preprocessing stage; do not run the compiler proper.  The
1179 output is in the form of preprocessed source code, which is sent to the
1180 standard output.
1182 Input files which don't require preprocessing are ignored.
1184 @cindex output file option
1185 @item -o @var{file}
1186 @opindex o
1187 Place output in file @var{file}.  This applies regardless to whatever
1188 sort of output is being produced, whether it be an executable file,
1189 an object file, an assembler file or preprocessed C code.
1191 If @option{-o} is not specified, the default is to put an executable
1192 file in @file{a.out}, the object file for
1193 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1194 assembler file in @file{@var{source}.s}, a precompiled header file in
1195 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1196 standard output.
1198 @item -v
1199 @opindex v
1200 Print (on standard error output) the commands executed to run the stages
1201 of compilation.  Also print the version number of the compiler driver
1202 program and of the preprocessor and the compiler proper.
1204 @item -###
1205 @opindex ###
1206 Like @option{-v} except the commands are not executed and arguments
1207 are quoted unless they contain only alphanumeric characters or @code{./-_}.
1208 This is useful for shell scripts to capture the driver-generated command lines.
1210 @item -pipe
1211 @opindex pipe
1212 Use pipes rather than temporary files for communication between the
1213 various stages of compilation.  This fails to work on some systems where
1214 the assembler is unable to read from a pipe; but the GNU assembler has
1215 no trouble.
1217 @item --help
1218 @opindex help
1219 Print (on the standard output) a description of the command line options
1220 understood by @command{gcc}.  If the @option{-v} option is also specified
1221 then @option{--help} will also be passed on to the various processes
1222 invoked by @command{gcc}, so that they can display the command line options
1223 they accept.  If the @option{-Wextra} option has also been specified
1224 (prior to the @option{--help} option), then command line options which
1225 have no documentation associated with them will also be displayed.
1227 @item --target-help
1228 @opindex target-help
1229 Print (on the standard output) a description of target-specific command
1230 line options for each tool.  For some targets extra target-specific
1231 information may also be printed.
1233 @item --help=@{@var{class}@r{|[}^@r{]}@var{qualifier}@}@r{[},@dots{}@r{]}
1234 Print (on the standard output) a description of the command line
1235 options understood by the compiler that fit into all specified classes
1236 and qualifiers.  These are the supported classes:
1238 @table @asis
1239 @item @samp{optimizers}
1240 This will display all of the optimization options supported by the
1241 compiler.
1243 @item @samp{warnings}
1244 This will display all of the options controlling warning messages
1245 produced by the compiler.
1247 @item @samp{target}
1248 This will display target-specific options.  Unlike the
1249 @option{--target-help} option however, target-specific options of the
1250 linker and assembler will not be displayed.  This is because those
1251 tools do not currently support the extended @option{--help=} syntax.
1253 @item @samp{params}
1254 This will display the values recognized by the @option{--param}
1255 option.
1257 @item @var{language}
1258 This will display the options supported for @var{language}, where
1259 @var{language} is the name of one of the languages supported in this
1260 version of GCC.
1262 @item @samp{common}
1263 This will display the options that are common to all languages.
1264 @end table
1266 These are the supported qualifiers:
1268 @table @asis
1269 @item @samp{undocumented}
1270 Display only those options which are undocumented.
1272 @item @samp{joined}
1273 Display options which take an argument that appears after an equal
1274 sign in the same continuous piece of text, such as:
1275 @samp{--help=target}.
1277 @item @samp{separate}
1278 Display options which take an argument that appears as a separate word
1279 following the original option, such as: @samp{-o output-file}.
1280 @end table
1282 Thus for example to display all the undocumented target-specific
1283 switches supported by the compiler the following can be used:
1285 @smallexample
1286 --help=target,undocumented
1287 @end smallexample
1289 The sense of a qualifier can be inverted by prefixing it with the
1290 @samp{^} character, so for example to display all binary warning
1291 options (i.e., ones that are either on or off and that do not take an
1292 argument), which have a description the following can be used:
1294 @smallexample
1295 --help=warnings,^joined,^undocumented
1296 @end smallexample
1298 The argument to @option{--help=} should not consist solely of inverted
1299 qualifiers.
1301 Combining several classes is possible, although this usually
1302 restricts the output by so much that there is nothing to display.  One
1303 case where it does work however is when one of the classes is
1304 @var{target}.  So for example to display all the target-specific
1305 optimization options the following can be used:
1307 @smallexample
1308 --help=target,optimizers
1309 @end smallexample
1311 The @option{--help=} option can be repeated on the command line.  Each
1312 successive use will display its requested class of options, skipping
1313 those that have already been displayed.
1315 If the @option{-Q} option appears on the command line before the
1316 @option{--help=} option, then the descriptive text displayed by
1317 @option{--help=} is changed.  Instead of describing the displayed
1318 options, an indication is given as to whether the option is enabled,
1319 disabled or set to a specific value (assuming that the compiler
1320 knows this at the point where the @option{--help=} option is used).
1322 Here is a truncated example from the ARM port of @command{gcc}:
1324 @smallexample
1325   % gcc -Q -mabi=2 --help=target -c
1326   The following options are target specific:
1327   -mabi=                                2
1328   -mabort-on-noreturn                   [disabled]
1329   -mapcs                                [disabled]
1330 @end smallexample
1332 The output is sensitive to the effects of previous command line
1333 options, so for example it is possible to find out which optimizations
1334 are enabled at @option{-O2} by using:
1336 @smallexample
1337 -Q -O2 --help=optimizers
1338 @end smallexample
1340 Alternatively you can discover which binary optimizations are enabled
1341 by @option{-O3} by using:
1343 @smallexample
1344 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1345 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1346 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1347 @end smallexample
1349 @item -no-canonical-prefixes
1350 @opindex no-canonical-prefixes
1351 Do not expand any symbolic links, resolve references to @samp{/../}
1352 or @samp{/./}, or make the path absolute when generating a relative
1353 prefix.
1355 @item --version
1356 @opindex version
1357 Display the version number and copyrights of the invoked GCC@.
1359 @item -wrapper
1360 @opindex wrapper
1361 Invoke all subcommands under a wrapper program.  The name of the
1362 wrapper program and its parameters are passed as a comma separated
1363 list.
1365 @smallexample
1366 gcc -c t.c -wrapper gdb,--args
1367 @end smallexample
1369 This will invoke all subprograms of @command{gcc} under
1370 @samp{gdb --args}, thus the invocation of @command{cc1} will be
1371 @samp{gdb --args cc1 @dots{}}.
1373 @item -fplugin=@var{name}.so
1374 Load the plugin code in file @var{name}.so, assumed to be a
1375 shared object to be dlopen'd by the compiler.  The base name of
1376 the shared object file is used to identify the plugin for the
1377 purposes of argument parsing (See
1378 @option{-fplugin-arg-@var{name}-@var{key}=@var{value}} below).
1379 Each plugin should define the callback functions specified in the
1380 Plugins API.
1382 @item -fplugin-arg-@var{name}-@var{key}=@var{value}
1383 Define an argument called @var{key} with a value of @var{value}
1384 for the plugin called @var{name}.
1386 @item -fdump-ada-spec@r{[}-slim@r{]}
1387 For C and C++ source and include files, generate corresponding Ada
1388 specs. @xref{Generating Ada Bindings for C and C++ headers,,, gnat_ugn,
1389 GNAT User's Guide}, which provides detailed documentation on this feature.
1391 @item -fdump-go-spec=@var{file}
1392 For input files in any language, generate corresponding Go
1393 declarations in @var{file}.  This generates Go @code{const},
1394 @code{type}, @code{var}, and @code{func} declarations which may be a
1395 useful way to start writing a Go interface to code written in some
1396 other language.
1398 @include @value{srcdir}/../libiberty/at-file.texi
1399 @end table
1401 @node Invoking G++
1402 @section Compiling C++ Programs
1404 @cindex suffixes for C++ source
1405 @cindex C++ source file suffixes
1406 C++ source files conventionally use one of the suffixes @samp{.C},
1407 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1408 @samp{.cxx}; C++ header files often use @samp{.hh}, @samp{.hpp},
1409 @samp{.H}, or (for shared template code) @samp{.tcc}; and
1410 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1411 files with these names and compiles them as C++ programs even if you
1412 call the compiler the same way as for compiling C programs (usually
1413 with the name @command{gcc}).
1415 @findex g++
1416 @findex c++
1417 However, the use of @command{gcc} does not add the C++ library.
1418 @command{g++} is a program that calls GCC and treats @samp{.c},
1419 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1420 files unless @option{-x} is used, and automatically specifies linking
1421 against the C++ library.  This program is also useful when
1422 precompiling a C header file with a @samp{.h} extension for use in C++
1423 compilations.  On many systems, @command{g++} is also installed with
1424 the name @command{c++}.
1426 @cindex invoking @command{g++}
1427 When you compile C++ programs, you may specify many of the same
1428 command-line options that you use for compiling programs in any
1429 language; or command-line options meaningful for C and related
1430 languages; or options that are meaningful only for C++ programs.
1431 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1432 explanations of options for languages related to C@.
1433 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1434 explanations of options that are meaningful only for C++ programs.
1436 @node C Dialect Options
1437 @section Options Controlling C Dialect
1438 @cindex dialect options
1439 @cindex language dialect options
1440 @cindex options, dialect
1442 The following options control the dialect of C (or languages derived
1443 from C, such as C++, Objective-C and Objective-C++) that the compiler
1444 accepts:
1446 @table @gcctabopt
1447 @cindex ANSI support
1448 @cindex ISO support
1449 @item -ansi
1450 @opindex ansi
1451 In C mode, this is equivalent to @samp{-std=c90}. In C++ mode, it is
1452 equivalent to @samp{-std=c++98}.
1454 This turns off certain features of GCC that are incompatible with ISO
1455 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1456 such as the @code{asm} and @code{typeof} keywords, and
1457 predefined macros such as @code{unix} and @code{vax} that identify the
1458 type of system you are using.  It also enables the undesirable and
1459 rarely used ISO trigraph feature.  For the C compiler,
1460 it disables recognition of C++ style @samp{//} comments as well as
1461 the @code{inline} keyword.
1463 The alternate keywords @code{__asm__}, @code{__extension__},
1464 @code{__inline__} and @code{__typeof__} continue to work despite
1465 @option{-ansi}.  You would not want to use them in an ISO C program, of
1466 course, but it is useful to put them in header files that might be included
1467 in compilations done with @option{-ansi}.  Alternate predefined macros
1468 such as @code{__unix__} and @code{__vax__} are also available, with or
1469 without @option{-ansi}.
1471 The @option{-ansi} option does not cause non-ISO programs to be
1472 rejected gratuitously.  For that, @option{-pedantic} is required in
1473 addition to @option{-ansi}.  @xref{Warning Options}.
1475 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1476 option is used.  Some header files may notice this macro and refrain
1477 from declaring certain functions or defining certain macros that the
1478 ISO standard doesn't call for; this is to avoid interfering with any
1479 programs that might use these names for other things.
1481 Functions that would normally be built in but do not have semantics
1482 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1483 functions when @option{-ansi} is used.  @xref{Other Builtins,,Other
1484 built-in functions provided by GCC}, for details of the functions
1485 affected.
1487 @item -std=
1488 @opindex std
1489 Determine the language standard. @xref{Standards,,Language Standards
1490 Supported by GCC}, for details of these standard versions.  This option
1491 is currently only supported when compiling C or C++.
1493 The compiler can accept several base standards, such as @samp{c90} or
1494 @samp{c++98}, and GNU dialects of those standards, such as
1495 @samp{gnu90} or @samp{gnu++98}.  By specifying a base standard, the
1496 compiler will accept all programs following that standard and those
1497 using GNU extensions that do not contradict it.  For example,
1498 @samp{-std=c90} turns off certain features of GCC that are
1499 incompatible with ISO C90, such as the @code{asm} and @code{typeof}
1500 keywords, but not other GNU extensions that do not have a meaning in
1501 ISO C90, such as omitting the middle term of a @code{?:}
1502 expression. On the other hand, by specifying a GNU dialect of a
1503 standard, all features the compiler support are enabled, even when
1504 those features change the meaning of the base standard and some
1505 strict-conforming programs may be rejected.  The particular standard
1506 is used by @option{-pedantic} to identify which features are GNU
1507 extensions given that version of the standard. For example
1508 @samp{-std=gnu90 -pedantic} would warn about C++ style @samp{//}
1509 comments, while @samp{-std=gnu99 -pedantic} would not.
1511 A value for this option must be provided; possible values are
1513 @table @samp
1514 @item c90
1515 @itemx c89
1516 @itemx iso9899:1990
1517 Support all ISO C90 programs (certain GNU extensions that conflict
1518 with ISO C90 are disabled). Same as @option{-ansi} for C code.
1520 @item iso9899:199409
1521 ISO C90 as modified in amendment 1.
1523 @item c99
1524 @itemx c9x
1525 @itemx iso9899:1999
1526 @itemx iso9899:199x
1527 ISO C99.  Note that this standard is not yet fully supported; see
1528 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1529 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1531 @item c1x
1532 ISO C1X, the draft of the next revision of the ISO C standard.
1533 Support is limited and experimental and features enabled by this
1534 option may be changed or removed if changed in or removed from the
1535 standard draft.
1537 @item gnu90
1538 @itemx gnu89
1539 GNU dialect of ISO C90 (including some C99 features). This
1540 is the default for C code.
1542 @item gnu99
1543 @itemx gnu9x
1544 GNU dialect of ISO C99.  When ISO C99 is fully implemented in GCC,
1545 this will become the default.  The name @samp{gnu9x} is deprecated.
1547 @item gnu1x
1548 GNU dialect of ISO C1X.  Support is limited and experimental and
1549 features enabled by this option may be changed or removed if changed
1550 in or removed from the standard draft.
1552 @item c++98
1553 The 1998 ISO C++ standard plus amendments. Same as @option{-ansi} for
1554 C++ code.
1556 @item gnu++98
1557 GNU dialect of @option{-std=c++98}.  This is the default for
1558 C++ code.
1560 @item c++0x
1561 The working draft of the upcoming ISO C++0x standard. This option
1562 enables experimental features that are likely to be included in
1563 C++0x. The working draft is constantly changing, and any feature that is
1564 enabled by this flag may be removed from future versions of GCC if it is
1565 not part of the C++0x standard.
1567 @item gnu++0x
1568 GNU dialect of @option{-std=c++0x}. This option enables
1569 experimental features that may be removed in future versions of GCC.
1570 @end table
1572 @item -fgnu89-inline
1573 @opindex fgnu89-inline
1574 The option @option{-fgnu89-inline} tells GCC to use the traditional
1575 GNU semantics for @code{inline} functions when in C99 mode.
1576 @xref{Inline,,An Inline Function is As Fast As a Macro}.  This option
1577 is accepted and ignored by GCC versions 4.1.3 up to but not including
1578 4.3.  In GCC versions 4.3 and later it changes the behavior of GCC in
1579 C99 mode.  Using this option is roughly equivalent to adding the
1580 @code{gnu_inline} function attribute to all inline functions
1581 (@pxref{Function Attributes}).
1583 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
1584 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
1585 specifies the default behavior).  This option was first supported in
1586 GCC 4.3.  This option is not supported in @option{-std=c90} or
1587 @option{-std=gnu90} mode.
1589 The preprocessor macros @code{__GNUC_GNU_INLINE__} and
1590 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
1591 in effect for @code{inline} functions.  @xref{Common Predefined
1592 Macros,,,cpp,The C Preprocessor}.
1594 @item -aux-info @var{filename}
1595 @opindex aux-info
1596 Output to the given filename prototyped declarations for all functions
1597 declared and/or defined in a translation unit, including those in header
1598 files.  This option is silently ignored in any language other than C@.
1600 Besides declarations, the file indicates, in comments, the origin of
1601 each declaration (source file and line), whether the declaration was
1602 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1603 @samp{O} for old, respectively, in the first character after the line
1604 number and the colon), and whether it came from a declaration or a
1605 definition (@samp{C} or @samp{F}, respectively, in the following
1606 character).  In the case of function definitions, a K&R-style list of
1607 arguments followed by their declarations is also provided, inside
1608 comments, after the declaration.
1610 @item -fno-asm
1611 @opindex fno-asm
1612 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1613 keyword, so that code can use these words as identifiers.  You can use
1614 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1615 instead.  @option{-ansi} implies @option{-fno-asm}.
1617 In C++, this switch only affects the @code{typeof} keyword, since
1618 @code{asm} and @code{inline} are standard keywords.  You may want to
1619 use the @option{-fno-gnu-keywords} flag instead, which has the same
1620 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1621 switch only affects the @code{asm} and @code{typeof} keywords, since
1622 @code{inline} is a standard keyword in ISO C99.
1624 @item -fno-builtin
1625 @itemx -fno-builtin-@var{function}
1626 @opindex fno-builtin
1627 @cindex built-in functions
1628 Don't recognize built-in functions that do not begin with
1629 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1630 functions provided by GCC}, for details of the functions affected,
1631 including those which are not built-in functions when @option{-ansi} or
1632 @option{-std} options for strict ISO C conformance are used because they
1633 do not have an ISO standard meaning.
1635 GCC normally generates special code to handle certain built-in functions
1636 more efficiently; for instance, calls to @code{alloca} may become single
1637 instructions that adjust the stack directly, and calls to @code{memcpy}
1638 may become inline copy loops.  The resulting code is often both smaller
1639 and faster, but since the function calls no longer appear as such, you
1640 cannot set a breakpoint on those calls, nor can you change the behavior
1641 of the functions by linking with a different library.  In addition,
1642 when a function is recognized as a built-in function, GCC may use
1643 information about that function to warn about problems with calls to
1644 that function, or to generate more efficient code, even if the
1645 resulting code still contains calls to that function.  For example,
1646 warnings are given with @option{-Wformat} for bad calls to
1647 @code{printf}, when @code{printf} is built in, and @code{strlen} is
1648 known not to modify global memory.
1650 With the @option{-fno-builtin-@var{function}} option
1651 only the built-in function @var{function} is
1652 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1653 function is named that is not built-in in this version of GCC, this
1654 option is ignored.  There is no corresponding
1655 @option{-fbuiltin-@var{function}} option; if you wish to enable
1656 built-in functions selectively when using @option{-fno-builtin} or
1657 @option{-ffreestanding}, you may define macros such as:
1659 @smallexample
1660 #define abs(n)          __builtin_abs ((n))
1661 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1662 @end smallexample
1664 @item -fhosted
1665 @opindex fhosted
1666 @cindex hosted environment
1668 Assert that compilation takes place in a hosted environment.  This implies
1669 @option{-fbuiltin}.  A hosted environment is one in which the
1670 entire standard library is available, and in which @code{main} has a return
1671 type of @code{int}.  Examples are nearly everything except a kernel.
1672 This is equivalent to @option{-fno-freestanding}.
1674 @item -ffreestanding
1675 @opindex ffreestanding
1676 @cindex hosted environment
1678 Assert that compilation takes place in a freestanding environment.  This
1679 implies @option{-fno-builtin}.  A freestanding environment
1680 is one in which the standard library may not exist, and program startup may
1681 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1682 This is equivalent to @option{-fno-hosted}.
1684 @xref{Standards,,Language Standards Supported by GCC}, for details of
1685 freestanding and hosted environments.
1687 @item -fopenmp
1688 @opindex fopenmp
1689 @cindex OpenMP parallel
1690 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
1691 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
1692 compiler generates parallel code according to the OpenMP Application
1693 Program Interface v3.0 @w{@uref{http://www.openmp.org/}}.  This option
1694 implies @option{-pthread}, and thus is only supported on targets that
1695 have support for @option{-pthread}.
1697 @item -fms-extensions
1698 @opindex fms-extensions
1699 Accept some non-standard constructs used in Microsoft header files.
1701 In C++ code, this allows member names in structures to be similar
1702 to previous types declarations.
1704 @smallexample
1705 typedef int UOW;
1706 struct ABC @{
1707   UOW UOW;
1709 @end smallexample
1711 Some cases of unnamed fields in structures and unions are only
1712 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
1713 fields within structs/unions}, for details.
1715 @item -fplan9-extensions
1716 Accept some non-standard constructs used in Plan 9 code.
1718 This enables @option{-fms-extensions}, permits passing pointers to
1719 structures with anonymous fields to functions which expect pointers to
1720 elements of the type of the field, and permits referring to anonymous
1721 fields declared using a typedef.  @xref{Unnamed Fields,,Unnamed
1722 struct/union fields within structs/unions}, for details.  This is only
1723 supported for C, not C++.
1725 @item -trigraphs
1726 @opindex trigraphs
1727 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
1728 options for strict ISO C conformance) implies @option{-trigraphs}.
1730 @item -no-integrated-cpp
1731 @opindex no-integrated-cpp
1732 Performs a compilation in two passes: preprocessing and compiling.  This
1733 option allows a user supplied "cc1", "cc1plus", or "cc1obj" via the
1734 @option{-B} option.  The user supplied compilation step can then add in
1735 an additional preprocessing step after normal preprocessing but before
1736 compiling.  The default is to use the integrated cpp (internal cpp)
1738 The semantics of this option will change if "cc1", "cc1plus", and
1739 "cc1obj" are merged.
1741 @cindex traditional C language
1742 @cindex C language, traditional
1743 @item -traditional
1744 @itemx -traditional-cpp
1745 @opindex traditional-cpp
1746 @opindex traditional
1747 Formerly, these options caused GCC to attempt to emulate a pre-standard
1748 C compiler.  They are now only supported with the @option{-E} switch.
1749 The preprocessor continues to support a pre-standard mode.  See the GNU
1750 CPP manual for details.
1752 @item -fcond-mismatch
1753 @opindex fcond-mismatch
1754 Allow conditional expressions with mismatched types in the second and
1755 third arguments.  The value of such an expression is void.  This option
1756 is not supported for C++.
1758 @item -flax-vector-conversions
1759 @opindex flax-vector-conversions
1760 Allow implicit conversions between vectors with differing numbers of
1761 elements and/or incompatible element types.  This option should not be
1762 used for new code.
1764 @item -funsigned-char
1765 @opindex funsigned-char
1766 Let the type @code{char} be unsigned, like @code{unsigned char}.
1768 Each kind of machine has a default for what @code{char} should
1769 be.  It is either like @code{unsigned char} by default or like
1770 @code{signed char} by default.
1772 Ideally, a portable program should always use @code{signed char} or
1773 @code{unsigned char} when it depends on the signedness of an object.
1774 But many programs have been written to use plain @code{char} and
1775 expect it to be signed, or expect it to be unsigned, depending on the
1776 machines they were written for.  This option, and its inverse, let you
1777 make such a program work with the opposite default.
1779 The type @code{char} is always a distinct type from each of
1780 @code{signed char} or @code{unsigned char}, even though its behavior
1781 is always just like one of those two.
1783 @item -fsigned-char
1784 @opindex fsigned-char
1785 Let the type @code{char} be signed, like @code{signed char}.
1787 Note that this is equivalent to @option{-fno-unsigned-char}, which is
1788 the negative form of @option{-funsigned-char}.  Likewise, the option
1789 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
1791 @item -fsigned-bitfields
1792 @itemx -funsigned-bitfields
1793 @itemx -fno-signed-bitfields
1794 @itemx -fno-unsigned-bitfields
1795 @opindex fsigned-bitfields
1796 @opindex funsigned-bitfields
1797 @opindex fno-signed-bitfields
1798 @opindex fno-unsigned-bitfields
1799 These options control whether a bit-field is signed or unsigned, when the
1800 declaration does not use either @code{signed} or @code{unsigned}.  By
1801 default, such a bit-field is signed, because this is consistent: the
1802 basic integer types such as @code{int} are signed types.
1803 @end table
1805 @node C++ Dialect Options
1806 @section Options Controlling C++ Dialect
1808 @cindex compiler options, C++
1809 @cindex C++ options, command line
1810 @cindex options, C++
1811 This section describes the command-line options that are only meaningful
1812 for C++ programs; but you can also use most of the GNU compiler options
1813 regardless of what language your program is in.  For example, you
1814 might compile a file @code{firstClass.C} like this:
1816 @smallexample
1817 g++ -g -frepo -O -c firstClass.C
1818 @end smallexample
1820 @noindent
1821 In this example, only @option{-frepo} is an option meant
1822 only for C++ programs; you can use the other options with any
1823 language supported by GCC@.
1825 Here is a list of options that are @emph{only} for compiling C++ programs:
1827 @table @gcctabopt
1829 @item -fabi-version=@var{n}
1830 @opindex fabi-version
1831 Use version @var{n} of the C++ ABI@.  Version 2 is the version of the
1832 C++ ABI that first appeared in G++ 3.4.  Version 1 is the version of
1833 the C++ ABI that first appeared in G++ 3.2.  Version 0 will always be
1834 the version that conforms most closely to the C++ ABI specification.
1835 Therefore, the ABI obtained using version 0 will change as ABI bugs
1836 are fixed.
1838 The default is version 2.
1840 Version 3 corrects an error in mangling a constant address as a
1841 template argument.
1843 Version 4 implements a standard mangling for vector types.
1845 Version 5 corrects the mangling of attribute const/volatile on
1846 function pointer types, decltype of a plain decl, and use of a
1847 function parameter in the declaration of another parameter.
1849 Version 6 corrects the promotion behavior of C++0x scoped enums.
1851 See also @option{-Wabi}.
1853 @item -fno-access-control
1854 @opindex fno-access-control
1855 Turn off all access checking.  This switch is mainly useful for working
1856 around bugs in the access control code.
1858 @item -fcheck-new
1859 @opindex fcheck-new
1860 Check that the pointer returned by @code{operator new} is non-null
1861 before attempting to modify the storage allocated.  This check is
1862 normally unnecessary because the C++ standard specifies that
1863 @code{operator new} will only return @code{0} if it is declared
1864 @samp{throw()}, in which case the compiler will always check the
1865 return value even without this option.  In all other cases, when
1866 @code{operator new} has a non-empty exception specification, memory
1867 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
1868 @samp{new (nothrow)}.
1870 @item -fconserve-space
1871 @opindex fconserve-space
1872 Put uninitialized or runtime-initialized global variables into the
1873 common segment, as C does.  This saves space in the executable at the
1874 cost of not diagnosing duplicate definitions.  If you compile with this
1875 flag and your program mysteriously crashes after @code{main()} has
1876 completed, you may have an object that is being destroyed twice because
1877 two definitions were merged.
1879 This option is no longer useful on most targets, now that support has
1880 been added for putting variables into BSS without making them common.
1882 @item -fconstexpr-depth=@var{n}
1883 @opindex fconstexpr-depth
1884 Set the maximum nested evaluation depth for C++0x constexpr functions
1885 to @var{n}.  A limit is needed to detect endless recursion during
1886 constant expression evaluation.  The minimum specified by the standard
1887 is 512.
1889 @item -fno-deduce-init-list
1890 @opindex fno-deduce-init-list
1891 Disable deduction of a template type parameter as
1892 std::initializer_list from a brace-enclosed initializer list, i.e.
1894 @smallexample
1895 template <class T> auto forward(T t) -> decltype (realfn (t))
1897   return realfn (t);
1900 void f()
1902   forward(@{1,2@}); // call forward<std::initializer_list<int>>
1904 @end smallexample
1906 This option is present because this deduction is an extension to the
1907 current specification in the C++0x working draft, and there was
1908 some concern about potential overload resolution problems.
1910 @item -ffriend-injection
1911 @opindex ffriend-injection
1912 Inject friend functions into the enclosing namespace, so that they are
1913 visible outside the scope of the class in which they are declared.
1914 Friend functions were documented to work this way in the old Annotated
1915 C++ Reference Manual, and versions of G++ before 4.1 always worked
1916 that way.  However, in ISO C++ a friend function which is not declared
1917 in an enclosing scope can only be found using argument dependent
1918 lookup.  This option causes friends to be injected as they were in
1919 earlier releases.
1921 This option is for compatibility, and may be removed in a future
1922 release of G++.
1924 @item -fno-elide-constructors
1925 @opindex fno-elide-constructors
1926 The C++ standard allows an implementation to omit creating a temporary
1927 which is only used to initialize another object of the same type.
1928 Specifying this option disables that optimization, and forces G++ to
1929 call the copy constructor in all cases.
1931 @item -fno-enforce-eh-specs
1932 @opindex fno-enforce-eh-specs
1933 Don't generate code to check for violation of exception specifications
1934 at runtime.  This option violates the C++ standard, but may be useful
1935 for reducing code size in production builds, much like defining
1936 @samp{NDEBUG}.  This does not give user code permission to throw
1937 exceptions in violation of the exception specifications; the compiler
1938 will still optimize based on the specifications, so throwing an
1939 unexpected exception will result in undefined behavior.
1941 @item -ffor-scope
1942 @itemx -fno-for-scope
1943 @opindex ffor-scope
1944 @opindex fno-for-scope
1945 If @option{-ffor-scope} is specified, the scope of variables declared in
1946 a @i{for-init-statement} is limited to the @samp{for} loop itself,
1947 as specified by the C++ standard.
1948 If @option{-fno-for-scope} is specified, the scope of variables declared in
1949 a @i{for-init-statement} extends to the end of the enclosing scope,
1950 as was the case in old versions of G++, and other (traditional)
1951 implementations of C++.
1953 The default if neither flag is given to follow the standard,
1954 but to allow and give a warning for old-style code that would
1955 otherwise be invalid, or have different behavior.
1957 @item -fno-gnu-keywords
1958 @opindex fno-gnu-keywords
1959 Do not recognize @code{typeof} as a keyword, so that code can use this
1960 word as an identifier.  You can use the keyword @code{__typeof__} instead.
1961 @option{-ansi} implies @option{-fno-gnu-keywords}.
1963 @item -fno-implicit-templates
1964 @opindex fno-implicit-templates
1965 Never emit code for non-inline templates which are instantiated
1966 implicitly (i.e.@: by use); only emit code for explicit instantiations.
1967 @xref{Template Instantiation}, for more information.
1969 @item -fno-implicit-inline-templates
1970 @opindex fno-implicit-inline-templates
1971 Don't emit code for implicit instantiations of inline templates, either.
1972 The default is to handle inlines differently so that compiles with and
1973 without optimization will need the same set of explicit instantiations.
1975 @item -fno-implement-inlines
1976 @opindex fno-implement-inlines
1977 To save space, do not emit out-of-line copies of inline functions
1978 controlled by @samp{#pragma implementation}.  This will cause linker
1979 errors if these functions are not inlined everywhere they are called.
1981 @item -fms-extensions
1982 @opindex fms-extensions
1983 Disable pedantic warnings about constructs used in MFC, such as implicit
1984 int and getting a pointer to member function via non-standard syntax.
1986 @item -fno-nonansi-builtins
1987 @opindex fno-nonansi-builtins
1988 Disable built-in declarations of functions that are not mandated by
1989 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
1990 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
1992 @item -fnothrow-opt
1993 @opindex fnothrow-opt
1994 Treat a @code{throw()} exception specification as though it were a
1995 @code{noexcept} specification to reduce or eliminate the text size
1996 overhead relative to a function with no exception specification.  If
1997 the function has local variables of types with non-trivial
1998 destructors, the exception specification will actually make the
1999 function smaller because the EH cleanups for those variables can be
2000 optimized away.  The semantic effect is that an exception thrown out of
2001 a function with such an exception specification will result in a call
2002 to @code{terminate} rather than @code{unexpected}.
2004 @item -fno-operator-names
2005 @opindex fno-operator-names
2006 Do not treat the operator name keywords @code{and}, @code{bitand},
2007 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
2008 synonyms as keywords.
2010 @item -fno-optional-diags
2011 @opindex fno-optional-diags
2012 Disable diagnostics that the standard says a compiler does not need to
2013 issue.  Currently, the only such diagnostic issued by G++ is the one for
2014 a name having multiple meanings within a class.
2016 @item -fpermissive
2017 @opindex fpermissive
2018 Downgrade some diagnostics about nonconformant code from errors to
2019 warnings.  Thus, using @option{-fpermissive} will allow some
2020 nonconforming code to compile.
2022 @item -fno-pretty-templates
2023 @opindex fno-pretty-templates
2024 When an error message refers to a specialization of a function
2025 template, the compiler will normally print the signature of the
2026 template followed by the template arguments and any typedefs or
2027 typenames in the signature (e.g. @code{void f(T) [with T = int]}
2028 rather than @code{void f(int)}) so that it's clear which template is
2029 involved.  When an error message refers to a specialization of a class
2030 template, the compiler will omit any template arguments which match
2031 the default template arguments for that template.  If either of these
2032 behaviors make it harder to understand the error message rather than
2033 easier, using @option{-fno-pretty-templates} will disable them.
2035 @item -frepo
2036 @opindex frepo
2037 Enable automatic template instantiation at link time.  This option also
2038 implies @option{-fno-implicit-templates}.  @xref{Template
2039 Instantiation}, for more information.
2041 @item -fno-rtti
2042 @opindex fno-rtti
2043 Disable generation of information about every class with virtual
2044 functions for use by the C++ runtime type identification features
2045 (@samp{dynamic_cast} and @samp{typeid}).  If you don't use those parts
2046 of the language, you can save some space by using this flag.  Note that
2047 exception handling uses the same information, but it will generate it as
2048 needed. The @samp{dynamic_cast} operator can still be used for casts that
2049 do not require runtime type information, i.e.@: casts to @code{void *} or to
2050 unambiguous base classes.
2052 @item -fstats
2053 @opindex fstats
2054 Emit statistics about front-end processing at the end of the compilation.
2055 This information is generally only useful to the G++ development team.
2057 @item -fstrict-enums
2058 @opindex fstrict-enums
2059 Allow the compiler to optimize using the assumption that a value of
2060 enumeration type can only be one of the values of the enumeration (as
2061 defined in the C++ standard; basically, a value which can be
2062 represented in the minimum number of bits needed to represent all the
2063 enumerators).  This assumption may not be valid if the program uses a
2064 cast to convert an arbitrary integer value to the enumeration type.
2066 @item -ftemplate-depth=@var{n}
2067 @opindex ftemplate-depth
2068 Set the maximum instantiation depth for template classes to @var{n}.
2069 A limit on the template instantiation depth is needed to detect
2070 endless recursions during template class instantiation.  ANSI/ISO C++
2071 conforming programs must not rely on a maximum depth greater than 17
2072 (changed to 1024 in C++0x).
2074 @item -fno-threadsafe-statics
2075 @opindex fno-threadsafe-statics
2076 Do not emit the extra code to use the routines specified in the C++
2077 ABI for thread-safe initialization of local statics.  You can use this
2078 option to reduce code size slightly in code that doesn't need to be
2079 thread-safe.
2081 @item -fuse-cxa-atexit
2082 @opindex fuse-cxa-atexit
2083 Register destructors for objects with static storage duration with the
2084 @code{__cxa_atexit} function rather than the @code{atexit} function.
2085 This option is required for fully standards-compliant handling of static
2086 destructors, but will only work if your C library supports
2087 @code{__cxa_atexit}.
2089 @item -fno-use-cxa-get-exception-ptr
2090 @opindex fno-use-cxa-get-exception-ptr
2091 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
2092 will cause @code{std::uncaught_exception} to be incorrect, but is necessary
2093 if the runtime routine is not available.
2095 @item -fvisibility-inlines-hidden
2096 @opindex fvisibility-inlines-hidden
2097 This switch declares that the user does not attempt to compare
2098 pointers to inline methods where the addresses of the two functions
2099 were taken in different shared objects.
2101 The effect of this is that GCC may, effectively, mark inline methods with
2102 @code{__attribute__ ((visibility ("hidden")))} so that they do not
2103 appear in the export table of a DSO and do not require a PLT indirection
2104 when used within the DSO@.  Enabling this option can have a dramatic effect
2105 on load and link times of a DSO as it massively reduces the size of the
2106 dynamic export table when the library makes heavy use of templates.
2108 The behavior of this switch is not quite the same as marking the
2109 methods as hidden directly, because it does not affect static variables
2110 local to the function or cause the compiler to deduce that
2111 the function is defined in only one shared object.
2113 You may mark a method as having a visibility explicitly to negate the
2114 effect of the switch for that method.  For example, if you do want to
2115 compare pointers to a particular inline method, you might mark it as
2116 having default visibility.  Marking the enclosing class with explicit
2117 visibility will have no effect.
2119 Explicitly instantiated inline methods are unaffected by this option
2120 as their linkage might otherwise cross a shared library boundary.
2121 @xref{Template Instantiation}.
2123 @item -fvisibility-ms-compat
2124 @opindex fvisibility-ms-compat
2125 This flag attempts to use visibility settings to make GCC's C++
2126 linkage model compatible with that of Microsoft Visual Studio.
2128 The flag makes these changes to GCC's linkage model:
2130 @enumerate
2131 @item
2132 It sets the default visibility to @code{hidden}, like
2133 @option{-fvisibility=hidden}.
2135 @item
2136 Types, but not their members, are not hidden by default.
2138 @item
2139 The One Definition Rule is relaxed for types without explicit
2140 visibility specifications which are defined in more than one different
2141 shared object: those declarations are permitted if they would have
2142 been permitted when this option was not used.
2143 @end enumerate
2145 In new code it is better to use @option{-fvisibility=hidden} and
2146 export those classes which are intended to be externally visible.
2147 Unfortunately it is possible for code to rely, perhaps accidentally,
2148 on the Visual Studio behavior.
2150 Among the consequences of these changes are that static data members
2151 of the same type with the same name but defined in different shared
2152 objects will be different, so changing one will not change the other;
2153 and that pointers to function members defined in different shared
2154 objects may not compare equal.  When this flag is given, it is a
2155 violation of the ODR to define types with the same name differently.
2157 @item -fno-weak
2158 @opindex fno-weak
2159 Do not use weak symbol support, even if it is provided by the linker.
2160 By default, G++ will use weak symbols if they are available.  This
2161 option exists only for testing, and should not be used by end-users;
2162 it will result in inferior code and has no benefits.  This option may
2163 be removed in a future release of G++.
2165 @item -nostdinc++
2166 @opindex nostdinc++
2167 Do not search for header files in the standard directories specific to
2168 C++, but do still search the other standard directories.  (This option
2169 is used when building the C++ library.)
2170 @end table
2172 In addition, these optimization, warning, and code generation options
2173 have meanings only for C++ programs:
2175 @table @gcctabopt
2176 @item -fno-default-inline
2177 @opindex fno-default-inline
2178 Do not assume @samp{inline} for functions defined inside a class scope.
2179 @xref{Optimize Options,,Options That Control Optimization}.  Note that these
2180 functions will have linkage like inline functions; they just won't be
2181 inlined by default.
2183 @item -Wabi @r{(C, Objective-C, C++ and Objective-C++ only)}
2184 @opindex Wabi
2185 @opindex Wno-abi
2186 Warn when G++ generates code that is probably not compatible with the
2187 vendor-neutral C++ ABI@.  Although an effort has been made to warn about
2188 all such cases, there are probably some cases that are not warned about,
2189 even though G++ is generating incompatible code.  There may also be
2190 cases where warnings are emitted even though the code that is generated
2191 will be compatible.
2193 You should rewrite your code to avoid these warnings if you are
2194 concerned about the fact that code generated by G++ may not be binary
2195 compatible with code generated by other compilers.
2197 The known incompatibilities in @option{-fabi-version=2} (the default) include:
2199 @itemize @bullet
2201 @item
2202 A template with a non-type template parameter of reference type is
2203 mangled incorrectly:
2204 @smallexample
2205 extern int N;
2206 template <int &> struct S @{@};
2207 void n (S<N>) @{2@}
2208 @end smallexample
2210 This is fixed in @option{-fabi-version=3}.
2212 @item
2213 SIMD vector types declared using @code{__attribute ((vector_size))} are
2214 mangled in a non-standard way that does not allow for overloading of
2215 functions taking vectors of different sizes.
2217 The mangling is changed in @option{-fabi-version=4}.
2218 @end itemize
2220 The known incompatibilities in @option{-fabi-version=1} include:
2222 @itemize @bullet
2224 @item
2225 Incorrect handling of tail-padding for bit-fields.  G++ may attempt to
2226 pack data into the same byte as a base class.  For example:
2228 @smallexample
2229 struct A @{ virtual void f(); int f1 : 1; @};
2230 struct B : public A @{ int f2 : 1; @};
2231 @end smallexample
2233 @noindent
2234 In this case, G++ will place @code{B::f2} into the same byte
2235 as@code{A::f1}; other compilers will not.  You can avoid this problem
2236 by explicitly padding @code{A} so that its size is a multiple of the
2237 byte size on your platform; that will cause G++ and other compilers to
2238 layout @code{B} identically.
2240 @item
2241 Incorrect handling of tail-padding for virtual bases.  G++ does not use
2242 tail padding when laying out virtual bases.  For example:
2244 @smallexample
2245 struct A @{ virtual void f(); char c1; @};
2246 struct B @{ B(); char c2; @};
2247 struct C : public A, public virtual B @{@};
2248 @end smallexample
2250 @noindent
2251 In this case, G++ will not place @code{B} into the tail-padding for
2252 @code{A}; other compilers will.  You can avoid this problem by
2253 explicitly padding @code{A} so that its size is a multiple of its
2254 alignment (ignoring virtual base classes); that will cause G++ and other
2255 compilers to layout @code{C} identically.
2257 @item
2258 Incorrect handling of bit-fields with declared widths greater than that
2259 of their underlying types, when the bit-fields appear in a union.  For
2260 example:
2262 @smallexample
2263 union U @{ int i : 4096; @};
2264 @end smallexample
2266 @noindent
2267 Assuming that an @code{int} does not have 4096 bits, G++ will make the
2268 union too small by the number of bits in an @code{int}.
2270 @item
2271 Empty classes can be placed at incorrect offsets.  For example:
2273 @smallexample
2274 struct A @{@};
2276 struct B @{
2277   A a;
2278   virtual void f ();
2281 struct C : public B, public A @{@};
2282 @end smallexample
2284 @noindent
2285 G++ will place the @code{A} base class of @code{C} at a nonzero offset;
2286 it should be placed at offset zero.  G++ mistakenly believes that the
2287 @code{A} data member of @code{B} is already at offset zero.
2289 @item
2290 Names of template functions whose types involve @code{typename} or
2291 template template parameters can be mangled incorrectly.
2293 @smallexample
2294 template <typename Q>
2295 void f(typename Q::X) @{@}
2297 template <template <typename> class Q>
2298 void f(typename Q<int>::X) @{@}
2299 @end smallexample
2301 @noindent
2302 Instantiations of these templates may be mangled incorrectly.
2304 @end itemize
2306 It also warns psABI related changes.  The known psABI changes at this
2307 point include:
2309 @itemize @bullet
2311 @item
2312 For SYSV/x86-64, when passing union with long double, it is changed to
2313 pass in memory as specified in psABI.  For example:
2315 @smallexample
2316 union U @{
2317   long double ld;
2318   int i;
2320 @end smallexample
2322 @noindent
2323 @code{union U} will always be passed in memory.
2325 @end itemize
2327 @item -Wctor-dtor-privacy @r{(C++ and Objective-C++ only)}
2328 @opindex Wctor-dtor-privacy
2329 @opindex Wno-ctor-dtor-privacy
2330 Warn when a class seems unusable because all the constructors or
2331 destructors in that class are private, and it has neither friends nor
2332 public static member functions.
2334 @item -Wdelete-non-virtual-dtor @r{(C++ and Objective-C++ only)}
2335 @opindex Wdelete-non-virtual-dtor
2336 @opindex Wno-delete-non-virtual-dtor
2337 Warn when @samp{delete} is used to destroy an instance of a class which
2338 has virtual functions and non-virtual destructor. It is unsafe to delete
2339 an instance of a derived class through a pointer to a base class if the
2340 base class does not have a virtual destructor.  This warning is enabled
2341 by @option{-Wall}.
2343 @item -Wnoexcept @r{(C++ and Objective-C++ only)}
2344 @opindex Wnoexcept
2345 @opindex Wno-noexcept
2346 Warn when a noexcept-expression evaluates to false because of a call
2347 to a function that does not have a non-throwing exception
2348 specification (i.e. @samp{throw()} or @samp{noexcept}) but is known by
2349 the compiler to never throw an exception.
2351 @item -Wnon-virtual-dtor @r{(C++ and Objective-C++ only)}
2352 @opindex Wnon-virtual-dtor
2353 @opindex Wno-non-virtual-dtor
2354 Warn when a class has virtual functions and accessible non-virtual
2355 destructor, in which case it would be possible but unsafe to delete
2356 an instance of a derived class through a pointer to the base class.
2357 This warning is also enabled if -Weffc++ is specified.
2359 @item -Wreorder @r{(C++ and Objective-C++ only)}
2360 @opindex Wreorder
2361 @opindex Wno-reorder
2362 @cindex reordering, warning
2363 @cindex warning for reordering of member initializers
2364 Warn when the order of member initializers given in the code does not
2365 match the order in which they must be executed.  For instance:
2367 @smallexample
2368 struct A @{
2369   int i;
2370   int j;
2371   A(): j (0), i (1) @{ @}
2373 @end smallexample
2375 The compiler will rearrange the member initializers for @samp{i}
2376 and @samp{j} to match the declaration order of the members, emitting
2377 a warning to that effect.  This warning is enabled by @option{-Wall}.
2378 @end table
2380 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
2382 @table @gcctabopt
2383 @item -Weffc++ @r{(C++ and Objective-C++ only)}
2384 @opindex Weffc++
2385 @opindex Wno-effc++
2386 Warn about violations of the following style guidelines from Scott Meyers'
2387 @cite{Effective C++} book:
2389 @itemize @bullet
2390 @item
2391 Item 11:  Define a copy constructor and an assignment operator for classes
2392 with dynamically allocated memory.
2394 @item
2395 Item 12:  Prefer initialization to assignment in constructors.
2397 @item
2398 Item 14:  Make destructors virtual in base classes.
2400 @item
2401 Item 15:  Have @code{operator=} return a reference to @code{*this}.
2403 @item
2404 Item 23:  Don't try to return a reference when you must return an object.
2406 @end itemize
2408 Also warn about violations of the following style guidelines from
2409 Scott Meyers' @cite{More Effective C++} book:
2411 @itemize @bullet
2412 @item
2413 Item 6:  Distinguish between prefix and postfix forms of increment and
2414 decrement operators.
2416 @item
2417 Item 7:  Never overload @code{&&}, @code{||}, or @code{,}.
2419 @end itemize
2421 When selecting this option, be aware that the standard library
2422 headers do not obey all of these guidelines; use @samp{grep -v}
2423 to filter out those warnings.
2425 @item -Wstrict-null-sentinel @r{(C++ and Objective-C++ only)}
2426 @opindex Wstrict-null-sentinel
2427 @opindex Wno-strict-null-sentinel
2428 Warn also about the use of an uncasted @code{NULL} as sentinel.  When
2429 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
2430 to @code{__null}.  Although it is a null pointer constant not a null pointer,
2431 it is guaranteed to be of the same size as a pointer.  But this use is
2432 not portable across different compilers.
2434 @item -Wno-non-template-friend @r{(C++ and Objective-C++ only)}
2435 @opindex Wno-non-template-friend
2436 @opindex Wnon-template-friend
2437 Disable warnings when non-templatized friend functions are declared
2438 within a template.  Since the advent of explicit template specification
2439 support in G++, if the name of the friend is an unqualified-id (i.e.,
2440 @samp{friend foo(int)}), the C++ language specification demands that the
2441 friend declare or define an ordinary, nontemplate function.  (Section
2442 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
2443 could be interpreted as a particular specialization of a templatized
2444 function.  Because this non-conforming behavior is no longer the default
2445 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
2446 check existing code for potential trouble spots and is on by default.
2447 This new compiler behavior can be turned off with
2448 @option{-Wno-non-template-friend} which keeps the conformant compiler code
2449 but disables the helpful warning.
2451 @item -Wold-style-cast @r{(C++ and Objective-C++ only)}
2452 @opindex Wold-style-cast
2453 @opindex Wno-old-style-cast
2454 Warn if an old-style (C-style) cast to a non-void type is used within
2455 a C++ program.  The new-style casts (@samp{dynamic_cast},
2456 @samp{static_cast}, @samp{reinterpret_cast}, and @samp{const_cast}) are
2457 less vulnerable to unintended effects and much easier to search for.
2459 @item -Woverloaded-virtual @r{(C++ and Objective-C++ only)}
2460 @opindex Woverloaded-virtual
2461 @opindex Wno-overloaded-virtual
2462 @cindex overloaded virtual function, warning
2463 @cindex warning for overloaded virtual function
2464 Warn when a function declaration hides virtual functions from a
2465 base class.  For example, in:
2467 @smallexample
2468 struct A @{
2469   virtual void f();
2472 struct B: public A @{
2473   void f(int);
2475 @end smallexample
2477 the @code{A} class version of @code{f} is hidden in @code{B}, and code
2478 like:
2480 @smallexample
2481 B* b;
2482 b->f();
2483 @end smallexample
2485 will fail to compile.
2487 @item -Wno-pmf-conversions @r{(C++ and Objective-C++ only)}
2488 @opindex Wno-pmf-conversions
2489 @opindex Wpmf-conversions
2490 Disable the diagnostic for converting a bound pointer to member function
2491 to a plain pointer.
2493 @item -Wsign-promo @r{(C++ and Objective-C++ only)}
2494 @opindex Wsign-promo
2495 @opindex Wno-sign-promo
2496 Warn when overload resolution chooses a promotion from unsigned or
2497 enumerated type to a signed type, over a conversion to an unsigned type of
2498 the same size.  Previous versions of G++ would try to preserve
2499 unsignedness, but the standard mandates the current behavior.
2501 @smallexample
2502 struct A @{
2503   operator int ();
2504   A& operator = (int);
2507 main ()
2509   A a,b;
2510   a = b;
2512 @end smallexample
2514 In this example, G++ will synthesize a default @samp{A& operator =
2515 (const A&);}, while cfront will use the user-defined @samp{operator =}.
2516 @end table
2518 @node Objective-C and Objective-C++ Dialect Options
2519 @section Options Controlling Objective-C and Objective-C++ Dialects
2521 @cindex compiler options, Objective-C and Objective-C++
2522 @cindex Objective-C and Objective-C++ options, command line
2523 @cindex options, Objective-C and Objective-C++
2524 (NOTE: This manual does not describe the Objective-C and Objective-C++
2525 languages themselves.  @xref{Standards,,Language Standards
2526 Supported by GCC}, for references.)
2528 This section describes the command-line options that are only meaningful
2529 for Objective-C and Objective-C++ programs, but you can also use most of
2530 the language-independent GNU compiler options.
2531 For example, you might compile a file @code{some_class.m} like this:
2533 @smallexample
2534 gcc -g -fgnu-runtime -O -c some_class.m
2535 @end smallexample
2537 @noindent
2538 In this example, @option{-fgnu-runtime} is an option meant only for
2539 Objective-C and Objective-C++ programs; you can use the other options with
2540 any language supported by GCC@.
2542 Note that since Objective-C is an extension of the C language, Objective-C
2543 compilations may also use options specific to the C front-end (e.g.,
2544 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
2545 C++-specific options (e.g., @option{-Wabi}).
2547 Here is a list of options that are @emph{only} for compiling Objective-C
2548 and Objective-C++ programs:
2550 @table @gcctabopt
2551 @item -fconstant-string-class=@var{class-name}
2552 @opindex fconstant-string-class
2553 Use @var{class-name} as the name of the class to instantiate for each
2554 literal string specified with the syntax @code{@@"@dots{}"}.  The default
2555 class name is @code{NXConstantString} if the GNU runtime is being used, and
2556 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
2557 @option{-fconstant-cfstrings} option, if also present, will override the
2558 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
2559 to be laid out as constant CoreFoundation strings.
2561 @item -fgnu-runtime
2562 @opindex fgnu-runtime
2563 Generate object code compatible with the standard GNU Objective-C
2564 runtime.  This is the default for most types of systems.
2566 @item -fnext-runtime
2567 @opindex fnext-runtime
2568 Generate output compatible with the NeXT runtime.  This is the default
2569 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
2570 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
2571 used.
2573 @item -fno-nil-receivers
2574 @opindex fno-nil-receivers
2575 Assume that all Objective-C message dispatches (@code{[receiver
2576 message:arg]}) in this translation unit ensure that the receiver is
2577 not @code{nil}.  This allows for more efficient entry points in the
2578 runtime to be used.  This option is only available in conjunction with
2579 the NeXT runtime and ABI version 0 or 1.
2581 @item -fobjc-abi-version=@var{n}
2582 @opindex fobjc-abi-version
2583 Use version @var{n} of the Objective-C ABI for the selected runtime.
2584 This option is currently supported only for the NeXT runtime.  In that
2585 case, Version 0 is the traditional (32-bit) ABI without support for
2586 properties and other Objective-C 2.0 additions.  Version 1 is the
2587 traditional (32-bit) ABI with support for properties and other
2588 Objective-C 2.0 additions.  Version 2 is the modern (64-bit) ABI.  If
2589 nothing is specified, the default is Version 0 on 32-bit target
2590 machines, and Version 2 on 64-bit target machines.
2592 @item -fobjc-call-cxx-cdtors
2593 @opindex fobjc-call-cxx-cdtors
2594 For each Objective-C class, check if any of its instance variables is a
2595 C++ object with a non-trivial default constructor.  If so, synthesize a
2596 special @code{- (id) .cxx_construct} instance method that will run
2597 non-trivial default constructors on any such instance variables, in order,
2598 and then return @code{self}.  Similarly, check if any instance variable
2599 is a C++ object with a non-trivial destructor, and if so, synthesize a
2600 special @code{- (void) .cxx_destruct} method that will run
2601 all such default destructors, in reverse order.
2603 The @code{- (id) .cxx_construct} and @code{- (void) .cxx_destruct}
2604 methods thusly generated will only operate on instance variables
2605 declared in the current Objective-C class, and not those inherited
2606 from superclasses.  It is the responsibility of the Objective-C
2607 runtime to invoke all such methods in an object's inheritance
2608 hierarchy.  The @code{- (id) .cxx_construct} methods will be invoked
2609 by the runtime immediately after a new object instance is allocated;
2610 the @code{- (void) .cxx_destruct} methods will be invoked immediately
2611 before the runtime deallocates an object instance.
2613 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
2614 support for invoking the @code{- (id) .cxx_construct} and
2615 @code{- (void) .cxx_destruct} methods.
2617 @item -fobjc-direct-dispatch
2618 @opindex fobjc-direct-dispatch
2619 Allow fast jumps to the message dispatcher.  On Darwin this is
2620 accomplished via the comm page.
2622 @item -fobjc-exceptions
2623 @opindex fobjc-exceptions
2624 Enable syntactic support for structured exception handling in
2625 Objective-C, similar to what is offered by C++ and Java.  This option
2626 is required to use the Objective-C keywords @code{@@try},
2627 @code{@@throw}, @code{@@catch}, @code{@@finally} and
2628 @code{@@synchronized}.  This option is available with both the GNU
2629 runtime and the NeXT runtime (but not available in conjunction with
2630 the NeXT runtime on Mac OS X 10.2 and earlier).
2632 @item -fobjc-gc
2633 @opindex fobjc-gc
2634 Enable garbage collection (GC) in Objective-C and Objective-C++
2635 programs.  This option is only available with the NeXT runtime; the
2636 GNU runtime has a different garbage collection implementation that
2637 does not require special compiler flags.
2639 @item -fobjc-nilcheck
2640 @opindex fobjc-nilcheck
2641 For the NeXT runtime with version 2 of the ABI, check for a nil
2642 receiver in method invocations before doing the actual method call.
2643 This is the default and can be disabled using
2644 @option{-fno-objc-nilcheck}.  Class methods and super calls are never
2645 checked for nil in this way no matter what this flag is set to.
2646 Currently this flag does nothing when the GNU runtime, or an older
2647 version of the NeXT runtime ABI, is used.
2649 @item -fobjc-std=objc1
2650 @opindex fobjc-std
2651 Conform to the language syntax of Objective-C 1.0, the language
2652 recognized by GCC 4.0.  This only affects the Objective-C additions to
2653 the C/C++ language; it does not affect conformance to C/C++ standards,
2654 which is controlled by the separate C/C++ dialect option flags.  When
2655 this option is used with the Objective-C or Objective-C++ compiler,
2656 any Objective-C syntax that is not recognized by GCC 4.0 is rejected.
2657 This is useful if you need to make sure that your Objective-C code can
2658 be compiled with older versions of GCC.
2660 @item -freplace-objc-classes
2661 @opindex freplace-objc-classes
2662 Emit a special marker instructing @command{ld(1)} not to statically link in
2663 the resulting object file, and allow @command{dyld(1)} to load it in at
2664 run time instead.  This is used in conjunction with the Fix-and-Continue
2665 debugging mode, where the object file in question may be recompiled and
2666 dynamically reloaded in the course of program execution, without the need
2667 to restart the program itself.  Currently, Fix-and-Continue functionality
2668 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
2669 and later.
2671 @item -fzero-link
2672 @opindex fzero-link
2673 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
2674 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
2675 compile time) with static class references that get initialized at load time,
2676 which improves run-time performance.  Specifying the @option{-fzero-link} flag
2677 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
2678 to be retained.  This is useful in Zero-Link debugging mode, since it allows
2679 for individual class implementations to be modified during program execution.
2680 The GNU runtime currently always retains calls to @code{objc_get_class("@dots{}")}
2681 regardless of command line options.
2683 @item -gen-decls
2684 @opindex gen-decls
2685 Dump interface declarations for all classes seen in the source file to a
2686 file named @file{@var{sourcename}.decl}.
2688 @item -Wassign-intercept @r{(Objective-C and Objective-C++ only)}
2689 @opindex Wassign-intercept
2690 @opindex Wno-assign-intercept
2691 Warn whenever an Objective-C assignment is being intercepted by the
2692 garbage collector.
2694 @item -Wno-protocol @r{(Objective-C and Objective-C++ only)}
2695 @opindex Wno-protocol
2696 @opindex Wprotocol
2697 If a class is declared to implement a protocol, a warning is issued for
2698 every method in the protocol that is not implemented by the class.  The
2699 default behavior is to issue a warning for every method not explicitly
2700 implemented in the class, even if a method implementation is inherited
2701 from the superclass.  If you use the @option{-Wno-protocol} option, then
2702 methods inherited from the superclass are considered to be implemented,
2703 and no warning is issued for them.
2705 @item -Wselector @r{(Objective-C and Objective-C++ only)}
2706 @opindex Wselector
2707 @opindex Wno-selector
2708 Warn if multiple methods of different types for the same selector are
2709 found during compilation.  The check is performed on the list of methods
2710 in the final stage of compilation.  Additionally, a check is performed
2711 for each selector appearing in a @code{@@selector(@dots{})}
2712 expression, and a corresponding method for that selector has been found
2713 during compilation.  Because these checks scan the method table only at
2714 the end of compilation, these warnings are not produced if the final
2715 stage of compilation is not reached, for example because an error is
2716 found during compilation, or because the @option{-fsyntax-only} option is
2717 being used.
2719 @item -Wstrict-selector-match @r{(Objective-C and Objective-C++ only)}
2720 @opindex Wstrict-selector-match
2721 @opindex Wno-strict-selector-match
2722 Warn if multiple methods with differing argument and/or return types are
2723 found for a given selector when attempting to send a message using this
2724 selector to a receiver of type @code{id} or @code{Class}.  When this flag
2725 is off (which is the default behavior), the compiler will omit such warnings
2726 if any differences found are confined to types which share the same size
2727 and alignment.
2729 @item -Wundeclared-selector @r{(Objective-C and Objective-C++ only)}
2730 @opindex Wundeclared-selector
2731 @opindex Wno-undeclared-selector
2732 Warn if a @code{@@selector(@dots{})} expression referring to an
2733 undeclared selector is found.  A selector is considered undeclared if no
2734 method with that name has been declared before the
2735 @code{@@selector(@dots{})} expression, either explicitly in an
2736 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
2737 an @code{@@implementation} section.  This option always performs its
2738 checks as soon as a @code{@@selector(@dots{})} expression is found,
2739 while @option{-Wselector} only performs its checks in the final stage of
2740 compilation.  This also enforces the coding style convention
2741 that methods and selectors must be declared before being used.
2743 @item -print-objc-runtime-info
2744 @opindex print-objc-runtime-info
2745 Generate C header describing the largest structure that is passed by
2746 value, if any.
2748 @end table
2750 @node Language Independent Options
2751 @section Options to Control Diagnostic Messages Formatting
2752 @cindex options to control diagnostics formatting
2753 @cindex diagnostic messages
2754 @cindex message formatting
2756 Traditionally, diagnostic messages have been formatted irrespective of
2757 the output device's aspect (e.g.@: its width, @dots{}).  The options described
2758 below can be used to control the diagnostic messages formatting
2759 algorithm, e.g.@: how many characters per line, how often source location
2760 information should be reported.  Right now, only the C++ front end can
2761 honor these options.  However it is expected, in the near future, that
2762 the remaining front ends would be able to digest them correctly.
2764 @table @gcctabopt
2765 @item -fmessage-length=@var{n}
2766 @opindex fmessage-length
2767 Try to format error messages so that they fit on lines of about @var{n}
2768 characters.  The default is 72 characters for @command{g++} and 0 for the rest of
2769 the front ends supported by GCC@.  If @var{n} is zero, then no
2770 line-wrapping will be done; each error message will appear on a single
2771 line.
2773 @opindex fdiagnostics-show-location
2774 @item -fdiagnostics-show-location=once
2775 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
2776 reporter to emit @emph{once} source location information; that is, in
2777 case the message is too long to fit on a single physical line and has to
2778 be wrapped, the source location won't be emitted (as prefix) again,
2779 over and over, in subsequent continuation lines.  This is the default
2780 behavior.
2782 @item -fdiagnostics-show-location=every-line
2783 Only meaningful in line-wrapping mode.  Instructs the diagnostic
2784 messages reporter to emit the same source location information (as
2785 prefix) for physical lines that result from the process of breaking
2786 a message which is too long to fit on a single line.
2788 @item -fno-diagnostics-show-option
2789 @opindex fno-diagnostics-show-option
2790 @opindex fdiagnostics-show-option
2791 By default, each diagnostic emitted includes text which indicates the
2792 command line option that directly controls the diagnostic (if such an
2793 option is known to the diagnostic machinery).  Specifying the
2794 @option{-fno-diagnostics-show-option} flag suppresses that behavior.
2796 @item -Wcoverage-mismatch
2797 @opindex Wcoverage-mismatch
2798 Warn if feedback profiles do not match when using the
2799 @option{-fprofile-use} option.
2800 If a source file was changed between @option{-fprofile-gen} and
2801 @option{-fprofile-use}, the files with the profile feedback can fail
2802 to match the source file and GCC can not use the profile feedback
2803 information.  By default, this warning is enabled and is treated as an
2804 error.  @option{-Wno-coverage-mismatch} can be used to disable the
2805 warning or @option{-Wno-error=coverage-mismatch} can be used to
2806 disable the error.  Disable the error for this warning can result in
2807 poorly optimized code, so disabling the error is useful only in the
2808 case of very minor changes such as bug fixes to an existing code-base.
2809 Completely disabling the warning is not recommended.
2811 @end table
2813 @node Warning Options
2814 @section Options to Request or Suppress Warnings
2815 @cindex options to control warnings
2816 @cindex warning messages
2817 @cindex messages, warning
2818 @cindex suppressing warnings
2820 Warnings are diagnostic messages that report constructions which
2821 are not inherently erroneous but which are risky or suggest there
2822 may have been an error.
2824 The following language-independent options do not enable specific
2825 warnings but control the kinds of diagnostics produced by GCC.
2827 @table @gcctabopt
2828 @cindex syntax checking
2829 @item -fsyntax-only
2830 @opindex fsyntax-only
2831 Check the code for syntax errors, but don't do anything beyond that.
2833 @item -fmax-errors=@var{n}
2834 @opindex fmax-errors
2835 Limits the maximum number of error messages to @var{n}, at which point
2836 GCC bails out rather than attempting to continue processing the source
2837 code.  If @var{n} is 0 (the default), there is no limit on the number
2838 of error messages produced.  If @option{-Wfatal-errors} is also
2839 specified, then @option{-Wfatal-errors} takes precedence over this
2840 option.
2842 @item -w
2843 @opindex w
2844 Inhibit all warning messages.
2846 @item -Werror
2847 @opindex Werror
2848 @opindex Wno-error
2849 Make all warnings into errors.
2851 @item -Werror=
2852 @opindex Werror=
2853 @opindex Wno-error=
2854 Make the specified warning into an error.  The specifier for a warning
2855 is appended, for example @option{-Werror=switch} turns the warnings
2856 controlled by @option{-Wswitch} into errors.  This switch takes a
2857 negative form, to be used to negate @option{-Werror} for specific
2858 warnings, for example @option{-Wno-error=switch} makes
2859 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
2860 is in effect.
2862 The warning message for each controllable warning includes the
2863 option which controls the warning.  That option can then be used with
2864 @option{-Werror=} and @option{-Wno-error=} as described above.
2865 (Printing of the option in the warning message can be disabled using the
2866 @option{-fno-diagnostics-show-option} flag.)
2868 Note that specifying @option{-Werror=}@var{foo} automatically implies
2869 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
2870 imply anything.
2872 @item -Wfatal-errors
2873 @opindex Wfatal-errors
2874 @opindex Wno-fatal-errors
2875 This option causes the compiler to abort compilation on the first error
2876 occurred rather than trying to keep going and printing further error
2877 messages.
2879 @end table
2881 You can request many specific warnings with options beginning
2882 @samp{-W}, for example @option{-Wimplicit} to request warnings on
2883 implicit declarations.  Each of these specific warning options also
2884 has a negative form beginning @samp{-Wno-} to turn off warnings; for
2885 example, @option{-Wno-implicit}.  This manual lists only one of the
2886 two forms, whichever is not the default.  For further,
2887 language-specific options also refer to @ref{C++ Dialect Options} and
2888 @ref{Objective-C and Objective-C++ Dialect Options}.
2890 When an unrecognized warning option is requested (e.g.,
2891 @option{-Wunknown-warning}), GCC will emit a diagnostic stating
2892 that the option is not recognized.  However, if the @option{-Wno-} form
2893 is used, the behavior is slightly different: No diagnostic will be
2894 produced for @option{-Wno-unknown-warning} unless other diagnostics
2895 are being produced.  This allows the use of new @option{-Wno-} options
2896 with old compilers, but if something goes wrong, the compiler will
2897 warn that an unrecognized option was used.
2899 @table @gcctabopt
2900 @item -pedantic
2901 @opindex pedantic
2902 Issue all the warnings demanded by strict ISO C and ISO C++;
2903 reject all programs that use forbidden extensions, and some other
2904 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
2905 version of the ISO C standard specified by any @option{-std} option used.
2907 Valid ISO C and ISO C++ programs should compile properly with or without
2908 this option (though a rare few will require @option{-ansi} or a
2909 @option{-std} option specifying the required version of ISO C)@.  However,
2910 without this option, certain GNU extensions and traditional C and C++
2911 features are supported as well.  With this option, they are rejected.
2913 @option{-pedantic} does not cause warning messages for use of the
2914 alternate keywords whose names begin and end with @samp{__}.  Pedantic
2915 warnings are also disabled in the expression that follows
2916 @code{__extension__}.  However, only system header files should use
2917 these escape routes; application programs should avoid them.
2918 @xref{Alternate Keywords}.
2920 Some users try to use @option{-pedantic} to check programs for strict ISO
2921 C conformance.  They soon find that it does not do quite what they want:
2922 it finds some non-ISO practices, but not all---only those for which
2923 ISO C @emph{requires} a diagnostic, and some others for which
2924 diagnostics have been added.
2926 A feature to report any failure to conform to ISO C might be useful in
2927 some instances, but would require considerable additional work and would
2928 be quite different from @option{-pedantic}.  We don't have plans to
2929 support such a feature in the near future.
2931 Where the standard specified with @option{-std} represents a GNU
2932 extended dialect of C, such as @samp{gnu90} or @samp{gnu99}, there is a
2933 corresponding @dfn{base standard}, the version of ISO C on which the GNU
2934 extended dialect is based.  Warnings from @option{-pedantic} are given
2935 where they are required by the base standard.  (It would not make sense
2936 for such warnings to be given only for features not in the specified GNU
2937 C dialect, since by definition the GNU dialects of C include all
2938 features the compiler supports with the given option, and there would be
2939 nothing to warn about.)
2941 @item -pedantic-errors
2942 @opindex pedantic-errors
2943 Like @option{-pedantic}, except that errors are produced rather than
2944 warnings.
2946 @item -Wall
2947 @opindex Wall
2948 @opindex Wno-all
2949 This enables all the warnings about constructions that some users
2950 consider questionable, and that are easy to avoid (or modify to
2951 prevent the warning), even in conjunction with macros.  This also
2952 enables some language-specific warnings described in @ref{C++ Dialect
2953 Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
2955 @option{-Wall} turns on the following warning flags:
2957 @gccoptlist{-Waddress   @gol
2958 -Warray-bounds @r{(only with} @option{-O2}@r{)}  @gol
2959 -Wc++0x-compat  @gol
2960 -Wchar-subscripts  @gol
2961 -Wenum-compare @r{(in C/Objc; this is on by default in C++)} @gol
2962 -Wimplicit-int @r{(C and Objective-C only)} @gol
2963 -Wimplicit-function-declaration @r{(C and Objective-C only)} @gol
2964 -Wcomment  @gol
2965 -Wformat   @gol
2966 -Wmain @r{(only for C/ObjC and unless} @option{-ffreestanding}@r{)}  @gol
2967 -Wmaybe-uninitialized @gol
2968 -Wmissing-braces  @gol
2969 -Wnonnull  @gol
2970 -Wparentheses  @gol
2971 -Wpointer-sign  @gol
2972 -Wreorder   @gol
2973 -Wreturn-type  @gol
2974 -Wsequence-point  @gol
2975 -Wsign-compare @r{(only in C++)}  @gol
2976 -Wstrict-aliasing  @gol
2977 -Wstrict-overflow=1  @gol
2978 -Wswitch  @gol
2979 -Wtrigraphs  @gol
2980 -Wuninitialized  @gol
2981 -Wunknown-pragmas  @gol
2982 -Wunused-function  @gol
2983 -Wunused-label     @gol
2984 -Wunused-value     @gol
2985 -Wunused-variable  @gol
2986 -Wvolatile-register-var @gol
2989 Note that some warning flags are not implied by @option{-Wall}.  Some of
2990 them warn about constructions that users generally do not consider
2991 questionable, but which occasionally you might wish to check for;
2992 others warn about constructions that are necessary or hard to avoid in
2993 some cases, and there is no simple way to modify the code to suppress
2994 the warning. Some of them are enabled by @option{-Wextra} but many of
2995 them must be enabled individually.
2997 @item -Wextra
2998 @opindex W
2999 @opindex Wextra
3000 @opindex Wno-extra
3001 This enables some extra warning flags that are not enabled by
3002 @option{-Wall}. (This option used to be called @option{-W}.  The older
3003 name is still supported, but the newer name is more descriptive.)
3005 @gccoptlist{-Wclobbered  @gol
3006 -Wempty-body  @gol
3007 -Wignored-qualifiers @gol
3008 -Wmissing-field-initializers  @gol
3009 -Wmissing-parameter-type @r{(C only)}  @gol
3010 -Wold-style-declaration @r{(C only)}  @gol
3011 -Woverride-init  @gol
3012 -Wsign-compare  @gol
3013 -Wtype-limits  @gol
3014 -Wuninitialized  @gol
3015 -Wunused-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)} @gol
3016 -Wunused-but-set-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)}  @gol
3019 The option @option{-Wextra} also prints warning messages for the
3020 following cases:
3022 @itemize @bullet
3024 @item
3025 A pointer is compared against integer zero with @samp{<}, @samp{<=},
3026 @samp{>}, or @samp{>=}.
3028 @item
3029 (C++ only) An enumerator and a non-enumerator both appear in a
3030 conditional expression.
3032 @item
3033 (C++ only) Ambiguous virtual bases.
3035 @item
3036 (C++ only) Subscripting an array which has been declared @samp{register}.
3038 @item
3039 (C++ only) Taking the address of a variable which has been declared
3040 @samp{register}.
3042 @item
3043 (C++ only) A base class is not initialized in a derived class' copy
3044 constructor.
3046 @end itemize
3048 @item -Wchar-subscripts
3049 @opindex Wchar-subscripts
3050 @opindex Wno-char-subscripts
3051 Warn if an array subscript has type @code{char}.  This is a common cause
3052 of error, as programmers often forget that this type is signed on some
3053 machines.
3054 This warning is enabled by @option{-Wall}.
3056 @item -Wcomment
3057 @opindex Wcomment
3058 @opindex Wno-comment
3059 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
3060 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
3061 This warning is enabled by @option{-Wall}.
3063 @item -Wno-cpp
3064 @r{(C, Objective-C, C++, Objective-C++ and Fortran only)}
3066 Suppress warning messages emitted by @code{#warning} directives.
3068 @item -Wdouble-promotion @r{(C, C++, Objective-C and Objective-C++ only)}
3069 @opindex Wdouble-promotion
3070 @opindex Wno-double-promotion
3071 Give a warning when a value of type @code{float} is implicitly
3072 promoted to @code{double}.  CPUs with a 32-bit ``single-precision''
3073 floating-point unit implement @code{float} in hardware, but emulate
3074 @code{double} in software.  On such a machine, doing computations
3075 using @code{double} values is much more expensive because of the
3076 overhead required for software emulation.
3078 It is easy to accidentally do computations with @code{double} because
3079 floating-point literals are implicitly of type @code{double}.  For
3080 example, in:
3081 @smallexample
3082 @group
3083 float area(float radius)
3085    return 3.14159 * radius * radius;
3087 @end group
3088 @end smallexample
3089 the compiler will perform the entire computation with @code{double}
3090 because the floating-point literal is a @code{double}.
3092 @item -Wformat
3093 @opindex Wformat
3094 @opindex Wno-format
3095 @opindex ffreestanding
3096 @opindex fno-builtin
3097 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
3098 the arguments supplied have types appropriate to the format string
3099 specified, and that the conversions specified in the format string make
3100 sense.  This includes standard functions, and others specified by format
3101 attributes (@pxref{Function Attributes}), in the @code{printf},
3102 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
3103 not in the C standard) families (or other target-specific families).
3104 Which functions are checked without format attributes having been
3105 specified depends on the standard version selected, and such checks of
3106 functions without the attribute specified are disabled by
3107 @option{-ffreestanding} or @option{-fno-builtin}.
3109 The formats are checked against the format features supported by GNU
3110 libc version 2.2.  These include all ISO C90 and C99 features, as well
3111 as features from the Single Unix Specification and some BSD and GNU
3112 extensions.  Other library implementations may not support all these
3113 features; GCC does not support warning about features that go beyond a
3114 particular library's limitations.  However, if @option{-pedantic} is used
3115 with @option{-Wformat}, warnings will be given about format features not
3116 in the selected standard version (but not for @code{strfmon} formats,
3117 since those are not in any version of the C standard).  @xref{C Dialect
3118 Options,,Options Controlling C Dialect}.
3120 Since @option{-Wformat} also checks for null format arguments for
3121 several functions, @option{-Wformat} also implies @option{-Wnonnull}.
3123 @option{-Wformat} is included in @option{-Wall}.  For more control over some
3124 aspects of format checking, the options @option{-Wformat-y2k},
3125 @option{-Wno-format-extra-args}, @option{-Wno-format-zero-length},
3126 @option{-Wformat-nonliteral}, @option{-Wformat-security}, and
3127 @option{-Wformat=2} are available, but are not included in @option{-Wall}.
3129 @item -Wformat-y2k
3130 @opindex Wformat-y2k
3131 @opindex Wno-format-y2k
3132 If @option{-Wformat} is specified, also warn about @code{strftime}
3133 formats which may yield only a two-digit year.
3135 @item -Wno-format-contains-nul
3136 @opindex Wno-format-contains-nul
3137 @opindex Wformat-contains-nul
3138 If @option{-Wformat} is specified, do not warn about format strings that
3139 contain NUL bytes.
3141 @item -Wno-format-extra-args
3142 @opindex Wno-format-extra-args
3143 @opindex Wformat-extra-args
3144 If @option{-Wformat} is specified, do not warn about excess arguments to a
3145 @code{printf} or @code{scanf} format function.  The C standard specifies
3146 that such arguments are ignored.
3148 Where the unused arguments lie between used arguments that are
3149 specified with @samp{$} operand number specifications, normally
3150 warnings are still given, since the implementation could not know what
3151 type to pass to @code{va_arg} to skip the unused arguments.  However,
3152 in the case of @code{scanf} formats, this option will suppress the
3153 warning if the unused arguments are all pointers, since the Single
3154 Unix Specification says that such unused arguments are allowed.
3156 @item -Wno-format-zero-length @r{(C and Objective-C only)}
3157 @opindex Wno-format-zero-length
3158 @opindex Wformat-zero-length
3159 If @option{-Wformat} is specified, do not warn about zero-length formats.
3160 The C standard specifies that zero-length formats are allowed.
3162 @item -Wformat-nonliteral
3163 @opindex Wformat-nonliteral
3164 @opindex Wno-format-nonliteral
3165 If @option{-Wformat} is specified, also warn if the format string is not a
3166 string literal and so cannot be checked, unless the format function
3167 takes its format arguments as a @code{va_list}.
3169 @item -Wformat-security
3170 @opindex Wformat-security
3171 @opindex Wno-format-security
3172 If @option{-Wformat} is specified, also warn about uses of format
3173 functions that represent possible security problems.  At present, this
3174 warns about calls to @code{printf} and @code{scanf} functions where the
3175 format string is not a string literal and there are no format arguments,
3176 as in @code{printf (foo);}.  This may be a security hole if the format
3177 string came from untrusted input and contains @samp{%n}.  (This is
3178 currently a subset of what @option{-Wformat-nonliteral} warns about, but
3179 in future warnings may be added to @option{-Wformat-security} that are not
3180 included in @option{-Wformat-nonliteral}.)
3182 @item -Wformat=2
3183 @opindex Wformat=2
3184 @opindex Wno-format=2
3185 Enable @option{-Wformat} plus format checks not included in
3186 @option{-Wformat}.  Currently equivalent to @samp{-Wformat
3187 -Wformat-nonliteral -Wformat-security -Wformat-y2k}.
3189 @item -Wnonnull @r{(C and Objective-C only)}
3190 @opindex Wnonnull
3191 @opindex Wno-nonnull
3192 Warn about passing a null pointer for arguments marked as
3193 requiring a non-null value by the @code{nonnull} function attribute.
3195 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
3196 can be disabled with the @option{-Wno-nonnull} option.
3198 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
3199 @opindex Winit-self
3200 @opindex Wno-init-self
3201 Warn about uninitialized variables which are initialized with themselves.
3202 Note this option can only be used with the @option{-Wuninitialized} option.
3204 For example, GCC will warn about @code{i} being uninitialized in the
3205 following snippet only when @option{-Winit-self} has been specified:
3206 @smallexample
3207 @group
3208 int f()
3210   int i = i;
3211   return i;
3213 @end group
3214 @end smallexample
3216 @item -Wimplicit-int @r{(C and Objective-C only)}
3217 @opindex Wimplicit-int
3218 @opindex Wno-implicit-int
3219 Warn when a declaration does not specify a type.
3220 This warning is enabled by @option{-Wall}.
3222 @item -Wimplicit-function-declaration @r{(C and Objective-C only)}
3223 @opindex Wimplicit-function-declaration
3224 @opindex Wno-implicit-function-declaration
3225 Give a warning whenever a function is used before being declared. In
3226 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
3227 enabled by default and it is made into an error by
3228 @option{-pedantic-errors}. This warning is also enabled by
3229 @option{-Wall}.
3231 @item -Wimplicit @r{(C and Objective-C only)}
3232 @opindex Wimplicit
3233 @opindex Wno-implicit
3234 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
3235 This warning is enabled by @option{-Wall}.
3237 @item -Wignored-qualifiers @r{(C and C++ only)}
3238 @opindex Wignored-qualifiers
3239 @opindex Wno-ignored-qualifiers
3240 Warn if the return type of a function has a type qualifier
3241 such as @code{const}.  For ISO C such a type qualifier has no effect,
3242 since the value returned by a function is not an lvalue.
3243 For C++, the warning is only emitted for scalar types or @code{void}.
3244 ISO C prohibits qualified @code{void} return types on function
3245 definitions, so such return types always receive a warning
3246 even without this option.
3248 This warning is also enabled by @option{-Wextra}.
3250 @item -Wmain
3251 @opindex Wmain
3252 @opindex Wno-main
3253 Warn if the type of @samp{main} is suspicious.  @samp{main} should be
3254 a function with external linkage, returning int, taking either zero
3255 arguments, two, or three arguments of appropriate types.  This warning
3256 is enabled by default in C++ and is enabled by either @option{-Wall}
3257 or @option{-pedantic}.
3259 @item -Wmissing-braces
3260 @opindex Wmissing-braces
3261 @opindex Wno-missing-braces
3262 Warn if an aggregate or union initializer is not fully bracketed.  In
3263 the following example, the initializer for @samp{a} is not fully
3264 bracketed, but that for @samp{b} is fully bracketed.
3266 @smallexample
3267 int a[2][2] = @{ 0, 1, 2, 3 @};
3268 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
3269 @end smallexample
3271 This warning is enabled by @option{-Wall}.
3273 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
3274 @opindex Wmissing-include-dirs
3275 @opindex Wno-missing-include-dirs
3276 Warn if a user-supplied include directory does not exist.
3278 @item -Wparentheses
3279 @opindex Wparentheses
3280 @opindex Wno-parentheses
3281 Warn if parentheses are omitted in certain contexts, such
3282 as when there is an assignment in a context where a truth value
3283 is expected, or when operators are nested whose precedence people
3284 often get confused about.
3286 Also warn if a comparison like @samp{x<=y<=z} appears; this is
3287 equivalent to @samp{(x<=y ? 1 : 0) <= z}, which is a different
3288 interpretation from that of ordinary mathematical notation.
3290 Also warn about constructions where there may be confusion to which
3291 @code{if} statement an @code{else} branch belongs.  Here is an example of
3292 such a case:
3294 @smallexample
3295 @group
3297   if (a)
3298     if (b)
3299       foo ();
3300   else
3301     bar ();
3303 @end group
3304 @end smallexample
3306 In C/C++, every @code{else} branch belongs to the innermost possible
3307 @code{if} statement, which in this example is @code{if (b)}.  This is
3308 often not what the programmer expected, as illustrated in the above
3309 example by indentation the programmer chose.  When there is the
3310 potential for this confusion, GCC will issue a warning when this flag
3311 is specified.  To eliminate the warning, add explicit braces around
3312 the innermost @code{if} statement so there is no way the @code{else}
3313 could belong to the enclosing @code{if}.  The resulting code would
3314 look like this:
3316 @smallexample
3317 @group
3319   if (a)
3320     @{
3321       if (b)
3322         foo ();
3323       else
3324         bar ();
3325     @}
3327 @end group
3328 @end smallexample
3330 Also warn for dangerous uses of the
3331 ?: with omitted middle operand GNU extension. When the condition
3332 in the ?: operator is a boolean expression the omitted value will
3333 be always 1. Often the user expects it to be a value computed
3334 inside the conditional expression instead.
3336 This warning is enabled by @option{-Wall}.
3338 @item -Wsequence-point
3339 @opindex Wsequence-point
3340 @opindex Wno-sequence-point
3341 Warn about code that may have undefined semantics because of violations
3342 of sequence point rules in the C and C++ standards.
3344 The C and C++ standards defines the order in which expressions in a C/C++
3345 program are evaluated in terms of @dfn{sequence points}, which represent
3346 a partial ordering between the execution of parts of the program: those
3347 executed before the sequence point, and those executed after it.  These
3348 occur after the evaluation of a full expression (one which is not part
3349 of a larger expression), after the evaluation of the first operand of a
3350 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
3351 function is called (but after the evaluation of its arguments and the
3352 expression denoting the called function), and in certain other places.
3353 Other than as expressed by the sequence point rules, the order of
3354 evaluation of subexpressions of an expression is not specified.  All
3355 these rules describe only a partial order rather than a total order,
3356 since, for example, if two functions are called within one expression
3357 with no sequence point between them, the order in which the functions
3358 are called is not specified.  However, the standards committee have
3359 ruled that function calls do not overlap.
3361 It is not specified when between sequence points modifications to the
3362 values of objects take effect.  Programs whose behavior depends on this
3363 have undefined behavior; the C and C++ standards specify that ``Between
3364 the previous and next sequence point an object shall have its stored
3365 value modified at most once by the evaluation of an expression.
3366 Furthermore, the prior value shall be read only to determine the value
3367 to be stored.''.  If a program breaks these rules, the results on any
3368 particular implementation are entirely unpredictable.
3370 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
3371 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
3372 diagnosed by this option, and it may give an occasional false positive
3373 result, but in general it has been found fairly effective at detecting
3374 this sort of problem in programs.
3376 The standard is worded confusingly, therefore there is some debate
3377 over the precise meaning of the sequence point rules in subtle cases.
3378 Links to discussions of the problem, including proposed formal
3379 definitions, may be found on the GCC readings page, at
3380 @uref{http://gcc.gnu.org/@/readings.html}.
3382 This warning is enabled by @option{-Wall} for C and C++.
3384 @item -Wreturn-type
3385 @opindex Wreturn-type
3386 @opindex Wno-return-type
3387 Warn whenever a function is defined with a return-type that defaults
3388 to @code{int}.  Also warn about any @code{return} statement with no
3389 return-value in a function whose return-type is not @code{void}
3390 (falling off the end of the function body is considered returning
3391 without a value), and about a @code{return} statement with an
3392 expression in a function whose return-type is @code{void}.
3394 For C++, a function without return type always produces a diagnostic
3395 message, even when @option{-Wno-return-type} is specified.  The only
3396 exceptions are @samp{main} and functions defined in system headers.
3398 This warning is enabled by @option{-Wall}.
3400 @item -Wswitch
3401 @opindex Wswitch
3402 @opindex Wno-switch
3403 Warn whenever a @code{switch} statement has an index of enumerated type
3404 and lacks a @code{case} for one or more of the named codes of that
3405 enumeration.  (The presence of a @code{default} label prevents this
3406 warning.)  @code{case} labels outside the enumeration range also
3407 provoke warnings when this option is used (even if there is a
3408 @code{default} label).
3409 This warning is enabled by @option{-Wall}.
3411 @item -Wswitch-default
3412 @opindex Wswitch-default
3413 @opindex Wno-switch-default
3414 Warn whenever a @code{switch} statement does not have a @code{default}
3415 case.
3417 @item -Wswitch-enum
3418 @opindex Wswitch-enum
3419 @opindex Wno-switch-enum
3420 Warn whenever a @code{switch} statement has an index of enumerated type
3421 and lacks a @code{case} for one or more of the named codes of that
3422 enumeration.  @code{case} labels outside the enumeration range also
3423 provoke warnings when this option is used.  The only difference
3424 between @option{-Wswitch} and this option is that this option gives a
3425 warning about an omitted enumeration code even if there is a
3426 @code{default} label.
3428 @item -Wsync-nand @r{(C and C++ only)}
3429 @opindex Wsync-nand
3430 @opindex Wno-sync-nand
3431 Warn when @code{__sync_fetch_and_nand} and @code{__sync_nand_and_fetch}
3432 built-in functions are used.  These functions changed semantics in GCC 4.4.
3434 @item -Wtrigraphs
3435 @opindex Wtrigraphs
3436 @opindex Wno-trigraphs
3437 Warn if any trigraphs are encountered that might change the meaning of
3438 the program (trigraphs within comments are not warned about).
3439 This warning is enabled by @option{-Wall}.
3441 @item -Wunused-but-set-parameter
3442 @opindex Wunused-but-set-parameter
3443 @opindex Wno-unused-but-set-parameter
3444 Warn whenever a function parameter is assigned to, but otherwise unused
3445 (aside from its declaration).
3447 To suppress this warning use the @samp{unused} attribute
3448 (@pxref{Variable Attributes}).
3450 This warning is also enabled by @option{-Wunused} together with
3451 @option{-Wextra}.
3453 @item -Wunused-but-set-variable
3454 @opindex Wunused-but-set-variable
3455 @opindex Wno-unused-but-set-variable
3456 Warn whenever a local variable is assigned to, but otherwise unused
3457 (aside from its declaration).
3458 This warning is enabled by @option{-Wall}.
3460 To suppress this warning use the @samp{unused} attribute
3461 (@pxref{Variable Attributes}).
3463 This warning is also enabled by @option{-Wunused}, which is enabled
3464 by @option{-Wall}.
3466 @item -Wunused-function
3467 @opindex Wunused-function
3468 @opindex Wno-unused-function
3469 Warn whenever a static function is declared but not defined or a
3470 non-inline static function is unused.
3471 This warning is enabled by @option{-Wall}.
3473 @item -Wunused-label
3474 @opindex Wunused-label
3475 @opindex Wno-unused-label
3476 Warn whenever a label is declared but not used.
3477 This warning is enabled by @option{-Wall}.
3479 To suppress this warning use the @samp{unused} attribute
3480 (@pxref{Variable Attributes}).
3482 @item -Wunused-parameter
3483 @opindex Wunused-parameter
3484 @opindex Wno-unused-parameter
3485 Warn whenever a function parameter is unused aside from its declaration.
3487 To suppress this warning use the @samp{unused} attribute
3488 (@pxref{Variable Attributes}).
3490 @item -Wno-unused-result
3491 @opindex Wunused-result
3492 @opindex Wno-unused-result
3493 Do not warn if a caller of a function marked with attribute
3494 @code{warn_unused_result} (@pxref{Variable Attributes}) does not use
3495 its return value. The default is @option{-Wunused-result}.
3497 @item -Wunused-variable
3498 @opindex Wunused-variable
3499 @opindex Wno-unused-variable
3500 Warn whenever a local variable or non-constant static variable is unused
3501 aside from its declaration.
3502 This warning is enabled by @option{-Wall}.
3504 To suppress this warning use the @samp{unused} attribute
3505 (@pxref{Variable Attributes}).
3507 @item -Wunused-value
3508 @opindex Wunused-value
3509 @opindex Wno-unused-value
3510 Warn whenever a statement computes a result that is explicitly not
3511 used. To suppress this warning cast the unused expression to
3512 @samp{void}. This includes an expression-statement or the left-hand
3513 side of a comma expression that contains no side effects. For example,
3514 an expression such as @samp{x[i,j]} will cause a warning, while
3515 @samp{x[(void)i,j]} will not.
3517 This warning is enabled by @option{-Wall}.
3519 @item -Wunused
3520 @opindex Wunused
3521 @opindex Wno-unused
3522 All the above @option{-Wunused} options combined.
3524 In order to get a warning about an unused function parameter, you must
3525 either specify @samp{-Wextra -Wunused} (note that @samp{-Wall} implies
3526 @samp{-Wunused}), or separately specify @option{-Wunused-parameter}.
3528 @item -Wuninitialized
3529 @opindex Wuninitialized
3530 @opindex Wno-uninitialized
3531 Warn if an automatic variable is used without first being initialized
3532 or if a variable may be clobbered by a @code{setjmp} call. In C++,
3533 warn if a non-static reference or non-static @samp{const} member
3534 appears in a class without constructors.
3536 If you want to warn about code which uses the uninitialized value of the
3537 variable in its own initializer, use the @option{-Winit-self} option.
3539 These warnings occur for individual uninitialized or clobbered
3540 elements of structure, union or array variables as well as for
3541 variables which are uninitialized or clobbered as a whole.  They do
3542 not occur for variables or elements declared @code{volatile}.  Because
3543 these warnings depend on optimization, the exact variables or elements
3544 for which there are warnings will depend on the precise optimization
3545 options and version of GCC used.
3547 Note that there may be no warning about a variable that is used only
3548 to compute a value that itself is never used, because such
3549 computations may be deleted by data flow analysis before the warnings
3550 are printed.
3552 @item -Wmaybe-uninitialized
3553 @opindex Wmaybe-uninitialized
3554 @opindex Wno-maybe-uninitialized
3555 For an automatic variable, if there exists a path from the function
3556 entry to a use of the variable that is initialized, but there exist
3557 some other paths the variable is not initialized, the compiler will
3558 emit a warning if it can not prove the uninitialized paths do not
3559 happen at runtime. These warnings are made optional because GCC is
3560 not smart enough to see all the reasons why the code might be correct
3561 despite appearing to have an error.  Here is one example of how
3562 this can happen:
3564 @smallexample
3565 @group
3567   int x;
3568   switch (y)
3569     @{
3570     case 1: x = 1;
3571       break;
3572     case 2: x = 4;
3573       break;
3574     case 3: x = 5;
3575     @}
3576   foo (x);
3578 @end group
3579 @end smallexample
3581 @noindent
3582 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
3583 always initialized, but GCC doesn't know this. To suppress the
3584 warning, the user needs to provide a default case with assert(0) or
3585 similar code.
3587 @cindex @code{longjmp} warnings
3588 This option also warns when a non-volatile automatic variable might be
3589 changed by a call to @code{longjmp}.  These warnings as well are possible
3590 only in optimizing compilation.
3592 The compiler sees only the calls to @code{setjmp}.  It cannot know
3593 where @code{longjmp} will be called; in fact, a signal handler could
3594 call it at any point in the code.  As a result, you may get a warning
3595 even when there is in fact no problem because @code{longjmp} cannot
3596 in fact be called at the place which would cause a problem.
3598 Some spurious warnings can be avoided if you declare all the functions
3599 you use that never return as @code{noreturn}.  @xref{Function
3600 Attributes}.
3602 This warning is enabled by @option{-Wall} or @option{-Wextra}.
3604 @item -Wunknown-pragmas
3605 @opindex Wunknown-pragmas
3606 @opindex Wno-unknown-pragmas
3607 @cindex warning for unknown pragmas
3608 @cindex unknown pragmas, warning
3609 @cindex pragmas, warning of unknown
3610 Warn when a #pragma directive is encountered which is not understood by
3611 GCC@.  If this command line option is used, warnings will even be issued
3612 for unknown pragmas in system header files.  This is not the case if
3613 the warnings were only enabled by the @option{-Wall} command line option.
3615 @item -Wno-pragmas
3616 @opindex Wno-pragmas
3617 @opindex Wpragmas
3618 Do not warn about misuses of pragmas, such as incorrect parameters,
3619 invalid syntax, or conflicts between pragmas.  See also
3620 @samp{-Wunknown-pragmas}.
3622 @item -Wstrict-aliasing
3623 @opindex Wstrict-aliasing
3624 @opindex Wno-strict-aliasing
3625 This option is only active when @option{-fstrict-aliasing} is active.
3626 It warns about code which might break the strict aliasing rules that the
3627 compiler is using for optimization.  The warning does not catch all
3628 cases, but does attempt to catch the more common pitfalls.  It is
3629 included in @option{-Wall}.
3630 It is equivalent to @option{-Wstrict-aliasing=3}
3632 @item -Wstrict-aliasing=n
3633 @opindex Wstrict-aliasing=n
3634 @opindex Wno-strict-aliasing=n
3635 This option is only active when @option{-fstrict-aliasing} is active.
3636 It warns about code which might break the strict aliasing rules that the
3637 compiler is using for optimization.
3638 Higher levels correspond to higher accuracy (fewer false positives).
3639 Higher levels also correspond to more effort, similar to the way -O works.
3640 @option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=n},
3641 with n=3.
3643 Level 1: Most aggressive, quick, least accurate.
3644 Possibly useful when higher levels
3645 do not warn but -fstrict-aliasing still breaks the code, as it has very few
3646 false negatives.  However, it has many false positives.
3647 Warns for all pointer conversions between possibly incompatible types,
3648 even if never dereferenced.  Runs in the frontend only.
3650 Level 2: Aggressive, quick, not too precise.
3651 May still have many false positives (not as many as level 1 though),
3652 and few false negatives (but possibly more than level 1).
3653 Unlike level 1, it only warns when an address is taken.  Warns about
3654 incomplete types.  Runs in the frontend only.
3656 Level 3 (default for @option{-Wstrict-aliasing}):
3657 Should have very few false positives and few false
3658 negatives.  Slightly slower than levels 1 or 2 when optimization is enabled.
3659 Takes care of the common pun+dereference pattern in the frontend:
3660 @code{*(int*)&some_float}.
3661 If optimization is enabled, it also runs in the backend, where it deals
3662 with multiple statement cases using flow-sensitive points-to information.
3663 Only warns when the converted pointer is dereferenced.
3664 Does not warn about incomplete types.
3666 @item -Wstrict-overflow
3667 @itemx -Wstrict-overflow=@var{n}
3668 @opindex Wstrict-overflow
3669 @opindex Wno-strict-overflow
3670 This option is only active when @option{-fstrict-overflow} is active.
3671 It warns about cases where the compiler optimizes based on the
3672 assumption that signed overflow does not occur.  Note that it does not
3673 warn about all cases where the code might overflow: it only warns
3674 about cases where the compiler implements some optimization.  Thus
3675 this warning depends on the optimization level.
3677 An optimization which assumes that signed overflow does not occur is
3678 perfectly safe if the values of the variables involved are such that
3679 overflow never does, in fact, occur.  Therefore this warning can
3680 easily give a false positive: a warning about code which is not
3681 actually a problem.  To help focus on important issues, several
3682 warning levels are defined.  No warnings are issued for the use of
3683 undefined signed overflow when estimating how many iterations a loop
3684 will require, in particular when determining whether a loop will be
3685 executed at all.
3687 @table @gcctabopt
3688 @item -Wstrict-overflow=1
3689 Warn about cases which are both questionable and easy to avoid.  For
3690 example: @code{x + 1 > x}; with @option{-fstrict-overflow}, the
3691 compiler will simplify this to @code{1}.  This level of
3692 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
3693 are not, and must be explicitly requested.
3695 @item -Wstrict-overflow=2
3696 Also warn about other cases where a comparison is simplified to a
3697 constant.  For example: @code{abs (x) >= 0}.  This can only be
3698 simplified when @option{-fstrict-overflow} is in effect, because
3699 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
3700 zero.  @option{-Wstrict-overflow} (with no level) is the same as
3701 @option{-Wstrict-overflow=2}.
3703 @item -Wstrict-overflow=3
3704 Also warn about other cases where a comparison is simplified.  For
3705 example: @code{x + 1 > 1} will be simplified to @code{x > 0}.
3707 @item -Wstrict-overflow=4
3708 Also warn about other simplifications not covered by the above cases.
3709 For example: @code{(x * 10) / 5} will be simplified to @code{x * 2}.
3711 @item -Wstrict-overflow=5
3712 Also warn about cases where the compiler reduces the magnitude of a
3713 constant involved in a comparison.  For example: @code{x + 2 > y} will
3714 be simplified to @code{x + 1 >= y}.  This is reported only at the
3715 highest warning level because this simplification applies to many
3716 comparisons, so this warning level will give a very large number of
3717 false positives.
3718 @end table
3720 @item -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{]}
3721 @opindex Wsuggest-attribute=
3722 @opindex Wno-suggest-attribute=
3723 Warn for cases where adding an attribute may be beneficial. The
3724 attributes currently supported are listed below.
3726 @table @gcctabopt
3727 @item -Wsuggest-attribute=pure
3728 @itemx -Wsuggest-attribute=const
3729 @itemx -Wsuggest-attribute=noreturn
3730 @opindex Wsuggest-attribute=pure
3731 @opindex Wno-suggest-attribute=pure
3732 @opindex Wsuggest-attribute=const
3733 @opindex Wno-suggest-attribute=const
3734 @opindex Wsuggest-attribute=noreturn
3735 @opindex Wno-suggest-attribute=noreturn
3737 Warn about functions which might be candidates for attributes
3738 @code{pure}, @code{const} or @code{noreturn}.  The compiler only warns for
3739 functions visible in other compilation units or (in the case of @code{pure} and
3740 @code{const}) if it cannot prove that the function returns normally. A function
3741 returns normally if it doesn't contain an infinite loop nor returns abnormally
3742 by throwing, calling @code{abort()} or trapping.  This analysis requires option
3743 @option{-fipa-pure-const}, which is enabled by default at @option{-O} and
3744 higher.  Higher optimization levels improve the accuracy of the analysis.
3745 @end table
3747 @item -Warray-bounds
3748 @opindex Wno-array-bounds
3749 @opindex Warray-bounds
3750 This option is only active when @option{-ftree-vrp} is active
3751 (default for @option{-O2} and above). It warns about subscripts to arrays
3752 that are always out of bounds. This warning is enabled by @option{-Wall}.
3754 @item -Wno-div-by-zero
3755 @opindex Wno-div-by-zero
3756 @opindex Wdiv-by-zero
3757 Do not warn about compile-time integer division by zero.  Floating point
3758 division by zero is not warned about, as it can be a legitimate way of
3759 obtaining infinities and NaNs.
3761 @item -Wsystem-headers
3762 @opindex Wsystem-headers
3763 @opindex Wno-system-headers
3764 @cindex warnings from system headers
3765 @cindex system headers, warnings from
3766 Print warning messages for constructs found in system header files.
3767 Warnings from system headers are normally suppressed, on the assumption
3768 that they usually do not indicate real problems and would only make the
3769 compiler output harder to read.  Using this command line option tells
3770 GCC to emit warnings from system headers as if they occurred in user
3771 code.  However, note that using @option{-Wall} in conjunction with this
3772 option will @emph{not} warn about unknown pragmas in system
3773 headers---for that, @option{-Wunknown-pragmas} must also be used.
3775 @item -Wtrampolines
3776 @opindex Wtrampolines
3777 @opindex Wno-trampolines
3778  Warn about trampolines generated for pointers to nested functions.
3780  A trampoline is a small piece of data or code that is created at run
3781  time on the stack when the address of a nested function is taken, and
3782  is used to call the nested function indirectly.  For some targets, it
3783  is made up of data only and thus requires no special treatment.  But,
3784  for most targets, it is made up of code and thus requires the stack
3785  to be made executable in order for the program to work properly.
3787 @item -Wfloat-equal
3788 @opindex Wfloat-equal
3789 @opindex Wno-float-equal
3790 Warn if floating point values are used in equality comparisons.
3792 The idea behind this is that sometimes it is convenient (for the
3793 programmer) to consider floating-point values as approximations to
3794 infinitely precise real numbers.  If you are doing this, then you need
3795 to compute (by analyzing the code, or in some other way) the maximum or
3796 likely maximum error that the computation introduces, and allow for it
3797 when performing comparisons (and when producing output, but that's a
3798 different problem).  In particular, instead of testing for equality, you
3799 would check to see whether the two values have ranges that overlap; and
3800 this is done with the relational operators, so equality comparisons are
3801 probably mistaken.
3803 @item -Wtraditional @r{(C and Objective-C only)}
3804 @opindex Wtraditional
3805 @opindex Wno-traditional
3806 Warn about certain constructs that behave differently in traditional and
3807 ISO C@.  Also warn about ISO C constructs that have no traditional C
3808 equivalent, and/or problematic constructs which should be avoided.
3810 @itemize @bullet
3811 @item
3812 Macro parameters that appear within string literals in the macro body.
3813 In traditional C macro replacement takes place within string literals,
3814 but does not in ISO C@.
3816 @item
3817 In traditional C, some preprocessor directives did not exist.
3818 Traditional preprocessors would only consider a line to be a directive
3819 if the @samp{#} appeared in column 1 on the line.  Therefore
3820 @option{-Wtraditional} warns about directives that traditional C
3821 understands but would ignore because the @samp{#} does not appear as the
3822 first character on the line.  It also suggests you hide directives like
3823 @samp{#pragma} not understood by traditional C by indenting them.  Some
3824 traditional implementations would not recognize @samp{#elif}, so it
3825 suggests avoiding it altogether.
3827 @item
3828 A function-like macro that appears without arguments.
3830 @item
3831 The unary plus operator.
3833 @item
3834 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating point
3835 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
3836 constants.)  Note, these suffixes appear in macros defined in the system
3837 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
3838 Use of these macros in user code might normally lead to spurious
3839 warnings, however GCC's integrated preprocessor has enough context to
3840 avoid warning in these cases.
3842 @item
3843 A function declared external in one block and then used after the end of
3844 the block.
3846 @item
3847 A @code{switch} statement has an operand of type @code{long}.
3849 @item
3850 A non-@code{static} function declaration follows a @code{static} one.
3851 This construct is not accepted by some traditional C compilers.
3853 @item
3854 The ISO type of an integer constant has a different width or
3855 signedness from its traditional type.  This warning is only issued if
3856 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
3857 typically represent bit patterns, are not warned about.
3859 @item
3860 Usage of ISO string concatenation is detected.
3862 @item
3863 Initialization of automatic aggregates.
3865 @item
3866 Identifier conflicts with labels.  Traditional C lacks a separate
3867 namespace for labels.
3869 @item
3870 Initialization of unions.  If the initializer is zero, the warning is
3871 omitted.  This is done under the assumption that the zero initializer in
3872 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
3873 initializer warnings and relies on default initialization to zero in the
3874 traditional C case.
3876 @item
3877 Conversions by prototypes between fixed/floating point values and vice
3878 versa.  The absence of these prototypes when compiling with traditional
3879 C would cause serious problems.  This is a subset of the possible
3880 conversion warnings, for the full set use @option{-Wtraditional-conversion}.
3882 @item
3883 Use of ISO C style function definitions.  This warning intentionally is
3884 @emph{not} issued for prototype declarations or variadic functions
3885 because these ISO C features will appear in your code when using
3886 libiberty's traditional C compatibility macros, @code{PARAMS} and
3887 @code{VPARAMS}.  This warning is also bypassed for nested functions
3888 because that feature is already a GCC extension and thus not relevant to
3889 traditional C compatibility.
3890 @end itemize
3892 @item -Wtraditional-conversion @r{(C and Objective-C only)}
3893 @opindex Wtraditional-conversion
3894 @opindex Wno-traditional-conversion
3895 Warn if a prototype causes a type conversion that is different from what
3896 would happen to the same argument in the absence of a prototype.  This
3897 includes conversions of fixed point to floating and vice versa, and
3898 conversions changing the width or signedness of a fixed point argument
3899 except when the same as the default promotion.
3901 @item -Wdeclaration-after-statement @r{(C and Objective-C only)}
3902 @opindex Wdeclaration-after-statement
3903 @opindex Wno-declaration-after-statement
3904 Warn when a declaration is found after a statement in a block.  This
3905 construct, known from C++, was introduced with ISO C99 and is by default
3906 allowed in GCC@.  It is not supported by ISO C90 and was not supported by
3907 GCC versions before GCC 3.0.  @xref{Mixed Declarations}.
3909 @item -Wundef
3910 @opindex Wundef
3911 @opindex Wno-undef
3912 Warn if an undefined identifier is evaluated in an @samp{#if} directive.
3914 @item -Wno-endif-labels
3915 @opindex Wno-endif-labels
3916 @opindex Wendif-labels
3917 Do not warn whenever an @samp{#else} or an @samp{#endif} are followed by text.
3919 @item -Wshadow
3920 @opindex Wshadow
3921 @opindex Wno-shadow
3922 Warn whenever a local variable or type declaration shadows another variable,
3923 parameter, type, or class member (in C++), or whenever a built-in function
3924 is shadowed. Note that in C++, the compiler will not warn if a local variable
3925 shadows a struct/class/enum, but will warn if it shadows an explicit typedef.
3927 @item -Wlarger-than=@var{len}
3928 @opindex Wlarger-than=@var{len}
3929 @opindex Wlarger-than-@var{len}
3930 Warn whenever an object of larger than @var{len} bytes is defined.
3932 @item -Wframe-larger-than=@var{len}
3933 @opindex Wframe-larger-than
3934 Warn if the size of a function frame is larger than @var{len} bytes.
3935 The computation done to determine the stack frame size is approximate
3936 and not conservative.
3937 The actual requirements may be somewhat greater than @var{len}
3938 even if you do not get a warning.  In addition, any space allocated
3939 via @code{alloca}, variable-length arrays, or related constructs
3940 is not included by the compiler when determining
3941 whether or not to issue a warning.
3943 @item -Wstack-usage=@var{len}
3944 @opindex Wstack-usage
3945 Warn if the stack usage of a function might be larger than @var{len} bytes.
3946 The computation done to determine the stack usage is conservative.
3947 Any space allocated via @code{alloca}, variable-length arrays, or related
3948 constructs is included by the compiler when determining whether or not to
3949 issue a warning.
3951 The message is in keeping with the output of @option{-fstack-usage}.
3953 @itemize
3954 @item
3955 If the stack usage is fully static but exceeds the specified amount, it's:
3957 @smallexample
3958   warning: stack usage is 1120 bytes
3959 @end smallexample
3960 @item
3961 If the stack usage is (partly) dynamic but bounded, it's:
3963 @smallexample
3964   warning: stack usage might be 1648 bytes
3965 @end smallexample
3966 @item
3967 If the stack usage is (partly) dynamic and not bounded, it's:
3969 @smallexample
3970   warning: stack usage might be unbounded
3971 @end smallexample
3972 @end itemize
3974 @item -Wunsafe-loop-optimizations
3975 @opindex Wunsafe-loop-optimizations
3976 @opindex Wno-unsafe-loop-optimizations
3977 Warn if the loop cannot be optimized because the compiler could not
3978 assume anything on the bounds of the loop indices.  With
3979 @option{-funsafe-loop-optimizations} warn if the compiler made
3980 such assumptions.
3982 @item -Wno-pedantic-ms-format @r{(MinGW targets only)}
3983 @opindex Wno-pedantic-ms-format
3984 @opindex Wpedantic-ms-format
3985 Disables the warnings about non-ISO @code{printf} / @code{scanf} format
3986 width specifiers @code{I32}, @code{I64}, and @code{I} used on Windows targets
3987 depending on the MS runtime, when you are using the options @option{-Wformat}
3988 and @option{-pedantic} without gnu-extensions.
3990 @item -Wpointer-arith
3991 @opindex Wpointer-arith
3992 @opindex Wno-pointer-arith
3993 Warn about anything that depends on the ``size of'' a function type or
3994 of @code{void}.  GNU C assigns these types a size of 1, for
3995 convenience in calculations with @code{void *} pointers and pointers
3996 to functions.  In C++, warn also when an arithmetic operation involves
3997 @code{NULL}.  This warning is also enabled by @option{-pedantic}.
3999 @item -Wtype-limits
4000 @opindex Wtype-limits
4001 @opindex Wno-type-limits
4002 Warn if a comparison is always true or always false due to the limited
4003 range of the data type, but do not warn for constant expressions.  For
4004 example, warn if an unsigned variable is compared against zero with
4005 @samp{<} or @samp{>=}.  This warning is also enabled by
4006 @option{-Wextra}.
4008 @item -Wbad-function-cast @r{(C and Objective-C only)}
4009 @opindex Wbad-function-cast
4010 @opindex Wno-bad-function-cast
4011 Warn whenever a function call is cast to a non-matching type.
4012 For example, warn if @code{int malloc()} is cast to @code{anything *}.
4014 @item -Wc++-compat @r{(C and Objective-C only)}
4015 Warn about ISO C constructs that are outside of the common subset of
4016 ISO C and ISO C++, e.g.@: request for implicit conversion from
4017 @code{void *} to a pointer to non-@code{void} type.
4019 @item -Wc++0x-compat @r{(C++ and Objective-C++ only)}
4020 Warn about C++ constructs whose meaning differs between ISO C++ 1998 and
4021 ISO C++ 200x, e.g., identifiers in ISO C++ 1998 that will become keywords
4022 in ISO C++ 200x.  This warning is enabled by @option{-Wall}.
4024 @item -Wcast-qual
4025 @opindex Wcast-qual
4026 @opindex Wno-cast-qual
4027 Warn whenever a pointer is cast so as to remove a type qualifier from
4028 the target type.  For example, warn if a @code{const char *} is cast
4029 to an ordinary @code{char *}.
4031 Also warn when making a cast which introduces a type qualifier in an
4032 unsafe way.  For example, casting @code{char **} to @code{const char **}
4033 is unsafe, as in this example:
4035 @smallexample
4036   /* p is char ** value.  */
4037   const char **q = (const char **) p;
4038   /* Assignment of readonly string to const char * is OK.  */
4039   *q = "string";
4040   /* Now char** pointer points to read-only memory.  */
4041   **p = 'b';
4042 @end smallexample
4044 @item -Wcast-align
4045 @opindex Wcast-align
4046 @opindex Wno-cast-align
4047 Warn whenever a pointer is cast such that the required alignment of the
4048 target is increased.  For example, warn if a @code{char *} is cast to
4049 an @code{int *} on machines where integers can only be accessed at
4050 two- or four-byte boundaries.
4052 @item -Wwrite-strings
4053 @opindex Wwrite-strings
4054 @opindex Wno-write-strings
4055 When compiling C, give string constants the type @code{const
4056 char[@var{length}]} so that copying the address of one into a
4057 non-@code{const} @code{char *} pointer will get a warning.  These
4058 warnings will help you find at compile time code that can try to write
4059 into a string constant, but only if you have been very careful about
4060 using @code{const} in declarations and prototypes.  Otherwise, it will
4061 just be a nuisance. This is why we did not make @option{-Wall} request
4062 these warnings.
4064 When compiling C++, warn about the deprecated conversion from string
4065 literals to @code{char *}.  This warning is enabled by default for C++
4066 programs.
4068 @item -Wclobbered
4069 @opindex Wclobbered
4070 @opindex Wno-clobbered
4071 Warn for variables that might be changed by @samp{longjmp} or
4072 @samp{vfork}.  This warning is also enabled by @option{-Wextra}.
4074 @item -Wconversion
4075 @opindex Wconversion
4076 @opindex Wno-conversion
4077 Warn for implicit conversions that may alter a value. This includes
4078 conversions between real and integer, like @code{abs (x)} when
4079 @code{x} is @code{double}; conversions between signed and unsigned,
4080 like @code{unsigned ui = -1}; and conversions to smaller types, like
4081 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
4082 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
4083 changed by the conversion like in @code{abs (2.0)}.  Warnings about
4084 conversions between signed and unsigned integers can be disabled by
4085 using @option{-Wno-sign-conversion}.
4087 For C++, also warn for confusing overload resolution for user-defined
4088 conversions; and conversions that will never use a type conversion
4089 operator: conversions to @code{void}, the same type, a base class or a
4090 reference to them. Warnings about conversions between signed and
4091 unsigned integers are disabled by default in C++ unless
4092 @option{-Wsign-conversion} is explicitly enabled.
4094 @item -Wno-conversion-null @r{(C++ and Objective-C++ only)}
4095 @opindex Wconversion-null
4096 @opindex Wno-conversion-null
4097 Do not warn for conversions between @code{NULL} and non-pointer
4098 types. @option{-Wconversion-null} is enabled by default.
4100 @item -Wempty-body
4101 @opindex Wempty-body
4102 @opindex Wno-empty-body
4103 Warn if an empty body occurs in an @samp{if}, @samp{else} or @samp{do
4104 while} statement.  This warning is also enabled by @option{-Wextra}.
4106 @item -Wenum-compare
4107 @opindex Wenum-compare
4108 @opindex Wno-enum-compare
4109 Warn about a comparison between values of different enum types. In C++
4110 this warning is enabled by default.  In C this warning is enabled by
4111 @option{-Wall}.
4113 @item -Wjump-misses-init @r{(C, Objective-C only)}
4114 @opindex Wjump-misses-init
4115 @opindex Wno-jump-misses-init
4116 Warn if a @code{goto} statement or a @code{switch} statement jumps
4117 forward across the initialization of a variable, or jumps backward to a
4118 label after the variable has been initialized.  This only warns about
4119 variables which are initialized when they are declared.  This warning is
4120 only supported for C and Objective C; in C++ this sort of branch is an
4121 error in any case.
4123 @option{-Wjump-misses-init} is included in @option{-Wc++-compat}.  It
4124 can be disabled with the @option{-Wno-jump-misses-init} option.
4126 @item -Wsign-compare
4127 @opindex Wsign-compare
4128 @opindex Wno-sign-compare
4129 @cindex warning for comparison of signed and unsigned values
4130 @cindex comparison of signed and unsigned values, warning
4131 @cindex signed and unsigned values, comparison warning
4132 Warn when a comparison between signed and unsigned values could produce
4133 an incorrect result when the signed value is converted to unsigned.
4134 This warning is also enabled by @option{-Wextra}; to get the other warnings
4135 of @option{-Wextra} without this warning, use @samp{-Wextra -Wno-sign-compare}.
4137 @item -Wsign-conversion
4138 @opindex Wsign-conversion
4139 @opindex Wno-sign-conversion
4140 Warn for implicit conversions that may change the sign of an integer
4141 value, like assigning a signed integer expression to an unsigned
4142 integer variable. An explicit cast silences the warning. In C, this
4143 option is enabled also by @option{-Wconversion}.
4145 @item -Waddress
4146 @opindex Waddress
4147 @opindex Wno-address
4148 Warn about suspicious uses of memory addresses. These include using
4149 the address of a function in a conditional expression, such as
4150 @code{void func(void); if (func)}, and comparisons against the memory
4151 address of a string literal, such as @code{if (x == "abc")}.  Such
4152 uses typically indicate a programmer error: the address of a function
4153 always evaluates to true, so their use in a conditional usually
4154 indicate that the programmer forgot the parentheses in a function
4155 call; and comparisons against string literals result in unspecified
4156 behavior and are not portable in C, so they usually indicate that the
4157 programmer intended to use @code{strcmp}.  This warning is enabled by
4158 @option{-Wall}.
4160 @item -Wlogical-op
4161 @opindex Wlogical-op
4162 @opindex Wno-logical-op
4163 Warn about suspicious uses of logical operators in expressions.
4164 This includes using logical operators in contexts where a
4165 bit-wise operator is likely to be expected.
4167 @item -Waggregate-return
4168 @opindex Waggregate-return
4169 @opindex Wno-aggregate-return
4170 Warn if any functions that return structures or unions are defined or
4171 called.  (In languages where you can return an array, this also elicits
4172 a warning.)
4174 @item -Wno-attributes
4175 @opindex Wno-attributes
4176 @opindex Wattributes
4177 Do not warn if an unexpected @code{__attribute__} is used, such as
4178 unrecognized attributes, function attributes applied to variables,
4179 etc.  This will not stop errors for incorrect use of supported
4180 attributes.
4182 @item -Wno-builtin-macro-redefined
4183 @opindex Wno-builtin-macro-redefined
4184 @opindex Wbuiltin-macro-redefined
4185 Do not warn if certain built-in macros are redefined.  This suppresses
4186 warnings for redefinition of @code{__TIMESTAMP__}, @code{__TIME__},
4187 @code{__DATE__}, @code{__FILE__}, and @code{__BASE_FILE__}.
4189 @item -Wstrict-prototypes @r{(C and Objective-C only)}
4190 @opindex Wstrict-prototypes
4191 @opindex Wno-strict-prototypes
4192 Warn if a function is declared or defined without specifying the
4193 argument types.  (An old-style function definition is permitted without
4194 a warning if preceded by a declaration which specifies the argument
4195 types.)
4197 @item -Wold-style-declaration @r{(C and Objective-C only)}
4198 @opindex Wold-style-declaration
4199 @opindex Wno-old-style-declaration
4200 Warn for obsolescent usages, according to the C Standard, in a
4201 declaration. For example, warn if storage-class specifiers like
4202 @code{static} are not the first things in a declaration.  This warning
4203 is also enabled by @option{-Wextra}.
4205 @item -Wold-style-definition @r{(C and Objective-C only)}
4206 @opindex Wold-style-definition
4207 @opindex Wno-old-style-definition
4208 Warn if an old-style function definition is used.  A warning is given
4209 even if there is a previous prototype.
4211 @item -Wmissing-parameter-type @r{(C and Objective-C only)}
4212 @opindex Wmissing-parameter-type
4213 @opindex Wno-missing-parameter-type
4214 A function parameter is declared without a type specifier in K&R-style
4215 functions:
4217 @smallexample
4218 void foo(bar) @{ @}
4219 @end smallexample
4221 This warning is also enabled by @option{-Wextra}.
4223 @item -Wmissing-prototypes @r{(C and Objective-C only)}
4224 @opindex Wmissing-prototypes
4225 @opindex Wno-missing-prototypes
4226 Warn if a global function is defined without a previous prototype
4227 declaration.  This warning is issued even if the definition itself
4228 provides a prototype.  The aim is to detect global functions that fail
4229 to be declared in header files.
4231 @item -Wmissing-declarations
4232 @opindex Wmissing-declarations
4233 @opindex Wno-missing-declarations
4234 Warn if a global function is defined without a previous declaration.
4235 Do so even if the definition itself provides a prototype.
4236 Use this option to detect global functions that are not declared in
4237 header files.  In C++, no warnings are issued for function templates,
4238 or for inline functions, or for functions in anonymous namespaces.
4240 @item -Wmissing-field-initializers
4241 @opindex Wmissing-field-initializers
4242 @opindex Wno-missing-field-initializers
4243 @opindex W
4244 @opindex Wextra
4245 @opindex Wno-extra
4246 Warn if a structure's initializer has some fields missing.  For
4247 example, the following code would cause such a warning, because
4248 @code{x.h} is implicitly zero:
4250 @smallexample
4251 struct s @{ int f, g, h; @};
4252 struct s x = @{ 3, 4 @};
4253 @end smallexample
4255 This option does not warn about designated initializers, so the following
4256 modification would not trigger a warning:
4258 @smallexample
4259 struct s @{ int f, g, h; @};
4260 struct s x = @{ .f = 3, .g = 4 @};
4261 @end smallexample
4263 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
4264 warnings without this one, use @samp{-Wextra -Wno-missing-field-initializers}.
4266 @item -Wmissing-format-attribute
4267 @opindex Wmissing-format-attribute
4268 @opindex Wno-missing-format-attribute
4269 @opindex Wformat
4270 @opindex Wno-format
4271 Warn about function pointers which might be candidates for @code{format}
4272 attributes.  Note these are only possible candidates, not absolute ones.
4273 GCC will guess that function pointers with @code{format} attributes that
4274 are used in assignment, initialization, parameter passing or return
4275 statements should have a corresponding @code{format} attribute in the
4276 resulting type.  I.e.@: the left-hand side of the assignment or
4277 initialization, the type of the parameter variable, or the return type
4278 of the containing function respectively should also have a @code{format}
4279 attribute to avoid the warning.
4281 GCC will also warn about function definitions which might be
4282 candidates for @code{format} attributes.  Again, these are only
4283 possible candidates.  GCC will guess that @code{format} attributes
4284 might be appropriate for any function that calls a function like
4285 @code{vprintf} or @code{vscanf}, but this might not always be the
4286 case, and some functions for which @code{format} attributes are
4287 appropriate may not be detected.
4289 @item -Wno-multichar
4290 @opindex Wno-multichar
4291 @opindex Wmultichar
4292 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
4293 Usually they indicate a typo in the user's code, as they have
4294 implementation-defined values, and should not be used in portable code.
4296 @item -Wnormalized=<none|id|nfc|nfkc>
4297 @opindex Wnormalized=
4298 @cindex NFC
4299 @cindex NFKC
4300 @cindex character set, input normalization
4301 In ISO C and ISO C++, two identifiers are different if they are
4302 different sequences of characters.  However, sometimes when characters
4303 outside the basic ASCII character set are used, you can have two
4304 different character sequences that look the same.  To avoid confusion,
4305 the ISO 10646 standard sets out some @dfn{normalization rules} which
4306 when applied ensure that two sequences that look the same are turned into
4307 the same sequence.  GCC can warn you if you are using identifiers which
4308 have not been normalized; this option controls that warning.
4310 There are four levels of warning that GCC supports.  The default is
4311 @option{-Wnormalized=nfc}, which warns about any identifier which is
4312 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
4313 recommended form for most uses.
4315 Unfortunately, there are some characters which ISO C and ISO C++ allow
4316 in identifiers that when turned into NFC aren't allowable as
4317 identifiers.  That is, there's no way to use these symbols in portable
4318 ISO C or C++ and have all your identifiers in NFC@.
4319 @option{-Wnormalized=id} suppresses the warning for these characters.
4320 It is hoped that future versions of the standards involved will correct
4321 this, which is why this option is not the default.
4323 You can switch the warning off for all characters by writing
4324 @option{-Wnormalized=none}.  You would only want to do this if you
4325 were using some other normalization scheme (like ``D''), because
4326 otherwise you can easily create bugs that are literally impossible to see.
4328 Some characters in ISO 10646 have distinct meanings but look identical
4329 in some fonts or display methodologies, especially once formatting has
4330 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
4331 LETTER N'', will display just like a regular @code{n} which has been
4332 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
4333 normalization scheme to convert all these into a standard form as
4334 well, and GCC will warn if your code is not in NFKC if you use
4335 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
4336 about every identifier that contains the letter O because it might be
4337 confused with the digit 0, and so is not the default, but may be
4338 useful as a local coding convention if the programming environment is
4339 unable to be fixed to display these characters distinctly.
4341 @item -Wno-deprecated
4342 @opindex Wno-deprecated
4343 @opindex Wdeprecated
4344 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
4346 @item -Wno-deprecated-declarations
4347 @opindex Wno-deprecated-declarations
4348 @opindex Wdeprecated-declarations
4349 Do not warn about uses of functions (@pxref{Function Attributes}),
4350 variables (@pxref{Variable Attributes}), and types (@pxref{Type
4351 Attributes}) marked as deprecated by using the @code{deprecated}
4352 attribute.
4354 @item -Wno-overflow
4355 @opindex Wno-overflow
4356 @opindex Woverflow
4357 Do not warn about compile-time overflow in constant expressions.
4359 @item -Woverride-init @r{(C and Objective-C only)}
4360 @opindex Woverride-init
4361 @opindex Wno-override-init
4362 @opindex W
4363 @opindex Wextra
4364 @opindex Wno-extra
4365 Warn if an initialized field without side effects is overridden when
4366 using designated initializers (@pxref{Designated Inits, , Designated
4367 Initializers}).
4369 This warning is included in @option{-Wextra}.  To get other
4370 @option{-Wextra} warnings without this one, use @samp{-Wextra
4371 -Wno-override-init}.
4373 @item -Wpacked
4374 @opindex Wpacked
4375 @opindex Wno-packed
4376 Warn if a structure is given the packed attribute, but the packed
4377 attribute has no effect on the layout or size of the structure.
4378 Such structures may be mis-aligned for little benefit.  For
4379 instance, in this code, the variable @code{f.x} in @code{struct bar}
4380 will be misaligned even though @code{struct bar} does not itself
4381 have the packed attribute:
4383 @smallexample
4384 @group
4385 struct foo @{
4386   int x;
4387   char a, b, c, d;
4388 @} __attribute__((packed));
4389 struct bar @{
4390   char z;
4391   struct foo f;
4393 @end group
4394 @end smallexample
4396 @item -Wpacked-bitfield-compat
4397 @opindex Wpacked-bitfield-compat
4398 @opindex Wno-packed-bitfield-compat
4399 The 4.1, 4.2 and 4.3 series of GCC ignore the @code{packed} attribute
4400 on bit-fields of type @code{char}.  This has been fixed in GCC 4.4 but
4401 the change can lead to differences in the structure layout.  GCC
4402 informs you when the offset of such a field has changed in GCC 4.4.
4403 For example there is no longer a 4-bit padding between field @code{a}
4404 and @code{b} in this structure:
4406 @smallexample
4407 struct foo
4409   char a:4;
4410   char b:8;
4411 @} __attribute__ ((packed));
4412 @end smallexample
4414 This warning is enabled by default.  Use
4415 @option{-Wno-packed-bitfield-compat} to disable this warning.
4417 @item -Wpadded
4418 @opindex Wpadded
4419 @opindex Wno-padded
4420 Warn if padding is included in a structure, either to align an element
4421 of the structure or to align the whole structure.  Sometimes when this
4422 happens it is possible to rearrange the fields of the structure to
4423 reduce the padding and so make the structure smaller.
4425 @item -Wredundant-decls
4426 @opindex Wredundant-decls
4427 @opindex Wno-redundant-decls
4428 Warn if anything is declared more than once in the same scope, even in
4429 cases where multiple declaration is valid and changes nothing.
4431 @item -Wnested-externs @r{(C and Objective-C only)}
4432 @opindex Wnested-externs
4433 @opindex Wno-nested-externs
4434 Warn if an @code{extern} declaration is encountered within a function.
4436 @item -Winline
4437 @opindex Winline
4438 @opindex Wno-inline
4439 Warn if a function can not be inlined and it was declared as inline.
4440 Even with this option, the compiler will not warn about failures to
4441 inline functions declared in system headers.
4443 The compiler uses a variety of heuristics to determine whether or not
4444 to inline a function.  For example, the compiler takes into account
4445 the size of the function being inlined and the amount of inlining
4446 that has already been done in the current function.  Therefore,
4447 seemingly insignificant changes in the source program can cause the
4448 warnings produced by @option{-Winline} to appear or disappear.
4450 @item -Wno-invalid-offsetof @r{(C++ and Objective-C++ only)}
4451 @opindex Wno-invalid-offsetof
4452 @opindex Winvalid-offsetof
4453 Suppress warnings from applying the @samp{offsetof} macro to a non-POD
4454 type.  According to the 1998 ISO C++ standard, applying @samp{offsetof}
4455 to a non-POD type is undefined.  In existing C++ implementations,
4456 however, @samp{offsetof} typically gives meaningful results even when
4457 applied to certain kinds of non-POD types. (Such as a simple
4458 @samp{struct} that fails to be a POD type only by virtue of having a
4459 constructor.)  This flag is for users who are aware that they are
4460 writing nonportable code and who have deliberately chosen to ignore the
4461 warning about it.
4463 The restrictions on @samp{offsetof} may be relaxed in a future version
4464 of the C++ standard.
4466 @item -Wno-int-to-pointer-cast
4467 @opindex Wno-int-to-pointer-cast
4468 @opindex Wint-to-pointer-cast
4469 Suppress warnings from casts to pointer type of an integer of a
4470 different size. In C++, casting to a pointer type of smaller size is
4471 an error. @option{Wint-to-pointer-cast} is enabled by default.
4474 @item -Wno-pointer-to-int-cast @r{(C and Objective-C only)}
4475 @opindex Wno-pointer-to-int-cast
4476 @opindex Wpointer-to-int-cast
4477 Suppress warnings from casts from a pointer to an integer type of a
4478 different size.
4480 @item -Winvalid-pch
4481 @opindex Winvalid-pch
4482 @opindex Wno-invalid-pch
4483 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
4484 the search path but can't be used.
4486 @item -Wlong-long
4487 @opindex Wlong-long
4488 @opindex Wno-long-long
4489 Warn if @samp{long long} type is used.  This is enabled by either
4490 @option{-pedantic} or @option{-Wtraditional} in ISO C90 and C++98
4491 modes.  To inhibit the warning messages, use @option{-Wno-long-long}.
4493 @item -Wvariadic-macros
4494 @opindex Wvariadic-macros
4495 @opindex Wno-variadic-macros
4496 Warn if variadic macros are used in pedantic ISO C90 mode, or the GNU
4497 alternate syntax when in pedantic ISO C99 mode.  This is default.
4498 To inhibit the warning messages, use @option{-Wno-variadic-macros}.
4500 @item -Wvla
4501 @opindex Wvla
4502 @opindex Wno-vla
4503 Warn if variable length array is used in the code.
4504 @option{-Wno-vla} will prevent the @option{-pedantic} warning of
4505 the variable length array.
4507 @item -Wvolatile-register-var
4508 @opindex Wvolatile-register-var
4509 @opindex Wno-volatile-register-var
4510 Warn if a register variable is declared volatile.  The volatile
4511 modifier does not inhibit all optimizations that may eliminate reads
4512 and/or writes to register variables.  This warning is enabled by
4513 @option{-Wall}.
4515 @item -Wdisabled-optimization
4516 @opindex Wdisabled-optimization
4517 @opindex Wno-disabled-optimization
4518 Warn if a requested optimization pass is disabled.  This warning does
4519 not generally indicate that there is anything wrong with your code; it
4520 merely indicates that GCC's optimizers were unable to handle the code
4521 effectively.  Often, the problem is that your code is too big or too
4522 complex; GCC will refuse to optimize programs when the optimization
4523 itself is likely to take inordinate amounts of time.
4525 @item -Wpointer-sign @r{(C and Objective-C only)}
4526 @opindex Wpointer-sign
4527 @opindex Wno-pointer-sign
4528 Warn for pointer argument passing or assignment with different signedness.
4529 This option is only supported for C and Objective-C@.  It is implied by
4530 @option{-Wall} and by @option{-pedantic}, which can be disabled with
4531 @option{-Wno-pointer-sign}.
4533 @item -Wstack-protector
4534 @opindex Wstack-protector
4535 @opindex Wno-stack-protector
4536 This option is only active when @option{-fstack-protector} is active.  It
4537 warns about functions that will not be protected against stack smashing.
4539 @item -Wno-mudflap
4540 @opindex Wno-mudflap
4541 Suppress warnings about constructs that cannot be instrumented by
4542 @option{-fmudflap}.
4544 @item -Woverlength-strings
4545 @opindex Woverlength-strings
4546 @opindex Wno-overlength-strings
4547 Warn about string constants which are longer than the ``minimum
4548 maximum'' length specified in the C standard.  Modern compilers
4549 generally allow string constants which are much longer than the
4550 standard's minimum limit, but very portable programs should avoid
4551 using longer strings.
4553 The limit applies @emph{after} string constant concatenation, and does
4554 not count the trailing NUL@.  In C90, the limit was 509 characters; in
4555 C99, it was raised to 4095.  C++98 does not specify a normative
4556 minimum maximum, so we do not diagnose overlength strings in C++@.
4558 This option is implied by @option{-pedantic}, and can be disabled with
4559 @option{-Wno-overlength-strings}.
4561 @item -Wunsuffixed-float-constants @r{(C and Objective-C only)}
4562 @opindex Wunsuffixed-float-constants
4564 GCC will issue a warning for any floating constant that does not have
4565 a suffix.  When used together with @option{-Wsystem-headers} it will
4566 warn about such constants in system header files.  This can be useful
4567 when preparing code to use with the @code{FLOAT_CONST_DECIMAL64} pragma
4568 from the decimal floating-point extension to C99.
4569 @end table
4571 @node Debugging Options
4572 @section Options for Debugging Your Program or GCC
4573 @cindex options, debugging
4574 @cindex debugging information options
4576 GCC has various special options that are used for debugging
4577 either your program or GCC:
4579 @table @gcctabopt
4580 @item -g
4581 @opindex g
4582 Produce debugging information in the operating system's native format
4583 (stabs, COFF, XCOFF, or DWARF 2)@.  GDB can work with this debugging
4584 information.
4586 On most systems that use stabs format, @option{-g} enables use of extra
4587 debugging information that only GDB can use; this extra information
4588 makes debugging work better in GDB but will probably make other debuggers
4589 crash or
4590 refuse to read the program.  If you want to control for certain whether
4591 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
4592 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
4594 GCC allows you to use @option{-g} with
4595 @option{-O}.  The shortcuts taken by optimized code may occasionally
4596 produce surprising results: some variables you declared may not exist
4597 at all; flow of control may briefly move where you did not expect it;
4598 some statements may not be executed because they compute constant
4599 results or their values were already at hand; some statements may
4600 execute in different places because they were moved out of loops.
4602 Nevertheless it proves possible to debug optimized output.  This makes
4603 it reasonable to use the optimizer for programs that might have bugs.
4605 The following options are useful when GCC is generated with the
4606 capability for more than one debugging format.
4608 @item -ggdb
4609 @opindex ggdb
4610 Produce debugging information for use by GDB@.  This means to use the
4611 most expressive format available (DWARF 2, stabs, or the native format
4612 if neither of those are supported), including GDB extensions if at all
4613 possible.
4615 @item -gstabs
4616 @opindex gstabs
4617 Produce debugging information in stabs format (if that is supported),
4618 without GDB extensions.  This is the format used by DBX on most BSD
4619 systems.  On MIPS, Alpha and System V Release 4 systems this option
4620 produces stabs debugging output which is not understood by DBX or SDB@.
4621 On System V Release 4 systems this option requires the GNU assembler.
4623 @item -feliminate-unused-debug-symbols
4624 @opindex feliminate-unused-debug-symbols
4625 Produce debugging information in stabs format (if that is supported),
4626 for only symbols that are actually used.
4628 @item -femit-class-debug-always
4629 Instead of emitting debugging information for a C++ class in only one
4630 object file, emit it in all object files using the class.  This option
4631 should be used only with debuggers that are unable to handle the way GCC
4632 normally emits debugging information for classes because using this
4633 option will increase the size of debugging information by as much as a
4634 factor of two.
4636 @item -fno-debug-types-section
4637 @opindex fno-debug-types-section
4638 @opindex fdebug-types-section
4639 By default when using DWARF v4 or higher type DIEs will be put into
4640 their own .debug_types section instead of making them part of the
4641 .debug_info section.  It is more efficient to put them in a separate
4642 comdat sections since the linker will then be able to remove duplicates.
4643 But not all DWARF consumers support .debug_types sections yet.
4645 @item -gstabs+
4646 @opindex gstabs+
4647 Produce debugging information in stabs format (if that is supported),
4648 using GNU extensions understood only by the GNU debugger (GDB)@.  The
4649 use of these extensions is likely to make other debuggers crash or
4650 refuse to read the program.
4652 @item -gcoff
4653 @opindex gcoff
4654 Produce debugging information in COFF format (if that is supported).
4655 This is the format used by SDB on most System V systems prior to
4656 System V Release 4.
4658 @item -gxcoff
4659 @opindex gxcoff
4660 Produce debugging information in XCOFF format (if that is supported).
4661 This is the format used by the DBX debugger on IBM RS/6000 systems.
4663 @item -gxcoff+
4664 @opindex gxcoff+
4665 Produce debugging information in XCOFF format (if that is supported),
4666 using GNU extensions understood only by the GNU debugger (GDB)@.  The
4667 use of these extensions is likely to make other debuggers crash or
4668 refuse to read the program, and may cause assemblers other than the GNU
4669 assembler (GAS) to fail with an error.
4671 @item -gdwarf-@var{version}
4672 @opindex gdwarf-@var{version}
4673 Produce debugging information in DWARF format (if that is
4674 supported).  This is the format used by DBX on IRIX 6.  The value
4675 of @var{version} may be either 2, 3 or 4; the default version is 2.
4677 Note that with DWARF version 2 some ports require, and will always
4678 use, some non-conflicting DWARF 3 extensions in the unwind tables.
4680 Version 4 may require GDB 7.0 and @option{-fvar-tracking-assignments}
4681 for maximum benefit.
4683 @item -gstrict-dwarf
4684 @opindex gstrict-dwarf
4685 Disallow using extensions of later DWARF standard version than selected
4686 with @option{-gdwarf-@var{version}}.  On most targets using non-conflicting
4687 DWARF extensions from later standard versions is allowed.
4689 @item -gno-strict-dwarf
4690 @opindex gno-strict-dwarf
4691 Allow using extensions of later DWARF standard version than selected with
4692 @option{-gdwarf-@var{version}}.
4694 @item -gvms
4695 @opindex gvms
4696 Produce debugging information in VMS debug format (if that is
4697 supported).  This is the format used by DEBUG on VMS systems.
4699 @item -g@var{level}
4700 @itemx -ggdb@var{level}
4701 @itemx -gstabs@var{level}
4702 @itemx -gcoff@var{level}
4703 @itemx -gxcoff@var{level}
4704 @itemx -gvms@var{level}
4705 Request debugging information and also use @var{level} to specify how
4706 much information.  The default level is 2.
4708 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
4709 @option{-g}.
4711 Level 1 produces minimal information, enough for making backtraces in
4712 parts of the program that you don't plan to debug.  This includes
4713 descriptions of functions and external variables, but no information
4714 about local variables and no line numbers.
4716 Level 3 includes extra information, such as all the macro definitions
4717 present in the program.  Some debuggers support macro expansion when
4718 you use @option{-g3}.
4720 @option{-gdwarf-2} does not accept a concatenated debug level, because
4721 GCC used to support an option @option{-gdwarf} that meant to generate
4722 debug information in version 1 of the DWARF format (which is very
4723 different from version 2), and it would have been too confusing.  That
4724 debug format is long obsolete, but the option cannot be changed now.
4725 Instead use an additional @option{-g@var{level}} option to change the
4726 debug level for DWARF.
4728 @item -gtoggle
4729 @opindex gtoggle
4730 Turn off generation of debug info, if leaving out this option would have
4731 generated it, or turn it on at level 2 otherwise.  The position of this
4732 argument in the command line does not matter, it takes effect after all
4733 other options are processed, and it does so only once, no matter how
4734 many times it is given.  This is mainly intended to be used with
4735 @option{-fcompare-debug}.
4737 @item -fdump-final-insns@r{[}=@var{file}@r{]}
4738 @opindex fdump-final-insns
4739 Dump the final internal representation (RTL) to @var{file}.  If the
4740 optional argument is omitted (or if @var{file} is @code{.}), the name
4741 of the dump file will be determined by appending @code{.gkd} to the
4742 compilation output file name.
4744 @item -fcompare-debug@r{[}=@var{opts}@r{]}
4745 @opindex fcompare-debug
4746 @opindex fno-compare-debug
4747 If no error occurs during compilation, run the compiler a second time,
4748 adding @var{opts} and @option{-fcompare-debug-second} to the arguments
4749 passed to the second compilation.  Dump the final internal
4750 representation in both compilations, and print an error if they differ.
4752 If the equal sign is omitted, the default @option{-gtoggle} is used.
4754 The environment variable @env{GCC_COMPARE_DEBUG}, if defined, non-empty
4755 and nonzero, implicitly enables @option{-fcompare-debug}.  If
4756 @env{GCC_COMPARE_DEBUG} is defined to a string starting with a dash,
4757 then it is used for @var{opts}, otherwise the default @option{-gtoggle}
4758 is used.
4760 @option{-fcompare-debug=}, with the equal sign but without @var{opts},
4761 is equivalent to @option{-fno-compare-debug}, which disables the dumping
4762 of the final representation and the second compilation, preventing even
4763 @env{GCC_COMPARE_DEBUG} from taking effect.
4765 To verify full coverage during @option{-fcompare-debug} testing, set
4766 @env{GCC_COMPARE_DEBUG} to say @samp{-fcompare-debug-not-overridden},
4767 which GCC will reject as an invalid option in any actual compilation
4768 (rather than preprocessing, assembly or linking).  To get just a
4769 warning, setting @env{GCC_COMPARE_DEBUG} to @samp{-w%n-fcompare-debug
4770 not overridden} will do.
4772 @item -fcompare-debug-second
4773 @opindex fcompare-debug-second
4774 This option is implicitly passed to the compiler for the second
4775 compilation requested by @option{-fcompare-debug}, along with options to
4776 silence warnings, and omitting other options that would cause
4777 side-effect compiler outputs to files or to the standard output.  Dump
4778 files and preserved temporary files are renamed so as to contain the
4779 @code{.gk} additional extension during the second compilation, to avoid
4780 overwriting those generated by the first.
4782 When this option is passed to the compiler driver, it causes the
4783 @emph{first} compilation to be skipped, which makes it useful for little
4784 other than debugging the compiler proper.
4786 @item -feliminate-dwarf2-dups
4787 @opindex feliminate-dwarf2-dups
4788 Compress DWARF2 debugging information by eliminating duplicated
4789 information about each symbol.  This option only makes sense when
4790 generating DWARF2 debugging information with @option{-gdwarf-2}.
4792 @item -femit-struct-debug-baseonly
4793 Emit debug information for struct-like types
4794 only when the base name of the compilation source file
4795 matches the base name of file in which the struct was defined.
4797 This option substantially reduces the size of debugging information,
4798 but at significant potential loss in type information to the debugger.
4799 See @option{-femit-struct-debug-reduced} for a less aggressive option.
4800 See @option{-femit-struct-debug-detailed} for more detailed control.
4802 This option works only with DWARF 2.
4804 @item -femit-struct-debug-reduced
4805 Emit debug information for struct-like types
4806 only when the base name of the compilation source file
4807 matches the base name of file in which the type was defined,
4808 unless the struct is a template or defined in a system header.
4810 This option significantly reduces the size of debugging information,
4811 with some potential loss in type information to the debugger.
4812 See @option{-femit-struct-debug-baseonly} for a more aggressive option.
4813 See @option{-femit-struct-debug-detailed} for more detailed control.
4815 This option works only with DWARF 2.
4817 @item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
4818 Specify the struct-like types
4819 for which the compiler will generate debug information.
4820 The intent is to reduce duplicate struct debug information
4821 between different object files within the same program.
4823 This option is a detailed version of
4824 @option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
4825 which will serve for most needs.
4827 A specification has the syntax@*
4828 [@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
4830 The optional first word limits the specification to
4831 structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
4832 A struct type is used directly when it is the type of a variable, member.
4833 Indirect uses arise through pointers to structs.
4834 That is, when use of an incomplete struct would be legal, the use is indirect.
4835 An example is
4836 @samp{struct one direct; struct two * indirect;}.
4838 The optional second word limits the specification to
4839 ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
4840 Generic structs are a bit complicated to explain.
4841 For C++, these are non-explicit specializations of template classes,
4842 or non-template classes within the above.
4843 Other programming languages have generics,
4844 but @samp{-femit-struct-debug-detailed} does not yet implement them.
4846 The third word specifies the source files for those
4847 structs for which the compiler will emit debug information.
4848 The values @samp{none} and @samp{any} have the normal meaning.
4849 The value @samp{base} means that
4850 the base of name of the file in which the type declaration appears
4851 must match the base of the name of the main compilation file.
4852 In practice, this means that
4853 types declared in @file{foo.c} and @file{foo.h} will have debug information,
4854 but types declared in other header will not.
4855 The value @samp{sys} means those types satisfying @samp{base}
4856 or declared in system or compiler headers.
4858 You may need to experiment to determine the best settings for your application.
4860 The default is @samp{-femit-struct-debug-detailed=all}.
4862 This option works only with DWARF 2.
4864 @item -fno-merge-debug-strings
4865 @opindex fmerge-debug-strings
4866 @opindex fno-merge-debug-strings
4867 Direct the linker to not merge together strings in the debugging
4868 information which are identical in different object files.  Merging is
4869 not supported by all assemblers or linkers.  Merging decreases the size
4870 of the debug information in the output file at the cost of increasing
4871 link processing time.  Merging is enabled by default.
4873 @item -fdebug-prefix-map=@var{old}=@var{new}
4874 @opindex fdebug-prefix-map
4875 When compiling files in directory @file{@var{old}}, record debugging
4876 information describing them as in @file{@var{new}} instead.
4878 @item -fno-dwarf2-cfi-asm
4879 @opindex fdwarf2-cfi-asm
4880 @opindex fno-dwarf2-cfi-asm
4881 Emit DWARF 2 unwind info as compiler generated @code{.eh_frame} section
4882 instead of using GAS @code{.cfi_*} directives.
4884 @cindex @command{prof}
4885 @item -p
4886 @opindex p
4887 Generate extra code to write profile information suitable for the
4888 analysis program @command{prof}.  You must use this option when compiling
4889 the source files you want data about, and you must also use it when
4890 linking.
4892 @cindex @command{gprof}
4893 @item -pg
4894 @opindex pg
4895 Generate extra code to write profile information suitable for the
4896 analysis program @command{gprof}.  You must use this option when compiling
4897 the source files you want data about, and you must also use it when
4898 linking.
4900 @item -Q
4901 @opindex Q
4902 Makes the compiler print out each function name as it is compiled, and
4903 print some statistics about each pass when it finishes.
4905 @item -ftime-report
4906 @opindex ftime-report
4907 Makes the compiler print some statistics about the time consumed by each
4908 pass when it finishes.
4910 @item -fmem-report
4911 @opindex fmem-report
4912 Makes the compiler print some statistics about permanent memory
4913 allocation when it finishes.
4915 @item -fpre-ipa-mem-report
4916 @opindex fpre-ipa-mem-report
4917 @item -fpost-ipa-mem-report
4918 @opindex fpost-ipa-mem-report
4919 Makes the compiler print some statistics about permanent memory
4920 allocation before or after interprocedural optimization.
4922 @item -fstack-usage
4923 @opindex fstack-usage
4924 Makes the compiler output stack usage information for the program, on a
4925 per-function basis.  The filename for the dump is made by appending
4926 @file{.su} to the @var{auxname}.  @var{auxname} is generated from the name of
4927 the output file, if explicitly specified and it is not an executable,
4928 otherwise it is the basename of the source file.  An entry is made up
4929 of three fields:
4931 @itemize
4932 @item
4933 The name of the function.
4934 @item
4935 A number of bytes.
4936 @item
4937 One or more qualifiers: @code{static}, @code{dynamic}, @code{bounded}.
4938 @end itemize
4940 The qualifier @code{static} means that the function manipulates the stack
4941 statically: a fixed number of bytes are allocated for the frame on function
4942 entry and released on function exit; no stack adjustments are otherwise made
4943 in the function.  The second field is this fixed number of bytes.
4945 The qualifier @code{dynamic} means that the function manipulates the stack
4946 dynamically: in addition to the static allocation described above, stack
4947 adjustments are made in the body of the function, for example to push/pop
4948 arguments around function calls.  If the qualifier @code{bounded} is also
4949 present, the amount of these adjustments is bounded at compile-time and
4950 the second field is an upper bound of the total amount of stack used by
4951 the function.  If it is not present, the amount of these adjustments is
4952 not bounded at compile-time and the second field only represents the
4953 bounded part.
4955 @item -fprofile-arcs
4956 @opindex fprofile-arcs
4957 Add code so that program flow @dfn{arcs} are instrumented.  During
4958 execution the program records how many times each branch and call is
4959 executed and how many times it is taken or returns.  When the compiled
4960 program exits it saves this data to a file called
4961 @file{@var{auxname}.gcda} for each source file.  The data may be used for
4962 profile-directed optimizations (@option{-fbranch-probabilities}), or for
4963 test coverage analysis (@option{-ftest-coverage}).  Each object file's
4964 @var{auxname} is generated from the name of the output file, if
4965 explicitly specified and it is not the final executable, otherwise it is
4966 the basename of the source file.  In both cases any suffix is removed
4967 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
4968 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
4969 @xref{Cross-profiling}.
4971 @cindex @command{gcov}
4972 @item --coverage
4973 @opindex coverage
4975 This option is used to compile and link code instrumented for coverage
4976 analysis.  The option is a synonym for @option{-fprofile-arcs}
4977 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
4978 linking).  See the documentation for those options for more details.
4980 @itemize
4982 @item
4983 Compile the source files with @option{-fprofile-arcs} plus optimization
4984 and code generation options.  For test coverage analysis, use the
4985 additional @option{-ftest-coverage} option.  You do not need to profile
4986 every source file in a program.
4988 @item
4989 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
4990 (the latter implies the former).
4992 @item
4993 Run the program on a representative workload to generate the arc profile
4994 information.  This may be repeated any number of times.  You can run
4995 concurrent instances of your program, and provided that the file system
4996 supports locking, the data files will be correctly updated.  Also
4997 @code{fork} calls are detected and correctly handled (double counting
4998 will not happen).
5000 @item
5001 For profile-directed optimizations, compile the source files again with
5002 the same optimization and code generation options plus
5003 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
5004 Control Optimization}).
5006 @item
5007 For test coverage analysis, use @command{gcov} to produce human readable
5008 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
5009 @command{gcov} documentation for further information.
5011 @end itemize
5013 With @option{-fprofile-arcs}, for each function of your program GCC
5014 creates a program flow graph, then finds a spanning tree for the graph.
5015 Only arcs that are not on the spanning tree have to be instrumented: the
5016 compiler adds code to count the number of times that these arcs are
5017 executed.  When an arc is the only exit or only entrance to a block, the
5018 instrumentation code can be added to the block; otherwise, a new basic
5019 block must be created to hold the instrumentation code.
5021 @need 2000
5022 @item -ftest-coverage
5023 @opindex ftest-coverage
5024 Produce a notes file that the @command{gcov} code-coverage utility
5025 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
5026 show program coverage.  Each source file's note file is called
5027 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
5028 above for a description of @var{auxname} and instructions on how to
5029 generate test coverage data.  Coverage data will match the source files
5030 more closely, if you do not optimize.
5032 @item -fdbg-cnt-list
5033 @opindex fdbg-cnt-list
5034 Print the name and the counter upper bound for all debug counters.
5037 @item -fdbg-cnt=@var{counter-value-list}
5038 @opindex fdbg-cnt
5039 Set the internal debug counter upper bound.  @var{counter-value-list}
5040 is a comma-separated list of @var{name}:@var{value} pairs
5041 which sets the upper bound of each debug counter @var{name} to @var{value}.
5042 All debug counters have the initial upper bound of @var{UINT_MAX},
5043 thus dbg_cnt() returns true always unless the upper bound is set by this option.
5044 e.g. With -fdbg-cnt=dce:10,tail_call:0
5045 dbg_cnt(dce) will return true only for first 10 invocations
5047 @itemx -fenable-@var{kind}-@var{pass}
5048 @itemx -fdisable-@var{kind}-@var{pass}=@var{range-list}
5049 @opindex fdisable-
5050 @opindex fenable-
5052 This is a set of debugging options that are used to explicitly disable/enable
5053 optimization passes. For compiler users, regular options for enabling/disabling
5054 passes should be used instead.
5056 @itemize
5058 @item -fdisable-ipa-@var{pass}
5059 Disable ipa pass @var{pass}. @var{pass} is the pass name.  If the same pass is
5060 statically invoked in the compiler multiple times, the pass name should be
5061 appended with a sequential number starting from 1.
5063 @item -fdisable-rtl-@var{pass}
5064 @item -fdisable-rtl-@var{pass}=@var{range-list}
5065 Disable rtl pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
5066 statically invoked in the compiler multiple times, the pass name should be
5067 appended with a sequential number starting from 1.  @var{range-list} is a comma
5068 seperated list of function ranges or assembler names.  Each range is a number
5069 pair seperated by a colon.  The range is inclusive in both ends.  If the range
5070 is trivial, the number pair can be simplified as a single number.  If the
5071 function's cgraph node's @var{uid} is falling within one of the specified ranges,
5072 the @var{pass} is disabled for that function.  The @var{uid} is shown in the
5073 function header of a dump file.
5075 @item -fdisable-tree-@var{pass}
5076 @item -fdisable-tree-@var{pass}=@var{range-list}
5077 Disable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description of
5078 option arguments.
5080 @item -fenable-ipa-@var{pass}
5081 Enable ipa pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
5082 statically invoked in the compiler multiple times, the pass name should be
5083 appended with a sequential number starting from 1.
5085 @item -fenable-rtl-@var{pass}
5086 @item -fenable-rtl-@var{pass}=@var{range-list}
5087 Enable rtl pass @var{pass}.  See @option{-fdisable-rtl} for option argument
5088 description and examples.
5090 @item -fenable-tree-@var{pass}
5091 @item -fenable-tree-@var{pass}=@var{range-list}
5092 Enable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description
5093 of option arguments.
5095 @smallexample
5097 # disable ccp1 for all functions
5098    -fdisable-tree-ccp1
5099 # disable complete unroll for function whose cgraph node uid is 1
5100    -fenable-tree-cunroll=1
5101 # disable gcse2 for functions at the following ranges [1,1],
5102 # [300,400], and [400,1000]
5103 # disable gcse2 for functions foo and foo2
5104    -fdisable-rtl-gcse2=foo,foo2
5105 # disable early inlining
5106    -fdisable-tree-einline
5107 # disable ipa inlining
5108    -fdisable-ipa-inline
5109 # enable tree full unroll
5110    -fenable-tree-unroll
5112 @end smallexample
5114 @end itemize
5116 @item -d@var{letters}
5117 @itemx -fdump-rtl-@var{pass}
5118 @opindex d
5119 Says to make debugging dumps during compilation at times specified by
5120 @var{letters}.  This is used for debugging the RTL-based passes of the
5121 compiler.  The file names for most of the dumps are made by appending
5122 a pass number and a word to the @var{dumpname}, and the files are
5123 created in the directory of the output file.  Note that the pass
5124 number is computed statically as passes get registered into the pass
5125 manager.  Thus the numbering is not related to the dynamic order of
5126 execution of passes.  In particular, a pass installed by a plugin
5127 could have a number over 200 even if it executed quite early.
5128 @var{dumpname} is generated from the name of the output file, if
5129 explicitly specified and it is not an executable, otherwise it is the
5130 basename of the source file. These switches may have different effects
5131 when @option{-E} is used for preprocessing.
5133 Debug dumps can be enabled with a @option{-fdump-rtl} switch or some
5134 @option{-d} option @var{letters}.  Here are the possible
5135 letters for use in @var{pass} and @var{letters}, and their meanings:
5137 @table @gcctabopt
5139 @item -fdump-rtl-alignments
5140 @opindex fdump-rtl-alignments
5141 Dump after branch alignments have been computed.
5143 @item -fdump-rtl-asmcons
5144 @opindex fdump-rtl-asmcons
5145 Dump after fixing rtl statements that have unsatisfied in/out constraints.
5147 @item -fdump-rtl-auto_inc_dec
5148 @opindex fdump-rtl-auto_inc_dec
5149 Dump after auto-inc-dec discovery.  This pass is only run on
5150 architectures that have auto inc or auto dec instructions.
5152 @item -fdump-rtl-barriers
5153 @opindex fdump-rtl-barriers
5154 Dump after cleaning up the barrier instructions.
5156 @item -fdump-rtl-bbpart
5157 @opindex fdump-rtl-bbpart
5158 Dump after partitioning hot and cold basic blocks.
5160 @item -fdump-rtl-bbro
5161 @opindex fdump-rtl-bbro
5162 Dump after block reordering.
5164 @item -fdump-rtl-btl1
5165 @itemx -fdump-rtl-btl2
5166 @opindex fdump-rtl-btl2
5167 @opindex fdump-rtl-btl2
5168 @option{-fdump-rtl-btl1} and @option{-fdump-rtl-btl2} enable dumping
5169 after the two branch
5170 target load optimization passes.
5172 @item -fdump-rtl-bypass
5173 @opindex fdump-rtl-bypass
5174 Dump after jump bypassing and control flow optimizations.
5176 @item -fdump-rtl-combine
5177 @opindex fdump-rtl-combine
5178 Dump after the RTL instruction combination pass.
5180 @item -fdump-rtl-compgotos
5181 @opindex fdump-rtl-compgotos
5182 Dump after duplicating the computed gotos.
5184 @item -fdump-rtl-ce1
5185 @itemx -fdump-rtl-ce2
5186 @itemx -fdump-rtl-ce3
5187 @opindex fdump-rtl-ce1
5188 @opindex fdump-rtl-ce2
5189 @opindex fdump-rtl-ce3
5190 @option{-fdump-rtl-ce1}, @option{-fdump-rtl-ce2}, and
5191 @option{-fdump-rtl-ce3} enable dumping after the three
5192 if conversion passes.
5194 @itemx -fdump-rtl-cprop_hardreg
5195 @opindex fdump-rtl-cprop_hardreg
5196 Dump after hard register copy propagation.
5198 @itemx -fdump-rtl-csa
5199 @opindex fdump-rtl-csa
5200 Dump after combining stack adjustments.
5202 @item -fdump-rtl-cse1
5203 @itemx -fdump-rtl-cse2
5204 @opindex fdump-rtl-cse1
5205 @opindex fdump-rtl-cse2
5206 @option{-fdump-rtl-cse1} and @option{-fdump-rtl-cse2} enable dumping after
5207 the two common sub-expression elimination passes.
5209 @itemx -fdump-rtl-dce
5210 @opindex fdump-rtl-dce
5211 Dump after the standalone dead code elimination passes.
5213 @itemx -fdump-rtl-dbr
5214 @opindex fdump-rtl-dbr
5215 Dump after delayed branch scheduling.
5217 @item -fdump-rtl-dce1
5218 @itemx -fdump-rtl-dce2
5219 @opindex fdump-rtl-dce1
5220 @opindex fdump-rtl-dce2
5221 @option{-fdump-rtl-dce1} and @option{-fdump-rtl-dce2} enable dumping after
5222 the two dead store elimination passes.
5224 @item -fdump-rtl-eh
5225 @opindex fdump-rtl-eh
5226 Dump after finalization of EH handling code.
5228 @item -fdump-rtl-eh_ranges
5229 @opindex fdump-rtl-eh_ranges
5230 Dump after conversion of EH handling range regions.
5232 @item -fdump-rtl-expand
5233 @opindex fdump-rtl-expand
5234 Dump after RTL generation.
5236 @item -fdump-rtl-fwprop1
5237 @itemx -fdump-rtl-fwprop2
5238 @opindex fdump-rtl-fwprop1
5239 @opindex fdump-rtl-fwprop2
5240 @option{-fdump-rtl-fwprop1} and @option{-fdump-rtl-fwprop2} enable
5241 dumping after the two forward propagation passes.
5243 @item -fdump-rtl-gcse1
5244 @itemx -fdump-rtl-gcse2
5245 @opindex fdump-rtl-gcse1
5246 @opindex fdump-rtl-gcse2
5247 @option{-fdump-rtl-gcse1} and @option{-fdump-rtl-gcse2} enable dumping
5248 after global common subexpression elimination.
5250 @item -fdump-rtl-init-regs
5251 @opindex fdump-rtl-init-regs
5252 Dump after the initialization of the registers.
5254 @item -fdump-rtl-initvals
5255 @opindex fdump-rtl-initvals
5256 Dump after the computation of the initial value sets.
5258 @itemx -fdump-rtl-into_cfglayout
5259 @opindex fdump-rtl-into_cfglayout
5260 Dump after converting to cfglayout mode.
5262 @item -fdump-rtl-ira
5263 @opindex fdump-rtl-ira
5264 Dump after iterated register allocation.
5266 @item -fdump-rtl-jump
5267 @opindex fdump-rtl-jump
5268 Dump after the second jump optimization.
5270 @item -fdump-rtl-loop2
5271 @opindex fdump-rtl-loop2
5272 @option{-fdump-rtl-loop2} enables dumping after the rtl
5273 loop optimization passes.
5275 @item -fdump-rtl-mach
5276 @opindex fdump-rtl-mach
5277 Dump after performing the machine dependent reorganization pass, if that
5278 pass exists.
5280 @item -fdump-rtl-mode_sw
5281 @opindex fdump-rtl-mode_sw
5282 Dump after removing redundant mode switches.
5284 @item -fdump-rtl-rnreg
5285 @opindex fdump-rtl-rnreg
5286 Dump after register renumbering.
5288 @itemx -fdump-rtl-outof_cfglayout
5289 @opindex fdump-rtl-outof_cfglayout
5290 Dump after converting from cfglayout mode.
5292 @item -fdump-rtl-peephole2
5293 @opindex fdump-rtl-peephole2
5294 Dump after the peephole pass.
5296 @item -fdump-rtl-postreload
5297 @opindex fdump-rtl-postreload
5298 Dump after post-reload optimizations.
5300 @itemx -fdump-rtl-pro_and_epilogue
5301 @opindex fdump-rtl-pro_and_epilogue
5302 Dump after generating the function pro and epilogues.
5304 @item -fdump-rtl-regmove
5305 @opindex fdump-rtl-regmove
5306 Dump after the register move pass.
5308 @item -fdump-rtl-sched1
5309 @itemx -fdump-rtl-sched2
5310 @opindex fdump-rtl-sched1
5311 @opindex fdump-rtl-sched2
5312 @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2} enable dumping
5313 after the basic block scheduling passes.
5315 @item -fdump-rtl-see
5316 @opindex fdump-rtl-see
5317 Dump after sign extension elimination.
5319 @item -fdump-rtl-seqabstr
5320 @opindex fdump-rtl-seqabstr
5321 Dump after common sequence discovery.
5323 @item -fdump-rtl-shorten
5324 @opindex fdump-rtl-shorten
5325 Dump after shortening branches.
5327 @item -fdump-rtl-sibling
5328 @opindex fdump-rtl-sibling
5329 Dump after sibling call optimizations.
5331 @item -fdump-rtl-split1
5332 @itemx -fdump-rtl-split2
5333 @itemx -fdump-rtl-split3
5334 @itemx -fdump-rtl-split4
5335 @itemx -fdump-rtl-split5
5336 @opindex fdump-rtl-split1
5337 @opindex fdump-rtl-split2
5338 @opindex fdump-rtl-split3
5339 @opindex fdump-rtl-split4
5340 @opindex fdump-rtl-split5
5341 @option{-fdump-rtl-split1}, @option{-fdump-rtl-split2},
5342 @option{-fdump-rtl-split3}, @option{-fdump-rtl-split4} and
5343 @option{-fdump-rtl-split5} enable dumping after five rounds of
5344 instruction splitting.
5346 @item -fdump-rtl-sms
5347 @opindex fdump-rtl-sms
5348 Dump after modulo scheduling.  This pass is only run on some
5349 architectures.
5351 @item -fdump-rtl-stack
5352 @opindex fdump-rtl-stack
5353 Dump after conversion from GCC's "flat register file" registers to the
5354 x87's stack-like registers.  This pass is only run on x86 variants.
5356 @item -fdump-rtl-subreg1
5357 @itemx -fdump-rtl-subreg2
5358 @opindex fdump-rtl-subreg1
5359 @opindex fdump-rtl-subreg2
5360 @option{-fdump-rtl-subreg1} and @option{-fdump-rtl-subreg2} enable dumping after
5361 the two subreg expansion passes.
5363 @item -fdump-rtl-unshare
5364 @opindex fdump-rtl-unshare
5365 Dump after all rtl has been unshared.
5367 @item -fdump-rtl-vartrack
5368 @opindex fdump-rtl-vartrack
5369 Dump after variable tracking.
5371 @item -fdump-rtl-vregs
5372 @opindex fdump-rtl-vregs
5373 Dump after converting virtual registers to hard registers.
5375 @item -fdump-rtl-web
5376 @opindex fdump-rtl-web
5377 Dump after live range splitting.
5379 @item -fdump-rtl-regclass
5380 @itemx -fdump-rtl-subregs_of_mode_init
5381 @itemx -fdump-rtl-subregs_of_mode_finish
5382 @itemx -fdump-rtl-dfinit
5383 @itemx -fdump-rtl-dfinish
5384 @opindex fdump-rtl-regclass
5385 @opindex fdump-rtl-subregs_of_mode_init
5386 @opindex fdump-rtl-subregs_of_mode_finish
5387 @opindex fdump-rtl-dfinit
5388 @opindex fdump-rtl-dfinish
5389 These dumps are defined but always produce empty files.
5391 @item -fdump-rtl-all
5392 @opindex fdump-rtl-all
5393 Produce all the dumps listed above.
5395 @item -dA
5396 @opindex dA
5397 Annotate the assembler output with miscellaneous debugging information.
5399 @item -dD
5400 @opindex dD
5401 Dump all macro definitions, at the end of preprocessing, in addition to
5402 normal output.
5404 @item -dH
5405 @opindex dH
5406 Produce a core dump whenever an error occurs.
5408 @item -dm
5409 @opindex dm
5410 Print statistics on memory usage, at the end of the run, to
5411 standard error.
5413 @item -dp
5414 @opindex dp
5415 Annotate the assembler output with a comment indicating which
5416 pattern and alternative was used.  The length of each instruction is
5417 also printed.
5419 @item -dP
5420 @opindex dP
5421 Dump the RTL in the assembler output as a comment before each instruction.
5422 Also turns on @option{-dp} annotation.
5424 @item -dv
5425 @opindex dv
5426 For each of the other indicated dump files (@option{-fdump-rtl-@var{pass}}),
5427 dump a representation of the control flow graph suitable for viewing with VCG
5428 to @file{@var{file}.@var{pass}.vcg}.
5430 @item -dx
5431 @opindex dx
5432 Just generate RTL for a function instead of compiling it.  Usually used
5433 with @option{-fdump-rtl-expand}.
5434 @end table
5436 @item -fdump-noaddr
5437 @opindex fdump-noaddr
5438 When doing debugging dumps, suppress address output.  This makes it more
5439 feasible to use diff on debugging dumps for compiler invocations with
5440 different compiler binaries and/or different
5441 text / bss / data / heap / stack / dso start locations.
5443 @item -fdump-unnumbered
5444 @opindex fdump-unnumbered
5445 When doing debugging dumps, suppress instruction numbers and address output.
5446 This makes it more feasible to use diff on debugging dumps for compiler
5447 invocations with different options, in particular with and without
5448 @option{-g}.
5450 @item -fdump-unnumbered-links
5451 @opindex fdump-unnumbered-links
5452 When doing debugging dumps (see @option{-d} option above), suppress
5453 instruction numbers for the links to the previous and next instructions
5454 in a sequence.
5456 @item -fdump-translation-unit @r{(C++ only)}
5457 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
5458 @opindex fdump-translation-unit
5459 Dump a representation of the tree structure for the entire translation
5460 unit to a file.  The file name is made by appending @file{.tu} to the
5461 source file name, and the file is created in the same directory as the
5462 output file.  If the @samp{-@var{options}} form is used, @var{options}
5463 controls the details of the dump as described for the
5464 @option{-fdump-tree} options.
5466 @item -fdump-class-hierarchy @r{(C++ only)}
5467 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
5468 @opindex fdump-class-hierarchy
5469 Dump a representation of each class's hierarchy and virtual function
5470 table layout to a file.  The file name is made by appending
5471 @file{.class} to the source file name, and the file is created in the
5472 same directory as the output file.  If the @samp{-@var{options}} form
5473 is used, @var{options} controls the details of the dump as described
5474 for the @option{-fdump-tree} options.
5476 @item -fdump-ipa-@var{switch}
5477 @opindex fdump-ipa
5478 Control the dumping at various stages of inter-procedural analysis
5479 language tree to a file.  The file name is generated by appending a
5480 switch specific suffix to the source file name, and the file is created
5481 in the same directory as the output file.  The following dumps are
5482 possible:
5484 @table @samp
5485 @item all
5486 Enables all inter-procedural analysis dumps.
5488 @item cgraph
5489 Dumps information about call-graph optimization, unused function removal,
5490 and inlining decisions.
5492 @item inline
5493 Dump after function inlining.
5495 @end table
5497 @item -fdump-statistics-@var{option}
5498 @opindex fdump-statistics
5499 Enable and control dumping of pass statistics in a separate file.  The
5500 file name is generated by appending a suffix ending in
5501 @samp{.statistics} to the source file name, and the file is created in
5502 the same directory as the output file.  If the @samp{-@var{option}}
5503 form is used, @samp{-stats} will cause counters to be summed over the
5504 whole compilation unit while @samp{-details} will dump every event as
5505 the passes generate them.  The default with no option is to sum
5506 counters for each function compiled.
5508 @item -fdump-tree-@var{switch}
5509 @itemx -fdump-tree-@var{switch}-@var{options}
5510 @opindex fdump-tree
5511 Control the dumping at various stages of processing the intermediate
5512 language tree to a file.  The file name is generated by appending a
5513 switch specific suffix to the source file name, and the file is
5514 created in the same directory as the output file.  If the
5515 @samp{-@var{options}} form is used, @var{options} is a list of
5516 @samp{-} separated options that control the details of the dump.  Not
5517 all options are applicable to all dumps, those which are not
5518 meaningful will be ignored.  The following options are available
5520 @table @samp
5521 @item address
5522 Print the address of each node.  Usually this is not meaningful as it
5523 changes according to the environment and source file.  Its primary use
5524 is for tying up a dump file with a debug environment.
5525 @item asmname
5526 If @code{DECL_ASSEMBLER_NAME} has been set for a given decl, use that
5527 in the dump instead of @code{DECL_NAME}.  Its primary use is ease of
5528 use working backward from mangled names in the assembly file.
5529 @item slim
5530 Inhibit dumping of members of a scope or body of a function merely
5531 because that scope has been reached.  Only dump such items when they
5532 are directly reachable by some other path.  When dumping pretty-printed
5533 trees, this option inhibits dumping the bodies of control structures.
5534 @item raw
5535 Print a raw representation of the tree.  By default, trees are
5536 pretty-printed into a C-like representation.
5537 @item details
5538 Enable more detailed dumps (not honored by every dump option).
5539 @item stats
5540 Enable dumping various statistics about the pass (not honored by every dump
5541 option).
5542 @item blocks
5543 Enable showing basic block boundaries (disabled in raw dumps).
5544 @item vops
5545 Enable showing virtual operands for every statement.
5546 @item lineno
5547 Enable showing line numbers for statements.
5548 @item uid
5549 Enable showing the unique ID (@code{DECL_UID}) for each variable.
5550 @item verbose
5551 Enable showing the tree dump for each statement.
5552 @item eh
5553 Enable showing the EH region number holding each statement.
5554 @item all
5555 Turn on all options, except @option{raw}, @option{slim}, @option{verbose}
5556 and @option{lineno}.
5557 @end table
5559 The following tree dumps are possible:
5560 @table @samp
5562 @item original
5563 @opindex fdump-tree-original
5564 Dump before any tree based optimization, to @file{@var{file}.original}.
5566 @item optimized
5567 @opindex fdump-tree-optimized
5568 Dump after all tree based optimization, to @file{@var{file}.optimized}.
5570 @item gimple
5571 @opindex fdump-tree-gimple
5572 Dump each function before and after the gimplification pass to a file.  The
5573 file name is made by appending @file{.gimple} to the source file name.
5575 @item cfg
5576 @opindex fdump-tree-cfg
5577 Dump the control flow graph of each function to a file.  The file name is
5578 made by appending @file{.cfg} to the source file name.
5580 @item vcg
5581 @opindex fdump-tree-vcg
5582 Dump the control flow graph of each function to a file in VCG format.  The
5583 file name is made by appending @file{.vcg} to the source file name.  Note
5584 that if the file contains more than one function, the generated file cannot
5585 be used directly by VCG@.  You will need to cut and paste each function's
5586 graph into its own separate file first.
5588 @item ch
5589 @opindex fdump-tree-ch
5590 Dump each function after copying loop headers.  The file name is made by
5591 appending @file{.ch} to the source file name.
5593 @item ssa
5594 @opindex fdump-tree-ssa
5595 Dump SSA related information to a file.  The file name is made by appending
5596 @file{.ssa} to the source file name.
5598 @item alias
5599 @opindex fdump-tree-alias
5600 Dump aliasing information for each function.  The file name is made by
5601 appending @file{.alias} to the source file name.
5603 @item ccp
5604 @opindex fdump-tree-ccp
5605 Dump each function after CCP@.  The file name is made by appending
5606 @file{.ccp} to the source file name.
5608 @item storeccp
5609 @opindex fdump-tree-storeccp
5610 Dump each function after STORE-CCP@.  The file name is made by appending
5611 @file{.storeccp} to the source file name.
5613 @item pre
5614 @opindex fdump-tree-pre
5615 Dump trees after partial redundancy elimination.  The file name is made
5616 by appending @file{.pre} to the source file name.
5618 @item fre
5619 @opindex fdump-tree-fre
5620 Dump trees after full redundancy elimination.  The file name is made
5621 by appending @file{.fre} to the source file name.
5623 @item copyprop
5624 @opindex fdump-tree-copyprop
5625 Dump trees after copy propagation.  The file name is made
5626 by appending @file{.copyprop} to the source file name.
5628 @item store_copyprop
5629 @opindex fdump-tree-store_copyprop
5630 Dump trees after store copy-propagation.  The file name is made
5631 by appending @file{.store_copyprop} to the source file name.
5633 @item dce
5634 @opindex fdump-tree-dce
5635 Dump each function after dead code elimination.  The file name is made by
5636 appending @file{.dce} to the source file name.
5638 @item mudflap
5639 @opindex fdump-tree-mudflap
5640 Dump each function after adding mudflap instrumentation.  The file name is
5641 made by appending @file{.mudflap} to the source file name.
5643 @item sra
5644 @opindex fdump-tree-sra
5645 Dump each function after performing scalar replacement of aggregates.  The
5646 file name is made by appending @file{.sra} to the source file name.
5648 @item sink
5649 @opindex fdump-tree-sink
5650 Dump each function after performing code sinking.  The file name is made
5651 by appending @file{.sink} to the source file name.
5653 @item dom
5654 @opindex fdump-tree-dom
5655 Dump each function after applying dominator tree optimizations.  The file
5656 name is made by appending @file{.dom} to the source file name.
5658 @item dse
5659 @opindex fdump-tree-dse
5660 Dump each function after applying dead store elimination.  The file
5661 name is made by appending @file{.dse} to the source file name.
5663 @item phiopt
5664 @opindex fdump-tree-phiopt
5665 Dump each function after optimizing PHI nodes into straightline code.  The file
5666 name is made by appending @file{.phiopt} to the source file name.
5668 @item forwprop
5669 @opindex fdump-tree-forwprop
5670 Dump each function after forward propagating single use variables.  The file
5671 name is made by appending @file{.forwprop} to the source file name.
5673 @item copyrename
5674 @opindex fdump-tree-copyrename
5675 Dump each function after applying the copy rename optimization.  The file
5676 name is made by appending @file{.copyrename} to the source file name.
5678 @item nrv
5679 @opindex fdump-tree-nrv
5680 Dump each function after applying the named return value optimization on
5681 generic trees.  The file name is made by appending @file{.nrv} to the source
5682 file name.
5684 @item vect
5685 @opindex fdump-tree-vect
5686 Dump each function after applying vectorization of loops.  The file name is
5687 made by appending @file{.vect} to the source file name.
5689 @item slp
5690 @opindex fdump-tree-slp
5691 Dump each function after applying vectorization of basic blocks.  The file name
5692 is made by appending @file{.slp} to the source file name.
5694 @item vrp
5695 @opindex fdump-tree-vrp
5696 Dump each function after Value Range Propagation (VRP).  The file name
5697 is made by appending @file{.vrp} to the source file name.
5699 @item all
5700 @opindex fdump-tree-all
5701 Enable all the available tree dumps with the flags provided in this option.
5702 @end table
5704 @item -ftree-vectorizer-verbose=@var{n}
5705 @opindex ftree-vectorizer-verbose
5706 This option controls the amount of debugging output the vectorizer prints.
5707 This information is written to standard error, unless
5708 @option{-fdump-tree-all} or @option{-fdump-tree-vect} is specified,
5709 in which case it is output to the usual dump listing file, @file{.vect}.
5710 For @var{n}=0 no diagnostic information is reported.
5711 If @var{n}=1 the vectorizer reports each loop that got vectorized,
5712 and the total number of loops that got vectorized.
5713 If @var{n}=2 the vectorizer also reports non-vectorized loops that passed
5714 the first analysis phase (vect_analyze_loop_form) - i.e.@: countable,
5715 inner-most, single-bb, single-entry/exit loops.  This is the same verbosity
5716 level that @option{-fdump-tree-vect-stats} uses.
5717 Higher verbosity levels mean either more information dumped for each
5718 reported loop, or same amount of information reported for more loops:
5719 if @var{n}=3, vectorizer cost model information is reported.
5720 If @var{n}=4, alignment related information is added to the reports.
5721 If @var{n}=5, data-references related information (e.g.@: memory dependences,
5722 memory access-patterns) is added to the reports.
5723 If @var{n}=6, the vectorizer reports also non-vectorized inner-most loops
5724 that did not pass the first analysis phase (i.e., may not be countable, or
5725 may have complicated control-flow).
5726 If @var{n}=7, the vectorizer reports also non-vectorized nested loops.
5727 If @var{n}=8, SLP related information is added to the reports.
5728 For @var{n}=9, all the information the vectorizer generates during its
5729 analysis and transformation is reported.  This is the same verbosity level
5730 that @option{-fdump-tree-vect-details} uses.
5732 @item -frandom-seed=@var{string}
5733 @opindex frandom-seed
5734 This option provides a seed that GCC uses when it would otherwise use
5735 random numbers.  It is used to generate certain symbol names
5736 that have to be different in every compiled file.  It is also used to
5737 place unique stamps in coverage data files and the object files that
5738 produce them.  You can use the @option{-frandom-seed} option to produce
5739 reproducibly identical object files.
5741 The @var{string} should be different for every file you compile.
5743 @item -fsched-verbose=@var{n}
5744 @opindex fsched-verbose
5745 On targets that use instruction scheduling, this option controls the
5746 amount of debugging output the scheduler prints.  This information is
5747 written to standard error, unless @option{-fdump-rtl-sched1} or
5748 @option{-fdump-rtl-sched2} is specified, in which case it is output
5749 to the usual dump listing file, @file{.sched1} or @file{.sched2}
5750 respectively.  However for @var{n} greater than nine, the output is
5751 always printed to standard error.
5753 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
5754 same information as @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2}.
5755 For @var{n} greater than one, it also output basic block probabilities,
5756 detailed ready list information and unit/insn info.  For @var{n} greater
5757 than two, it includes RTL at abort point, control-flow and regions info.
5758 And for @var{n} over four, @option{-fsched-verbose} also includes
5759 dependence info.
5761 @item -save-temps
5762 @itemx -save-temps=cwd
5763 @opindex save-temps
5764 Store the usual ``temporary'' intermediate files permanently; place them
5765 in the current directory and name them based on the source file.  Thus,
5766 compiling @file{foo.c} with @samp{-c -save-temps} would produce files
5767 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
5768 preprocessed @file{foo.i} output file even though the compiler now
5769 normally uses an integrated preprocessor.
5771 When used in combination with the @option{-x} command line option,
5772 @option{-save-temps} is sensible enough to avoid over writing an
5773 input source file with the same extension as an intermediate file.
5774 The corresponding intermediate file may be obtained by renaming the
5775 source file before using @option{-save-temps}.
5777 If you invoke GCC in parallel, compiling several different source
5778 files that share a common base name in different subdirectories or the
5779 same source file compiled for multiple output destinations, it is
5780 likely that the different parallel compilers will interfere with each
5781 other, and overwrite the temporary files.  For instance:
5783 @smallexample
5784 gcc -save-temps -o outdir1/foo.o indir1/foo.c&
5785 gcc -save-temps -o outdir2/foo.o indir2/foo.c&
5786 @end smallexample
5788 may result in @file{foo.i} and @file{foo.o} being written to
5789 simultaneously by both compilers.
5791 @item -save-temps=obj
5792 @opindex save-temps=obj
5793 Store the usual ``temporary'' intermediate files permanently.  If the
5794 @option{-o} option is used, the temporary files are based on the
5795 object file.  If the @option{-o} option is not used, the
5796 @option{-save-temps=obj} switch behaves like @option{-save-temps}.
5798 For example:
5800 @smallexample
5801 gcc -save-temps=obj -c foo.c
5802 gcc -save-temps=obj -c bar.c -o dir/xbar.o
5803 gcc -save-temps=obj foobar.c -o dir2/yfoobar
5804 @end smallexample
5806 would create @file{foo.i}, @file{foo.s}, @file{dir/xbar.i},
5807 @file{dir/xbar.s}, @file{dir2/yfoobar.i}, @file{dir2/yfoobar.s}, and
5808 @file{dir2/yfoobar.o}.
5810 @item -time@r{[}=@var{file}@r{]}
5811 @opindex time
5812 Report the CPU time taken by each subprocess in the compilation
5813 sequence.  For C source files, this is the compiler proper and assembler
5814 (plus the linker if linking is done).
5816 Without the specification of an output file, the output looks like this:
5818 @smallexample
5819 # cc1 0.12 0.01
5820 # as 0.00 0.01
5821 @end smallexample
5823 The first number on each line is the ``user time'', that is time spent
5824 executing the program itself.  The second number is ``system time'',
5825 time spent executing operating system routines on behalf of the program.
5826 Both numbers are in seconds.
5828 With the specification of an output file, the output is appended to the
5829 named file, and it looks like this:
5831 @smallexample
5832 0.12 0.01 cc1 @var{options}
5833 0.00 0.01 as @var{options}
5834 @end smallexample
5836 The ``user time'' and the ``system time'' are moved before the program
5837 name, and the options passed to the program are displayed, so that one
5838 can later tell what file was being compiled, and with which options.
5840 @item -fvar-tracking
5841 @opindex fvar-tracking
5842 Run variable tracking pass.  It computes where variables are stored at each
5843 position in code.  Better debugging information is then generated
5844 (if the debugging information format supports this information).
5846 It is enabled by default when compiling with optimization (@option{-Os},
5847 @option{-O}, @option{-O2}, @dots{}), debugging information (@option{-g}) and
5848 the debug info format supports it.
5850 @item -fvar-tracking-assignments
5851 @opindex fvar-tracking-assignments
5852 @opindex fno-var-tracking-assignments
5853 Annotate assignments to user variables early in the compilation and
5854 attempt to carry the annotations over throughout the compilation all the
5855 way to the end, in an attempt to improve debug information while
5856 optimizing.  Use of @option{-gdwarf-4} is recommended along with it.
5858 It can be enabled even if var-tracking is disabled, in which case
5859 annotations will be created and maintained, but discarded at the end.
5861 @item -fvar-tracking-assignments-toggle
5862 @opindex fvar-tracking-assignments-toggle
5863 @opindex fno-var-tracking-assignments-toggle
5864 Toggle @option{-fvar-tracking-assignments}, in the same way that
5865 @option{-gtoggle} toggles @option{-g}.
5867 @item -print-file-name=@var{library}
5868 @opindex print-file-name
5869 Print the full absolute name of the library file @var{library} that
5870 would be used when linking---and don't do anything else.  With this
5871 option, GCC does not compile or link anything; it just prints the
5872 file name.
5874 @item -print-multi-directory
5875 @opindex print-multi-directory
5876 Print the directory name corresponding to the multilib selected by any
5877 other switches present in the command line.  This directory is supposed
5878 to exist in @env{GCC_EXEC_PREFIX}.
5880 @item -print-multi-lib
5881 @opindex print-multi-lib
5882 Print the mapping from multilib directory names to compiler switches
5883 that enable them.  The directory name is separated from the switches by
5884 @samp{;}, and each switch starts with an @samp{@@} instead of the
5885 @samp{-}, without spaces between multiple switches.  This is supposed to
5886 ease shell-processing.
5888 @item -print-multi-os-directory
5889 @opindex print-multi-os-directory
5890 Print the path to OS libraries for the selected
5891 multilib, relative to some @file{lib} subdirectory.  If OS libraries are
5892 present in the @file{lib} subdirectory and no multilibs are used, this is
5893 usually just @file{.}, if OS libraries are present in @file{lib@var{suffix}}
5894 sibling directories this prints e.g.@: @file{../lib64}, @file{../lib} or
5895 @file{../lib32}, or if OS libraries are present in @file{lib/@var{subdir}}
5896 subdirectories it prints e.g.@: @file{amd64}, @file{sparcv9} or @file{ev6}.
5898 @item -print-prog-name=@var{program}
5899 @opindex print-prog-name
5900 Like @option{-print-file-name}, but searches for a program such as @samp{cpp}.
5902 @item -print-libgcc-file-name
5903 @opindex print-libgcc-file-name
5904 Same as @option{-print-file-name=libgcc.a}.
5906 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
5907 but you do want to link with @file{libgcc.a}.  You can do
5909 @smallexample
5910 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
5911 @end smallexample
5913 @item -print-search-dirs
5914 @opindex print-search-dirs
5915 Print the name of the configured installation directory and a list of
5916 program and library directories @command{gcc} will search---and don't do anything else.
5918 This is useful when @command{gcc} prints the error message
5919 @samp{installation problem, cannot exec cpp0: No such file or directory}.
5920 To resolve this you either need to put @file{cpp0} and the other compiler
5921 components where @command{gcc} expects to find them, or you can set the environment
5922 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
5923 Don't forget the trailing @samp{/}.
5924 @xref{Environment Variables}.
5926 @item -print-sysroot
5927 @opindex print-sysroot
5928 Print the target sysroot directory that will be used during
5929 compilation.  This is the target sysroot specified either at configure
5930 time or using the @option{--sysroot} option, possibly with an extra
5931 suffix that depends on compilation options.  If no target sysroot is
5932 specified, the option prints nothing.
5934 @item -print-sysroot-headers-suffix
5935 @opindex print-sysroot-headers-suffix
5936 Print the suffix added to the target sysroot when searching for
5937 headers, or give an error if the compiler is not configured with such
5938 a suffix---and don't do anything else.
5940 @item -dumpmachine
5941 @opindex dumpmachine
5942 Print the compiler's target machine (for example,
5943 @samp{i686-pc-linux-gnu})---and don't do anything else.
5945 @item -dumpversion
5946 @opindex dumpversion
5947 Print the compiler version (for example, @samp{3.0})---and don't do
5948 anything else.
5950 @item -dumpspecs
5951 @opindex dumpspecs
5952 Print the compiler's built-in specs---and don't do anything else.  (This
5953 is used when GCC itself is being built.)  @xref{Spec Files}.
5955 @item -feliminate-unused-debug-types
5956 @opindex feliminate-unused-debug-types
5957 Normally, when producing DWARF2 output, GCC will emit debugging
5958 information for all types declared in a compilation
5959 unit, regardless of whether or not they are actually used
5960 in that compilation unit.  Sometimes this is useful, such as
5961 if, in the debugger, you want to cast a value to a type that is
5962 not actually used in your program (but is declared).  More often,
5963 however, this results in a significant amount of wasted space.
5964 With this option, GCC will avoid producing debug symbol output
5965 for types that are nowhere used in the source file being compiled.
5966 @end table
5968 @node Optimize Options
5969 @section Options That Control Optimization
5970 @cindex optimize options
5971 @cindex options, optimization
5973 These options control various sorts of optimizations.
5975 Without any optimization option, the compiler's goal is to reduce the
5976 cost of compilation and to make debugging produce the expected
5977 results.  Statements are independent: if you stop the program with a
5978 breakpoint between statements, you can then assign a new value to any
5979 variable or change the program counter to any other statement in the
5980 function and get exactly the results you would expect from the source
5981 code.
5983 Turning on optimization flags makes the compiler attempt to improve
5984 the performance and/or code size at the expense of compilation time
5985 and possibly the ability to debug the program.
5987 The compiler performs optimization based on the knowledge it has of the
5988 program.  Compiling multiple files at once to a single output file mode allows
5989 the compiler to use information gained from all of the files when compiling
5990 each of them.
5992 Not all optimizations are controlled directly by a flag.  Only
5993 optimizations that have a flag are listed in this section.
5995 Most optimizations are only enabled if an @option{-O} level is set on
5996 the command line.  Otherwise they are disabled, even if individual
5997 optimization flags are specified.
5999 Depending on the target and how GCC was configured, a slightly different
6000 set of optimizations may be enabled at each @option{-O} level than
6001 those listed here.  You can invoke GCC with @samp{-Q --help=optimizers}
6002 to find out the exact set of optimizations that are enabled at each level.
6003 @xref{Overall Options}, for examples.
6005 @table @gcctabopt
6006 @item -O
6007 @itemx -O1
6008 @opindex O
6009 @opindex O1
6010 Optimize.  Optimizing compilation takes somewhat more time, and a lot
6011 more memory for a large function.
6013 With @option{-O}, the compiler tries to reduce code size and execution
6014 time, without performing any optimizations that take a great deal of
6015 compilation time.
6017 @option{-O} turns on the following optimization flags:
6018 @gccoptlist{
6019 -fauto-inc-dec @gol
6020 -fcompare-elim @gol
6021 -fcprop-registers @gol
6022 -fdce @gol
6023 -fdefer-pop @gol
6024 -fdelayed-branch @gol
6025 -fdse @gol
6026 -fguess-branch-probability @gol
6027 -fif-conversion2 @gol
6028 -fif-conversion @gol
6029 -fipa-pure-const @gol
6030 -fipa-profile @gol
6031 -fipa-reference @gol
6032 -fmerge-constants
6033 -fsplit-wide-types @gol
6034 -ftree-bit-ccp @gol
6035 -ftree-builtin-call-dce @gol
6036 -ftree-ccp @gol
6037 -ftree-ch @gol
6038 -ftree-copyrename @gol
6039 -ftree-dce @gol
6040 -ftree-dominator-opts @gol
6041 -ftree-dse @gol
6042 -ftree-forwprop @gol
6043 -ftree-fre @gol
6044 -ftree-phiprop @gol
6045 -ftree-sra @gol
6046 -ftree-pta @gol
6047 -ftree-ter @gol
6048 -funit-at-a-time}
6050 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
6051 where doing so does not interfere with debugging.
6053 @item -O2
6054 @opindex O2
6055 Optimize even more.  GCC performs nearly all supported optimizations
6056 that do not involve a space-speed tradeoff.
6057 As compared to @option{-O}, this option increases both compilation time
6058 and the performance of the generated code.
6060 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
6061 also turns on the following optimization flags:
6062 @gccoptlist{-fthread-jumps @gol
6063 -falign-functions  -falign-jumps @gol
6064 -falign-loops  -falign-labels @gol
6065 -fcaller-saves @gol
6066 -fcrossjumping @gol
6067 -fcse-follow-jumps  -fcse-skip-blocks @gol
6068 -fdelete-null-pointer-checks @gol
6069 -fdevirtualize @gol
6070 -fexpensive-optimizations @gol
6071 -fgcse  -fgcse-lm  @gol
6072 -finline-small-functions @gol
6073 -findirect-inlining @gol
6074 -fipa-sra @gol
6075 -foptimize-sibling-calls @gol
6076 -fpartial-inlining @gol
6077 -fpeephole2 @gol
6078 -fregmove @gol
6079 -freorder-blocks  -freorder-functions @gol
6080 -frerun-cse-after-loop  @gol
6081 -fsched-interblock  -fsched-spec @gol
6082 -fschedule-insns  -fschedule-insns2 @gol
6083 -fstrict-aliasing -fstrict-overflow @gol
6084 -ftree-switch-conversion @gol
6085 -ftree-pre @gol
6086 -ftree-vrp}
6088 Please note the warning under @option{-fgcse} about
6089 invoking @option{-O2} on programs that use computed gotos.
6091 @item -O3
6092 @opindex O3
6093 Optimize yet more.  @option{-O3} turns on all optimizations specified
6094 by @option{-O2} and also turns on the @option{-finline-functions},
6095 @option{-funswitch-loops}, @option{-fpredictive-commoning},
6096 @option{-fgcse-after-reload}, @option{-ftree-vectorize} and
6097 @option{-fipa-cp-clone} options.
6099 @item -O0
6100 @opindex O0
6101 Reduce compilation time and make debugging produce the expected
6102 results.  This is the default.
6104 @item -Os
6105 @opindex Os
6106 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
6107 do not typically increase code size.  It also performs further
6108 optimizations designed to reduce code size.
6110 @option{-Os} disables the following optimization flags:
6111 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
6112 -falign-labels  -freorder-blocks  -freorder-blocks-and-partition @gol
6113 -fprefetch-loop-arrays  -ftree-vect-loop-version}
6115 @item -Ofast
6116 @opindex Ofast
6117 Disregard strict standards compliance.  @option{-Ofast} enables all
6118 @option{-O3} optimizations.  It also enables optimizations that are not
6119 valid for all standard compliant programs.
6120 It turns on @option{-ffast-math} and the Fortran-specific
6121 @option{-fno-protect-parens} and @option{-fstack-arrays}.
6123 If you use multiple @option{-O} options, with or without level numbers,
6124 the last such option is the one that is effective.
6125 @end table
6127 Options of the form @option{-f@var{flag}} specify machine-independent
6128 flags.  Most flags have both positive and negative forms; the negative
6129 form of @option{-ffoo} would be @option{-fno-foo}.  In the table
6130 below, only one of the forms is listed---the one you typically will
6131 use.  You can figure out the other form by either removing @samp{no-}
6132 or adding it.
6134 The following options control specific optimizations.  They are either
6135 activated by @option{-O} options or are related to ones that are.  You
6136 can use the following flags in the rare cases when ``fine-tuning'' of
6137 optimizations to be performed is desired.
6139 @table @gcctabopt
6140 @item -fno-default-inline
6141 @opindex fno-default-inline
6142 Do not make member functions inline by default merely because they are
6143 defined inside the class scope (C++ only).  Otherwise, when you specify
6144 @w{@option{-O}}, member functions defined inside class scope are compiled
6145 inline by default; i.e., you don't need to add @samp{inline} in front of
6146 the member function name.
6148 @item -fno-defer-pop
6149 @opindex fno-defer-pop
6150 Always pop the arguments to each function call as soon as that function
6151 returns.  For machines which must pop arguments after a function call,
6152 the compiler normally lets arguments accumulate on the stack for several
6153 function calls and pops them all at once.
6155 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6157 @item -fforward-propagate
6158 @opindex fforward-propagate
6159 Perform a forward propagation pass on RTL@.  The pass tries to combine two
6160 instructions and checks if the result can be simplified.  If loop unrolling
6161 is active, two passes are performed and the second is scheduled after
6162 loop unrolling.
6164 This option is enabled by default at optimization levels @option{-O},
6165 @option{-O2}, @option{-O3}, @option{-Os}.
6167 @item -ffp-contract=@var{style}
6168 @opindex ffp-contract
6169 @option{-ffp-contract=off} disables floating-point expression contraction.
6170 @option{-ffp-contract=fast} enables floating-point expression contraction
6171 such as forming of fused multiply-add operations if the target has
6172 native support for them.
6173 @option{-ffp-contract=on} enables floating-point expression contraction
6174 if allowed by the language standard.  This is currently not implemented
6175 and treated equal to @option{-ffp-contract=off}.
6177 The default is @option{-ffp-contract=fast}.
6179 @item -fomit-frame-pointer
6180 @opindex fomit-frame-pointer
6181 Don't keep the frame pointer in a register for functions that
6182 don't need one.  This avoids the instructions to save, set up and
6183 restore frame pointers; it also makes an extra register available
6184 in many functions.  @strong{It also makes debugging impossible on
6185 some machines.}
6187 On some machines, such as the VAX, this flag has no effect, because
6188 the standard calling sequence automatically handles the frame pointer
6189 and nothing is saved by pretending it doesn't exist.  The
6190 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
6191 whether a target machine supports this flag.  @xref{Registers,,Register
6192 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
6194 Starting with GCC version 4.6, the default setting (when not optimizing for
6195 size) for 32-bit Linux x86 and 32-bit Darwin x86 targets has been changed to
6196 @option{-fomit-frame-pointer}.  The default can be reverted to
6197 @option{-fno-omit-frame-pointer} by configuring GCC with the
6198 @option{--enable-frame-pointer} configure option.
6200 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6202 @item -foptimize-sibling-calls
6203 @opindex foptimize-sibling-calls
6204 Optimize sibling and tail recursive calls.
6206 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6208 @item -fno-inline
6209 @opindex fno-inline
6210 Don't pay attention to the @code{inline} keyword.  Normally this option
6211 is used to keep the compiler from expanding any functions inline.
6212 Note that if you are not optimizing, no functions can be expanded inline.
6214 @item -finline-small-functions
6215 @opindex finline-small-functions
6216 Integrate functions into their callers when their body is smaller than expected
6217 function call code (so overall size of program gets smaller).  The compiler
6218 heuristically decides which functions are simple enough to be worth integrating
6219 in this way.
6221 Enabled at level @option{-O2}.
6223 @item -findirect-inlining
6224 @opindex findirect-inlining
6225 Inline also indirect calls that are discovered to be known at compile
6226 time thanks to previous inlining.  This option has any effect only
6227 when inlining itself is turned on by the @option{-finline-functions}
6228 or @option{-finline-small-functions} options.
6230 Enabled at level @option{-O2}.
6232 @item -finline-functions
6233 @opindex finline-functions
6234 Integrate all simple functions into their callers.  The compiler
6235 heuristically decides which functions are simple enough to be worth
6236 integrating in this way.
6238 If all calls to a given function are integrated, and the function is
6239 declared @code{static}, then the function is normally not output as
6240 assembler code in its own right.
6242 Enabled at level @option{-O3}.
6244 @item -finline-functions-called-once
6245 @opindex finline-functions-called-once
6246 Consider all @code{static} functions called once for inlining into their
6247 caller even if they are not marked @code{inline}.  If a call to a given
6248 function is integrated, then the function is not output as assembler code
6249 in its own right.
6251 Enabled at levels @option{-O1}, @option{-O2}, @option{-O3} and @option{-Os}.
6253 @item -fearly-inlining
6254 @opindex fearly-inlining
6255 Inline functions marked by @code{always_inline} and functions whose body seems
6256 smaller than the function call overhead early before doing
6257 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
6258 makes profiling significantly cheaper and usually inlining faster on programs
6259 having large chains of nested wrapper functions.
6261 Enabled by default.
6263 @item -fipa-sra
6264 @opindex fipa-sra
6265 Perform interprocedural scalar replacement of aggregates, removal of
6266 unused parameters and replacement of parameters passed by reference
6267 by parameters passed by value.
6269 Enabled at levels @option{-O2}, @option{-O3} and @option{-Os}.
6271 @item -finline-limit=@var{n}
6272 @opindex finline-limit
6273 By default, GCC limits the size of functions that can be inlined.  This flag
6274 allows coarse control of this limit.  @var{n} is the size of functions that
6275 can be inlined in number of pseudo instructions.
6277 Inlining is actually controlled by a number of parameters, which may be
6278 specified individually by using @option{--param @var{name}=@var{value}}.
6279 The @option{-finline-limit=@var{n}} option sets some of these parameters
6280 as follows:
6282 @table @gcctabopt
6283 @item max-inline-insns-single
6284 is set to @var{n}/2.
6285 @item max-inline-insns-auto
6286 is set to @var{n}/2.
6287 @end table
6289 See below for a documentation of the individual
6290 parameters controlling inlining and for the defaults of these parameters.
6292 @emph{Note:} there may be no value to @option{-finline-limit} that results
6293 in default behavior.
6295 @emph{Note:} pseudo instruction represents, in this particular context, an
6296 abstract measurement of function's size.  In no way does it represent a count
6297 of assembly instructions and as such its exact meaning might change from one
6298 release to an another.
6300 @item -fno-keep-inline-dllexport
6301 @opindex -fno-keep-inline-dllexport
6302 This is a more fine-grained version of @option{-fkeep-inline-functions},
6303 which applies only to functions that are declared using the @code{dllexport}
6304 attribute or declspec (@xref{Function Attributes,,Declaring Attributes of
6305 Functions}.)
6307 @item -fkeep-inline-functions
6308 @opindex fkeep-inline-functions
6309 In C, emit @code{static} functions that are declared @code{inline}
6310 into the object file, even if the function has been inlined into all
6311 of its callers.  This switch does not affect functions using the
6312 @code{extern inline} extension in GNU C90@.  In C++, emit any and all
6313 inline functions into the object file.
6315 @item -fkeep-static-consts
6316 @opindex fkeep-static-consts
6317 Emit variables declared @code{static const} when optimization isn't turned
6318 on, even if the variables aren't referenced.
6320 GCC enables this option by default.  If you want to force the compiler to
6321 check if the variable was referenced, regardless of whether or not
6322 optimization is turned on, use the @option{-fno-keep-static-consts} option.
6324 @item -fmerge-constants
6325 @opindex fmerge-constants
6326 Attempt to merge identical constants (string constants and floating point
6327 constants) across compilation units.
6329 This option is the default for optimized compilation if the assembler and
6330 linker support it.  Use @option{-fno-merge-constants} to inhibit this
6331 behavior.
6333 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6335 @item -fmerge-all-constants
6336 @opindex fmerge-all-constants
6337 Attempt to merge identical constants and identical variables.
6339 This option implies @option{-fmerge-constants}.  In addition to
6340 @option{-fmerge-constants} this considers e.g.@: even constant initialized
6341 arrays or initialized constant variables with integral or floating point
6342 types.  Languages like C or C++ require each variable, including multiple
6343 instances of the same variable in recursive calls, to have distinct locations,
6344 so using this option will result in non-conforming
6345 behavior.
6347 @item -fmodulo-sched
6348 @opindex fmodulo-sched
6349 Perform swing modulo scheduling immediately before the first scheduling
6350 pass.  This pass looks at innermost loops and reorders their
6351 instructions by overlapping different iterations.
6353 @item -fmodulo-sched-allow-regmoves
6354 @opindex fmodulo-sched-allow-regmoves
6355 Perform more aggressive SMS based modulo scheduling with register moves
6356 allowed.  By setting this flag certain anti-dependences edges will be
6357 deleted which will trigger the generation of reg-moves based on the
6358 life-range analysis.  This option is effective only with
6359 @option{-fmodulo-sched} enabled.
6361 @item -fno-branch-count-reg
6362 @opindex fno-branch-count-reg
6363 Do not use ``decrement and branch'' instructions on a count register,
6364 but instead generate a sequence of instructions that decrement a
6365 register, compare it against zero, then branch based upon the result.
6366 This option is only meaningful on architectures that support such
6367 instructions, which include x86, PowerPC, IA-64 and S/390.
6369 The default is @option{-fbranch-count-reg}.
6371 @item -fno-function-cse
6372 @opindex fno-function-cse
6373 Do not put function addresses in registers; make each instruction that
6374 calls a constant function contain the function's address explicitly.
6376 This option results in less efficient code, but some strange hacks
6377 that alter the assembler output may be confused by the optimizations
6378 performed when this option is not used.
6380 The default is @option{-ffunction-cse}
6382 @item -fno-zero-initialized-in-bss
6383 @opindex fno-zero-initialized-in-bss
6384 If the target supports a BSS section, GCC by default puts variables that
6385 are initialized to zero into BSS@.  This can save space in the resulting
6386 code.
6388 This option turns off this behavior because some programs explicitly
6389 rely on variables going to the data section.  E.g., so that the
6390 resulting executable can find the beginning of that section and/or make
6391 assumptions based on that.
6393 The default is @option{-fzero-initialized-in-bss}.
6395 @item -fmudflap -fmudflapth -fmudflapir
6396 @opindex fmudflap
6397 @opindex fmudflapth
6398 @opindex fmudflapir
6399 @cindex bounds checking
6400 @cindex mudflap
6401 For front-ends that support it (C and C++), instrument all risky
6402 pointer/array dereferencing operations, some standard library
6403 string/heap functions, and some other associated constructs with
6404 range/validity tests.  Modules so instrumented should be immune to
6405 buffer overflows, invalid heap use, and some other classes of C/C++
6406 programming errors.  The instrumentation relies on a separate runtime
6407 library (@file{libmudflap}), which will be linked into a program if
6408 @option{-fmudflap} is given at link time.  Run-time behavior of the
6409 instrumented program is controlled by the @env{MUDFLAP_OPTIONS}
6410 environment variable.  See @code{env MUDFLAP_OPTIONS=-help a.out}
6411 for its options.
6413 Use @option{-fmudflapth} instead of @option{-fmudflap} to compile and to
6414 link if your program is multi-threaded.  Use @option{-fmudflapir}, in
6415 addition to @option{-fmudflap} or @option{-fmudflapth}, if
6416 instrumentation should ignore pointer reads.  This produces less
6417 instrumentation (and therefore faster execution) and still provides
6418 some protection against outright memory corrupting writes, but allows
6419 erroneously read data to propagate within a program.
6421 @item -fthread-jumps
6422 @opindex fthread-jumps
6423 Perform optimizations where we check to see if a jump branches to a
6424 location where another comparison subsumed by the first is found.  If
6425 so, the first branch is redirected to either the destination of the
6426 second branch or a point immediately following it, depending on whether
6427 the condition is known to be true or false.
6429 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6431 @item -fsplit-wide-types
6432 @opindex fsplit-wide-types
6433 When using a type that occupies multiple registers, such as @code{long
6434 long} on a 32-bit system, split the registers apart and allocate them
6435 independently.  This normally generates better code for those types,
6436 but may make debugging more difficult.
6438 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
6439 @option{-Os}.
6441 @item -fcse-follow-jumps
6442 @opindex fcse-follow-jumps
6443 In common subexpression elimination (CSE), scan through jump instructions
6444 when the target of the jump is not reached by any other path.  For
6445 example, when CSE encounters an @code{if} statement with an
6446 @code{else} clause, CSE will follow the jump when the condition
6447 tested is false.
6449 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6451 @item -fcse-skip-blocks
6452 @opindex fcse-skip-blocks
6453 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
6454 follow jumps which conditionally skip over blocks.  When CSE
6455 encounters a simple @code{if} statement with no else clause,
6456 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
6457 body of the @code{if}.
6459 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6461 @item -frerun-cse-after-loop
6462 @opindex frerun-cse-after-loop
6463 Re-run common subexpression elimination after loop optimizations has been
6464 performed.
6466 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6468 @item -fgcse
6469 @opindex fgcse
6470 Perform a global common subexpression elimination pass.
6471 This pass also performs global constant and copy propagation.
6473 @emph{Note:} When compiling a program using computed gotos, a GCC
6474 extension, you may get better runtime performance if you disable
6475 the global common subexpression elimination pass by adding
6476 @option{-fno-gcse} to the command line.
6478 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6480 @item -fgcse-lm
6481 @opindex fgcse-lm
6482 When @option{-fgcse-lm} is enabled, global common subexpression elimination will
6483 attempt to move loads which are only killed by stores into themselves.  This
6484 allows a loop containing a load/store sequence to be changed to a load outside
6485 the loop, and a copy/store within the loop.
6487 Enabled by default when gcse is enabled.
6489 @item -fgcse-sm
6490 @opindex fgcse-sm
6491 When @option{-fgcse-sm} is enabled, a store motion pass is run after
6492 global common subexpression elimination.  This pass will attempt to move
6493 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
6494 loops containing a load/store sequence can be changed to a load before
6495 the loop and a store after the loop.
6497 Not enabled at any optimization level.
6499 @item -fgcse-las
6500 @opindex fgcse-las
6501 When @option{-fgcse-las} is enabled, the global common subexpression
6502 elimination pass eliminates redundant loads that come after stores to the
6503 same memory location (both partial and full redundancies).
6505 Not enabled at any optimization level.
6507 @item -fgcse-after-reload
6508 @opindex fgcse-after-reload
6509 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
6510 pass is performed after reload.  The purpose of this pass is to cleanup
6511 redundant spilling.
6513 @item -funsafe-loop-optimizations
6514 @opindex funsafe-loop-optimizations
6515 If given, the loop optimizer will assume that loop indices do not
6516 overflow, and that the loops with nontrivial exit condition are not
6517 infinite.  This enables a wider range of loop optimizations even if
6518 the loop optimizer itself cannot prove that these assumptions are valid.
6519 Using @option{-Wunsafe-loop-optimizations}, the compiler will warn you
6520 if it finds this kind of loop.
6522 @item -fcrossjumping
6523 @opindex fcrossjumping
6524 Perform cross-jumping transformation.  This transformation unifies equivalent code and save code size.  The
6525 resulting code may or may not perform better than without cross-jumping.
6527 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6529 @item -fauto-inc-dec
6530 @opindex fauto-inc-dec
6531 Combine increments or decrements of addresses with memory accesses.
6532 This pass is always skipped on architectures that do not have
6533 instructions to support this.  Enabled by default at @option{-O} and
6534 higher on architectures that support this.
6536 @item -fdce
6537 @opindex fdce
6538 Perform dead code elimination (DCE) on RTL@.
6539 Enabled by default at @option{-O} and higher.
6541 @item -fdse
6542 @opindex fdse
6543 Perform dead store elimination (DSE) on RTL@.
6544 Enabled by default at @option{-O} and higher.
6546 @item -fif-conversion
6547 @opindex fif-conversion
6548 Attempt to transform conditional jumps into branch-less equivalents.  This
6549 include use of conditional moves, min, max, set flags and abs instructions, and
6550 some tricks doable by standard arithmetics.  The use of conditional execution
6551 on chips where it is available is controlled by @code{if-conversion2}.
6553 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6555 @item -fif-conversion2
6556 @opindex fif-conversion2
6557 Use conditional execution (where available) to transform conditional jumps into
6558 branch-less equivalents.
6560 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6562 @item -fdelete-null-pointer-checks
6563 @opindex fdelete-null-pointer-checks
6564 Assume that programs cannot safely dereference null pointers, and that
6565 no code or data element resides there.  This enables simple constant
6566 folding optimizations at all optimization levels.  In addition, other
6567 optimization passes in GCC use this flag to control global dataflow
6568 analyses that eliminate useless checks for null pointers; these assume
6569 that if a pointer is checked after it has already been dereferenced,
6570 it cannot be null.
6572 Note however that in some environments this assumption is not true.
6573 Use @option{-fno-delete-null-pointer-checks} to disable this optimization
6574 for programs which depend on that behavior.
6576 Some targets, especially embedded ones, disable this option at all levels.
6577 Otherwise it is enabled at all levels: @option{-O0}, @option{-O1},
6578 @option{-O2}, @option{-O3}, @option{-Os}.  Passes that use the information
6579 are enabled independently at different optimization levels.
6581 @item -fdevirtualize
6582 @opindex fdevirtualize
6583 Attempt to convert calls to virtual functions to direct calls.  This
6584 is done both within a procedure and interprocedurally as part of
6585 indirect inlining (@code{-findirect-inlining}) and interprocedural constant
6586 propagation (@option{-fipa-cp}).
6587 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6589 @item -fexpensive-optimizations
6590 @opindex fexpensive-optimizations
6591 Perform a number of minor optimizations that are relatively expensive.
6593 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6595 @item -foptimize-register-move
6596 @itemx -fregmove
6597 @opindex foptimize-register-move
6598 @opindex fregmove
6599 Attempt to reassign register numbers in move instructions and as
6600 operands of other simple instructions in order to maximize the amount of
6601 register tying.  This is especially helpful on machines with two-operand
6602 instructions.
6604 Note @option{-fregmove} and @option{-foptimize-register-move} are the same
6605 optimization.
6607 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6609 @item -fira-algorithm=@var{algorithm}
6610 Use specified coloring algorithm for the integrated register
6611 allocator.  The @var{algorithm} argument should be @code{priority} or
6612 @code{CB}.  The first algorithm specifies Chow's priority coloring,
6613 the second one specifies Chaitin-Briggs coloring.  The second
6614 algorithm can be unimplemented for some architectures.  If it is
6615 implemented, it is the default because Chaitin-Briggs coloring as a
6616 rule generates a better code.
6618 @item -fira-region=@var{region}
6619 Use specified regions for the integrated register allocator.  The
6620 @var{region} argument should be one of @code{all}, @code{mixed}, or
6621 @code{one}.  The first value means using all loops as register
6622 allocation regions, the second value which is the default means using
6623 all loops except for loops with small register pressure as the
6624 regions, and third one means using all function as a single region.
6625 The first value can give best result for machines with small size and
6626 irregular register set, the third one results in faster and generates
6627 decent code and the smallest size code, and the default value usually
6628 give the best results in most cases and for most architectures.
6630 @item -fira-loop-pressure
6631 @opindex fira-loop-pressure
6632 Use IRA to evaluate register pressure in loops for decision to move
6633 loop invariants.  Usage of this option usually results in generation
6634 of faster and smaller code on machines with big register files (>= 32
6635 registers) but it can slow compiler down.
6637 This option is enabled at level @option{-O3} for some targets.
6639 @item -fno-ira-share-save-slots
6640 @opindex fno-ira-share-save-slots
6641 Switch off sharing stack slots used for saving call used hard
6642 registers living through a call.  Each hard register will get a
6643 separate stack slot and as a result function stack frame will be
6644 bigger.
6646 @item -fno-ira-share-spill-slots
6647 @opindex fno-ira-share-spill-slots
6648 Switch off sharing stack slots allocated for pseudo-registers.  Each
6649 pseudo-register which did not get a hard register will get a separate
6650 stack slot and as a result function stack frame will be bigger.
6652 @item -fira-verbose=@var{n}
6653 @opindex fira-verbose
6654 Set up how verbose dump file for the integrated register allocator
6655 will be.  Default value is 5.  If the value is greater or equal to 10,
6656 the dump file will be stderr as if the value were @var{n} minus 10.
6658 @item -fdelayed-branch
6659 @opindex fdelayed-branch
6660 If supported for the target machine, attempt to reorder instructions
6661 to exploit instruction slots available after delayed branch
6662 instructions.
6664 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6666 @item -fschedule-insns
6667 @opindex fschedule-insns
6668 If supported for the target machine, attempt to reorder instructions to
6669 eliminate execution stalls due to required data being unavailable.  This
6670 helps machines that have slow floating point or memory load instructions
6671 by allowing other instructions to be issued until the result of the load
6672 or floating point instruction is required.
6674 Enabled at levels @option{-O2}, @option{-O3}.
6676 @item -fschedule-insns2
6677 @opindex fschedule-insns2
6678 Similar to @option{-fschedule-insns}, but requests an additional pass of
6679 instruction scheduling after register allocation has been done.  This is
6680 especially useful on machines with a relatively small number of
6681 registers and where memory load instructions take more than one cycle.
6683 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6685 @item -fno-sched-interblock
6686 @opindex fno-sched-interblock
6687 Don't schedule instructions across basic blocks.  This is normally
6688 enabled by default when scheduling before register allocation, i.e.@:
6689 with @option{-fschedule-insns} or at @option{-O2} or higher.
6691 @item -fno-sched-spec
6692 @opindex fno-sched-spec
6693 Don't allow speculative motion of non-load instructions.  This is normally
6694 enabled by default when scheduling before register allocation, i.e.@:
6695 with @option{-fschedule-insns} or at @option{-O2} or higher.
6697 @item -fsched-pressure
6698 @opindex fsched-pressure
6699 Enable register pressure sensitive insn scheduling before the register
6700 allocation.  This only makes sense when scheduling before register
6701 allocation is enabled, i.e.@: with @option{-fschedule-insns} or at
6702 @option{-O2} or higher.  Usage of this option can improve the
6703 generated code and decrease its size by preventing register pressure
6704 increase above the number of available hard registers and as a
6705 consequence register spills in the register allocation.
6707 @item -fsched-spec-load
6708 @opindex fsched-spec-load
6709 Allow speculative motion of some load instructions.  This only makes
6710 sense when scheduling before register allocation, i.e.@: with
6711 @option{-fschedule-insns} or at @option{-O2} or higher.
6713 @item -fsched-spec-load-dangerous
6714 @opindex fsched-spec-load-dangerous
6715 Allow speculative motion of more load instructions.  This only makes
6716 sense when scheduling before register allocation, i.e.@: with
6717 @option{-fschedule-insns} or at @option{-O2} or higher.
6719 @item -fsched-stalled-insns
6720 @itemx -fsched-stalled-insns=@var{n}
6721 @opindex fsched-stalled-insns
6722 Define how many insns (if any) can be moved prematurely from the queue
6723 of stalled insns into the ready list, during the second scheduling pass.
6724 @option{-fno-sched-stalled-insns} means that no insns will be moved
6725 prematurely, @option{-fsched-stalled-insns=0} means there is no limit
6726 on how many queued insns can be moved prematurely.
6727 @option{-fsched-stalled-insns} without a value is equivalent to
6728 @option{-fsched-stalled-insns=1}.
6730 @item -fsched-stalled-insns-dep
6731 @itemx -fsched-stalled-insns-dep=@var{n}
6732 @opindex fsched-stalled-insns-dep
6733 Define how many insn groups (cycles) will be examined for a dependency
6734 on a stalled insn that is candidate for premature removal from the queue
6735 of stalled insns.  This has an effect only during the second scheduling pass,
6736 and only if @option{-fsched-stalled-insns} is used.
6737 @option{-fno-sched-stalled-insns-dep} is equivalent to
6738 @option{-fsched-stalled-insns-dep=0}.
6739 @option{-fsched-stalled-insns-dep} without a value is equivalent to
6740 @option{-fsched-stalled-insns-dep=1}.
6742 @item -fsched2-use-superblocks
6743 @opindex fsched2-use-superblocks
6744 When scheduling after register allocation, do use superblock scheduling
6745 algorithm.  Superblock scheduling allows motion across basic block boundaries
6746 resulting on faster schedules.  This option is experimental, as not all machine
6747 descriptions used by GCC model the CPU closely enough to avoid unreliable
6748 results from the algorithm.
6750 This only makes sense when scheduling after register allocation, i.e.@: with
6751 @option{-fschedule-insns2} or at @option{-O2} or higher.
6753 @item -fsched-group-heuristic
6754 @opindex fsched-group-heuristic
6755 Enable the group heuristic in the scheduler.  This heuristic favors
6756 the instruction that belongs to a schedule group.  This is enabled
6757 by default when scheduling is enabled, i.e.@: with @option{-fschedule-insns}
6758 or @option{-fschedule-insns2} or at @option{-O2} or higher.
6760 @item -fsched-critical-path-heuristic
6761 @opindex fsched-critical-path-heuristic
6762 Enable the critical-path heuristic in the scheduler.  This heuristic favors
6763 instructions on the critical path.  This is enabled by default when
6764 scheduling is enabled, i.e.@: with @option{-fschedule-insns}
6765 or @option{-fschedule-insns2} or at @option{-O2} or higher.
6767 @item -fsched-spec-insn-heuristic
6768 @opindex fsched-spec-insn-heuristic
6769 Enable the speculative instruction heuristic in the scheduler.  This
6770 heuristic favors speculative instructions with greater dependency weakness.
6771 This is enabled by default when scheduling is enabled, i.e.@:
6772 with @option{-fschedule-insns} or @option{-fschedule-insns2}
6773 or at @option{-O2} or higher.
6775 @item -fsched-rank-heuristic
6776 @opindex fsched-rank-heuristic
6777 Enable the rank heuristic in the scheduler.  This heuristic favors
6778 the instruction belonging to a basic block with greater size or frequency.
6779 This is enabled by default when scheduling is enabled, i.e.@:
6780 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
6781 at @option{-O2} or higher.
6783 @item -fsched-last-insn-heuristic
6784 @opindex fsched-last-insn-heuristic
6785 Enable the last-instruction heuristic in the scheduler.  This heuristic
6786 favors the instruction that is less dependent on the last instruction
6787 scheduled.  This is enabled by default when scheduling is enabled,
6788 i.e.@: with @option{-fschedule-insns} or @option{-fschedule-insns2} or
6789 at @option{-O2} or higher.
6791 @item -fsched-dep-count-heuristic
6792 @opindex fsched-dep-count-heuristic
6793 Enable the dependent-count heuristic in the scheduler.  This heuristic
6794 favors the instruction that has more instructions depending on it.
6795 This is enabled by default when scheduling is enabled, i.e.@:
6796 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
6797 at @option{-O2} or higher.
6799 @item -freschedule-modulo-scheduled-loops
6800 @opindex freschedule-modulo-scheduled-loops
6801 The modulo scheduling comes before the traditional scheduling, if a loop
6802 was modulo scheduled we may want to prevent the later scheduling passes
6803 from changing its schedule, we use this option to control that.
6805 @item -fselective-scheduling
6806 @opindex fselective-scheduling
6807 Schedule instructions using selective scheduling algorithm.  Selective
6808 scheduling runs instead of the first scheduler pass.
6810 @item -fselective-scheduling2
6811 @opindex fselective-scheduling2
6812 Schedule instructions using selective scheduling algorithm.  Selective
6813 scheduling runs instead of the second scheduler pass.
6815 @item -fsel-sched-pipelining
6816 @opindex fsel-sched-pipelining
6817 Enable software pipelining of innermost loops during selective scheduling.
6818 This option has no effect until one of @option{-fselective-scheduling} or
6819 @option{-fselective-scheduling2} is turned on.
6821 @item -fsel-sched-pipelining-outer-loops
6822 @opindex fsel-sched-pipelining-outer-loops
6823 When pipelining loops during selective scheduling, also pipeline outer loops.
6824 This option has no effect until @option{-fsel-sched-pipelining} is turned on.
6826 @item -fcaller-saves
6827 @opindex fcaller-saves
6828 Enable values to be allocated in registers that will be clobbered by
6829 function calls, by emitting extra instructions to save and restore the
6830 registers around such calls.  Such allocation is done only when it
6831 seems to result in better code than would otherwise be produced.
6833 This option is always enabled by default on certain machines, usually
6834 those which have no call-preserved registers to use instead.
6836 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6838 @item -fcombine-stack-adjustments
6839 @opindex fcombine-stack-adjustments
6840 Tracks stack adjustments (pushes and pops) and stack memory references
6841 and then tries to find ways to combine them.
6843 Enabled by default at @option{-O1} and higher.
6845 @item -fconserve-stack
6846 @opindex fconserve-stack
6847 Attempt to minimize stack usage.  The compiler will attempt to use less
6848 stack space, even if that makes the program slower.  This option
6849 implies setting the @option{large-stack-frame} parameter to 100
6850 and the @option{large-stack-frame-growth} parameter to 400.
6852 @item -ftree-reassoc
6853 @opindex ftree-reassoc
6854 Perform reassociation on trees.  This flag is enabled by default
6855 at @option{-O} and higher.
6857 @item -ftree-pre
6858 @opindex ftree-pre
6859 Perform partial redundancy elimination (PRE) on trees.  This flag is
6860 enabled by default at @option{-O2} and @option{-O3}.
6862 @item -ftree-forwprop
6863 @opindex ftree-forwprop
6864 Perform forward propagation on trees.  This flag is enabled by default
6865 at @option{-O} and higher.
6867 @item -ftree-fre
6868 @opindex ftree-fre
6869 Perform full redundancy elimination (FRE) on trees.  The difference
6870 between FRE and PRE is that FRE only considers expressions
6871 that are computed on all paths leading to the redundant computation.
6872 This analysis is faster than PRE, though it exposes fewer redundancies.
6873 This flag is enabled by default at @option{-O} and higher.
6875 @item -ftree-phiprop
6876 @opindex ftree-phiprop
6877 Perform hoisting of loads from conditional pointers on trees.  This
6878 pass is enabled by default at @option{-O} and higher.
6880 @item -ftree-copy-prop
6881 @opindex ftree-copy-prop
6882 Perform copy propagation on trees.  This pass eliminates unnecessary
6883 copy operations.  This flag is enabled by default at @option{-O} and
6884 higher.
6886 @item -fipa-pure-const
6887 @opindex fipa-pure-const
6888 Discover which functions are pure or constant.
6889 Enabled by default at @option{-O} and higher.
6891 @item -fipa-reference
6892 @opindex fipa-reference
6893 Discover which static variables do not escape cannot escape the
6894 compilation unit.
6895 Enabled by default at @option{-O} and higher.
6897 @item -fipa-pta
6898 @opindex fipa-pta
6899 Perform interprocedural pointer analysis and interprocedural modification
6900 and reference analysis.  This option can cause excessive memory and
6901 compile-time usage on large compilation units.  It is not enabled by
6902 default at any optimization level.
6904 @item -fipa-profile
6905 @opindex fipa-profile
6906 Perform interprocedural profile propagation.  The functions called only from
6907 cold functions are marked as cold. Also functions executed once (such as
6908 @code{cold}, @code{noreturn}, static constructors or destructors) are identified. Cold
6909 functions and loop less parts of functions executed once are then optimized for
6910 size.
6911 Enabled by default at @option{-O} and higher.
6913 @item -fipa-cp
6914 @opindex fipa-cp
6915 Perform interprocedural constant propagation.
6916 This optimization analyzes the program to determine when values passed
6917 to functions are constants and then optimizes accordingly.
6918 This optimization can substantially increase performance
6919 if the application has constants passed to functions.
6920 This flag is enabled by default at @option{-O2}, @option{-Os} and @option{-O3}.
6922 @item -fipa-cp-clone
6923 @opindex fipa-cp-clone
6924 Perform function cloning to make interprocedural constant propagation stronger.
6925 When enabled, interprocedural constant propagation will perform function cloning
6926 when externally visible function can be called with constant arguments.
6927 Because this optimization can create multiple copies of functions,
6928 it may significantly increase code size
6929 (see @option{--param ipcp-unit-growth=@var{value}}).
6930 This flag is enabled by default at @option{-O3}.
6932 @item -fipa-matrix-reorg
6933 @opindex fipa-matrix-reorg
6934 Perform matrix flattening and transposing.
6935 Matrix flattening tries to replace an @math{m}-dimensional matrix
6936 with its equivalent @math{n}-dimensional matrix, where @math{n < m}.
6937 This reduces the level of indirection needed for accessing the elements
6938 of the matrix. The second optimization is matrix transposing that
6939 attempts to change the order of the matrix's dimensions in order to
6940 improve cache locality.
6941 Both optimizations need the @option{-fwhole-program} flag.
6942 Transposing is enabled only if profiling information is available.
6944 @item -ftree-sink
6945 @opindex ftree-sink
6946 Perform forward store motion  on trees.  This flag is
6947 enabled by default at @option{-O} and higher.
6949 @item -ftree-bit-ccp
6950 @opindex ftree-bit-ccp
6951 Perform sparse conditional bit constant propagation on trees and propagate
6952 pointer alignment information.
6953 This pass only operates on local scalar variables and is enabled by default
6954 at @option{-O} and higher.  It requires that @option{-ftree-ccp} is enabled.
6956 @item -ftree-ccp
6957 @opindex ftree-ccp
6958 Perform sparse conditional constant propagation (CCP) on trees.  This
6959 pass only operates on local scalar variables and is enabled by default
6960 at @option{-O} and higher.
6962 @item -ftree-switch-conversion
6963 Perform conversion of simple initializations in a switch to
6964 initializations from a scalar array.  This flag is enabled by default
6965 at @option{-O2} and higher.
6967 @item -ftree-dce
6968 @opindex ftree-dce
6969 Perform dead code elimination (DCE) on trees.  This flag is enabled by
6970 default at @option{-O} and higher.
6972 @item -ftree-builtin-call-dce
6973 @opindex ftree-builtin-call-dce
6974 Perform conditional dead code elimination (DCE) for calls to builtin functions
6975 that may set @code{errno} but are otherwise side-effect free.  This flag is
6976 enabled by default at @option{-O2} and higher if @option{-Os} is not also
6977 specified.
6979 @item -ftree-dominator-opts
6980 @opindex ftree-dominator-opts
6981 Perform a variety of simple scalar cleanups (constant/copy
6982 propagation, redundancy elimination, range propagation and expression
6983 simplification) based on a dominator tree traversal.  This also
6984 performs jump threading (to reduce jumps to jumps). This flag is
6985 enabled by default at @option{-O} and higher.
6987 @item -ftree-dse
6988 @opindex ftree-dse
6989 Perform dead store elimination (DSE) on trees.  A dead store is a store into
6990 a memory location which will later be overwritten by another store without
6991 any intervening loads.  In this case the earlier store can be deleted.  This
6992 flag is enabled by default at @option{-O} and higher.
6994 @item -ftree-ch
6995 @opindex ftree-ch
6996 Perform loop header copying on trees.  This is beneficial since it increases
6997 effectiveness of code motion optimizations.  It also saves one jump.  This flag
6998 is enabled by default at @option{-O} and higher.  It is not enabled
6999 for @option{-Os}, since it usually increases code size.
7001 @item -ftree-loop-optimize
7002 @opindex ftree-loop-optimize
7003 Perform loop optimizations on trees.  This flag is enabled by default
7004 at @option{-O} and higher.
7006 @item -ftree-loop-linear
7007 @opindex ftree-loop-linear
7008 Perform loop interchange transformations on tree.  Same as
7009 @option{-floop-interchange}.  To use this code transformation, GCC has
7010 to be configured with @option{--with-ppl} and @option{--with-cloog} to
7011 enable the Graphite loop transformation infrastructure.
7013 @item -floop-interchange
7014 @opindex floop-interchange
7015 Perform loop interchange transformations on loops.  Interchanging two
7016 nested loops switches the inner and outer loops.  For example, given a
7017 loop like:
7018 @smallexample
7019 DO J = 1, M
7020   DO I = 1, N
7021     A(J, I) = A(J, I) * C
7022   ENDDO
7023 ENDDO
7024 @end smallexample
7025 loop interchange will transform the loop as if the user had written:
7026 @smallexample
7027 DO I = 1, N
7028   DO J = 1, M
7029     A(J, I) = A(J, I) * C
7030   ENDDO
7031 ENDDO
7032 @end smallexample
7033 which can be beneficial when @code{N} is larger than the caches,
7034 because in Fortran, the elements of an array are stored in memory
7035 contiguously by column, and the original loop iterates over rows,
7036 potentially creating at each access a cache miss.  This optimization
7037 applies to all the languages supported by GCC and is not limited to
7038 Fortran.  To use this code transformation, GCC has to be configured
7039 with @option{--with-ppl} and @option{--with-cloog} to enable the
7040 Graphite loop transformation infrastructure.
7042 @item -floop-strip-mine
7043 @opindex floop-strip-mine
7044 Perform loop strip mining transformations on loops.  Strip mining
7045 splits a loop into two nested loops.  The outer loop has strides
7046 equal to the strip size and the inner loop has strides of the
7047 original loop within a strip.  The strip length can be changed
7048 using the @option{loop-block-tile-size} parameter.  For example,
7049 given a loop like:
7050 @smallexample
7051 DO I = 1, N
7052   A(I) = A(I) + C
7053 ENDDO
7054 @end smallexample
7055 loop strip mining will transform the loop as if the user had written:
7056 @smallexample
7057 DO II = 1, N, 51
7058   DO I = II, min (II + 50, N)
7059     A(I) = A(I) + C
7060   ENDDO
7061 ENDDO
7062 @end smallexample
7063 This optimization applies to all the languages supported by GCC and is
7064 not limited to Fortran.  To use this code transformation, GCC has to
7065 be configured with @option{--with-ppl} and @option{--with-cloog} to
7066 enable the Graphite loop transformation infrastructure.
7068 @item -floop-block
7069 @opindex floop-block
7070 Perform loop blocking transformations on loops.  Blocking strip mines
7071 each loop in the loop nest such that the memory accesses of the
7072 element loops fit inside caches.  The strip length can be changed
7073 using the @option{loop-block-tile-size} parameter.  For example, given
7074 a loop like:
7075 @smallexample
7076 DO I = 1, N
7077   DO J = 1, M
7078     A(J, I) = B(I) + C(J)
7079   ENDDO
7080 ENDDO
7081 @end smallexample
7082 loop blocking will transform the loop as if the user had written:
7083 @smallexample
7084 DO II = 1, N, 51
7085   DO JJ = 1, M, 51
7086     DO I = II, min (II + 50, N)
7087       DO J = JJ, min (JJ + 50, M)
7088         A(J, I) = B(I) + C(J)
7089       ENDDO
7090     ENDDO
7091   ENDDO
7092 ENDDO
7093 @end smallexample
7094 which can be beneficial when @code{M} is larger than the caches,
7095 because the innermost loop will iterate over a smaller amount of data
7096 that can be kept in the caches.  This optimization applies to all the
7097 languages supported by GCC and is not limited to Fortran.  To use this
7098 code transformation, GCC has to be configured with @option{--with-ppl}
7099 and @option{--with-cloog} to enable the Graphite loop transformation
7100 infrastructure.
7102 @item -fgraphite-identity
7103 @opindex fgraphite-identity
7104 Enable the identity transformation for graphite.  For every SCoP we generate
7105 the polyhedral representation and transform it back to gimple.  Using
7106 @option{-fgraphite-identity} we can check the costs or benefits of the
7107 GIMPLE -> GRAPHITE -> GIMPLE transformation.  Some minimal optimizations
7108 are also performed by the code generator CLooG, like index splitting and
7109 dead code elimination in loops.
7111 @item -floop-flatten
7112 @opindex floop-flatten
7113 Removes the loop nesting structure: transforms the loop nest into a
7114 single loop.  This transformation can be useful to vectorize all the
7115 levels of the loop nest.
7117 @item -floop-parallelize-all
7118 @opindex floop-parallelize-all
7119 Use the Graphite data dependence analysis to identify loops that can
7120 be parallelized.  Parallelize all the loops that can be analyzed to
7121 not contain loop carried dependences without checking that it is
7122 profitable to parallelize the loops.
7124 @item -fcheck-data-deps
7125 @opindex fcheck-data-deps
7126 Compare the results of several data dependence analyzers.  This option
7127 is used for debugging the data dependence analyzers.
7129 @item -ftree-loop-if-convert
7130 Attempt to transform conditional jumps in the innermost loops to
7131 branch-less equivalents.  The intent is to remove control-flow from
7132 the innermost loops in order to improve the ability of the
7133 vectorization pass to handle these loops.  This is enabled by default
7134 if vectorization is enabled.
7136 @item -ftree-loop-if-convert-stores
7137 Attempt to also if-convert conditional jumps containing memory writes.
7138 This transformation can be unsafe for multi-threaded programs as it
7139 transforms conditional memory writes into unconditional memory writes.
7140 For example,
7141 @smallexample
7142 for (i = 0; i < N; i++)
7143   if (cond)
7144     A[i] = expr;
7145 @end smallexample
7146 would be transformed to
7147 @smallexample
7148 for (i = 0; i < N; i++)
7149   A[i] = cond ? expr : A[i];
7150 @end smallexample
7151 potentially producing data races.
7153 @item -ftree-loop-distribution
7154 Perform loop distribution.  This flag can improve cache performance on
7155 big loop bodies and allow further loop optimizations, like
7156 parallelization or vectorization, to take place.  For example, the loop
7157 @smallexample
7158 DO I = 1, N
7159   A(I) = B(I) + C
7160   D(I) = E(I) * F
7161 ENDDO
7162 @end smallexample
7163 is transformed to
7164 @smallexample
7165 DO I = 1, N
7166    A(I) = B(I) + C
7167 ENDDO
7168 DO I = 1, N
7169    D(I) = E(I) * F
7170 ENDDO
7171 @end smallexample
7173 @item -ftree-loop-distribute-patterns
7174 Perform loop distribution of patterns that can be code generated with
7175 calls to a library.  This flag is enabled by default at @option{-O3}.
7177 This pass distributes the initialization loops and generates a call to
7178 memset zero.  For example, the loop
7179 @smallexample
7180 DO I = 1, N
7181   A(I) = 0
7182   B(I) = A(I) + I
7183 ENDDO
7184 @end smallexample
7185 is transformed to
7186 @smallexample
7187 DO I = 1, N
7188    A(I) = 0
7189 ENDDO
7190 DO I = 1, N
7191    B(I) = A(I) + I
7192 ENDDO
7193 @end smallexample
7194 and the initialization loop is transformed into a call to memset zero.
7196 @item -ftree-loop-im
7197 @opindex ftree-loop-im
7198 Perform loop invariant motion on trees.  This pass moves only invariants that
7199 would be hard to handle at RTL level (function calls, operations that expand to
7200 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
7201 operands of conditions that are invariant out of the loop, so that we can use
7202 just trivial invariantness analysis in loop unswitching.  The pass also includes
7203 store motion.
7205 @item -ftree-loop-ivcanon
7206 @opindex ftree-loop-ivcanon
7207 Create a canonical counter for number of iterations in the loop for that
7208 determining number of iterations requires complicated analysis.  Later
7209 optimizations then may determine the number easily.  Useful especially
7210 in connection with unrolling.
7212 @item -fivopts
7213 @opindex fivopts
7214 Perform induction variable optimizations (strength reduction, induction
7215 variable merging and induction variable elimination) on trees.
7217 @item -ftree-parallelize-loops=n
7218 @opindex ftree-parallelize-loops
7219 Parallelize loops, i.e., split their iteration space to run in n threads.
7220 This is only possible for loops whose iterations are independent
7221 and can be arbitrarily reordered.  The optimization is only
7222 profitable on multiprocessor machines, for loops that are CPU-intensive,
7223 rather than constrained e.g.@: by memory bandwidth.  This option
7224 implies @option{-pthread}, and thus is only supported on targets
7225 that have support for @option{-pthread}.
7227 @item -ftree-pta
7228 @opindex ftree-pta
7229 Perform function-local points-to analysis on trees.  This flag is
7230 enabled by default at @option{-O} and higher.
7232 @item -ftree-sra
7233 @opindex ftree-sra
7234 Perform scalar replacement of aggregates.  This pass replaces structure
7235 references with scalars to prevent committing structures to memory too
7236 early.  This flag is enabled by default at @option{-O} and higher.
7238 @item -ftree-copyrename
7239 @opindex ftree-copyrename
7240 Perform copy renaming on trees.  This pass attempts to rename compiler
7241 temporaries to other variables at copy locations, usually resulting in
7242 variable names which more closely resemble the original variables.  This flag
7243 is enabled by default at @option{-O} and higher.
7245 @item -ftree-ter
7246 @opindex ftree-ter
7247 Perform temporary expression replacement during the SSA->normal phase.  Single
7248 use/single def temporaries are replaced at their use location with their
7249 defining expression.  This results in non-GIMPLE code, but gives the expanders
7250 much more complex trees to work on resulting in better RTL generation.  This is
7251 enabled by default at @option{-O} and higher.
7253 @item -ftree-vectorize
7254 @opindex ftree-vectorize
7255 Perform loop vectorization on trees. This flag is enabled by default at
7256 @option{-O3}.
7258 @item -ftree-slp-vectorize
7259 @opindex ftree-slp-vectorize
7260 Perform basic block vectorization on trees. This flag is enabled by default at
7261 @option{-O3} and when @option{-ftree-vectorize} is enabled.
7263 @item -ftree-vect-loop-version
7264 @opindex ftree-vect-loop-version
7265 Perform loop versioning when doing loop vectorization on trees.  When a loop
7266 appears to be vectorizable except that data alignment or data dependence cannot
7267 be determined at compile time then vectorized and non-vectorized versions of
7268 the loop are generated along with runtime checks for alignment or dependence
7269 to control which version is executed.  This option is enabled by default
7270 except at level @option{-Os} where it is disabled.
7272 @item -fvect-cost-model
7273 @opindex fvect-cost-model
7274 Enable cost model for vectorization.
7276 @item -ftree-vrp
7277 @opindex ftree-vrp
7278 Perform Value Range Propagation on trees.  This is similar to the
7279 constant propagation pass, but instead of values, ranges of values are
7280 propagated.  This allows the optimizers to remove unnecessary range
7281 checks like array bound checks and null pointer checks.  This is
7282 enabled by default at @option{-O2} and higher.  Null pointer check
7283 elimination is only done if @option{-fdelete-null-pointer-checks} is
7284 enabled.
7286 @item -ftracer
7287 @opindex ftracer
7288 Perform tail duplication to enlarge superblock size.  This transformation
7289 simplifies the control flow of the function allowing other optimizations to do
7290 better job.
7292 @item -funroll-loops
7293 @opindex funroll-loops
7294 Unroll loops whose number of iterations can be determined at compile
7295 time or upon entry to the loop.  @option{-funroll-loops} implies
7296 @option{-frerun-cse-after-loop}.  This option makes code larger,
7297 and may or may not make it run faster.
7299 @item -funroll-all-loops
7300 @opindex funroll-all-loops
7301 Unroll all loops, even if their number of iterations is uncertain when
7302 the loop is entered.  This usually makes programs run more slowly.
7303 @option{-funroll-all-loops} implies the same options as
7304 @option{-funroll-loops},
7306 @item -fsplit-ivs-in-unroller
7307 @opindex fsplit-ivs-in-unroller
7308 Enables expressing of values of induction variables in later iterations
7309 of the unrolled loop using the value in the first iteration.  This breaks
7310 long dependency chains, thus improving efficiency of the scheduling passes.
7312 Combination of @option{-fweb} and CSE is often sufficient to obtain the
7313 same effect.  However in cases the loop body is more complicated than
7314 a single basic block, this is not reliable.  It also does not work at all
7315 on some of the architectures due to restrictions in the CSE pass.
7317 This optimization is enabled by default.
7319 @item -fvariable-expansion-in-unroller
7320 @opindex fvariable-expansion-in-unroller
7321 With this option, the compiler will create multiple copies of some
7322 local variables when unrolling a loop which can result in superior code.
7324 @item -fpartial-inlining
7325 @opindex fpartial-inlining
7326 Inline parts of functions.  This option has any effect only
7327 when inlining itself is turned on by the @option{-finline-functions}
7328 or @option{-finline-small-functions} options.
7330 Enabled at level @option{-O2}.
7332 @item -fpredictive-commoning
7333 @opindex fpredictive-commoning
7334 Perform predictive commoning optimization, i.e., reusing computations
7335 (especially memory loads and stores) performed in previous
7336 iterations of loops.
7338 This option is enabled at level @option{-O3}.
7340 @item -fprefetch-loop-arrays
7341 @opindex fprefetch-loop-arrays
7342 If supported by the target machine, generate instructions to prefetch
7343 memory to improve the performance of loops that access large arrays.
7345 This option may generate better or worse code; results are highly
7346 dependent on the structure of loops within the source code.
7348 Disabled at level @option{-Os}.
7350 @item -fno-peephole
7351 @itemx -fno-peephole2
7352 @opindex fno-peephole
7353 @opindex fno-peephole2
7354 Disable any machine-specific peephole optimizations.  The difference
7355 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
7356 are implemented in the compiler; some targets use one, some use the
7357 other, a few use both.
7359 @option{-fpeephole} is enabled by default.
7360 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7362 @item -fno-guess-branch-probability
7363 @opindex fno-guess-branch-probability
7364 Do not guess branch probabilities using heuristics.
7366 GCC will use heuristics to guess branch probabilities if they are
7367 not provided by profiling feedback (@option{-fprofile-arcs}).  These
7368 heuristics are based on the control flow graph.  If some branch probabilities
7369 are specified by @samp{__builtin_expect}, then the heuristics will be
7370 used to guess branch probabilities for the rest of the control flow graph,
7371 taking the @samp{__builtin_expect} info into account.  The interactions
7372 between the heuristics and @samp{__builtin_expect} can be complex, and in
7373 some cases, it may be useful to disable the heuristics so that the effects
7374 of @samp{__builtin_expect} are easier to understand.
7376 The default is @option{-fguess-branch-probability} at levels
7377 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7379 @item -freorder-blocks
7380 @opindex freorder-blocks
7381 Reorder basic blocks in the compiled function in order to reduce number of
7382 taken branches and improve code locality.
7384 Enabled at levels @option{-O2}, @option{-O3}.
7386 @item -freorder-blocks-and-partition
7387 @opindex freorder-blocks-and-partition
7388 In addition to reordering basic blocks in the compiled function, in order
7389 to reduce number of taken branches, partitions hot and cold basic blocks
7390 into separate sections of the assembly and .o files, to improve
7391 paging and cache locality performance.
7393 This optimization is automatically turned off in the presence of
7394 exception handling, for linkonce sections, for functions with a user-defined
7395 section attribute and on any architecture that does not support named
7396 sections.
7398 @item -freorder-functions
7399 @opindex freorder-functions
7400 Reorder functions in the object file in order to
7401 improve code locality.  This is implemented by using special
7402 subsections @code{.text.hot} for most frequently executed functions and
7403 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
7404 the linker so object file format must support named sections and linker must
7405 place them in a reasonable way.
7407 Also profile feedback must be available in to make this option effective.  See
7408 @option{-fprofile-arcs} for details.
7410 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7412 @item -fstrict-aliasing
7413 @opindex fstrict-aliasing
7414 Allow the compiler to assume the strictest aliasing rules applicable to
7415 the language being compiled.  For C (and C++), this activates
7416 optimizations based on the type of expressions.  In particular, an
7417 object of one type is assumed never to reside at the same address as an
7418 object of a different type, unless the types are almost the same.  For
7419 example, an @code{unsigned int} can alias an @code{int}, but not a
7420 @code{void*} or a @code{double}.  A character type may alias any other
7421 type.
7423 @anchor{Type-punning}Pay special attention to code like this:
7424 @smallexample
7425 union a_union @{
7426   int i;
7427   double d;
7430 int f() @{
7431   union a_union t;
7432   t.d = 3.0;
7433   return t.i;
7435 @end smallexample
7436 The practice of reading from a different union member than the one most
7437 recently written to (called ``type-punning'') is common.  Even with
7438 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
7439 is accessed through the union type.  So, the code above will work as
7440 expected.  @xref{Structures unions enumerations and bit-fields
7441 implementation}.  However, this code might not:
7442 @smallexample
7443 int f() @{
7444   union a_union t;
7445   int* ip;
7446   t.d = 3.0;
7447   ip = &t.i;
7448   return *ip;
7450 @end smallexample
7452 Similarly, access by taking the address, casting the resulting pointer
7453 and dereferencing the result has undefined behavior, even if the cast
7454 uses a union type, e.g.:
7455 @smallexample
7456 int f() @{
7457   double d = 3.0;
7458   return ((union a_union *) &d)->i;
7460 @end smallexample
7462 The @option{-fstrict-aliasing} option is enabled at levels
7463 @option{-O2}, @option{-O3}, @option{-Os}.
7465 @item -fstrict-overflow
7466 @opindex fstrict-overflow
7467 Allow the compiler to assume strict signed overflow rules, depending
7468 on the language being compiled.  For C (and C++) this means that
7469 overflow when doing arithmetic with signed numbers is undefined, which
7470 means that the compiler may assume that it will not happen.  This
7471 permits various optimizations.  For example, the compiler will assume
7472 that an expression like @code{i + 10 > i} will always be true for
7473 signed @code{i}.  This assumption is only valid if signed overflow is
7474 undefined, as the expression is false if @code{i + 10} overflows when
7475 using twos complement arithmetic.  When this option is in effect any
7476 attempt to determine whether an operation on signed numbers will
7477 overflow must be written carefully to not actually involve overflow.
7479 This option also allows the compiler to assume strict pointer
7480 semantics: given a pointer to an object, if adding an offset to that
7481 pointer does not produce a pointer to the same object, the addition is
7482 undefined.  This permits the compiler to conclude that @code{p + u >
7483 p} is always true for a pointer @code{p} and unsigned integer
7484 @code{u}.  This assumption is only valid because pointer wraparound is
7485 undefined, as the expression is false if @code{p + u} overflows using
7486 twos complement arithmetic.
7488 See also the @option{-fwrapv} option.  Using @option{-fwrapv} means
7489 that integer signed overflow is fully defined: it wraps.  When
7490 @option{-fwrapv} is used, there is no difference between
7491 @option{-fstrict-overflow} and @option{-fno-strict-overflow} for
7492 integers.  With @option{-fwrapv} certain types of overflow are
7493 permitted.  For example, if the compiler gets an overflow when doing
7494 arithmetic on constants, the overflowed value can still be used with
7495 @option{-fwrapv}, but not otherwise.
7497 The @option{-fstrict-overflow} option is enabled at levels
7498 @option{-O2}, @option{-O3}, @option{-Os}.
7500 @item -falign-functions
7501 @itemx -falign-functions=@var{n}
7502 @opindex falign-functions
7503 Align the start of functions to the next power-of-two greater than
7504 @var{n}, skipping up to @var{n} bytes.  For instance,
7505 @option{-falign-functions=32} aligns functions to the next 32-byte
7506 boundary, but @option{-falign-functions=24} would align to the next
7507 32-byte boundary only if this can be done by skipping 23 bytes or less.
7509 @option{-fno-align-functions} and @option{-falign-functions=1} are
7510 equivalent and mean that functions will not be aligned.
7512 Some assemblers only support this flag when @var{n} is a power of two;
7513 in that case, it is rounded up.
7515 If @var{n} is not specified or is zero, use a machine-dependent default.
7517 Enabled at levels @option{-O2}, @option{-O3}.
7519 @item -falign-labels
7520 @itemx -falign-labels=@var{n}
7521 @opindex falign-labels
7522 Align all branch targets to a power-of-two boundary, skipping up to
7523 @var{n} bytes like @option{-falign-functions}.  This option can easily
7524 make code slower, because it must insert dummy operations for when the
7525 branch target is reached in the usual flow of the code.
7527 @option{-fno-align-labels} and @option{-falign-labels=1} are
7528 equivalent and mean that labels will not be aligned.
7530 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
7531 are greater than this value, then their values are used instead.
7533 If @var{n} is not specified or is zero, use a machine-dependent default
7534 which is very likely to be @samp{1}, meaning no alignment.
7536 Enabled at levels @option{-O2}, @option{-O3}.
7538 @item -falign-loops
7539 @itemx -falign-loops=@var{n}
7540 @opindex falign-loops
7541 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
7542 like @option{-falign-functions}.  The hope is that the loop will be
7543 executed many times, which will make up for any execution of the dummy
7544 operations.
7546 @option{-fno-align-loops} and @option{-falign-loops=1} are
7547 equivalent and mean that loops will not be aligned.
7549 If @var{n} is not specified or is zero, use a machine-dependent default.
7551 Enabled at levels @option{-O2}, @option{-O3}.
7553 @item -falign-jumps
7554 @itemx -falign-jumps=@var{n}
7555 @opindex falign-jumps
7556 Align branch targets to a power-of-two boundary, for branch targets
7557 where the targets can only be reached by jumping, skipping up to @var{n}
7558 bytes like @option{-falign-functions}.  In this case, no dummy operations
7559 need be executed.
7561 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
7562 equivalent and mean that loops will not be aligned.
7564 If @var{n} is not specified or is zero, use a machine-dependent default.
7566 Enabled at levels @option{-O2}, @option{-O3}.
7568 @item -funit-at-a-time
7569 @opindex funit-at-a-time
7570 This option is left for compatibility reasons. @option{-funit-at-a-time}
7571 has no effect, while @option{-fno-unit-at-a-time} implies
7572 @option{-fno-toplevel-reorder} and @option{-fno-section-anchors}.
7574 Enabled by default.
7576 @item -fno-toplevel-reorder
7577 @opindex fno-toplevel-reorder
7578 Do not reorder top-level functions, variables, and @code{asm}
7579 statements.  Output them in the same order that they appear in the
7580 input file.  When this option is used, unreferenced static variables
7581 will not be removed.  This option is intended to support existing code
7582 which relies on a particular ordering.  For new code, it is better to
7583 use attributes.
7585 Enabled at level @option{-O0}.  When disabled explicitly, it also imply
7586 @option{-fno-section-anchors} that is otherwise enabled at @option{-O0} on some
7587 targets.
7589 @item -fweb
7590 @opindex fweb
7591 Constructs webs as commonly used for register allocation purposes and assign
7592 each web individual pseudo register.  This allows the register allocation pass
7593 to operate on pseudos directly, but also strengthens several other optimization
7594 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
7595 however, make debugging impossible, since variables will no longer stay in a
7596 ``home register''.
7598 Enabled by default with @option{-funroll-loops}.
7600 @item -fwhole-program
7601 @opindex fwhole-program
7602 Assume that the current compilation unit represents the whole program being
7603 compiled.  All public functions and variables with the exception of @code{main}
7604 and those merged by attribute @code{externally_visible} become static functions
7605 and in effect are optimized more aggressively by interprocedural optimizers. If @command{gold} is used as the linker plugin, @code{externally_visible} attributes are automatically added to functions (not variable yet due to a current @command{gold} issue) that are accessed outside of LTO objects according to resolution file produced by @command{gold}.  For other linkers that cannot generate resolution file, explicit @code{externally_visible} attributes are still necessary.
7606 While this option is equivalent to proper use of the @code{static} keyword for
7607 programs consisting of a single file, in combination with option
7608 @option{-flto} this flag can be used to
7609 compile many smaller scale programs since the functions and variables become
7610 local for the whole combined compilation unit, not for the single source file
7611 itself.
7613 This option implies @option{-fwhole-file} for Fortran programs.
7615 @item -flto[=@var{n}]
7616 @opindex flto
7617 This option runs the standard link-time optimizer.  When invoked
7618 with source code, it generates GIMPLE (one of GCC's internal
7619 representations) and writes it to special ELF sections in the object
7620 file.  When the object files are linked together, all the function
7621 bodies are read from these ELF sections and instantiated as if they
7622 had been part of the same translation unit.
7624 To use the link-timer optimizer, @option{-flto} needs to be specified at
7625 compile time and during the final link.  For example,
7627 @smallexample
7628 gcc -c -O2 -flto foo.c
7629 gcc -c -O2 -flto bar.c
7630 gcc -o myprog -flto -O2 foo.o bar.o
7631 @end smallexample
7633 The first two invocations to GCC will save a bytecode representation
7634 of GIMPLE into special ELF sections inside @file{foo.o} and
7635 @file{bar.o}.  The final invocation will read the GIMPLE bytecode from
7636 @file{foo.o} and @file{bar.o}, merge the two files into a single
7637 internal image, and compile the result as usual.  Since both
7638 @file{foo.o} and @file{bar.o} are merged into a single image, this
7639 causes all the inter-procedural analyses and optimizations in GCC to
7640 work across the two files as if they were a single one.  This means,
7641 for example, that the inliner will be able to inline functions in
7642 @file{bar.o} into functions in @file{foo.o} and vice-versa.
7644 Another (simpler) way to enable link-time optimization is,
7646 @smallexample
7647 gcc -o myprog -flto -O2 foo.c bar.c
7648 @end smallexample
7650 The above will generate bytecode for @file{foo.c} and @file{bar.c},
7651 merge them together into a single GIMPLE representation and optimize
7652 them as usual to produce @file{myprog}.
7654 The only important thing to keep in mind is that to enable link-time
7655 optimizations the @option{-flto} flag needs to be passed to both the
7656 compile and the link commands.
7658 To make whole program optimization effective, it is necessary to make
7659 certain whole program assumptions.  The compiler needs to know
7660 what functions and variables can be accessed by libraries and runtime
7661 outside of the link time optimized unit.  When supported by the linker,
7662 the linker plugin (see @option{-fuse-linker-plugin}) passes to the
7663 compiler information about used and externally visible symbols.  When
7664 the linker plugin is not available, @option{-fwhole-program} should be
7665 used to allow the compiler to make these assumptions, which will lead
7666 to more aggressive optimization decisions.
7668 Note that when a file is compiled with @option{-flto}, the generated
7669 object file will be larger than a regular object file because it will
7670 contain GIMPLE bytecodes and the usual final code.  This means that
7671 object files with LTO information can be linked as a normal object
7672 file.  So, in the previous example, if the final link is done with
7674 @smallexample
7675 gcc -o myprog foo.o bar.o
7676 @end smallexample
7678 The only difference will be that no inter-procedural optimizations
7679 will be applied to produce @file{myprog}.  The two object files
7680 @file{foo.o} and @file{bar.o} will be simply sent to the regular
7681 linker.
7683 Additionally, the optimization flags used to compile individual files
7684 are not necessarily related to those used at link-time.  For instance,
7686 @smallexample
7687 gcc -c -O0 -flto foo.c
7688 gcc -c -O0 -flto bar.c
7689 gcc -o myprog -flto -O3 foo.o bar.o
7690 @end smallexample
7692 This will produce individual object files with unoptimized assembler
7693 code, but the resulting binary @file{myprog} will be optimized at
7694 @option{-O3}.  Now, if the final binary is generated without
7695 @option{-flto}, then @file{myprog} will not be optimized.
7697 When producing the final binary with @option{-flto}, GCC will only
7698 apply link-time optimizations to those files that contain bytecode.
7699 Therefore, you can mix and match object files and libraries with
7700 GIMPLE bytecodes and final object code.  GCC will automatically select
7701 which files to optimize in LTO mode and which files to link without
7702 further processing.
7704 There are some code generation flags that GCC will preserve when
7705 generating bytecodes, as they need to be used during the final link
7706 stage.  Currently, the following options are saved into the GIMPLE
7707 bytecode files: @option{-fPIC}, @option{-fcommon} and all the
7708 @option{-m} target flags.
7710 At link time, these options are read-in and reapplied.  Note that the
7711 current implementation makes no attempt at recognizing conflicting
7712 values for these options.  If two or more files have a conflicting
7713 value (e.g., one file is compiled with @option{-fPIC} and another
7714 isn't), the compiler will simply use the last value read from the
7715 bytecode files.  It is recommended, then, that all the files
7716 participating in the same link be compiled with the same options.
7718 Another feature of LTO is that it is possible to apply interprocedural
7719 optimizations on files written in different languages.  This requires
7720 some support in the language front end.  Currently, the C, C++ and
7721 Fortran front ends are capable of emitting GIMPLE bytecodes, so
7722 something like this should work
7724 @smallexample
7725 gcc -c -flto foo.c
7726 g++ -c -flto bar.cc
7727 gfortran -c -flto baz.f90
7728 g++ -o myprog -flto -O3 foo.o bar.o baz.o -lgfortran
7729 @end smallexample
7731 Notice that the final link is done with @command{g++} to get the C++
7732 runtime libraries and @option{-lgfortran} is added to get the Fortran
7733 runtime libraries.  In general, when mixing languages in LTO mode, you
7734 should use the same link command used when mixing languages in a
7735 regular (non-LTO) compilation.  This means that if your build process
7736 was mixing languages before, all you need to add is @option{-flto} to
7737 all the compile and link commands.
7739 If LTO encounters objects with C linkage declared with incompatible
7740 types in separate translation units to be linked together (undefined
7741 behavior according to ISO C99 6.2.7), a non-fatal diagnostic may be
7742 issued.  The behavior is still undefined at runtime.
7744 If object files containing GIMPLE bytecode are stored in a library archive, say
7745 @file{libfoo.a}, it is possible to extract and use them in an LTO link if you
7746 are using a linker with linker plugin support.  To enable this feature, use
7747 the flag @option{-fuse-linker-plugin} at link-time:
7749 @smallexample
7750 gcc -o myprog -O2 -flto -fuse-linker-plugin a.o b.o -lfoo
7751 @end smallexample
7753 With the linker plugin enabled, the linker will extract the needed
7754 GIMPLE files from @file{libfoo.a} and pass them on to the running GCC
7755 to make them part of the aggregated GIMPLE image to be optimized.
7757 If you are not using a linker with linker plugin support and/or do not
7758 enable linker plugin then the objects inside @file{libfoo.a}
7759 will be extracted and linked as usual, but they will not participate
7760 in the LTO optimization process.
7762 Link time optimizations do not require the presence of the whole program to
7763 operate.  If the program does not require any symbols to be exported, it is
7764 possible to combine @option{-flto} and with @option{-fwhole-program} to allow
7765 the interprocedural optimizers to use more aggressive assumptions which may
7766 lead to improved optimization opportunities.
7767 Use of @option{-fwhole-program} is not needed when linker plugin is
7768 active (see @option{-fuse-linker-plugin}).
7770 Regarding portability: the current implementation of LTO makes no
7771 attempt at generating bytecode that can be ported between different
7772 types of hosts.  The bytecode files are versioned and there is a
7773 strict version check, so bytecode files generated in one version of
7774 GCC will not work with an older/newer version of GCC.
7776 Link time optimization does not play well with generating debugging
7777 information.  Combining @option{-flto} with
7778 @option{-g} is currently experimental and expected to produce wrong
7779 results.
7781 If you specify the optional @var{n}, the optimization and code
7782 generation done at link time is executed in parallel using @var{n}
7783 parallel jobs by utilizing an installed @command{make} program.  The
7784 environment variable @env{MAKE} may be used to override the program
7785 used.  The default value for @var{n} is 1.
7787 You can also specify @option{-flto=jobserver} to use GNU make's
7788 job server mode to determine the number of parallel jobs. This
7789 is useful when the Makefile calling GCC is already executing in parallel.
7790 The parent Makefile will need a @samp{+} prepended to the command recipe
7791 for this to work. This will likely only work if @env{MAKE} is
7792 GNU make.
7794 This option is disabled by default.
7796 @item -flto-partition=@var{alg}
7797 @opindex flto-partition
7798 Specify the partitioning algorithm used by the link time optimizer.
7799 The value is either @code{1to1} to specify a partitioning mirroring
7800 the original source files or @code{balanced} to specify partitioning
7801 into equally sized chunks (whenever possible).  Specifying @code{none}
7802 as an algorithm disables partitioning and streaming completely. The
7803 default value is @code{balanced}.
7805 @item -flto-compression-level=@var{n}
7806 This option specifies the level of compression used for intermediate
7807 language written to LTO object files, and is only meaningful in
7808 conjunction with LTO mode (@option{-flto}).  Valid
7809 values are 0 (no compression) to 9 (maximum compression).  Values
7810 outside this range are clamped to either 0 or 9.  If the option is not
7811 given, a default balanced compression setting is used.
7813 @item -flto-report
7814 Prints a report with internal details on the workings of the link-time
7815 optimizer.  The contents of this report vary from version to version,
7816 it is meant to be useful to GCC developers when processing object
7817 files in LTO mode (via @option{-flto}).
7819 Disabled by default.
7821 @item -fuse-linker-plugin
7822 Enables the use of a linker plugin during link time optimization.  This
7823 option relies on plugin support in the linker, which is available in gold
7824 or in GNU ld 2.21 or newer.
7826 This option enables the extraction of object files with GIMPLE bytecode out
7827 of library archives. This improves the quality of optimization by exposing
7828 more code to the link time optimizer.  This information specifies what
7829 symbols can be accessed externally (by non-LTO object or during dynamic
7830 linking).  Resulting code quality improvements on binaries (and shared
7831 libraries that use hidden visibility) are similar to @code{-fwhole-program}.
7832 See @option{-flto} for a description of the effect of this flag and how to
7833 use it.
7835 Enabled by default when LTO support in GCC is enabled and GCC was compiled
7836 with a linker supporting plugins (GNU ld 2.21 or newer or gold).
7838 @item -fcompare-elim
7839 @opindex fcompare-elim
7840 After register allocation and post-register allocation instruction splitting,
7841 identify arithmetic instructions that compute processor flags similar to a
7842 comparison operation based on that arithmetic.  If possible, eliminate the
7843 explicit comparison operation.
7845 This pass only applies to certain targets that cannot explicitly represent
7846 the comparison operation before register allocation is complete.
7848 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7850 @item -fcprop-registers
7851 @opindex fcprop-registers
7852 After register allocation and post-register allocation instruction splitting,
7853 we perform a copy-propagation pass to try to reduce scheduling dependencies
7854 and occasionally eliminate the copy.
7856 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7858 @item -fprofile-correction
7859 @opindex fprofile-correction
7860 Profiles collected using an instrumented binary for multi-threaded programs may
7861 be inconsistent due to missed counter updates. When this option is specified,
7862 GCC will use heuristics to correct or smooth out such inconsistencies. By
7863 default, GCC will emit an error message when an inconsistent profile is detected.
7865 @item -fprofile-dir=@var{path}
7866 @opindex fprofile-dir
7868 Set the directory to search for the profile data files in to @var{path}.
7869 This option affects only the profile data generated by
7870 @option{-fprofile-generate}, @option{-ftest-coverage}, @option{-fprofile-arcs}
7871 and used by @option{-fprofile-use} and @option{-fbranch-probabilities}
7872 and its related options.  Both absolute and relative paths can be used.
7873 By default, GCC will use the current directory as @var{path}, thus the
7874 profile data file will appear in the same directory as the object file.
7876 @item -fprofile-generate
7877 @itemx -fprofile-generate=@var{path}
7878 @opindex fprofile-generate
7880 Enable options usually used for instrumenting application to produce
7881 profile useful for later recompilation with profile feedback based
7882 optimization.  You must use @option{-fprofile-generate} both when
7883 compiling and when linking your program.
7885 The following options are enabled: @code{-fprofile-arcs}, @code{-fprofile-values}, @code{-fvpt}.
7887 If @var{path} is specified, GCC will look at the @var{path} to find
7888 the profile feedback data files. See @option{-fprofile-dir}.
7890 @item -fprofile-use
7891 @itemx -fprofile-use=@var{path}
7892 @opindex fprofile-use
7893 Enable profile feedback directed optimizations, and optimizations
7894 generally profitable only with profile feedback available.
7896 The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt},
7897 @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}
7899 By default, GCC emits an error message if the feedback profiles do not
7900 match the source code.  This error can be turned into a warning by using
7901 @option{-Wcoverage-mismatch}.  Note this may result in poorly optimized
7902 code.
7904 If @var{path} is specified, GCC will look at the @var{path} to find
7905 the profile feedback data files. See @option{-fprofile-dir}.
7906 @end table
7908 The following options control compiler behavior regarding floating
7909 point arithmetic.  These options trade off between speed and
7910 correctness.  All must be specifically enabled.
7912 @table @gcctabopt
7913 @item -ffloat-store
7914 @opindex ffloat-store
7915 Do not store floating point variables in registers, and inhibit other
7916 options that might change whether a floating point value is taken from a
7917 register or memory.
7919 @cindex floating point precision
7920 This option prevents undesirable excess precision on machines such as
7921 the 68000 where the floating registers (of the 68881) keep more
7922 precision than a @code{double} is supposed to have.  Similarly for the
7923 x86 architecture.  For most programs, the excess precision does only
7924 good, but a few programs rely on the precise definition of IEEE floating
7925 point.  Use @option{-ffloat-store} for such programs, after modifying
7926 them to store all pertinent intermediate computations into variables.
7928 @item -fexcess-precision=@var{style}
7929 @opindex fexcess-precision
7930 This option allows further control over excess precision on machines
7931 where floating-point registers have more precision than the IEEE
7932 @code{float} and @code{double} types and the processor does not
7933 support operations rounding to those types.  By default,
7934 @option{-fexcess-precision=fast} is in effect; this means that
7935 operations are carried out in the precision of the registers and that
7936 it is unpredictable when rounding to the types specified in the source
7937 code takes place.  When compiling C, if
7938 @option{-fexcess-precision=standard} is specified then excess
7939 precision will follow the rules specified in ISO C99; in particular,
7940 both casts and assignments cause values to be rounded to their
7941 semantic types (whereas @option{-ffloat-store} only affects
7942 assignments).  This option is enabled by default for C if a strict
7943 conformance option such as @option{-std=c99} is used.
7945 @opindex mfpmath
7946 @option{-fexcess-precision=standard} is not implemented for languages
7947 other than C, and has no effect if
7948 @option{-funsafe-math-optimizations} or @option{-ffast-math} is
7949 specified.  On the x86, it also has no effect if @option{-mfpmath=sse}
7950 or @option{-mfpmath=sse+387} is specified; in the former case, IEEE
7951 semantics apply without excess precision, and in the latter, rounding
7952 is unpredictable.
7954 @item -ffast-math
7955 @opindex ffast-math
7956 Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations},
7957 @option{-ffinite-math-only}, @option{-fno-rounding-math},
7958 @option{-fno-signaling-nans} and @option{-fcx-limited-range}.
7960 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
7962 This option is not turned on by any @option{-O} option besides
7963 @option{-Ofast} since it can result in incorrect output for programs
7964 which depend on an exact implementation of IEEE or ISO rules/specifications
7965 for math functions. It may, however, yield faster code for programs
7966 that do not require the guarantees of these specifications.
7968 @item -fno-math-errno
7969 @opindex fno-math-errno
7970 Do not set ERRNO after calling math functions that are executed
7971 with a single instruction, e.g., sqrt.  A program that relies on
7972 IEEE exceptions for math error handling may want to use this flag
7973 for speed while maintaining IEEE arithmetic compatibility.
7975 This option is not turned on by any @option{-O} option since
7976 it can result in incorrect output for programs which depend on
7977 an exact implementation of IEEE or ISO rules/specifications for
7978 math functions. It may, however, yield faster code for programs
7979 that do not require the guarantees of these specifications.
7981 The default is @option{-fmath-errno}.
7983 On Darwin systems, the math library never sets @code{errno}.  There is
7984 therefore no reason for the compiler to consider the possibility that
7985 it might, and @option{-fno-math-errno} is the default.
7987 @item -funsafe-math-optimizations
7988 @opindex funsafe-math-optimizations
7990 Allow optimizations for floating-point arithmetic that (a) assume
7991 that arguments and results are valid and (b) may violate IEEE or
7992 ANSI standards.  When used at link-time, it may include libraries
7993 or startup files that change the default FPU control word or other
7994 similar optimizations.
7996 This option is not turned on by any @option{-O} option since
7997 it can result in incorrect output for programs which depend on
7998 an exact implementation of IEEE or ISO rules/specifications for
7999 math functions. It may, however, yield faster code for programs
8000 that do not require the guarantees of these specifications.
8001 Enables @option{-fno-signed-zeros}, @option{-fno-trapping-math},
8002 @option{-fassociative-math} and @option{-freciprocal-math}.
8004 The default is @option{-fno-unsafe-math-optimizations}.
8006 @item -fassociative-math
8007 @opindex fassociative-math
8009 Allow re-association of operands in series of floating-point operations.
8010 This violates the ISO C and C++ language standard by possibly changing
8011 computation result.  NOTE: re-ordering may change the sign of zero as
8012 well as ignore NaNs and inhibit or create underflow or overflow (and
8013 thus cannot be used on a code which relies on rounding behavior like
8014 @code{(x + 2**52) - 2**52)}.  May also reorder floating-point comparisons
8015 and thus may not be used when ordered comparisons are required.
8016 This option requires that both @option{-fno-signed-zeros} and
8017 @option{-fno-trapping-math} be in effect.  Moreover, it doesn't make
8018 much sense with @option{-frounding-math}. For Fortran the option
8019 is automatically enabled when both @option{-fno-signed-zeros} and
8020 @option{-fno-trapping-math} are in effect.
8022 The default is @option{-fno-associative-math}.
8024 @item -freciprocal-math
8025 @opindex freciprocal-math
8027 Allow the reciprocal of a value to be used instead of dividing by
8028 the value if this enables optimizations.  For example @code{x / y}
8029 can be replaced with @code{x * (1/y)} which is useful if @code{(1/y)}
8030 is subject to common subexpression elimination.  Note that this loses
8031 precision and increases the number of flops operating on the value.
8033 The default is @option{-fno-reciprocal-math}.
8035 @item -ffinite-math-only
8036 @opindex ffinite-math-only
8037 Allow optimizations for floating-point arithmetic that assume
8038 that arguments and results are not NaNs or +-Infs.
8040 This option is not turned on by any @option{-O} option since
8041 it can result in incorrect output for programs which depend on
8042 an exact implementation of IEEE or ISO rules/specifications for
8043 math functions. It may, however, yield faster code for programs
8044 that do not require the guarantees of these specifications.
8046 The default is @option{-fno-finite-math-only}.
8048 @item -fno-signed-zeros
8049 @opindex fno-signed-zeros
8050 Allow optimizations for floating point arithmetic that ignore the
8051 signedness of zero.  IEEE arithmetic specifies the behavior of
8052 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
8053 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
8054 This option implies that the sign of a zero result isn't significant.
8056 The default is @option{-fsigned-zeros}.
8058 @item -fno-trapping-math
8059 @opindex fno-trapping-math
8060 Compile code assuming that floating-point operations cannot generate
8061 user-visible traps.  These traps include division by zero, overflow,
8062 underflow, inexact result and invalid operation.  This option requires
8063 that @option{-fno-signaling-nans} be in effect.  Setting this option may
8064 allow faster code if one relies on ``non-stop'' IEEE arithmetic, for example.
8066 This option should never be turned on by any @option{-O} option since
8067 it can result in incorrect output for programs which depend on
8068 an exact implementation of IEEE or ISO rules/specifications for
8069 math functions.
8071 The default is @option{-ftrapping-math}.
8073 @item -frounding-math
8074 @opindex frounding-math
8075 Disable transformations and optimizations that assume default floating
8076 point rounding behavior.  This is round-to-zero for all floating point
8077 to integer conversions, and round-to-nearest for all other arithmetic
8078 truncations.  This option should be specified for programs that change
8079 the FP rounding mode dynamically, or that may be executed with a
8080 non-default rounding mode.  This option disables constant folding of
8081 floating point expressions at compile-time (which may be affected by
8082 rounding mode) and arithmetic transformations that are unsafe in the
8083 presence of sign-dependent rounding modes.
8085 The default is @option{-fno-rounding-math}.
8087 This option is experimental and does not currently guarantee to
8088 disable all GCC optimizations that are affected by rounding mode.
8089 Future versions of GCC may provide finer control of this setting
8090 using C99's @code{FENV_ACCESS} pragma.  This command line option
8091 will be used to specify the default state for @code{FENV_ACCESS}.
8093 @item -fsignaling-nans
8094 @opindex fsignaling-nans
8095 Compile code assuming that IEEE signaling NaNs may generate user-visible
8096 traps during floating-point operations.  Setting this option disables
8097 optimizations that may change the number of exceptions visible with
8098 signaling NaNs.  This option implies @option{-ftrapping-math}.
8100 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
8101 be defined.
8103 The default is @option{-fno-signaling-nans}.
8105 This option is experimental and does not currently guarantee to
8106 disable all GCC optimizations that affect signaling NaN behavior.
8108 @item -fsingle-precision-constant
8109 @opindex fsingle-precision-constant
8110 Treat floating point constant as single precision constant instead of
8111 implicitly converting it to double precision constant.
8113 @item -fcx-limited-range
8114 @opindex fcx-limited-range
8115 When enabled, this option states that a range reduction step is not
8116 needed when performing complex division.  Also, there is no checking
8117 whether the result of a complex multiplication or division is @code{NaN
8118 + I*NaN}, with an attempt to rescue the situation in that case.  The
8119 default is @option{-fno-cx-limited-range}, but is enabled by
8120 @option{-ffast-math}.
8122 This option controls the default setting of the ISO C99
8123 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
8124 all languages.
8126 @item -fcx-fortran-rules
8127 @opindex fcx-fortran-rules
8128 Complex multiplication and division follow Fortran rules.  Range
8129 reduction is done as part of complex division, but there is no checking
8130 whether the result of a complex multiplication or division is @code{NaN
8131 + I*NaN}, with an attempt to rescue the situation in that case.
8133 The default is @option{-fno-cx-fortran-rules}.
8135 @end table
8137 The following options control optimizations that may improve
8138 performance, but are not enabled by any @option{-O} options.  This
8139 section includes experimental options that may produce broken code.
8141 @table @gcctabopt
8142 @item -fbranch-probabilities
8143 @opindex fbranch-probabilities
8144 After running a program compiled with @option{-fprofile-arcs}
8145 (@pxref{Debugging Options,, Options for Debugging Your Program or
8146 @command{gcc}}), you can compile it a second time using
8147 @option{-fbranch-probabilities}, to improve optimizations based on
8148 the number of times each branch was taken.  When the program
8149 compiled with @option{-fprofile-arcs} exits it saves arc execution
8150 counts to a file called @file{@var{sourcename}.gcda} for each source
8151 file.  The information in this data file is very dependent on the
8152 structure of the generated code, so you must use the same source code
8153 and the same optimization options for both compilations.
8155 With @option{-fbranch-probabilities}, GCC puts a
8156 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
8157 These can be used to improve optimization.  Currently, they are only
8158 used in one place: in @file{reorg.c}, instead of guessing which path a
8159 branch is most likely to take, the @samp{REG_BR_PROB} values are used to
8160 exactly determine which path is taken more often.
8162 @item -fprofile-values
8163 @opindex fprofile-values
8164 If combined with @option{-fprofile-arcs}, it adds code so that some
8165 data about values of expressions in the program is gathered.
8167 With @option{-fbranch-probabilities}, it reads back the data gathered
8168 from profiling values of expressions for usage in optimizations.
8170 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
8172 @item -fvpt
8173 @opindex fvpt
8174 If combined with @option{-fprofile-arcs}, it instructs the compiler to add
8175 a code to gather information about values of expressions.
8177 With @option{-fbranch-probabilities}, it reads back the data gathered
8178 and actually performs the optimizations based on them.
8179 Currently the optimizations include specialization of division operation
8180 using the knowledge about the value of the denominator.
8182 @item -frename-registers
8183 @opindex frename-registers
8184 Attempt to avoid false dependencies in scheduled code by making use
8185 of registers left over after register allocation.  This optimization
8186 will most benefit processors with lots of registers.  Depending on the
8187 debug information format adopted by the target, however, it can
8188 make debugging impossible, since variables will no longer stay in
8189 a ``home register''.
8191 Enabled by default with @option{-funroll-loops} and @option{-fpeel-loops}.
8193 @item -ftracer
8194 @opindex ftracer
8195 Perform tail duplication to enlarge superblock size.  This transformation
8196 simplifies the control flow of the function allowing other optimizations to do
8197 better job.
8199 Enabled with @option{-fprofile-use}.
8201 @item -funroll-loops
8202 @opindex funroll-loops
8203 Unroll loops whose number of iterations can be determined at compile time or
8204 upon entry to the loop.  @option{-funroll-loops} implies
8205 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
8206 It also turns on complete loop peeling (i.e.@: complete removal of loops with
8207 small constant number of iterations).  This option makes code larger, and may
8208 or may not make it run faster.
8210 Enabled with @option{-fprofile-use}.
8212 @item -funroll-all-loops
8213 @opindex funroll-all-loops
8214 Unroll all loops, even if their number of iterations is uncertain when
8215 the loop is entered.  This usually makes programs run more slowly.
8216 @option{-funroll-all-loops} implies the same options as
8217 @option{-funroll-loops}.
8219 @item -fpeel-loops
8220 @opindex fpeel-loops
8221 Peels the loops for that there is enough information that they do not
8222 roll much (from profile feedback).  It also turns on complete loop peeling
8223 (i.e.@: complete removal of loops with small constant number of iterations).
8225 Enabled with @option{-fprofile-use}.
8227 @item -fmove-loop-invariants
8228 @opindex fmove-loop-invariants
8229 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
8230 at level @option{-O1}
8232 @item -funswitch-loops
8233 @opindex funswitch-loops
8234 Move branches with loop invariant conditions out of the loop, with duplicates
8235 of the loop on both branches (modified according to result of the condition).
8237 @item -ffunction-sections
8238 @itemx -fdata-sections
8239 @opindex ffunction-sections
8240 @opindex fdata-sections
8241 Place each function or data item into its own section in the output
8242 file if the target supports arbitrary sections.  The name of the
8243 function or the name of the data item determines the section's name
8244 in the output file.
8246 Use these options on systems where the linker can perform optimizations
8247 to improve locality of reference in the instruction space.  Most systems
8248 using the ELF object format and SPARC processors running Solaris 2 have
8249 linkers with such optimizations.  AIX may have these optimizations in
8250 the future.
8252 Only use these options when there are significant benefits from doing
8253 so.  When you specify these options, the assembler and linker will
8254 create larger object and executable files and will also be slower.
8255 You will not be able to use @code{gprof} on all systems if you
8256 specify this option and you may have problems with debugging if
8257 you specify both this option and @option{-g}.
8259 @item -fbranch-target-load-optimize
8260 @opindex fbranch-target-load-optimize
8261 Perform branch target register load optimization before prologue / epilogue
8262 threading.
8263 The use of target registers can typically be exposed only during reload,
8264 thus hoisting loads out of loops and doing inter-block scheduling needs
8265 a separate optimization pass.
8267 @item -fbranch-target-load-optimize2
8268 @opindex fbranch-target-load-optimize2
8269 Perform branch target register load optimization after prologue / epilogue
8270 threading.
8272 @item -fbtr-bb-exclusive
8273 @opindex fbtr-bb-exclusive
8274 When performing branch target register load optimization, don't reuse
8275 branch target registers in within any basic block.
8277 @item -fstack-protector
8278 @opindex fstack-protector
8279 Emit extra code to check for buffer overflows, such as stack smashing
8280 attacks.  This is done by adding a guard variable to functions with
8281 vulnerable objects.  This includes functions that call alloca, and
8282 functions with buffers larger than 8 bytes.  The guards are initialized
8283 when a function is entered and then checked when the function exits.
8284 If a guard check fails, an error message is printed and the program exits.
8286 @item -fstack-protector-all
8287 @opindex fstack-protector-all
8288 Like @option{-fstack-protector} except that all functions are protected.
8290 @item -fsection-anchors
8291 @opindex fsection-anchors
8292 Try to reduce the number of symbolic address calculations by using
8293 shared ``anchor'' symbols to address nearby objects.  This transformation
8294 can help to reduce the number of GOT entries and GOT accesses on some
8295 targets.
8297 For example, the implementation of the following function @code{foo}:
8299 @smallexample
8300 static int a, b, c;
8301 int foo (void) @{ return a + b + c; @}
8302 @end smallexample
8304 would usually calculate the addresses of all three variables, but if you
8305 compile it with @option{-fsection-anchors}, it will access the variables
8306 from a common anchor point instead.  The effect is similar to the
8307 following pseudocode (which isn't valid C):
8309 @smallexample
8310 int foo (void)
8312   register int *xr = &x;
8313   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
8315 @end smallexample
8317 Not all targets support this option.
8319 @item --param @var{name}=@var{value}
8320 @opindex param
8321 In some places, GCC uses various constants to control the amount of
8322 optimization that is done.  For example, GCC will not inline functions
8323 that contain more that a certain number of instructions.  You can
8324 control some of these constants on the command-line using the
8325 @option{--param} option.
8327 The names of specific parameters, and the meaning of the values, are
8328 tied to the internals of the compiler, and are subject to change
8329 without notice in future releases.
8331 In each case, the @var{value} is an integer.  The allowable choices for
8332 @var{name} are given in the following table:
8334 @table @gcctabopt
8335 @item predictable-branch-outcome
8336 When branch is predicted to be taken with probability lower than this threshold
8337 (in percent), then it is considered well predictable. The default is 10.
8339 @item max-crossjump-edges
8340 The maximum number of incoming edges to consider for crossjumping.
8341 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
8342 the number of edges incoming to each block.  Increasing values mean
8343 more aggressive optimization, making the compile time increase with
8344 probably small improvement in executable size.
8346 @item min-crossjump-insns
8347 The minimum number of instructions which must be matched at the end
8348 of two blocks before crossjumping will be performed on them.  This
8349 value is ignored in the case where all instructions in the block being
8350 crossjumped from are matched.  The default value is 5.
8352 @item max-grow-copy-bb-insns
8353 The maximum code size expansion factor when copying basic blocks
8354 instead of jumping.  The expansion is relative to a jump instruction.
8355 The default value is 8.
8357 @item max-goto-duplication-insns
8358 The maximum number of instructions to duplicate to a block that jumps
8359 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
8360 passes, GCC factors computed gotos early in the compilation process,
8361 and unfactors them as late as possible.  Only computed jumps at the
8362 end of a basic blocks with no more than max-goto-duplication-insns are
8363 unfactored.  The default value is 8.
8365 @item max-delay-slot-insn-search
8366 The maximum number of instructions to consider when looking for an
8367 instruction to fill a delay slot.  If more than this arbitrary number of
8368 instructions is searched, the time savings from filling the delay slot
8369 will be minimal so stop searching.  Increasing values mean more
8370 aggressive optimization, making the compile time increase with probably
8371 small improvement in executable run time.
8373 @item max-delay-slot-live-search
8374 When trying to fill delay slots, the maximum number of instructions to
8375 consider when searching for a block with valid live register
8376 information.  Increasing this arbitrarily chosen value means more
8377 aggressive optimization, increasing the compile time.  This parameter
8378 should be removed when the delay slot code is rewritten to maintain the
8379 control-flow graph.
8381 @item max-gcse-memory
8382 The approximate maximum amount of memory that will be allocated in
8383 order to perform the global common subexpression elimination
8384 optimization.  If more memory than specified is required, the
8385 optimization will not be done.
8387 @item max-gcse-insertion-ratio
8388 If the ratio of expression insertions to deletions is larger than this value
8389 for any expression, then RTL PRE will insert or remove the expression and thus
8390 leave partially redundant computations in the instruction stream.  The default value is 20.
8392 @item max-pending-list-length
8393 The maximum number of pending dependencies scheduling will allow
8394 before flushing the current state and starting over.  Large functions
8395 with few branches or calls can create excessively large lists which
8396 needlessly consume memory and resources.
8398 @item max-inline-insns-single
8399 Several parameters control the tree inliner used in gcc.
8400 This number sets the maximum number of instructions (counted in GCC's
8401 internal representation) in a single function that the tree inliner
8402 will consider for inlining.  This only affects functions declared
8403 inline and methods implemented in a class declaration (C++).
8404 The default value is 400.
8406 @item max-inline-insns-auto
8407 When you use @option{-finline-functions} (included in @option{-O3}),
8408 a lot of functions that would otherwise not be considered for inlining
8409 by the compiler will be investigated.  To those functions, a different
8410 (more restrictive) limit compared to functions declared inline can
8411 be applied.
8412 The default value is 40.
8414 @item large-function-insns
8415 The limit specifying really large functions.  For functions larger than this
8416 limit after inlining, inlining is constrained by
8417 @option{--param large-function-growth}.  This parameter is useful primarily
8418 to avoid extreme compilation time caused by non-linear algorithms used by the
8419 backend.
8420 The default value is 2700.
8422 @item large-function-growth
8423 Specifies maximal growth of large function caused by inlining in percents.
8424 The default value is 100 which limits large function growth to 2.0 times
8425 the original size.
8427 @item large-unit-insns
8428 The limit specifying large translation unit.  Growth caused by inlining of
8429 units larger than this limit is limited by @option{--param inline-unit-growth}.
8430 For small units this might be too tight (consider unit consisting of function A
8431 that is inline and B that just calls A three time.  If B is small relative to
8432 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
8433 large units consisting of small inlineable functions however the overall unit
8434 growth limit is needed to avoid exponential explosion of code size.  Thus for
8435 smaller units, the size is increased to @option{--param large-unit-insns}
8436 before applying @option{--param inline-unit-growth}.  The default is 10000
8438 @item inline-unit-growth
8439 Specifies maximal overall growth of the compilation unit caused by inlining.
8440 The default value is 30 which limits unit growth to 1.3 times the original
8441 size.
8443 @item ipcp-unit-growth
8444 Specifies maximal overall growth of the compilation unit caused by
8445 interprocedural constant propagation.  The default value is 10 which limits
8446 unit growth to 1.1 times the original size.
8448 @item large-stack-frame
8449 The limit specifying large stack frames.  While inlining the algorithm is trying
8450 to not grow past this limit too much.  Default value is 256 bytes.
8452 @item large-stack-frame-growth
8453 Specifies maximal growth of large stack frames caused by inlining in percents.
8454 The default value is 1000 which limits large stack frame growth to 11 times
8455 the original size.
8457 @item max-inline-insns-recursive
8458 @itemx max-inline-insns-recursive-auto
8459 Specifies maximum number of instructions out-of-line copy of self recursive inline
8460 function can grow into by performing recursive inlining.
8462 For functions declared inline @option{--param max-inline-insns-recursive} is
8463 taken into account.  For function not declared inline, recursive inlining
8464 happens only when @option{-finline-functions} (included in @option{-O3}) is
8465 enabled and @option{--param max-inline-insns-recursive-auto} is used.  The
8466 default value is 450.
8468 @item max-inline-recursive-depth
8469 @itemx max-inline-recursive-depth-auto
8470 Specifies maximum recursion depth used by the recursive inlining.
8472 For functions declared inline @option{--param max-inline-recursive-depth} is
8473 taken into account.  For function not declared inline, recursive inlining
8474 happens only when @option{-finline-functions} (included in @option{-O3}) is
8475 enabled and @option{--param max-inline-recursive-depth-auto} is used.  The
8476 default value is 8.
8478 @item min-inline-recursive-probability
8479 Recursive inlining is profitable only for function having deep recursion
8480 in average and can hurt for function having little recursion depth by
8481 increasing the prologue size or complexity of function body to other
8482 optimizers.
8484 When profile feedback is available (see @option{-fprofile-generate}) the actual
8485 recursion depth can be guessed from probability that function will recurse via
8486 given call expression.  This parameter limits inlining only to call expression
8487 whose probability exceeds given threshold (in percents).  The default value is
8490 @item early-inlining-insns
8491 Specify growth that early inliner can make.  In effect it increases amount of
8492 inlining for code having large abstraction penalty.  The default value is 10.
8494 @item max-early-inliner-iterations
8495 @itemx max-early-inliner-iterations
8496 Limit of iterations of early inliner.  This basically bounds number of nested
8497 indirect calls early inliner can resolve.  Deeper chains are still handled by
8498 late inlining.
8500 @item comdat-sharing-probability
8501 @itemx comdat-sharing-probability
8502 Probability (in percent) that C++ inline function with comdat visibility
8503 will be shared across multiple compilation units.  The default value is 20.
8505 @item min-vect-loop-bound
8506 The minimum number of iterations under which a loop will not get vectorized
8507 when @option{-ftree-vectorize} is used.  The number of iterations after
8508 vectorization needs to be greater than the value specified by this option
8509 to allow vectorization.  The default value is 0.
8511 @item gcse-cost-distance-ratio
8512 Scaling factor in calculation of maximum distance an expression
8513 can be moved by GCSE optimizations.  This is currently supported only in the
8514 code hoisting pass.  The bigger the ratio, the more aggressive code hoisting
8515 will be with simple expressions, i.e., the expressions which have cost
8516 less than @option{gcse-unrestricted-cost}.  Specifying 0 will disable
8517 hoisting of simple expressions.  The default value is 10.
8519 @item gcse-unrestricted-cost
8520 Cost, roughly measured as the cost of a single typical machine
8521 instruction, at which GCSE optimizations will not constrain
8522 the distance an expression can travel.  This is currently
8523 supported only in the code hoisting pass.  The lesser the cost,
8524 the more aggressive code hoisting will be.  Specifying 0 will
8525 allow all expressions to travel unrestricted distances.
8526 The default value is 3.
8528 @item max-hoist-depth
8529 The depth of search in the dominator tree for expressions to hoist.
8530 This is used to avoid quadratic behavior in hoisting algorithm.
8531 The value of 0 will avoid limiting the search, but may slow down compilation
8532 of huge functions.  The default value is 30.
8534 @item max-unrolled-insns
8535 The maximum number of instructions that a loop should have if that loop
8536 is unrolled, and if the loop is unrolled, it determines how many times
8537 the loop code is unrolled.
8539 @item max-average-unrolled-insns
8540 The maximum number of instructions biased by probabilities of their execution
8541 that a loop should have if that loop is unrolled, and if the loop is unrolled,
8542 it determines how many times the loop code is unrolled.
8544 @item max-unroll-times
8545 The maximum number of unrollings of a single loop.
8547 @item max-peeled-insns
8548 The maximum number of instructions that a loop should have if that loop
8549 is peeled, and if the loop is peeled, it determines how many times
8550 the loop code is peeled.
8552 @item max-peel-times
8553 The maximum number of peelings of a single loop.
8555 @item max-completely-peeled-insns
8556 The maximum number of insns of a completely peeled loop.
8558 @item max-completely-peel-times
8559 The maximum number of iterations of a loop to be suitable for complete peeling.
8561 @item max-completely-peel-loop-nest-depth
8562 The maximum depth of a loop nest suitable for complete peeling.
8564 @item max-unswitch-insns
8565 The maximum number of insns of an unswitched loop.
8567 @item max-unswitch-level
8568 The maximum number of branches unswitched in a single loop.
8570 @item lim-expensive
8571 The minimum cost of an expensive expression in the loop invariant motion.
8573 @item iv-consider-all-candidates-bound
8574 Bound on number of candidates for induction variables below that
8575 all candidates are considered for each use in induction variable
8576 optimizations.  Only the most relevant candidates are considered
8577 if there are more candidates, to avoid quadratic time complexity.
8579 @item iv-max-considered-uses
8580 The induction variable optimizations give up on loops that contain more
8581 induction variable uses.
8583 @item iv-always-prune-cand-set-bound
8584 If number of candidates in the set is smaller than this value,
8585 we always try to remove unnecessary ivs from the set during its
8586 optimization when a new iv is added to the set.
8588 @item scev-max-expr-size
8589 Bound on size of expressions used in the scalar evolutions analyzer.
8590 Large expressions slow the analyzer.
8592 @item scev-max-expr-complexity
8593 Bound on the complexity of the expressions in the scalar evolutions analyzer.
8594 Complex expressions slow the analyzer.
8596 @item omega-max-vars
8597 The maximum number of variables in an Omega constraint system.
8598 The default value is 128.
8600 @item omega-max-geqs
8601 The maximum number of inequalities in an Omega constraint system.
8602 The default value is 256.
8604 @item omega-max-eqs
8605 The maximum number of equalities in an Omega constraint system.
8606 The default value is 128.
8608 @item omega-max-wild-cards
8609 The maximum number of wildcard variables that the Omega solver will
8610 be able to insert.  The default value is 18.
8612 @item omega-hash-table-size
8613 The size of the hash table in the Omega solver.  The default value is
8614 550.
8616 @item omega-max-keys
8617 The maximal number of keys used by the Omega solver.  The default
8618 value is 500.
8620 @item omega-eliminate-redundant-constraints
8621 When set to 1, use expensive methods to eliminate all redundant
8622 constraints.  The default value is 0.
8624 @item vect-max-version-for-alignment-checks
8625 The maximum number of runtime checks that can be performed when
8626 doing loop versioning for alignment in the vectorizer.  See option
8627 ftree-vect-loop-version for more information.
8629 @item vect-max-version-for-alias-checks
8630 The maximum number of runtime checks that can be performed when
8631 doing loop versioning for alias in the vectorizer.  See option
8632 ftree-vect-loop-version for more information.
8634 @item max-iterations-to-track
8636 The maximum number of iterations of a loop the brute force algorithm
8637 for analysis of # of iterations of the loop tries to evaluate.
8639 @item hot-bb-count-fraction
8640 Select fraction of the maximal count of repetitions of basic block in program
8641 given basic block needs to have to be considered hot.
8643 @item hot-bb-frequency-fraction
8644 Select fraction of the entry block frequency of executions of basic block in
8645 function given basic block needs to have to be considered hot.
8647 @item max-predicted-iterations
8648 The maximum number of loop iterations we predict statically.  This is useful
8649 in cases where function contain single loop with known bound and other loop
8650 with unknown.  We predict the known number of iterations correctly, while
8651 the unknown number of iterations average to roughly 10.  This means that the
8652 loop without bounds would appear artificially cold relative to the other one.
8654 @item align-threshold
8656 Select fraction of the maximal frequency of executions of basic block in
8657 function given basic block will get aligned.
8659 @item align-loop-iterations
8661 A loop expected to iterate at lest the selected number of iterations will get
8662 aligned.
8664 @item tracer-dynamic-coverage
8665 @itemx tracer-dynamic-coverage-feedback
8667 This value is used to limit superblock formation once the given percentage of
8668 executed instructions is covered.  This limits unnecessary code size
8669 expansion.
8671 The @option{tracer-dynamic-coverage-feedback} is used only when profile
8672 feedback is available.  The real profiles (as opposed to statically estimated
8673 ones) are much less balanced allowing the threshold to be larger value.
8675 @item tracer-max-code-growth
8676 Stop tail duplication once code growth has reached given percentage.  This is
8677 rather hokey argument, as most of the duplicates will be eliminated later in
8678 cross jumping, so it may be set to much higher values than is the desired code
8679 growth.
8681 @item tracer-min-branch-ratio
8683 Stop reverse growth when the reverse probability of best edge is less than this
8684 threshold (in percent).
8686 @item tracer-min-branch-ratio
8687 @itemx tracer-min-branch-ratio-feedback
8689 Stop forward growth if the best edge do have probability lower than this
8690 threshold.
8692 Similarly to @option{tracer-dynamic-coverage} two values are present, one for
8693 compilation for profile feedback and one for compilation without.  The value
8694 for compilation with profile feedback needs to be more conservative (higher) in
8695 order to make tracer effective.
8697 @item max-cse-path-length
8699 Maximum number of basic blocks on path that cse considers.  The default is 10.
8701 @item max-cse-insns
8702 The maximum instructions CSE process before flushing. The default is 1000.
8704 @item ggc-min-expand
8706 GCC uses a garbage collector to manage its own memory allocation.  This
8707 parameter specifies the minimum percentage by which the garbage
8708 collector's heap should be allowed to expand between collections.
8709 Tuning this may improve compilation speed; it has no effect on code
8710 generation.
8712 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
8713 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of "RAM" is
8714 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
8715 GCC is not able to calculate RAM on a particular platform, the lower
8716 bound of 30% is used.  Setting this parameter and
8717 @option{ggc-min-heapsize} to zero causes a full collection to occur at
8718 every opportunity.  This is extremely slow, but can be useful for
8719 debugging.
8721 @item ggc-min-heapsize
8723 Minimum size of the garbage collector's heap before it begins bothering
8724 to collect garbage.  The first collection occurs after the heap expands
8725 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
8726 tuning this may improve compilation speed, and has no effect on code
8727 generation.
8729 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit which
8730 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
8731 with a lower bound of 4096 (four megabytes) and an upper bound of
8732 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
8733 particular platform, the lower bound is used.  Setting this parameter
8734 very large effectively disables garbage collection.  Setting this
8735 parameter and @option{ggc-min-expand} to zero causes a full collection
8736 to occur at every opportunity.
8738 @item max-reload-search-insns
8739 The maximum number of instruction reload should look backward for equivalent
8740 register.  Increasing values mean more aggressive optimization, making the
8741 compile time increase with probably slightly better performance.  The default
8742 value is 100.
8744 @item max-cselib-memory-locations
8745 The maximum number of memory locations cselib should take into account.
8746 Increasing values mean more aggressive optimization, making the compile time
8747 increase with probably slightly better performance.  The default value is 500.
8749 @item reorder-blocks-duplicate
8750 @itemx reorder-blocks-duplicate-feedback
8752 Used by basic block reordering pass to decide whether to use unconditional
8753 branch or duplicate the code on its destination.  Code is duplicated when its
8754 estimated size is smaller than this value multiplied by the estimated size of
8755 unconditional jump in the hot spots of the program.
8757 The @option{reorder-block-duplicate-feedback} is used only when profile
8758 feedback is available and may be set to higher values than
8759 @option{reorder-block-duplicate} since information about the hot spots is more
8760 accurate.
8762 @item max-sched-ready-insns
8763 The maximum number of instructions ready to be issued the scheduler should
8764 consider at any given time during the first scheduling pass.  Increasing
8765 values mean more thorough searches, making the compilation time increase
8766 with probably little benefit.  The default value is 100.
8768 @item max-sched-region-blocks
8769 The maximum number of blocks in a region to be considered for
8770 interblock scheduling.  The default value is 10.
8772 @item max-pipeline-region-blocks
8773 The maximum number of blocks in a region to be considered for
8774 pipelining in the selective scheduler.  The default value is 15.
8776 @item max-sched-region-insns
8777 The maximum number of insns in a region to be considered for
8778 interblock scheduling.  The default value is 100.
8780 @item max-pipeline-region-insns
8781 The maximum number of insns in a region to be considered for
8782 pipelining in the selective scheduler.  The default value is 200.
8784 @item min-spec-prob
8785 The minimum probability (in percents) of reaching a source block
8786 for interblock speculative scheduling.  The default value is 40.
8788 @item max-sched-extend-regions-iters
8789 The maximum number of iterations through CFG to extend regions.
8790 0 - disable region extension,
8791 N - do at most N iterations.
8792 The default value is 0.
8794 @item max-sched-insn-conflict-delay
8795 The maximum conflict delay for an insn to be considered for speculative motion.
8796 The default value is 3.
8798 @item sched-spec-prob-cutoff
8799 The minimal probability of speculation success (in percents), so that
8800 speculative insn will be scheduled.
8801 The default value is 40.
8803 @item sched-mem-true-dep-cost
8804 Minimal distance (in CPU cycles) between store and load targeting same
8805 memory locations.  The default value is 1.
8807 @item selsched-max-lookahead
8808 The maximum size of the lookahead window of selective scheduling.  It is a
8809 depth of search for available instructions.
8810 The default value is 50.
8812 @item selsched-max-sched-times
8813 The maximum number of times that an instruction will be scheduled during
8814 selective scheduling.  This is the limit on the number of iterations
8815 through which the instruction may be pipelined.  The default value is 2.
8817 @item selsched-max-insns-to-rename
8818 The maximum number of best instructions in the ready list that are considered
8819 for renaming in the selective scheduler.  The default value is 2.
8821 @item sms-min-sc
8822 The minimum value of stage count that swing modulo scheduler will
8823 generate.  The default value is 2.
8825 @item max-last-value-rtl
8826 The maximum size measured as number of RTLs that can be recorded in an expression
8827 in combiner for a pseudo register as last known value of that register.  The default
8828 is 10000.
8830 @item integer-share-limit
8831 Small integer constants can use a shared data structure, reducing the
8832 compiler's memory usage and increasing its speed.  This sets the maximum
8833 value of a shared integer constant.  The default value is 256.
8835 @item min-virtual-mappings
8836 Specifies the minimum number of virtual mappings in the incremental
8837 SSA updater that should be registered to trigger the virtual mappings
8838 heuristic defined by virtual-mappings-ratio.  The default value is
8839 100.
8841 @item virtual-mappings-ratio
8842 If the number of virtual mappings is virtual-mappings-ratio bigger
8843 than the number of virtual symbols to be updated, then the incremental
8844 SSA updater switches to a full update for those symbols.  The default
8845 ratio is 3.
8847 @item ssp-buffer-size
8848 The minimum size of buffers (i.e.@: arrays) that will receive stack smashing
8849 protection when @option{-fstack-protection} is used.
8851 @item max-jump-thread-duplication-stmts
8852 Maximum number of statements allowed in a block that needs to be
8853 duplicated when threading jumps.
8855 @item max-fields-for-field-sensitive
8856 Maximum number of fields in a structure we will treat in
8857 a field sensitive manner during pointer analysis.  The default is zero
8858 for -O0, and -O1 and 100 for -Os, -O2, and -O3.
8860 @item prefetch-latency
8861 Estimate on average number of instructions that are executed before
8862 prefetch finishes.  The distance we prefetch ahead is proportional
8863 to this constant.  Increasing this number may also lead to less
8864 streams being prefetched (see @option{simultaneous-prefetches}).
8866 @item simultaneous-prefetches
8867 Maximum number of prefetches that can run at the same time.
8869 @item l1-cache-line-size
8870 The size of cache line in L1 cache, in bytes.
8872 @item l1-cache-size
8873 The size of L1 cache, in kilobytes.
8875 @item l2-cache-size
8876 The size of L2 cache, in kilobytes.
8878 @item min-insn-to-prefetch-ratio
8879 The minimum ratio between the number of instructions and the
8880 number of prefetches to enable prefetching in a loop.
8882 @item prefetch-min-insn-to-mem-ratio
8883 The minimum ratio between the number of instructions and the
8884 number of memory references to enable prefetching in a loop.
8886 @item use-canonical-types
8887 Whether the compiler should use the ``canonical'' type system.  By
8888 default, this should always be 1, which uses a more efficient internal
8889 mechanism for comparing types in C++ and Objective-C++.  However, if
8890 bugs in the canonical type system are causing compilation failures,
8891 set this value to 0 to disable canonical types.
8893 @item switch-conversion-max-branch-ratio
8894 Switch initialization conversion will refuse to create arrays that are
8895 bigger than @option{switch-conversion-max-branch-ratio} times the number of
8896 branches in the switch.
8898 @item max-partial-antic-length
8899 Maximum length of the partial antic set computed during the tree
8900 partial redundancy elimination optimization (@option{-ftree-pre}) when
8901 optimizing at @option{-O3} and above.  For some sorts of source code
8902 the enhanced partial redundancy elimination optimization can run away,
8903 consuming all of the memory available on the host machine.  This
8904 parameter sets a limit on the length of the sets that are computed,
8905 which prevents the runaway behavior.  Setting a value of 0 for
8906 this parameter will allow an unlimited set length.
8908 @item sccvn-max-scc-size
8909 Maximum size of a strongly connected component (SCC) during SCCVN
8910 processing.  If this limit is hit, SCCVN processing for the whole
8911 function will not be done and optimizations depending on it will
8912 be disabled.  The default maximum SCC size is 10000.
8914 @item ira-max-loops-num
8915 IRA uses a regional register allocation by default.  If a function
8916 contains loops more than number given by the parameter, only at most
8917 given number of the most frequently executed loops will form regions
8918 for the regional register allocation.  The default value of the
8919 parameter is 100.
8921 @item ira-max-conflict-table-size
8922 Although IRA uses a sophisticated algorithm of compression conflict
8923 table, the table can be still big for huge functions.  If the conflict
8924 table for a function could be more than size in MB given by the
8925 parameter, the conflict table is not built and faster, simpler, and
8926 lower quality register allocation algorithm will be used.  The
8927 algorithm do not use pseudo-register conflicts.  The default value of
8928 the parameter is 2000.
8930 @item ira-loop-reserved-regs
8931 IRA can be used to evaluate more accurate register pressure in loops
8932 for decision to move loop invariants (see @option{-O3}).  The number
8933 of available registers reserved for some other purposes is described
8934 by this parameter.  The default value of the parameter is 2 which is
8935 minimal number of registers needed for execution of typical
8936 instruction.  This value is the best found from numerous experiments.
8938 @item loop-invariant-max-bbs-in-loop
8939 Loop invariant motion can be very expensive, both in compile time and
8940 in amount of needed compile time memory, with very large loops.  Loops
8941 with more basic blocks than this parameter won't have loop invariant
8942 motion optimization performed on them.  The default value of the
8943 parameter is 1000 for -O1 and 10000 for -O2 and above.
8945 @item max-vartrack-size
8946 Sets a maximum number of hash table slots to use during variable
8947 tracking dataflow analysis of any function.  If this limit is exceeded
8948 with variable tracking at assignments enabled, analysis for that
8949 function is retried without it, after removing all debug insns from
8950 the function.  If the limit is exceeded even without debug insns, var
8951 tracking analysis is completely disabled for the function.  Setting
8952 the parameter to zero makes it unlimited.
8954 @item max-vartrack-expr-depth
8955 Sets a maximum number of recursion levels when attempting to map
8956 variable names or debug temporaries to value expressions.  This trades
8957 compile time for more complete debug information.  If this is set too
8958 low, value expressions that are available and could be represented in
8959 debug information may end up not being used; setting this higher may
8960 enable the compiler to find more complex debug expressions, but compile
8961 time may grow exponentially, and even then, it may fail to find more
8962 usable expressions.  The default is 10.
8964 @item min-nondebug-insn-uid
8965 Use uids starting at this parameter for nondebug insns.  The range below
8966 the parameter is reserved exclusively for debug insns created by
8967 @option{-fvar-tracking-assignments}, but debug insns may get
8968 (non-overlapping) uids above it if the reserved range is exhausted.
8970 @item ipa-sra-ptr-growth-factor
8971 IPA-SRA will replace a pointer to an aggregate with one or more new
8972 parameters only when their cumulative size is less or equal to
8973 @option{ipa-sra-ptr-growth-factor} times the size of the original
8974 pointer parameter.
8976 @item graphite-max-nb-scop-params
8977 To avoid exponential effects in the Graphite loop transforms, the
8978 number of parameters in a Static Control Part (SCoP) is bounded.  The
8979 default value is 10 parameters.  A variable whose value is unknown at
8980 compile time and defined outside a SCoP is a parameter of the SCoP.
8982 @item graphite-max-bbs-per-function
8983 To avoid exponential effects in the detection of SCoPs, the size of
8984 the functions analyzed by Graphite is bounded.  The default value is
8985 100 basic blocks.
8987 @item loop-block-tile-size
8988 Loop blocking or strip mining transforms, enabled with
8989 @option{-floop-block} or @option{-floop-strip-mine}, strip mine each
8990 loop in the loop nest by a given number of iterations.  The strip
8991 length can be changed using the @option{loop-block-tile-size}
8992 parameter.  The default value is 51 iterations.
8994 @item devirt-type-list-size
8995 IPA-CP attempts to track all possible types passed to a function's
8996 parameter in order to perform devirtualization.
8997 @option{devirt-type-list-size} is the maximum number of types it
8998 stores per a single formal parameter of a function.
9000 @item lto-partitions
9001 Specify desired number of partitions produced during WHOPR compilation.
9002 The number of partitions should exceed the number of CPUs used for compilation.
9003 The default value is 32.
9005 @item lto-minpartition
9006 Size of minimal partition for WHOPR (in estimated instructions).
9007 This prevents expenses of splitting very small programs into too many
9008 partitions.
9010 @item cxx-max-namespaces-for-diagnostic-help
9011 The maximum number of namespaces to consult for suggestions when C++
9012 name lookup fails for an identifier.  The default is 1000.
9014 @item max-stores-to-sink
9015 The maximum number of conditional stores paires that can be sunk.  Set to 0
9016 if either vectorization (@option{-ftree-vectorize}) or if-conversion
9017 (@option{-ftree-loop-if-convert}) is disabled.  The default is 2.
9019 @end table
9020 @end table
9022 @node Preprocessor Options
9023 @section Options Controlling the Preprocessor
9024 @cindex preprocessor options
9025 @cindex options, preprocessor
9027 These options control the C preprocessor, which is run on each C source
9028 file before actual compilation.
9030 If you use the @option{-E} option, nothing is done except preprocessing.
9031 Some of these options make sense only together with @option{-E} because
9032 they cause the preprocessor output to be unsuitable for actual
9033 compilation.
9035 @table @gcctabopt
9036 @item -Wp,@var{option}
9037 @opindex Wp
9038 You can use @option{-Wp,@var{option}} to bypass the compiler driver
9039 and pass @var{option} directly through to the preprocessor.  If
9040 @var{option} contains commas, it is split into multiple options at the
9041 commas.  However, many options are modified, translated or interpreted
9042 by the compiler driver before being passed to the preprocessor, and
9043 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
9044 interface is undocumented and subject to change, so whenever possible
9045 you should avoid using @option{-Wp} and let the driver handle the
9046 options instead.
9048 @item -Xpreprocessor @var{option}
9049 @opindex Xpreprocessor
9050 Pass @var{option} as an option to the preprocessor.  You can use this to
9051 supply system-specific preprocessor options which GCC does not know how to
9052 recognize.
9054 If you want to pass an option that takes an argument, you must use
9055 @option{-Xpreprocessor} twice, once for the option and once for the argument.
9056 @end table
9058 @include cppopts.texi
9060 @node Assembler Options
9061 @section Passing Options to the Assembler
9063 @c prevent bad page break with this line
9064 You can pass options to the assembler.
9066 @table @gcctabopt
9067 @item -Wa,@var{option}
9068 @opindex Wa
9069 Pass @var{option} as an option to the assembler.  If @var{option}
9070 contains commas, it is split into multiple options at the commas.
9072 @item -Xassembler @var{option}
9073 @opindex Xassembler
9074 Pass @var{option} as an option to the assembler.  You can use this to
9075 supply system-specific assembler options which GCC does not know how to
9076 recognize.
9078 If you want to pass an option that takes an argument, you must use
9079 @option{-Xassembler} twice, once for the option and once for the argument.
9081 @end table
9083 @node Link Options
9084 @section Options for Linking
9085 @cindex link options
9086 @cindex options, linking
9088 These options come into play when the compiler links object files into
9089 an executable output file.  They are meaningless if the compiler is
9090 not doing a link step.
9092 @table @gcctabopt
9093 @cindex file names
9094 @item @var{object-file-name}
9095 A file name that does not end in a special recognized suffix is
9096 considered to name an object file or library.  (Object files are
9097 distinguished from libraries by the linker according to the file
9098 contents.)  If linking is done, these object files are used as input
9099 to the linker.
9101 @item -c
9102 @itemx -S
9103 @itemx -E
9104 @opindex c
9105 @opindex S
9106 @opindex E
9107 If any of these options is used, then the linker is not run, and
9108 object file names should not be used as arguments.  @xref{Overall
9109 Options}.
9111 @cindex Libraries
9112 @item -l@var{library}
9113 @itemx -l @var{library}
9114 @opindex l
9115 Search the library named @var{library} when linking.  (The second
9116 alternative with the library as a separate argument is only for
9117 POSIX compliance and is not recommended.)
9119 It makes a difference where in the command you write this option; the
9120 linker searches and processes libraries and object files in the order they
9121 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
9122 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
9123 to functions in @samp{z}, those functions may not be loaded.
9125 The linker searches a standard list of directories for the library,
9126 which is actually a file named @file{lib@var{library}.a}.  The linker
9127 then uses this file as if it had been specified precisely by name.
9129 The directories searched include several standard system directories
9130 plus any that you specify with @option{-L}.
9132 Normally the files found this way are library files---archive files
9133 whose members are object files.  The linker handles an archive file by
9134 scanning through it for members which define symbols that have so far
9135 been referenced but not defined.  But if the file that is found is an
9136 ordinary object file, it is linked in the usual fashion.  The only
9137 difference between using an @option{-l} option and specifying a file name
9138 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
9139 and searches several directories.
9141 @item -lobjc
9142 @opindex lobjc
9143 You need this special case of the @option{-l} option in order to
9144 link an Objective-C or Objective-C++ program.
9146 @item -nostartfiles
9147 @opindex nostartfiles
9148 Do not use the standard system startup files when linking.
9149 The standard system libraries are used normally, unless @option{-nostdlib}
9150 or @option{-nodefaultlibs} is used.
9152 @item -nodefaultlibs
9153 @opindex nodefaultlibs
9154 Do not use the standard system libraries when linking.
9155 Only the libraries you specify will be passed to the linker, options
9156 specifying linkage of the system libraries, such as @code{-static-libgcc}
9157 or @code{-shared-libgcc}, will be ignored.
9158 The standard startup files are used normally, unless @option{-nostartfiles}
9159 is used.  The compiler may generate calls to @code{memcmp},
9160 @code{memset}, @code{memcpy} and @code{memmove}.
9161 These entries are usually resolved by entries in
9162 libc.  These entry points should be supplied through some other
9163 mechanism when this option is specified.
9165 @item -nostdlib
9166 @opindex nostdlib
9167 Do not use the standard system startup files or libraries when linking.
9168 No startup files and only the libraries you specify will be passed to
9169 the linker, options specifying linkage of the system libraries, such as
9170 @code{-static-libgcc} or @code{-shared-libgcc}, will be ignored.
9171 The compiler may generate calls to @code{memcmp}, @code{memset},
9172 @code{memcpy} and @code{memmove}.
9173 These entries are usually resolved by entries in
9174 libc.  These entry points should be supplied through some other
9175 mechanism when this option is specified.
9177 @cindex @option{-lgcc}, use with @option{-nostdlib}
9178 @cindex @option{-nostdlib} and unresolved references
9179 @cindex unresolved references and @option{-nostdlib}
9180 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
9181 @cindex @option{-nodefaultlibs} and unresolved references
9182 @cindex unresolved references and @option{-nodefaultlibs}
9183 One of the standard libraries bypassed by @option{-nostdlib} and
9184 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
9185 that GCC uses to overcome shortcomings of particular machines, or special
9186 needs for some languages.
9187 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
9188 Collection (GCC) Internals},
9189 for more discussion of @file{libgcc.a}.)
9190 In most cases, you need @file{libgcc.a} even when you want to avoid
9191 other standard libraries.  In other words, when you specify @option{-nostdlib}
9192 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
9193 This ensures that you have no unresolved references to internal GCC
9194 library subroutines.  (For example, @samp{__main}, used to ensure C++
9195 constructors will be called; @pxref{Collect2,,@code{collect2}, gccint,
9196 GNU Compiler Collection (GCC) Internals}.)
9198 @item -pie
9199 @opindex pie
9200 Produce a position independent executable on targets which support it.
9201 For predictable results, you must also specify the same set of options
9202 that were used to generate code (@option{-fpie}, @option{-fPIE},
9203 or model suboptions) when you specify this option.
9205 @item -rdynamic
9206 @opindex rdynamic
9207 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
9208 that support it. This instructs the linker to add all symbols, not
9209 only used ones, to the dynamic symbol table. This option is needed
9210 for some uses of @code{dlopen} or to allow obtaining backtraces
9211 from within a program.
9213 @item -s
9214 @opindex s
9215 Remove all symbol table and relocation information from the executable.
9217 @item -static
9218 @opindex static
9219 On systems that support dynamic linking, this prevents linking with the shared
9220 libraries.  On other systems, this option has no effect.
9222 @item -shared
9223 @opindex shared
9224 Produce a shared object which can then be linked with other objects to
9225 form an executable.  Not all systems support this option.  For predictable
9226 results, you must also specify the same set of options that were used to
9227 generate code (@option{-fpic}, @option{-fPIC}, or model suboptions)
9228 when you specify this option.@footnote{On some systems, @samp{gcc -shared}
9229 needs to build supplementary stub code for constructors to work.  On
9230 multi-libbed systems, @samp{gcc -shared} must select the correct support
9231 libraries to link against.  Failing to supply the correct flags may lead
9232 to subtle defects.  Supplying them in cases where they are not necessary
9233 is innocuous.}
9235 @item -shared-libgcc
9236 @itemx -static-libgcc
9237 @opindex shared-libgcc
9238 @opindex static-libgcc
9239 On systems that provide @file{libgcc} as a shared library, these options
9240 force the use of either the shared or static version respectively.
9241 If no shared version of @file{libgcc} was built when the compiler was
9242 configured, these options have no effect.
9244 There are several situations in which an application should use the
9245 shared @file{libgcc} instead of the static version.  The most common
9246 of these is when the application wishes to throw and catch exceptions
9247 across different shared libraries.  In that case, each of the libraries
9248 as well as the application itself should use the shared @file{libgcc}.
9250 Therefore, the G++ and GCJ drivers automatically add
9251 @option{-shared-libgcc} whenever you build a shared library or a main
9252 executable, because C++ and Java programs typically use exceptions, so
9253 this is the right thing to do.
9255 If, instead, you use the GCC driver to create shared libraries, you may
9256 find that they will not always be linked with the shared @file{libgcc}.
9257 If GCC finds, at its configuration time, that you have a non-GNU linker
9258 or a GNU linker that does not support option @option{--eh-frame-hdr},
9259 it will link the shared version of @file{libgcc} into shared libraries
9260 by default.  Otherwise, it will take advantage of the linker and optimize
9261 away the linking with the shared version of @file{libgcc}, linking with
9262 the static version of libgcc by default.  This allows exceptions to
9263 propagate through such shared libraries, without incurring relocation
9264 costs at library load time.
9266 However, if a library or main executable is supposed to throw or catch
9267 exceptions, you must link it using the G++ or GCJ driver, as appropriate
9268 for the languages used in the program, or using the option
9269 @option{-shared-libgcc}, such that it is linked with the shared
9270 @file{libgcc}.
9272 @item -static-libstdc++
9273 When the @command{g++} program is used to link a C++ program, it will
9274 normally automatically link against @option{libstdc++}.  If
9275 @file{libstdc++} is available as a shared library, and the
9276 @option{-static} option is not used, then this will link against the
9277 shared version of @file{libstdc++}.  That is normally fine.  However, it
9278 is sometimes useful to freeze the version of @file{libstdc++} used by
9279 the program without going all the way to a fully static link.  The
9280 @option{-static-libstdc++} option directs the @command{g++} driver to
9281 link @file{libstdc++} statically, without necessarily linking other
9282 libraries statically.
9284 @item -symbolic
9285 @opindex symbolic
9286 Bind references to global symbols when building a shared object.  Warn
9287 about any unresolved references (unless overridden by the link editor
9288 option @samp{-Xlinker -z -Xlinker defs}).  Only a few systems support
9289 this option.
9291 @item -T @var{script}
9292 @opindex T
9293 @cindex linker script
9294 Use @var{script} as the linker script.  This option is supported by most
9295 systems using the GNU linker.  On some targets, such as bare-board
9296 targets without an operating system, the @option{-T} option may be required
9297 when linking to avoid references to undefined symbols.
9299 @item -Xlinker @var{option}
9300 @opindex Xlinker
9301 Pass @var{option} as an option to the linker.  You can use this to
9302 supply system-specific linker options which GCC does not know how to
9303 recognize.
9305 If you want to pass an option that takes a separate argument, you must use
9306 @option{-Xlinker} twice, once for the option and once for the argument.
9307 For example, to pass @option{-assert definitions}, you must write
9308 @samp{-Xlinker -assert -Xlinker definitions}.  It does not work to write
9309 @option{-Xlinker "-assert definitions"}, because this passes the entire
9310 string as a single argument, which is not what the linker expects.
9312 When using the GNU linker, it is usually more convenient to pass
9313 arguments to linker options using the @option{@var{option}=@var{value}}
9314 syntax than as separate arguments.  For example, you can specify
9315 @samp{-Xlinker -Map=output.map} rather than
9316 @samp{-Xlinker -Map -Xlinker output.map}.  Other linkers may not support
9317 this syntax for command-line options.
9319 @item -Wl,@var{option}
9320 @opindex Wl
9321 Pass @var{option} as an option to the linker.  If @var{option} contains
9322 commas, it is split into multiple options at the commas.  You can use this
9323 syntax to pass an argument to the option.
9324 For example, @samp{-Wl,-Map,output.map} passes @samp{-Map output.map} to the
9325 linker.  When using the GNU linker, you can also get the same effect with
9326 @samp{-Wl,-Map=output.map}.
9328 @item -u @var{symbol}
9329 @opindex u
9330 Pretend the symbol @var{symbol} is undefined, to force linking of
9331 library modules to define it.  You can use @option{-u} multiple times with
9332 different symbols to force loading of additional library modules.
9333 @end table
9335 @node Directory Options
9336 @section Options for Directory Search
9337 @cindex directory options
9338 @cindex options, directory search
9339 @cindex search path
9341 These options specify directories to search for header files, for
9342 libraries and for parts of the compiler:
9344 @table @gcctabopt
9345 @item -I@var{dir}
9346 @opindex I
9347 Add the directory @var{dir} to the head of the list of directories to be
9348 searched for header files.  This can be used to override a system header
9349 file, substituting your own version, since these directories are
9350 searched before the system header file directories.  However, you should
9351 not use this option to add directories that contain vendor-supplied
9352 system header files (use @option{-isystem} for that).  If you use more than
9353 one @option{-I} option, the directories are scanned in left-to-right
9354 order; the standard system directories come after.
9356 If a standard system include directory, or a directory specified with
9357 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
9358 option will be ignored.  The directory will still be searched but as a
9359 system directory at its normal position in the system include chain.
9360 This is to ensure that GCC's procedure to fix buggy system headers and
9361 the ordering for the include_next directive are not inadvertently changed.
9362 If you really need to change the search order for system directories,
9363 use the @option{-nostdinc} and/or @option{-isystem} options.
9365 @item -iplugindir=@var{dir}
9366 Set the directory to search for plugins which are passed
9367 by @option{-fplugin=@var{name}} instead of
9368 @option{-fplugin=@var{path}/@var{name}.so}.  This option is not meant
9369 to be used by the user, but only passed by the driver.
9371 @item -iquote@var{dir}
9372 @opindex iquote
9373 Add the directory @var{dir} to the head of the list of directories to
9374 be searched for header files only for the case of @samp{#include
9375 "@var{file}"}; they are not searched for @samp{#include <@var{file}>},
9376 otherwise just like @option{-I}.
9378 @item -L@var{dir}
9379 @opindex L
9380 Add directory @var{dir} to the list of directories to be searched
9381 for @option{-l}.
9383 @item -B@var{prefix}
9384 @opindex B
9385 This option specifies where to find the executables, libraries,
9386 include files, and data files of the compiler itself.
9388 The compiler driver program runs one or more of the subprograms
9389 @file{cpp}, @file{cc1}, @file{as} and @file{ld}.  It tries
9390 @var{prefix} as a prefix for each program it tries to run, both with and
9391 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
9393 For each subprogram to be run, the compiler driver first tries the
9394 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
9395 was not specified, the driver tries two standard prefixes, which are
9396 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
9397 those results in a file name that is found, the unmodified program
9398 name is searched for using the directories specified in your
9399 @env{PATH} environment variable.
9401 The compiler will check to see if the path provided by the @option{-B}
9402 refers to a directory, and if necessary it will add a directory
9403 separator character at the end of the path.
9405 @option{-B} prefixes that effectively specify directory names also apply
9406 to libraries in the linker, because the compiler translates these
9407 options into @option{-L} options for the linker.  They also apply to
9408 includes files in the preprocessor, because the compiler translates these
9409 options into @option{-isystem} options for the preprocessor.  In this case,
9410 the compiler appends @samp{include} to the prefix.
9412 The run-time support file @file{libgcc.a} can also be searched for using
9413 the @option{-B} prefix, if needed.  If it is not found there, the two
9414 standard prefixes above are tried, and that is all.  The file is left
9415 out of the link if it is not found by those means.
9417 Another way to specify a prefix much like the @option{-B} prefix is to use
9418 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
9419 Variables}.
9421 As a special kludge, if the path provided by @option{-B} is
9422 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
9423 9, then it will be replaced by @file{[dir/]include}.  This is to help
9424 with boot-strapping the compiler.
9426 @item -specs=@var{file}
9427 @opindex specs
9428 Process @var{file} after the compiler reads in the standard @file{specs}
9429 file, in order to override the defaults that the @file{gcc} driver
9430 program uses when determining what switches to pass to @file{cc1},
9431 @file{cc1plus}, @file{as}, @file{ld}, etc.  More than one
9432 @option{-specs=@var{file}} can be specified on the command line, and they
9433 are processed in order, from left to right.
9435 @item --sysroot=@var{dir}
9436 @opindex sysroot
9437 Use @var{dir} as the logical root directory for headers and libraries.
9438 For example, if the compiler would normally search for headers in
9439 @file{/usr/include} and libraries in @file{/usr/lib}, it will instead
9440 search @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
9442 If you use both this option and the @option{-isysroot} option, then
9443 the @option{--sysroot} option will apply to libraries, but the
9444 @option{-isysroot} option will apply to header files.
9446 The GNU linker (beginning with version 2.16) has the necessary support
9447 for this option.  If your linker does not support this option, the
9448 header file aspect of @option{--sysroot} will still work, but the
9449 library aspect will not.
9451 @item -I-
9452 @opindex I-
9453 This option has been deprecated.  Please use @option{-iquote} instead for
9454 @option{-I} directories before the @option{-I-} and remove the @option{-I-}.
9455 Any directories you specify with @option{-I} options before the @option{-I-}
9456 option are searched only for the case of @samp{#include "@var{file}"};
9457 they are not searched for @samp{#include <@var{file}>}.
9459 If additional directories are specified with @option{-I} options after
9460 the @option{-I-}, these directories are searched for all @samp{#include}
9461 directives.  (Ordinarily @emph{all} @option{-I} directories are used
9462 this way.)
9464 In addition, the @option{-I-} option inhibits the use of the current
9465 directory (where the current input file came from) as the first search
9466 directory for @samp{#include "@var{file}"}.  There is no way to
9467 override this effect of @option{-I-}.  With @option{-I.} you can specify
9468 searching the directory which was current when the compiler was
9469 invoked.  That is not exactly the same as what the preprocessor does
9470 by default, but it is often satisfactory.
9472 @option{-I-} does not inhibit the use of the standard system directories
9473 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
9474 independent.
9475 @end table
9477 @c man end
9479 @node Spec Files
9480 @section Specifying subprocesses and the switches to pass to them
9481 @cindex Spec Files
9483 @command{gcc} is a driver program.  It performs its job by invoking a
9484 sequence of other programs to do the work of compiling, assembling and
9485 linking.  GCC interprets its command-line parameters and uses these to
9486 deduce which programs it should invoke, and which command-line options
9487 it ought to place on their command lines.  This behavior is controlled
9488 by @dfn{spec strings}.  In most cases there is one spec string for each
9489 program that GCC can invoke, but a few programs have multiple spec
9490 strings to control their behavior.  The spec strings built into GCC can
9491 be overridden by using the @option{-specs=} command-line switch to specify
9492 a spec file.
9494 @dfn{Spec files} are plaintext files that are used to construct spec
9495 strings.  They consist of a sequence of directives separated by blank
9496 lines.  The type of directive is determined by the first non-whitespace
9497 character on the line and it can be one of the following:
9499 @table @code
9500 @item %@var{command}
9501 Issues a @var{command} to the spec file processor.  The commands that can
9502 appear here are:
9504 @table @code
9505 @item %include <@var{file}>
9506 @cindex @code{%include}
9507 Search for @var{file} and insert its text at the current point in the
9508 specs file.
9510 @item %include_noerr <@var{file}>
9511 @cindex @code{%include_noerr}
9512 Just like @samp{%include}, but do not generate an error message if the include
9513 file cannot be found.
9515 @item %rename @var{old_name} @var{new_name}
9516 @cindex @code{%rename}
9517 Rename the spec string @var{old_name} to @var{new_name}.
9519 @end table
9521 @item *[@var{spec_name}]:
9522 This tells the compiler to create, override or delete the named spec
9523 string.  All lines after this directive up to the next directive or
9524 blank line are considered to be the text for the spec string.  If this
9525 results in an empty string then the spec will be deleted.  (Or, if the
9526 spec did not exist, then nothing will happen.)  Otherwise, if the spec
9527 does not currently exist a new spec will be created.  If the spec does
9528 exist then its contents will be overridden by the text of this
9529 directive, unless the first character of that text is the @samp{+}
9530 character, in which case the text will be appended to the spec.
9532 @item [@var{suffix}]:
9533 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
9534 and up to the next directive or blank line are considered to make up the
9535 spec string for the indicated suffix.  When the compiler encounters an
9536 input file with the named suffix, it will processes the spec string in
9537 order to work out how to compile that file.  For example:
9539 @smallexample
9540 .ZZ:
9541 z-compile -input %i
9542 @end smallexample
9544 This says that any input file whose name ends in @samp{.ZZ} should be
9545 passed to the program @samp{z-compile}, which should be invoked with the
9546 command-line switch @option{-input} and with the result of performing the
9547 @samp{%i} substitution.  (See below.)
9549 As an alternative to providing a spec string, the text that follows a
9550 suffix directive can be one of the following:
9552 @table @code
9553 @item @@@var{language}
9554 This says that the suffix is an alias for a known @var{language}.  This is
9555 similar to using the @option{-x} command-line switch to GCC to specify a
9556 language explicitly.  For example:
9558 @smallexample
9559 .ZZ:
9560 @@c++
9561 @end smallexample
9563 Says that .ZZ files are, in fact, C++ source files.
9565 @item #@var{name}
9566 This causes an error messages saying:
9568 @smallexample
9569 @var{name} compiler not installed on this system.
9570 @end smallexample
9571 @end table
9573 GCC already has an extensive list of suffixes built into it.
9574 This directive will add an entry to the end of the list of suffixes, but
9575 since the list is searched from the end backwards, it is effectively
9576 possible to override earlier entries using this technique.
9578 @end table
9580 GCC has the following spec strings built into it.  Spec files can
9581 override these strings or create their own.  Note that individual
9582 targets can also add their own spec strings to this list.
9584 @smallexample
9585 asm          Options to pass to the assembler
9586 asm_final    Options to pass to the assembler post-processor
9587 cpp          Options to pass to the C preprocessor
9588 cc1          Options to pass to the C compiler
9589 cc1plus      Options to pass to the C++ compiler
9590 endfile      Object files to include at the end of the link
9591 link         Options to pass to the linker
9592 lib          Libraries to include on the command line to the linker
9593 libgcc       Decides which GCC support library to pass to the linker
9594 linker       Sets the name of the linker
9595 predefines   Defines to be passed to the C preprocessor
9596 signed_char  Defines to pass to CPP to say whether @code{char} is signed
9597              by default
9598 startfile    Object files to include at the start of the link
9599 @end smallexample
9601 Here is a small example of a spec file:
9603 @smallexample
9604 %rename lib                 old_lib
9606 *lib:
9607 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
9608 @end smallexample
9610 This example renames the spec called @samp{lib} to @samp{old_lib} and
9611 then overrides the previous definition of @samp{lib} with a new one.
9612 The new definition adds in some extra command-line options before
9613 including the text of the old definition.
9615 @dfn{Spec strings} are a list of command-line options to be passed to their
9616 corresponding program.  In addition, the spec strings can contain
9617 @samp{%}-prefixed sequences to substitute variable text or to
9618 conditionally insert text into the command line.  Using these constructs
9619 it is possible to generate quite complex command lines.
9621 Here is a table of all defined @samp{%}-sequences for spec
9622 strings.  Note that spaces are not generated automatically around the
9623 results of expanding these sequences.  Therefore you can concatenate them
9624 together or combine them with constant text in a single argument.
9626 @table @code
9627 @item %%
9628 Substitute one @samp{%} into the program name or argument.
9630 @item %i
9631 Substitute the name of the input file being processed.
9633 @item %b
9634 Substitute the basename of the input file being processed.
9635 This is the substring up to (and not including) the last period
9636 and not including the directory.
9638 @item %B
9639 This is the same as @samp{%b}, but include the file suffix (text after
9640 the last period).
9642 @item %d
9643 Marks the argument containing or following the @samp{%d} as a
9644 temporary file name, so that that file will be deleted if GCC exits
9645 successfully.  Unlike @samp{%g}, this contributes no text to the
9646 argument.
9648 @item %g@var{suffix}
9649 Substitute a file name that has suffix @var{suffix} and is chosen
9650 once per compilation, and mark the argument in the same way as
9651 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
9652 name is now chosen in a way that is hard to predict even when previously
9653 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
9654 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
9655 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
9656 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
9657 was simply substituted with a file name chosen once per compilation,
9658 without regard to any appended suffix (which was therefore treated
9659 just like ordinary text), making such attacks more likely to succeed.
9661 @item %u@var{suffix}
9662 Like @samp{%g}, but generates a new temporary file name even if
9663 @samp{%u@var{suffix}} was already seen.
9665 @item %U@var{suffix}
9666 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
9667 new one if there is no such last file name.  In the absence of any
9668 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
9669 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
9670 would involve the generation of two distinct file names, one
9671 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
9672 simply substituted with a file name chosen for the previous @samp{%u},
9673 without regard to any appended suffix.
9675 @item %j@var{suffix}
9676 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
9677 writable, and if save-temps is off; otherwise, substitute the name
9678 of a temporary file, just like @samp{%u}.  This temporary file is not
9679 meant for communication between processes, but rather as a junk
9680 disposal mechanism.
9682 @item %|@var{suffix}
9683 @itemx %m@var{suffix}
9684 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
9685 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
9686 all.  These are the two most common ways to instruct a program that it
9687 should read from standard input or write to standard output.  If you
9688 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
9689 construct: see for example @file{f/lang-specs.h}.
9691 @item %.@var{SUFFIX}
9692 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
9693 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
9694 terminated by the next space or %.
9696 @item %w
9697 Marks the argument containing or following the @samp{%w} as the
9698 designated output file of this compilation.  This puts the argument
9699 into the sequence of arguments that @samp{%o} will substitute later.
9701 @item %o
9702 Substitutes the names of all the output files, with spaces
9703 automatically placed around them.  You should write spaces
9704 around the @samp{%o} as well or the results are undefined.
9705 @samp{%o} is for use in the specs for running the linker.
9706 Input files whose names have no recognized suffix are not compiled
9707 at all, but they are included among the output files, so they will
9708 be linked.
9710 @item %O
9711 Substitutes the suffix for object files.  Note that this is
9712 handled specially when it immediately follows @samp{%g, %u, or %U},
9713 because of the need for those to form complete file names.  The
9714 handling is such that @samp{%O} is treated exactly as if it had already
9715 been substituted, except that @samp{%g, %u, and %U} do not currently
9716 support additional @var{suffix} characters following @samp{%O} as they would
9717 following, for example, @samp{.o}.
9719 @item %p
9720 Substitutes the standard macro predefinitions for the
9721 current target machine.  Use this when running @code{cpp}.
9723 @item %P
9724 Like @samp{%p}, but puts @samp{__} before and after the name of each
9725 predefined macro, except for macros that start with @samp{__} or with
9726 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
9729 @item %I
9730 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
9731 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
9732 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
9733 and @option{-imultilib} as necessary.
9735 @item %s
9736 Current argument is the name of a library or startup file of some sort.
9737 Search for that file in a standard list of directories and substitute
9738 the full name found.  The current working directory is included in the
9739 list of directories scanned.
9741 @item %T
9742 Current argument is the name of a linker script.  Search for that file
9743 in the current list of directories to scan for libraries. If the file
9744 is located insert a @option{--script} option into the command line
9745 followed by the full path name found.  If the file is not found then
9746 generate an error message.  Note: the current working directory is not
9747 searched.
9749 @item %e@var{str}
9750 Print @var{str} as an error message.  @var{str} is terminated by a newline.
9751 Use this when inconsistent options are detected.
9753 @item %(@var{name})
9754 Substitute the contents of spec string @var{name} at this point.
9756 @item %[@var{name}]
9757 Like @samp{%(@dots{})} but put @samp{__} around @option{-D} arguments.
9759 @item %x@{@var{option}@}
9760 Accumulate an option for @samp{%X}.
9762 @item %X
9763 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
9764 spec string.
9766 @item %Y
9767 Output the accumulated assembler options specified by @option{-Wa}.
9769 @item %Z
9770 Output the accumulated preprocessor options specified by @option{-Wp}.
9772 @item %a
9773 Process the @code{asm} spec.  This is used to compute the
9774 switches to be passed to the assembler.
9776 @item %A
9777 Process the @code{asm_final} spec.  This is a spec string for
9778 passing switches to an assembler post-processor, if such a program is
9779 needed.
9781 @item %l
9782 Process the @code{link} spec.  This is the spec for computing the
9783 command line passed to the linker.  Typically it will make use of the
9784 @samp{%L %G %S %D and %E} sequences.
9786 @item %D
9787 Dump out a @option{-L} option for each directory that GCC believes might
9788 contain startup files.  If the target supports multilibs then the
9789 current multilib directory will be prepended to each of these paths.
9791 @item %L
9792 Process the @code{lib} spec.  This is a spec string for deciding which
9793 libraries should be included on the command line to the linker.
9795 @item %G
9796 Process the @code{libgcc} spec.  This is a spec string for deciding
9797 which GCC support library should be included on the command line to the linker.
9799 @item %S
9800 Process the @code{startfile} spec.  This is a spec for deciding which
9801 object files should be the first ones passed to the linker.  Typically
9802 this might be a file named @file{crt0.o}.
9804 @item %E
9805 Process the @code{endfile} spec.  This is a spec string that specifies
9806 the last object files that will be passed to the linker.
9808 @item %C
9809 Process the @code{cpp} spec.  This is used to construct the arguments
9810 to be passed to the C preprocessor.
9812 @item %1
9813 Process the @code{cc1} spec.  This is used to construct the options to be
9814 passed to the actual C compiler (@samp{cc1}).
9816 @item %2
9817 Process the @code{cc1plus} spec.  This is used to construct the options to be
9818 passed to the actual C++ compiler (@samp{cc1plus}).
9820 @item %*
9821 Substitute the variable part of a matched option.  See below.
9822 Note that each comma in the substituted string is replaced by
9823 a single space.
9825 @item %<@code{S}
9826 Remove all occurrences of @code{-S} from the command line.  Note---this
9827 command is position dependent.  @samp{%} commands in the spec string
9828 before this one will see @code{-S}, @samp{%} commands in the spec string
9829 after this one will not.
9831 @item %:@var{function}(@var{args})
9832 Call the named function @var{function}, passing it @var{args}.
9833 @var{args} is first processed as a nested spec string, then split
9834 into an argument vector in the usual fashion.  The function returns
9835 a string which is processed as if it had appeared literally as part
9836 of the current spec.
9838 The following built-in spec functions are provided:
9840 @table @code
9841 @item @code{getenv}
9842 The @code{getenv} spec function takes two arguments: an environment
9843 variable name and a string.  If the environment variable is not
9844 defined, a fatal error is issued.  Otherwise, the return value is the
9845 value of the environment variable concatenated with the string.  For
9846 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
9848 @smallexample
9849 %:getenv(TOPDIR /include)
9850 @end smallexample
9852 expands to @file{/path/to/top/include}.
9854 @item @code{if-exists}
9855 The @code{if-exists} spec function takes one argument, an absolute
9856 pathname to a file.  If the file exists, @code{if-exists} returns the
9857 pathname.  Here is a small example of its usage:
9859 @smallexample
9860 *startfile:
9861 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
9862 @end smallexample
9864 @item @code{if-exists-else}
9865 The @code{if-exists-else} spec function is similar to the @code{if-exists}
9866 spec function, except that it takes two arguments.  The first argument is
9867 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
9868 returns the pathname.  If it does not exist, it returns the second argument.
9869 This way, @code{if-exists-else} can be used to select one file or another,
9870 based on the existence of the first.  Here is a small example of its usage:
9872 @smallexample
9873 *startfile:
9874 crt0%O%s %:if-exists(crti%O%s) \
9875 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
9876 @end smallexample
9878 @item @code{replace-outfile}
9879 The @code{replace-outfile} spec function takes two arguments.  It looks for the
9880 first argument in the outfiles array and replaces it with the second argument.  Here
9881 is a small example of its usage:
9883 @smallexample
9884 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
9885 @end smallexample
9887 @item @code{remove-outfile}
9888 The @code{remove-outfile} spec function takes one argument.  It looks for the
9889 first argument in the outfiles array and removes it.  Here is a small example
9890 its usage:
9892 @smallexample
9893 %:remove-outfile(-lm)
9894 @end smallexample
9896 @item @code{pass-through-libs}
9897 The @code{pass-through-libs} spec function takes any number of arguments.  It
9898 finds any @option{-l} options and any non-options ending in ".a" (which it
9899 assumes are the names of linker input library archive files) and returns a
9900 result containing all the found arguments each prepended by
9901 @option{-plugin-opt=-pass-through=} and joined by spaces.  This list is
9902 intended to be passed to the LTO linker plugin.
9904 @smallexample
9905 %:pass-through-libs(%G %L %G)
9906 @end smallexample
9908 @item @code{print-asm-header}
9909 The @code{print-asm-header} function takes no arguments and simply
9910 prints a banner like:
9912 @smallexample
9913 Assembler options
9914 =================
9916 Use "-Wa,OPTION" to pass "OPTION" to the assembler.
9917 @end smallexample
9919 It is used to separate compiler options from assembler options
9920 in the @option{--target-help} output.
9921 @end table
9923 @item %@{@code{S}@}
9924 Substitutes the @code{-S} switch, if that switch was given to GCC@.
9925 If that switch was not specified, this substitutes nothing.  Note that
9926 the leading dash is omitted when specifying this option, and it is
9927 automatically inserted if the substitution is performed.  Thus the spec
9928 string @samp{%@{foo@}} would match the command-line option @option{-foo}
9929 and would output the command line option @option{-foo}.
9931 @item %W@{@code{S}@}
9932 Like %@{@code{S}@} but mark last argument supplied within as a file to be
9933 deleted on failure.
9935 @item %@{@code{S}*@}
9936 Substitutes all the switches specified to GCC whose names start
9937 with @code{-S}, but which also take an argument.  This is used for
9938 switches like @option{-o}, @option{-D}, @option{-I}, etc.
9939 GCC considers @option{-o foo} as being
9940 one switch whose names starts with @samp{o}.  %@{o*@} would substitute this
9941 text, including the space.  Thus two arguments would be generated.
9943 @item %@{@code{S}*&@code{T}*@}
9944 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
9945 (the order of @code{S} and @code{T} in the spec is not significant).
9946 There can be any number of ampersand-separated variables; for each the
9947 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
9949 @item %@{@code{S}:@code{X}@}
9950 Substitutes @code{X}, if the @samp{-S} switch was given to GCC@.
9952 @item %@{!@code{S}:@code{X}@}
9953 Substitutes @code{X}, if the @samp{-S} switch was @emph{not} given to GCC@.
9955 @item %@{@code{S}*:@code{X}@}
9956 Substitutes @code{X} if one or more switches whose names start with
9957 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
9958 once, no matter how many such switches appeared.  However, if @code{%*}
9959 appears somewhere in @code{X}, then @code{X} will be substituted once
9960 for each matching switch, with the @code{%*} replaced by the part of
9961 that switch that matched the @code{*}.
9963 @item %@{.@code{S}:@code{X}@}
9964 Substitutes @code{X}, if processing a file with suffix @code{S}.
9966 @item %@{!.@code{S}:@code{X}@}
9967 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
9969 @item %@{,@code{S}:@code{X}@}
9970 Substitutes @code{X}, if processing a file for language @code{S}.
9972 @item %@{!,@code{S}:@code{X}@}
9973 Substitutes @code{X}, if not processing a file for language @code{S}.
9975 @item %@{@code{S}|@code{P}:@code{X}@}
9976 Substitutes @code{X} if either @code{-S} or @code{-P} was given to
9977 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
9978 @code{*} sequences as well, although they have a stronger binding than
9979 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
9980 alternatives must be starred, and only the first matching alternative
9981 is substituted.
9983 For example, a spec string like this:
9985 @smallexample
9986 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
9987 @end smallexample
9989 will output the following command-line options from the following input
9990 command-line options:
9992 @smallexample
9993 fred.c        -foo -baz
9994 jim.d         -bar -boggle
9995 -d fred.c     -foo -baz -boggle
9996 -d jim.d      -bar -baz -boggle
9997 @end smallexample
9999 @item %@{S:X; T:Y; :D@}
10001 If @code{S} was given to GCC, substitutes @code{X}; else if @code{T} was
10002 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
10003 be as many clauses as you need.  This may be combined with @code{.},
10004 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
10007 @end table
10009 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
10010 construct may contain other nested @samp{%} constructs or spaces, or
10011 even newlines.  They are processed as usual, as described above.
10012 Trailing white space in @code{X} is ignored.  White space may also
10013 appear anywhere on the left side of the colon in these constructs,
10014 except between @code{.} or @code{*} and the corresponding word.
10016 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
10017 handled specifically in these constructs.  If another value of
10018 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
10019 @option{-W} switch is found later in the command line, the earlier
10020 switch value is ignored, except with @{@code{S}*@} where @code{S} is
10021 just one letter, which passes all matching options.
10023 The character @samp{|} at the beginning of the predicate text is used to
10024 indicate that a command should be piped to the following command, but
10025 only if @option{-pipe} is specified.
10027 It is built into GCC which switches take arguments and which do not.
10028 (You might think it would be useful to generalize this to allow each
10029 compiler's spec to say which switches take arguments.  But this cannot
10030 be done in a consistent fashion.  GCC cannot even decide which input
10031 files have been specified without knowing which switches take arguments,
10032 and it must know which input files to compile in order to tell which
10033 compilers to run).
10035 GCC also knows implicitly that arguments starting in @option{-l} are to be
10036 treated as compiler output files, and passed to the linker in their
10037 proper position among the other output files.
10039 @c man begin OPTIONS
10041 @node Target Options
10042 @section Specifying Target Machine and Compiler Version
10043 @cindex target options
10044 @cindex cross compiling
10045 @cindex specifying machine version
10046 @cindex specifying compiler version and target machine
10047 @cindex compiler version, specifying
10048 @cindex target machine, specifying
10050 The usual way to run GCC is to run the executable called @command{gcc}, or
10051 @command{@var{machine}-gcc} when cross-compiling, or
10052 @command{@var{machine}-gcc-@var{version}} to run a version other than the
10053 one that was installed last.
10055 @node Submodel Options
10056 @section Hardware Models and Configurations
10057 @cindex submodel options
10058 @cindex specifying hardware config
10059 @cindex hardware models and configurations, specifying
10060 @cindex machine dependent options
10062 Each target machine types can have its own
10063 special options, starting with @samp{-m}, to choose among various
10064 hardware models or configurations---for example, 68010 vs 68020,
10065 floating coprocessor or none.  A single installed version of the
10066 compiler can compile for any model or configuration, according to the
10067 options specified.
10069 Some configurations of the compiler also support additional special
10070 options, usually for compatibility with other compilers on the same
10071 platform.
10073 @c This list is ordered alphanumerically by subsection name.
10074 @c It should be the same order and spelling as these options are listed
10075 @c in Machine Dependent Options
10077 @menu
10078 * ARM Options::
10079 * AVR Options::
10080 * Blackfin Options::
10081 * CRIS Options::
10082 * Darwin Options::
10083 * DEC Alpha Options::
10084 * DEC Alpha/VMS Options::
10085 * FR30 Options::
10086 * FRV Options::
10087 * GNU/Linux Options::
10088 * H8/300 Options::
10089 * HPPA Options::
10090 * i386 and x86-64 Options::
10091 * i386 and x86-64 Windows Options::
10092 * IA-64 Options::
10093 * IA-64/VMS Options::
10094 * LM32 Options::
10095 * M32C Options::
10096 * M32R/D Options::
10097 * M680x0 Options::
10098 * MCore Options::
10099 * MeP Options::
10100 * MicroBlaze Options::
10101 * MIPS Options::
10102 * MMIX Options::
10103 * MN10300 Options::
10104 * PDP-11 Options::
10105 * picoChip Options::
10106 * PowerPC Options::
10107 * RS/6000 and PowerPC Options::
10108 * RX Options::
10109 * S/390 and zSeries Options::
10110 * Score Options::
10111 * SH Options::
10112 * Solaris 2 Options::
10113 * SPARC Options::
10114 * SPU Options::
10115 * System V Options::
10116 * V850 Options::
10117 * VAX Options::
10118 * VxWorks Options::
10119 * x86-64 Options::
10120 * Xstormy16 Options::
10121 * Xtensa Options::
10122 * zSeries Options::
10123 @end menu
10125 @node ARM Options
10126 @subsection ARM Options
10127 @cindex ARM options
10129 These @samp{-m} options are defined for Advanced RISC Machines (ARM)
10130 architectures:
10132 @table @gcctabopt
10133 @item -mabi=@var{name}
10134 @opindex mabi
10135 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
10136 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
10138 @item -mapcs-frame
10139 @opindex mapcs-frame
10140 Generate a stack frame that is compliant with the ARM Procedure Call
10141 Standard for all functions, even if this is not strictly necessary for
10142 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
10143 with this option will cause the stack frames not to be generated for
10144 leaf functions.  The default is @option{-mno-apcs-frame}.
10146 @item -mapcs
10147 @opindex mapcs
10148 This is a synonym for @option{-mapcs-frame}.
10150 @ignore
10151 @c not currently implemented
10152 @item -mapcs-stack-check
10153 @opindex mapcs-stack-check
10154 Generate code to check the amount of stack space available upon entry to
10155 every function (that actually uses some stack space).  If there is
10156 insufficient space available then either the function
10157 @samp{__rt_stkovf_split_small} or @samp{__rt_stkovf_split_big} will be
10158 called, depending upon the amount of stack space required.  The run time
10159 system is required to provide these functions.  The default is
10160 @option{-mno-apcs-stack-check}, since this produces smaller code.
10162 @c not currently implemented
10163 @item -mapcs-float
10164 @opindex mapcs-float
10165 Pass floating point arguments using the float point registers.  This is
10166 one of the variants of the APCS@.  This option is recommended if the
10167 target hardware has a floating point unit or if a lot of floating point
10168 arithmetic is going to be performed by the code.  The default is
10169 @option{-mno-apcs-float}, since integer only code is slightly increased in
10170 size if @option{-mapcs-float} is used.
10172 @c not currently implemented
10173 @item -mapcs-reentrant
10174 @opindex mapcs-reentrant
10175 Generate reentrant, position independent code.  The default is
10176 @option{-mno-apcs-reentrant}.
10177 @end ignore
10179 @item -mthumb-interwork
10180 @opindex mthumb-interwork
10181 Generate code which supports calling between the ARM and Thumb
10182 instruction sets.  Without this option the two instruction sets cannot
10183 be reliably used inside one program.  The default is
10184 @option{-mno-thumb-interwork}, since slightly larger code is generated
10185 when @option{-mthumb-interwork} is specified.
10187 @item -mno-sched-prolog
10188 @opindex mno-sched-prolog
10189 Prevent the reordering of instructions in the function prolog, or the
10190 merging of those instruction with the instructions in the function's
10191 body.  This means that all functions will start with a recognizable set
10192 of instructions (or in fact one of a choice from a small set of
10193 different function prologues), and this information can be used to
10194 locate the start if functions inside an executable piece of code.  The
10195 default is @option{-msched-prolog}.
10197 @item -mfloat-abi=@var{name}
10198 @opindex mfloat-abi
10199 Specifies which floating-point ABI to use.  Permissible values
10200 are: @samp{soft}, @samp{softfp} and @samp{hard}.
10202 Specifying @samp{soft} causes GCC to generate output containing
10203 library calls for floating-point operations.
10204 @samp{softfp} allows the generation of code using hardware floating-point
10205 instructions, but still uses the soft-float calling conventions.
10206 @samp{hard} allows generation of floating-point instructions
10207 and uses FPU-specific calling conventions.
10209 The default depends on the specific target configuration.  Note that
10210 the hard-float and soft-float ABIs are not link-compatible; you must
10211 compile your entire program with the same ABI, and link with a
10212 compatible set of libraries.
10214 @item -mlittle-endian
10215 @opindex mlittle-endian
10216 Generate code for a processor running in little-endian mode.  This is
10217 the default for all standard configurations.
10219 @item -mbig-endian
10220 @opindex mbig-endian
10221 Generate code for a processor running in big-endian mode; the default is
10222 to compile code for a little-endian processor.
10224 @item -mwords-little-endian
10225 @opindex mwords-little-endian
10226 This option only applies when generating code for big-endian processors.
10227 Generate code for a little-endian word order but a big-endian byte
10228 order.  That is, a byte order of the form @samp{32107654}.  Note: this
10229 option should only be used if you require compatibility with code for
10230 big-endian ARM processors generated by versions of the compiler prior to
10231 2.8.
10233 @item -mcpu=@var{name}
10234 @opindex mcpu
10235 This specifies the name of the target ARM processor.  GCC uses this name
10236 to determine what kind of instructions it can emit when generating
10237 assembly code.  Permissible names are: @samp{arm2}, @samp{arm250},
10238 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
10239 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
10240 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
10241 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
10242 @samp{arm720},
10243 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
10244 @samp{arm710t}, @samp{arm720t}, @samp{arm740t},
10245 @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
10246 @samp{strongarm1110},
10247 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
10248 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
10249 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
10250 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
10251 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
10252 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
10253 @samp{arm1156t2-s}, @samp{arm1156t2f-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
10254 @samp{cortex-a5}, @samp{cortex-a8}, @samp{cortex-a9}, @samp{cortex-a15},
10255 @samp{cortex-r4}, @samp{cortex-r4f}, @samp{cortex-r5},
10256 @samp{cortex-m4}, @samp{cortex-m3},
10257 @samp{cortex-m1},
10258 @samp{cortex-m0},
10259 @samp{xscale}, @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312}.
10261 @item -mtune=@var{name}
10262 @opindex mtune
10263 This option is very similar to the @option{-mcpu=} option, except that
10264 instead of specifying the actual target processor type, and hence
10265 restricting which instructions can be used, it specifies that GCC should
10266 tune the performance of the code as if the target were of the type
10267 specified in this option, but still choosing the instructions that it
10268 will generate based on the CPU specified by a @option{-mcpu=} option.
10269 For some ARM implementations better performance can be obtained by using
10270 this option.
10272 @item -march=@var{name}
10273 @opindex march
10274 This specifies the name of the target ARM architecture.  GCC uses this
10275 name to determine what kind of instructions it can emit when generating
10276 assembly code.  This option can be used in conjunction with or instead
10277 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
10278 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
10279 @samp{armv5}, @samp{armv5t}, @samp{armv5e}, @samp{armv5te},
10280 @samp{armv6}, @samp{armv6j},
10281 @samp{armv6t2}, @samp{armv6z}, @samp{armv6zk}, @samp{armv6-m},
10282 @samp{armv7}, @samp{armv7-a}, @samp{armv7-r}, @samp{armv7-m},
10283 @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312}.
10285 @item -mfpu=@var{name}
10286 @itemx -mfpe=@var{number}
10287 @itemx -mfp=@var{number}
10288 @opindex mfpu
10289 @opindex mfpe
10290 @opindex mfp
10291 This specifies what floating point hardware (or hardware emulation) is
10292 available on the target.  Permissible names are: @samp{fpa}, @samp{fpe2},
10293 @samp{fpe3}, @samp{maverick}, @samp{vfp}, @samp{vfpv3}, @samp{vfpv3-fp16},
10294 @samp{vfpv3-d16}, @samp{vfpv3-d16-fp16}, @samp{vfpv3xd}, @samp{vfpv3xd-fp16},
10295 @samp{neon}, @samp{neon-fp16}, @samp{vfpv4}, @samp{vfpv4-d16},
10296 @samp{fpv4-sp-d16} and @samp{neon-vfpv4}.
10297 @option{-mfp} and @option{-mfpe} are synonyms for
10298 @option{-mfpu}=@samp{fpe}@var{number}, for compatibility with older versions
10299 of GCC@.
10301 If @option{-msoft-float} is specified this specifies the format of
10302 floating point values.
10304 If the selected floating-point hardware includes the NEON extension
10305 (e.g. @option{-mfpu}=@samp{neon}), note that floating-point
10306 operations will not be used by GCC's auto-vectorization pass unless
10307 @option{-funsafe-math-optimizations} is also specified.  This is
10308 because NEON hardware does not fully implement the IEEE 754 standard for
10309 floating-point arithmetic (in particular denormal values are treated as
10310 zero), so the use of NEON instructions may lead to a loss of precision.
10312 @item -mfp16-format=@var{name}
10313 @opindex mfp16-format
10314 Specify the format of the @code{__fp16} half-precision floating-point type.
10315 Permissible names are @samp{none}, @samp{ieee}, and @samp{alternative};
10316 the default is @samp{none}, in which case the @code{__fp16} type is not
10317 defined.  @xref{Half-Precision}, for more information.
10319 @item -mstructure-size-boundary=@var{n}
10320 @opindex mstructure-size-boundary
10321 The size of all structures and unions will be rounded up to a multiple
10322 of the number of bits set by this option.  Permissible values are 8, 32
10323 and 64.  The default value varies for different toolchains.  For the COFF
10324 targeted toolchain the default value is 8.  A value of 64 is only allowed
10325 if the underlying ABI supports it.
10327 Specifying the larger number can produce faster, more efficient code, but
10328 can also increase the size of the program.  Different values are potentially
10329 incompatible.  Code compiled with one value cannot necessarily expect to
10330 work with code or libraries compiled with another value, if they exchange
10331 information using structures or unions.
10333 @item -mabort-on-noreturn
10334 @opindex mabort-on-noreturn
10335 Generate a call to the function @code{abort} at the end of a
10336 @code{noreturn} function.  It will be executed if the function tries to
10337 return.
10339 @item -mlong-calls
10340 @itemx -mno-long-calls
10341 @opindex mlong-calls
10342 @opindex mno-long-calls
10343 Tells the compiler to perform function calls by first loading the
10344 address of the function into a register and then performing a subroutine
10345 call on this register.  This switch is needed if the target function
10346 will lie outside of the 64 megabyte addressing range of the offset based
10347 version of subroutine call instruction.
10349 Even if this switch is enabled, not all function calls will be turned
10350 into long calls.  The heuristic is that static functions, functions
10351 which have the @samp{short-call} attribute, functions that are inside
10352 the scope of a @samp{#pragma no_long_calls} directive and functions whose
10353 definitions have already been compiled within the current compilation
10354 unit, will not be turned into long calls.  The exception to this rule is
10355 that weak function definitions, functions with the @samp{long-call}
10356 attribute or the @samp{section} attribute, and functions that are within
10357 the scope of a @samp{#pragma long_calls} directive, will always be
10358 turned into long calls.
10360 This feature is not enabled by default.  Specifying
10361 @option{-mno-long-calls} will restore the default behavior, as will
10362 placing the function calls within the scope of a @samp{#pragma
10363 long_calls_off} directive.  Note these switches have no effect on how
10364 the compiler generates code to handle function calls via function
10365 pointers.
10367 @item -msingle-pic-base
10368 @opindex msingle-pic-base
10369 Treat the register used for PIC addressing as read-only, rather than
10370 loading it in the prologue for each function.  The run-time system is
10371 responsible for initializing this register with an appropriate value
10372 before execution begins.
10374 @item -mpic-register=@var{reg}
10375 @opindex mpic-register
10376 Specify the register to be used for PIC addressing.  The default is R10
10377 unless stack-checking is enabled, when R9 is used.
10379 @item -mcirrus-fix-invalid-insns
10380 @opindex mcirrus-fix-invalid-insns
10381 @opindex mno-cirrus-fix-invalid-insns
10382 Insert NOPs into the instruction stream to in order to work around
10383 problems with invalid Maverick instruction combinations.  This option
10384 is only valid if the @option{-mcpu=ep9312} option has been used to
10385 enable generation of instructions for the Cirrus Maverick floating
10386 point co-processor.  This option is not enabled by default, since the
10387 problem is only present in older Maverick implementations.  The default
10388 can be re-enabled by use of the @option{-mno-cirrus-fix-invalid-insns}
10389 switch.
10391 @item -mpoke-function-name
10392 @opindex mpoke-function-name
10393 Write the name of each function into the text section, directly
10394 preceding the function prologue.  The generated code is similar to this:
10396 @smallexample
10397      t0
10398          .ascii "arm_poke_function_name", 0
10399          .align
10400      t1
10401          .word 0xff000000 + (t1 - t0)
10402      arm_poke_function_name
10403          mov     ip, sp
10404          stmfd   sp!, @{fp, ip, lr, pc@}
10405          sub     fp, ip, #4
10406 @end smallexample
10408 When performing a stack backtrace, code can inspect the value of
10409 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
10410 location @code{pc - 12} and the top 8 bits are set, then we know that
10411 there is a function name embedded immediately preceding this location
10412 and has length @code{((pc[-3]) & 0xff000000)}.
10414 @item -mthumb
10415 @itemx -marm
10416 @opindex marm
10417 @opindex mthumb
10419 Select between generating code that executes in ARM and Thumb
10420 states.  The default for most configurations is to generate code
10421 that executes in ARM state, but the default can be changed by
10422 configuring GCC with the @option{--with-mode=}@var{state}
10423 configure option.
10425 @item -mtpcs-frame
10426 @opindex mtpcs-frame
10427 Generate a stack frame that is compliant with the Thumb Procedure Call
10428 Standard for all non-leaf functions.  (A leaf function is one that does
10429 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
10431 @item -mtpcs-leaf-frame
10432 @opindex mtpcs-leaf-frame
10433 Generate a stack frame that is compliant with the Thumb Procedure Call
10434 Standard for all leaf functions.  (A leaf function is one that does
10435 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
10437 @item -mcallee-super-interworking
10438 @opindex mcallee-super-interworking
10439 Gives all externally visible functions in the file being compiled an ARM
10440 instruction set header which switches to Thumb mode before executing the
10441 rest of the function.  This allows these functions to be called from
10442 non-interworking code.  This option is not valid in AAPCS configurations
10443 because interworking is enabled by default.
10445 @item -mcaller-super-interworking
10446 @opindex mcaller-super-interworking
10447 Allows calls via function pointers (including virtual functions) to
10448 execute correctly regardless of whether the target code has been
10449 compiled for interworking or not.  There is a small overhead in the cost
10450 of executing a function pointer if this option is enabled.  This option
10451 is not valid in AAPCS configurations because interworking is enabled
10452 by default.
10454 @item -mtp=@var{name}
10455 @opindex mtp
10456 Specify the access model for the thread local storage pointer.  The valid
10457 models are @option{soft}, which generates calls to @code{__aeabi_read_tp},
10458 @option{cp15}, which fetches the thread pointer from @code{cp15} directly
10459 (supported in the arm6k architecture), and @option{auto}, which uses the
10460 best available method for the selected processor.  The default setting is
10461 @option{auto}.
10463 @item -mword-relocations
10464 @opindex mword-relocations
10465 Only generate absolute relocations on word sized values (i.e. R_ARM_ABS32).
10466 This is enabled by default on targets (uClinux, SymbianOS) where the runtime
10467 loader imposes this restriction, and when @option{-fpic} or @option{-fPIC}
10468 is specified.
10470 @item -mfix-cortex-m3-ldrd
10471 @opindex mfix-cortex-m3-ldrd
10472 Some Cortex-M3 cores can cause data corruption when @code{ldrd} instructions
10473 with overlapping destination and base registers are used.  This option avoids
10474 generating these instructions.  This option is enabled by default when
10475 @option{-mcpu=cortex-m3} is specified.
10477 @end table
10479 @node AVR Options
10480 @subsection AVR Options
10481 @cindex AVR Options
10483 These options are defined for AVR implementations:
10485 @table @gcctabopt
10486 @item -mmcu=@var{mcu}
10487 @opindex mmcu
10488 Specify ATMEL AVR instruction set or MCU type.
10490 Instruction set avr1 is for the minimal AVR core, not supported by the C
10491 compiler, only for assembler programs (MCU types: at90s1200, attiny10,
10492 attiny11, attiny12, attiny15, attiny28).
10494 Instruction set avr2 (default) is for the classic AVR core with up to
10495 8K program memory space (MCU types: at90s2313, at90s2323, attiny22,
10496 at90s2333, at90s2343, at90s4414, at90s4433, at90s4434, at90s8515,
10497 at90c8534, at90s8535).
10499 Instruction set avr3 is for the classic AVR core with up to 128K program
10500 memory space (MCU types: atmega103, atmega603, at43usb320, at76c711).
10502 Instruction set avr4 is for the enhanced AVR core with up to 8K program
10503 memory space (MCU types: atmega8, atmega83, atmega85).
10505 Instruction set avr5 is for the enhanced AVR core with up to 128K program
10506 memory space (MCU types: atmega16, atmega161, atmega163, atmega32, atmega323,
10507 atmega64, atmega128, at43usb355, at94k).
10509 @item -mno-interrupts
10510 @opindex mno-interrupts
10511 Generated code is not compatible with hardware interrupts.
10512 Code size will be smaller.
10514 @item -mcall-prologues
10515 @opindex mcall-prologues
10516 Functions prologues/epilogues expanded as call to appropriate
10517 subroutines.  Code size will be smaller.
10519 @item -mtiny-stack
10520 @opindex mtiny-stack
10521 Change only the low 8 bits of the stack pointer.
10523 @item -mint8
10524 @opindex mint8
10525 Assume int to be 8 bit integer.  This affects the sizes of all types: A
10526 char will be 1 byte, an int will be 1 byte, a long will be 2 bytes
10527 and long long will be 4 bytes.  Please note that this option does not
10528 comply to the C standards, but it will provide you with smaller code
10529 size.
10530 @end table
10532 @node Blackfin Options
10533 @subsection Blackfin Options
10534 @cindex Blackfin Options
10536 @table @gcctabopt
10537 @item -mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]}
10538 @opindex mcpu=
10539 Specifies the name of the target Blackfin processor.  Currently, @var{cpu}
10540 can be one of @samp{bf512}, @samp{bf514}, @samp{bf516}, @samp{bf518},
10541 @samp{bf522}, @samp{bf523}, @samp{bf524}, @samp{bf525}, @samp{bf526},
10542 @samp{bf527}, @samp{bf531}, @samp{bf532}, @samp{bf533},
10543 @samp{bf534}, @samp{bf536}, @samp{bf537}, @samp{bf538}, @samp{bf539},
10544 @samp{bf542}, @samp{bf544}, @samp{bf547}, @samp{bf548}, @samp{bf549},
10545 @samp{bf542m}, @samp{bf544m}, @samp{bf547m}, @samp{bf548m}, @samp{bf549m},
10546 @samp{bf561}, @samp{bf592}.
10547 The optional @var{sirevision} specifies the silicon revision of the target
10548 Blackfin processor.  Any workarounds available for the targeted silicon revision
10549 will be enabled.  If @var{sirevision} is @samp{none}, no workarounds are enabled.
10550 If @var{sirevision} is @samp{any}, all workarounds for the targeted processor
10551 will be enabled.  The @code{__SILICON_REVISION__} macro is defined to two
10552 hexadecimal digits representing the major and minor numbers in the silicon
10553 revision.  If @var{sirevision} is @samp{none}, the @code{__SILICON_REVISION__}
10554 is not defined.  If @var{sirevision} is @samp{any}, the
10555 @code{__SILICON_REVISION__} is defined to be @code{0xffff}.
10556 If this optional @var{sirevision} is not used, GCC assumes the latest known
10557 silicon revision of the targeted Blackfin processor.
10559 Support for @samp{bf561} is incomplete.  For @samp{bf561},
10560 Only the processor macro is defined.
10561 Without this option, @samp{bf532} is used as the processor by default.
10562 The corresponding predefined processor macros for @var{cpu} is to
10563 be defined.  And for @samp{bfin-elf} toolchain, this causes the hardware BSP
10564 provided by libgloss to be linked in if @option{-msim} is not given.
10566 @item -msim
10567 @opindex msim
10568 Specifies that the program will be run on the simulator.  This causes
10569 the simulator BSP provided by libgloss to be linked in.  This option
10570 has effect only for @samp{bfin-elf} toolchain.
10571 Certain other options, such as @option{-mid-shared-library} and
10572 @option{-mfdpic}, imply @option{-msim}.
10574 @item -momit-leaf-frame-pointer
10575 @opindex momit-leaf-frame-pointer
10576 Don't keep the frame pointer in a register for leaf functions.  This
10577 avoids the instructions to save, set up and restore frame pointers and
10578 makes an extra register available in leaf functions.  The option
10579 @option{-fomit-frame-pointer} removes the frame pointer for all functions
10580 which might make debugging harder.
10582 @item -mspecld-anomaly
10583 @opindex mspecld-anomaly
10584 When enabled, the compiler will ensure that the generated code does not
10585 contain speculative loads after jump instructions. If this option is used,
10586 @code{__WORKAROUND_SPECULATIVE_LOADS} is defined.
10588 @item -mno-specld-anomaly
10589 @opindex mno-specld-anomaly
10590 Don't generate extra code to prevent speculative loads from occurring.
10592 @item -mcsync-anomaly
10593 @opindex mcsync-anomaly
10594 When enabled, the compiler will ensure that the generated code does not
10595 contain CSYNC or SSYNC instructions too soon after conditional branches.
10596 If this option is used, @code{__WORKAROUND_SPECULATIVE_SYNCS} is defined.
10598 @item -mno-csync-anomaly
10599 @opindex mno-csync-anomaly
10600 Don't generate extra code to prevent CSYNC or SSYNC instructions from
10601 occurring too soon after a conditional branch.
10603 @item -mlow-64k
10604 @opindex mlow-64k
10605 When enabled, the compiler is free to take advantage of the knowledge that
10606 the entire program fits into the low 64k of memory.
10608 @item -mno-low-64k
10609 @opindex mno-low-64k
10610 Assume that the program is arbitrarily large.  This is the default.
10612 @item -mstack-check-l1
10613 @opindex mstack-check-l1
10614 Do stack checking using information placed into L1 scratchpad memory by the
10615 uClinux kernel.
10617 @item -mid-shared-library
10618 @opindex mid-shared-library
10619 Generate code that supports shared libraries via the library ID method.
10620 This allows for execute in place and shared libraries in an environment
10621 without virtual memory management.  This option implies @option{-fPIC}.
10622 With a @samp{bfin-elf} target, this option implies @option{-msim}.
10624 @item -mno-id-shared-library
10625 @opindex mno-id-shared-library
10626 Generate code that doesn't assume ID based shared libraries are being used.
10627 This is the default.
10629 @item -mleaf-id-shared-library
10630 @opindex mleaf-id-shared-library
10631 Generate code that supports shared libraries via the library ID method,
10632 but assumes that this library or executable won't link against any other
10633 ID shared libraries.  That allows the compiler to use faster code for jumps
10634 and calls.
10636 @item -mno-leaf-id-shared-library
10637 @opindex mno-leaf-id-shared-library
10638 Do not assume that the code being compiled won't link against any ID shared
10639 libraries.  Slower code will be generated for jump and call insns.
10641 @item -mshared-library-id=n
10642 @opindex mshared-library-id
10643 Specified the identification number of the ID based shared library being
10644 compiled.  Specifying a value of 0 will generate more compact code, specifying
10645 other values will force the allocation of that number to the current
10646 library but is no more space or time efficient than omitting this option.
10648 @item -msep-data
10649 @opindex msep-data
10650 Generate code that allows the data segment to be located in a different
10651 area of memory from the text segment.  This allows for execute in place in
10652 an environment without virtual memory management by eliminating relocations
10653 against the text section.
10655 @item -mno-sep-data
10656 @opindex mno-sep-data
10657 Generate code that assumes that the data segment follows the text segment.
10658 This is the default.
10660 @item -mlong-calls
10661 @itemx -mno-long-calls
10662 @opindex mlong-calls
10663 @opindex mno-long-calls
10664 Tells the compiler to perform function calls by first loading the
10665 address of the function into a register and then performing a subroutine
10666 call on this register.  This switch is needed if the target function
10667 will lie outside of the 24 bit addressing range of the offset based
10668 version of subroutine call instruction.
10670 This feature is not enabled by default.  Specifying
10671 @option{-mno-long-calls} will restore the default behavior.  Note these
10672 switches have no effect on how the compiler generates code to handle
10673 function calls via function pointers.
10675 @item -mfast-fp
10676 @opindex mfast-fp
10677 Link with the fast floating-point library. This library relaxes some of
10678 the IEEE floating-point standard's rules for checking inputs against
10679 Not-a-Number (NAN), in the interest of performance.
10681 @item -minline-plt
10682 @opindex minline-plt
10683 Enable inlining of PLT entries in function calls to functions that are
10684 not known to bind locally.  It has no effect without @option{-mfdpic}.
10686 @item -mmulticore
10687 @opindex mmulticore
10688 Build standalone application for multicore Blackfin processor. Proper
10689 start files and link scripts will be used to support multicore.
10690 This option defines @code{__BFIN_MULTICORE}. It can only be used with
10691 @option{-mcpu=bf561@r{[}-@var{sirevision}@r{]}}. It can be used with
10692 @option{-mcorea} or @option{-mcoreb}. If it's used without
10693 @option{-mcorea} or @option{-mcoreb}, single application/dual core
10694 programming model is used. In this model, the main function of Core B
10695 should be named as coreb_main. If it's used with @option{-mcorea} or
10696 @option{-mcoreb}, one application per core programming model is used.
10697 If this option is not used, single core application programming
10698 model is used.
10700 @item -mcorea
10701 @opindex mcorea
10702 Build standalone application for Core A of BF561 when using
10703 one application per core programming model. Proper start files
10704 and link scripts will be used to support Core A. This option
10705 defines @code{__BFIN_COREA}. It must be used with @option{-mmulticore}.
10707 @item -mcoreb
10708 @opindex mcoreb
10709 Build standalone application for Core B of BF561 when using
10710 one application per core programming model. Proper start files
10711 and link scripts will be used to support Core B. This option
10712 defines @code{__BFIN_COREB}. When this option is used, coreb_main
10713 should be used instead of main. It must be used with
10714 @option{-mmulticore}.
10716 @item -msdram
10717 @opindex msdram
10718 Build standalone application for SDRAM. Proper start files and
10719 link scripts will be used to put the application into SDRAM.
10720 Loader should initialize SDRAM before loading the application
10721 into SDRAM. This option defines @code{__BFIN_SDRAM}.
10723 @item -micplb
10724 @opindex micplb
10725 Assume that ICPLBs are enabled at runtime.  This has an effect on certain
10726 anomaly workarounds.  For Linux targets, the default is to assume ICPLBs
10727 are enabled; for standalone applications the default is off.
10728 @end table
10730 @node CRIS Options
10731 @subsection CRIS Options
10732 @cindex CRIS Options
10734 These options are defined specifically for the CRIS ports.
10736 @table @gcctabopt
10737 @item -march=@var{architecture-type}
10738 @itemx -mcpu=@var{architecture-type}
10739 @opindex march
10740 @opindex mcpu
10741 Generate code for the specified architecture.  The choices for
10742 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
10743 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
10744 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
10745 @samp{v10}.
10747 @item -mtune=@var{architecture-type}
10748 @opindex mtune
10749 Tune to @var{architecture-type} everything applicable about the generated
10750 code, except for the ABI and the set of available instructions.  The
10751 choices for @var{architecture-type} are the same as for
10752 @option{-march=@var{architecture-type}}.
10754 @item -mmax-stack-frame=@var{n}
10755 @opindex mmax-stack-frame
10756 Warn when the stack frame of a function exceeds @var{n} bytes.
10758 @item -metrax4
10759 @itemx -metrax100
10760 @opindex metrax4
10761 @opindex metrax100
10762 The options @option{-metrax4} and @option{-metrax100} are synonyms for
10763 @option{-march=v3} and @option{-march=v8} respectively.
10765 @item -mmul-bug-workaround
10766 @itemx -mno-mul-bug-workaround
10767 @opindex mmul-bug-workaround
10768 @opindex mno-mul-bug-workaround
10769 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
10770 models where it applies.  This option is active by default.
10772 @item -mpdebug
10773 @opindex mpdebug
10774 Enable CRIS-specific verbose debug-related information in the assembly
10775 code.  This option also has the effect to turn off the @samp{#NO_APP}
10776 formatted-code indicator to the assembler at the beginning of the
10777 assembly file.
10779 @item -mcc-init
10780 @opindex mcc-init
10781 Do not use condition-code results from previous instruction; always emit
10782 compare and test instructions before use of condition codes.
10784 @item -mno-side-effects
10785 @opindex mno-side-effects
10786 Do not emit instructions with side-effects in addressing modes other than
10787 post-increment.
10789 @item -mstack-align
10790 @itemx -mno-stack-align
10791 @itemx -mdata-align
10792 @itemx -mno-data-align
10793 @itemx -mconst-align
10794 @itemx -mno-const-align
10795 @opindex mstack-align
10796 @opindex mno-stack-align
10797 @opindex mdata-align
10798 @opindex mno-data-align
10799 @opindex mconst-align
10800 @opindex mno-const-align
10801 These options (no-options) arranges (eliminate arrangements) for the
10802 stack-frame, individual data and constants to be aligned for the maximum
10803 single data access size for the chosen CPU model.  The default is to
10804 arrange for 32-bit alignment.  ABI details such as structure layout are
10805 not affected by these options.
10807 @item -m32-bit
10808 @itemx -m16-bit
10809 @itemx -m8-bit
10810 @opindex m32-bit
10811 @opindex m16-bit
10812 @opindex m8-bit
10813 Similar to the stack- data- and const-align options above, these options
10814 arrange for stack-frame, writable data and constants to all be 32-bit,
10815 16-bit or 8-bit aligned.  The default is 32-bit alignment.
10817 @item -mno-prologue-epilogue
10818 @itemx -mprologue-epilogue
10819 @opindex mno-prologue-epilogue
10820 @opindex mprologue-epilogue
10821 With @option{-mno-prologue-epilogue}, the normal function prologue and
10822 epilogue that sets up the stack-frame are omitted and no return
10823 instructions or return sequences are generated in the code.  Use this
10824 option only together with visual inspection of the compiled code: no
10825 warnings or errors are generated when call-saved registers must be saved,
10826 or storage for local variable needs to be allocated.
10828 @item -mno-gotplt
10829 @itemx -mgotplt
10830 @opindex mno-gotplt
10831 @opindex mgotplt
10832 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
10833 instruction sequences that load addresses for functions from the PLT part
10834 of the GOT rather than (traditional on other architectures) calls to the
10835 PLT@.  The default is @option{-mgotplt}.
10837 @item -melf
10838 @opindex melf
10839 Legacy no-op option only recognized with the cris-axis-elf and
10840 cris-axis-linux-gnu targets.
10842 @item -mlinux
10843 @opindex mlinux
10844 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
10846 @item -sim
10847 @opindex sim
10848 This option, recognized for the cris-axis-elf arranges
10849 to link with input-output functions from a simulator library.  Code,
10850 initialized data and zero-initialized data are allocated consecutively.
10852 @item -sim2
10853 @opindex sim2
10854 Like @option{-sim}, but pass linker options to locate initialized data at
10855 0x40000000 and zero-initialized data at 0x80000000.
10856 @end table
10858 @node Darwin Options
10859 @subsection Darwin Options
10860 @cindex Darwin options
10862 These options are defined for all architectures running the Darwin operating
10863 system.
10865 FSF GCC on Darwin does not create ``fat'' object files; it will create
10866 an object file for the single architecture that it was built to
10867 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
10868 @option{-arch} options are used; it does so by running the compiler or
10869 linker multiple times and joining the results together with
10870 @file{lipo}.
10872 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
10873 @samp{i686}) is determined by the flags that specify the ISA
10874 that GCC is targetting, like @option{-mcpu} or @option{-march}.  The
10875 @option{-force_cpusubtype_ALL} option can be used to override this.
10877 The Darwin tools vary in their behavior when presented with an ISA
10878 mismatch.  The assembler, @file{as}, will only permit instructions to
10879 be used that are valid for the subtype of the file it is generating,
10880 so you cannot put 64-bit instructions in a @samp{ppc750} object file.
10881 The linker for shared libraries, @file{/usr/bin/libtool}, will fail
10882 and print an error if asked to create a shared library with a less
10883 restrictive subtype than its input files (for instance, trying to put
10884 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
10885 for executables, @file{ld}, will quietly give the executable the most
10886 restrictive subtype of any of its input files.
10888 @table @gcctabopt
10889 @item -F@var{dir}
10890 @opindex F
10891 Add the framework directory @var{dir} to the head of the list of
10892 directories to be searched for header files.  These directories are
10893 interleaved with those specified by @option{-I} options and are
10894 scanned in a left-to-right order.
10896 A framework directory is a directory with frameworks in it.  A
10897 framework is a directory with a @samp{"Headers"} and/or
10898 @samp{"PrivateHeaders"} directory contained directly in it that ends
10899 in @samp{".framework"}.  The name of a framework is the name of this
10900 directory excluding the @samp{".framework"}.  Headers associated with
10901 the framework are found in one of those two directories, with
10902 @samp{"Headers"} being searched first.  A subframework is a framework
10903 directory that is in a framework's @samp{"Frameworks"} directory.
10904 Includes of subframework headers can only appear in a header of a
10905 framework that contains the subframework, or in a sibling subframework
10906 header.  Two subframeworks are siblings if they occur in the same
10907 framework.  A subframework should not have the same name as a
10908 framework, a warning will be issued if this is violated.  Currently a
10909 subframework cannot have subframeworks, in the future, the mechanism
10910 may be extended to support this.  The standard frameworks can be found
10911 in @samp{"/System/Library/Frameworks"} and
10912 @samp{"/Library/Frameworks"}.  An example include looks like
10913 @code{#include <Framework/header.h>}, where @samp{Framework} denotes
10914 the name of the framework and header.h is found in the
10915 @samp{"PrivateHeaders"} or @samp{"Headers"} directory.
10917 @item -iframework@var{dir}
10918 @opindex iframework
10919 Like @option{-F} except the directory is a treated as a system
10920 directory.  The main difference between this @option{-iframework} and
10921 @option{-F} is that with @option{-iframework} the compiler does not
10922 warn about constructs contained within header files found via
10923 @var{dir}.  This option is valid only for the C family of languages.
10925 @item -gused
10926 @opindex gused
10927 Emit debugging information for symbols that are used.  For STABS
10928 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
10929 This is by default ON@.
10931 @item -gfull
10932 @opindex gfull
10933 Emit debugging information for all symbols and types.
10935 @item -mmacosx-version-min=@var{version}
10936 The earliest version of MacOS X that this executable will run on
10937 is @var{version}.  Typical values of @var{version} include @code{10.1},
10938 @code{10.2}, and @code{10.3.9}.
10940 If the compiler was built to use the system's headers by default,
10941 then the default for this option is the system version on which the
10942 compiler is running, otherwise the default is to make choices which
10943 are compatible with as many systems and code bases as possible.
10945 @item -mkernel
10946 @opindex mkernel
10947 Enable kernel development mode.  The @option{-mkernel} option sets
10948 @option{-static}, @option{-fno-common}, @option{-fno-cxa-atexit},
10949 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
10950 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
10951 applicable.  This mode also sets @option{-mno-altivec},
10952 @option{-msoft-float}, @option{-fno-builtin} and
10953 @option{-mlong-branch} for PowerPC targets.
10955 @item -mone-byte-bool
10956 @opindex mone-byte-bool
10957 Override the defaults for @samp{bool} so that @samp{sizeof(bool)==1}.
10958 By default @samp{sizeof(bool)} is @samp{4} when compiling for
10959 Darwin/PowerPC and @samp{1} when compiling for Darwin/x86, so this
10960 option has no effect on x86.
10962 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
10963 to generate code that is not binary compatible with code generated
10964 without that switch.  Using this switch may require recompiling all
10965 other modules in a program, including system libraries.  Use this
10966 switch to conform to a non-default data model.
10968 @item -mfix-and-continue
10969 @itemx -ffix-and-continue
10970 @itemx -findirect-data
10971 @opindex mfix-and-continue
10972 @opindex ffix-and-continue
10973 @opindex findirect-data
10974 Generate code suitable for fast turn around development.  Needed to
10975 enable gdb to dynamically load @code{.o} files into already running
10976 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
10977 are provided for backwards compatibility.
10979 @item -all_load
10980 @opindex all_load
10981 Loads all members of static archive libraries.
10982 See man ld(1) for more information.
10984 @item -arch_errors_fatal
10985 @opindex arch_errors_fatal
10986 Cause the errors having to do with files that have the wrong architecture
10987 to be fatal.
10989 @item -bind_at_load
10990 @opindex bind_at_load
10991 Causes the output file to be marked such that the dynamic linker will
10992 bind all undefined references when the file is loaded or launched.
10994 @item -bundle
10995 @opindex bundle
10996 Produce a Mach-o bundle format file.
10997 See man ld(1) for more information.
10999 @item -bundle_loader @var{executable}
11000 @opindex bundle_loader
11001 This option specifies the @var{executable} that will be loading the build
11002 output file being linked.  See man ld(1) for more information.
11004 @item -dynamiclib
11005 @opindex dynamiclib
11006 When passed this option, GCC will produce a dynamic library instead of
11007 an executable when linking, using the Darwin @file{libtool} command.
11009 @item -force_cpusubtype_ALL
11010 @opindex force_cpusubtype_ALL
11011 This causes GCC's output file to have the @var{ALL} subtype, instead of
11012 one controlled by the @option{-mcpu} or @option{-march} option.
11014 @item -allowable_client  @var{client_name}
11015 @itemx -client_name
11016 @itemx -compatibility_version
11017 @itemx -current_version
11018 @itemx -dead_strip
11019 @itemx -dependency-file
11020 @itemx -dylib_file
11021 @itemx -dylinker_install_name
11022 @itemx -dynamic
11023 @itemx -exported_symbols_list
11024 @itemx -filelist
11025 @need 800
11026 @itemx -flat_namespace
11027 @itemx -force_flat_namespace
11028 @itemx -headerpad_max_install_names
11029 @itemx -image_base
11030 @itemx -init
11031 @itemx -install_name
11032 @itemx -keep_private_externs
11033 @itemx -multi_module
11034 @itemx -multiply_defined
11035 @itemx -multiply_defined_unused
11036 @need 800
11037 @itemx -noall_load
11038 @itemx -no_dead_strip_inits_and_terms
11039 @itemx -nofixprebinding
11040 @itemx -nomultidefs
11041 @itemx -noprebind
11042 @itemx -noseglinkedit
11043 @itemx -pagezero_size
11044 @itemx -prebind
11045 @itemx -prebind_all_twolevel_modules
11046 @itemx -private_bundle
11047 @need 800
11048 @itemx -read_only_relocs
11049 @itemx -sectalign
11050 @itemx -sectobjectsymbols
11051 @itemx -whyload
11052 @itemx -seg1addr
11053 @itemx -sectcreate
11054 @itemx -sectobjectsymbols
11055 @itemx -sectorder
11056 @itemx -segaddr
11057 @itemx -segs_read_only_addr
11058 @need 800
11059 @itemx -segs_read_write_addr
11060 @itemx -seg_addr_table
11061 @itemx -seg_addr_table_filename
11062 @itemx -seglinkedit
11063 @itemx -segprot
11064 @itemx -segs_read_only_addr
11065 @itemx -segs_read_write_addr
11066 @itemx -single_module
11067 @itemx -static
11068 @itemx -sub_library
11069 @need 800
11070 @itemx -sub_umbrella
11071 @itemx -twolevel_namespace
11072 @itemx -umbrella
11073 @itemx -undefined
11074 @itemx -unexported_symbols_list
11075 @itemx -weak_reference_mismatches
11076 @itemx -whatsloaded
11077 @opindex allowable_client
11078 @opindex client_name
11079 @opindex compatibility_version
11080 @opindex current_version
11081 @opindex dead_strip
11082 @opindex dependency-file
11083 @opindex dylib_file
11084 @opindex dylinker_install_name
11085 @opindex dynamic
11086 @opindex exported_symbols_list
11087 @opindex filelist
11088 @opindex flat_namespace
11089 @opindex force_flat_namespace
11090 @opindex headerpad_max_install_names
11091 @opindex image_base
11092 @opindex init
11093 @opindex install_name
11094 @opindex keep_private_externs
11095 @opindex multi_module
11096 @opindex multiply_defined
11097 @opindex multiply_defined_unused
11098 @opindex noall_load
11099 @opindex no_dead_strip_inits_and_terms
11100 @opindex nofixprebinding
11101 @opindex nomultidefs
11102 @opindex noprebind
11103 @opindex noseglinkedit
11104 @opindex pagezero_size
11105 @opindex prebind
11106 @opindex prebind_all_twolevel_modules
11107 @opindex private_bundle
11108 @opindex read_only_relocs
11109 @opindex sectalign
11110 @opindex sectobjectsymbols
11111 @opindex whyload
11112 @opindex seg1addr
11113 @opindex sectcreate
11114 @opindex sectobjectsymbols
11115 @opindex sectorder
11116 @opindex segaddr
11117 @opindex segs_read_only_addr
11118 @opindex segs_read_write_addr
11119 @opindex seg_addr_table
11120 @opindex seg_addr_table_filename
11121 @opindex seglinkedit
11122 @opindex segprot
11123 @opindex segs_read_only_addr
11124 @opindex segs_read_write_addr
11125 @opindex single_module
11126 @opindex static
11127 @opindex sub_library
11128 @opindex sub_umbrella
11129 @opindex twolevel_namespace
11130 @opindex umbrella
11131 @opindex undefined
11132 @opindex unexported_symbols_list
11133 @opindex weak_reference_mismatches
11134 @opindex whatsloaded
11135 These options are passed to the Darwin linker.  The Darwin linker man page
11136 describes them in detail.
11137 @end table
11139 @node DEC Alpha Options
11140 @subsection DEC Alpha Options
11142 These @samp{-m} options are defined for the DEC Alpha implementations:
11144 @table @gcctabopt
11145 @item -mno-soft-float
11146 @itemx -msoft-float
11147 @opindex mno-soft-float
11148 @opindex msoft-float
11149 Use (do not use) the hardware floating-point instructions for
11150 floating-point operations.  When @option{-msoft-float} is specified,
11151 functions in @file{libgcc.a} will be used to perform floating-point
11152 operations.  Unless they are replaced by routines that emulate the
11153 floating-point operations, or compiled in such a way as to call such
11154 emulations routines, these routines will issue floating-point
11155 operations.   If you are compiling for an Alpha without floating-point
11156 operations, you must ensure that the library is built so as not to call
11157 them.
11159 Note that Alpha implementations without floating-point operations are
11160 required to have floating-point registers.
11162 @item -mfp-reg
11163 @itemx -mno-fp-regs
11164 @opindex mfp-reg
11165 @opindex mno-fp-regs
11166 Generate code that uses (does not use) the floating-point register set.
11167 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
11168 register set is not used, floating point operands are passed in integer
11169 registers as if they were integers and floating-point results are passed
11170 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
11171 so any function with a floating-point argument or return value called by code
11172 compiled with @option{-mno-fp-regs} must also be compiled with that
11173 option.
11175 A typical use of this option is building a kernel that does not use,
11176 and hence need not save and restore, any floating-point registers.
11178 @item -mieee
11179 @opindex mieee
11180 The Alpha architecture implements floating-point hardware optimized for
11181 maximum performance.  It is mostly compliant with the IEEE floating
11182 point standard.  However, for full compliance, software assistance is
11183 required.  This option generates code fully IEEE compliant code
11184 @emph{except} that the @var{inexact-flag} is not maintained (see below).
11185 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
11186 defined during compilation.  The resulting code is less efficient but is
11187 able to correctly support denormalized numbers and exceptional IEEE
11188 values such as not-a-number and plus/minus infinity.  Other Alpha
11189 compilers call this option @option{-ieee_with_no_inexact}.
11191 @item -mieee-with-inexact
11192 @opindex mieee-with-inexact
11193 This is like @option{-mieee} except the generated code also maintains
11194 the IEEE @var{inexact-flag}.  Turning on this option causes the
11195 generated code to implement fully-compliant IEEE math.  In addition to
11196 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
11197 macro.  On some Alpha implementations the resulting code may execute
11198 significantly slower than the code generated by default.  Since there is
11199 very little code that depends on the @var{inexact-flag}, you should
11200 normally not specify this option.  Other Alpha compilers call this
11201 option @option{-ieee_with_inexact}.
11203 @item -mfp-trap-mode=@var{trap-mode}
11204 @opindex mfp-trap-mode
11205 This option controls what floating-point related traps are enabled.
11206 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
11207 The trap mode can be set to one of four values:
11209 @table @samp
11210 @item n
11211 This is the default (normal) setting.  The only traps that are enabled
11212 are the ones that cannot be disabled in software (e.g., division by zero
11213 trap).
11215 @item u
11216 In addition to the traps enabled by @samp{n}, underflow traps are enabled
11217 as well.
11219 @item su
11220 Like @samp{u}, but the instructions are marked to be safe for software
11221 completion (see Alpha architecture manual for details).
11223 @item sui
11224 Like @samp{su}, but inexact traps are enabled as well.
11225 @end table
11227 @item -mfp-rounding-mode=@var{rounding-mode}
11228 @opindex mfp-rounding-mode
11229 Selects the IEEE rounding mode.  Other Alpha compilers call this option
11230 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
11233 @table @samp
11234 @item n
11235 Normal IEEE rounding mode.  Floating point numbers are rounded towards
11236 the nearest machine number or towards the even machine number in case
11237 of a tie.
11239 @item m
11240 Round towards minus infinity.
11242 @item c
11243 Chopped rounding mode.  Floating point numbers are rounded towards zero.
11245 @item d
11246 Dynamic rounding mode.  A field in the floating point control register
11247 (@var{fpcr}, see Alpha architecture reference manual) controls the
11248 rounding mode in effect.  The C library initializes this register for
11249 rounding towards plus infinity.  Thus, unless your program modifies the
11250 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
11251 @end table
11253 @item -mtrap-precision=@var{trap-precision}
11254 @opindex mtrap-precision
11255 In the Alpha architecture, floating point traps are imprecise.  This
11256 means without software assistance it is impossible to recover from a
11257 floating trap and program execution normally needs to be terminated.
11258 GCC can generate code that can assist operating system trap handlers
11259 in determining the exact location that caused a floating point trap.
11260 Depending on the requirements of an application, different levels of
11261 precisions can be selected:
11263 @table @samp
11264 @item p
11265 Program precision.  This option is the default and means a trap handler
11266 can only identify which program caused a floating point exception.
11268 @item f
11269 Function precision.  The trap handler can determine the function that
11270 caused a floating point exception.
11272 @item i
11273 Instruction precision.  The trap handler can determine the exact
11274 instruction that caused a floating point exception.
11275 @end table
11277 Other Alpha compilers provide the equivalent options called
11278 @option{-scope_safe} and @option{-resumption_safe}.
11280 @item -mieee-conformant
11281 @opindex mieee-conformant
11282 This option marks the generated code as IEEE conformant.  You must not
11283 use this option unless you also specify @option{-mtrap-precision=i} and either
11284 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
11285 is to emit the line @samp{.eflag 48} in the function prologue of the
11286 generated assembly file.  Under DEC Unix, this has the effect that
11287 IEEE-conformant math library routines will be linked in.
11289 @item -mbuild-constants
11290 @opindex mbuild-constants
11291 Normally GCC examines a 32- or 64-bit integer constant to
11292 see if it can construct it from smaller constants in two or three
11293 instructions.  If it cannot, it will output the constant as a literal and
11294 generate code to load it from the data segment at runtime.
11296 Use this option to require GCC to construct @emph{all} integer constants
11297 using code, even if it takes more instructions (the maximum is six).
11299 You would typically use this option to build a shared library dynamic
11300 loader.  Itself a shared library, it must relocate itself in memory
11301 before it can find the variables and constants in its own data segment.
11303 @item -malpha-as
11304 @itemx -mgas
11305 @opindex malpha-as
11306 @opindex mgas
11307 Select whether to generate code to be assembled by the vendor-supplied
11308 assembler (@option{-malpha-as}) or by the GNU assembler @option{-mgas}.
11310 @item -mbwx
11311 @itemx -mno-bwx
11312 @itemx -mcix
11313 @itemx -mno-cix
11314 @itemx -mfix
11315 @itemx -mno-fix
11316 @itemx -mmax
11317 @itemx -mno-max
11318 @opindex mbwx
11319 @opindex mno-bwx
11320 @opindex mcix
11321 @opindex mno-cix
11322 @opindex mfix
11323 @opindex mno-fix
11324 @opindex mmax
11325 @opindex mno-max
11326 Indicate whether GCC should generate code to use the optional BWX,
11327 CIX, FIX and MAX instruction sets.  The default is to use the instruction
11328 sets supported by the CPU type specified via @option{-mcpu=} option or that
11329 of the CPU on which GCC was built if none was specified.
11331 @item -mfloat-vax
11332 @itemx -mfloat-ieee
11333 @opindex mfloat-vax
11334 @opindex mfloat-ieee
11335 Generate code that uses (does not use) VAX F and G floating point
11336 arithmetic instead of IEEE single and double precision.
11338 @item -mexplicit-relocs
11339 @itemx -mno-explicit-relocs
11340 @opindex mexplicit-relocs
11341 @opindex mno-explicit-relocs
11342 Older Alpha assemblers provided no way to generate symbol relocations
11343 except via assembler macros.  Use of these macros does not allow
11344 optimal instruction scheduling.  GNU binutils as of version 2.12
11345 supports a new syntax that allows the compiler to explicitly mark
11346 which relocations should apply to which instructions.  This option
11347 is mostly useful for debugging, as GCC detects the capabilities of
11348 the assembler when it is built and sets the default accordingly.
11350 @item -msmall-data
11351 @itemx -mlarge-data
11352 @opindex msmall-data
11353 @opindex mlarge-data
11354 When @option{-mexplicit-relocs} is in effect, static data is
11355 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
11356 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
11357 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
11358 16-bit relocations off of the @code{$gp} register.  This limits the
11359 size of the small data area to 64KB, but allows the variables to be
11360 directly accessed via a single instruction.
11362 The default is @option{-mlarge-data}.  With this option the data area
11363 is limited to just below 2GB@.  Programs that require more than 2GB of
11364 data must use @code{malloc} or @code{mmap} to allocate the data in the
11365 heap instead of in the program's data segment.
11367 When generating code for shared libraries, @option{-fpic} implies
11368 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
11370 @item -msmall-text
11371 @itemx -mlarge-text
11372 @opindex msmall-text
11373 @opindex mlarge-text
11374 When @option{-msmall-text} is used, the compiler assumes that the
11375 code of the entire program (or shared library) fits in 4MB, and is
11376 thus reachable with a branch instruction.  When @option{-msmall-data}
11377 is used, the compiler can assume that all local symbols share the
11378 same @code{$gp} value, and thus reduce the number of instructions
11379 required for a function call from 4 to 1.
11381 The default is @option{-mlarge-text}.
11383 @item -mcpu=@var{cpu_type}
11384 @opindex mcpu
11385 Set the instruction set and instruction scheduling parameters for
11386 machine type @var{cpu_type}.  You can specify either the @samp{EV}
11387 style name or the corresponding chip number.  GCC supports scheduling
11388 parameters for the EV4, EV5 and EV6 family of processors and will
11389 choose the default values for the instruction set from the processor
11390 you specify.  If you do not specify a processor type, GCC will default
11391 to the processor on which the compiler was built.
11393 Supported values for @var{cpu_type} are
11395 @table @samp
11396 @item ev4
11397 @itemx ev45
11398 @itemx 21064
11399 Schedules as an EV4 and has no instruction set extensions.
11401 @item ev5
11402 @itemx 21164
11403 Schedules as an EV5 and has no instruction set extensions.
11405 @item ev56
11406 @itemx 21164a
11407 Schedules as an EV5 and supports the BWX extension.
11409 @item pca56
11410 @itemx 21164pc
11411 @itemx 21164PC
11412 Schedules as an EV5 and supports the BWX and MAX extensions.
11414 @item ev6
11415 @itemx 21264
11416 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
11418 @item ev67
11419 @itemx 21264a
11420 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
11421 @end table
11423 Native Linux/GNU toolchains also support the value @samp{native},
11424 which selects the best architecture option for the host processor.
11425 @option{-mcpu=native} has no effect if GCC does not recognize
11426 the processor.
11428 @item -mtune=@var{cpu_type}
11429 @opindex mtune
11430 Set only the instruction scheduling parameters for machine type
11431 @var{cpu_type}.  The instruction set is not changed.
11433 Native Linux/GNU toolchains also support the value @samp{native},
11434 which selects the best architecture option for the host processor.
11435 @option{-mtune=native} has no effect if GCC does not recognize
11436 the processor.
11438 @item -mmemory-latency=@var{time}
11439 @opindex mmemory-latency
11440 Sets the latency the scheduler should assume for typical memory
11441 references as seen by the application.  This number is highly
11442 dependent on the memory access patterns used by the application
11443 and the size of the external cache on the machine.
11445 Valid options for @var{time} are
11447 @table @samp
11448 @item @var{number}
11449 A decimal number representing clock cycles.
11451 @item L1
11452 @itemx L2
11453 @itemx L3
11454 @itemx main
11455 The compiler contains estimates of the number of clock cycles for
11456 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
11457 (also called Dcache, Scache, and Bcache), as well as to main memory.
11458 Note that L3 is only valid for EV5.
11460 @end table
11461 @end table
11463 @node DEC Alpha/VMS Options
11464 @subsection DEC Alpha/VMS Options
11466 These @samp{-m} options are defined for the DEC Alpha/VMS implementations:
11468 @table @gcctabopt
11469 @item -mvms-return-codes
11470 @opindex mvms-return-codes
11471 Return VMS condition codes from main.  The default is to return POSIX
11472 style condition (e.g.@: error) codes.
11474 @item -mdebug-main=@var{prefix}
11475 @opindex mdebug-main=@var{prefix}
11476 Flag the first routine whose name starts with @var{prefix} as the main
11477 routine for the debugger.
11479 @item -mmalloc64
11480 @opindex mmalloc64
11481 Default to 64bit memory allocation routines.
11482 @end table
11484 @node FR30 Options
11485 @subsection FR30 Options
11486 @cindex FR30 Options
11488 These options are defined specifically for the FR30 port.
11490 @table @gcctabopt
11492 @item -msmall-model
11493 @opindex msmall-model
11494 Use the small address space model.  This can produce smaller code, but
11495 it does assume that all symbolic values and addresses will fit into a
11496 20-bit range.
11498 @item -mno-lsim
11499 @opindex mno-lsim
11500 Assume that run-time support has been provided and so there is no need
11501 to include the simulator library (@file{libsim.a}) on the linker
11502 command line.
11504 @end table
11506 @node FRV Options
11507 @subsection FRV Options
11508 @cindex FRV Options
11510 @table @gcctabopt
11511 @item -mgpr-32
11512 @opindex mgpr-32
11514 Only use the first 32 general purpose registers.
11516 @item -mgpr-64
11517 @opindex mgpr-64
11519 Use all 64 general purpose registers.
11521 @item -mfpr-32
11522 @opindex mfpr-32
11524 Use only the first 32 floating point registers.
11526 @item -mfpr-64
11527 @opindex mfpr-64
11529 Use all 64 floating point registers
11531 @item -mhard-float
11532 @opindex mhard-float
11534 Use hardware instructions for floating point operations.
11536 @item -msoft-float
11537 @opindex msoft-float
11539 Use library routines for floating point operations.
11541 @item -malloc-cc
11542 @opindex malloc-cc
11544 Dynamically allocate condition code registers.
11546 @item -mfixed-cc
11547 @opindex mfixed-cc
11549 Do not try to dynamically allocate condition code registers, only
11550 use @code{icc0} and @code{fcc0}.
11552 @item -mdword
11553 @opindex mdword
11555 Change ABI to use double word insns.
11557 @item -mno-dword
11558 @opindex mno-dword
11560 Do not use double word instructions.
11562 @item -mdouble
11563 @opindex mdouble
11565 Use floating point double instructions.
11567 @item -mno-double
11568 @opindex mno-double
11570 Do not use floating point double instructions.
11572 @item -mmedia
11573 @opindex mmedia
11575 Use media instructions.
11577 @item -mno-media
11578 @opindex mno-media
11580 Do not use media instructions.
11582 @item -mmuladd
11583 @opindex mmuladd
11585 Use multiply and add/subtract instructions.
11587 @item -mno-muladd
11588 @opindex mno-muladd
11590 Do not use multiply and add/subtract instructions.
11592 @item -mfdpic
11593 @opindex mfdpic
11595 Select the FDPIC ABI, that uses function descriptors to represent
11596 pointers to functions.  Without any PIC/PIE-related options, it
11597 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
11598 assumes GOT entries and small data are within a 12-bit range from the
11599 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
11600 are computed with 32 bits.
11601 With a @samp{bfin-elf} target, this option implies @option{-msim}.
11603 @item -minline-plt
11604 @opindex minline-plt
11606 Enable inlining of PLT entries in function calls to functions that are
11607 not known to bind locally.  It has no effect without @option{-mfdpic}.
11608 It's enabled by default if optimizing for speed and compiling for
11609 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
11610 optimization option such as @option{-O3} or above is present in the
11611 command line.
11613 @item -mTLS
11614 @opindex mTLS
11616 Assume a large TLS segment when generating thread-local code.
11618 @item -mtls
11619 @opindex mtls
11621 Do not assume a large TLS segment when generating thread-local code.
11623 @item -mgprel-ro
11624 @opindex mgprel-ro
11626 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
11627 that is known to be in read-only sections.  It's enabled by default,
11628 except for @option{-fpic} or @option{-fpie}: even though it may help
11629 make the global offset table smaller, it trades 1 instruction for 4.
11630 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
11631 one of which may be shared by multiple symbols, and it avoids the need
11632 for a GOT entry for the referenced symbol, so it's more likely to be a
11633 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
11635 @item -multilib-library-pic
11636 @opindex multilib-library-pic
11638 Link with the (library, not FD) pic libraries.  It's implied by
11639 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
11640 @option{-fpic} without @option{-mfdpic}.  You should never have to use
11641 it explicitly.
11643 @item -mlinked-fp
11644 @opindex mlinked-fp
11646 Follow the EABI requirement of always creating a frame pointer whenever
11647 a stack frame is allocated.  This option is enabled by default and can
11648 be disabled with @option{-mno-linked-fp}.
11650 @item -mlong-calls
11651 @opindex mlong-calls
11653 Use indirect addressing to call functions outside the current
11654 compilation unit.  This allows the functions to be placed anywhere
11655 within the 32-bit address space.
11657 @item -malign-labels
11658 @opindex malign-labels
11660 Try to align labels to an 8-byte boundary by inserting nops into the
11661 previous packet.  This option only has an effect when VLIW packing
11662 is enabled.  It doesn't create new packets; it merely adds nops to
11663 existing ones.
11665 @item -mlibrary-pic
11666 @opindex mlibrary-pic
11668 Generate position-independent EABI code.
11670 @item -macc-4
11671 @opindex macc-4
11673 Use only the first four media accumulator registers.
11675 @item -macc-8
11676 @opindex macc-8
11678 Use all eight media accumulator registers.
11680 @item -mpack
11681 @opindex mpack
11683 Pack VLIW instructions.
11685 @item -mno-pack
11686 @opindex mno-pack
11688 Do not pack VLIW instructions.
11690 @item -mno-eflags
11691 @opindex mno-eflags
11693 Do not mark ABI switches in e_flags.
11695 @item -mcond-move
11696 @opindex mcond-move
11698 Enable the use of conditional-move instructions (default).
11700 This switch is mainly for debugging the compiler and will likely be removed
11701 in a future version.
11703 @item -mno-cond-move
11704 @opindex mno-cond-move
11706 Disable the use of conditional-move instructions.
11708 This switch is mainly for debugging the compiler and will likely be removed
11709 in a future version.
11711 @item -mscc
11712 @opindex mscc
11714 Enable the use of conditional set instructions (default).
11716 This switch is mainly for debugging the compiler and will likely be removed
11717 in a future version.
11719 @item -mno-scc
11720 @opindex mno-scc
11722 Disable the use of conditional set instructions.
11724 This switch is mainly for debugging the compiler and will likely be removed
11725 in a future version.
11727 @item -mcond-exec
11728 @opindex mcond-exec
11730 Enable the use of conditional execution (default).
11732 This switch is mainly for debugging the compiler and will likely be removed
11733 in a future version.
11735 @item -mno-cond-exec
11736 @opindex mno-cond-exec
11738 Disable the use of conditional execution.
11740 This switch is mainly for debugging the compiler and will likely be removed
11741 in a future version.
11743 @item -mvliw-branch
11744 @opindex mvliw-branch
11746 Run a pass to pack branches into VLIW instructions (default).
11748 This switch is mainly for debugging the compiler and will likely be removed
11749 in a future version.
11751 @item -mno-vliw-branch
11752 @opindex mno-vliw-branch
11754 Do not run a pass to pack branches into VLIW instructions.
11756 This switch is mainly for debugging the compiler and will likely be removed
11757 in a future version.
11759 @item -mmulti-cond-exec
11760 @opindex mmulti-cond-exec
11762 Enable optimization of @code{&&} and @code{||} in conditional execution
11763 (default).
11765 This switch is mainly for debugging the compiler and will likely be removed
11766 in a future version.
11768 @item -mno-multi-cond-exec
11769 @opindex mno-multi-cond-exec
11771 Disable optimization of @code{&&} and @code{||} in conditional execution.
11773 This switch is mainly for debugging the compiler and will likely be removed
11774 in a future version.
11776 @item -mnested-cond-exec
11777 @opindex mnested-cond-exec
11779 Enable nested conditional execution optimizations (default).
11781 This switch is mainly for debugging the compiler and will likely be removed
11782 in a future version.
11784 @item -mno-nested-cond-exec
11785 @opindex mno-nested-cond-exec
11787 Disable nested conditional execution optimizations.
11789 This switch is mainly for debugging the compiler and will likely be removed
11790 in a future version.
11792 @item -moptimize-membar
11793 @opindex moptimize-membar
11795 This switch removes redundant @code{membar} instructions from the
11796 compiler generated code.  It is enabled by default.
11798 @item -mno-optimize-membar
11799 @opindex mno-optimize-membar
11801 This switch disables the automatic removal of redundant @code{membar}
11802 instructions from the generated code.
11804 @item -mtomcat-stats
11805 @opindex mtomcat-stats
11807 Cause gas to print out tomcat statistics.
11809 @item -mcpu=@var{cpu}
11810 @opindex mcpu
11812 Select the processor type for which to generate code.  Possible values are
11813 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
11814 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
11816 @end table
11818 @node GNU/Linux Options
11819 @subsection GNU/Linux Options
11821 These @samp{-m} options are defined for GNU/Linux targets:
11823 @table @gcctabopt
11824 @item -mglibc
11825 @opindex mglibc
11826 Use the GNU C library.  This is the default except
11827 on @samp{*-*-linux-*uclibc*} and @samp{*-*-linux-*android*} targets.
11829 @item -muclibc
11830 @opindex muclibc
11831 Use uClibc C library.  This is the default on
11832 @samp{*-*-linux-*uclibc*} targets.
11834 @item -mbionic
11835 @opindex mbionic
11836 Use Bionic C library.  This is the default on
11837 @samp{*-*-linux-*android*} targets.
11839 @item -mandroid
11840 @opindex mandroid
11841 Compile code compatible with Android platform.  This is the default on
11842 @samp{*-*-linux-*android*} targets.
11844 When compiling, this option enables @option{-mbionic}, @option{-fPIC},
11845 @option{-fno-exceptions} and @option{-fno-rtti} by default.  When linking,
11846 this option makes the GCC driver pass Android-specific options to the linker.
11847 Finally, this option causes the preprocessor macro @code{__ANDROID__}
11848 to be defined.
11850 @item -tno-android-cc
11851 @opindex tno-android-cc
11852 Disable compilation effects of @option{-mandroid}, i.e., do not enable
11853 @option{-mbionic}, @option{-fPIC}, @option{-fno-exceptions} and
11854 @option{-fno-rtti} by default.
11856 @item -tno-android-ld
11857 @opindex tno-android-ld
11858 Disable linking effects of @option{-mandroid}, i.e., pass standard Linux
11859 linking options to the linker.
11861 @end table
11863 @node H8/300 Options
11864 @subsection H8/300 Options
11866 These @samp{-m} options are defined for the H8/300 implementations:
11868 @table @gcctabopt
11869 @item -mrelax
11870 @opindex mrelax
11871 Shorten some address references at link time, when possible; uses the
11872 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
11873 ld, Using ld}, for a fuller description.
11875 @item -mh
11876 @opindex mh
11877 Generate code for the H8/300H@.
11879 @item -ms
11880 @opindex ms
11881 Generate code for the H8S@.
11883 @item -mn
11884 @opindex mn
11885 Generate code for the H8S and H8/300H in the normal mode.  This switch
11886 must be used either with @option{-mh} or @option{-ms}.
11888 @item -ms2600
11889 @opindex ms2600
11890 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
11892 @item -mint32
11893 @opindex mint32
11894 Make @code{int} data 32 bits by default.
11896 @item -malign-300
11897 @opindex malign-300
11898 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
11899 The default for the H8/300H and H8S is to align longs and floats on 4
11900 byte boundaries.
11901 @option{-malign-300} causes them to be aligned on 2 byte boundaries.
11902 This option has no effect on the H8/300.
11903 @end table
11905 @node HPPA Options
11906 @subsection HPPA Options
11907 @cindex HPPA Options
11909 These @samp{-m} options are defined for the HPPA family of computers:
11911 @table @gcctabopt
11912 @item -march=@var{architecture-type}
11913 @opindex march
11914 Generate code for the specified architecture.  The choices for
11915 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
11916 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
11917 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
11918 architecture option for your machine.  Code compiled for lower numbered
11919 architectures will run on higher numbered architectures, but not the
11920 other way around.
11922 @item -mpa-risc-1-0
11923 @itemx -mpa-risc-1-1
11924 @itemx -mpa-risc-2-0
11925 @opindex mpa-risc-1-0
11926 @opindex mpa-risc-1-1
11927 @opindex mpa-risc-2-0
11928 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
11930 @item -mbig-switch
11931 @opindex mbig-switch
11932 Generate code suitable for big switch tables.  Use this option only if
11933 the assembler/linker complain about out of range branches within a switch
11934 table.
11936 @item -mjump-in-delay
11937 @opindex mjump-in-delay
11938 Fill delay slots of function calls with unconditional jump instructions
11939 by modifying the return pointer for the function call to be the target
11940 of the conditional jump.
11942 @item -mdisable-fpregs
11943 @opindex mdisable-fpregs
11944 Prevent floating point registers from being used in any manner.  This is
11945 necessary for compiling kernels which perform lazy context switching of
11946 floating point registers.  If you use this option and attempt to perform
11947 floating point operations, the compiler will abort.
11949 @item -mdisable-indexing
11950 @opindex mdisable-indexing
11951 Prevent the compiler from using indexing address modes.  This avoids some
11952 rather obscure problems when compiling MIG generated code under MACH@.
11954 @item -mno-space-regs
11955 @opindex mno-space-regs
11956 Generate code that assumes the target has no space registers.  This allows
11957 GCC to generate faster indirect calls and use unscaled index address modes.
11959 Such code is suitable for level 0 PA systems and kernels.
11961 @item -mfast-indirect-calls
11962 @opindex mfast-indirect-calls
11963 Generate code that assumes calls never cross space boundaries.  This
11964 allows GCC to emit code which performs faster indirect calls.
11966 This option will not work in the presence of shared libraries or nested
11967 functions.
11969 @item -mfixed-range=@var{register-range}
11970 @opindex mfixed-range
11971 Generate code treating the given register range as fixed registers.
11972 A fixed register is one that the register allocator can not use.  This is
11973 useful when compiling kernel code.  A register range is specified as
11974 two registers separated by a dash.  Multiple register ranges can be
11975 specified separated by a comma.
11977 @item -mlong-load-store
11978 @opindex mlong-load-store
11979 Generate 3-instruction load and store sequences as sometimes required by
11980 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
11981 the HP compilers.
11983 @item -mportable-runtime
11984 @opindex mportable-runtime
11985 Use the portable calling conventions proposed by HP for ELF systems.
11987 @item -mgas
11988 @opindex mgas
11989 Enable the use of assembler directives only GAS understands.
11991 @item -mschedule=@var{cpu-type}
11992 @opindex mschedule
11993 Schedule code according to the constraints for the machine type
11994 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
11995 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
11996 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
11997 proper scheduling option for your machine.  The default scheduling is
11998 @samp{8000}.
12000 @item -mlinker-opt
12001 @opindex mlinker-opt
12002 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
12003 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
12004 linkers in which they give bogus error messages when linking some programs.
12006 @item -msoft-float
12007 @opindex msoft-float
12008 Generate output containing library calls for floating point.
12009 @strong{Warning:} the requisite libraries are not available for all HPPA
12010 targets.  Normally the facilities of the machine's usual C compiler are
12011 used, but this cannot be done directly in cross-compilation.  You must make
12012 your own arrangements to provide suitable library functions for
12013 cross-compilation.
12015 @option{-msoft-float} changes the calling convention in the output file;
12016 therefore, it is only useful if you compile @emph{all} of a program with
12017 this option.  In particular, you need to compile @file{libgcc.a}, the
12018 library that comes with GCC, with @option{-msoft-float} in order for
12019 this to work.
12021 @item -msio
12022 @opindex msio
12023 Generate the predefine, @code{_SIO}, for server IO@.  The default is
12024 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
12025 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
12026 options are available under HP-UX and HI-UX@.
12028 @item -mgnu-ld
12029 @opindex mgnu-ld
12030 Use GNU ld specific options.  This passes @option{-shared} to ld when
12031 building a shared library.  It is the default when GCC is configured,
12032 explicitly or implicitly, with the GNU linker.  This option does not
12033 have any affect on which ld is called, it only changes what parameters
12034 are passed to that ld.  The ld that is called is determined by the
12035 @option{--with-ld} configure option, GCC's program search path, and
12036 finally by the user's @env{PATH}.  The linker used by GCC can be printed
12037 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
12038 on the 64 bit HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
12040 @item -mhp-ld
12041 @opindex mhp-ld
12042 Use HP ld specific options.  This passes @option{-b} to ld when building
12043 a shared library and passes @option{+Accept TypeMismatch} to ld on all
12044 links.  It is the default when GCC is configured, explicitly or
12045 implicitly, with the HP linker.  This option does not have any affect on
12046 which ld is called, it only changes what parameters are passed to that
12047 ld.  The ld that is called is determined by the @option{--with-ld}
12048 configure option, GCC's program search path, and finally by the user's
12049 @env{PATH}.  The linker used by GCC can be printed using @samp{which
12050 `gcc -print-prog-name=ld`}.  This option is only available on the 64 bit
12051 HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
12053 @item -mlong-calls
12054 @opindex mno-long-calls
12055 Generate code that uses long call sequences.  This ensures that a call
12056 is always able to reach linker generated stubs.  The default is to generate
12057 long calls only when the distance from the call site to the beginning
12058 of the function or translation unit, as the case may be, exceeds a
12059 predefined limit set by the branch type being used.  The limits for
12060 normal calls are 7,600,000 and 240,000 bytes, respectively for the
12061 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
12062 240,000 bytes.
12064 Distances are measured from the beginning of functions when using the
12065 @option{-ffunction-sections} option, or when using the @option{-mgas}
12066 and @option{-mno-portable-runtime} options together under HP-UX with
12067 the SOM linker.
12069 It is normally not desirable to use this option as it will degrade
12070 performance.  However, it may be useful in large applications,
12071 particularly when partial linking is used to build the application.
12073 The types of long calls used depends on the capabilities of the
12074 assembler and linker, and the type of code being generated.  The
12075 impact on systems that support long absolute calls, and long pic
12076 symbol-difference or pc-relative calls should be relatively small.
12077 However, an indirect call is used on 32-bit ELF systems in pic code
12078 and it is quite long.
12080 @item -munix=@var{unix-std}
12081 @opindex march
12082 Generate compiler predefines and select a startfile for the specified
12083 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
12084 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
12085 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
12086 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
12087 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
12088 and later.
12090 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
12091 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
12092 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
12093 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
12094 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
12095 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
12097 It is @emph{important} to note that this option changes the interfaces
12098 for various library routines.  It also affects the operational behavior
12099 of the C library.  Thus, @emph{extreme} care is needed in using this
12100 option.
12102 Library code that is intended to operate with more than one UNIX
12103 standard must test, set and restore the variable @var{__xpg4_extended_mask}
12104 as appropriate.  Most GNU software doesn't provide this capability.
12106 @item -nolibdld
12107 @opindex nolibdld
12108 Suppress the generation of link options to search libdld.sl when the
12109 @option{-static} option is specified on HP-UX 10 and later.
12111 @item -static
12112 @opindex static
12113 The HP-UX implementation of setlocale in libc has a dependency on
12114 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
12115 when the @option{-static} option is specified, special link options
12116 are needed to resolve this dependency.
12118 On HP-UX 10 and later, the GCC driver adds the necessary options to
12119 link with libdld.sl when the @option{-static} option is specified.
12120 This causes the resulting binary to be dynamic.  On the 64-bit port,
12121 the linkers generate dynamic binaries by default in any case.  The
12122 @option{-nolibdld} option can be used to prevent the GCC driver from
12123 adding these link options.
12125 @item -threads
12126 @opindex threads
12127 Add support for multithreading with the @dfn{dce thread} library
12128 under HP-UX@.  This option sets flags for both the preprocessor and
12129 linker.
12130 @end table
12132 @node i386 and x86-64 Options
12133 @subsection Intel 386 and AMD x86-64 Options
12134 @cindex i386 Options
12135 @cindex x86-64 Options
12136 @cindex Intel 386 Options
12137 @cindex AMD x86-64 Options
12139 These @samp{-m} options are defined for the i386 and x86-64 family of
12140 computers:
12142 @table @gcctabopt
12143 @item -mtune=@var{cpu-type}
12144 @opindex mtune
12145 Tune to @var{cpu-type} everything applicable about the generated code, except
12146 for the ABI and the set of available instructions.  The choices for
12147 @var{cpu-type} are:
12148 @table @emph
12149 @item generic
12150 Produce code optimized for the most common IA32/@/AMD64/@/EM64T processors.
12151 If you know the CPU on which your code will run, then you should use
12152 the corresponding @option{-mtune} option instead of
12153 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
12154 of your application will have, then you should use this option.
12156 As new processors are deployed in the marketplace, the behavior of this
12157 option will change.  Therefore, if you upgrade to a newer version of
12158 GCC, the code generated option will change to reflect the processors
12159 that were most common when that version of GCC was released.
12161 There is no @option{-march=generic} option because @option{-march}
12162 indicates the instruction set the compiler can use, and there is no
12163 generic instruction set applicable to all processors.  In contrast,
12164 @option{-mtune} indicates the processor (or, in this case, collection of
12165 processors) for which the code is optimized.
12166 @item native
12167 This selects the CPU to tune for at compilation time by determining
12168 the processor type of the compiling machine.  Using @option{-mtune=native}
12169 will produce code optimized for the local machine under the constraints
12170 of the selected instruction set.  Using @option{-march=native} will
12171 enable all instruction subsets supported by the local machine (hence
12172 the result might not run on different machines).
12173 @item i386
12174 Original Intel's i386 CPU@.
12175 @item i486
12176 Intel's i486 CPU@.  (No scheduling is implemented for this chip.)
12177 @item i586, pentium
12178 Intel Pentium CPU with no MMX support.
12179 @item pentium-mmx
12180 Intel PentiumMMX CPU based on Pentium core with MMX instruction set support.
12181 @item pentiumpro
12182 Intel PentiumPro CPU@.
12183 @item i686
12184 Same as @code{generic}, but when used as @code{march} option, PentiumPro
12185 instruction set will be used, so the code will run on all i686 family chips.
12186 @item pentium2
12187 Intel Pentium2 CPU based on PentiumPro core with MMX instruction set support.
12188 @item pentium3, pentium3m
12189 Intel Pentium3 CPU based on PentiumPro core with MMX and SSE instruction set
12190 support.
12191 @item pentium-m
12192 Low power version of Intel Pentium3 CPU with MMX, SSE and SSE2 instruction set
12193 support.  Used by Centrino notebooks.
12194 @item pentium4, pentium4m
12195 Intel Pentium4 CPU with MMX, SSE and SSE2 instruction set support.
12196 @item prescott
12197 Improved version of Intel Pentium4 CPU with MMX, SSE, SSE2 and SSE3 instruction
12198 set support.
12199 @item nocona
12200 Improved version of Intel Pentium4 CPU with 64-bit extensions, MMX, SSE,
12201 SSE2 and SSE3 instruction set support.
12202 @item core2
12203 Intel Core2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
12204 instruction set support.
12205 @item corei7
12206 Intel Core i7 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1
12207 and SSE4.2 instruction set support.
12208 @item corei7-avx
12209 Intel Core i7 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
12210 SSE4.1, SSE4.2, AVX, AES and PCLMUL instruction set support.
12211 @item atom
12212 Intel Atom CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
12213 instruction set support.
12214 @item k6
12215 AMD K6 CPU with MMX instruction set support.
12216 @item k6-2, k6-3
12217 Improved versions of AMD K6 CPU with MMX and 3DNow!@: instruction set support.
12218 @item athlon, athlon-tbird
12219 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3DNow!@: and SSE prefetch instructions
12220 support.
12221 @item athlon-4, athlon-xp, athlon-mp
12222 Improved AMD Athlon CPU with MMX, 3DNow!, enhanced 3DNow!@: and full SSE
12223 instruction set support.
12224 @item k8, opteron, athlon64, athlon-fx
12225 AMD K8 core based CPUs with x86-64 instruction set support.  (This supersets
12226 MMX, SSE, SSE2, 3DNow!, enhanced 3DNow!@: and 64-bit instruction set extensions.)
12227 @item k8-sse3, opteron-sse3, athlon64-sse3
12228 Improved versions of k8, opteron and athlon64 with SSE3 instruction set support.
12229 @item amdfam10, barcelona
12230 AMD Family 10h core based CPUs with x86-64 instruction set support.  (This
12231 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3DNow!, enhanced 3DNow!, ABM and 64-bit
12232 instruction set extensions.)
12233 @item winchip-c6
12234 IDT Winchip C6 CPU, dealt in same way as i486 with additional MMX instruction
12235 set support.
12236 @item winchip2
12237 IDT Winchip2 CPU, dealt in same way as i486 with additional MMX and 3DNow!@:
12238 instruction set support.
12239 @item c3
12240 Via C3 CPU with MMX and 3DNow!@: instruction set support.  (No scheduling is
12241 implemented for this chip.)
12242 @item c3-2
12243 Via C3-2 CPU with MMX and SSE instruction set support.  (No scheduling is
12244 implemented for this chip.)
12245 @item geode
12246 Embedded AMD CPU with MMX and 3DNow!@: instruction set support.
12247 @end table
12249 While picking a specific @var{cpu-type} will schedule things appropriately
12250 for that particular chip, the compiler will not generate any code that
12251 does not run on the i386 without the @option{-march=@var{cpu-type}} option
12252 being used.
12254 @item -march=@var{cpu-type}
12255 @opindex march
12256 Generate instructions for the machine type @var{cpu-type}.  The choices
12257 for @var{cpu-type} are the same as for @option{-mtune}.  Moreover,
12258 specifying @option{-march=@var{cpu-type}} implies @option{-mtune=@var{cpu-type}}.
12260 @item -mcpu=@var{cpu-type}
12261 @opindex mcpu
12262 A deprecated synonym for @option{-mtune}.
12264 @item -mfpmath=@var{unit}
12265 @opindex mfpmath
12266 Generate floating point arithmetics for selected unit @var{unit}.  The choices
12267 for @var{unit} are:
12269 @table @samp
12270 @item 387
12271 Use the standard 387 floating point coprocessor present majority of chips and
12272 emulated otherwise.  Code compiled with this option will run almost everywhere.
12273 The temporary results are computed in 80bit precision instead of precision
12274 specified by the type resulting in slightly different results compared to most
12275 of other chips.  See @option{-ffloat-store} for more detailed description.
12277 This is the default choice for i386 compiler.
12279 @item sse
12280 Use scalar floating point instructions present in the SSE instruction set.
12281 This instruction set is supported by Pentium3 and newer chips, in the AMD line
12282 by Athlon-4, Athlon-xp and Athlon-mp chips.  The earlier version of SSE
12283 instruction set supports only single precision arithmetics, thus the double and
12284 extended precision arithmetics is still done using 387.  Later version, present
12285 only in Pentium4 and the future AMD x86-64 chips supports double precision
12286 arithmetics too.
12288 For the i386 compiler, you need to use @option{-march=@var{cpu-type}}, @option{-msse}
12289 or @option{-msse2} switches to enable SSE extensions and make this option
12290 effective.  For the x86-64 compiler, these extensions are enabled by default.
12292 The resulting code should be considerably faster in the majority of cases and avoid
12293 the numerical instability problems of 387 code, but may break some existing
12294 code that expects temporaries to be 80bit.
12296 This is the default choice for the x86-64 compiler.
12298 @item sse,387
12299 @itemx sse+387
12300 @itemx both
12301 Attempt to utilize both instruction sets at once.  This effectively double the
12302 amount of available registers and on chips with separate execution units for
12303 387 and SSE the execution resources too.  Use this option with care, as it is
12304 still experimental, because the GCC register allocator does not model separate
12305 functional units well resulting in instable performance.
12306 @end table
12308 @item -masm=@var{dialect}
12309 @opindex masm=@var{dialect}
12310 Output asm instructions using selected @var{dialect}.  Supported
12311 choices are @samp{intel} or @samp{att} (the default one).  Darwin does
12312 not support @samp{intel}.
12314 @item -mieee-fp
12315 @itemx -mno-ieee-fp
12316 @opindex mieee-fp
12317 @opindex mno-ieee-fp
12318 Control whether or not the compiler uses IEEE floating point
12319 comparisons.  These handle correctly the case where the result of a
12320 comparison is unordered.
12322 @item -msoft-float
12323 @opindex msoft-float
12324 Generate output containing library calls for floating point.
12325 @strong{Warning:} the requisite libraries are not part of GCC@.
12326 Normally the facilities of the machine's usual C compiler are used, but
12327 this can't be done directly in cross-compilation.  You must make your
12328 own arrangements to provide suitable library functions for
12329 cross-compilation.
12331 On machines where a function returns floating point results in the 80387
12332 register stack, some floating point opcodes may be emitted even if
12333 @option{-msoft-float} is used.
12335 @item -mno-fp-ret-in-387
12336 @opindex mno-fp-ret-in-387
12337 Do not use the FPU registers for return values of functions.
12339 The usual calling convention has functions return values of types
12340 @code{float} and @code{double} in an FPU register, even if there
12341 is no FPU@.  The idea is that the operating system should emulate
12342 an FPU@.
12344 The option @option{-mno-fp-ret-in-387} causes such values to be returned
12345 in ordinary CPU registers instead.
12347 @item -mno-fancy-math-387
12348 @opindex mno-fancy-math-387
12349 Some 387 emulators do not support the @code{sin}, @code{cos} and
12350 @code{sqrt} instructions for the 387.  Specify this option to avoid
12351 generating those instructions.  This option is the default on FreeBSD,
12352 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
12353 indicates that the target CPU will always have an FPU and so the
12354 instruction will not need emulation.  As of revision 2.6.1, these
12355 instructions are not generated unless you also use the
12356 @option{-funsafe-math-optimizations} switch.
12358 @item -malign-double
12359 @itemx -mno-align-double
12360 @opindex malign-double
12361 @opindex mno-align-double
12362 Control whether GCC aligns @code{double}, @code{long double}, and
12363 @code{long long} variables on a two word boundary or a one word
12364 boundary.  Aligning @code{double} variables on a two word boundary will
12365 produce code that runs somewhat faster on a @samp{Pentium} at the
12366 expense of more memory.
12368 On x86-64, @option{-malign-double} is enabled by default.
12370 @strong{Warning:} if you use the @option{-malign-double} switch,
12371 structures containing the above types will be aligned differently than
12372 the published application binary interface specifications for the 386
12373 and will not be binary compatible with structures in code compiled
12374 without that switch.
12376 @item -m96bit-long-double
12377 @itemx -m128bit-long-double
12378 @opindex m96bit-long-double
12379 @opindex m128bit-long-double
12380 These switches control the size of @code{long double} type.  The i386
12381 application binary interface specifies the size to be 96 bits,
12382 so @option{-m96bit-long-double} is the default in 32 bit mode.
12384 Modern architectures (Pentium and newer) would prefer @code{long double}
12385 to be aligned to an 8 or 16 byte boundary.  In arrays or structures
12386 conforming to the ABI, this would not be possible.  So specifying a
12387 @option{-m128bit-long-double} will align @code{long double}
12388 to a 16 byte boundary by padding the @code{long double} with an additional
12389 32 bit zero.
12391 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
12392 its ABI specifies that @code{long double} is to be aligned on 16 byte boundary.
12394 Notice that neither of these options enable any extra precision over the x87
12395 standard of 80 bits for a @code{long double}.
12397 @strong{Warning:} if you override the default value for your target ABI, the
12398 structures and arrays containing @code{long double} variables will change
12399 their size as well as function calling convention for function taking
12400 @code{long double} will be modified.  Hence they will not be binary
12401 compatible with arrays or structures in code compiled without that switch.
12403 @item -mlarge-data-threshold=@var{number}
12404 @opindex mlarge-data-threshold=@var{number}
12405 When @option{-mcmodel=medium} is specified, the data greater than
12406 @var{threshold} are placed in large data section.  This value must be the
12407 same across all object linked into the binary and defaults to 65535.
12409 @item -mrtd
12410 @opindex mrtd
12411 Use a different function-calling convention, in which functions that
12412 take a fixed number of arguments return with the @code{ret} @var{num}
12413 instruction, which pops their arguments while returning.  This saves one
12414 instruction in the caller since there is no need to pop the arguments
12415 there.
12417 You can specify that an individual function is called with this calling
12418 sequence with the function attribute @samp{stdcall}.  You can also
12419 override the @option{-mrtd} option by using the function attribute
12420 @samp{cdecl}.  @xref{Function Attributes}.
12422 @strong{Warning:} this calling convention is incompatible with the one
12423 normally used on Unix, so you cannot use it if you need to call
12424 libraries compiled with the Unix compiler.
12426 Also, you must provide function prototypes for all functions that
12427 take variable numbers of arguments (including @code{printf});
12428 otherwise incorrect code will be generated for calls to those
12429 functions.
12431 In addition, seriously incorrect code will result if you call a
12432 function with too many arguments.  (Normally, extra arguments are
12433 harmlessly ignored.)
12435 @item -mregparm=@var{num}
12436 @opindex mregparm
12437 Control how many registers are used to pass integer arguments.  By
12438 default, no registers are used to pass arguments, and at most 3
12439 registers can be used.  You can control this behavior for a specific
12440 function by using the function attribute @samp{regparm}.
12441 @xref{Function Attributes}.
12443 @strong{Warning:} if you use this switch, and
12444 @var{num} is nonzero, then you must build all modules with the same
12445 value, including any libraries.  This includes the system libraries and
12446 startup modules.
12448 @item -msseregparm
12449 @opindex msseregparm
12450 Use SSE register passing conventions for float and double arguments
12451 and return values.  You can control this behavior for a specific
12452 function by using the function attribute @samp{sseregparm}.
12453 @xref{Function Attributes}.
12455 @strong{Warning:} if you use this switch then you must build all
12456 modules with the same value, including any libraries.  This includes
12457 the system libraries and startup modules.
12459 @item -mvect8-ret-in-mem
12460 @opindex mvect8-ret-in-mem
12461 Return 8-byte vectors in memory instead of MMX registers.  This is the
12462 default on Solaris@tie{}8 and 9 and VxWorks to match the ABI of the Sun
12463 Studio compilers until version 12.  Later compiler versions (starting
12464 with Studio 12 Update@tie{}1) follow the ABI used by other x86 targets, which
12465 is the default on Solaris@tie{}10 and later.  @emph{Only} use this option if
12466 you need to remain compatible with existing code produced by those
12467 previous compiler versions or older versions of GCC.
12469 @item -mpc32
12470 @itemx -mpc64
12471 @itemx -mpc80
12472 @opindex mpc32
12473 @opindex mpc64
12474 @opindex mpc80
12476 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
12477 is specified, the significands of results of floating-point operations are
12478 rounded to 24 bits (single precision); @option{-mpc64} rounds the
12479 significands of results of floating-point operations to 53 bits (double
12480 precision) and @option{-mpc80} rounds the significands of results of
12481 floating-point operations to 64 bits (extended double precision), which is
12482 the default.  When this option is used, floating-point operations in higher
12483 precisions are not available to the programmer without setting the FPU
12484 control word explicitly.
12486 Setting the rounding of floating-point operations to less than the default
12487 80 bits can speed some programs by 2% or more.  Note that some mathematical
12488 libraries assume that extended precision (80 bit) floating-point operations
12489 are enabled by default; routines in such libraries could suffer significant
12490 loss of accuracy, typically through so-called "catastrophic cancellation",
12491 when this option is used to set the precision to less than extended precision.
12493 @item -mstackrealign
12494 @opindex mstackrealign
12495 Realign the stack at entry.  On the Intel x86, the @option{-mstackrealign}
12496 option will generate an alternate prologue and epilogue that realigns the
12497 runtime stack if necessary.  This supports mixing legacy codes that keep
12498 a 4-byte aligned stack with modern codes that keep a 16-byte stack for
12499 SSE compatibility.  See also the attribute @code{force_align_arg_pointer},
12500 applicable to individual functions.
12502 @item -mpreferred-stack-boundary=@var{num}
12503 @opindex mpreferred-stack-boundary
12504 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
12505 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
12506 the default is 4 (16 bytes or 128 bits).
12508 @item -mincoming-stack-boundary=@var{num}
12509 @opindex mincoming-stack-boundary
12510 Assume the incoming stack is aligned to a 2 raised to @var{num} byte
12511 boundary.  If @option{-mincoming-stack-boundary} is not specified,
12512 the one specified by @option{-mpreferred-stack-boundary} will be used.
12514 On Pentium and PentiumPro, @code{double} and @code{long double} values
12515 should be aligned to an 8 byte boundary (see @option{-malign-double}) or
12516 suffer significant run time performance penalties.  On Pentium III, the
12517 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
12518 properly if it is not 16 byte aligned.
12520 To ensure proper alignment of this values on the stack, the stack boundary
12521 must be as aligned as that required by any value stored on the stack.
12522 Further, every function must be generated such that it keeps the stack
12523 aligned.  Thus calling a function compiled with a higher preferred
12524 stack boundary from a function compiled with a lower preferred stack
12525 boundary will most likely misalign the stack.  It is recommended that
12526 libraries that use callbacks always use the default setting.
12528 This extra alignment does consume extra stack space, and generally
12529 increases code size.  Code that is sensitive to stack space usage, such
12530 as embedded systems and operating system kernels, may want to reduce the
12531 preferred alignment to @option{-mpreferred-stack-boundary=2}.
12533 @item -mmmx
12534 @itemx -mno-mmx
12535 @itemx -msse
12536 @itemx -mno-sse
12537 @itemx -msse2
12538 @itemx -mno-sse2
12539 @itemx -msse3
12540 @itemx -mno-sse3
12541 @itemx -mssse3
12542 @itemx -mno-ssse3
12543 @itemx -msse4.1
12544 @need 800
12545 @itemx -mno-sse4.1
12546 @itemx -msse4.2
12547 @itemx -mno-sse4.2
12548 @itemx -msse4
12549 @itemx -mno-sse4
12550 @itemx -mavx
12551 @itemx -mno-avx
12552 @itemx -maes
12553 @itemx -mno-aes
12554 @itemx -mpclmul
12555 @need 800
12556 @itemx -mno-pclmul
12557 @itemx -mfsgsbase
12558 @itemx -mno-fsgsbase
12559 @itemx -mrdrnd
12560 @itemx -mno-rdrnd
12561 @itemx -mf16c
12562 @itemx -mno-f16c
12563 @itemx -msse4a
12564 @itemx -mno-sse4a
12565 @itemx -mfma4
12566 @need 800
12567 @itemx -mno-fma4
12568 @itemx -mxop
12569 @itemx -mno-xop
12570 @itemx -mlwp
12571 @itemx -mno-lwp
12572 @itemx -m3dnow
12573 @itemx -mno-3dnow
12574 @itemx -mpopcnt
12575 @itemx -mno-popcnt
12576 @itemx -mabm
12577 @itemx -mno-abm
12578 @itemx -mbmi
12579 @itemx -mno-bmi
12580 @itemx -mtbm
12581 @itemx -mno-tbm
12582 @opindex mmmx
12583 @opindex mno-mmx
12584 @opindex msse
12585 @opindex mno-sse
12586 @opindex m3dnow
12587 @opindex mno-3dnow
12588 These switches enable or disable the use of instructions in the MMX,
12589 SSE, SSE2, SSE3, SSSE3, SSE4.1, AVX, AES, PCLMUL, FSGSBASE, RDRND,
12590 F16C, SSE4A, FMA4, XOP, LWP, ABM, BMI, or 3DNow!@: extended instruction sets.
12591 These extensions are also available as built-in functions: see
12592 @ref{X86 Built-in Functions}, for details of the functions enabled and
12593 disabled by these switches.
12595 To have SSE/SSE2 instructions generated automatically from floating-point
12596 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
12598 GCC depresses SSEx instructions when @option{-mavx} is used. Instead, it
12599 generates new AVX instructions or AVX equivalence for all SSEx instructions
12600 when needed.
12602 These options will enable GCC to use these extended instructions in
12603 generated code, even without @option{-mfpmath=sse}.  Applications which
12604 perform runtime CPU detection must compile separate files for each
12605 supported architecture, using the appropriate flags.  In particular,
12606 the file containing the CPU detection code should be compiled without
12607 these options.
12609 @item -mfused-madd
12610 @itemx -mno-fused-madd
12611 @opindex mfused-madd
12612 @opindex mno-fused-madd
12613 Do (don't) generate code that uses the fused multiply/add or multiply/subtract
12614 instructions.  The default is to use these instructions.
12616 @item -mcld
12617 @opindex mcld
12618 This option instructs GCC to emit a @code{cld} instruction in the prologue
12619 of functions that use string instructions.  String instructions depend on
12620 the DF flag to select between autoincrement or autodecrement mode.  While the
12621 ABI specifies the DF flag to be cleared on function entry, some operating
12622 systems violate this specification by not clearing the DF flag in their
12623 exception dispatchers.  The exception handler can be invoked with the DF flag
12624 set which leads to wrong direction mode, when string instructions are used.
12625 This option can be enabled by default on 32-bit x86 targets by configuring
12626 GCC with the @option{--enable-cld} configure option.  Generation of @code{cld}
12627 instructions can be suppressed with the @option{-mno-cld} compiler option
12628 in this case.
12630 @item -mvzeroupper
12631 @opindex mvzeroupper
12632 This option instructs GCC to emit a @code{vzeroupper} instruction
12633 before a transfer of control flow out of the function to minimize
12634 AVX to SSE transition penalty as well as remove unnecessary zeroupper
12635 intrinsics.
12637 @item -mcx16
12638 @opindex mcx16
12639 This option will enable GCC to use CMPXCHG16B instruction in generated code.
12640 CMPXCHG16B allows for atomic operations on 128-bit double quadword (or oword)
12641 data types.  This is useful for high resolution counters that could be updated
12642 by multiple processors (or cores).  This instruction is generated as part of
12643 atomic built-in functions: see @ref{Atomic Builtins} for details.
12645 @item -msahf
12646 @opindex msahf
12647 This option will enable GCC to use SAHF instruction in generated 64-bit code.
12648 Early Intel CPUs with Intel 64 lacked LAHF and SAHF instructions supported
12649 by AMD64 until introduction of Pentium 4 G1 step in December 2005.  LAHF and
12650 SAHF are load and store instructions, respectively, for certain status flags.
12651 In 64-bit mode, SAHF instruction is used to optimize @code{fmod}, @code{drem}
12652 or @code{remainder} built-in functions: see @ref{Other Builtins} for details.
12654 @item -mmovbe
12655 @opindex mmovbe
12656 This option will enable GCC to use movbe instruction to implement
12657 @code{__builtin_bswap32} and @code{__builtin_bswap64}.
12659 @item -mcrc32
12660 @opindex mcrc32
12661 This option will enable built-in functions, @code{__builtin_ia32_crc32qi},
12662 @code{__builtin_ia32_crc32hi}. @code{__builtin_ia32_crc32si} and
12663 @code{__builtin_ia32_crc32di} to generate the crc32 machine instruction.
12665 @item -mrecip
12666 @opindex mrecip
12667 This option will enable GCC to use RCPSS and RSQRTSS instructions (and their
12668 vectorized variants RCPPS and RSQRTPS) with an additional Newton-Raphson step
12669 to increase precision instead of DIVSS and SQRTSS (and their vectorized
12670 variants) for single precision floating point arguments.  These instructions
12671 are generated only when @option{-funsafe-math-optimizations} is enabled
12672 together with @option{-finite-math-only} and @option{-fno-trapping-math}.
12673 Note that while the throughput of the sequence is higher than the throughput
12674 of the non-reciprocal instruction, the precision of the sequence can be
12675 decreased by up to 2 ulp (i.e. the inverse of 1.0 equals 0.99999994).
12677 Note that GCC implements 1.0f/sqrtf(x) in terms of RSQRTSS (or RSQRTPS)
12678 already with @option{-ffast-math} (or the above option combination), and
12679 doesn't need @option{-mrecip}.
12681 @item -mveclibabi=@var{type}
12682 @opindex mveclibabi
12683 Specifies the ABI type to use for vectorizing intrinsics using an
12684 external library.  Supported types are @code{svml} for the Intel short
12685 vector math library and @code{acml} for the AMD math core library style
12686 of interfacing.  GCC will currently emit calls to @code{vmldExp2},
12687 @code{vmldLn2}, @code{vmldLog102}, @code{vmldLog102}, @code{vmldPow2},
12688 @code{vmldTanh2}, @code{vmldTan2}, @code{vmldAtan2}, @code{vmldAtanh2},
12689 @code{vmldCbrt2}, @code{vmldSinh2}, @code{vmldSin2}, @code{vmldAsinh2},
12690 @code{vmldAsin2}, @code{vmldCosh2}, @code{vmldCos2}, @code{vmldAcosh2},
12691 @code{vmldAcos2}, @code{vmlsExp4}, @code{vmlsLn4}, @code{vmlsLog104},
12692 @code{vmlsLog104}, @code{vmlsPow4}, @code{vmlsTanh4}, @code{vmlsTan4},
12693 @code{vmlsAtan4}, @code{vmlsAtanh4}, @code{vmlsCbrt4}, @code{vmlsSinh4},
12694 @code{vmlsSin4}, @code{vmlsAsinh4}, @code{vmlsAsin4}, @code{vmlsCosh4},
12695 @code{vmlsCos4}, @code{vmlsAcosh4} and @code{vmlsAcos4} for corresponding
12696 function type when @option{-mveclibabi=svml} is used and @code{__vrd2_sin},
12697 @code{__vrd2_cos}, @code{__vrd2_exp}, @code{__vrd2_log}, @code{__vrd2_log2},
12698 @code{__vrd2_log10}, @code{__vrs4_sinf}, @code{__vrs4_cosf},
12699 @code{__vrs4_expf}, @code{__vrs4_logf}, @code{__vrs4_log2f},
12700 @code{__vrs4_log10f} and @code{__vrs4_powf} for corresponding function type
12701 when @option{-mveclibabi=acml} is used. Both @option{-ftree-vectorize} and
12702 @option{-funsafe-math-optimizations} have to be enabled. A SVML or ACML ABI
12703 compatible library will have to be specified at link time.
12705 @item -mabi=@var{name}
12706 @opindex mabi
12707 Generate code for the specified calling convention.  Permissible values
12708 are: @samp{sysv} for the ABI used on GNU/Linux and other systems and
12709 @samp{ms} for the Microsoft ABI.  The default is to use the Microsoft
12710 ABI when targeting Windows.  On all other systems, the default is the
12711 SYSV ABI.  You can control this behavior for a specific function by
12712 using the function attribute @samp{ms_abi}/@samp{sysv_abi}.
12713 @xref{Function Attributes}.
12715 @item -mtls-dialect=@var{type}
12716 @opindex mtls-dialect
12717 Generate code to access thread-local storage using the @samp{gnu} or
12718 @samp{gnu2} conventions.  @samp{gnu} is the conservative default;
12719 @samp{gnu2} is more efficient, but it may add compile- and run-time
12720 requirements that cannot be satisfied on all systems.
12722 @item -mpush-args
12723 @itemx -mno-push-args
12724 @opindex mpush-args
12725 @opindex mno-push-args
12726 Use PUSH operations to store outgoing parameters.  This method is shorter
12727 and usually equally fast as method using SUB/MOV operations and is enabled
12728 by default.  In some cases disabling it may improve performance because of
12729 improved scheduling and reduced dependencies.
12731 @item -maccumulate-outgoing-args
12732 @opindex maccumulate-outgoing-args
12733 If enabled, the maximum amount of space required for outgoing arguments will be
12734 computed in the function prologue.  This is faster on most modern CPUs
12735 because of reduced dependencies, improved scheduling and reduced stack usage
12736 when preferred stack boundary is not equal to 2.  The drawback is a notable
12737 increase in code size.  This switch implies @option{-mno-push-args}.
12739 @item -mthreads
12740 @opindex mthreads
12741 Support thread-safe exception handling on @samp{Mingw32}.  Code that relies
12742 on thread-safe exception handling must compile and link all code with the
12743 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
12744 @option{-D_MT}; when linking, it links in a special thread helper library
12745 @option{-lmingwthrd} which cleans up per thread exception handling data.
12747 @item -mno-align-stringops
12748 @opindex mno-align-stringops
12749 Do not align destination of inlined string operations.  This switch reduces
12750 code size and improves performance in case the destination is already aligned,
12751 but GCC doesn't know about it.
12753 @item -minline-all-stringops
12754 @opindex minline-all-stringops
12755 By default GCC inlines string operations only when destination is known to be
12756 aligned at least to 4 byte boundary.  This enables more inlining, increase code
12757 size, but may improve performance of code that depends on fast memcpy, strlen
12758 and memset for short lengths.
12760 @item -minline-stringops-dynamically
12761 @opindex minline-stringops-dynamically
12762 For string operation of unknown size, inline runtime checks so for small
12763 blocks inline code is used, while for large blocks library call is used.
12765 @item -mstringop-strategy=@var{alg}
12766 @opindex mstringop-strategy=@var{alg}
12767 Overwrite internal decision heuristic about particular algorithm to inline
12768 string operation with.  The allowed values are @code{rep_byte},
12769 @code{rep_4byte}, @code{rep_8byte} for expanding using i386 @code{rep} prefix
12770 of specified size, @code{byte_loop}, @code{loop}, @code{unrolled_loop} for
12771 expanding inline loop, @code{libcall} for always expanding library call.
12773 @item -momit-leaf-frame-pointer
12774 @opindex momit-leaf-frame-pointer
12775 Don't keep the frame pointer in a register for leaf functions.  This
12776 avoids the instructions to save, set up and restore frame pointers and
12777 makes an extra register available in leaf functions.  The option
12778 @option{-fomit-frame-pointer} removes the frame pointer for all functions
12779 which might make debugging harder.
12781 @item -mtls-direct-seg-refs
12782 @itemx -mno-tls-direct-seg-refs
12783 @opindex mtls-direct-seg-refs
12784 Controls whether TLS variables may be accessed with offsets from the
12785 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
12786 or whether the thread base pointer must be added.  Whether or not this
12787 is legal depends on the operating system, and whether it maps the
12788 segment to cover the entire TLS area.
12790 For systems that use GNU libc, the default is on.
12792 @item -msse2avx
12793 @itemx -mno-sse2avx
12794 @opindex msse2avx
12795 Specify that the assembler should encode SSE instructions with VEX
12796 prefix.  The option @option{-mavx} turns this on by default.
12798 @item -mfentry
12799 @itemx -mno-fentry
12800 @opindex mfentry
12801 If profiling is active @option{-pg} put the profiling
12802 counter call before prologue.
12803 Note: On x86 architectures the attribute @code{ms_hook_prologue}
12804 isn't possible at the moment for @option{-mfentry} and @option{-pg}.
12806 @item -m8bit-idiv
12807 @itemx -mno-8bit-idiv
12808 @opindex 8bit-idiv
12809 On some processors, like Intel Atom, 8bit unsigned integer divide is
12810 much faster than 32bit/64bit integer divide.  This option will generate a
12811 runt-time check.  If both dividend and divisor are within range of 0
12812 to 255, 8bit unsigned integer divide will be used instead of
12813 32bit/64bit integer divide.
12815 @item -mavx256-split-unaligned-load
12816 @item -mavx256-split-unaligned-store
12817 @opindex avx256-split-unaligned-load
12818 @opindex avx256-split-unaligned-store
12819 Split 32-byte AVX unaligned load and store.
12821 @end table
12823 These @samp{-m} switches are supported in addition to the above
12824 on AMD x86-64 processors in 64-bit environments.
12826 @table @gcctabopt
12827 @item -m32
12828 @itemx -m64
12829 @opindex m32
12830 @opindex m64
12831 Generate code for a 32-bit or 64-bit environment.
12832 The 32-bit environment sets int, long and pointer to 32 bits and
12833 generates code that runs on any i386 system.
12834 The 64-bit environment sets int to 32 bits and long and pointer
12835 to 64 bits and generates code for AMD's x86-64 architecture. For
12836 darwin only the -m64 option turns off the @option{-fno-pic} and
12837 @option{-mdynamic-no-pic} options.
12839 @item -mno-red-zone
12840 @opindex mno-red-zone
12841 Do not use a so called red zone for x86-64 code.  The red zone is mandated
12842 by the x86-64 ABI, it is a 128-byte area beyond the location of the
12843 stack pointer that will not be modified by signal or interrupt handlers
12844 and therefore can be used for temporary data without adjusting the stack
12845 pointer.  The flag @option{-mno-red-zone} disables this red zone.
12847 @item -mcmodel=small
12848 @opindex mcmodel=small
12849 Generate code for the small code model: the program and its symbols must
12850 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
12851 Programs can be statically or dynamically linked.  This is the default
12852 code model.
12854 @item -mcmodel=kernel
12855 @opindex mcmodel=kernel
12856 Generate code for the kernel code model.  The kernel runs in the
12857 negative 2 GB of the address space.
12858 This model has to be used for Linux kernel code.
12860 @item -mcmodel=medium
12861 @opindex mcmodel=medium
12862 Generate code for the medium model: The program is linked in the lower 2
12863 GB of the address space.  Small symbols are also placed there.  Symbols
12864 with sizes larger than @option{-mlarge-data-threshold} are put into
12865 large data or bss sections and can be located above 2GB.  Programs can
12866 be statically or dynamically linked.
12868 @item -mcmodel=large
12869 @opindex mcmodel=large
12870 Generate code for the large model: This model makes no assumptions
12871 about addresses and sizes of sections.
12872 @end table
12874 @node i386 and x86-64 Windows Options
12875 @subsection i386 and x86-64 Windows Options
12876 @cindex i386 and x86-64 Windows Options
12878 These additional options are available for Windows targets:
12880 @table @gcctabopt
12881 @item -mconsole
12882 @opindex mconsole
12883 This option is available for Cygwin and MinGW targets.  It
12884 specifies that a console application is to be generated, by
12885 instructing the linker to set the PE header subsystem type
12886 required for console applications.
12887 This is the default behavior for Cygwin and MinGW targets.
12889 @item -mdll
12890 @opindex mdll
12891 This option is available for Cygwin and MinGW targets.  It
12892 specifies that a DLL - a dynamic link library - is to be
12893 generated, enabling the selection of the required runtime
12894 startup object and entry point.
12896 @item -mnop-fun-dllimport
12897 @opindex mnop-fun-dllimport
12898 This option is available for Cygwin and MinGW targets.  It
12899 specifies that the dllimport attribute should be ignored.
12901 @item -mthread
12902 @opindex mthread
12903 This option is available for MinGW targets. It specifies
12904 that MinGW-specific thread support is to be used.
12906 @item -municode
12907 @opindex municode
12908 This option is available for mingw-w64 targets.  It specifies
12909 that the UNICODE macro is getting pre-defined and that the
12910 unicode capable runtime startup code is chosen.
12912 @item -mwin32
12913 @opindex mwin32
12914 This option is available for Cygwin and MinGW targets.  It
12915 specifies that the typical Windows pre-defined macros are to
12916 be set in the pre-processor, but does not influence the choice
12917 of runtime library/startup code.
12919 @item -mwindows
12920 @opindex mwindows
12921 This option is available for Cygwin and MinGW targets.  It
12922 specifies that a GUI application is to be generated by
12923 instructing the linker to set the PE header subsystem type
12924 appropriately.
12926 @item -fno-set-stack-executable
12927 @opindex fno-set-stack-executable
12928 This option is available for MinGW targets. It specifies that
12929 the executable flag for stack used by nested functions isn't
12930 set. This is necessary for binaries running in kernel mode of
12931 Windows, as there the user32 API, which is used to set executable
12932 privileges, isn't available.
12934 @item -mpe-aligned-commons
12935 @opindex mpe-aligned-commons
12936 This option is available for Cygwin and MinGW targets.  It
12937 specifies that the GNU extension to the PE file format that
12938 permits the correct alignment of COMMON variables should be
12939 used when generating code.  It will be enabled by default if
12940 GCC detects that the target assembler found during configuration
12941 supports the feature.
12942 @end table
12944 See also under @ref{i386 and x86-64 Options} for standard options.
12946 @node IA-64 Options
12947 @subsection IA-64 Options
12948 @cindex IA-64 Options
12950 These are the @samp{-m} options defined for the Intel IA-64 architecture.
12952 @table @gcctabopt
12953 @item -mbig-endian
12954 @opindex mbig-endian
12955 Generate code for a big endian target.  This is the default for HP-UX@.
12957 @item -mlittle-endian
12958 @opindex mlittle-endian
12959 Generate code for a little endian target.  This is the default for AIX5
12960 and GNU/Linux.
12962 @item -mgnu-as
12963 @itemx -mno-gnu-as
12964 @opindex mgnu-as
12965 @opindex mno-gnu-as
12966 Generate (or don't) code for the GNU assembler.  This is the default.
12967 @c Also, this is the default if the configure option @option{--with-gnu-as}
12968 @c is used.
12970 @item -mgnu-ld
12971 @itemx -mno-gnu-ld
12972 @opindex mgnu-ld
12973 @opindex mno-gnu-ld
12974 Generate (or don't) code for the GNU linker.  This is the default.
12975 @c Also, this is the default if the configure option @option{--with-gnu-ld}
12976 @c is used.
12978 @item -mno-pic
12979 @opindex mno-pic
12980 Generate code that does not use a global pointer register.  The result
12981 is not position independent code, and violates the IA-64 ABI@.
12983 @item -mvolatile-asm-stop
12984 @itemx -mno-volatile-asm-stop
12985 @opindex mvolatile-asm-stop
12986 @opindex mno-volatile-asm-stop
12987 Generate (or don't) a stop bit immediately before and after volatile asm
12988 statements.
12990 @item -mregister-names
12991 @itemx -mno-register-names
12992 @opindex mregister-names
12993 @opindex mno-register-names
12994 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
12995 the stacked registers.  This may make assembler output more readable.
12997 @item -mno-sdata
12998 @itemx -msdata
12999 @opindex mno-sdata
13000 @opindex msdata
13001 Disable (or enable) optimizations that use the small data section.  This may
13002 be useful for working around optimizer bugs.
13004 @item -mconstant-gp
13005 @opindex mconstant-gp
13006 Generate code that uses a single constant global pointer value.  This is
13007 useful when compiling kernel code.
13009 @item -mauto-pic
13010 @opindex mauto-pic
13011 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
13012 This is useful when compiling firmware code.
13014 @item -minline-float-divide-min-latency
13015 @opindex minline-float-divide-min-latency
13016 Generate code for inline divides of floating point values
13017 using the minimum latency algorithm.
13019 @item -minline-float-divide-max-throughput
13020 @opindex minline-float-divide-max-throughput
13021 Generate code for inline divides of floating point values
13022 using the maximum throughput algorithm.
13024 @item -mno-inline-float-divide
13025 @opindex mno-inline-float-divide
13026 Do not generate inline code for divides of floating point values.
13028 @item -minline-int-divide-min-latency
13029 @opindex minline-int-divide-min-latency
13030 Generate code for inline divides of integer values
13031 using the minimum latency algorithm.
13033 @item -minline-int-divide-max-throughput
13034 @opindex minline-int-divide-max-throughput
13035 Generate code for inline divides of integer values
13036 using the maximum throughput algorithm.
13038 @item -mno-inline-int-divide
13039 @opindex mno-inline-int-divide
13040 Do not generate inline code for divides of integer values.
13042 @item -minline-sqrt-min-latency
13043 @opindex minline-sqrt-min-latency
13044 Generate code for inline square roots
13045 using the minimum latency algorithm.
13047 @item -minline-sqrt-max-throughput
13048 @opindex minline-sqrt-max-throughput
13049 Generate code for inline square roots
13050 using the maximum throughput algorithm.
13052 @item -mno-inline-sqrt
13053 @opindex mno-inline-sqrt
13054 Do not generate inline code for sqrt.
13056 @item -mfused-madd
13057 @itemx -mno-fused-madd
13058 @opindex mfused-madd
13059 @opindex mno-fused-madd
13060 Do (don't) generate code that uses the fused multiply/add or multiply/subtract
13061 instructions.  The default is to use these instructions.
13063 @item -mno-dwarf2-asm
13064 @itemx -mdwarf2-asm
13065 @opindex mno-dwarf2-asm
13066 @opindex mdwarf2-asm
13067 Don't (or do) generate assembler code for the DWARF2 line number debugging
13068 info.  This may be useful when not using the GNU assembler.
13070 @item -mearly-stop-bits
13071 @itemx -mno-early-stop-bits
13072 @opindex mearly-stop-bits
13073 @opindex mno-early-stop-bits
13074 Allow stop bits to be placed earlier than immediately preceding the
13075 instruction that triggered the stop bit.  This can improve instruction
13076 scheduling, but does not always do so.
13078 @item -mfixed-range=@var{register-range}
13079 @opindex mfixed-range
13080 Generate code treating the given register range as fixed registers.
13081 A fixed register is one that the register allocator can not use.  This is
13082 useful when compiling kernel code.  A register range is specified as
13083 two registers separated by a dash.  Multiple register ranges can be
13084 specified separated by a comma.
13086 @item -mtls-size=@var{tls-size}
13087 @opindex mtls-size
13088 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
13091 @item -mtune=@var{cpu-type}
13092 @opindex mtune
13093 Tune the instruction scheduling for a particular CPU, Valid values are
13094 itanium, itanium1, merced, itanium2, and mckinley.
13096 @item -milp32
13097 @itemx -mlp64
13098 @opindex milp32
13099 @opindex mlp64
13100 Generate code for a 32-bit or 64-bit environment.
13101 The 32-bit environment sets int, long and pointer to 32 bits.
13102 The 64-bit environment sets int to 32 bits and long and pointer
13103 to 64 bits.  These are HP-UX specific flags.
13105 @item -mno-sched-br-data-spec
13106 @itemx -msched-br-data-spec
13107 @opindex mno-sched-br-data-spec
13108 @opindex msched-br-data-spec
13109 (Dis/En)able data speculative scheduling before reload.
13110 This will result in generation of the ld.a instructions and
13111 the corresponding check instructions (ld.c / chk.a).
13112 The default is 'disable'.
13114 @item -msched-ar-data-spec
13115 @itemx -mno-sched-ar-data-spec
13116 @opindex msched-ar-data-spec
13117 @opindex mno-sched-ar-data-spec
13118 (En/Dis)able data speculative scheduling after reload.
13119 This will result in generation of the ld.a instructions and
13120 the corresponding check instructions (ld.c / chk.a).
13121 The default is 'enable'.
13123 @item -mno-sched-control-spec
13124 @itemx -msched-control-spec
13125 @opindex mno-sched-control-spec
13126 @opindex msched-control-spec
13127 (Dis/En)able control speculative scheduling.  This feature is
13128 available only during region scheduling (i.e.@: before reload).
13129 This will result in generation of the ld.s instructions and
13130 the corresponding check instructions chk.s .
13131 The default is 'disable'.
13133 @item -msched-br-in-data-spec
13134 @itemx -mno-sched-br-in-data-spec
13135 @opindex msched-br-in-data-spec
13136 @opindex mno-sched-br-in-data-spec
13137 (En/Dis)able speculative scheduling of the instructions that
13138 are dependent on the data speculative loads before reload.
13139 This is effective only with @option{-msched-br-data-spec} enabled.
13140 The default is 'enable'.
13142 @item -msched-ar-in-data-spec
13143 @itemx -mno-sched-ar-in-data-spec
13144 @opindex msched-ar-in-data-spec
13145 @opindex mno-sched-ar-in-data-spec
13146 (En/Dis)able speculative scheduling of the instructions that
13147 are dependent on the data speculative loads after reload.
13148 This is effective only with @option{-msched-ar-data-spec} enabled.
13149 The default is 'enable'.
13151 @item -msched-in-control-spec
13152 @itemx -mno-sched-in-control-spec
13153 @opindex msched-in-control-spec
13154 @opindex mno-sched-in-control-spec
13155 (En/Dis)able speculative scheduling of the instructions that
13156 are dependent on the control speculative loads.
13157 This is effective only with @option{-msched-control-spec} enabled.
13158 The default is 'enable'.
13160 @item -mno-sched-prefer-non-data-spec-insns
13161 @itemx -msched-prefer-non-data-spec-insns
13162 @opindex mno-sched-prefer-non-data-spec-insns
13163 @opindex msched-prefer-non-data-spec-insns
13164 If enabled, data speculative instructions will be chosen for schedule
13165 only if there are no other choices at the moment.  This will make
13166 the use of the data speculation much more conservative.
13167 The default is 'disable'.
13169 @item -mno-sched-prefer-non-control-spec-insns
13170 @itemx -msched-prefer-non-control-spec-insns
13171 @opindex mno-sched-prefer-non-control-spec-insns
13172 @opindex msched-prefer-non-control-spec-insns
13173 If enabled, control speculative instructions will be chosen for schedule
13174 only if there are no other choices at the moment.  This will make
13175 the use of the control speculation much more conservative.
13176 The default is 'disable'.
13178 @item -mno-sched-count-spec-in-critical-path
13179 @itemx -msched-count-spec-in-critical-path
13180 @opindex mno-sched-count-spec-in-critical-path
13181 @opindex msched-count-spec-in-critical-path
13182 If enabled, speculative dependencies will be considered during
13183 computation of the instructions priorities.  This will make the use of the
13184 speculation a bit more conservative.
13185 The default is 'disable'.
13187 @item -msched-spec-ldc
13188 @opindex msched-spec-ldc
13189 Use a simple data speculation check.  This option is on by default.
13191 @item -msched-control-spec-ldc
13192 @opindex msched-spec-ldc
13193 Use a simple check for control speculation.  This option is on by default.
13195 @item -msched-stop-bits-after-every-cycle
13196 @opindex msched-stop-bits-after-every-cycle
13197 Place a stop bit after every cycle when scheduling.  This option is on
13198 by default.
13200 @item -msched-fp-mem-deps-zero-cost
13201 @opindex msched-fp-mem-deps-zero-cost
13202 Assume that floating-point stores and loads are not likely to cause a conflict
13203 when placed into the same instruction group.  This option is disabled by
13204 default.
13206 @item -msel-sched-dont-check-control-spec
13207 @opindex msel-sched-dont-check-control-spec
13208 Generate checks for control speculation in selective scheduling.
13209 This flag is disabled by default.
13211 @item -msched-max-memory-insns=@var{max-insns}
13212 @opindex msched-max-memory-insns
13213 Limit on the number of memory insns per instruction group, giving lower
13214 priority to subsequent memory insns attempting to schedule in the same
13215 instruction group. Frequently useful to prevent cache bank conflicts.
13216 The default value is 1.
13218 @item -msched-max-memory-insns-hard-limit
13219 @opindex msched-max-memory-insns-hard-limit
13220 Disallow more than `msched-max-memory-insns' in instruction group.
13221 Otherwise, limit is `soft' meaning that we would prefer non-memory operations
13222 when limit is reached but may still schedule memory operations.
13224 @end table
13226 @node IA-64/VMS Options
13227 @subsection IA-64/VMS Options
13229 These @samp{-m} options are defined for the IA-64/VMS implementations:
13231 @table @gcctabopt
13232 @item -mvms-return-codes
13233 @opindex mvms-return-codes
13234 Return VMS condition codes from main. The default is to return POSIX
13235 style condition (e.g.@ error) codes.
13237 @item -mdebug-main=@var{prefix}
13238 @opindex mdebug-main=@var{prefix}
13239 Flag the first routine whose name starts with @var{prefix} as the main
13240 routine for the debugger.
13242 @item -mmalloc64
13243 @opindex mmalloc64
13244 Default to 64bit memory allocation routines.
13245 @end table
13247 @node LM32 Options
13248 @subsection LM32 Options
13249 @cindex LM32 options
13251 These @option{-m} options are defined for the Lattice Mico32 architecture:
13253 @table @gcctabopt
13254 @item -mbarrel-shift-enabled
13255 @opindex mbarrel-shift-enabled
13256 Enable barrel-shift instructions.
13258 @item -mdivide-enabled
13259 @opindex mdivide-enabled
13260 Enable divide and modulus instructions.
13262 @item -mmultiply-enabled
13263 @opindex multiply-enabled
13264 Enable multiply instructions.
13266 @item -msign-extend-enabled
13267 @opindex msign-extend-enabled
13268 Enable sign extend instructions.
13270 @item -muser-enabled
13271 @opindex muser-enabled
13272 Enable user-defined instructions.
13274 @end table
13276 @node M32C Options
13277 @subsection M32C Options
13278 @cindex M32C options
13280 @table @gcctabopt
13281 @item -mcpu=@var{name}
13282 @opindex mcpu=
13283 Select the CPU for which code is generated.  @var{name} may be one of
13284 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
13285 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
13286 the M32C/80 series.
13288 @item -msim
13289 @opindex msim
13290 Specifies that the program will be run on the simulator.  This causes
13291 an alternate runtime library to be linked in which supports, for
13292 example, file I/O@.  You must not use this option when generating
13293 programs that will run on real hardware; you must provide your own
13294 runtime library for whatever I/O functions are needed.
13296 @item -memregs=@var{number}
13297 @opindex memregs=
13298 Specifies the number of memory-based pseudo-registers GCC will use
13299 during code generation.  These pseudo-registers will be used like real
13300 registers, so there is a tradeoff between GCC's ability to fit the
13301 code into available registers, and the performance penalty of using
13302 memory instead of registers.  Note that all modules in a program must
13303 be compiled with the same value for this option.  Because of that, you
13304 must not use this option with the default runtime libraries gcc
13305 builds.
13307 @end table
13309 @node M32R/D Options
13310 @subsection M32R/D Options
13311 @cindex M32R/D options
13313 These @option{-m} options are defined for Renesas M32R/D architectures:
13315 @table @gcctabopt
13316 @item -m32r2
13317 @opindex m32r2
13318 Generate code for the M32R/2@.
13320 @item -m32rx
13321 @opindex m32rx
13322 Generate code for the M32R/X@.
13324 @item -m32r
13325 @opindex m32r
13326 Generate code for the M32R@.  This is the default.
13328 @item -mmodel=small
13329 @opindex mmodel=small
13330 Assume all objects live in the lower 16MB of memory (so that their addresses
13331 can be loaded with the @code{ld24} instruction), and assume all subroutines
13332 are reachable with the @code{bl} instruction.
13333 This is the default.
13335 The addressability of a particular object can be set with the
13336 @code{model} attribute.
13338 @item -mmodel=medium
13339 @opindex mmodel=medium
13340 Assume objects may be anywhere in the 32-bit address space (the compiler
13341 will generate @code{seth/add3} instructions to load their addresses), and
13342 assume all subroutines are reachable with the @code{bl} instruction.
13344 @item -mmodel=large
13345 @opindex mmodel=large
13346 Assume objects may be anywhere in the 32-bit address space (the compiler
13347 will generate @code{seth/add3} instructions to load their addresses), and
13348 assume subroutines may not be reachable with the @code{bl} instruction
13349 (the compiler will generate the much slower @code{seth/add3/jl}
13350 instruction sequence).
13352 @item -msdata=none
13353 @opindex msdata=none
13354 Disable use of the small data area.  Variables will be put into
13355 one of @samp{.data}, @samp{bss}, or @samp{.rodata} (unless the
13356 @code{section} attribute has been specified).
13357 This is the default.
13359 The small data area consists of sections @samp{.sdata} and @samp{.sbss}.
13360 Objects may be explicitly put in the small data area with the
13361 @code{section} attribute using one of these sections.
13363 @item -msdata=sdata
13364 @opindex msdata=sdata
13365 Put small global and static data in the small data area, but do not
13366 generate special code to reference them.
13368 @item -msdata=use
13369 @opindex msdata=use
13370 Put small global and static data in the small data area, and generate
13371 special instructions to reference them.
13373 @item -G @var{num}
13374 @opindex G
13375 @cindex smaller data references
13376 Put global and static objects less than or equal to @var{num} bytes
13377 into the small data or bss sections instead of the normal data or bss
13378 sections.  The default value of @var{num} is 8.
13379 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
13380 for this option to have any effect.
13382 All modules should be compiled with the same @option{-G @var{num}} value.
13383 Compiling with different values of @var{num} may or may not work; if it
13384 doesn't the linker will give an error message---incorrect code will not be
13385 generated.
13387 @item -mdebug
13388 @opindex mdebug
13389 Makes the M32R specific code in the compiler display some statistics
13390 that might help in debugging programs.
13392 @item -malign-loops
13393 @opindex malign-loops
13394 Align all loops to a 32-byte boundary.
13396 @item -mno-align-loops
13397 @opindex mno-align-loops
13398 Do not enforce a 32-byte alignment for loops.  This is the default.
13400 @item -missue-rate=@var{number}
13401 @opindex missue-rate=@var{number}
13402 Issue @var{number} instructions per cycle.  @var{number} can only be 1
13403 or 2.
13405 @item -mbranch-cost=@var{number}
13406 @opindex mbranch-cost=@var{number}
13407 @var{number} can only be 1 or 2.  If it is 1 then branches will be
13408 preferred over conditional code, if it is 2, then the opposite will
13409 apply.
13411 @item -mflush-trap=@var{number}
13412 @opindex mflush-trap=@var{number}
13413 Specifies the trap number to use to flush the cache.  The default is
13414 12.  Valid numbers are between 0 and 15 inclusive.
13416 @item -mno-flush-trap
13417 @opindex mno-flush-trap
13418 Specifies that the cache cannot be flushed by using a trap.
13420 @item -mflush-func=@var{name}
13421 @opindex mflush-func=@var{name}
13422 Specifies the name of the operating system function to call to flush
13423 the cache.  The default is @emph{_flush_cache}, but a function call
13424 will only be used if a trap is not available.
13426 @item -mno-flush-func
13427 @opindex mno-flush-func
13428 Indicates that there is no OS function for flushing the cache.
13430 @end table
13432 @node M680x0 Options
13433 @subsection M680x0 Options
13434 @cindex M680x0 options
13436 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
13437 The default settings depend on which architecture was selected when
13438 the compiler was configured; the defaults for the most common choices
13439 are given below.
13441 @table @gcctabopt
13442 @item -march=@var{arch}
13443 @opindex march
13444 Generate code for a specific M680x0 or ColdFire instruction set
13445 architecture.  Permissible values of @var{arch} for M680x0
13446 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
13447 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
13448 architectures are selected according to Freescale's ISA classification
13449 and the permissible values are: @samp{isaa}, @samp{isaaplus},
13450 @samp{isab} and @samp{isac}.
13452 gcc defines a macro @samp{__mcf@var{arch}__} whenever it is generating
13453 code for a ColdFire target.  The @var{arch} in this macro is one of the
13454 @option{-march} arguments given above.
13456 When used together, @option{-march} and @option{-mtune} select code
13457 that runs on a family of similar processors but that is optimized
13458 for a particular microarchitecture.
13460 @item -mcpu=@var{cpu}
13461 @opindex mcpu
13462 Generate code for a specific M680x0 or ColdFire processor.
13463 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
13464 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
13465 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
13466 below, which also classifies the CPUs into families:
13468 @multitable @columnfractions 0.20 0.80
13469 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
13470 @item @samp{51} @tab @samp{51} @samp{51ac} @samp{51cn} @samp{51em} @samp{51qe}
13471 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
13472 @item @samp{5206e} @tab @samp{5206e}
13473 @item @samp{5208} @tab @samp{5207} @samp{5208}
13474 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
13475 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
13476 @item @samp{5216} @tab @samp{5214} @samp{5216}
13477 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
13478 @item @samp{5225} @tab @samp{5224} @samp{5225}
13479 @item @samp{52259} @tab @samp{52252} @samp{52254} @samp{52255} @samp{52256} @samp{52258} @samp{52259}
13480 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
13481 @item @samp{5249} @tab @samp{5249}
13482 @item @samp{5250} @tab @samp{5250}
13483 @item @samp{5271} @tab @samp{5270} @samp{5271}
13484 @item @samp{5272} @tab @samp{5272}
13485 @item @samp{5275} @tab @samp{5274} @samp{5275}
13486 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
13487 @item @samp{53017} @tab @samp{53011} @samp{53012} @samp{53013} @samp{53014} @samp{53015} @samp{53016} @samp{53017}
13488 @item @samp{5307} @tab @samp{5307}
13489 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
13490 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
13491 @item @samp{5407} @tab @samp{5407}
13492 @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}
13493 @end multitable
13495 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
13496 @var{arch} is compatible with @var{cpu}.  Other combinations of
13497 @option{-mcpu} and @option{-march} are rejected.
13499 gcc defines the macro @samp{__mcf_cpu_@var{cpu}} when ColdFire target
13500 @var{cpu} is selected.  It also defines @samp{__mcf_family_@var{family}},
13501 where the value of @var{family} is given by the table above.
13503 @item -mtune=@var{tune}
13504 @opindex mtune
13505 Tune the code for a particular microarchitecture, within the
13506 constraints set by @option{-march} and @option{-mcpu}.
13507 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
13508 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
13509 and @samp{cpu32}.  The ColdFire microarchitectures
13510 are: @samp{cfv1}, @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
13512 You can also use @option{-mtune=68020-40} for code that needs
13513 to run relatively well on 68020, 68030 and 68040 targets.
13514 @option{-mtune=68020-60} is similar but includes 68060 targets
13515 as well.  These two options select the same tuning decisions as
13516 @option{-m68020-40} and @option{-m68020-60} respectively.
13518 gcc defines the macros @samp{__mc@var{arch}} and @samp{__mc@var{arch}__}
13519 when tuning for 680x0 architecture @var{arch}.  It also defines
13520 @samp{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
13521 option is used.  If gcc is tuning for a range of architectures,
13522 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
13523 it defines the macros for every architecture in the range.
13525 gcc also defines the macro @samp{__m@var{uarch}__} when tuning for
13526 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
13527 of the arguments given above.
13529 @item -m68000
13530 @itemx -mc68000
13531 @opindex m68000
13532 @opindex mc68000
13533 Generate output for a 68000.  This is the default
13534 when the compiler is configured for 68000-based systems.
13535 It is equivalent to @option{-march=68000}.
13537 Use this option for microcontrollers with a 68000 or EC000 core,
13538 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
13540 @item -m68010
13541 @opindex m68010
13542 Generate output for a 68010.  This is the default
13543 when the compiler is configured for 68010-based systems.
13544 It is equivalent to @option{-march=68010}.
13546 @item -m68020
13547 @itemx -mc68020
13548 @opindex m68020
13549 @opindex mc68020
13550 Generate output for a 68020.  This is the default
13551 when the compiler is configured for 68020-based systems.
13552 It is equivalent to @option{-march=68020}.
13554 @item -m68030
13555 @opindex m68030
13556 Generate output for a 68030.  This is the default when the compiler is
13557 configured for 68030-based systems.  It is equivalent to
13558 @option{-march=68030}.
13560 @item -m68040
13561 @opindex m68040
13562 Generate output for a 68040.  This is the default when the compiler is
13563 configured for 68040-based systems.  It is equivalent to
13564 @option{-march=68040}.
13566 This option inhibits the use of 68881/68882 instructions that have to be
13567 emulated by software on the 68040.  Use this option if your 68040 does not
13568 have code to emulate those instructions.
13570 @item -m68060
13571 @opindex m68060
13572 Generate output for a 68060.  This is the default when the compiler is
13573 configured for 68060-based systems.  It is equivalent to
13574 @option{-march=68060}.
13576 This option inhibits the use of 68020 and 68881/68882 instructions that
13577 have to be emulated by software on the 68060.  Use this option if your 68060
13578 does not have code to emulate those instructions.
13580 @item -mcpu32
13581 @opindex mcpu32
13582 Generate output for a CPU32.  This is the default
13583 when the compiler is configured for CPU32-based systems.
13584 It is equivalent to @option{-march=cpu32}.
13586 Use this option for microcontrollers with a
13587 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
13588 68336, 68340, 68341, 68349 and 68360.
13590 @item -m5200
13591 @opindex m5200
13592 Generate output for a 520X ColdFire CPU@.  This is the default
13593 when the compiler is configured for 520X-based systems.
13594 It is equivalent to @option{-mcpu=5206}, and is now deprecated
13595 in favor of that option.
13597 Use this option for microcontroller with a 5200 core, including
13598 the MCF5202, MCF5203, MCF5204 and MCF5206.
13600 @item -m5206e
13601 @opindex m5206e
13602 Generate output for a 5206e ColdFire CPU@.  The option is now
13603 deprecated in favor of the equivalent @option{-mcpu=5206e}.
13605 @item -m528x
13606 @opindex m528x
13607 Generate output for a member of the ColdFire 528X family.
13608 The option is now deprecated in favor of the equivalent
13609 @option{-mcpu=528x}.
13611 @item -m5307
13612 @opindex m5307
13613 Generate output for a ColdFire 5307 CPU@.  The option is now deprecated
13614 in favor of the equivalent @option{-mcpu=5307}.
13616 @item -m5407
13617 @opindex m5407
13618 Generate output for a ColdFire 5407 CPU@.  The option is now deprecated
13619 in favor of the equivalent @option{-mcpu=5407}.
13621 @item -mcfv4e
13622 @opindex mcfv4e
13623 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
13624 This includes use of hardware floating point instructions.
13625 The option is equivalent to @option{-mcpu=547x}, and is now
13626 deprecated in favor of that option.
13628 @item -m68020-40
13629 @opindex m68020-40
13630 Generate output for a 68040, without using any of the new instructions.
13631 This results in code which can run relatively efficiently on either a
13632 68020/68881 or a 68030 or a 68040.  The generated code does use the
13633 68881 instructions that are emulated on the 68040.
13635 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
13637 @item -m68020-60
13638 @opindex m68020-60
13639 Generate output for a 68060, without using any of the new instructions.
13640 This results in code which can run relatively efficiently on either a
13641 68020/68881 or a 68030 or a 68040.  The generated code does use the
13642 68881 instructions that are emulated on the 68060.
13644 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
13646 @item -mhard-float
13647 @itemx -m68881
13648 @opindex mhard-float
13649 @opindex m68881
13650 Generate floating-point instructions.  This is the default for 68020
13651 and above, and for ColdFire devices that have an FPU@.  It defines the
13652 macro @samp{__HAVE_68881__} on M680x0 targets and @samp{__mcffpu__}
13653 on ColdFire targets.
13655 @item -msoft-float
13656 @opindex msoft-float
13657 Do not generate floating-point instructions; use library calls instead.
13658 This is the default for 68000, 68010, and 68832 targets.  It is also
13659 the default for ColdFire devices that have no FPU.
13661 @item -mdiv
13662 @itemx -mno-div
13663 @opindex mdiv
13664 @opindex mno-div
13665 Generate (do not generate) ColdFire hardware divide and remainder
13666 instructions.  If @option{-march} is used without @option{-mcpu},
13667 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
13668 architectures.  Otherwise, the default is taken from the target CPU
13669 (either the default CPU, or the one specified by @option{-mcpu}).  For
13670 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
13671 @option{-mcpu=5206e}.
13673 gcc defines the macro @samp{__mcfhwdiv__} when this option is enabled.
13675 @item -mshort
13676 @opindex mshort
13677 Consider type @code{int} to be 16 bits wide, like @code{short int}.
13678 Additionally, parameters passed on the stack are also aligned to a
13679 16-bit boundary even on targets whose API mandates promotion to 32-bit.
13681 @item -mno-short
13682 @opindex mno-short
13683 Do not consider type @code{int} to be 16 bits wide.  This is the default.
13685 @item -mnobitfield
13686 @itemx -mno-bitfield
13687 @opindex mnobitfield
13688 @opindex mno-bitfield
13689 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
13690 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
13692 @item -mbitfield
13693 @opindex mbitfield
13694 Do use the bit-field instructions.  The @option{-m68020} option implies
13695 @option{-mbitfield}.  This is the default if you use a configuration
13696 designed for a 68020.
13698 @item -mrtd
13699 @opindex mrtd
13700 Use a different function-calling convention, in which functions
13701 that take a fixed number of arguments return with the @code{rtd}
13702 instruction, which pops their arguments while returning.  This
13703 saves one instruction in the caller since there is no need to pop
13704 the arguments there.
13706 This calling convention is incompatible with the one normally
13707 used on Unix, so you cannot use it if you need to call libraries
13708 compiled with the Unix compiler.
13710 Also, you must provide function prototypes for all functions that
13711 take variable numbers of arguments (including @code{printf});
13712 otherwise incorrect code will be generated for calls to those
13713 functions.
13715 In addition, seriously incorrect code will result if you call a
13716 function with too many arguments.  (Normally, extra arguments are
13717 harmlessly ignored.)
13719 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
13720 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
13722 @item -mno-rtd
13723 @opindex mno-rtd
13724 Do not use the calling conventions selected by @option{-mrtd}.
13725 This is the default.
13727 @item -malign-int
13728 @itemx -mno-align-int
13729 @opindex malign-int
13730 @opindex mno-align-int
13731 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
13732 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
13733 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
13734 Aligning variables on 32-bit boundaries produces code that runs somewhat
13735 faster on processors with 32-bit busses at the expense of more memory.
13737 @strong{Warning:} if you use the @option{-malign-int} switch, GCC will
13738 align structures containing the above types  differently than
13739 most published application binary interface specifications for the m68k.
13741 @item -mpcrel
13742 @opindex mpcrel
13743 Use the pc-relative addressing mode of the 68000 directly, instead of
13744 using a global offset table.  At present, this option implies @option{-fpic},
13745 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
13746 not presently supported with @option{-mpcrel}, though this could be supported for
13747 68020 and higher processors.
13749 @item -mno-strict-align
13750 @itemx -mstrict-align
13751 @opindex mno-strict-align
13752 @opindex mstrict-align
13753 Do not (do) assume that unaligned memory references will be handled by
13754 the system.
13756 @item -msep-data
13757 Generate code that allows the data segment to be located in a different
13758 area of memory from the text segment.  This allows for execute in place in
13759 an environment without virtual memory management.  This option implies
13760 @option{-fPIC}.
13762 @item -mno-sep-data
13763 Generate code that assumes that the data segment follows the text segment.
13764 This is the default.
13766 @item -mid-shared-library
13767 Generate code that supports shared libraries via the library ID method.
13768 This allows for execute in place and shared libraries in an environment
13769 without virtual memory management.  This option implies @option{-fPIC}.
13771 @item -mno-id-shared-library
13772 Generate code that doesn't assume ID based shared libraries are being used.
13773 This is the default.
13775 @item -mshared-library-id=n
13776 Specified the identification number of the ID based shared library being
13777 compiled.  Specifying a value of 0 will generate more compact code, specifying
13778 other values will force the allocation of that number to the current
13779 library but is no more space or time efficient than omitting this option.
13781 @item -mxgot
13782 @itemx -mno-xgot
13783 @opindex mxgot
13784 @opindex mno-xgot
13785 When generating position-independent code for ColdFire, generate code
13786 that works if the GOT has more than 8192 entries.  This code is
13787 larger and slower than code generated without this option.  On M680x0
13788 processors, this option is not needed; @option{-fPIC} suffices.
13790 GCC normally uses a single instruction to load values from the GOT@.
13791 While this is relatively efficient, it only works if the GOT
13792 is smaller than about 64k.  Anything larger causes the linker
13793 to report an error such as:
13795 @cindex relocation truncated to fit (ColdFire)
13796 @smallexample
13797 relocation truncated to fit: R_68K_GOT16O foobar
13798 @end smallexample
13800 If this happens, you should recompile your code with @option{-mxgot}.
13801 It should then work with very large GOTs.  However, code generated with
13802 @option{-mxgot} is less efficient, since it takes 4 instructions to fetch
13803 the value of a global symbol.
13805 Note that some linkers, including newer versions of the GNU linker,
13806 can create multiple GOTs and sort GOT entries.  If you have such a linker,
13807 you should only need to use @option{-mxgot} when compiling a single
13808 object file that accesses more than 8192 GOT entries.  Very few do.
13810 These options have no effect unless GCC is generating
13811 position-independent code.
13813 @end table
13815 @node MCore Options
13816 @subsection MCore Options
13817 @cindex MCore options
13819 These are the @samp{-m} options defined for the Motorola M*Core
13820 processors.
13822 @table @gcctabopt
13824 @item -mhardlit
13825 @itemx -mno-hardlit
13826 @opindex mhardlit
13827 @opindex mno-hardlit
13828 Inline constants into the code stream if it can be done in two
13829 instructions or less.
13831 @item -mdiv
13832 @itemx -mno-div
13833 @opindex mdiv
13834 @opindex mno-div
13835 Use the divide instruction.  (Enabled by default).
13837 @item -mrelax-immediate
13838 @itemx -mno-relax-immediate
13839 @opindex mrelax-immediate
13840 @opindex mno-relax-immediate
13841 Allow arbitrary sized immediates in bit operations.
13843 @item -mwide-bitfields
13844 @itemx -mno-wide-bitfields
13845 @opindex mwide-bitfields
13846 @opindex mno-wide-bitfields
13847 Always treat bit-fields as int-sized.
13849 @item -m4byte-functions
13850 @itemx -mno-4byte-functions
13851 @opindex m4byte-functions
13852 @opindex mno-4byte-functions
13853 Force all functions to be aligned to a four byte boundary.
13855 @item -mcallgraph-data
13856 @itemx -mno-callgraph-data
13857 @opindex mcallgraph-data
13858 @opindex mno-callgraph-data
13859 Emit callgraph information.
13861 @item -mslow-bytes
13862 @itemx -mno-slow-bytes
13863 @opindex mslow-bytes
13864 @opindex mno-slow-bytes
13865 Prefer word access when reading byte quantities.
13867 @item -mlittle-endian
13868 @itemx -mbig-endian
13869 @opindex mlittle-endian
13870 @opindex mbig-endian
13871 Generate code for a little endian target.
13873 @item -m210
13874 @itemx -m340
13875 @opindex m210
13876 @opindex m340
13877 Generate code for the 210 processor.
13879 @item -mno-lsim
13880 @opindex mno-lsim
13881 Assume that run-time support has been provided and so omit the
13882 simulator library (@file{libsim.a)} from the linker command line.
13884 @item -mstack-increment=@var{size}
13885 @opindex mstack-increment
13886 Set the maximum amount for a single stack increment operation.  Large
13887 values can increase the speed of programs which contain functions
13888 that need a large amount of stack space, but they can also trigger a
13889 segmentation fault if the stack is extended too much.  The default
13890 value is 0x1000.
13892 @end table
13894 @node MeP Options
13895 @subsection MeP Options
13896 @cindex MeP options
13898 @table @gcctabopt
13900 @item -mabsdiff
13901 @opindex mabsdiff
13902 Enables the @code{abs} instruction, which is the absolute difference
13903 between two registers.
13905 @item -mall-opts
13906 @opindex mall-opts
13907 Enables all the optional instructions - average, multiply, divide, bit
13908 operations, leading zero, absolute difference, min/max, clip, and
13909 saturation.
13912 @item -maverage
13913 @opindex maverage
13914 Enables the @code{ave} instruction, which computes the average of two
13915 registers.
13917 @item -mbased=@var{n}
13918 @opindex mbased=
13919 Variables of size @var{n} bytes or smaller will be placed in the
13920 @code{.based} section by default.  Based variables use the @code{$tp}
13921 register as a base register, and there is a 128 byte limit to the
13922 @code{.based} section.
13924 @item -mbitops
13925 @opindex mbitops
13926 Enables the bit operation instructions - bit test (@code{btstm}), set
13927 (@code{bsetm}), clear (@code{bclrm}), invert (@code{bnotm}), and
13928 test-and-set (@code{tas}).
13930 @item -mc=@var{name}
13931 @opindex mc=
13932 Selects which section constant data will be placed in.  @var{name} may
13933 be @code{tiny}, @code{near}, or @code{far}.
13935 @item -mclip
13936 @opindex mclip
13937 Enables the @code{clip} instruction.  Note that @code{-mclip} is not
13938 useful unless you also provide @code{-mminmax}.
13940 @item -mconfig=@var{name}
13941 @opindex mconfig=
13942 Selects one of the build-in core configurations.  Each MeP chip has
13943 one or more modules in it; each module has a core CPU and a variety of
13944 coprocessors, optional instructions, and peripherals.  The
13945 @code{MeP-Integrator} tool, not part of GCC, provides these
13946 configurations through this option; using this option is the same as
13947 using all the corresponding command line options.  The default
13948 configuration is @code{default}.
13950 @item -mcop
13951 @opindex mcop
13952 Enables the coprocessor instructions.  By default, this is a 32-bit
13953 coprocessor.  Note that the coprocessor is normally enabled via the
13954 @code{-mconfig=} option.
13956 @item -mcop32
13957 @opindex mcop32
13958 Enables the 32-bit coprocessor's instructions.
13960 @item -mcop64
13961 @opindex mcop64
13962 Enables the 64-bit coprocessor's instructions.
13964 @item -mivc2
13965 @opindex mivc2
13966 Enables IVC2 scheduling.  IVC2 is a 64-bit VLIW coprocessor.
13968 @item -mdc
13969 @opindex mdc
13970 Causes constant variables to be placed in the @code{.near} section.
13972 @item -mdiv
13973 @opindex mdiv
13974 Enables the @code{div} and @code{divu} instructions.
13976 @item -meb
13977 @opindex meb
13978 Generate big-endian code.
13980 @item -mel
13981 @opindex mel
13982 Generate little-endian code.
13984 @item -mio-volatile
13985 @opindex mio-volatile
13986 Tells the compiler that any variable marked with the @code{io}
13987 attribute is to be considered volatile.
13989 @item -ml
13990 @opindex ml
13991 Causes variables to be assigned to the @code{.far} section by default.
13993 @item -mleadz
13994 @opindex mleadz
13995 Enables the @code{leadz} (leading zero) instruction.
13997 @item -mm
13998 @opindex mm
13999 Causes variables to be assigned to the @code{.near} section by default.
14001 @item -mminmax
14002 @opindex mminmax
14003 Enables the @code{min} and @code{max} instructions.
14005 @item -mmult
14006 @opindex mmult
14007 Enables the multiplication and multiply-accumulate instructions.
14009 @item -mno-opts
14010 @opindex mno-opts
14011 Disables all the optional instructions enabled by @code{-mall-opts}.
14013 @item -mrepeat
14014 @opindex mrepeat
14015 Enables the @code{repeat} and @code{erepeat} instructions, used for
14016 low-overhead looping.
14018 @item -ms
14019 @opindex ms
14020 Causes all variables to default to the @code{.tiny} section.  Note
14021 that there is a 65536 byte limit to this section.  Accesses to these
14022 variables use the @code{%gp} base register.
14024 @item -msatur
14025 @opindex msatur
14026 Enables the saturation instructions.  Note that the compiler does not
14027 currently generate these itself, but this option is included for
14028 compatibility with other tools, like @code{as}.
14030 @item -msdram
14031 @opindex msdram
14032 Link the SDRAM-based runtime instead of the default ROM-based runtime.
14034 @item -msim
14035 @opindex msim
14036 Link the simulator runtime libraries.
14038 @item -msimnovec
14039 @opindex msimnovec
14040 Link the simulator runtime libraries, excluding built-in support
14041 for reset and exception vectors and tables.
14043 @item -mtf
14044 @opindex mtf
14045 Causes all functions to default to the @code{.far} section.  Without
14046 this option, functions default to the @code{.near} section.
14048 @item -mtiny=@var{n}
14049 @opindex mtiny=
14050 Variables that are @var{n} bytes or smaller will be allocated to the
14051 @code{.tiny} section.  These variables use the @code{$gp} base
14052 register.  The default for this option is 4, but note that there's a
14053 65536 byte limit to the @code{.tiny} section.
14055 @end table
14057 @node MicroBlaze Options
14058 @subsection MicroBlaze Options
14059 @cindex MicroBlaze Options
14061 @table @gcctabopt
14063 @item -msoft-float
14064 @opindex msoft-float
14065 Use software emulation for floating point (default).
14067 @item -mhard-float
14068 @opindex mhard-float
14069 Use hardware floating point instructions.
14071 @item -mmemcpy
14072 @opindex mmemcpy
14073 Do not optimize block moves, use @code{memcpy}.
14075 @item -mno-clearbss
14076 @opindex mno-clearbss
14077 This option is deprecated.  Use @option{-fno-zero-initialized-in-bss} instead.
14079 @item -mcpu=@var{cpu-type}
14080 @opindex mcpu=
14081 Use features of and schedule code for given CPU.
14082 Supported values are in the format @samp{v@var{X}.@var{YY}.@var{Z}},
14083 where @var{X} is a major version, @var{YY} is the minor version, and
14084 @var{Z} is compatibility code.  Example values are @samp{v3.00.a},
14085 @samp{v4.00.b}, @samp{v5.00.a}, @samp{v5.00.b}, @samp{v5.00.b}, @samp{v6.00.a}.
14087 @item -mxl-soft-mul
14088 @opindex mxl-soft-mul
14089 Use software multiply emulation (default).
14091 @item -mxl-soft-div
14092 @opindex mxl-soft-div
14093 Use software emulation for divides (default).
14095 @item -mxl-barrel-shift
14096 @opindex mxl-barrel-shift
14097 Use the hardware barrel shifter.
14099 @item -mxl-pattern-compare
14100 @opindex mxl-pattern-compare
14101 Use pattern compare instructions.
14103 @item -msmall-divides
14104 @opindex msmall-divides
14105 Use table lookup optimization for small signed integer divisions.
14107 @item -mxl-stack-check
14108 @opindex mxl-stack-check
14109 This option is deprecated.  Use -fstack-check instead.
14111 @item -mxl-gp-opt
14112 @opindex mxl-gp-opt
14113 Use GP relative sdata/sbss sections.
14115 @item -mxl-multiply-high
14116 @opindex mxl-multiply-high
14117 Use multiply high instructions for high part of 32x32 multiply.
14119 @item -mxl-float-convert
14120 @opindex mxl-float-convert
14121 Use hardware floating point conversion instructions.
14123 @item -mxl-float-sqrt
14124 @opindex mxl-float-sqrt
14125 Use hardware floating point square root instruction.
14127 @item -mxl-mode-@var{app-model}
14128 Select application model @var{app-model}.  Valid models are
14129 @table @samp
14130 @item executable
14131 normal executable (default), uses startup code @file{crt0.o}.
14133 @item xmdstub
14134 for use with Xilinx Microprocessor Debugger (XMD) based
14135 software intrusive debug agent called xmdstub. This uses startup file
14136 @file{crt1.o} and sets the start address of the program to be 0x800.
14138 @item bootstrap
14139 for applications that are loaded using a bootloader.
14140 This model uses startup file @file{crt2.o} which does not contain a processor
14141 reset vector handler. This is suitable for transferring control on a
14142 processor reset to the bootloader rather than the application.
14144 @item novectors
14145 for applications that do not require any of the
14146 MicroBlaze vectors. This option may be useful for applications running
14147 within a monitoring application. This model uses @file{crt3.o} as a startup file.
14148 @end table
14150 Option @option{-xl-mode-@var{app-model}} is a deprecated alias for
14151 @option{-mxl-mode-@var{app-model}}.
14153 @end table
14155 @node MIPS Options
14156 @subsection MIPS Options
14157 @cindex MIPS options
14159 @table @gcctabopt
14161 @item -EB
14162 @opindex EB
14163 Generate big-endian code.
14165 @item -EL
14166 @opindex EL
14167 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
14168 configurations.
14170 @item -march=@var{arch}
14171 @opindex march
14172 Generate code that will run on @var{arch}, which can be the name of a
14173 generic MIPS ISA, or the name of a particular processor.
14174 The ISA names are:
14175 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
14176 @samp{mips32}, @samp{mips32r2}, @samp{mips64} and @samp{mips64r2}.
14177 The processor names are:
14178 @samp{4kc}, @samp{4km}, @samp{4kp}, @samp{4ksc},
14179 @samp{4kec}, @samp{4kem}, @samp{4kep}, @samp{4ksd},
14180 @samp{5kc}, @samp{5kf},
14181 @samp{20kc},
14182 @samp{24kc}, @samp{24kf2_1}, @samp{24kf1_1},
14183 @samp{24kec}, @samp{24kef2_1}, @samp{24kef1_1},
14184 @samp{34kc}, @samp{34kf2_1}, @samp{34kf1_1},
14185 @samp{74kc}, @samp{74kf2_1}, @samp{74kf1_1}, @samp{74kf3_2},
14186 @samp{1004kc}, @samp{1004kf2_1}, @samp{1004kf1_1},
14187 @samp{loongson2e}, @samp{loongson2f}, @samp{loongson3a},
14188 @samp{m4k},
14189 @samp{octeon},
14190 @samp{orion},
14191 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
14192 @samp{r4600}, @samp{r4650}, @samp{r6000}, @samp{r8000},
14193 @samp{rm7000}, @samp{rm9000},
14194 @samp{r10000}, @samp{r12000}, @samp{r14000}, @samp{r16000},
14195 @samp{sb1},
14196 @samp{sr71000},
14197 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
14198 @samp{vr5000}, @samp{vr5400}, @samp{vr5500}
14199 and @samp{xlr}.
14200 The special value @samp{from-abi} selects the
14201 most compatible architecture for the selected ABI (that is,
14202 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
14204 Native Linux/GNU toolchains also support the value @samp{native},
14205 which selects the best architecture option for the host processor.
14206 @option{-march=native} has no effect if GCC does not recognize
14207 the processor.
14209 In processor names, a final @samp{000} can be abbreviated as @samp{k}
14210 (for example, @samp{-march=r2k}).  Prefixes are optional, and
14211 @samp{vr} may be written @samp{r}.
14213 Names of the form @samp{@var{n}f2_1} refer to processors with
14214 FPUs clocked at half the rate of the core, names of the form
14215 @samp{@var{n}f1_1} refer to processors with FPUs clocked at the same
14216 rate as the core, and names of the form @samp{@var{n}f3_2} refer to
14217 processors with FPUs clocked a ratio of 3:2 with respect to the core.
14218 For compatibility reasons, @samp{@var{n}f} is accepted as a synonym
14219 for @samp{@var{n}f2_1} while @samp{@var{n}x} and @samp{@var{b}fx} are
14220 accepted as synonyms for @samp{@var{n}f1_1}.
14222 GCC defines two macros based on the value of this option.  The first
14223 is @samp{_MIPS_ARCH}, which gives the name of target architecture, as
14224 a string.  The second has the form @samp{_MIPS_ARCH_@var{foo}},
14225 where @var{foo} is the capitalized value of @samp{_MIPS_ARCH}@.
14226 For example, @samp{-march=r2000} will set @samp{_MIPS_ARCH}
14227 to @samp{"r2000"} and define the macro @samp{_MIPS_ARCH_R2000}.
14229 Note that the @samp{_MIPS_ARCH} macro uses the processor names given
14230 above.  In other words, it will have the full prefix and will not
14231 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
14232 the macro names the resolved architecture (either @samp{"mips1"} or
14233 @samp{"mips3"}).  It names the default architecture when no
14234 @option{-march} option is given.
14236 @item -mtune=@var{arch}
14237 @opindex mtune
14238 Optimize for @var{arch}.  Among other things, this option controls
14239 the way instructions are scheduled, and the perceived cost of arithmetic
14240 operations.  The list of @var{arch} values is the same as for
14241 @option{-march}.
14243 When this option is not used, GCC will optimize for the processor
14244 specified by @option{-march}.  By using @option{-march} and
14245 @option{-mtune} together, it is possible to generate code that will
14246 run on a family of processors, but optimize the code for one
14247 particular member of that family.
14249 @samp{-mtune} defines the macros @samp{_MIPS_TUNE} and
14250 @samp{_MIPS_TUNE_@var{foo}}, which work in the same way as the
14251 @samp{-march} ones described above.
14253 @item -mips1
14254 @opindex mips1
14255 Equivalent to @samp{-march=mips1}.
14257 @item -mips2
14258 @opindex mips2
14259 Equivalent to @samp{-march=mips2}.
14261 @item -mips3
14262 @opindex mips3
14263 Equivalent to @samp{-march=mips3}.
14265 @item -mips4
14266 @opindex mips4
14267 Equivalent to @samp{-march=mips4}.
14269 @item -mips32
14270 @opindex mips32
14271 Equivalent to @samp{-march=mips32}.
14273 @item -mips32r2
14274 @opindex mips32r2
14275 Equivalent to @samp{-march=mips32r2}.
14277 @item -mips64
14278 @opindex mips64
14279 Equivalent to @samp{-march=mips64}.
14281 @item -mips64r2
14282 @opindex mips64r2
14283 Equivalent to @samp{-march=mips64r2}.
14285 @item -mips16
14286 @itemx -mno-mips16
14287 @opindex mips16
14288 @opindex mno-mips16
14289 Generate (do not generate) MIPS16 code.  If GCC is targetting a
14290 MIPS32 or MIPS64 architecture, it will make use of the MIPS16e ASE@.
14292 MIPS16 code generation can also be controlled on a per-function basis
14293 by means of @code{mips16} and @code{nomips16} attributes.
14294 @xref{Function Attributes}, for more information.
14296 @item -mflip-mips16
14297 @opindex mflip-mips16
14298 Generate MIPS16 code on alternating functions.  This option is provided
14299 for regression testing of mixed MIPS16/non-MIPS16 code generation, and is
14300 not intended for ordinary use in compiling user code.
14302 @item -minterlink-mips16
14303 @itemx -mno-interlink-mips16
14304 @opindex minterlink-mips16
14305 @opindex mno-interlink-mips16
14306 Require (do not require) that non-MIPS16 code be link-compatible with
14307 MIPS16 code.
14309 For example, non-MIPS16 code cannot jump directly to MIPS16 code;
14310 it must either use a call or an indirect jump.  @option{-minterlink-mips16}
14311 therefore disables direct jumps unless GCC knows that the target of the
14312 jump is not MIPS16.
14314 @item -mabi=32
14315 @itemx -mabi=o64
14316 @itemx -mabi=n32
14317 @itemx -mabi=64
14318 @itemx -mabi=eabi
14319 @opindex mabi=32
14320 @opindex mabi=o64
14321 @opindex mabi=n32
14322 @opindex mabi=64
14323 @opindex mabi=eabi
14324 Generate code for the given ABI@.
14326 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
14327 generates 64-bit code when you select a 64-bit architecture, but you
14328 can use @option{-mgp32} to get 32-bit code instead.
14330 For information about the O64 ABI, see
14331 @uref{http://gcc.gnu.org/@/projects/@/mipso64-abi.html}.
14333 GCC supports a variant of the o32 ABI in which floating-point registers
14334 are 64 rather than 32 bits wide.  You can select this combination with
14335 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @samp{mthc1}
14336 and @samp{mfhc1} instructions and is therefore only supported for
14337 MIPS32R2 processors.
14339 The register assignments for arguments and return values remain the
14340 same, but each scalar value is passed in a single 64-bit register
14341 rather than a pair of 32-bit registers.  For example, scalar
14342 floating-point values are returned in @samp{$f0} only, not a
14343 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
14344 remains the same, but all 64 bits are saved.
14346 @item -mabicalls
14347 @itemx -mno-abicalls
14348 @opindex mabicalls
14349 @opindex mno-abicalls
14350 Generate (do not generate) code that is suitable for SVR4-style
14351 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
14352 systems.
14354 @item -mshared
14355 @itemx -mno-shared
14356 Generate (do not generate) code that is fully position-independent,
14357 and that can therefore be linked into shared libraries.  This option
14358 only affects @option{-mabicalls}.
14360 All @option{-mabicalls} code has traditionally been position-independent,
14361 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
14362 as an extension, the GNU toolchain allows executables to use absolute
14363 accesses for locally-binding symbols.  It can also use shorter GP
14364 initialization sequences and generate direct calls to locally-defined
14365 functions.  This mode is selected by @option{-mno-shared}.
14367 @option{-mno-shared} depends on binutils 2.16 or higher and generates
14368 objects that can only be linked by the GNU linker.  However, the option
14369 does not affect the ABI of the final executable; it only affects the ABI
14370 of relocatable objects.  Using @option{-mno-shared} will generally make
14371 executables both smaller and quicker.
14373 @option{-mshared} is the default.
14375 @item -mplt
14376 @itemx -mno-plt
14377 @opindex mplt
14378 @opindex mno-plt
14379 Assume (do not assume) that the static and dynamic linkers
14380 support PLTs and copy relocations.  This option only affects
14381 @samp{-mno-shared -mabicalls}.  For the n64 ABI, this option
14382 has no effect without @samp{-msym32}.
14384 You can make @option{-mplt} the default by configuring
14385 GCC with @option{--with-mips-plt}.  The default is
14386 @option{-mno-plt} otherwise.
14388 @item -mxgot
14389 @itemx -mno-xgot
14390 @opindex mxgot
14391 @opindex mno-xgot
14392 Lift (do not lift) the usual restrictions on the size of the global
14393 offset table.
14395 GCC normally uses a single instruction to load values from the GOT@.
14396 While this is relatively efficient, it will only work if the GOT
14397 is smaller than about 64k.  Anything larger will cause the linker
14398 to report an error such as:
14400 @cindex relocation truncated to fit (MIPS)
14401 @smallexample
14402 relocation truncated to fit: R_MIPS_GOT16 foobar
14403 @end smallexample
14405 If this happens, you should recompile your code with @option{-mxgot}.
14406 It should then work with very large GOTs, although it will also be
14407 less efficient, since it will take three instructions to fetch the
14408 value of a global symbol.
14410 Note that some linkers can create multiple GOTs.  If you have such a
14411 linker, you should only need to use @option{-mxgot} when a single object
14412 file accesses more than 64k's worth of GOT entries.  Very few do.
14414 These options have no effect unless GCC is generating position
14415 independent code.
14417 @item -mgp32
14418 @opindex mgp32
14419 Assume that general-purpose registers are 32 bits wide.
14421 @item -mgp64
14422 @opindex mgp64
14423 Assume that general-purpose registers are 64 bits wide.
14425 @item -mfp32
14426 @opindex mfp32
14427 Assume that floating-point registers are 32 bits wide.
14429 @item -mfp64
14430 @opindex mfp64
14431 Assume that floating-point registers are 64 bits wide.
14433 @item -mhard-float
14434 @opindex mhard-float
14435 Use floating-point coprocessor instructions.
14437 @item -msoft-float
14438 @opindex msoft-float
14439 Do not use floating-point coprocessor instructions.  Implement
14440 floating-point calculations using library calls instead.
14442 @item -msingle-float
14443 @opindex msingle-float
14444 Assume that the floating-point coprocessor only supports single-precision
14445 operations.
14447 @item -mdouble-float
14448 @opindex mdouble-float
14449 Assume that the floating-point coprocessor supports double-precision
14450 operations.  This is the default.
14452 @item -mllsc
14453 @itemx -mno-llsc
14454 @opindex mllsc
14455 @opindex mno-llsc
14456 Use (do not use) @samp{ll}, @samp{sc}, and @samp{sync} instructions to
14457 implement atomic memory built-in functions.  When neither option is
14458 specified, GCC will use the instructions if the target architecture
14459 supports them.
14461 @option{-mllsc} is useful if the runtime environment can emulate the
14462 instructions and @option{-mno-llsc} can be useful when compiling for
14463 nonstandard ISAs.  You can make either option the default by
14464 configuring GCC with @option{--with-llsc} and @option{--without-llsc}
14465 respectively.  @option{--with-llsc} is the default for some
14466 configurations; see the installation documentation for details.
14468 @item -mdsp
14469 @itemx -mno-dsp
14470 @opindex mdsp
14471 @opindex mno-dsp
14472 Use (do not use) revision 1 of the MIPS DSP ASE@.
14473 @xref{MIPS DSP Built-in Functions}.  This option defines the
14474 preprocessor macro @samp{__mips_dsp}.  It also defines
14475 @samp{__mips_dsp_rev} to 1.
14477 @item -mdspr2
14478 @itemx -mno-dspr2
14479 @opindex mdspr2
14480 @opindex mno-dspr2
14481 Use (do not use) revision 2 of the MIPS DSP ASE@.
14482 @xref{MIPS DSP Built-in Functions}.  This option defines the
14483 preprocessor macros @samp{__mips_dsp} and @samp{__mips_dspr2}.
14484 It also defines @samp{__mips_dsp_rev} to 2.
14486 @item -msmartmips
14487 @itemx -mno-smartmips
14488 @opindex msmartmips
14489 @opindex mno-smartmips
14490 Use (do not use) the MIPS SmartMIPS ASE.
14492 @item -mpaired-single
14493 @itemx -mno-paired-single
14494 @opindex mpaired-single
14495 @opindex mno-paired-single
14496 Use (do not use) paired-single floating-point instructions.
14497 @xref{MIPS Paired-Single Support}.  This option requires
14498 hardware floating-point support to be enabled.
14500 @item -mdmx
14501 @itemx -mno-mdmx
14502 @opindex mdmx
14503 @opindex mno-mdmx
14504 Use (do not use) MIPS Digital Media Extension instructions.
14505 This option can only be used when generating 64-bit code and requires
14506 hardware floating-point support to be enabled.
14508 @item -mips3d
14509 @itemx -mno-mips3d
14510 @opindex mips3d
14511 @opindex mno-mips3d
14512 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
14513 The option @option{-mips3d} implies @option{-mpaired-single}.
14515 @item -mmt
14516 @itemx -mno-mt
14517 @opindex mmt
14518 @opindex mno-mt
14519 Use (do not use) MT Multithreading instructions.
14521 @item -mlong64
14522 @opindex mlong64
14523 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
14524 an explanation of the default and the way that the pointer size is
14525 determined.
14527 @item -mlong32
14528 @opindex mlong32
14529 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
14531 The default size of @code{int}s, @code{long}s and pointers depends on
14532 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
14533 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
14534 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
14535 or the same size as integer registers, whichever is smaller.
14537 @item -msym32
14538 @itemx -mno-sym32
14539 @opindex msym32
14540 @opindex mno-sym32
14541 Assume (do not assume) that all symbols have 32-bit values, regardless
14542 of the selected ABI@.  This option is useful in combination with
14543 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
14544 to generate shorter and faster references to symbolic addresses.
14546 @item -G @var{num}
14547 @opindex G
14548 Put definitions of externally-visible data in a small data section
14549 if that data is no bigger than @var{num} bytes.  GCC can then access
14550 the data more efficiently; see @option{-mgpopt} for details.
14552 The default @option{-G} option depends on the configuration.
14554 @item -mlocal-sdata
14555 @itemx -mno-local-sdata
14556 @opindex mlocal-sdata
14557 @opindex mno-local-sdata
14558 Extend (do not extend) the @option{-G} behavior to local data too,
14559 such as to static variables in C@.  @option{-mlocal-sdata} is the
14560 default for all configurations.
14562 If the linker complains that an application is using too much small data,
14563 you might want to try rebuilding the less performance-critical parts with
14564 @option{-mno-local-sdata}.  You might also want to build large
14565 libraries with @option{-mno-local-sdata}, so that the libraries leave
14566 more room for the main program.
14568 @item -mextern-sdata
14569 @itemx -mno-extern-sdata
14570 @opindex mextern-sdata
14571 @opindex mno-extern-sdata
14572 Assume (do not assume) that externally-defined data will be in
14573 a small data section if that data is within the @option{-G} limit.
14574 @option{-mextern-sdata} is the default for all configurations.
14576 If you compile a module @var{Mod} with @option{-mextern-sdata} @option{-G
14577 @var{num}} @option{-mgpopt}, and @var{Mod} references a variable @var{Var}
14578 that is no bigger than @var{num} bytes, you must make sure that @var{Var}
14579 is placed in a small data section.  If @var{Var} is defined by another
14580 module, you must either compile that module with a high-enough
14581 @option{-G} setting or attach a @code{section} attribute to @var{Var}'s
14582 definition.  If @var{Var} is common, you must link the application
14583 with a high-enough @option{-G} setting.
14585 The easiest way of satisfying these restrictions is to compile
14586 and link every module with the same @option{-G} option.  However,
14587 you may wish to build a library that supports several different
14588 small data limits.  You can do this by compiling the library with
14589 the highest supported @option{-G} setting and additionally using
14590 @option{-mno-extern-sdata} to stop the library from making assumptions
14591 about externally-defined data.
14593 @item -mgpopt
14594 @itemx -mno-gpopt
14595 @opindex mgpopt
14596 @opindex mno-gpopt
14597 Use (do not use) GP-relative accesses for symbols that are known to be
14598 in a small data section; see @option{-G}, @option{-mlocal-sdata} and
14599 @option{-mextern-sdata}.  @option{-mgpopt} is the default for all
14600 configurations.
14602 @option{-mno-gpopt} is useful for cases where the @code{$gp} register
14603 might not hold the value of @code{_gp}.  For example, if the code is
14604 part of a library that might be used in a boot monitor, programs that
14605 call boot monitor routines will pass an unknown value in @code{$gp}.
14606 (In such situations, the boot monitor itself would usually be compiled
14607 with @option{-G0}.)
14609 @option{-mno-gpopt} implies @option{-mno-local-sdata} and
14610 @option{-mno-extern-sdata}.
14612 @item -membedded-data
14613 @itemx -mno-embedded-data
14614 @opindex membedded-data
14615 @opindex mno-embedded-data
14616 Allocate variables to the read-only data section first if possible, then
14617 next in the small data section if possible, otherwise in data.  This gives
14618 slightly slower code than the default, but reduces the amount of RAM required
14619 when executing, and thus may be preferred for some embedded systems.
14621 @item -muninit-const-in-rodata
14622 @itemx -mno-uninit-const-in-rodata
14623 @opindex muninit-const-in-rodata
14624 @opindex mno-uninit-const-in-rodata
14625 Put uninitialized @code{const} variables in the read-only data section.
14626 This option is only meaningful in conjunction with @option{-membedded-data}.
14628 @item -mcode-readable=@var{setting}
14629 @opindex mcode-readable
14630 Specify whether GCC may generate code that reads from executable sections.
14631 There are three possible settings:
14633 @table @gcctabopt
14634 @item -mcode-readable=yes
14635 Instructions may freely access executable sections.  This is the
14636 default setting.
14638 @item -mcode-readable=pcrel
14639 MIPS16 PC-relative load instructions can access executable sections,
14640 but other instructions must not do so.  This option is useful on 4KSc
14641 and 4KSd processors when the code TLBs have the Read Inhibit bit set.
14642 It is also useful on processors that can be configured to have a dual
14643 instruction/data SRAM interface and that, like the M4K, automatically
14644 redirect PC-relative loads to the instruction RAM.
14646 @item -mcode-readable=no
14647 Instructions must not access executable sections.  This option can be
14648 useful on targets that are configured to have a dual instruction/data
14649 SRAM interface but that (unlike the M4K) do not automatically redirect
14650 PC-relative loads to the instruction RAM.
14651 @end table
14653 @item -msplit-addresses
14654 @itemx -mno-split-addresses
14655 @opindex msplit-addresses
14656 @opindex mno-split-addresses
14657 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
14658 relocation operators.  This option has been superseded by
14659 @option{-mexplicit-relocs} but is retained for backwards compatibility.
14661 @item -mexplicit-relocs
14662 @itemx -mno-explicit-relocs
14663 @opindex mexplicit-relocs
14664 @opindex mno-explicit-relocs
14665 Use (do not use) assembler relocation operators when dealing with symbolic
14666 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
14667 is to use assembler macros instead.
14669 @option{-mexplicit-relocs} is the default if GCC was configured
14670 to use an assembler that supports relocation operators.
14672 @item -mcheck-zero-division
14673 @itemx -mno-check-zero-division
14674 @opindex mcheck-zero-division
14675 @opindex mno-check-zero-division
14676 Trap (do not trap) on integer division by zero.
14678 The default is @option{-mcheck-zero-division}.
14680 @item -mdivide-traps
14681 @itemx -mdivide-breaks
14682 @opindex mdivide-traps
14683 @opindex mdivide-breaks
14684 MIPS systems check for division by zero by generating either a
14685 conditional trap or a break instruction.  Using traps results in
14686 smaller code, but is only supported on MIPS II and later.  Also, some
14687 versions of the Linux kernel have a bug that prevents trap from
14688 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
14689 allow conditional traps on architectures that support them and
14690 @option{-mdivide-breaks} to force the use of breaks.
14692 The default is usually @option{-mdivide-traps}, but this can be
14693 overridden at configure time using @option{--with-divide=breaks}.
14694 Divide-by-zero checks can be completely disabled using
14695 @option{-mno-check-zero-division}.
14697 @item -mmemcpy
14698 @itemx -mno-memcpy
14699 @opindex mmemcpy
14700 @opindex mno-memcpy
14701 Force (do not force) the use of @code{memcpy()} for non-trivial block
14702 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
14703 most constant-sized copies.
14705 @item -mlong-calls
14706 @itemx -mno-long-calls
14707 @opindex mlong-calls
14708 @opindex mno-long-calls
14709 Disable (do not disable) use of the @code{jal} instruction.  Calling
14710 functions using @code{jal} is more efficient but requires the caller
14711 and callee to be in the same 256 megabyte segment.
14713 This option has no effect on abicalls code.  The default is
14714 @option{-mno-long-calls}.
14716 @item -mmad
14717 @itemx -mno-mad
14718 @opindex mmad
14719 @opindex mno-mad
14720 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
14721 instructions, as provided by the R4650 ISA@.
14723 @item -mfused-madd
14724 @itemx -mno-fused-madd
14725 @opindex mfused-madd
14726 @opindex mno-fused-madd
14727 Enable (disable) use of the floating point multiply-accumulate
14728 instructions, when they are available.  The default is
14729 @option{-mfused-madd}.
14731 When multiply-accumulate instructions are used, the intermediate
14732 product is calculated to infinite precision and is not subject to
14733 the FCSR Flush to Zero bit.  This may be undesirable in some
14734 circumstances.
14736 @item -nocpp
14737 @opindex nocpp
14738 Tell the MIPS assembler to not run its preprocessor over user
14739 assembler files (with a @samp{.s} suffix) when assembling them.
14741 @item -mfix-24k
14742 @item -mno-fix-24k
14743 @opindex mfix-24k
14744 @opindex mno-fix-24k
14745 Work around the 24K E48 (lost data on stores during refill) errata.
14746 The workarounds are implemented by the assembler rather than by GCC.
14748 @item -mfix-r4000
14749 @itemx -mno-fix-r4000
14750 @opindex mfix-r4000
14751 @opindex mno-fix-r4000
14752 Work around certain R4000 CPU errata:
14753 @itemize @minus
14754 @item
14755 A double-word or a variable shift may give an incorrect result if executed
14756 immediately after starting an integer division.
14757 @item
14758 A double-word or a variable shift may give an incorrect result if executed
14759 while an integer multiplication is in progress.
14760 @item
14761 An integer division may give an incorrect result if started in a delay slot
14762 of a taken branch or a jump.
14763 @end itemize
14765 @item -mfix-r4400
14766 @itemx -mno-fix-r4400
14767 @opindex mfix-r4400
14768 @opindex mno-fix-r4400
14769 Work around certain R4400 CPU errata:
14770 @itemize @minus
14771 @item
14772 A double-word or a variable shift may give an incorrect result if executed
14773 immediately after starting an integer division.
14774 @end itemize
14776 @item -mfix-r10000
14777 @itemx -mno-fix-r10000
14778 @opindex mfix-r10000
14779 @opindex mno-fix-r10000
14780 Work around certain R10000 errata:
14781 @itemize @minus
14782 @item
14783 @code{ll}/@code{sc} sequences may not behave atomically on revisions
14784 prior to 3.0.  They may deadlock on revisions 2.6 and earlier.
14785 @end itemize
14787 This option can only be used if the target architecture supports
14788 branch-likely instructions.  @option{-mfix-r10000} is the default when
14789 @option{-march=r10000} is used; @option{-mno-fix-r10000} is the default
14790 otherwise.
14792 @item -mfix-vr4120
14793 @itemx -mno-fix-vr4120
14794 @opindex mfix-vr4120
14795 Work around certain VR4120 errata:
14796 @itemize @minus
14797 @item
14798 @code{dmultu} does not always produce the correct result.
14799 @item
14800 @code{div} and @code{ddiv} do not always produce the correct result if one
14801 of the operands is negative.
14802 @end itemize
14803 The workarounds for the division errata rely on special functions in
14804 @file{libgcc.a}.  At present, these functions are only provided by
14805 the @code{mips64vr*-elf} configurations.
14807 Other VR4120 errata require a nop to be inserted between certain pairs of
14808 instructions.  These errata are handled by the assembler, not by GCC itself.
14810 @item -mfix-vr4130
14811 @opindex mfix-vr4130
14812 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
14813 workarounds are implemented by the assembler rather than by GCC,
14814 although GCC will avoid using @code{mflo} and @code{mfhi} if the
14815 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
14816 instructions are available instead.
14818 @item -mfix-sb1
14819 @itemx -mno-fix-sb1
14820 @opindex mfix-sb1
14821 Work around certain SB-1 CPU core errata.
14822 (This flag currently works around the SB-1 revision 2
14823 ``F1'' and ``F2'' floating point errata.)
14825 @item -mr10k-cache-barrier=@var{setting}
14826 @opindex mr10k-cache-barrier
14827 Specify whether GCC should insert cache barriers to avoid the
14828 side-effects of speculation on R10K processors.
14830 In common with many processors, the R10K tries to predict the outcome
14831 of a conditional branch and speculatively executes instructions from
14832 the ``taken'' branch.  It later aborts these instructions if the
14833 predicted outcome was wrong.  However, on the R10K, even aborted
14834 instructions can have side effects.
14836 This problem only affects kernel stores and, depending on the system,
14837 kernel loads.  As an example, a speculatively-executed store may load
14838 the target memory into cache and mark the cache line as dirty, even if
14839 the store itself is later aborted.  If a DMA operation writes to the
14840 same area of memory before the ``dirty'' line is flushed, the cached
14841 data will overwrite the DMA-ed data.  See the R10K processor manual
14842 for a full description, including other potential problems.
14844 One workaround is to insert cache barrier instructions before every memory
14845 access that might be speculatively executed and that might have side
14846 effects even if aborted.  @option{-mr10k-cache-barrier=@var{setting}}
14847 controls GCC's implementation of this workaround.  It assumes that
14848 aborted accesses to any byte in the following regions will not have
14849 side effects:
14851 @enumerate
14852 @item
14853 the memory occupied by the current function's stack frame;
14855 @item
14856 the memory occupied by an incoming stack argument;
14858 @item
14859 the memory occupied by an object with a link-time-constant address.
14860 @end enumerate
14862 It is the kernel's responsibility to ensure that speculative
14863 accesses to these regions are indeed safe.
14865 If the input program contains a function declaration such as:
14867 @smallexample
14868 void foo (void);
14869 @end smallexample
14871 then the implementation of @code{foo} must allow @code{j foo} and
14872 @code{jal foo} to be executed speculatively.  GCC honors this
14873 restriction for functions it compiles itself.  It expects non-GCC
14874 functions (such as hand-written assembly code) to do the same.
14876 The option has three forms:
14878 @table @gcctabopt
14879 @item -mr10k-cache-barrier=load-store
14880 Insert a cache barrier before a load or store that might be
14881 speculatively executed and that might have side effects even
14882 if aborted.
14884 @item -mr10k-cache-barrier=store
14885 Insert a cache barrier before a store that might be speculatively
14886 executed and that might have side effects even if aborted.
14888 @item -mr10k-cache-barrier=none
14889 Disable the insertion of cache barriers.  This is the default setting.
14890 @end table
14892 @item -mflush-func=@var{func}
14893 @itemx -mno-flush-func
14894 @opindex mflush-func
14895 Specifies the function to call to flush the I and D caches, or to not
14896 call any such function.  If called, the function must take the same
14897 arguments as the common @code{_flush_func()}, that is, the address of the
14898 memory range for which the cache is being flushed, the size of the
14899 memory range, and the number 3 (to flush both caches).  The default
14900 depends on the target GCC was configured for, but commonly is either
14901 @samp{_flush_func} or @samp{__cpu_flush}.
14903 @item mbranch-cost=@var{num}
14904 @opindex mbranch-cost
14905 Set the cost of branches to roughly @var{num} ``simple'' instructions.
14906 This cost is only a heuristic and is not guaranteed to produce
14907 consistent results across releases.  A zero cost redundantly selects
14908 the default, which is based on the @option{-mtune} setting.
14910 @item -mbranch-likely
14911 @itemx -mno-branch-likely
14912 @opindex mbranch-likely
14913 @opindex mno-branch-likely
14914 Enable or disable use of Branch Likely instructions, regardless of the
14915 default for the selected architecture.  By default, Branch Likely
14916 instructions may be generated if they are supported by the selected
14917 architecture.  An exception is for the MIPS32 and MIPS64 architectures
14918 and processors which implement those architectures; for those, Branch
14919 Likely instructions will not be generated by default because the MIPS32
14920 and MIPS64 architectures specifically deprecate their use.
14922 @item -mfp-exceptions
14923 @itemx -mno-fp-exceptions
14924 @opindex mfp-exceptions
14925 Specifies whether FP exceptions are enabled.  This affects how we schedule
14926 FP instructions for some processors.  The default is that FP exceptions are
14927 enabled.
14929 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
14930 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
14931 FP pipe.
14933 @item -mvr4130-align
14934 @itemx -mno-vr4130-align
14935 @opindex mvr4130-align
14936 The VR4130 pipeline is two-way superscalar, but can only issue two
14937 instructions together if the first one is 8-byte aligned.  When this
14938 option is enabled, GCC will align pairs of instructions that it
14939 thinks should execute in parallel.
14941 This option only has an effect when optimizing for the VR4130.
14942 It normally makes code faster, but at the expense of making it bigger.
14943 It is enabled by default at optimization level @option{-O3}.
14945 @item -msynci
14946 @itemx -mno-synci
14947 @opindex msynci
14948 Enable (disable) generation of @code{synci} instructions on
14949 architectures that support it.  The @code{synci} instructions (if
14950 enabled) will be generated when @code{__builtin___clear_cache()} is
14951 compiled.
14953 This option defaults to @code{-mno-synci}, but the default can be
14954 overridden by configuring with @code{--with-synci}.
14956 When compiling code for single processor systems, it is generally safe
14957 to use @code{synci}.  However, on many multi-core (SMP) systems, it
14958 will not invalidate the instruction caches on all cores and may lead
14959 to undefined behavior.
14961 @item -mrelax-pic-calls
14962 @itemx -mno-relax-pic-calls
14963 @opindex mrelax-pic-calls
14964 Try to turn PIC calls that are normally dispatched via register
14965 @code{$25} into direct calls.  This is only possible if the linker can
14966 resolve the destination at link-time and if the destination is within
14967 range for a direct call.
14969 @option{-mrelax-pic-calls} is the default if GCC was configured to use
14970 an assembler and a linker that supports the @code{.reloc} assembly
14971 directive and @code{-mexplicit-relocs} is in effect.  With
14972 @code{-mno-explicit-relocs}, this optimization can be performed by the
14973 assembler and the linker alone without help from the compiler.
14975 @item -mmcount-ra-address
14976 @itemx -mno-mcount-ra-address
14977 @opindex mmcount-ra-address
14978 @opindex mno-mcount-ra-address
14979 Emit (do not emit) code that allows @code{_mcount} to modify the
14980 calling function's return address.  When enabled, this option extends
14981 the usual @code{_mcount} interface with a new @var{ra-address}
14982 parameter, which has type @code{intptr_t *} and is passed in register
14983 @code{$12}.  @code{_mcount} can then modify the return address by
14984 doing both of the following:
14985 @itemize
14986 @item
14987 Returning the new address in register @code{$31}.
14988 @item
14989 Storing the new address in @code{*@var{ra-address}},
14990 if @var{ra-address} is nonnull.
14991 @end itemize
14993 The default is @option{-mno-mcount-ra-address}.
14995 @end table
14997 @node MMIX Options
14998 @subsection MMIX Options
14999 @cindex MMIX Options
15001 These options are defined for the MMIX:
15003 @table @gcctabopt
15004 @item -mlibfuncs
15005 @itemx -mno-libfuncs
15006 @opindex mlibfuncs
15007 @opindex mno-libfuncs
15008 Specify that intrinsic library functions are being compiled, passing all
15009 values in registers, no matter the size.
15011 @item -mepsilon
15012 @itemx -mno-epsilon
15013 @opindex mepsilon
15014 @opindex mno-epsilon
15015 Generate floating-point comparison instructions that compare with respect
15016 to the @code{rE} epsilon register.
15018 @item -mabi=mmixware
15019 @itemx -mabi=gnu
15020 @opindex mabi=mmixware
15021 @opindex mabi=gnu
15022 Generate code that passes function parameters and return values that (in
15023 the called function) are seen as registers @code{$0} and up, as opposed to
15024 the GNU ABI which uses global registers @code{$231} and up.
15026 @item -mzero-extend
15027 @itemx -mno-zero-extend
15028 @opindex mzero-extend
15029 @opindex mno-zero-extend
15030 When reading data from memory in sizes shorter than 64 bits, use (do not
15031 use) zero-extending load instructions by default, rather than
15032 sign-extending ones.
15034 @item -mknuthdiv
15035 @itemx -mno-knuthdiv
15036 @opindex mknuthdiv
15037 @opindex mno-knuthdiv
15038 Make the result of a division yielding a remainder have the same sign as
15039 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
15040 remainder follows the sign of the dividend.  Both methods are
15041 arithmetically valid, the latter being almost exclusively used.
15043 @item -mtoplevel-symbols
15044 @itemx -mno-toplevel-symbols
15045 @opindex mtoplevel-symbols
15046 @opindex mno-toplevel-symbols
15047 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
15048 code can be used with the @code{PREFIX} assembly directive.
15050 @item -melf
15051 @opindex melf
15052 Generate an executable in the ELF format, rather than the default
15053 @samp{mmo} format used by the @command{mmix} simulator.
15055 @item -mbranch-predict
15056 @itemx -mno-branch-predict
15057 @opindex mbranch-predict
15058 @opindex mno-branch-predict
15059 Use (do not use) the probable-branch instructions, when static branch
15060 prediction indicates a probable branch.
15062 @item -mbase-addresses
15063 @itemx -mno-base-addresses
15064 @opindex mbase-addresses
15065 @opindex mno-base-addresses
15066 Generate (do not generate) code that uses @emph{base addresses}.  Using a
15067 base address automatically generates a request (handled by the assembler
15068 and the linker) for a constant to be set up in a global register.  The
15069 register is used for one or more base address requests within the range 0
15070 to 255 from the value held in the register.  The generally leads to short
15071 and fast code, but the number of different data items that can be
15072 addressed is limited.  This means that a program that uses lots of static
15073 data may require @option{-mno-base-addresses}.
15075 @item -msingle-exit
15076 @itemx -mno-single-exit
15077 @opindex msingle-exit
15078 @opindex mno-single-exit
15079 Force (do not force) generated code to have a single exit point in each
15080 function.
15081 @end table
15083 @node MN10300 Options
15084 @subsection MN10300 Options
15085 @cindex MN10300 options
15087 These @option{-m} options are defined for Matsushita MN10300 architectures:
15089 @table @gcctabopt
15090 @item -mmult-bug
15091 @opindex mmult-bug
15092 Generate code to avoid bugs in the multiply instructions for the MN10300
15093 processors.  This is the default.
15095 @item -mno-mult-bug
15096 @opindex mno-mult-bug
15097 Do not generate code to avoid bugs in the multiply instructions for the
15098 MN10300 processors.
15100 @item -mam33
15101 @opindex mam33
15102 Generate code which uses features specific to the AM33 processor.
15104 @item -mno-am33
15105 @opindex mno-am33
15106 Do not generate code which uses features specific to the AM33 processor.  This
15107 is the default.
15109 @item -mam33-2
15110 @opindex mam33-2
15111 Generate code which uses features specific to the AM33/2.0 processor.
15113 @item -mam34
15114 @opindex mam34
15115 Generate code which uses features specific to the AM34 processor.
15117 @item -mtune=@var{cpu-type}
15118 @opindex mtune
15119 Use the timing characteristics of the indicated CPU type when
15120 scheduling instructions.  This does not change the targeted processor
15121 type.  The CPU type must be one of @samp{mn10300}, @samp{am33},
15122 @samp{am33-2} or @samp{am34}.
15124 @item -mreturn-pointer-on-d0
15125 @opindex mreturn-pointer-on-d0
15126 When generating a function which returns a pointer, return the pointer
15127 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
15128 only in a0, and attempts to call such functions without a prototype
15129 would result in errors.  Note that this option is on by default; use
15130 @option{-mno-return-pointer-on-d0} to disable it.
15132 @item -mno-crt0
15133 @opindex mno-crt0
15134 Do not link in the C run-time initialization object file.
15136 @item -mrelax
15137 @opindex mrelax
15138 Indicate to the linker that it should perform a relaxation optimization pass
15139 to shorten branches, calls and absolute memory addresses.  This option only
15140 has an effect when used on the command line for the final link step.
15142 This option makes symbolic debugging impossible.
15144 @item -mliw
15145 @opindex mliw
15146 Allow the compiler to generate @emph{Long Instruction Word}
15147 instructions if the target is the @samp{AM33} or later.  This is the
15148 default.  This option defines the preprocessor macro @samp{__LIW__}.
15150 @item -mnoliw
15151 @opindex mnoliw
15152 Do not allow the compiler to generate @emph{Long Instruction Word}
15153 instructions.  This option defines the preprocessor macro
15154 @samp{__NO_LIW__}.
15156 @item -msetlb
15157 @opindex msetlb
15158 Allow the compiler to generate the @emph{SETLB} and @emph{Lcc}
15159 instructions if the target is the @samp{AM33} or later.  This is the
15160 default.  This option defines the preprocessor macro @samp{__SETLB__}.
15162 @item -mnosetlb
15163 @opindex mnosetlb
15164 Do not allow the compiler to generate @emph{SETLB} or @emph{Lcc}
15165 instructions.  This option defines the preprocessor macro
15166 @samp{__NO_SETLB__}.
15168 @end table
15170 @node PDP-11 Options
15171 @subsection PDP-11 Options
15172 @cindex PDP-11 Options
15174 These options are defined for the PDP-11:
15176 @table @gcctabopt
15177 @item -mfpu
15178 @opindex mfpu
15179 Use hardware FPP floating point.  This is the default.  (FIS floating
15180 point on the PDP-11/40 is not supported.)
15182 @item -msoft-float
15183 @opindex msoft-float
15184 Do not use hardware floating point.
15186 @item -mac0
15187 @opindex mac0
15188 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
15190 @item -mno-ac0
15191 @opindex mno-ac0
15192 Return floating-point results in memory.  This is the default.
15194 @item -m40
15195 @opindex m40
15196 Generate code for a PDP-11/40.
15198 @item -m45
15199 @opindex m45
15200 Generate code for a PDP-11/45.  This is the default.
15202 @item -m10
15203 @opindex m10
15204 Generate code for a PDP-11/10.
15206 @item -mbcopy-builtin
15207 @opindex mbcopy-builtin
15208 Use inline @code{movmemhi} patterns for copying memory.  This is the
15209 default.
15211 @item -mbcopy
15212 @opindex mbcopy
15213 Do not use inline @code{movmemhi} patterns for copying memory.
15215 @item -mint16
15216 @itemx -mno-int32
15217 @opindex mint16
15218 @opindex mno-int32
15219 Use 16-bit @code{int}.  This is the default.
15221 @item -mint32
15222 @itemx -mno-int16
15223 @opindex mint32
15224 @opindex mno-int16
15225 Use 32-bit @code{int}.
15227 @item -mfloat64
15228 @itemx -mno-float32
15229 @opindex mfloat64
15230 @opindex mno-float32
15231 Use 64-bit @code{float}.  This is the default.
15233 @item -mfloat32
15234 @itemx -mno-float64
15235 @opindex mfloat32
15236 @opindex mno-float64
15237 Use 32-bit @code{float}.
15239 @item -mabshi
15240 @opindex mabshi
15241 Use @code{abshi2} pattern.  This is the default.
15243 @item -mno-abshi
15244 @opindex mno-abshi
15245 Do not use @code{abshi2} pattern.
15247 @item -mbranch-expensive
15248 @opindex mbranch-expensive
15249 Pretend that branches are expensive.  This is for experimenting with
15250 code generation only.
15252 @item -mbranch-cheap
15253 @opindex mbranch-cheap
15254 Do not pretend that branches are expensive.  This is the default.
15256 @item -munix-asm
15257 @opindex munix-asm
15258 Use Unix assembler syntax.  This is the default when configured for
15259 @samp{pdp11-*-bsd}.
15261 @item -mdec-asm
15262 @opindex mdec-asm
15263 Use DEC assembler syntax.  This is the default when configured for any
15264 PDP-11 target other than @samp{pdp11-*-bsd}.
15265 @end table
15267 @node picoChip Options
15268 @subsection picoChip Options
15269 @cindex picoChip options
15271 These @samp{-m} options are defined for picoChip implementations:
15273 @table @gcctabopt
15275 @item -mae=@var{ae_type}
15276 @opindex mcpu
15277 Set the instruction set, register set, and instruction scheduling
15278 parameters for array element type @var{ae_type}.  Supported values
15279 for @var{ae_type} are @samp{ANY}, @samp{MUL}, and @samp{MAC}.
15281 @option{-mae=ANY} selects a completely generic AE type.  Code
15282 generated with this option will run on any of the other AE types.  The
15283 code will not be as efficient as it would be if compiled for a specific
15284 AE type, and some types of operation (e.g., multiplication) will not
15285 work properly on all types of AE.
15287 @option{-mae=MUL} selects a MUL AE type.  This is the most useful AE type
15288 for compiled code, and is the default.
15290 @option{-mae=MAC} selects a DSP-style MAC AE.  Code compiled with this
15291 option may suffer from poor performance of byte (char) manipulation,
15292 since the DSP AE does not provide hardware support for byte load/stores.
15294 @item -msymbol-as-address
15295 Enable the compiler to directly use a symbol name as an address in a
15296 load/store instruction, without first loading it into a
15297 register.  Typically, the use of this option will generate larger
15298 programs, which run faster than when the option isn't used.  However, the
15299 results vary from program to program, so it is left as a user option,
15300 rather than being permanently enabled.
15302 @item -mno-inefficient-warnings
15303 Disables warnings about the generation of inefficient code.  These
15304 warnings can be generated, for example, when compiling code which
15305 performs byte-level memory operations on the MAC AE type.  The MAC AE has
15306 no hardware support for byte-level memory operations, so all byte
15307 load/stores must be synthesized from word load/store operations.  This is
15308 inefficient and a warning will be generated indicating to the programmer
15309 that they should rewrite the code to avoid byte operations, or to target
15310 an AE type which has the necessary hardware support.  This option enables
15311 the warning to be turned off.
15313 @end table
15315 @node PowerPC Options
15316 @subsection PowerPC Options
15317 @cindex PowerPC options
15319 These are listed under @xref{RS/6000 and PowerPC Options}.
15321 @node RS/6000 and PowerPC Options
15322 @subsection IBM RS/6000 and PowerPC Options
15323 @cindex RS/6000 and PowerPC Options
15324 @cindex IBM RS/6000 and PowerPC Options
15326 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
15327 @table @gcctabopt
15328 @item -mpower
15329 @itemx -mno-power
15330 @itemx -mpower2
15331 @itemx -mno-power2
15332 @itemx -mpowerpc
15333 @itemx -mno-powerpc
15334 @itemx -mpowerpc-gpopt
15335 @itemx -mno-powerpc-gpopt
15336 @itemx -mpowerpc-gfxopt
15337 @itemx -mno-powerpc-gfxopt
15338 @need 800
15339 @itemx -mpowerpc64
15340 @itemx -mno-powerpc64
15341 @itemx -mmfcrf
15342 @itemx -mno-mfcrf
15343 @itemx -mpopcntb
15344 @itemx -mno-popcntb
15345 @itemx -mpopcntd
15346 @itemx -mno-popcntd
15347 @itemx -mfprnd
15348 @itemx -mno-fprnd
15349 @need 800
15350 @itemx -mcmpb
15351 @itemx -mno-cmpb
15352 @itemx -mmfpgpr
15353 @itemx -mno-mfpgpr
15354 @itemx -mhard-dfp
15355 @itemx -mno-hard-dfp
15356 @opindex mpower
15357 @opindex mno-power
15358 @opindex mpower2
15359 @opindex mno-power2
15360 @opindex mpowerpc
15361 @opindex mno-powerpc
15362 @opindex mpowerpc-gpopt
15363 @opindex mno-powerpc-gpopt
15364 @opindex mpowerpc-gfxopt
15365 @opindex mno-powerpc-gfxopt
15366 @opindex mpowerpc64
15367 @opindex mno-powerpc64
15368 @opindex mmfcrf
15369 @opindex mno-mfcrf
15370 @opindex mpopcntb
15371 @opindex mno-popcntb
15372 @opindex mpopcntd
15373 @opindex mno-popcntd
15374 @opindex mfprnd
15375 @opindex mno-fprnd
15376 @opindex mcmpb
15377 @opindex mno-cmpb
15378 @opindex mmfpgpr
15379 @opindex mno-mfpgpr
15380 @opindex mhard-dfp
15381 @opindex mno-hard-dfp
15382 GCC supports two related instruction set architectures for the
15383 RS/6000 and PowerPC@.  The @dfn{POWER} instruction set are those
15384 instructions supported by the @samp{rios} chip set used in the original
15385 RS/6000 systems and the @dfn{PowerPC} instruction set is the
15386 architecture of the Freescale MPC5xx, MPC6xx, MPC8xx microprocessors, and
15387 the IBM 4xx, 6xx, and follow-on microprocessors.
15389 Neither architecture is a subset of the other.  However there is a
15390 large common subset of instructions supported by both.  An MQ
15391 register is included in processors supporting the POWER architecture.
15393 You use these options to specify which instructions are available on the
15394 processor you are using.  The default value of these options is
15395 determined when configuring GCC@.  Specifying the
15396 @option{-mcpu=@var{cpu_type}} overrides the specification of these
15397 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
15398 rather than the options listed above.
15400 The @option{-mpower} option allows GCC to generate instructions that
15401 are found only in the POWER architecture and to use the MQ register.
15402 Specifying @option{-mpower2} implies @option{-power} and also allows GCC
15403 to generate instructions that are present in the POWER2 architecture but
15404 not the original POWER architecture.
15406 The @option{-mpowerpc} option allows GCC to generate instructions that
15407 are found only in the 32-bit subset of the PowerPC architecture.
15408 Specifying @option{-mpowerpc-gpopt} implies @option{-mpowerpc} and also allows
15409 GCC to use the optional PowerPC architecture instructions in the
15410 General Purpose group, including floating-point square root.  Specifying
15411 @option{-mpowerpc-gfxopt} implies @option{-mpowerpc} and also allows GCC to
15412 use the optional PowerPC architecture instructions in the Graphics
15413 group, including floating-point select.
15415 The @option{-mmfcrf} option allows GCC to generate the move from
15416 condition register field instruction implemented on the POWER4
15417 processor and other processors that support the PowerPC V2.01
15418 architecture.
15419 The @option{-mpopcntb} option allows GCC to generate the popcount and
15420 double precision FP reciprocal estimate instruction implemented on the
15421 POWER5 processor and other processors that support the PowerPC V2.02
15422 architecture.
15423 The @option{-mpopcntd} option allows GCC to generate the popcount
15424 instruction implemented on the POWER7 processor and other processors
15425 that support the PowerPC V2.06 architecture.
15426 The @option{-mfprnd} option allows GCC to generate the FP round to
15427 integer instructions implemented on the POWER5+ processor and other
15428 processors that support the PowerPC V2.03 architecture.
15429 The @option{-mcmpb} option allows GCC to generate the compare bytes
15430 instruction implemented on the POWER6 processor and other processors
15431 that support the PowerPC V2.05 architecture.
15432 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
15433 general purpose register instructions implemented on the POWER6X
15434 processor and other processors that support the extended PowerPC V2.05
15435 architecture.
15436 The @option{-mhard-dfp} option allows GCC to generate the decimal floating
15437 point instructions implemented on some POWER processors.
15439 The @option{-mpowerpc64} option allows GCC to generate the additional
15440 64-bit instructions that are found in the full PowerPC64 architecture
15441 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
15442 @option{-mno-powerpc64}.
15444 If you specify both @option{-mno-power} and @option{-mno-powerpc}, GCC
15445 will use only the instructions in the common subset of both
15446 architectures plus some special AIX common-mode calls, and will not use
15447 the MQ register.  Specifying both @option{-mpower} and @option{-mpowerpc}
15448 permits GCC to use any instruction from either architecture and to
15449 allow use of the MQ register; specify this for the Motorola MPC601.
15451 @item -mnew-mnemonics
15452 @itemx -mold-mnemonics
15453 @opindex mnew-mnemonics
15454 @opindex mold-mnemonics
15455 Select which mnemonics to use in the generated assembler code.  With
15456 @option{-mnew-mnemonics}, GCC uses the assembler mnemonics defined for
15457 the PowerPC architecture.  With @option{-mold-mnemonics} it uses the
15458 assembler mnemonics defined for the POWER architecture.  Instructions
15459 defined in only one architecture have only one mnemonic; GCC uses that
15460 mnemonic irrespective of which of these options is specified.
15462 GCC defaults to the mnemonics appropriate for the architecture in
15463 use.  Specifying @option{-mcpu=@var{cpu_type}} sometimes overrides the
15464 value of these option.  Unless you are building a cross-compiler, you
15465 should normally not specify either @option{-mnew-mnemonics} or
15466 @option{-mold-mnemonics}, but should instead accept the default.
15468 @item -mcpu=@var{cpu_type}
15469 @opindex mcpu
15470 Set architecture type, register usage, choice of mnemonics, and
15471 instruction scheduling parameters for machine type @var{cpu_type}.
15472 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
15473 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{464}, @samp{464fp},
15474 @samp{476}, @samp{476fp}, @samp{505}, @samp{601}, @samp{602}, @samp{603},
15475 @samp{603e}, @samp{604}, @samp{604e}, @samp{620}, @samp{630}, @samp{740},
15476 @samp{7400}, @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
15477 @samp{860}, @samp{970}, @samp{8540}, @samp{a2}, @samp{e300c2},
15478 @samp{e300c3}, @samp{e500mc}, @samp{e500mc64}, @samp{ec603e}, @samp{G3},
15479 @samp{G4}, @samp{G5}, @samp{titan}, @samp{power}, @samp{power2}, @samp{power3},
15480 @samp{power4}, @samp{power5}, @samp{power5+}, @samp{power6}, @samp{power6x},
15481 @samp{power7}, @samp{common}, @samp{powerpc}, @samp{powerpc64}, @samp{rios},
15482 @samp{rios1}, @samp{rios2}, @samp{rsc}, and @samp{rs64}.
15484 @option{-mcpu=common} selects a completely generic processor.  Code
15485 generated under this option will run on any POWER or PowerPC processor.
15486 GCC will use only the instructions in the common subset of both
15487 architectures, and will not use the MQ register.  GCC assumes a generic
15488 processor model for scheduling purposes.
15490 @option{-mcpu=power}, @option{-mcpu=power2}, @option{-mcpu=powerpc}, and
15491 @option{-mcpu=powerpc64} specify generic POWER, POWER2, pure 32-bit
15492 PowerPC (i.e., not MPC601), and 64-bit PowerPC architecture machine
15493 types, with an appropriate, generic processor model assumed for
15494 scheduling purposes.
15496 The other options specify a specific processor.  Code generated under
15497 those options will run best on that processor, and may not run at all on
15498 others.
15500 The @option{-mcpu} options automatically enable or disable the
15501 following options:
15503 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
15504 -mnew-mnemonics  -mpopcntb -mpopcntd  -mpower  -mpower2  -mpowerpc64 @gol
15505 -mpowerpc-gpopt  -mpowerpc-gfxopt  -msingle-float -mdouble-float @gol
15506 -msimple-fpu -mstring  -mmulhw  -mdlmzb  -mmfpgpr -mvsx}
15508 The particular options set for any particular CPU will vary between
15509 compiler versions, depending on what setting seems to produce optimal
15510 code for that CPU; it doesn't necessarily reflect the actual hardware's
15511 capabilities.  If you wish to set an individual option to a particular
15512 value, you may specify it after the @option{-mcpu} option, like
15513 @samp{-mcpu=970 -mno-altivec}.
15515 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
15516 not enabled or disabled by the @option{-mcpu} option at present because
15517 AIX does not have full support for these options.  You may still
15518 enable or disable them individually if you're sure it'll work in your
15519 environment.
15521 @item -mtune=@var{cpu_type}
15522 @opindex mtune
15523 Set the instruction scheduling parameters for machine type
15524 @var{cpu_type}, but do not set the architecture type, register usage, or
15525 choice of mnemonics, as @option{-mcpu=@var{cpu_type}} would.  The same
15526 values for @var{cpu_type} are used for @option{-mtune} as for
15527 @option{-mcpu}.  If both are specified, the code generated will use the
15528 architecture, registers, and mnemonics set by @option{-mcpu}, but the
15529 scheduling parameters set by @option{-mtune}.
15531 @item -mcmodel=small
15532 @opindex mcmodel=small
15533 Generate PowerPC64 code for the small model: The TOC is limited to
15534 64k.
15536 @item -mcmodel=medium
15537 @opindex mcmodel=medium
15538 Generate PowerPC64 code for the medium model: The TOC and other static
15539 data may be up to a total of 4G in size.
15541 @item -mcmodel=large
15542 @opindex mcmodel=large
15543 Generate PowerPC64 code for the large model: The TOC may be up to 4G
15544 in size.  Other data and code is only limited by the 64-bit address
15545 space.
15547 @item -maltivec
15548 @itemx -mno-altivec
15549 @opindex maltivec
15550 @opindex mno-altivec
15551 Generate code that uses (does not use) AltiVec instructions, and also
15552 enable the use of built-in functions that allow more direct access to
15553 the AltiVec instruction set.  You may also need to set
15554 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
15555 enhancements.
15557 @item -mvrsave
15558 @itemx -mno-vrsave
15559 @opindex mvrsave
15560 @opindex mno-vrsave
15561 Generate VRSAVE instructions when generating AltiVec code.
15563 @item -mgen-cell-microcode
15564 @opindex mgen-cell-microcode
15565 Generate Cell microcode instructions
15567 @item -mwarn-cell-microcode
15568 @opindex mwarn-cell-microcode
15569 Warning when a Cell microcode instruction is going to emitted.  An example
15570 of a Cell microcode instruction is a variable shift.
15572 @item -msecure-plt
15573 @opindex msecure-plt
15574 Generate code that allows ld and ld.so to build executables and shared
15575 libraries with non-exec .plt and .got sections.  This is a PowerPC
15576 32-bit SYSV ABI option.
15578 @item -mbss-plt
15579 @opindex mbss-plt
15580 Generate code that uses a BSS .plt section that ld.so fills in, and
15581 requires .plt and .got sections that are both writable and executable.
15582 This is a PowerPC 32-bit SYSV ABI option.
15584 @item -misel
15585 @itemx -mno-isel
15586 @opindex misel
15587 @opindex mno-isel
15588 This switch enables or disables the generation of ISEL instructions.
15590 @item -misel=@var{yes/no}
15591 This switch has been deprecated.  Use @option{-misel} and
15592 @option{-mno-isel} instead.
15594 @item -mspe
15595 @itemx -mno-spe
15596 @opindex mspe
15597 @opindex mno-spe
15598 This switch enables or disables the generation of SPE simd
15599 instructions.
15601 @item -mpaired
15602 @itemx -mno-paired
15603 @opindex mpaired
15604 @opindex mno-paired
15605 This switch enables or disables the generation of PAIRED simd
15606 instructions.
15608 @item -mspe=@var{yes/no}
15609 This option has been deprecated.  Use @option{-mspe} and
15610 @option{-mno-spe} instead.
15612 @item -mvsx
15613 @itemx -mno-vsx
15614 @opindex mvsx
15615 @opindex mno-vsx
15616 Generate code that uses (does not use) vector/scalar (VSX)
15617 instructions, and also enable the use of built-in functions that allow
15618 more direct access to the VSX instruction set.
15620 @item -mfloat-gprs=@var{yes/single/double/no}
15621 @itemx -mfloat-gprs
15622 @opindex mfloat-gprs
15623 This switch enables or disables the generation of floating point
15624 operations on the general purpose registers for architectures that
15625 support it.
15627 The argument @var{yes} or @var{single} enables the use of
15628 single-precision floating point operations.
15630 The argument @var{double} enables the use of single and
15631 double-precision floating point operations.
15633 The argument @var{no} disables floating point operations on the
15634 general purpose registers.
15636 This option is currently only available on the MPC854x.
15638 @item -m32
15639 @itemx -m64
15640 @opindex m32
15641 @opindex m64
15642 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
15643 targets (including GNU/Linux).  The 32-bit environment sets int, long
15644 and pointer to 32 bits and generates code that runs on any PowerPC
15645 variant.  The 64-bit environment sets int to 32 bits and long and
15646 pointer to 64 bits, and generates code for PowerPC64, as for
15647 @option{-mpowerpc64}.
15649 @item -mfull-toc
15650 @itemx -mno-fp-in-toc
15651 @itemx -mno-sum-in-toc
15652 @itemx -mminimal-toc
15653 @opindex mfull-toc
15654 @opindex mno-fp-in-toc
15655 @opindex mno-sum-in-toc
15656 @opindex mminimal-toc
15657 Modify generation of the TOC (Table Of Contents), which is created for
15658 every executable file.  The @option{-mfull-toc} option is selected by
15659 default.  In that case, GCC will allocate at least one TOC entry for
15660 each unique non-automatic variable reference in your program.  GCC
15661 will also place floating-point constants in the TOC@.  However, only
15662 16,384 entries are available in the TOC@.
15664 If you receive a linker error message that saying you have overflowed
15665 the available TOC space, you can reduce the amount of TOC space used
15666 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
15667 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
15668 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
15669 generate code to calculate the sum of an address and a constant at
15670 run-time instead of putting that sum into the TOC@.  You may specify one
15671 or both of these options.  Each causes GCC to produce very slightly
15672 slower and larger code at the expense of conserving TOC space.
15674 If you still run out of space in the TOC even when you specify both of
15675 these options, specify @option{-mminimal-toc} instead.  This option causes
15676 GCC to make only one TOC entry for every file.  When you specify this
15677 option, GCC will produce code that is slower and larger but which
15678 uses extremely little TOC space.  You may wish to use this option
15679 only on files that contain less frequently executed code.
15681 @item -maix64
15682 @itemx -maix32
15683 @opindex maix64
15684 @opindex maix32
15685 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
15686 @code{long} type, and the infrastructure needed to support them.
15687 Specifying @option{-maix64} implies @option{-mpowerpc64} and
15688 @option{-mpowerpc}, while @option{-maix32} disables the 64-bit ABI and
15689 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
15691 @item -mxl-compat
15692 @itemx -mno-xl-compat
15693 @opindex mxl-compat
15694 @opindex mno-xl-compat
15695 Produce code that conforms more closely to IBM XL compiler semantics
15696 when using AIX-compatible ABI@.  Pass floating-point arguments to
15697 prototyped functions beyond the register save area (RSA) on the stack
15698 in addition to argument FPRs.  Do not assume that most significant
15699 double in 128-bit long double value is properly rounded when comparing
15700 values and converting to double.  Use XL symbol names for long double
15701 support routines.
15703 The AIX calling convention was extended but not initially documented to
15704 handle an obscure K&R C case of calling a function that takes the
15705 address of its arguments with fewer arguments than declared.  IBM XL
15706 compilers access floating point arguments which do not fit in the
15707 RSA from the stack when a subroutine is compiled without
15708 optimization.  Because always storing floating-point arguments on the
15709 stack is inefficient and rarely needed, this option is not enabled by
15710 default and only is necessary when calling subroutines compiled by IBM
15711 XL compilers without optimization.
15713 @item -mpe
15714 @opindex mpe
15715 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
15716 application written to use message passing with special startup code to
15717 enable the application to run.  The system must have PE installed in the
15718 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
15719 must be overridden with the @option{-specs=} option to specify the
15720 appropriate directory location.  The Parallel Environment does not
15721 support threads, so the @option{-mpe} option and the @option{-pthread}
15722 option are incompatible.
15724 @item -malign-natural
15725 @itemx -malign-power
15726 @opindex malign-natural
15727 @opindex malign-power
15728 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
15729 @option{-malign-natural} overrides the ABI-defined alignment of larger
15730 types, such as floating-point doubles, on their natural size-based boundary.
15731 The option @option{-malign-power} instructs GCC to follow the ABI-specified
15732 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
15734 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
15735 is not supported.
15737 @item -msoft-float
15738 @itemx -mhard-float
15739 @opindex msoft-float
15740 @opindex mhard-float
15741 Generate code that does not use (uses) the floating-point register set.
15742 Software floating point emulation is provided if you use the
15743 @option{-msoft-float} option, and pass the option to GCC when linking.
15745 @item -msingle-float
15746 @itemx -mdouble-float
15747 @opindex msingle-float
15748 @opindex mdouble-float
15749 Generate code for single or double-precision floating point operations.
15750 @option{-mdouble-float} implies @option{-msingle-float}.
15752 @item -msimple-fpu
15753 @opindex msimple-fpu
15754 Do not generate sqrt and div instructions for hardware floating point unit.
15756 @item -mfpu
15757 @opindex mfpu
15758 Specify type of floating point unit.  Valid values are @var{sp_lite}
15759 (equivalent to -msingle-float -msimple-fpu), @var{dp_lite} (equivalent
15760 to -mdouble-float -msimple-fpu), @var{sp_full} (equivalent to -msingle-float),
15761 and @var{dp_full} (equivalent to -mdouble-float).
15763 @item -mxilinx-fpu
15764 @opindex mxilinx-fpu
15765 Perform optimizations for floating point unit on Xilinx PPC 405/440.
15767 @item -mmultiple
15768 @itemx -mno-multiple
15769 @opindex mmultiple
15770 @opindex mno-multiple
15771 Generate code that uses (does not use) the load multiple word
15772 instructions and the store multiple word instructions.  These
15773 instructions are generated by default on POWER systems, and not
15774 generated on PowerPC systems.  Do not use @option{-mmultiple} on little
15775 endian PowerPC systems, since those instructions do not work when the
15776 processor is in little endian mode.  The exceptions are PPC740 and
15777 PPC750 which permit the instructions usage in little endian mode.
15779 @item -mstring
15780 @itemx -mno-string
15781 @opindex mstring
15782 @opindex mno-string
15783 Generate code that uses (does not use) the load string instructions
15784 and the store string word instructions to save multiple registers and
15785 do small block moves.  These instructions are generated by default on
15786 POWER systems, and not generated on PowerPC systems.  Do not use
15787 @option{-mstring} on little endian PowerPC systems, since those
15788 instructions do not work when the processor is in little endian mode.
15789 The exceptions are PPC740 and PPC750 which permit the instructions
15790 usage in little endian mode.
15792 @item -mupdate
15793 @itemx -mno-update
15794 @opindex mupdate
15795 @opindex mno-update
15796 Generate code that uses (does not use) the load or store instructions
15797 that update the base register to the address of the calculated memory
15798 location.  These instructions are generated by default.  If you use
15799 @option{-mno-update}, there is a small window between the time that the
15800 stack pointer is updated and the address of the previous frame is
15801 stored, which means code that walks the stack frame across interrupts or
15802 signals may get corrupted data.
15804 @item -mavoid-indexed-addresses
15805 @itemx -mno-avoid-indexed-addresses
15806 @opindex mavoid-indexed-addresses
15807 @opindex mno-avoid-indexed-addresses
15808 Generate code that tries to avoid (not avoid) the use of indexed load
15809 or store instructions. These instructions can incur a performance
15810 penalty on Power6 processors in certain situations, such as when
15811 stepping through large arrays that cross a 16M boundary.  This option
15812 is enabled by default when targetting Power6 and disabled otherwise.
15814 @item -mfused-madd
15815 @itemx -mno-fused-madd
15816 @opindex mfused-madd
15817 @opindex mno-fused-madd
15818 Generate code that uses (does not use) the floating point multiply and
15819 accumulate instructions.  These instructions are generated by default
15820 if hardware floating point is used.  The machine dependent
15821 @option{-mfused-madd} option is now mapped to the machine independent
15822 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
15823 mapped to @option{-ffp-contract=off}.
15825 @item -mmulhw
15826 @itemx -mno-mulhw
15827 @opindex mmulhw
15828 @opindex mno-mulhw
15829 Generate code that uses (does not use) the half-word multiply and
15830 multiply-accumulate instructions on the IBM 405, 440, 464 and 476 processors.
15831 These instructions are generated by default when targetting those
15832 processors.
15834 @item -mdlmzb
15835 @itemx -mno-dlmzb
15836 @opindex mdlmzb
15837 @opindex mno-dlmzb
15838 Generate code that uses (does not use) the string-search @samp{dlmzb}
15839 instruction on the IBM 405, 440, 464 and 476 processors.  This instruction is
15840 generated by default when targetting those processors.
15842 @item -mno-bit-align
15843 @itemx -mbit-align
15844 @opindex mno-bit-align
15845 @opindex mbit-align
15846 On System V.4 and embedded PowerPC systems do not (do) force structures
15847 and unions that contain bit-fields to be aligned to the base type of the
15848 bit-field.
15850 For example, by default a structure containing nothing but 8
15851 @code{unsigned} bit-fields of length 1 would be aligned to a 4 byte
15852 boundary and have a size of 4 bytes.  By using @option{-mno-bit-align},
15853 the structure would be aligned to a 1 byte boundary and be one byte in
15854 size.
15856 @item -mno-strict-align
15857 @itemx -mstrict-align
15858 @opindex mno-strict-align
15859 @opindex mstrict-align
15860 On System V.4 and embedded PowerPC systems do not (do) assume that
15861 unaligned memory references will be handled by the system.
15863 @item -mrelocatable
15864 @itemx -mno-relocatable
15865 @opindex mrelocatable
15866 @opindex mno-relocatable
15867 Generate code that allows (does not allow) a static executable to be
15868 relocated to a different address at runtime.  A simple embedded
15869 PowerPC system loader should relocate the entire contents of
15870 @code{.got2} and 4-byte locations listed in the @code{.fixup} section,
15871 a table of 32-bit addresses generated by this option.  For this to
15872 work, all objects linked together must be compiled with
15873 @option{-mrelocatable} or @option{-mrelocatable-lib}.
15874 @option{-mrelocatable} code aligns the stack to an 8 byte boundary.
15876 @item -mrelocatable-lib
15877 @itemx -mno-relocatable-lib
15878 @opindex mrelocatable-lib
15879 @opindex mno-relocatable-lib
15880 Like @option{-mrelocatable}, @option{-mrelocatable-lib} generates a
15881 @code{.fixup} section to allow static executables to be relocated at
15882 runtime, but @option{-mrelocatable-lib} does not use the smaller stack
15883 alignment of @option{-mrelocatable}.  Objects compiled with
15884 @option{-mrelocatable-lib} may be linked with objects compiled with
15885 any combination of the @option{-mrelocatable} options.
15887 @item -mno-toc
15888 @itemx -mtoc
15889 @opindex mno-toc
15890 @opindex mtoc
15891 On System V.4 and embedded PowerPC systems do not (do) assume that
15892 register 2 contains a pointer to a global area pointing to the addresses
15893 used in the program.
15895 @item -mlittle
15896 @itemx -mlittle-endian
15897 @opindex mlittle
15898 @opindex mlittle-endian
15899 On System V.4 and embedded PowerPC systems compile code for the
15900 processor in little endian mode.  The @option{-mlittle-endian} option is
15901 the same as @option{-mlittle}.
15903 @item -mbig
15904 @itemx -mbig-endian
15905 @opindex mbig
15906 @opindex mbig-endian
15907 On System V.4 and embedded PowerPC systems compile code for the
15908 processor in big endian mode.  The @option{-mbig-endian} option is
15909 the same as @option{-mbig}.
15911 @item -mdynamic-no-pic
15912 @opindex mdynamic-no-pic
15913 On Darwin and Mac OS X systems, compile code so that it is not
15914 relocatable, but that its external references are relocatable.  The
15915 resulting code is suitable for applications, but not shared
15916 libraries.
15918 @item -msingle-pic-base
15919 @opindex msingle-pic-base
15920 Treat the register used for PIC addressing as read-only, rather than
15921 loading it in the prologue for each function.  The run-time system is
15922 responsible for initializing this register with an appropriate value
15923 before execution begins.
15925 @item -mprioritize-restricted-insns=@var{priority}
15926 @opindex mprioritize-restricted-insns
15927 This option controls the priority that is assigned to
15928 dispatch-slot restricted instructions during the second scheduling
15929 pass.  The argument @var{priority} takes the value @var{0/1/2} to assign
15930 @var{no/highest/second-highest} priority to dispatch slot restricted
15931 instructions.
15933 @item -msched-costly-dep=@var{dependence_type}
15934 @opindex msched-costly-dep
15935 This option controls which dependences are considered costly
15936 by the target during instruction scheduling.  The argument
15937 @var{dependence_type} takes one of the following values:
15938 @var{no}: no dependence is costly,
15939 @var{all}: all dependences are costly,
15940 @var{true_store_to_load}: a true dependence from store to load is costly,
15941 @var{store_to_load}: any dependence from store to load is costly,
15942 @var{number}: any dependence which latency >= @var{number} is costly.
15944 @item -minsert-sched-nops=@var{scheme}
15945 @opindex minsert-sched-nops
15946 This option controls which nop insertion scheme will be used during
15947 the second scheduling pass.  The argument @var{scheme} takes one of the
15948 following values:
15949 @var{no}: Don't insert nops.
15950 @var{pad}: Pad with nops any dispatch group which has vacant issue slots,
15951 according to the scheduler's grouping.
15952 @var{regroup_exact}: Insert nops to force costly dependent insns into
15953 separate groups.  Insert exactly as many nops as needed to force an insn
15954 to a new group, according to the estimated processor grouping.
15955 @var{number}: Insert nops to force costly dependent insns into
15956 separate groups.  Insert @var{number} nops to force an insn to a new group.
15958 @item -mcall-sysv
15959 @opindex mcall-sysv
15960 On System V.4 and embedded PowerPC systems compile code using calling
15961 conventions that adheres to the March 1995 draft of the System V
15962 Application Binary Interface, PowerPC processor supplement.  This is the
15963 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
15965 @item -mcall-sysv-eabi
15966 @itemx -mcall-eabi
15967 @opindex mcall-sysv-eabi
15968 @opindex mcall-eabi
15969 Specify both @option{-mcall-sysv} and @option{-meabi} options.
15971 @item -mcall-sysv-noeabi
15972 @opindex mcall-sysv-noeabi
15973 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
15975 @item -mcall-aixdesc
15976 @opindex m
15977 On System V.4 and embedded PowerPC systems compile code for the AIX
15978 operating system.
15980 @item -mcall-linux
15981 @opindex mcall-linux
15982 On System V.4 and embedded PowerPC systems compile code for the
15983 Linux-based GNU system.
15985 @item -mcall-freebsd
15986 @opindex mcall-freebsd
15987 On System V.4 and embedded PowerPC systems compile code for the
15988 FreeBSD operating system.
15990 @item -mcall-netbsd
15991 @opindex mcall-netbsd
15992 On System V.4 and embedded PowerPC systems compile code for the
15993 NetBSD operating system.
15995 @item -mcall-openbsd
15996 @opindex mcall-netbsd
15997 On System V.4 and embedded PowerPC systems compile code for the
15998 OpenBSD operating system.
16000 @item -maix-struct-return
16001 @opindex maix-struct-return
16002 Return all structures in memory (as specified by the AIX ABI)@.
16004 @item -msvr4-struct-return
16005 @opindex msvr4-struct-return
16006 Return structures smaller than 8 bytes in registers (as specified by the
16007 SVR4 ABI)@.
16009 @item -mabi=@var{abi-type}
16010 @opindex mabi
16011 Extend the current ABI with a particular extension, or remove such extension.
16012 Valid values are @var{altivec}, @var{no-altivec}, @var{spe},
16013 @var{no-spe}, @var{ibmlongdouble}, @var{ieeelongdouble}@.
16015 @item -mabi=spe
16016 @opindex mabi=spe
16017 Extend the current ABI with SPE ABI extensions.  This does not change
16018 the default ABI, instead it adds the SPE ABI extensions to the current
16019 ABI@.
16021 @item -mabi=no-spe
16022 @opindex mabi=no-spe
16023 Disable Booke SPE ABI extensions for the current ABI@.
16025 @item -mabi=ibmlongdouble
16026 @opindex mabi=ibmlongdouble
16027 Change the current ABI to use IBM extended precision long double.
16028 This is a PowerPC 32-bit SYSV ABI option.
16030 @item -mabi=ieeelongdouble
16031 @opindex mabi=ieeelongdouble
16032 Change the current ABI to use IEEE extended precision long double.
16033 This is a PowerPC 32-bit Linux ABI option.
16035 @item -mprototype
16036 @itemx -mno-prototype
16037 @opindex mprototype
16038 @opindex mno-prototype
16039 On System V.4 and embedded PowerPC systems assume that all calls to
16040 variable argument functions are properly prototyped.  Otherwise, the
16041 compiler must insert an instruction before every non prototyped call to
16042 set or clear bit 6 of the condition code register (@var{CR}) to
16043 indicate whether floating point values were passed in the floating point
16044 registers in case the function takes a variable arguments.  With
16045 @option{-mprototype}, only calls to prototyped variable argument functions
16046 will set or clear the bit.
16048 @item -msim
16049 @opindex msim
16050 On embedded PowerPC systems, assume that the startup module is called
16051 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
16052 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}
16053 configurations.
16055 @item -mmvme
16056 @opindex mmvme
16057 On embedded PowerPC systems, assume that the startup module is called
16058 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
16059 @file{libc.a}.
16061 @item -mads
16062 @opindex mads
16063 On embedded PowerPC systems, assume that the startup module is called
16064 @file{crt0.o} and the standard C libraries are @file{libads.a} and
16065 @file{libc.a}.
16067 @item -myellowknife
16068 @opindex myellowknife
16069 On embedded PowerPC systems, assume that the startup module is called
16070 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
16071 @file{libc.a}.
16073 @item -mvxworks
16074 @opindex mvxworks
16075 On System V.4 and embedded PowerPC systems, specify that you are
16076 compiling for a VxWorks system.
16078 @item -memb
16079 @opindex memb
16080 On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
16081 header to indicate that @samp{eabi} extended relocations are used.
16083 @item -meabi
16084 @itemx -mno-eabi
16085 @opindex meabi
16086 @opindex mno-eabi
16087 On System V.4 and embedded PowerPC systems do (do not) adhere to the
16088 Embedded Applications Binary Interface (eabi) which is a set of
16089 modifications to the System V.4 specifications.  Selecting @option{-meabi}
16090 means that the stack is aligned to an 8 byte boundary, a function
16091 @code{__eabi} is called to from @code{main} to set up the eabi
16092 environment, and the @option{-msdata} option can use both @code{r2} and
16093 @code{r13} to point to two separate small data areas.  Selecting
16094 @option{-mno-eabi} means that the stack is aligned to a 16 byte boundary,
16095 do not call an initialization function from @code{main}, and the
16096 @option{-msdata} option will only use @code{r13} to point to a single
16097 small data area.  The @option{-meabi} option is on by default if you
16098 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
16100 @item -msdata=eabi
16101 @opindex msdata=eabi
16102 On System V.4 and embedded PowerPC systems, put small initialized
16103 @code{const} global and static data in the @samp{.sdata2} section, which
16104 is pointed to by register @code{r2}.  Put small initialized
16105 non-@code{const} global and static data in the @samp{.sdata} section,
16106 which is pointed to by register @code{r13}.  Put small uninitialized
16107 global and static data in the @samp{.sbss} section, which is adjacent to
16108 the @samp{.sdata} section.  The @option{-msdata=eabi} option is
16109 incompatible with the @option{-mrelocatable} option.  The
16110 @option{-msdata=eabi} option also sets the @option{-memb} option.
16112 @item -msdata=sysv
16113 @opindex msdata=sysv
16114 On System V.4 and embedded PowerPC systems, put small global and static
16115 data in the @samp{.sdata} section, which is pointed to by register
16116 @code{r13}.  Put small uninitialized global and static data in the
16117 @samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
16118 The @option{-msdata=sysv} option is incompatible with the
16119 @option{-mrelocatable} option.
16121 @item -msdata=default
16122 @itemx -msdata
16123 @opindex msdata=default
16124 @opindex msdata
16125 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
16126 compile code the same as @option{-msdata=eabi}, otherwise compile code the
16127 same as @option{-msdata=sysv}.
16129 @item -msdata=data
16130 @opindex msdata=data
16131 On System V.4 and embedded PowerPC systems, put small global
16132 data in the @samp{.sdata} section.  Put small uninitialized global
16133 data in the @samp{.sbss} section.  Do not use register @code{r13}
16134 to address small data however.  This is the default behavior unless
16135 other @option{-msdata} options are used.
16137 @item -msdata=none
16138 @itemx -mno-sdata
16139 @opindex msdata=none
16140 @opindex mno-sdata
16141 On embedded PowerPC systems, put all initialized global and static data
16142 in the @samp{.data} section, and all uninitialized data in the
16143 @samp{.bss} section.
16145 @item -mblock-move-inline-limit=@var{num}
16146 @opindex mblock-move-inline-limit
16147 Inline all block moves (such as calls to @code{memcpy} or structure
16148 copies) less than or equal to @var{num} bytes.  The minimum value for
16149 @var{num} is 32 bytes on 32-bit targets and 64 bytes on 64-bit
16150 targets.  The default value is target-specific.
16152 @item -G @var{num}
16153 @opindex G
16154 @cindex smaller data references (PowerPC)
16155 @cindex .sdata/.sdata2 references (PowerPC)
16156 On embedded PowerPC systems, put global and static items less than or
16157 equal to @var{num} bytes into the small data or bss sections instead of
16158 the normal data or bss section.  By default, @var{num} is 8.  The
16159 @option{-G @var{num}} switch is also passed to the linker.
16160 All modules should be compiled with the same @option{-G @var{num}} value.
16162 @item -mregnames
16163 @itemx -mno-regnames
16164 @opindex mregnames
16165 @opindex mno-regnames
16166 On System V.4 and embedded PowerPC systems do (do not) emit register
16167 names in the assembly language output using symbolic forms.
16169 @item -mlongcall
16170 @itemx -mno-longcall
16171 @opindex mlongcall
16172 @opindex mno-longcall
16173 By default assume that all calls are far away so that a longer more
16174 expensive calling sequence is required.  This is required for calls
16175 further than 32 megabytes (33,554,432 bytes) from the current location.
16176 A short call will be generated if the compiler knows
16177 the call cannot be that far away.  This setting can be overridden by
16178 the @code{shortcall} function attribute, or by @code{#pragma
16179 longcall(0)}.
16181 Some linkers are capable of detecting out-of-range calls and generating
16182 glue code on the fly.  On these systems, long calls are unnecessary and
16183 generate slower code.  As of this writing, the AIX linker can do this,
16184 as can the GNU linker for PowerPC/64.  It is planned to add this feature
16185 to the GNU linker for 32-bit PowerPC systems as well.
16187 On Darwin/PPC systems, @code{#pragma longcall} will generate ``jbsr
16188 callee, L42'', plus a ``branch island'' (glue code).  The two target
16189 addresses represent the callee and the ``branch island''.  The
16190 Darwin/PPC linker will prefer the first address and generate a ``bl
16191 callee'' if the PPC ``bl'' instruction will reach the callee directly;
16192 otherwise, the linker will generate ``bl L42'' to call the ``branch
16193 island''.  The ``branch island'' is appended to the body of the
16194 calling function; it computes the full 32-bit address of the callee
16195 and jumps to it.
16197 On Mach-O (Darwin) systems, this option directs the compiler emit to
16198 the glue for every direct call, and the Darwin linker decides whether
16199 to use or discard it.
16201 In the future, we may cause GCC to ignore all longcall specifications
16202 when the linker is known to generate glue.
16204 @item -mtls-markers
16205 @itemx -mno-tls-markers
16206 @opindex mtls-markers
16207 @opindex mno-tls-markers
16208 Mark (do not mark) calls to @code{__tls_get_addr} with a relocation
16209 specifying the function argument.  The relocation allows ld to
16210 reliably associate function call with argument setup instructions for
16211 TLS optimization, which in turn allows gcc to better schedule the
16212 sequence.
16214 @item -pthread
16215 @opindex pthread
16216 Adds support for multithreading with the @dfn{pthreads} library.
16217 This option sets flags for both the preprocessor and linker.
16219 @item -mrecip
16220 @itemx -mno-recip
16221 @opindex mrecip
16222 This option will enable GCC to use the reciprocal estimate and
16223 reciprocal square root estimate instructions with additional
16224 Newton-Raphson steps to increase precision instead of doing a divide or
16225 square root and divide for floating point arguments.  You should use
16226 the @option{-ffast-math} option when using @option{-mrecip} (or at
16227 least @option{-funsafe-math-optimizations},
16228 @option{-finite-math-only}, @option{-freciprocal-math} and
16229 @option{-fno-trapping-math}).  Note that while the throughput of the
16230 sequence is generally higher than the throughput of the non-reciprocal
16231 instruction, the precision of the sequence can be decreased by up to 2
16232 ulp (i.e. the inverse of 1.0 equals 0.99999994) for reciprocal square
16233 roots.
16235 @item -mrecip=@var{opt}
16236 @opindex mrecip=opt
16237 This option allows to control which reciprocal estimate instructions
16238 may be used.  @var{opt} is a comma separated list of options, that may
16239 be preceded by a @code{!} to invert the option:
16240 @code{all}: enable all estimate instructions,
16241 @code{default}: enable the default instructions, equivalent to @option{-mrecip},
16242 @code{none}: disable all estimate instructions, equivalent to @option{-mno-recip};
16243 @code{div}: enable the reciprocal approximation instructions for both single and double precision;
16244 @code{divf}: enable the single precision reciprocal approximation instructions;
16245 @code{divd}: enable the double precision reciprocal approximation instructions;
16246 @code{rsqrt}: enable the reciprocal square root approximation instructions for both single and double precision;
16247 @code{rsqrtf}: enable the single precision reciprocal square root approximation instructions;
16248 @code{rsqrtd}: enable the double precision reciprocal square root approximation instructions;
16250 So for example, @option{-mrecip=all,!rsqrtd} would enable the
16251 all of the reciprocal estimate instructions, except for the
16252 @code{FRSQRTE}, @code{XSRSQRTEDP}, and @code{XVRSQRTEDP} instructions
16253 which handle the double precision reciprocal square root calculations.
16255 @item -mrecip-precision
16256 @itemx -mno-recip-precision
16257 @opindex mrecip-precision
16258 Assume (do not assume) that the reciprocal estimate instructions
16259 provide higher precision estimates than is mandated by the powerpc
16260 ABI.  Selecting @option{-mcpu=power6} or @option{-mcpu=power7}
16261 automatically selects @option{-mrecip-precision}.  The double
16262 precision square root estimate instructions are not generated by
16263 default on low precision machines, since they do not provide an
16264 estimate that converges after three steps.
16266 @item -mveclibabi=@var{type}
16267 @opindex mveclibabi
16268 Specifies the ABI type to use for vectorizing intrinsics using an
16269 external library.  The only type supported at present is @code{mass},
16270 which specifies to use IBM's Mathematical Acceleration Subsystem
16271 (MASS) libraries for vectorizing intrinsics using external libraries.
16272 GCC will currently emit calls to @code{acosd2}, @code{acosf4},
16273 @code{acoshd2}, @code{acoshf4}, @code{asind2}, @code{asinf4},
16274 @code{asinhd2}, @code{asinhf4}, @code{atan2d2}, @code{atan2f4},
16275 @code{atand2}, @code{atanf4}, @code{atanhd2}, @code{atanhf4},
16276 @code{cbrtd2}, @code{cbrtf4}, @code{cosd2}, @code{cosf4},
16277 @code{coshd2}, @code{coshf4}, @code{erfcd2}, @code{erfcf4},
16278 @code{erfd2}, @code{erff4}, @code{exp2d2}, @code{exp2f4},
16279 @code{expd2}, @code{expf4}, @code{expm1d2}, @code{expm1f4},
16280 @code{hypotd2}, @code{hypotf4}, @code{lgammad2}, @code{lgammaf4},
16281 @code{log10d2}, @code{log10f4}, @code{log1pd2}, @code{log1pf4},
16282 @code{log2d2}, @code{log2f4}, @code{logd2}, @code{logf4},
16283 @code{powd2}, @code{powf4}, @code{sind2}, @code{sinf4}, @code{sinhd2},
16284 @code{sinhf4}, @code{sqrtd2}, @code{sqrtf4}, @code{tand2},
16285 @code{tanf4}, @code{tanhd2}, and @code{tanhf4} when generating code
16286 for power7.  Both @option{-ftree-vectorize} and
16287 @option{-funsafe-math-optimizations} have to be enabled.  The MASS
16288 libraries will have to be specified at link time.
16290 @item -mfriz
16291 @itemx -mno-friz
16292 @opindex mfriz
16293 Generate (do not generate) the @code{friz} instruction when the
16294 @option{-funsafe-math-optimizations} option is used to optimize
16295 rounding a floating point value to 64-bit integer and back to floating
16296 point.  The @code{friz} instruction does not return the same value if
16297 the floating point number is too large to fit in an integer.
16298 @end table
16300 @node RX Options
16301 @subsection RX Options
16302 @cindex RX Options
16304 These command line options are defined for RX targets:
16306 @table @gcctabopt
16307 @item -m64bit-doubles
16308 @itemx -m32bit-doubles
16309 @opindex m64bit-doubles
16310 @opindex m32bit-doubles
16311 Make the @code{double} data type be 64-bits (@option{-m64bit-doubles})
16312 or 32-bits (@option{-m32bit-doubles}) in size.  The default is
16313 @option{-m32bit-doubles}.  @emph{Note} RX floating point hardware only
16314 works on 32-bit values, which is why the default is
16315 @option{-m32bit-doubles}.
16317 @item -fpu
16318 @itemx -nofpu
16319 @opindex fpu
16320 @opindex nofpu
16321 Enables (@option{-fpu}) or disables (@option{-nofpu}) the use of RX
16322 floating point hardware.  The default is enabled for the @var{RX600}
16323 series and disabled for the @var{RX200} series.
16325 Floating point instructions will only be generated for 32-bit floating
16326 point values however, so if the @option{-m64bit-doubles} option is in
16327 use then the FPU hardware will not be used for doubles.
16329 @emph{Note} If the @option{-fpu} option is enabled then
16330 @option{-funsafe-math-optimizations} is also enabled automatically.
16331 This is because the RX FPU instructions are themselves unsafe.
16333 @item -mcpu=@var{name}
16334 @opindex -mcpu
16335 Selects the type of RX CPU to be targeted.  Currently three types are
16336 supported, the generic @var{RX600} and @var{RX200} series hardware and
16337 the specific @var{RX610} CPU.  The default is @var{RX600}.
16339 The only difference between @var{RX600} and @var{RX610} is that the
16340 @var{RX610} does not support the @code{MVTIPL} instruction.
16342 The @var{RX200} series does not have a hardware floating point unit
16343 and so @option{-nofpu} is enabled by default when this type is
16344 selected.
16346 @item -mbig-endian-data
16347 @itemx -mlittle-endian-data
16348 @opindex mbig-endian-data
16349 @opindex mlittle-endian-data
16350 Store data (but not code) in the big-endian format.  The default is
16351 @option{-mlittle-endian-data}, i.e.@: to store data in the little endian
16352 format.
16354 @item -msmall-data-limit=@var{N}
16355 @opindex msmall-data-limit
16356 Specifies the maximum size in bytes of global and static variables
16357 which can be placed into the small data area.  Using the small data
16358 area can lead to smaller and faster code, but the size of area is
16359 limited and it is up to the programmer to ensure that the area does
16360 not overflow.  Also when the small data area is used one of the RX's
16361 registers (@code{r13}) is reserved for use pointing to this area, so
16362 it is no longer available for use by the compiler.  This could result
16363 in slower and/or larger code if variables which once could have been
16364 held in @code{r13} are now pushed onto the stack.
16366 Note, common variables (variables which have not been initialised) and
16367 constants are not placed into the small data area as they are assigned
16368 to other sections in the output executable.
16370 The default value is zero, which disables this feature.  Note, this
16371 feature is not enabled by default with higher optimization levels
16372 (@option{-O2} etc) because of the potentially detrimental effects of
16373 reserving register @code{r13}.  It is up to the programmer to
16374 experiment and discover whether this feature is of benefit to their
16375 program.
16377 @item -msim
16378 @itemx -mno-sim
16379 @opindex msim
16380 @opindex mno-sim
16381 Use the simulator runtime.  The default is to use the libgloss board
16382 specific runtime.
16384 @item -mas100-syntax
16385 @itemx -mno-as100-syntax
16386 @opindex mas100-syntax
16387 @opindex mno-as100-syntax
16388 When generating assembler output use a syntax that is compatible with
16389 Renesas's AS100 assembler.  This syntax can also be handled by the GAS
16390 assembler but it has some restrictions so generating it is not the
16391 default option.
16393 @item -mmax-constant-size=@var{N}
16394 @opindex mmax-constant-size
16395 Specifies the maximum size, in bytes, of a constant that can be used as
16396 an operand in a RX instruction.  Although the RX instruction set does
16397 allow constants of up to 4 bytes in length to be used in instructions,
16398 a longer value equates to a longer instruction.  Thus in some
16399 circumstances it can be beneficial to restrict the size of constants
16400 that are used in instructions.  Constants that are too big are instead
16401 placed into a constant pool and referenced via register indirection.
16403 The value @var{N} can be between 0 and 4.  A value of 0 (the default)
16404 or 4 means that constants of any size are allowed.
16406 @item -mrelax
16407 @opindex mrelax
16408 Enable linker relaxation.  Linker relaxation is a process whereby the
16409 linker will attempt to reduce the size of a program by finding shorter
16410 versions of various instructions.  Disabled by default.
16412 @item -mint-register=@var{N}
16413 @opindex mint-register
16414 Specify the number of registers to reserve for fast interrupt handler
16415 functions.  The value @var{N} can be between 0 and 4.  A value of 1
16416 means that register @code{r13} will be reserved for the exclusive use
16417 of fast interrupt handlers.  A value of 2 reserves @code{r13} and
16418 @code{r12}.  A value of 3 reserves @code{r13}, @code{r12} and
16419 @code{r11}, and a value of 4 reserves @code{r13} through @code{r10}.
16420 A value of 0, the default, does not reserve any registers.
16422 @item -msave-acc-in-interrupts
16423 @opindex msave-acc-in-interrupts
16424 Specifies that interrupt handler functions should preserve the
16425 accumulator register.  This is only necessary if normal code might use
16426 the accumulator register, for example because it performs 64-bit
16427 multiplications.  The default is to ignore the accumulator as this
16428 makes the interrupt handlers faster.
16430 @end table
16432 @emph{Note:} The generic GCC command line @option{-ffixed-@var{reg}}
16433 has special significance to the RX port when used with the
16434 @code{interrupt} function attribute.  This attribute indicates a
16435 function intended to process fast interrupts.  GCC will will ensure
16436 that it only uses the registers @code{r10}, @code{r11}, @code{r12}
16437 and/or @code{r13} and only provided that the normal use of the
16438 corresponding registers have been restricted via the
16439 @option{-ffixed-@var{reg}} or @option{-mint-register} command line
16440 options.
16442 @node S/390 and zSeries Options
16443 @subsection S/390 and zSeries Options
16444 @cindex S/390 and zSeries Options
16446 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
16448 @table @gcctabopt
16449 @item -mhard-float
16450 @itemx -msoft-float
16451 @opindex mhard-float
16452 @opindex msoft-float
16453 Use (do not use) the hardware floating-point instructions and registers
16454 for floating-point operations.  When @option{-msoft-float} is specified,
16455 functions in @file{libgcc.a} will be used to perform floating-point
16456 operations.  When @option{-mhard-float} is specified, the compiler
16457 generates IEEE floating-point instructions.  This is the default.
16459 @item -mhard-dfp
16460 @itemx -mno-hard-dfp
16461 @opindex mhard-dfp
16462 @opindex mno-hard-dfp
16463 Use (do not use) the hardware decimal-floating-point instructions for
16464 decimal-floating-point operations.  When @option{-mno-hard-dfp} is
16465 specified, functions in @file{libgcc.a} will be used to perform
16466 decimal-floating-point operations.  When @option{-mhard-dfp} is
16467 specified, the compiler generates decimal-floating-point hardware
16468 instructions.  This is the default for @option{-march=z9-ec} or higher.
16470 @item -mlong-double-64
16471 @itemx -mlong-double-128
16472 @opindex mlong-double-64
16473 @opindex mlong-double-128
16474 These switches control the size of @code{long double} type. A size
16475 of 64bit makes the @code{long double} type equivalent to the @code{double}
16476 type. This is the default.
16478 @item -mbackchain
16479 @itemx -mno-backchain
16480 @opindex mbackchain
16481 @opindex mno-backchain
16482 Store (do not store) the address of the caller's frame as backchain pointer
16483 into the callee's stack frame.
16484 A backchain may be needed to allow debugging using tools that do not understand
16485 DWARF-2 call frame information.
16486 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
16487 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
16488 the backchain is placed into the topmost word of the 96/160 byte register
16489 save area.
16491 In general, code compiled with @option{-mbackchain} is call-compatible with
16492 code compiled with @option{-mmo-backchain}; however, use of the backchain
16493 for debugging purposes usually requires that the whole binary is built with
16494 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
16495 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
16496 to build a linux kernel use @option{-msoft-float}.
16498 The default is to not maintain the backchain.
16500 @item -mpacked-stack
16501 @itemx -mno-packed-stack
16502 @opindex mpacked-stack
16503 @opindex mno-packed-stack
16504 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
16505 specified, the compiler uses the all fields of the 96/160 byte register save
16506 area only for their default purpose; unused fields still take up stack space.
16507 When @option{-mpacked-stack} is specified, register save slots are densely
16508 packed at the top of the register save area; unused space is reused for other
16509 purposes, allowing for more efficient use of the available stack space.
16510 However, when @option{-mbackchain} is also in effect, the topmost word of
16511 the save area is always used to store the backchain, and the return address
16512 register is always saved two words below the backchain.
16514 As long as the stack frame backchain is not used, code generated with
16515 @option{-mpacked-stack} is call-compatible with code generated with
16516 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
16517 S/390 or zSeries generated code that uses the stack frame backchain at run
16518 time, not just for debugging purposes.  Such code is not call-compatible
16519 with code compiled with @option{-mpacked-stack}.  Also, note that the
16520 combination of @option{-mbackchain},
16521 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
16522 to build a linux kernel use @option{-msoft-float}.
16524 The default is to not use the packed stack layout.
16526 @item -msmall-exec
16527 @itemx -mno-small-exec
16528 @opindex msmall-exec
16529 @opindex mno-small-exec
16530 Generate (or do not generate) code using the @code{bras} instruction
16531 to do subroutine calls.
16532 This only works reliably if the total executable size does not
16533 exceed 64k.  The default is to use the @code{basr} instruction instead,
16534 which does not have this limitation.
16536 @item -m64
16537 @itemx -m31
16538 @opindex m64
16539 @opindex m31
16540 When @option{-m31} is specified, generate code compliant to the
16541 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
16542 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
16543 particular to generate 64-bit instructions.  For the @samp{s390}
16544 targets, the default is @option{-m31}, while the @samp{s390x}
16545 targets default to @option{-m64}.
16547 @item -mzarch
16548 @itemx -mesa
16549 @opindex mzarch
16550 @opindex mesa
16551 When @option{-mzarch} is specified, generate code using the
16552 instructions available on z/Architecture.
16553 When @option{-mesa} is specified, generate code using the
16554 instructions available on ESA/390.  Note that @option{-mesa} is
16555 not possible with @option{-m64}.
16556 When generating code compliant to the GNU/Linux for S/390 ABI,
16557 the default is @option{-mesa}.  When generating code compliant
16558 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
16560 @item -mmvcle
16561 @itemx -mno-mvcle
16562 @opindex mmvcle
16563 @opindex mno-mvcle
16564 Generate (or do not generate) code using the @code{mvcle} instruction
16565 to perform block moves.  When @option{-mno-mvcle} is specified,
16566 use a @code{mvc} loop instead.  This is the default unless optimizing for
16567 size.
16569 @item -mdebug
16570 @itemx -mno-debug
16571 @opindex mdebug
16572 @opindex mno-debug
16573 Print (or do not print) additional debug information when compiling.
16574 The default is to not print debug information.
16576 @item -march=@var{cpu-type}
16577 @opindex march
16578 Generate code that will run on @var{cpu-type}, which is the name of a system
16579 representing a certain processor type.  Possible values for
16580 @var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, @samp{z990},
16581 @samp{z9-109}, @samp{z9-ec} and @samp{z10}.
16582 When generating code using the instructions available on z/Architecture,
16583 the default is @option{-march=z900}.  Otherwise, the default is
16584 @option{-march=g5}.
16586 @item -mtune=@var{cpu-type}
16587 @opindex mtune
16588 Tune to @var{cpu-type} everything applicable about the generated code,
16589 except for the ABI and the set of available instructions.
16590 The list of @var{cpu-type} values is the same as for @option{-march}.
16591 The default is the value used for @option{-march}.
16593 @item -mtpf-trace
16594 @itemx -mno-tpf-trace
16595 @opindex mtpf-trace
16596 @opindex mno-tpf-trace
16597 Generate code that adds (does not add) in TPF OS specific branches to trace
16598 routines in the operating system.  This option is off by default, even
16599 when compiling for the TPF OS@.
16601 @item -mfused-madd
16602 @itemx -mno-fused-madd
16603 @opindex mfused-madd
16604 @opindex mno-fused-madd
16605 Generate code that uses (does not use) the floating point multiply and
16606 accumulate instructions.  These instructions are generated by default if
16607 hardware floating point is used.
16609 @item -mwarn-framesize=@var{framesize}
16610 @opindex mwarn-framesize
16611 Emit a warning if the current function exceeds the given frame size.  Because
16612 this is a compile time check it doesn't need to be a real problem when the program
16613 runs.  It is intended to identify functions which most probably cause
16614 a stack overflow.  It is useful to be used in an environment with limited stack
16615 size e.g.@: the linux kernel.
16617 @item -mwarn-dynamicstack
16618 @opindex mwarn-dynamicstack
16619 Emit a warning if the function calls alloca or uses dynamically
16620 sized arrays.  This is generally a bad idea with a limited stack size.
16622 @item -mstack-guard=@var{stack-guard}
16623 @itemx -mstack-size=@var{stack-size}
16624 @opindex mstack-guard
16625 @opindex mstack-size
16626 If these options are provided the s390 back end emits additional instructions in
16627 the function prologue which trigger a trap if the stack size is @var{stack-guard}
16628 bytes above the @var{stack-size} (remember that the stack on s390 grows downward).
16629 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
16630 the frame size of the compiled function is chosen.
16631 These options are intended to be used to help debugging stack overflow problems.
16632 The additionally emitted code causes only little overhead and hence can also be
16633 used in production like systems without greater performance degradation.  The given
16634 values have to be exact powers of 2 and @var{stack-size} has to be greater than
16635 @var{stack-guard} without exceeding 64k.
16636 In order to be efficient the extra code makes the assumption that the stack starts
16637 at an address aligned to the value given by @var{stack-size}.
16638 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
16639 @end table
16641 @node Score Options
16642 @subsection Score Options
16643 @cindex Score Options
16645 These options are defined for Score implementations:
16647 @table @gcctabopt
16648 @item -meb
16649 @opindex meb
16650 Compile code for big endian mode.  This is the default.
16652 @item -mel
16653 @opindex mel
16654 Compile code for little endian mode.
16656 @item -mnhwloop
16657 @opindex mnhwloop
16658 Disable generate bcnz instruction.
16660 @item -muls
16661 @opindex muls
16662 Enable generate unaligned load and store instruction.
16664 @item -mmac
16665 @opindex mmac
16666 Enable the use of multiply-accumulate instructions. Disabled by default.
16668 @item -mscore5
16669 @opindex mscore5
16670 Specify the SCORE5 as the target architecture.
16672 @item -mscore5u
16673 @opindex mscore5u
16674 Specify the SCORE5U of the target architecture.
16676 @item -mscore7
16677 @opindex mscore7
16678 Specify the SCORE7 as the target architecture. This is the default.
16680 @item -mscore7d
16681 @opindex mscore7d
16682 Specify the SCORE7D as the target architecture.
16683 @end table
16685 @node SH Options
16686 @subsection SH Options
16688 These @samp{-m} options are defined for the SH implementations:
16690 @table @gcctabopt
16691 @item -m1
16692 @opindex m1
16693 Generate code for the SH1.
16695 @item -m2
16696 @opindex m2
16697 Generate code for the SH2.
16699 @item -m2e
16700 Generate code for the SH2e.
16702 @item -m2a-nofpu
16703 @opindex m2a-nofpu
16704 Generate code for the SH2a without FPU, or for a SH2a-FPU in such a way
16705 that the floating-point unit is not used.
16707 @item -m2a-single-only
16708 @opindex m2a-single-only
16709 Generate code for the SH2a-FPU, in such a way that no double-precision
16710 floating point operations are used.
16712 @item -m2a-single
16713 @opindex m2a-single
16714 Generate code for the SH2a-FPU assuming the floating-point unit is in
16715 single-precision mode by default.
16717 @item -m2a
16718 @opindex m2a
16719 Generate code for the SH2a-FPU assuming the floating-point unit is in
16720 double-precision mode by default.
16722 @item -m3
16723 @opindex m3
16724 Generate code for the SH3.
16726 @item -m3e
16727 @opindex m3e
16728 Generate code for the SH3e.
16730 @item -m4-nofpu
16731 @opindex m4-nofpu
16732 Generate code for the SH4 without a floating-point unit.
16734 @item -m4-single-only
16735 @opindex m4-single-only
16736 Generate code for the SH4 with a floating-point unit that only
16737 supports single-precision arithmetic.
16739 @item -m4-single
16740 @opindex m4-single
16741 Generate code for the SH4 assuming the floating-point unit is in
16742 single-precision mode by default.
16744 @item -m4
16745 @opindex m4
16746 Generate code for the SH4.
16748 @item -m4a-nofpu
16749 @opindex m4a-nofpu
16750 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
16751 floating-point unit is not used.
16753 @item -m4a-single-only
16754 @opindex m4a-single-only
16755 Generate code for the SH4a, in such a way that no double-precision
16756 floating point operations are used.
16758 @item -m4a-single
16759 @opindex m4a-single
16760 Generate code for the SH4a assuming the floating-point unit is in
16761 single-precision mode by default.
16763 @item -m4a
16764 @opindex m4a
16765 Generate code for the SH4a.
16767 @item -m4al
16768 @opindex m4al
16769 Same as @option{-m4a-nofpu}, except that it implicitly passes
16770 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
16771 instructions at the moment.
16773 @item -mb
16774 @opindex mb
16775 Compile code for the processor in big endian mode.
16777 @item -ml
16778 @opindex ml
16779 Compile code for the processor in little endian mode.
16781 @item -mdalign
16782 @opindex mdalign
16783 Align doubles at 64-bit boundaries.  Note that this changes the calling
16784 conventions, and thus some functions from the standard C library will
16785 not work unless you recompile it first with @option{-mdalign}.
16787 @item -mrelax
16788 @opindex mrelax
16789 Shorten some address references at link time, when possible; uses the
16790 linker option @option{-relax}.
16792 @item -mbigtable
16793 @opindex mbigtable
16794 Use 32-bit offsets in @code{switch} tables.  The default is to use
16795 16-bit offsets.
16797 @item -mbitops
16798 @opindex mbitops
16799 Enable the use of bit manipulation instructions on SH2A.
16801 @item -mfmovd
16802 @opindex mfmovd
16803 Enable the use of the instruction @code{fmovd}.  Check @option{-mdalign} for
16804 alignment constraints.
16806 @item -mhitachi
16807 @opindex mhitachi
16808 Comply with the calling conventions defined by Renesas.
16810 @item -mrenesas
16811 @opindex mhitachi
16812 Comply with the calling conventions defined by Renesas.
16814 @item -mno-renesas
16815 @opindex mhitachi
16816 Comply with the calling conventions defined for GCC before the Renesas
16817 conventions were available.  This option is the default for all
16818 targets of the SH toolchain.
16820 @item -mnomacsave
16821 @opindex mnomacsave
16822 Mark the @code{MAC} register as call-clobbered, even if
16823 @option{-mhitachi} is given.
16825 @item -mieee
16826 @opindex mieee
16827 Increase IEEE-compliance of floating-point code.
16828 At the moment, this is equivalent to @option{-fno-finite-math-only}.
16829 When generating 16 bit SH opcodes, getting IEEE-conforming results for
16830 comparisons of NANs / infinities incurs extra overhead in every
16831 floating point comparison, therefore the default is set to
16832 @option{-ffinite-math-only}.
16834 @item -minline-ic_invalidate
16835 @opindex minline-ic_invalidate
16836 Inline code to invalidate instruction cache entries after setting up
16837 nested function trampolines.
16838 This option has no effect if -musermode is in effect and the selected
16839 code generation option (e.g. -m4) does not allow the use of the icbi
16840 instruction.
16841 If the selected code generation option does not allow the use of the icbi
16842 instruction, and -musermode is not in effect, the inlined code will
16843 manipulate the instruction cache address array directly with an associative
16844 write.  This not only requires privileged mode, but it will also
16845 fail if the cache line had been mapped via the TLB and has become unmapped.
16847 @item -misize
16848 @opindex misize
16849 Dump instruction size and location in the assembly code.
16851 @item -mpadstruct
16852 @opindex mpadstruct
16853 This option is deprecated.  It pads structures to multiple of 4 bytes,
16854 which is incompatible with the SH ABI@.
16856 @item -mspace
16857 @opindex mspace
16858 Optimize for space instead of speed.  Implied by @option{-Os}.
16860 @item -mprefergot
16861 @opindex mprefergot
16862 When generating position-independent code, emit function calls using
16863 the Global Offset Table instead of the Procedure Linkage Table.
16865 @item -musermode
16866 @opindex musermode
16867 Don't generate privileged mode only code; implies -mno-inline-ic_invalidate
16868 if the inlined code would not work in user mode.
16869 This is the default when the target is @code{sh-*-linux*}.
16871 @item -multcost=@var{number}
16872 @opindex multcost=@var{number}
16873 Set the cost to assume for a multiply insn.
16875 @item -mdiv=@var{strategy}
16876 @opindex mdiv=@var{strategy}
16877 Set the division strategy to use for SHmedia code.  @var{strategy} must be
16878 one of: call, call2, fp, inv, inv:minlat, inv20u, inv20l, inv:call,
16879 inv:call2, inv:fp .
16880 "fp" performs the operation in floating point.  This has a very high latency,
16881 but needs only a few instructions, so it might be a good choice if
16882 your code has enough easily exploitable ILP to allow the compiler to
16883 schedule the floating point instructions together with other instructions.
16884 Division by zero causes a floating point exception.
16885 "inv" uses integer operations to calculate the inverse of the divisor,
16886 and then multiplies the dividend with the inverse.  This strategy allows
16887 cse and hoisting of the inverse calculation.  Division by zero calculates
16888 an unspecified result, but does not trap.
16889 "inv:minlat" is a variant of "inv" where if no cse / hoisting opportunities
16890 have been found, or if the entire operation has been hoisted to the same
16891 place, the last stages of the inverse calculation are intertwined with the
16892 final multiply to reduce the overall latency, at the expense of using a few
16893 more instructions, and thus offering fewer scheduling opportunities with
16894 other code.
16895 "call" calls a library function that usually implements the inv:minlat
16896 strategy.
16897 This gives high code density for m5-*media-nofpu compilations.
16898 "call2" uses a different entry point of the same library function, where it
16899 assumes that a pointer to a lookup table has already been set up, which
16900 exposes the pointer load to cse / code hoisting optimizations.
16901 "inv:call", "inv:call2" and "inv:fp" all use the "inv" algorithm for initial
16902 code generation, but if the code stays unoptimized, revert to the "call",
16903 "call2", or "fp" strategies, respectively.  Note that the
16904 potentially-trapping side effect of division by zero is carried by a
16905 separate instruction, so it is possible that all the integer instructions
16906 are hoisted out, but the marker for the side effect stays where it is.
16907 A recombination to fp operations or a call is not possible in that case.
16908 "inv20u" and "inv20l" are variants of the "inv:minlat" strategy.  In the case
16909 that the inverse calculation was nor separated from the multiply, they speed
16910 up division where the dividend fits into 20 bits (plus sign where applicable),
16911 by inserting a test to skip a number of operations in this case; this test
16912 slows down the case of larger dividends.  inv20u assumes the case of a such
16913 a small dividend to be unlikely, and inv20l assumes it to be likely.
16915 @item -maccumulate-outgoing-args
16916 @opindex maccumulate-outgoing-args
16917 Reserve space once for outgoing arguments in the function prologue rather
16918 than around each call.  Generally beneficial for performance and size.  Also
16919 needed for unwinding to avoid changing the stack frame around conditional code.
16921 @item -mdivsi3_libfunc=@var{name}
16922 @opindex mdivsi3_libfunc=@var{name}
16923 Set the name of the library function used for 32 bit signed division to
16924 @var{name}.  This only affect the name used in the call and inv:call
16925 division strategies, and the compiler will still expect the same
16926 sets of input/output/clobbered registers as if this option was not present.
16928 @item -mfixed-range=@var{register-range}
16929 @opindex mfixed-range
16930 Generate code treating the given register range as fixed registers.
16931 A fixed register is one that the register allocator can not use.  This is
16932 useful when compiling kernel code.  A register range is specified as
16933 two registers separated by a dash.  Multiple register ranges can be
16934 specified separated by a comma.
16936 @item -madjust-unroll
16937 @opindex madjust-unroll
16938 Throttle unrolling to avoid thrashing target registers.
16939 This option only has an effect if the gcc code base supports the
16940 TARGET_ADJUST_UNROLL_MAX target hook.
16942 @item -mindexed-addressing
16943 @opindex mindexed-addressing
16944 Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
16945 This is only safe if the hardware and/or OS implement 32 bit wrap-around
16946 semantics for the indexed addressing mode.  The architecture allows the
16947 implementation of processors with 64 bit MMU, which the OS could use to
16948 get 32 bit addressing, but since no current hardware implementation supports
16949 this or any other way to make the indexed addressing mode safe to use in
16950 the 32 bit ABI, the default is -mno-indexed-addressing.
16952 @item -mgettrcost=@var{number}
16953 @opindex mgettrcost=@var{number}
16954 Set the cost assumed for the gettr instruction to @var{number}.
16955 The default is 2 if @option{-mpt-fixed} is in effect, 100 otherwise.
16957 @item -mpt-fixed
16958 @opindex mpt-fixed
16959 Assume pt* instructions won't trap.  This will generally generate better
16960 scheduled code, but is unsafe on current hardware.  The current architecture
16961 definition says that ptabs and ptrel trap when the target anded with 3 is 3.
16962 This has the unintentional effect of making it unsafe to schedule ptabs /
16963 ptrel before a branch, or hoist it out of a loop.  For example,
16964 __do_global_ctors, a part of libgcc that runs constructors at program
16965 startup, calls functions in a list which is delimited by @minus{}1.  With the
16966 -mpt-fixed option, the ptabs will be done before testing against @minus{}1.
16967 That means that all the constructors will be run a bit quicker, but when
16968 the loop comes to the end of the list, the program crashes because ptabs
16969 loads @minus{}1 into a target register.  Since this option is unsafe for any
16970 hardware implementing the current architecture specification, the default
16971 is -mno-pt-fixed.  Unless the user specifies a specific cost with
16972 @option{-mgettrcost}, -mno-pt-fixed also implies @option{-mgettrcost=100};
16973 this deters register allocation using target registers for storing
16974 ordinary integers.
16976 @item -minvalid-symbols
16977 @opindex minvalid-symbols
16978 Assume symbols might be invalid.  Ordinary function symbols generated by
16979 the compiler will always be valid to load with movi/shori/ptabs or
16980 movi/shori/ptrel, but with assembler and/or linker tricks it is possible
16981 to generate symbols that will cause ptabs / ptrel to trap.
16982 This option is only meaningful when @option{-mno-pt-fixed} is in effect.
16983 It will then prevent cross-basic-block cse, hoisting and most scheduling
16984 of symbol loads.  The default is @option{-mno-invalid-symbols}.
16985 @end table
16987 @node Solaris 2 Options
16988 @subsection Solaris 2 Options
16989 @cindex Solaris 2 options
16991 These @samp{-m} options are supported on Solaris 2:
16993 @table @gcctabopt
16994 @item -mimpure-text
16995 @opindex mimpure-text
16996 @option{-mimpure-text}, used in addition to @option{-shared}, tells
16997 the compiler to not pass @option{-z text} to the linker when linking a
16998 shared object.  Using this option, you can link position-dependent
16999 code into a shared object.
17001 @option{-mimpure-text} suppresses the ``relocations remain against
17002 allocatable but non-writable sections'' linker error message.
17003 However, the necessary relocations will trigger copy-on-write, and the
17004 shared object is not actually shared across processes.  Instead of
17005 using @option{-mimpure-text}, you should compile all source code with
17006 @option{-fpic} or @option{-fPIC}.
17008 @end table
17010 These switches are supported in addition to the above on Solaris 2:
17012 @table @gcctabopt
17013 @item -pthreads
17014 @opindex pthreads
17015 Add support for multithreading using the POSIX threads library.  This
17016 option sets flags for both the preprocessor and linker.  This option does
17017 not affect the thread safety of object code produced  by the compiler or
17018 that of libraries supplied with it.
17020 @item -pthread
17021 @opindex pthread
17022 This is a synonym for @option{-pthreads}.
17023 @end table
17025 @node SPARC Options
17026 @subsection SPARC Options
17027 @cindex SPARC options
17029 These @samp{-m} options are supported on the SPARC:
17031 @table @gcctabopt
17032 @item -mno-app-regs
17033 @itemx -mapp-regs
17034 @opindex mno-app-regs
17035 @opindex mapp-regs
17036 Specify @option{-mapp-regs} to generate output using the global registers
17037 2 through 4, which the SPARC SVR4 ABI reserves for applications.  This
17038 is the default.
17040 To be fully SVR4 ABI compliant at the cost of some performance loss,
17041 specify @option{-mno-app-regs}.  You should compile libraries and system
17042 software with this option.
17044 @item -mfpu
17045 @itemx -mhard-float
17046 @opindex mfpu
17047 @opindex mhard-float
17048 Generate output containing floating point instructions.  This is the
17049 default.
17051 @item -mno-fpu
17052 @itemx -msoft-float
17053 @opindex mno-fpu
17054 @opindex msoft-float
17055 Generate output containing library calls for floating point.
17056 @strong{Warning:} the requisite libraries are not available for all SPARC
17057 targets.  Normally the facilities of the machine's usual C compiler are
17058 used, but this cannot be done directly in cross-compilation.  You must make
17059 your own arrangements to provide suitable library functions for
17060 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
17061 @samp{sparclite-*-*} do provide software floating point support.
17063 @option{-msoft-float} changes the calling convention in the output file;
17064 therefore, it is only useful if you compile @emph{all} of a program with
17065 this option.  In particular, you need to compile @file{libgcc.a}, the
17066 library that comes with GCC, with @option{-msoft-float} in order for
17067 this to work.
17069 @item -mhard-quad-float
17070 @opindex mhard-quad-float
17071 Generate output containing quad-word (long double) floating point
17072 instructions.
17074 @item -msoft-quad-float
17075 @opindex msoft-quad-float
17076 Generate output containing library calls for quad-word (long double)
17077 floating point instructions.  The functions called are those specified
17078 in the SPARC ABI@.  This is the default.
17080 As of this writing, there are no SPARC implementations that have hardware
17081 support for the quad-word floating point instructions.  They all invoke
17082 a trap handler for one of these instructions, and then the trap handler
17083 emulates the effect of the instruction.  Because of the trap handler overhead,
17084 this is much slower than calling the ABI library routines.  Thus the
17085 @option{-msoft-quad-float} option is the default.
17087 @item -mno-unaligned-doubles
17088 @itemx -munaligned-doubles
17089 @opindex mno-unaligned-doubles
17090 @opindex munaligned-doubles
17091 Assume that doubles have 8 byte alignment.  This is the default.
17093 With @option{-munaligned-doubles}, GCC assumes that doubles have 8 byte
17094 alignment only if they are contained in another type, or if they have an
17095 absolute address.  Otherwise, it assumes they have 4 byte alignment.
17096 Specifying this option avoids some rare compatibility problems with code
17097 generated by other compilers.  It is not the default because it results
17098 in a performance loss, especially for floating point code.
17100 @item -mno-faster-structs
17101 @itemx -mfaster-structs
17102 @opindex mno-faster-structs
17103 @opindex mfaster-structs
17104 With @option{-mfaster-structs}, the compiler assumes that structures
17105 should have 8 byte alignment.  This enables the use of pairs of
17106 @code{ldd} and @code{std} instructions for copies in structure
17107 assignment, in place of twice as many @code{ld} and @code{st} pairs.
17108 However, the use of this changed alignment directly violates the SPARC
17109 ABI@.  Thus, it's intended only for use on targets where the developer
17110 acknowledges that their resulting code will not be directly in line with
17111 the rules of the ABI@.
17113 @item -mcpu=@var{cpu_type}
17114 @opindex mcpu
17115 Set the instruction set, register set, and instruction scheduling parameters
17116 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
17117 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{hypersparc},
17118 @samp{leon}, @samp{sparclite}, @samp{f930}, @samp{f934}, @samp{sparclite86x},
17119 @samp{sparclet}, @samp{tsc701}, @samp{v9}, @samp{ultrasparc},
17120 @samp{ultrasparc3}, @samp{niagara} and @samp{niagara2}.
17122 Default instruction scheduling parameters are used for values that select
17123 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
17124 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
17126 Here is a list of each supported architecture and their supported
17127 implementations.
17129 @smallexample
17130     v7:             cypress
17131     v8:             supersparc, hypersparc, leon
17132     sparclite:      f930, f934, sparclite86x
17133     sparclet:       tsc701
17134     v9:             ultrasparc, ultrasparc3, niagara, niagara2
17135 @end smallexample
17137 By default (unless configured otherwise), GCC generates code for the V7
17138 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
17139 additionally optimizes it for the Cypress CY7C602 chip, as used in the
17140 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
17141 SPARCStation 1, 2, IPX etc.
17143 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
17144 architecture.  The only difference from V7 code is that the compiler emits
17145 the integer multiply and integer divide instructions which exist in SPARC-V8
17146 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
17147 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
17148 2000 series.
17150 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
17151 the SPARC architecture.  This adds the integer multiply, integer divide step
17152 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
17153 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
17154 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
17155 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
17156 MB86934 chip, which is the more recent SPARClite with FPU@.
17158 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
17159 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
17160 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
17161 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
17162 optimizes it for the TEMIC SPARClet chip.
17164 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
17165 architecture.  This adds 64-bit integer and floating-point move instructions,
17166 3 additional floating-point condition code registers and conditional move
17167 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
17168 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
17169 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
17170 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
17171 @option{-mcpu=niagara}, the compiler additionally optimizes it for
17172 Sun UltraSPARC T1 chips.  With @option{-mcpu=niagara2}, the compiler
17173 additionally optimizes it for Sun UltraSPARC T2 chips.
17175 @item -mtune=@var{cpu_type}
17176 @opindex mtune
17177 Set the instruction scheduling parameters for machine type
17178 @var{cpu_type}, but do not set the instruction set or register set that the
17179 option @option{-mcpu=@var{cpu_type}} would.
17181 The same values for @option{-mcpu=@var{cpu_type}} can be used for
17182 @option{-mtune=@var{cpu_type}}, but the only useful values are those
17183 that select a particular CPU implementation.  Those are @samp{cypress},
17184 @samp{supersparc}, @samp{hypersparc}, @samp{leon}, @samp{f930}, @samp{f934},
17185 @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc}, @samp{ultrasparc3},
17186 @samp{niagara}, and @samp{niagara2}.
17188 @item -mv8plus
17189 @itemx -mno-v8plus
17190 @opindex mv8plus
17191 @opindex mno-v8plus
17192 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
17193 difference from the V8 ABI is that the global and out registers are
17194 considered 64-bit wide.  This is enabled by default on Solaris in 32-bit
17195 mode for all SPARC-V9 processors.
17197 @item -mvis
17198 @itemx -mno-vis
17199 @opindex mvis
17200 @opindex mno-vis
17201 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
17202 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
17203 @end table
17205 These @samp{-m} options are supported in addition to the above
17206 on SPARC-V9 processors in 64-bit environments:
17208 @table @gcctabopt
17209 @item -mlittle-endian
17210 @opindex mlittle-endian
17211 Generate code for a processor running in little-endian mode.  It is only
17212 available for a few configurations and most notably not on Solaris and Linux.
17214 @item -m32
17215 @itemx -m64
17216 @opindex m32
17217 @opindex m64
17218 Generate code for a 32-bit or 64-bit environment.
17219 The 32-bit environment sets int, long and pointer to 32 bits.
17220 The 64-bit environment sets int to 32 bits and long and pointer
17221 to 64 bits.
17223 @item -mcmodel=medlow
17224 @opindex mcmodel=medlow
17225 Generate code for the Medium/Low code model: 64-bit addresses, programs
17226 must be linked in the low 32 bits of memory.  Programs can be statically
17227 or dynamically linked.
17229 @item -mcmodel=medmid
17230 @opindex mcmodel=medmid
17231 Generate code for the Medium/Middle code model: 64-bit addresses, programs
17232 must be linked in the low 44 bits of memory, the text and data segments must
17233 be less than 2GB in size and the data segment must be located within 2GB of
17234 the text segment.
17236 @item -mcmodel=medany
17237 @opindex mcmodel=medany
17238 Generate code for the Medium/Anywhere code model: 64-bit addresses, programs
17239 may be linked anywhere in memory, the text and data segments must be less
17240 than 2GB in size and the data segment must be located within 2GB of the
17241 text segment.
17243 @item -mcmodel=embmedany
17244 @opindex mcmodel=embmedany
17245 Generate code for the Medium/Anywhere code model for embedded systems:
17246 64-bit addresses, the text and data segments must be less than 2GB in
17247 size, both starting anywhere in memory (determined at link time).  The
17248 global register %g4 points to the base of the data segment.  Programs
17249 are statically linked and PIC is not supported.
17251 @item -mstack-bias
17252 @itemx -mno-stack-bias
17253 @opindex mstack-bias
17254 @opindex mno-stack-bias
17255 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
17256 frame pointer if present, are offset by @minus{}2047 which must be added back
17257 when making stack frame references.  This is the default in 64-bit mode.
17258 Otherwise, assume no such offset is present.
17259 @end table
17261 @node SPU Options
17262 @subsection SPU Options
17263 @cindex SPU options
17265 These @samp{-m} options are supported on the SPU:
17267 @table @gcctabopt
17268 @item -mwarn-reloc
17269 @itemx -merror-reloc
17270 @opindex mwarn-reloc
17271 @opindex merror-reloc
17273 The loader for SPU does not handle dynamic relocations.  By default, GCC
17274 will give an error when it generates code that requires a dynamic
17275 relocation.  @option{-mno-error-reloc} disables the error,
17276 @option{-mwarn-reloc} will generate a warning instead.
17278 @item -msafe-dma
17279 @itemx -munsafe-dma
17280 @opindex msafe-dma
17281 @opindex munsafe-dma
17283 Instructions which initiate or test completion of DMA must not be
17284 reordered with respect to loads and stores of the memory which is being
17285 accessed.  Users typically address this problem using the volatile
17286 keyword, but that can lead to inefficient code in places where the
17287 memory is known to not change.  Rather than mark the memory as volatile
17288 we treat the DMA instructions as potentially effecting all memory.  With
17289 @option{-munsafe-dma} users must use the volatile keyword to protect
17290 memory accesses.
17292 @item -mbranch-hints
17293 @opindex mbranch-hints
17295 By default, GCC will generate a branch hint instruction to avoid
17296 pipeline stalls for always taken or probably taken branches.  A hint
17297 will not be generated closer than 8 instructions away from its branch.
17298 There is little reason to disable them, except for debugging purposes,
17299 or to make an object a little bit smaller.
17301 @item -msmall-mem
17302 @itemx -mlarge-mem
17303 @opindex msmall-mem
17304 @opindex mlarge-mem
17306 By default, GCC generates code assuming that addresses are never larger
17307 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
17308 a full 32 bit address.
17310 @item -mstdmain
17311 @opindex mstdmain
17313 By default, GCC links against startup code that assumes the SPU-style
17314 main function interface (which has an unconventional parameter list).
17315 With @option{-mstdmain}, GCC will link your program against startup
17316 code that assumes a C99-style interface to @code{main}, including a
17317 local copy of @code{argv} strings.
17319 @item -mfixed-range=@var{register-range}
17320 @opindex mfixed-range
17321 Generate code treating the given register range as fixed registers.
17322 A fixed register is one that the register allocator can not use.  This is
17323 useful when compiling kernel code.  A register range is specified as
17324 two registers separated by a dash.  Multiple register ranges can be
17325 specified separated by a comma.
17327 @item -mea32
17328 @itemx -mea64
17329 @opindex mea32
17330 @opindex mea64
17331 Compile code assuming that pointers to the PPU address space accessed
17332 via the @code{__ea} named address space qualifier are either 32 or 64
17333 bits wide.  The default is 32 bits.  As this is an ABI changing option,
17334 all object code in an executable must be compiled with the same setting.
17336 @item -maddress-space-conversion
17337 @itemx -mno-address-space-conversion
17338 @opindex maddress-space-conversion
17339 @opindex mno-address-space-conversion
17340 Allow/disallow treating the @code{__ea} address space as superset
17341 of the generic address space.  This enables explicit type casts
17342 between @code{__ea} and generic pointer as well as implicit
17343 conversions of generic pointers to @code{__ea} pointers.  The
17344 default is to allow address space pointer conversions.
17346 @item -mcache-size=@var{cache-size}
17347 @opindex mcache-size
17348 This option controls the version of libgcc that the compiler links to an
17349 executable and selects a software-managed cache for accessing variables
17350 in the @code{__ea} address space with a particular cache size.  Possible
17351 options for @var{cache-size} are @samp{8}, @samp{16}, @samp{32}, @samp{64}
17352 and @samp{128}.  The default cache size is 64KB.
17354 @item -matomic-updates
17355 @itemx -mno-atomic-updates
17356 @opindex matomic-updates
17357 @opindex mno-atomic-updates
17358 This option controls the version of libgcc that the compiler links to an
17359 executable and selects whether atomic updates to the software-managed
17360 cache of PPU-side variables are used.  If you use atomic updates, changes
17361 to a PPU variable from SPU code using the @code{__ea} named address space
17362 qualifier will not interfere with changes to other PPU variables residing
17363 in the same cache line from PPU code.  If you do not use atomic updates,
17364 such interference may occur; however, writing back cache lines will be
17365 more efficient.  The default behavior is to use atomic updates.
17367 @item -mdual-nops
17368 @itemx -mdual-nops=@var{n}
17369 @opindex mdual-nops
17370 By default, GCC will insert nops to increase dual issue when it expects
17371 it to increase performance.  @var{n} can be a value from 0 to 10.  A
17372 smaller @var{n} will insert fewer nops.  10 is the default, 0 is the
17373 same as @option{-mno-dual-nops}.  Disabled with @option{-Os}.
17375 @item -mhint-max-nops=@var{n}
17376 @opindex mhint-max-nops
17377 Maximum number of nops to insert for a branch hint.  A branch hint must
17378 be at least 8 instructions away from the branch it is effecting.  GCC
17379 will insert up to @var{n} nops to enforce this, otherwise it will not
17380 generate the branch hint.
17382 @item -mhint-max-distance=@var{n}
17383 @opindex mhint-max-distance
17384 The encoding of the branch hint instruction limits the hint to be within
17385 256 instructions of the branch it is effecting.  By default, GCC makes
17386 sure it is within 125.
17388 @item -msafe-hints
17389 @opindex msafe-hints
17390 Work around a hardware bug which causes the SPU to stall indefinitely.
17391 By default, GCC will insert the @code{hbrp} instruction to make sure
17392 this stall won't happen.
17394 @end table
17396 @node System V Options
17397 @subsection Options for System V
17399 These additional options are available on System V Release 4 for
17400 compatibility with other compilers on those systems:
17402 @table @gcctabopt
17403 @item -G
17404 @opindex G
17405 Create a shared object.
17406 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
17408 @item -Qy
17409 @opindex Qy
17410 Identify the versions of each tool used by the compiler, in a
17411 @code{.ident} assembler directive in the output.
17413 @item -Qn
17414 @opindex Qn
17415 Refrain from adding @code{.ident} directives to the output file (this is
17416 the default).
17418 @item -YP,@var{dirs}
17419 @opindex YP
17420 Search the directories @var{dirs}, and no others, for libraries
17421 specified with @option{-l}.
17423 @item -Ym,@var{dir}
17424 @opindex Ym
17425 Look in the directory @var{dir} to find the M4 preprocessor.
17426 The assembler uses this option.
17427 @c This is supposed to go with a -Yd for predefined M4 macro files, but
17428 @c the generic assembler that comes with Solaris takes just -Ym.
17429 @end table
17431 @node V850 Options
17432 @subsection V850 Options
17433 @cindex V850 Options
17435 These @samp{-m} options are defined for V850 implementations:
17437 @table @gcctabopt
17438 @item -mlong-calls
17439 @itemx -mno-long-calls
17440 @opindex mlong-calls
17441 @opindex mno-long-calls
17442 Treat all calls as being far away (near).  If calls are assumed to be
17443 far away, the compiler will always load the functions address up into a
17444 register, and call indirect through the pointer.
17446 @item -mno-ep
17447 @itemx -mep
17448 @opindex mno-ep
17449 @opindex mep
17450 Do not optimize (do optimize) basic blocks that use the same index
17451 pointer 4 or more times to copy pointer into the @code{ep} register, and
17452 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
17453 option is on by default if you optimize.
17455 @item -mno-prolog-function
17456 @itemx -mprolog-function
17457 @opindex mno-prolog-function
17458 @opindex mprolog-function
17459 Do not use (do use) external functions to save and restore registers
17460 at the prologue and epilogue of a function.  The external functions
17461 are slower, but use less code space if more than one function saves
17462 the same number of registers.  The @option{-mprolog-function} option
17463 is on by default if you optimize.
17465 @item -mspace
17466 @opindex mspace
17467 Try to make the code as small as possible.  At present, this just turns
17468 on the @option{-mep} and @option{-mprolog-function} options.
17470 @item -mtda=@var{n}
17471 @opindex mtda
17472 Put static or global variables whose size is @var{n} bytes or less into
17473 the tiny data area that register @code{ep} points to.  The tiny data
17474 area can hold up to 256 bytes in total (128 bytes for byte references).
17476 @item -msda=@var{n}
17477 @opindex msda
17478 Put static or global variables whose size is @var{n} bytes or less into
17479 the small data area that register @code{gp} points to.  The small data
17480 area can hold up to 64 kilobytes.
17482 @item -mzda=@var{n}
17483 @opindex mzda
17484 Put static or global variables whose size is @var{n} bytes or less into
17485 the first 32 kilobytes of memory.
17487 @item -mv850
17488 @opindex mv850
17489 Specify that the target processor is the V850.
17491 @item -mbig-switch
17492 @opindex mbig-switch
17493 Generate code suitable for big switch tables.  Use this option only if
17494 the assembler/linker complain about out of range branches within a switch
17495 table.
17497 @item -mapp-regs
17498 @opindex mapp-regs
17499 This option will cause r2 and r5 to be used in the code generated by
17500 the compiler.  This setting is the default.
17502 @item -mno-app-regs
17503 @opindex mno-app-regs
17504 This option will cause r2 and r5 to be treated as fixed registers.
17506 @item -mv850e2v3
17507 @opindex mv850e2v3
17508 Specify that the target processor is the V850E2V3.  The preprocessor
17509 constants @samp{__v850e2v3__} will be defined if
17510 this option is used.
17512 @item -mv850e2
17513 @opindex mv850e2
17514 Specify that the target processor is the V850E2.  The preprocessor
17515 constants @samp{__v850e2__} will be defined if this option is used.
17517 @item -mv850e1
17518 @opindex mv850e1
17519 Specify that the target processor is the V850E1.  The preprocessor
17520 constants @samp{__v850e1__} and @samp{__v850e__} will be defined if
17521 this option is used.
17523 @item -mv850es
17524 @opindex mv850es
17525 Specify that the target processor is the V850ES.  This is an alias for
17526 the @option{-mv850e1} option.
17528 @item -mv850e
17529 @opindex mv850e
17530 Specify that the target processor is the V850E@.  The preprocessor
17531 constant @samp{__v850e__} will be defined if this option is used.
17533 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
17534 nor @option{-mv850e2} nor @option{-mv850e2v3}
17535 are defined then a default target processor will be chosen and the
17536 relevant @samp{__v850*__} preprocessor constant will be defined.
17538 The preprocessor constants @samp{__v850} and @samp{__v851__} are always
17539 defined, regardless of which processor variant is the target.
17541 @item -mdisable-callt
17542 @opindex mdisable-callt
17543 This option will suppress generation of the CALLT instruction for the
17544 v850e, v850e1, v850e2 and v850e2v3 flavors of the v850 architecture.  The default is
17545 @option{-mno-disable-callt} which allows the CALLT instruction to be used.
17547 @end table
17549 @node VAX Options
17550 @subsection VAX Options
17551 @cindex VAX options
17553 These @samp{-m} options are defined for the VAX:
17555 @table @gcctabopt
17556 @item -munix
17557 @opindex munix
17558 Do not output certain jump instructions (@code{aobleq} and so on)
17559 that the Unix assembler for the VAX cannot handle across long
17560 ranges.
17562 @item -mgnu
17563 @opindex mgnu
17564 Do output those jump instructions, on the assumption that you
17565 will assemble with the GNU assembler.
17567 @item -mg
17568 @opindex mg
17569 Output code for g-format floating point numbers instead of d-format.
17570 @end table
17572 @node VxWorks Options
17573 @subsection VxWorks Options
17574 @cindex VxWorks Options
17576 The options in this section are defined for all VxWorks targets.
17577 Options specific to the target hardware are listed with the other
17578 options for that target.
17580 @table @gcctabopt
17581 @item -mrtp
17582 @opindex mrtp
17583 GCC can generate code for both VxWorks kernels and real time processes
17584 (RTPs).  This option switches from the former to the latter.  It also
17585 defines the preprocessor macro @code{__RTP__}.
17587 @item -non-static
17588 @opindex non-static
17589 Link an RTP executable against shared libraries rather than static
17590 libraries.  The options @option{-static} and @option{-shared} can
17591 also be used for RTPs (@pxref{Link Options}); @option{-static}
17592 is the default.
17594 @item -Bstatic
17595 @itemx -Bdynamic
17596 @opindex Bstatic
17597 @opindex Bdynamic
17598 These options are passed down to the linker.  They are defined for
17599 compatibility with Diab.
17601 @item -Xbind-lazy
17602 @opindex Xbind-lazy
17603 Enable lazy binding of function calls.  This option is equivalent to
17604 @option{-Wl,-z,now} and is defined for compatibility with Diab.
17606 @item -Xbind-now
17607 @opindex Xbind-now
17608 Disable lazy binding of function calls.  This option is the default and
17609 is defined for compatibility with Diab.
17610 @end table
17612 @node x86-64 Options
17613 @subsection x86-64 Options
17614 @cindex x86-64 options
17616 These are listed under @xref{i386 and x86-64 Options}.
17618 @node Xstormy16 Options
17619 @subsection Xstormy16 Options
17620 @cindex Xstormy16 Options
17622 These options are defined for Xstormy16:
17624 @table @gcctabopt
17625 @item -msim
17626 @opindex msim
17627 Choose startup files and linker script suitable for the simulator.
17628 @end table
17630 @node Xtensa Options
17631 @subsection Xtensa Options
17632 @cindex Xtensa Options
17634 These options are supported for Xtensa targets:
17636 @table @gcctabopt
17637 @item -mconst16
17638 @itemx -mno-const16
17639 @opindex mconst16
17640 @opindex mno-const16
17641 Enable or disable use of @code{CONST16} instructions for loading
17642 constant values.  The @code{CONST16} instruction is currently not a
17643 standard option from Tensilica.  When enabled, @code{CONST16}
17644 instructions are always used in place of the standard @code{L32R}
17645 instructions.  The use of @code{CONST16} is enabled by default only if
17646 the @code{L32R} instruction is not available.
17648 @item -mfused-madd
17649 @itemx -mno-fused-madd
17650 @opindex mfused-madd
17651 @opindex mno-fused-madd
17652 Enable or disable use of fused multiply/add and multiply/subtract
17653 instructions in the floating-point option.  This has no effect if the
17654 floating-point option is not also enabled.  Disabling fused multiply/add
17655 and multiply/subtract instructions forces the compiler to use separate
17656 instructions for the multiply and add/subtract operations.  This may be
17657 desirable in some cases where strict IEEE 754-compliant results are
17658 required: the fused multiply add/subtract instructions do not round the
17659 intermediate result, thereby producing results with @emph{more} bits of
17660 precision than specified by the IEEE standard.  Disabling fused multiply
17661 add/subtract instructions also ensures that the program output is not
17662 sensitive to the compiler's ability to combine multiply and add/subtract
17663 operations.
17665 @item -mserialize-volatile
17666 @itemx -mno-serialize-volatile
17667 @opindex mserialize-volatile
17668 @opindex mno-serialize-volatile
17669 When this option is enabled, GCC inserts @code{MEMW} instructions before
17670 @code{volatile} memory references to guarantee sequential consistency.
17671 The default is @option{-mserialize-volatile}.  Use
17672 @option{-mno-serialize-volatile} to omit the @code{MEMW} instructions.
17674 @item -mforce-no-pic
17675 @opindex mforce-no-pic
17676 For targets, like GNU/Linux, where all user-mode Xtensa code must be
17677 position-independent code (PIC), this option disables PIC for compiling
17678 kernel code.
17680 @item -mtext-section-literals
17681 @itemx -mno-text-section-literals
17682 @opindex mtext-section-literals
17683 @opindex mno-text-section-literals
17684 Control the treatment of literal pools.  The default is
17685 @option{-mno-text-section-literals}, which places literals in a separate
17686 section in the output file.  This allows the literal pool to be placed
17687 in a data RAM/ROM, and it also allows the linker to combine literal
17688 pools from separate object files to remove redundant literals and
17689 improve code size.  With @option{-mtext-section-literals}, the literals
17690 are interspersed in the text section in order to keep them as close as
17691 possible to their references.  This may be necessary for large assembly
17692 files.
17694 @item -mtarget-align
17695 @itemx -mno-target-align
17696 @opindex mtarget-align
17697 @opindex mno-target-align
17698 When this option is enabled, GCC instructs the assembler to
17699 automatically align instructions to reduce branch penalties at the
17700 expense of some code density.  The assembler attempts to widen density
17701 instructions to align branch targets and the instructions following call
17702 instructions.  If there are not enough preceding safe density
17703 instructions to align a target, no widening will be performed.  The
17704 default is @option{-mtarget-align}.  These options do not affect the
17705 treatment of auto-aligned instructions like @code{LOOP}, which the
17706 assembler will always align, either by widening density instructions or
17707 by inserting no-op instructions.
17709 @item -mlongcalls
17710 @itemx -mno-longcalls
17711 @opindex mlongcalls
17712 @opindex mno-longcalls
17713 When this option is enabled, GCC instructs the assembler to translate
17714 direct calls to indirect calls unless it can determine that the target
17715 of a direct call is in the range allowed by the call instruction.  This
17716 translation typically occurs for calls to functions in other source
17717 files.  Specifically, the assembler translates a direct @code{CALL}
17718 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
17719 The default is @option{-mno-longcalls}.  This option should be used in
17720 programs where the call target can potentially be out of range.  This
17721 option is implemented in the assembler, not the compiler, so the
17722 assembly code generated by GCC will still show direct call
17723 instructions---look at the disassembled object code to see the actual
17724 instructions.  Note that the assembler will use an indirect call for
17725 every cross-file call, not just those that really will be out of range.
17726 @end table
17728 @node zSeries Options
17729 @subsection zSeries Options
17730 @cindex zSeries options
17732 These are listed under @xref{S/390 and zSeries Options}.
17734 @node Code Gen Options
17735 @section Options for Code Generation Conventions
17736 @cindex code generation conventions
17737 @cindex options, code generation
17738 @cindex run-time options
17740 These machine-independent options control the interface conventions
17741 used in code generation.
17743 Most of them have both positive and negative forms; the negative form
17744 of @option{-ffoo} would be @option{-fno-foo}.  In the table below, only
17745 one of the forms is listed---the one which is not the default.  You
17746 can figure out the other form by either removing @samp{no-} or adding
17749 @table @gcctabopt
17750 @item -fbounds-check
17751 @opindex fbounds-check
17752 For front-ends that support it, generate additional code to check that
17753 indices used to access arrays are within the declared range.  This is
17754 currently only supported by the Java and Fortran front-ends, where
17755 this option defaults to true and false respectively.
17757 @item -ftrapv
17758 @opindex ftrapv
17759 This option generates traps for signed overflow on addition, subtraction,
17760 multiplication operations.
17762 @item -fwrapv
17763 @opindex fwrapv
17764 This option instructs the compiler to assume that signed arithmetic
17765 overflow of addition, subtraction and multiplication wraps around
17766 using twos-complement representation.  This flag enables some optimizations
17767 and disables others.  This option is enabled by default for the Java
17768 front-end, as required by the Java language specification.
17770 @item -fexceptions
17771 @opindex fexceptions
17772 Enable exception handling.  Generates extra code needed to propagate
17773 exceptions.  For some targets, this implies GCC will generate frame
17774 unwind information for all functions, which can produce significant data
17775 size overhead, although it does not affect execution.  If you do not
17776 specify this option, GCC will enable it by default for languages like
17777 C++ which normally require exception handling, and disable it for
17778 languages like C that do not normally require it.  However, you may need
17779 to enable this option when compiling C code that needs to interoperate
17780 properly with exception handlers written in C++.  You may also wish to
17781 disable this option if you are compiling older C++ programs that don't
17782 use exception handling.
17784 @item -fnon-call-exceptions
17785 @opindex fnon-call-exceptions
17786 Generate code that allows trapping instructions to throw exceptions.
17787 Note that this requires platform-specific runtime support that does
17788 not exist everywhere.  Moreover, it only allows @emph{trapping}
17789 instructions to throw exceptions, i.e.@: memory references or floating
17790 point instructions.  It does not allow exceptions to be thrown from
17791 arbitrary signal handlers such as @code{SIGALRM}.
17793 @item -funwind-tables
17794 @opindex funwind-tables
17795 Similar to @option{-fexceptions}, except that it will just generate any needed
17796 static data, but will not affect the generated code in any other way.
17797 You will normally not enable this option; instead, a language processor
17798 that needs this handling would enable it on your behalf.
17800 @item -fasynchronous-unwind-tables
17801 @opindex fasynchronous-unwind-tables
17802 Generate unwind table in dwarf2 format, if supported by target machine.  The
17803 table is exact at each instruction boundary, so it can be used for stack
17804 unwinding from asynchronous events (such as debugger or garbage collector).
17806 @item -fpcc-struct-return
17807 @opindex fpcc-struct-return
17808 Return ``short'' @code{struct} and @code{union} values in memory like
17809 longer ones, rather than in registers.  This convention is less
17810 efficient, but it has the advantage of allowing intercallability between
17811 GCC-compiled files and files compiled with other compilers, particularly
17812 the Portable C Compiler (pcc).
17814 The precise convention for returning structures in memory depends
17815 on the target configuration macros.
17817 Short structures and unions are those whose size and alignment match
17818 that of some integer type.
17820 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
17821 switch is not binary compatible with code compiled with the
17822 @option{-freg-struct-return} switch.
17823 Use it to conform to a non-default application binary interface.
17825 @item -freg-struct-return
17826 @opindex freg-struct-return
17827 Return @code{struct} and @code{union} values in registers when possible.
17828 This is more efficient for small structures than
17829 @option{-fpcc-struct-return}.
17831 If you specify neither @option{-fpcc-struct-return} nor
17832 @option{-freg-struct-return}, GCC defaults to whichever convention is
17833 standard for the target.  If there is no standard convention, GCC
17834 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
17835 the principal compiler.  In those cases, we can choose the standard, and
17836 we chose the more efficient register return alternative.
17838 @strong{Warning:} code compiled with the @option{-freg-struct-return}
17839 switch is not binary compatible with code compiled with the
17840 @option{-fpcc-struct-return} switch.
17841 Use it to conform to a non-default application binary interface.
17843 @item -fshort-enums
17844 @opindex fshort-enums
17845 Allocate to an @code{enum} type only as many bytes as it needs for the
17846 declared range of possible values.  Specifically, the @code{enum} type
17847 will be equivalent to the smallest integer type which has enough room.
17849 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
17850 code that is not binary compatible with code generated without that switch.
17851 Use it to conform to a non-default application binary interface.
17853 @item -fshort-double
17854 @opindex fshort-double
17855 Use the same size for @code{double} as for @code{float}.
17857 @strong{Warning:} the @option{-fshort-double} switch causes GCC to generate
17858 code that is not binary compatible with code generated without that switch.
17859 Use it to conform to a non-default application binary interface.
17861 @item -fshort-wchar
17862 @opindex fshort-wchar
17863 Override the underlying type for @samp{wchar_t} to be @samp{short
17864 unsigned int} instead of the default for the target.  This option is
17865 useful for building programs to run under WINE@.
17867 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
17868 code that is not binary compatible with code generated without that switch.
17869 Use it to conform to a non-default application binary interface.
17871 @item -fno-common
17872 @opindex fno-common
17873 In C code, controls the placement of uninitialized global variables.
17874 Unix C compilers have traditionally permitted multiple definitions of
17875 such variables in different compilation units by placing the variables
17876 in a common block.
17877 This is the behavior specified by @option{-fcommon}, and is the default
17878 for GCC on most targets.
17879 On the other hand, this behavior is not required by ISO C, and on some
17880 targets may carry a speed or code size penalty on variable references.
17881 The @option{-fno-common} option specifies that the compiler should place
17882 uninitialized global variables in the data section of the object file,
17883 rather than generating them as common blocks.
17884 This has the effect that if the same variable is declared
17885 (without @code{extern}) in two different compilations,
17886 you will get a multiple-definition error when you link them.
17887 In this case, you must compile with @option{-fcommon} instead.
17888 Compiling with @option{-fno-common} is useful on targets for which
17889 it provides better performance, or if you wish to verify that the
17890 program will work on other systems which always treat uninitialized
17891 variable declarations this way.
17893 @item -fno-ident
17894 @opindex fno-ident
17895 Ignore the @samp{#ident} directive.
17897 @item -finhibit-size-directive
17898 @opindex finhibit-size-directive
17899 Don't output a @code{.size} assembler directive, or anything else that
17900 would cause trouble if the function is split in the middle, and the
17901 two halves are placed at locations far apart in memory.  This option is
17902 used when compiling @file{crtstuff.c}; you should not need to use it
17903 for anything else.
17905 @item -fverbose-asm
17906 @opindex fverbose-asm
17907 Put extra commentary information in the generated assembly code to
17908 make it more readable.  This option is generally only of use to those
17909 who actually need to read the generated assembly code (perhaps while
17910 debugging the compiler itself).
17912 @option{-fno-verbose-asm}, the default, causes the
17913 extra information to be omitted and is useful when comparing two assembler
17914 files.
17916 @item -frecord-gcc-switches
17917 @opindex frecord-gcc-switches
17918 This switch causes the command line that was used to invoke the
17919 compiler to be recorded into the object file that is being created.
17920 This switch is only implemented on some targets and the exact format
17921 of the recording is target and binary file format dependent, but it
17922 usually takes the form of a section containing ASCII text.  This
17923 switch is related to the @option{-fverbose-asm} switch, but that
17924 switch only records information in the assembler output file as
17925 comments, so it never reaches the object file.
17927 @item -fpic
17928 @opindex fpic
17929 @cindex global offset table
17930 @cindex PIC
17931 Generate position-independent code (PIC) suitable for use in a shared
17932 library, if supported for the target machine.  Such code accesses all
17933 constant addresses through a global offset table (GOT)@.  The dynamic
17934 loader resolves the GOT entries when the program starts (the dynamic
17935 loader is not part of GCC; it is part of the operating system).  If
17936 the GOT size for the linked executable exceeds a machine-specific
17937 maximum size, you get an error message from the linker indicating that
17938 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
17939 instead.  (These maximums are 8k on the SPARC and 32k
17940 on the m68k and RS/6000.  The 386 has no such limit.)
17942 Position-independent code requires special support, and therefore works
17943 only on certain machines.  For the 386, GCC supports PIC for System V
17944 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
17945 position-independent.
17947 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
17948 are defined to 1.
17950 @item -fPIC
17951 @opindex fPIC
17952 If supported for the target machine, emit position-independent code,
17953 suitable for dynamic linking and avoiding any limit on the size of the
17954 global offset table.  This option makes a difference on the m68k,
17955 PowerPC and SPARC@.
17957 Position-independent code requires special support, and therefore works
17958 only on certain machines.
17960 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
17961 are defined to 2.
17963 @item -fpie
17964 @itemx -fPIE
17965 @opindex fpie
17966 @opindex fPIE
17967 These options are similar to @option{-fpic} and @option{-fPIC}, but
17968 generated position independent code can be only linked into executables.
17969 Usually these options are used when @option{-pie} GCC option will be
17970 used during linking.
17972 @option{-fpie} and @option{-fPIE} both define the macros
17973 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
17974 for @option{-fpie} and 2 for @option{-fPIE}.
17976 @item -fno-jump-tables
17977 @opindex fno-jump-tables
17978 Do not use jump tables for switch statements even where it would be
17979 more efficient than other code generation strategies.  This option is
17980 of use in conjunction with @option{-fpic} or @option{-fPIC} for
17981 building code which forms part of a dynamic linker and cannot
17982 reference the address of a jump table.  On some targets, jump tables
17983 do not require a GOT and this option is not needed.
17985 @item -ffixed-@var{reg}
17986 @opindex ffixed
17987 Treat the register named @var{reg} as a fixed register; generated code
17988 should never refer to it (except perhaps as a stack pointer, frame
17989 pointer or in some other fixed role).
17991 @var{reg} must be the name of a register.  The register names accepted
17992 are machine-specific and are defined in the @code{REGISTER_NAMES}
17993 macro in the machine description macro file.
17995 This flag does not have a negative form, because it specifies a
17996 three-way choice.
17998 @item -fcall-used-@var{reg}
17999 @opindex fcall-used
18000 Treat the register named @var{reg} as an allocable register that is
18001 clobbered by function calls.  It may be allocated for temporaries or
18002 variables that do not live across a call.  Functions compiled this way
18003 will not save and restore the register @var{reg}.
18005 It is an error to used this flag with the frame pointer or stack pointer.
18006 Use of this flag for other registers that have fixed pervasive roles in
18007 the machine's execution model will produce disastrous results.
18009 This flag does not have a negative form, because it specifies a
18010 three-way choice.
18012 @item -fcall-saved-@var{reg}
18013 @opindex fcall-saved
18014 Treat the register named @var{reg} as an allocable register saved by
18015 functions.  It may be allocated even for temporaries or variables that
18016 live across a call.  Functions compiled this way will save and restore
18017 the register @var{reg} if they use it.
18019 It is an error to used this flag with the frame pointer or stack pointer.
18020 Use of this flag for other registers that have fixed pervasive roles in
18021 the machine's execution model will produce disastrous results.
18023 A different sort of disaster will result from the use of this flag for
18024 a register in which function values may be returned.
18026 This flag does not have a negative form, because it specifies a
18027 three-way choice.
18029 @item -fpack-struct[=@var{n}]
18030 @opindex fpack-struct
18031 Without a value specified, pack all structure members together without
18032 holes.  When a value is specified (which must be a small power of two), pack
18033 structure members according to this value, representing the maximum
18034 alignment (that is, objects with default alignment requirements larger than
18035 this will be output potentially unaligned at the next fitting location.
18037 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
18038 code that is not binary compatible with code generated without that switch.
18039 Additionally, it makes the code suboptimal.
18040 Use it to conform to a non-default application binary interface.
18042 @item -finstrument-functions
18043 @opindex finstrument-functions
18044 Generate instrumentation calls for entry and exit to functions.  Just
18045 after function entry and just before function exit, the following
18046 profiling functions will be called with the address of the current
18047 function and its call site.  (On some platforms,
18048 @code{__builtin_return_address} does not work beyond the current
18049 function, so the call site information may not be available to the
18050 profiling functions otherwise.)
18052 @smallexample
18053 void __cyg_profile_func_enter (void *this_fn,
18054                                void *call_site);
18055 void __cyg_profile_func_exit  (void *this_fn,
18056                                void *call_site);
18057 @end smallexample
18059 The first argument is the address of the start of the current function,
18060 which may be looked up exactly in the symbol table.
18062 This instrumentation is also done for functions expanded inline in other
18063 functions.  The profiling calls will indicate where, conceptually, the
18064 inline function is entered and exited.  This means that addressable
18065 versions of such functions must be available.  If all your uses of a
18066 function are expanded inline, this may mean an additional expansion of
18067 code size.  If you use @samp{extern inline} in your C code, an
18068 addressable version of such functions must be provided.  (This is
18069 normally the case anyways, but if you get lucky and the optimizer always
18070 expands the functions inline, you might have gotten away without
18071 providing static copies.)
18073 A function may be given the attribute @code{no_instrument_function}, in
18074 which case this instrumentation will not be done.  This can be used, for
18075 example, for the profiling functions listed above, high-priority
18076 interrupt routines, and any functions from which the profiling functions
18077 cannot safely be called (perhaps signal handlers, if the profiling
18078 routines generate output or allocate memory).
18080 @item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
18081 @opindex finstrument-functions-exclude-file-list
18083 Set the list of functions that are excluded from instrumentation (see
18084 the description of @code{-finstrument-functions}).  If the file that
18085 contains a function definition matches with one of @var{file}, then
18086 that function is not instrumented.  The match is done on substrings:
18087 if the @var{file} parameter is a substring of the file name, it is
18088 considered to be a match.
18090 For example:
18092 @smallexample
18093 -finstrument-functions-exclude-file-list=/bits/stl,include/sys
18094 @end smallexample
18096 @noindent
18097 will exclude any inline function defined in files whose pathnames
18098 contain @code{/bits/stl} or @code{include/sys}.
18100 If, for some reason, you want to include letter @code{','} in one of
18101 @var{sym}, write @code{'\,'}. For example,
18102 @code{-finstrument-functions-exclude-file-list='\,\,tmp'}
18103 (note the single quote surrounding the option).
18105 @item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{}
18106 @opindex finstrument-functions-exclude-function-list
18108 This is similar to @code{-finstrument-functions-exclude-file-list},
18109 but this option sets the list of function names to be excluded from
18110 instrumentation.  The function name to be matched is its user-visible
18111 name, such as @code{vector<int> blah(const vector<int> &)}, not the
18112 internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}).  The
18113 match is done on substrings: if the @var{sym} parameter is a substring
18114 of the function name, it is considered to be a match.  For C99 and C++
18115 extended identifiers, the function name must be given in UTF-8, not
18116 using universal character names.
18118 @item -fstack-check
18119 @opindex fstack-check
18120 Generate code to verify that you do not go beyond the boundary of the
18121 stack.  You should specify this flag if you are running in an
18122 environment with multiple threads, but only rarely need to specify it in
18123 a single-threaded environment since stack overflow is automatically
18124 detected on nearly all systems if there is only one stack.
18126 Note that this switch does not actually cause checking to be done; the
18127 operating system or the language runtime must do that.  The switch causes
18128 generation of code to ensure that they see the stack being extended.
18130 You can additionally specify a string parameter: @code{no} means no
18131 checking, @code{generic} means force the use of old-style checking,
18132 @code{specific} means use the best checking method and is equivalent
18133 to bare @option{-fstack-check}.
18135 Old-style checking is a generic mechanism that requires no specific
18136 target support in the compiler but comes with the following drawbacks:
18138 @enumerate
18139 @item
18140 Modified allocation strategy for large objects: they will always be
18141 allocated dynamically if their size exceeds a fixed threshold.
18143 @item
18144 Fixed limit on the size of the static frame of functions: when it is
18145 topped by a particular function, stack checking is not reliable and
18146 a warning is issued by the compiler.
18148 @item
18149 Inefficiency: because of both the modified allocation strategy and the
18150 generic implementation, the performances of the code are hampered.
18151 @end enumerate
18153 Note that old-style stack checking is also the fallback method for
18154 @code{specific} if no target support has been added in the compiler.
18156 @item -fstack-limit-register=@var{reg}
18157 @itemx -fstack-limit-symbol=@var{sym}
18158 @itemx -fno-stack-limit
18159 @opindex fstack-limit-register
18160 @opindex fstack-limit-symbol
18161 @opindex fno-stack-limit
18162 Generate code to ensure that the stack does not grow beyond a certain value,
18163 either the value of a register or the address of a symbol.  If the stack
18164 would grow beyond the value, a signal is raised.  For most targets,
18165 the signal is raised before the stack overruns the boundary, so
18166 it is possible to catch the signal without taking special precautions.
18168 For instance, if the stack starts at absolute address @samp{0x80000000}
18169 and grows downwards, you can use the flags
18170 @option{-fstack-limit-symbol=__stack_limit} and
18171 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
18172 of 128KB@.  Note that this may only work with the GNU linker.
18174 @item -fsplit-stack
18175 @opindex fsplit-stack
18176 Generate code to automatically split the stack before it overflows.
18177 The resulting program has a discontiguous stack which can only
18178 overflow if the program is unable to allocate any more memory.  This
18179 is most useful when running threaded programs, as it is no longer
18180 necessary to calculate a good stack size to use for each thread.  This
18181 is currently only implemented for the i386 and x86_64 backends running
18182 GNU/Linux.
18184 When code compiled with @option{-fsplit-stack} calls code compiled
18185 without @option{-fsplit-stack}, there may not be much stack space
18186 available for the latter code to run.  If compiling all code,
18187 including library code, with @option{-fsplit-stack} is not an option,
18188 then the linker can fix up these calls so that the code compiled
18189 without @option{-fsplit-stack} always has a large stack.  Support for
18190 this is implemented in the gold linker in GNU binutils release 2.21
18191 and later.
18193 @item -fleading-underscore
18194 @opindex fleading-underscore
18195 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
18196 change the way C symbols are represented in the object file.  One use
18197 is to help link with legacy assembly code.
18199 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
18200 generate code that is not binary compatible with code generated without that
18201 switch.  Use it to conform to a non-default application binary interface.
18202 Not all targets provide complete support for this switch.
18204 @item -ftls-model=@var{model}
18205 @opindex ftls-model
18206 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
18207 The @var{model} argument should be one of @code{global-dynamic},
18208 @code{local-dynamic}, @code{initial-exec} or @code{local-exec}.
18210 The default without @option{-fpic} is @code{initial-exec}; with
18211 @option{-fpic} the default is @code{global-dynamic}.
18213 @item -fvisibility=@var{default|internal|hidden|protected}
18214 @opindex fvisibility
18215 Set the default ELF image symbol visibility to the specified option---all
18216 symbols will be marked with this unless overridden within the code.
18217 Using this feature can very substantially improve linking and
18218 load times of shared object libraries, produce more optimized
18219 code, provide near-perfect API export and prevent symbol clashes.
18220 It is @strong{strongly} recommended that you use this in any shared objects
18221 you distribute.
18223 Despite the nomenclature, @code{default} always means public; i.e.,
18224 available to be linked against from outside the shared object.
18225 @code{protected} and @code{internal} are pretty useless in real-world
18226 usage so the only other commonly used option will be @code{hidden}.
18227 The default if @option{-fvisibility} isn't specified is
18228 @code{default}, i.e., make every
18229 symbol public---this causes the same behavior as previous versions of
18230 GCC@.
18232 A good explanation of the benefits offered by ensuring ELF
18233 symbols have the correct visibility is given by ``How To Write
18234 Shared Libraries'' by Ulrich Drepper (which can be found at
18235 @w{@uref{http://people.redhat.com/~drepper/}})---however a superior
18236 solution made possible by this option to marking things hidden when
18237 the default is public is to make the default hidden and mark things
18238 public.  This is the norm with DLL's on Windows and with @option{-fvisibility=hidden}
18239 and @code{__attribute__ ((visibility("default")))} instead of
18240 @code{__declspec(dllexport)} you get almost identical semantics with
18241 identical syntax.  This is a great boon to those working with
18242 cross-platform projects.
18244 For those adding visibility support to existing code, you may find
18245 @samp{#pragma GCC visibility} of use.  This works by you enclosing
18246 the declarations you wish to set visibility for with (for example)
18247 @samp{#pragma GCC visibility push(hidden)} and
18248 @samp{#pragma GCC visibility pop}.
18249 Bear in mind that symbol visibility should be viewed @strong{as
18250 part of the API interface contract} and thus all new code should
18251 always specify visibility when it is not the default; i.e., declarations
18252 only for use within the local DSO should @strong{always} be marked explicitly
18253 as hidden as so to avoid PLT indirection overheads---making this
18254 abundantly clear also aids readability and self-documentation of the code.
18255 Note that due to ISO C++ specification requirements, operator new and
18256 operator delete must always be of default visibility.
18258 Be aware that headers from outside your project, in particular system
18259 headers and headers from any other library you use, may not be
18260 expecting to be compiled with visibility other than the default.  You
18261 may need to explicitly say @samp{#pragma GCC visibility push(default)}
18262 before including any such headers.
18264 @samp{extern} declarations are not affected by @samp{-fvisibility}, so
18265 a lot of code can be recompiled with @samp{-fvisibility=hidden} with
18266 no modifications.  However, this means that calls to @samp{extern}
18267 functions with no explicit visibility will use the PLT, so it is more
18268 effective to use @samp{__attribute ((visibility))} and/or
18269 @samp{#pragma GCC visibility} to tell the compiler which @samp{extern}
18270 declarations should be treated as hidden.
18272 Note that @samp{-fvisibility} does affect C++ vague linkage
18273 entities. This means that, for instance, an exception class that will
18274 be thrown between DSOs must be explicitly marked with default
18275 visibility so that the @samp{type_info} nodes will be unified between
18276 the DSOs.
18278 An overview of these techniques, their benefits and how to use them
18279 is at @uref{http://gcc.gnu.org/@/wiki/@/Visibility}.
18281 @item -fstrict-volatile-bitfields
18282 @opindex fstrict-volatile-bitfields
18283 This option should be used if accesses to volatile bitfields (or other
18284 structure fields, although the compiler usually honors those types
18285 anyway) should use a single access of the width of the
18286 field's type, aligned to a natural alignment if possible.  For
18287 example, targets with memory-mapped peripheral registers might require
18288 all such accesses to be 16 bits wide; with this flag the user could
18289 declare all peripheral bitfields as ``unsigned short'' (assuming short
18290 is 16 bits on these targets) to force GCC to use 16 bit accesses
18291 instead of, perhaps, a more efficient 32 bit access.
18293 If this option is disabled, the compiler will use the most efficient
18294 instruction.  In the previous example, that might be a 32-bit load
18295 instruction, even though that will access bytes that do not contain
18296 any portion of the bitfield, or memory-mapped registers unrelated to
18297 the one being updated.
18299 If the target requires strict alignment, and honoring the field
18300 type would require violating this alignment, a warning is issued.
18301 If the field has @code{packed} attribute, the access is done without
18302 honoring the field type.  If the field doesn't have @code{packed}
18303 attribute, the access is done honoring the field type.  In both cases,
18304 GCC assumes that the user knows something about the target hardware
18305 that it is unaware of.
18307 The default value of this option is determined by the application binary
18308 interface for the target processor.
18310 @end table
18312 @c man end
18314 @node Environment Variables
18315 @section Environment Variables Affecting GCC
18316 @cindex environment variables
18318 @c man begin ENVIRONMENT
18319 This section describes several environment variables that affect how GCC
18320 operates.  Some of them work by specifying directories or prefixes to use
18321 when searching for various kinds of files.  Some are used to specify other
18322 aspects of the compilation environment.
18324 Note that you can also specify places to search using options such as
18325 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
18326 take precedence over places specified using environment variables, which
18327 in turn take precedence over those specified by the configuration of GCC@.
18328 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
18329 GNU Compiler Collection (GCC) Internals}.
18331 @table @env
18332 @item LANG
18333 @itemx LC_CTYPE
18334 @c @itemx LC_COLLATE
18335 @itemx LC_MESSAGES
18336 @c @itemx LC_MONETARY
18337 @c @itemx LC_NUMERIC
18338 @c @itemx LC_TIME
18339 @itemx LC_ALL
18340 @findex LANG
18341 @findex LC_CTYPE
18342 @c @findex LC_COLLATE
18343 @findex LC_MESSAGES
18344 @c @findex LC_MONETARY
18345 @c @findex LC_NUMERIC
18346 @c @findex LC_TIME
18347 @findex LC_ALL
18348 @cindex locale
18349 These environment variables control the way that GCC uses
18350 localization information that allow GCC to work with different
18351 national conventions.  GCC inspects the locale categories
18352 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
18353 so.  These locale categories can be set to any value supported by your
18354 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
18355 Kingdom encoded in UTF-8.
18357 The @env{LC_CTYPE} environment variable specifies character
18358 classification.  GCC uses it to determine the character boundaries in
18359 a string; this is needed for some multibyte encodings that contain quote
18360 and escape characters that would otherwise be interpreted as a string
18361 end or escape.
18363 The @env{LC_MESSAGES} environment variable specifies the language to
18364 use in diagnostic messages.
18366 If the @env{LC_ALL} environment variable is set, it overrides the value
18367 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
18368 and @env{LC_MESSAGES} default to the value of the @env{LANG}
18369 environment variable.  If none of these variables are set, GCC
18370 defaults to traditional C English behavior.
18372 @item TMPDIR
18373 @findex TMPDIR
18374 If @env{TMPDIR} is set, it specifies the directory to use for temporary
18375 files.  GCC uses temporary files to hold the output of one stage of
18376 compilation which is to be used as input to the next stage: for example,
18377 the output of the preprocessor, which is the input to the compiler
18378 proper.
18380 @item GCC_COMPARE_DEBUG
18381 @findex GCC_COMPARE_DEBUG
18382 Setting @env{GCC_COMPARE_DEBUG} is nearly equivalent to passing
18383 @option{-fcompare-debug} to the compiler driver.  See the documentation
18384 of this option for more details.
18386 @item GCC_EXEC_PREFIX
18387 @findex GCC_EXEC_PREFIX
18388 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
18389 names of the subprograms executed by the compiler.  No slash is added
18390 when this prefix is combined with the name of a subprogram, but you can
18391 specify a prefix that ends with a slash if you wish.
18393 If @env{GCC_EXEC_PREFIX} is not set, GCC will attempt to figure out
18394 an appropriate prefix to use based on the pathname it was invoked with.
18396 If GCC cannot find the subprogram using the specified prefix, it
18397 tries looking in the usual places for the subprogram.
18399 The default value of @env{GCC_EXEC_PREFIX} is
18400 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
18401 the installed compiler. In many cases @var{prefix} is the value
18402 of @code{prefix} when you ran the @file{configure} script.
18404 Other prefixes specified with @option{-B} take precedence over this prefix.
18406 This prefix is also used for finding files such as @file{crt0.o} that are
18407 used for linking.
18409 In addition, the prefix is used in an unusual way in finding the
18410 directories to search for header files.  For each of the standard
18411 directories whose name normally begins with @samp{/usr/local/lib/gcc}
18412 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
18413 replacing that beginning with the specified prefix to produce an
18414 alternate directory name.  Thus, with @option{-Bfoo/}, GCC will search
18415 @file{foo/bar} where it would normally search @file{/usr/local/lib/bar}.
18416 These alternate directories are searched first; the standard directories
18417 come next. If a standard directory begins with the configured
18418 @var{prefix} then the value of @var{prefix} is replaced by
18419 @env{GCC_EXEC_PREFIX} when looking for header files.
18421 @item COMPILER_PATH
18422 @findex COMPILER_PATH
18423 The value of @env{COMPILER_PATH} is a colon-separated list of
18424 directories, much like @env{PATH}.  GCC tries the directories thus
18425 specified when searching for subprograms, if it can't find the
18426 subprograms using @env{GCC_EXEC_PREFIX}.
18428 @item LIBRARY_PATH
18429 @findex LIBRARY_PATH
18430 The value of @env{LIBRARY_PATH} is a colon-separated list of
18431 directories, much like @env{PATH}.  When configured as a native compiler,
18432 GCC tries the directories thus specified when searching for special
18433 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
18434 using GCC also uses these directories when searching for ordinary
18435 libraries for the @option{-l} option (but directories specified with
18436 @option{-L} come first).
18438 @item LANG
18439 @findex LANG
18440 @cindex locale definition
18441 This variable is used to pass locale information to the compiler.  One way in
18442 which this information is used is to determine the character set to be used
18443 when character literals, string literals and comments are parsed in C and C++.
18444 When the compiler is configured to allow multibyte characters,
18445 the following values for @env{LANG} are recognized:
18447 @table @samp
18448 @item C-JIS
18449 Recognize JIS characters.
18450 @item C-SJIS
18451 Recognize SJIS characters.
18452 @item C-EUCJP
18453 Recognize EUCJP characters.
18454 @end table
18456 If @env{LANG} is not defined, or if it has some other value, then the
18457 compiler will use mblen and mbtowc as defined by the default locale to
18458 recognize and translate multibyte characters.
18459 @end table
18461 @noindent
18462 Some additional environments variables affect the behavior of the
18463 preprocessor.
18465 @include cppenv.texi
18467 @c man end
18469 @node Precompiled Headers
18470 @section Using Precompiled Headers
18471 @cindex precompiled headers
18472 @cindex speed of compilation
18474 Often large projects have many header files that are included in every
18475 source file.  The time the compiler takes to process these header files
18476 over and over again can account for nearly all of the time required to
18477 build the project.  To make builds faster, GCC allows users to
18478 `precompile' a header file; then, if builds can use the precompiled
18479 header file they will be much faster.
18481 To create a precompiled header file, simply compile it as you would any
18482 other file, if necessary using the @option{-x} option to make the driver
18483 treat it as a C or C++ header file.  You will probably want to use a
18484 tool like @command{make} to keep the precompiled header up-to-date when
18485 the headers it contains change.
18487 A precompiled header file will be searched for when @code{#include} is
18488 seen in the compilation.  As it searches for the included file
18489 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
18490 compiler looks for a precompiled header in each directory just before it
18491 looks for the include file in that directory.  The name searched for is
18492 the name specified in the @code{#include} with @samp{.gch} appended.  If
18493 the precompiled header file can't be used, it is ignored.
18495 For instance, if you have @code{#include "all.h"}, and you have
18496 @file{all.h.gch} in the same directory as @file{all.h}, then the
18497 precompiled header file will be used if possible, and the original
18498 header will be used otherwise.
18500 Alternatively, you might decide to put the precompiled header file in a
18501 directory and use @option{-I} to ensure that directory is searched
18502 before (or instead of) the directory containing the original header.
18503 Then, if you want to check that the precompiled header file is always
18504 used, you can put a file of the same name as the original header in this
18505 directory containing an @code{#error} command.
18507 This also works with @option{-include}.  So yet another way to use
18508 precompiled headers, good for projects not designed with precompiled
18509 header files in mind, is to simply take most of the header files used by
18510 a project, include them from another header file, precompile that header
18511 file, and @option{-include} the precompiled header.  If the header files
18512 have guards against multiple inclusion, they will be skipped because
18513 they've already been included (in the precompiled header).
18515 If you need to precompile the same header file for different
18516 languages, targets, or compiler options, you can instead make a
18517 @emph{directory} named like @file{all.h.gch}, and put each precompiled
18518 header in the directory, perhaps using @option{-o}.  It doesn't matter
18519 what you call the files in the directory, every precompiled header in
18520 the directory will be considered.  The first precompiled header
18521 encountered in the directory that is valid for this compilation will
18522 be used; they're searched in no particular order.
18524 There are many other possibilities, limited only by your imagination,
18525 good sense, and the constraints of your build system.
18527 A precompiled header file can be used only when these conditions apply:
18529 @itemize
18530 @item
18531 Only one precompiled header can be used in a particular compilation.
18533 @item
18534 A precompiled header can't be used once the first C token is seen.  You
18535 can have preprocessor directives before a precompiled header; you can
18536 even include a precompiled header from inside another header, so long as
18537 there are no C tokens before the @code{#include}.
18539 @item
18540 The precompiled header file must be produced for the same language as
18541 the current compilation.  You can't use a C precompiled header for a C++
18542 compilation.
18544 @item
18545 The precompiled header file must have been produced by the same compiler
18546 binary as the current compilation is using.
18548 @item
18549 Any macros defined before the precompiled header is included must
18550 either be defined in the same way as when the precompiled header was
18551 generated, or must not affect the precompiled header, which usually
18552 means that they don't appear in the precompiled header at all.
18554 The @option{-D} option is one way to define a macro before a
18555 precompiled header is included; using a @code{#define} can also do it.
18556 There are also some options that define macros implicitly, like
18557 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
18558 defined this way.
18560 @item If debugging information is output when using the precompiled
18561 header, using @option{-g} or similar, the same kind of debugging information
18562 must have been output when building the precompiled header.  However,
18563 a precompiled header built using @option{-g} can be used in a compilation
18564 when no debugging information is being output.
18566 @item The same @option{-m} options must generally be used when building
18567 and using the precompiled header.  @xref{Submodel Options},
18568 for any cases where this rule is relaxed.
18570 @item Each of the following options must be the same when building and using
18571 the precompiled header:
18573 @gccoptlist{-fexceptions}
18575 @item
18576 Some other command-line options starting with @option{-f},
18577 @option{-p}, or @option{-O} must be defined in the same way as when
18578 the precompiled header was generated.  At present, it's not clear
18579 which options are safe to change and which are not; the safest choice
18580 is to use exactly the same options when generating and using the
18581 precompiled header.  The following are known to be safe:
18583 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
18584 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
18585 -fsched-verbose=@var{number}  -fschedule-insns  -fvisibility= @gol
18586 -pedantic-errors}
18588 @end itemize
18590 For all of these except the last, the compiler will automatically
18591 ignore the precompiled header if the conditions aren't met.  If you
18592 find an option combination that doesn't work and doesn't cause the
18593 precompiled header to be ignored, please consider filing a bug report,
18594 see @ref{Bugs}.
18596 If you do use differing options when generating and using the
18597 precompiled header, the actual behavior will be a mixture of the
18598 behavior for the options.  For instance, if you use @option{-g} to
18599 generate the precompiled header but not when using it, you may or may
18600 not get debugging information for routines in the precompiled header.