Add -fmem-report-wpa
[official-gcc.git] / gcc / doc / invoke.texi
blob994e4db5fbfb0b1eb199702ad10c7ed56ee2891d
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, 2012
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, 2011,
15 2012
16 Free Software Foundation, Inc.
18 Permission is granted to copy, distribute and/or modify this document
19 under the terms of the GNU Free Documentation License, Version 1.3 or
20 any later version published by the Free Software Foundation; with the
21 Invariant Sections being ``GNU General Public License'' and ``Funding
22 Free Software'', the Front-Cover texts being (a) (see below), and with
23 the Back-Cover Texts being (b) (see below).  A copy of the license is
24 included in the gfdl(7) man page.
26 (a) The FSF's Front-Cover Text is:
28      A GNU Manual
30 (b) The FSF's Back-Cover Text is:
32      You have freedom to copy and modify this GNU Manual, like GNU
33      software.  Copies published by the Free Software Foundation raise
34      funds for GNU development.
35 @c man end
36 @c Set file name and title for the man page.
37 @setfilename gcc
38 @settitle GNU project C and C++ compiler
39 @c man begin SYNOPSIS
40 gcc [@option{-c}|@option{-S}|@option{-E}] [@option{-std=}@var{standard}]
41     [@option{-g}] [@option{-pg}] [@option{-O}@var{level}]
42     [@option{-W}@var{warn}@dots{}] [@option{-Wpedantic}]
43     [@option{-I}@var{dir}@dots{}] [@option{-L}@var{dir}@dots{}]
44     [@option{-D}@var{macro}[=@var{defn}]@dots{}] [@option{-U}@var{macro}]
45     [@option{-f}@var{option}@dots{}] [@option{-m}@var{machine-option}@dots{}]
46     [@option{-o} @var{outfile}] [@@@var{file}] @var{infile}@dots{}
48 Only the most useful options are listed here; see below for the
49 remainder.  @samp{g++} accepts mostly the same options as @samp{gcc}.
50 @c man end
51 @c man begin SEEALSO
52 gpl(7), gfdl(7), fsf-funding(7),
53 cpp(1), gcov(1), as(1), ld(1), gdb(1), adb(1), dbx(1), sdb(1)
54 and the Info entries for @file{gcc}, @file{cpp}, @file{as},
55 @file{ld}, @file{binutils} and @file{gdb}.
56 @c man end
57 @c man begin BUGS
58 For instructions on reporting bugs, see
59 @w{@value{BUGURL}}.
60 @c man end
61 @c man begin AUTHOR
62 See the Info entry for @command{gcc}, or
63 @w{@uref{http://gcc.gnu.org/onlinedocs/gcc/Contributors.html}},
64 for contributors to GCC@.
65 @c man end
66 @end ignore
68 @node Invoking GCC
69 @chapter GCC Command Options
70 @cindex GCC command options
71 @cindex command options
72 @cindex options, GCC command
74 @c man begin DESCRIPTION
75 When you invoke GCC, it normally does preprocessing, compilation,
76 assembly and linking.  The ``overall options'' allow you to stop this
77 process at an intermediate stage.  For example, the @option{-c} option
78 says not to run the linker.  Then the output consists of object files
79 output by the assembler.
81 Other options are passed on to one stage of processing.  Some options
82 control the preprocessor and others the compiler itself.  Yet other
83 options control the assembler and linker; most of these are not
84 documented here, since you rarely need to use any of them.
86 @cindex C compilation options
87 Most of the command-line options that you can use with GCC are useful
88 for C programs; when an option is only useful with another language
89 (usually C++), the explanation says so explicitly.  If the description
90 for a particular option does not mention a source language, you can use
91 that option with all supported languages.
93 @cindex C++ compilation options
94 @xref{Invoking G++,,Compiling C++ Programs}, for a summary of special
95 options for compiling C++ programs.
97 @cindex grouping options
98 @cindex options, grouping
99 The @command{gcc} program accepts options and file names as operands.  Many
100 options have multi-letter names; therefore multiple single-letter options
101 may @emph{not} be grouped: @option{-dv} is very different from @w{@samp{-d
102 -v}}.
104 @cindex order of options
105 @cindex options, order
106 You can mix options and other arguments.  For the most part, the order
107 you use doesn't matter.  Order does matter when you use several
108 options of the same kind; for example, if you specify @option{-L} more
109 than once, the directories are searched in the order specified.  Also,
110 the placement of the @option{-l} option is significant.
112 Many options have long names starting with @samp{-f} or with
113 @samp{-W}---for example,
114 @option{-fmove-loop-invariants}, @option{-Wformat} and so on.  Most of
115 these have both positive and negative forms; the negative form of
116 @option{-ffoo} is @option{-fno-foo}.  This manual documents
117 only one of these two forms, whichever one is not the default.
119 @c man end
121 @xref{Option Index}, for an index to GCC's options.
123 @menu
124 * Option Summary::      Brief list of all options, without explanations.
125 * Overall Options::     Controlling the kind of output:
126                         an executable, object files, assembler files,
127                         or preprocessed source.
128 * Invoking G++::        Compiling C++ programs.
129 * C Dialect Options::   Controlling the variant of C language compiled.
130 * C++ Dialect Options:: Variations on C++.
131 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
132                         and Objective-C++.
133 * Language Independent Options:: Controlling how diagnostics should be
134                         formatted.
135 * Warning Options::     How picky should the compiler be?
136 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
137 * Optimize Options::    How much optimization?
138 * Preprocessor Options:: Controlling header files and macro definitions.
139                          Also, getting dependency information for Make.
140 * Assembler Options::   Passing options to the assembler.
141 * Link Options::        Specifying libraries and so on.
142 * Directory Options::   Where to find header files and libraries.
143                         Where to find the compiler executable files.
144 * Spec Files::          How to pass switches to sub-processes.
145 * Target Options::      Running a cross-compiler, or an old version of GCC.
146 * Submodel Options::    Specifying minor hardware or convention variations,
147                         such as 68010 vs 68020.
148 * Code Gen Options::    Specifying conventions for function calls, data layout
149                         and register usage.
150 * Environment Variables:: Env vars that affect GCC.
151 * Precompiled Headers:: Compiling a header once, and using it many times.
152 @end menu
154 @c man begin OPTIONS
156 @node Option Summary
157 @section Option Summary
159 Here is a summary of all the options, grouped by type.  Explanations are
160 in the following sections.
162 @table @emph
163 @item Overall Options
164 @xref{Overall Options,,Options Controlling the Kind of Output}.
165 @gccoptlist{-c  -S  -E  -o @var{file}  -no-canonical-prefixes  @gol
166 -pipe  -pass-exit-codes  @gol
167 -x @var{language}  -v  -###  --help@r{[}=@var{class}@r{[},@dots{}@r{]]}  --target-help  @gol
168 --version -wrapper @@@var{file} -fplugin=@var{file} -fplugin-arg-@var{name}=@var{arg}  @gol
169 -fdump-ada-spec@r{[}-slim@r{]} -fdump-go-spec=@var{file}}
171 @item C Language Options
172 @xref{C Dialect Options,,Options Controlling C Dialect}.
173 @gccoptlist{-ansi  -std=@var{standard}  -fgnu89-inline @gol
174 -aux-info @var{filename} -fallow-parameterless-variadic-functions @gol
175 -fno-asm  -fno-builtin  -fno-builtin-@var{function} @gol
176 -fhosted  -ffreestanding -fopenmp -fms-extensions -fplan9-extensions @gol
177 -trigraphs  -traditional  -traditional-cpp @gol
178 -fallow-single-precision  -fcond-mismatch -flax-vector-conversions @gol
179 -fsigned-bitfields  -fsigned-char @gol
180 -funsigned-bitfields  -funsigned-char}
182 @item C++ Language Options
183 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}.
184 @gccoptlist{-fabi-version=@var{n}  -fno-access-control  -fcheck-new @gol
185 -fconstexpr-depth=@var{n}  -ffriend-injection @gol
186 -fno-elide-constructors @gol
187 -fno-enforce-eh-specs @gol
188 -ffor-scope  -fno-for-scope  -fno-gnu-keywords @gol
189 -fno-implicit-templates @gol
190 -fno-implicit-inline-templates @gol
191 -fno-implement-inlines  -fms-extensions @gol
192 -fno-nonansi-builtins  -fnothrow-opt  -fno-operator-names @gol
193 -fno-optional-diags  -fpermissive @gol
194 -fno-pretty-templates @gol
195 -frepo  -fno-rtti  -fstats  -ftemplate-backtrace-limit=@var{n} @gol
196 -ftemplate-depth=@var{n} @gol
197 -fno-threadsafe-statics -fuse-cxa-atexit  -fno-weak  -nostdinc++ @gol
198 -fno-default-inline  -fvisibility-inlines-hidden @gol
199 -fvisibility-ms-compat @gol
200 -Wabi  -Wconversion-null  -Wctor-dtor-privacy @gol
201 -Wdelete-non-virtual-dtor -Wliteral-suffix -Wnarrowing @gol
202 -Wnoexcept -Wnon-virtual-dtor  -Wreorder @gol
203 -Weffc++  -Wstrict-null-sentinel @gol
204 -Wno-non-template-friend  -Wold-style-cast @gol
205 -Woverloaded-virtual  -Wno-pmf-conversions @gol
206 -Wsign-promo}
208 @item Objective-C and Objective-C++ Language Options
209 @xref{Objective-C and Objective-C++ Dialect Options,,Options Controlling
210 Objective-C and Objective-C++ Dialects}.
211 @gccoptlist{-fconstant-string-class=@var{class-name} @gol
212 -fgnu-runtime  -fnext-runtime @gol
213 -fno-nil-receivers @gol
214 -fobjc-abi-version=@var{n} @gol
215 -fobjc-call-cxx-cdtors @gol
216 -fobjc-direct-dispatch @gol
217 -fobjc-exceptions @gol
218 -fobjc-gc @gol
219 -fobjc-nilcheck @gol
220 -fobjc-std=objc1 @gol
221 -freplace-objc-classes @gol
222 -fzero-link @gol
223 -gen-decls @gol
224 -Wassign-intercept @gol
225 -Wno-protocol  -Wselector @gol
226 -Wstrict-selector-match @gol
227 -Wundeclared-selector}
229 @item Language Independent Options
230 @xref{Language Independent Options,,Options to Control Diagnostic Messages Formatting}.
231 @gccoptlist{-fmessage-length=@var{n}  @gol
232 -fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]}  @gol
233 -fno-diagnostics-show-option -fno-diagnostics-show-caret}
235 @item Warning Options
236 @xref{Warning Options,,Options to Request or Suppress Warnings}.
237 @gccoptlist{-fsyntax-only  -fmax-errors=@var{n}  -Wpedantic @gol
238 -pedantic-errors @gol
239 -w  -Wextra  -Wall  -Waddress  -Waggregate-return  -Warray-bounds @gol
240 -Wno-attributes -Wno-builtin-macro-redefined @gol
241 -Wc++-compat -Wc++11-compat -Wcast-align  -Wcast-qual  @gol
242 -Wchar-subscripts -Wclobbered  -Wcomment @gol
243 -Wconversion  -Wcoverage-mismatch  -Wno-cpp  -Wno-deprecated  @gol
244 -Wno-deprecated-declarations -Wdisabled-optimization  @gol
245 -Wno-div-by-zero -Wdouble-promotion -Wempty-body  -Wenum-compare @gol
246 -Wno-endif-labels -Werror  -Werror=* @gol
247 -Wfatal-errors  -Wfloat-equal  -Wformat  -Wformat=2 @gol
248 -Wno-format-contains-nul -Wno-format-extra-args -Wformat-nonliteral @gol
249 -Wformat-security  -Wformat-y2k @gol
250 -Wframe-larger-than=@var{len} -Wno-free-nonheap-object -Wjump-misses-init @gol
251 -Wignored-qualifiers @gol
252 -Wimplicit  -Wimplicit-function-declaration  -Wimplicit-int @gol
253 -Winit-self  -Winline -Wmaybe-uninitialized @gol
254 -Wno-int-to-pointer-cast -Wno-invalid-offsetof @gol
255 -Winvalid-pch -Wlarger-than=@var{len}  -Wunsafe-loop-optimizations @gol
256 -Wlogical-op -Wlong-long @gol
257 -Wmain -Wmaybe-uninitialized -Wmissing-braces  -Wmissing-field-initializers @gol
258 -Wmissing-include-dirs @gol
259 -Wno-mudflap @gol
260 -Wno-multichar  -Wnonnull  -Wno-overflow @gol
261 -Woverlength-strings  -Wpacked  -Wpacked-bitfield-compat  -Wpadded @gol
262 -Wparentheses  -Wpedantic-ms-format -Wno-pedantic-ms-format @gol
263 -Wpointer-arith  -Wno-pointer-to-int-cast @gol
264 -Wredundant-decls @gol
265 -Wreturn-type  -Wsequence-point  -Wshadow @gol
266 -Wsign-compare  -Wsign-conversion  -Wsizeof-pointer-memaccess @gol
267 -Wstack-protector -Wstack-usage=@var{len} -Wstrict-aliasing @gol
268 -Wstrict-aliasing=n @gol -Wstrict-overflow -Wstrict-overflow=@var{n} @gol
269 -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{]} @gol
270 -Wmissing-format-attribute @gol
271 -Wswitch  -Wswitch-default  -Wswitch-enum -Wsync-nand @gol
272 -Wsystem-headers  -Wtrampolines  -Wtrigraphs  -Wtype-limits  -Wundef @gol
273 -Wuninitialized  -Wunknown-pragmas  -Wno-pragmas @gol
274 -Wunsuffixed-float-constants  -Wunused  -Wunused-function @gol
275 -Wunused-label  -Wunused-local-typedefs -Wunused-parameter @gol
276 -Wno-unused-result -Wunused-value @gol -Wunused-variable @gol
277 -Wunused-but-set-parameter -Wunused-but-set-variable @gol
278 -Wuseless-cast -Wvariadic-macros -Wvector-operation-performance @gol
279 -Wvla -Wvolatile-register-var  -Wwrite-strings -Wzero-as-null-pointer-constant}
281 @item C and Objective-C-only Warning Options
282 @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
283 -Wmissing-parameter-type  -Wmissing-prototypes  -Wnested-externs @gol
284 -Wold-style-declaration  -Wold-style-definition @gol
285 -Wstrict-prototypes  -Wtraditional  -Wtraditional-conversion @gol
286 -Wdeclaration-after-statement -Wpointer-sign}
288 @item Debugging Options
289 @xref{Debugging Options,,Options for Debugging Your Program or GCC}.
290 @gccoptlist{-d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
291 -fdbg-cnt-list -fdbg-cnt=@var{counter-value-list} @gol
292 -fdisable-ipa-@var{pass_name} @gol
293 -fdisable-rtl-@var{pass_name} @gol
294 -fdisable-rtl-@var{pass-name}=@var{range-list} @gol
295 -fdisable-tree-@var{pass_name} @gol
296 -fdisable-tree-@var{pass-name}=@var{range-list} @gol
297 -fdump-noaddr -fdump-unnumbered -fdump-unnumbered-links @gol
298 -fdump-translation-unit@r{[}-@var{n}@r{]} @gol
299 -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
300 -fdump-ipa-all -fdump-ipa-cgraph -fdump-ipa-inline @gol
301 -fdump-passes @gol
302 -fdump-statistics @gol
303 -fdump-tree-all @gol
304 -fdump-tree-original@r{[}-@var{n}@r{]}  @gol
305 -fdump-tree-optimized@r{[}-@var{n}@r{]} @gol
306 -fdump-tree-cfg -fdump-tree-vcg -fdump-tree-alias @gol
307 -fdump-tree-ch @gol
308 -fdump-tree-ssa@r{[}-@var{n}@r{]} -fdump-tree-pre@r{[}-@var{n}@r{]} @gol
309 -fdump-tree-ccp@r{[}-@var{n}@r{]} -fdump-tree-dce@r{[}-@var{n}@r{]} @gol
310 -fdump-tree-gimple@r{[}-raw@r{]} -fdump-tree-mudflap@r{[}-@var{n}@r{]} @gol
311 -fdump-tree-dom@r{[}-@var{n}@r{]} @gol
312 -fdump-tree-dse@r{[}-@var{n}@r{]} @gol
313 -fdump-tree-phiprop@r{[}-@var{n}@r{]} @gol
314 -fdump-tree-phiopt@r{[}-@var{n}@r{]} @gol
315 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
316 -fdump-tree-copyrename@r{[}-@var{n}@r{]} @gol
317 -fdump-tree-nrv -fdump-tree-vect @gol
318 -fdump-tree-sink @gol
319 -fdump-tree-sra@r{[}-@var{n}@r{]} @gol
320 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
321 -fdump-tree-fre@r{[}-@var{n}@r{]} @gol
322 -fdump-tree-vrp@r{[}-@var{n}@r{]} @gol
323 -ftree-vectorizer-verbose=@var{n} @gol
324 -fdump-tree-storeccp@r{[}-@var{n}@r{]} @gol
325 -fdump-final-insns=@var{file} @gol
326 -fcompare-debug@r{[}=@var{opts}@r{]}  -fcompare-debug-second @gol
327 -feliminate-dwarf2-dups -feliminate-unused-debug-types @gol
328 -feliminate-unused-debug-symbols -femit-class-debug-always @gol
329 -fenable-@var{kind}-@var{pass} @gol
330 -fenable-@var{kind}-@var{pass}=@var{range-list} @gol
331 -fdebug-types-section -fmem-report-wpa @gol
332 -fmem-report -fpre-ipa-mem-report -fpost-ipa-mem-report -fprofile-arcs @gol
333 -frandom-seed=@var{string} -fsched-verbose=@var{n} @gol
334 -fsel-sched-verbose -fsel-sched-dump-cfg -fsel-sched-pipelining-verbose @gol
335 -fstack-usage  -ftest-coverage  -ftime-report -fvar-tracking @gol
336 -fvar-tracking-assignments  -fvar-tracking-assignments-toggle @gol
337 -g  -g@var{level}  -gtoggle  -gcoff  -gdwarf-@var{version} @gol
338 -ggdb  -grecord-gcc-switches  -gno-record-gcc-switches @gol
339 -gstabs  -gstabs+  -gstrict-dwarf  -gno-strict-dwarf @gol
340 -gvms  -gxcoff  -gxcoff+ @gol
341 -fno-merge-debug-strings -fno-dwarf2-cfi-asm @gol
342 -fdebug-prefix-map=@var{old}=@var{new} @gol
343 -femit-struct-debug-baseonly -femit-struct-debug-reduced @gol
344 -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol
345 -p  -pg  -print-file-name=@var{library}  -print-libgcc-file-name @gol
346 -print-multi-directory  -print-multi-lib  -print-multi-os-directory @gol
347 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
348 -print-sysroot -print-sysroot-headers-suffix @gol
349 -save-temps -save-temps=cwd -save-temps=obj -time@r{[}=@var{file}@r{]}}
351 @item Optimization Options
352 @xref{Optimize Options,,Options that Control Optimization}.
353 @gccoptlist{-falign-functions[=@var{n}] -falign-jumps[=@var{n}] @gol
354 -falign-labels[=@var{n}] -falign-loops[=@var{n}] -fassociative-math @gol
355 -fauto-inc-dec -fbranch-probabilities -fbranch-target-load-optimize @gol
356 -fbranch-target-load-optimize2 -fbtr-bb-exclusive -fcaller-saves @gol
357 -fcheck-data-deps -fcombine-stack-adjustments -fconserve-stack @gol
358 -fcompare-elim -fcprop-registers -fcrossjumping @gol
359 -fcse-follow-jumps -fcse-skip-blocks -fcx-fortran-rules @gol
360 -fcx-limited-range @gol
361 -fdata-sections -fdce -fdelayed-branch @gol
362 -fdelete-null-pointer-checks -fdevirtualize -fdse @gol
363 -fearly-inlining -fipa-sra -fexpensive-optimizations -ffat-lto-objects @gol
364 -ffast-math -ffinite-math-only -ffloat-store -fexcess-precision=@var{style} @gol
365 -fforward-propagate -ffp-contract=@var{style} -ffunction-sections @gol
366 -fgcse -fgcse-after-reload -fgcse-las -fgcse-lm -fgraphite-identity @gol
367 -fgcse-sm -fhoist-adjacent-loads -fif-conversion @gol
368 -fif-conversion2 -findirect-inlining @gol
369 -finline-functions -finline-functions-called-once -finline-limit=@var{n} @gol
370 -finline-small-functions -fipa-cp -fipa-cp-clone @gol
371 -fipa-pta -fipa-profile -fipa-pure-const -fipa-reference @gol
372 -fira-algorithm=@var{algorithm} @gol
373 -fira-region=@var{region} @gol
374 -fira-loop-pressure -fno-ira-share-save-slots @gol
375 -fno-ira-share-spill-slots -fira-verbose=@var{n} @gol
376 -fivopts -fkeep-inline-functions -fkeep-static-consts @gol
377 -floop-block -floop-interchange -floop-strip-mine -floop-nest-optimize @gol
378 -floop-parallelize-all -flto -flto-compression-level @gol
379 -flto-partition=@var{alg} -flto-report -fmerge-all-constants @gol
380 -fmerge-constants -fmodulo-sched -fmodulo-sched-allow-regmoves @gol
381 -fmove-loop-invariants fmudflap -fmudflapir -fmudflapth -fno-branch-count-reg @gol
382 -fno-default-inline @gol
383 -fno-defer-pop -fno-function-cse -fno-guess-branch-probability @gol
384 -fno-inline -fno-math-errno -fno-peephole -fno-peephole2 @gol
385 -fno-sched-interblock -fno-sched-spec -fno-signed-zeros @gol
386 -fno-toplevel-reorder -fno-trapping-math -fno-zero-initialized-in-bss @gol
387 -fomit-frame-pointer -foptimize-register-move -foptimize-sibling-calls @gol
388 -fpartial-inlining -fpeel-loops -fpredictive-commoning @gol
389 -fprefetch-loop-arrays @gol
390 -fprofile-correction -fprofile-dir=@var{path} -fprofile-generate @gol
391 -fprofile-generate=@var{path} @gol
392 -fprofile-use -fprofile-use=@var{path} -fprofile-values @gol
393 -freciprocal-math -free -fregmove -frename-registers -freorder-blocks @gol
394 -freorder-blocks-and-partition -freorder-functions @gol
395 -frerun-cse-after-loop -freschedule-modulo-scheduled-loops @gol
396 -frounding-math -fsched2-use-superblocks -fsched-pressure @gol
397 -fsched-spec-load -fsched-spec-load-dangerous @gol
398 -fsched-stalled-insns-dep[=@var{n}] -fsched-stalled-insns[=@var{n}] @gol
399 -fsched-group-heuristic -fsched-critical-path-heuristic @gol
400 -fsched-spec-insn-heuristic -fsched-rank-heuristic @gol
401 -fsched-last-insn-heuristic -fsched-dep-count-heuristic @gol
402 -fschedule-insns -fschedule-insns2 -fsection-anchors @gol
403 -fselective-scheduling -fselective-scheduling2 @gol
404 -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops @gol
405 -fshrink-wrap -fsignaling-nans -fsingle-precision-constant @gol
406 -fsplit-ivs-in-unroller -fsplit-wide-types -fstack-protector @gol
407 -fstack-protector-all -fstrict-aliasing -fstrict-overflow @gol
408 -fthread-jumps -ftracer -ftree-bit-ccp @gol
409 -ftree-builtin-call-dce -ftree-ccp -ftree-ch @gol
410 -ftree-coalesce-inline-vars -ftree-coalesce-vars -ftree-copy-prop @gol
411 -ftree-copyrename -ftree-dce -ftree-dominator-opts -ftree-dse @gol
412 -ftree-forwprop -ftree-fre -ftree-loop-if-convert @gol
413 -ftree-loop-if-convert-stores -ftree-loop-im @gol
414 -ftree-phiprop -ftree-loop-distribution -ftree-loop-distribute-patterns @gol
415 -ftree-loop-ivcanon -ftree-loop-linear -ftree-loop-optimize @gol
416 -ftree-parallelize-loops=@var{n} -ftree-pre -ftree-partial-pre -ftree-pta @gol
417 -ftree-reassoc -ftree-sink -ftree-slsr -ftree-sra @gol
418 -ftree-switch-conversion -ftree-tail-merge @gol
419 -ftree-ter -ftree-vect-loop-version -ftree-vectorize -ftree-vrp @gol
420 -funit-at-a-time -funroll-all-loops -funroll-loops @gol
421 -funsafe-loop-optimizations -funsafe-math-optimizations -funswitch-loops @gol
422 -fvariable-expansion-in-unroller -fvect-cost-model -fvpt -fweb @gol
423 -fwhole-program -fwpa -fuse-linker-plugin @gol
424 --param @var{name}=@var{value}
425 -O  -O0  -O1  -O2  -O3  -Os -Ofast}
427 @item Preprocessor Options
428 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
429 @gccoptlist{-A@var{question}=@var{answer} @gol
430 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
431 -C  -dD  -dI  -dM  -dN @gol
432 -D@var{macro}@r{[}=@var{defn}@r{]}  -E  -H @gol
433 -idirafter @var{dir} @gol
434 -include @var{file}  -imacros @var{file} @gol
435 -iprefix @var{file}  -iwithprefix @var{dir} @gol
436 -iwithprefixbefore @var{dir}  -isystem @var{dir} @gol
437 -imultilib @var{dir} -isysroot @var{dir} @gol
438 -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  @gol
439 -P  -fdebug-cpp -ftrack-macro-expansion -fworking-directory @gol
440 -remap -trigraphs  -undef  -U@var{macro}  @gol
441 -Wp,@var{option} -Xpreprocessor @var{option} -no-integrated-cpp}
443 @item Assembler Option
444 @xref{Assembler Options,,Passing Options to the Assembler}.
445 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
447 @item Linker Options
448 @xref{Link Options,,Options for Linking}.
449 @gccoptlist{@var{object-file-name}  -l@var{library} @gol
450 -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic @gol
451 -s  -static  -static-libgcc  -static-libstdc++ -shared  @gol
452 -shared-libgcc  -symbolic @gol
453 -T @var{script}  -Wl,@var{option}  -Xlinker @var{option} @gol
454 -u @var{symbol}}
456 @item Directory Options
457 @xref{Directory Options,,Options for Directory Search}.
458 @gccoptlist{-B@var{prefix} -I@var{dir} -iplugindir=@var{dir} @gol
459 -iquote@var{dir} -L@var{dir} -specs=@var{file} -I- @gol
460 --sysroot=@var{dir} --no-sysroot-suffix}
462 @item Machine Dependent Options
463 @xref{Submodel Options,,Hardware Models and Configurations}.
464 @c This list is ordered alphanumerically by subsection name.
465 @c Try and put the significant identifier (CPU or system) first,
466 @c so users have a clue at guessing where the ones they want will be.
468 @emph{Adapteva Epiphany Options}
469 @gccoptlist{-mhalf-reg-file -mprefer-short-insn-regs @gol
470 -mbranch-cost=@var{num} -mcmove -mnops=@var{num} -msoft-cmpsf @gol
471 -msplit-lohi -mpost-inc -mpost-modify -mstack-offset=@var{num} @gol
472 -mround-nearest -mlong-calls -mshort-calls -msmall16 @gol
473 -mfp-mode=@var{mode} -mvect-double -max-vect-align=@var{num} @gol
474 -msplit-vecmove-early -m1reg-@var{reg}}
476 @emph{ARM Options}
477 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
478 -mabi=@var{name} @gol
479 -mapcs-stack-check  -mno-apcs-stack-check @gol
480 -mapcs-float  -mno-apcs-float @gol
481 -mapcs-reentrant  -mno-apcs-reentrant @gol
482 -msched-prolog  -mno-sched-prolog @gol
483 -mlittle-endian  -mbig-endian  -mwords-little-endian @gol
484 -mfloat-abi=@var{name} @gol
485 -mfp16-format=@var{name}
486 -mthumb-interwork  -mno-thumb-interwork @gol
487 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
488 -mstructure-size-boundary=@var{n} @gol
489 -mabort-on-noreturn @gol
490 -mlong-calls  -mno-long-calls @gol
491 -msingle-pic-base  -mno-single-pic-base @gol
492 -mpic-register=@var{reg} @gol
493 -mnop-fun-dllimport @gol
494 -mcirrus-fix-invalid-insns -mno-cirrus-fix-invalid-insns @gol
495 -mpoke-function-name @gol
496 -mthumb  -marm @gol
497 -mtpcs-frame  -mtpcs-leaf-frame @gol
498 -mcaller-super-interworking  -mcallee-super-interworking @gol
499 -mtp=@var{name} -mtls-dialect=@var{dialect} @gol
500 -mword-relocations @gol
501 -mfix-cortex-m3-ldrd @gol
502 -munaligned-access}
504 @emph{AVR Options}
505 @gccoptlist{-mmcu=@var{mcu} -maccumulate-args -mbranch-cost=@var{cost} @gol
506 -mcall-prologues -mint8 -mno-interrupts -mrelax -mshort-calls @gol
507 -mstrict-X -mtiny-stack}
509 @emph{Blackfin Options}
510 @gccoptlist{-mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]} @gol
511 -msim -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
512 -mspecld-anomaly  -mno-specld-anomaly  -mcsync-anomaly  -mno-csync-anomaly @gol
513 -mlow-64k -mno-low64k  -mstack-check-l1  -mid-shared-library @gol
514 -mno-id-shared-library  -mshared-library-id=@var{n} @gol
515 -mleaf-id-shared-library  -mno-leaf-id-shared-library @gol
516 -msep-data  -mno-sep-data  -mlong-calls  -mno-long-calls @gol
517 -mfast-fp -minline-plt -mmulticore  -mcorea  -mcoreb  -msdram @gol
518 -micplb}
520 @emph{C6X Options}
521 @gccoptlist{-mbig-endian  -mlittle-endian -march=@var{cpu} @gol
522 -msim -msdata=@var{sdata-type}}
524 @emph{CRIS Options}
525 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
526 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
527 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
528 -mstack-align  -mdata-align  -mconst-align @gol
529 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
530 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
531 -mmul-bug-workaround  -mno-mul-bug-workaround}
533 @emph{CR16 Options}
534 @gccoptlist{-mmac @gol
535 -mcr16cplus -mcr16c @gol
536 -msim -mint32 -mbit-ops
537 -mdata-model=@var{model}}
539 @emph{Darwin Options}
540 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
541 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
542 -client_name  -compatibility_version  -current_version @gol
543 -dead_strip @gol
544 -dependency-file  -dylib_file  -dylinker_install_name @gol
545 -dynamic  -dynamiclib  -exported_symbols_list @gol
546 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
547 -force_flat_namespace  -headerpad_max_install_names @gol
548 -iframework @gol
549 -image_base  -init  -install_name  -keep_private_externs @gol
550 -multi_module  -multiply_defined  -multiply_defined_unused @gol
551 -noall_load   -no_dead_strip_inits_and_terms @gol
552 -nofixprebinding -nomultidefs  -noprebind  -noseglinkedit @gol
553 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
554 -private_bundle  -read_only_relocs  -sectalign @gol
555 -sectobjectsymbols  -whyload  -seg1addr @gol
556 -sectcreate  -sectobjectsymbols  -sectorder @gol
557 -segaddr -segs_read_only_addr -segs_read_write_addr @gol
558 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
559 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
560 -single_module  -static  -sub_library  -sub_umbrella @gol
561 -twolevel_namespace  -umbrella  -undefined @gol
562 -unexported_symbols_list  -weak_reference_mismatches @gol
563 -whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} @gol
564 -mkernel -mone-byte-bool}
566 @emph{DEC Alpha Options}
567 @gccoptlist{-mno-fp-regs  -msoft-float @gol
568 -mieee  -mieee-with-inexact  -mieee-conformant @gol
569 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
570 -mtrap-precision=@var{mode}  -mbuild-constants @gol
571 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
572 -mbwx  -mmax  -mfix  -mcix @gol
573 -mfloat-vax  -mfloat-ieee @gol
574 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
575 -msmall-text  -mlarge-text @gol
576 -mmemory-latency=@var{time}}
578 @emph{FR30 Options}
579 @gccoptlist{-msmall-model -mno-lsim}
581 @emph{FRV Options}
582 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
583 -mhard-float  -msoft-float @gol
584 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
585 -mdouble  -mno-double @gol
586 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
587 -mfdpic  -minline-plt -mgprel-ro  -multilib-library-pic @gol
588 -mlinked-fp  -mlong-calls  -malign-labels @gol
589 -mlibrary-pic  -macc-4  -macc-8 @gol
590 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
591 -moptimize-membar -mno-optimize-membar @gol
592 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
593 -mvliw-branch  -mno-vliw-branch @gol
594 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
595 -mno-nested-cond-exec  -mtomcat-stats @gol
596 -mTLS -mtls @gol
597 -mcpu=@var{cpu}}
599 @emph{GNU/Linux Options}
600 @gccoptlist{-mglibc -muclibc -mbionic -mandroid @gol
601 -tno-android-cc -tno-android-ld}
603 @emph{H8/300 Options}
604 @gccoptlist{-mrelax  -mh  -ms  -mn  -mexr -mno-exr  -mint32  -malign-300}
606 @emph{HPPA Options}
607 @gccoptlist{-march=@var{architecture-type} @gol
608 -mbig-switch  -mdisable-fpregs  -mdisable-indexing @gol
609 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
610 -mfixed-range=@var{register-range} @gol
611 -mjump-in-delay -mlinker-opt -mlong-calls @gol
612 -mlong-load-store  -mno-big-switch  -mno-disable-fpregs @gol
613 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
614 -mno-jump-in-delay  -mno-long-load-store @gol
615 -mno-portable-runtime  -mno-soft-float @gol
616 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
617 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
618 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
619 -munix=@var{unix-std}  -nolibdld  -static  -threads}
621 @emph{i386 and x86-64 Options}
622 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
623 -mfpmath=@var{unit} @gol
624 -masm=@var{dialect}  -mno-fancy-math-387 @gol
625 -mno-fp-ret-in-387  -msoft-float @gol
626 -mno-wide-multiply  -mrtd  -malign-double @gol
627 -mpreferred-stack-boundary=@var{num} @gol
628 -mincoming-stack-boundary=@var{num} @gol
629 -mcld -mcx16 -msahf -mmovbe -mcrc32 @gol
630 -mrecip -mrecip=@var{opt} @gol
631 -mvzeroupper @gol
632 -mmmx  -msse  -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -msse4 -mavx @gol
633 -mavx2 -maes -mpclmul -mfsgsbase -mrdrnd -mf16c -mfma @gol
634 -msse4a -m3dnow -mpopcnt -mabm -mbmi -mtbm -mfma4 -mxop -mlzcnt @gol
635 -mbmi2 -mrtm -mlwp -mthreads @gol
636 -mno-align-stringops  -minline-all-stringops @gol
637 -minline-stringops-dynamically -mstringop-strategy=@var{alg} @gol
638 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
639 -m96bit-long-double -mlong-double-64 -mlong-double-80 @gol
640 -mregparm=@var{num}  -msseregparm @gol
641 -mveclibabi=@var{type} -mvect8-ret-in-mem @gol
642 -mpc32 -mpc64 -mpc80 -mstackrealign @gol
643 -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs @gol
644 -mcmodel=@var{code-model} -mabi=@var{name} -maddress-mode=@var{mode} @gol
645 -m32 -m64 -mx32 -mlarge-data-threshold=@var{num} @gol
646 -msse2avx -mfentry -m8bit-idiv @gol
647 -mavx256-split-unaligned-load -mavx256-split-unaligned-store}
649 @emph{i386 and x86-64 Windows Options}
650 @gccoptlist{-mconsole -mcygwin -mno-cygwin -mdll @gol
651 -mnop-fun-dllimport -mthread @gol
652 -municode -mwin32 -mwindows -fno-set-stack-executable}
654 @emph{IA-64 Options}
655 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
656 -mvolatile-asm-stop  -mregister-names  -msdata -mno-sdata @gol
657 -mconstant-gp  -mauto-pic  -mfused-madd @gol
658 -minline-float-divide-min-latency @gol
659 -minline-float-divide-max-throughput @gol
660 -mno-inline-float-divide @gol
661 -minline-int-divide-min-latency @gol
662 -minline-int-divide-max-throughput  @gol
663 -mno-inline-int-divide @gol
664 -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
665 -mno-inline-sqrt @gol
666 -mdwarf2-asm -mearly-stop-bits @gol
667 -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
668 -mtune=@var{cpu-type} -milp32 -mlp64 @gol
669 -msched-br-data-spec -msched-ar-data-spec -msched-control-spec @gol
670 -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec @gol
671 -msched-spec-ldc -msched-spec-control-ldc @gol
672 -msched-prefer-non-data-spec-insns -msched-prefer-non-control-spec-insns @gol
673 -msched-stop-bits-after-every-cycle -msched-count-spec-in-critical-path @gol
674 -msel-sched-dont-check-control-spec -msched-fp-mem-deps-zero-cost @gol
675 -msched-max-memory-insns-hard-limit -msched-max-memory-insns=@var{max-insns}}
677 @emph{LM32 Options}
678 @gccoptlist{-mbarrel-shift-enabled -mdivide-enabled -mmultiply-enabled @gol
679 -msign-extend-enabled -muser-enabled}
681 @emph{M32R/D Options}
682 @gccoptlist{-m32r2 -m32rx -m32r @gol
683 -mdebug @gol
684 -malign-loops -mno-align-loops @gol
685 -missue-rate=@var{number} @gol
686 -mbranch-cost=@var{number} @gol
687 -mmodel=@var{code-size-model-type} @gol
688 -msdata=@var{sdata-type} @gol
689 -mno-flush-func -mflush-func=@var{name} @gol
690 -mno-flush-trap -mflush-trap=@var{number} @gol
691 -G @var{num}}
693 @emph{M32C Options}
694 @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
696 @emph{M680x0 Options}
697 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu}  -mtune=@var{tune}
698 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
699 -m68060  -mcpu32  -m5200  -m5206e  -m528x  -m5307  -m5407 @gol
700 -mcfv4e  -mbitfield  -mno-bitfield  -mc68000  -mc68020 @gol
701 -mnobitfield  -mrtd  -mno-rtd  -mdiv  -mno-div  -mshort @gol
702 -mno-short  -mhard-float  -m68881  -msoft-float  -mpcrel @gol
703 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
704 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library @gol
705 -mxgot -mno-xgot}
707 @emph{MCore Options}
708 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
709 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
710 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
711 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
712 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
714 @emph{MeP Options}
715 @gccoptlist{-mabsdiff -mall-opts -maverage -mbased=@var{n} -mbitops @gol
716 -mc=@var{n} -mclip -mconfig=@var{name} -mcop -mcop32 -mcop64 -mivc2 @gol
717 -mdc -mdiv -meb -mel -mio-volatile -ml -mleadz -mm -mminmax @gol
718 -mmult -mno-opts -mrepeat -ms -msatur -msdram -msim -msimnovec -mtf @gol
719 -mtiny=@var{n}}
721 @emph{MicroBlaze Options}
722 @gccoptlist{-msoft-float -mhard-float -msmall-divides -mcpu=@var{cpu} @gol
723 -mmemcpy -mxl-soft-mul -mxl-soft-div -mxl-barrel-shift @gol
724 -mxl-pattern-compare -mxl-stack-check -mxl-gp-opt -mno-clearbss @gol
725 -mxl-multiply-high -mxl-float-convert -mxl-float-sqrt @gol
726 -mxl-mode-@var{app-model}}
728 @emph{MIPS Options}
729 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
730 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2 @gol
731 -mips64  -mips64r2 @gol
732 -mips16  -mno-mips16  -mflip-mips16 @gol
733 -minterlink-mips16  -mno-interlink-mips16 @gol
734 -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
735 -mshared  -mno-shared  -mplt  -mno-plt  -mxgot  -mno-xgot @gol
736 -mgp32  -mgp64  -mfp32  -mfp64  -mhard-float  -msoft-float @gol
737 -mno-float -msingle-float  -mdouble-float  @gol
738 -mdsp  -mno-dsp  -mdspr2  -mno-dspr2 @gol
739 -mmcu -mmno-mcu @gol
740 -mfpu=@var{fpu-type} @gol
741 -msmartmips  -mno-smartmips @gol
742 -mpaired-single  -mno-paired-single  -mdmx  -mno-mdmx @gol
743 -mips3d  -mno-mips3d  -mmt  -mno-mt  -mllsc  -mno-llsc @gol
744 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
745 -G@var{num}  -mlocal-sdata  -mno-local-sdata @gol
746 -mextern-sdata  -mno-extern-sdata  -mgpopt  -mno-gopt @gol
747 -membedded-data  -mno-embedded-data @gol
748 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
749 -mcode-readable=@var{setting} @gol
750 -msplit-addresses  -mno-split-addresses @gol
751 -mexplicit-relocs  -mno-explicit-relocs @gol
752 -mcheck-zero-division  -mno-check-zero-division @gol
753 -mdivide-traps  -mdivide-breaks @gol
754 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
755 -mmad  -mno-mad  -mfused-madd  -mno-fused-madd  -nocpp @gol
756 -mfix-24k -mno-fix-24k @gol
757 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
758 -mfix-r10000 -mno-fix-r10000  -mfix-vr4120  -mno-fix-vr4120 @gol
759 -mfix-vr4130  -mno-fix-vr4130  -mfix-sb1  -mno-fix-sb1 @gol
760 -mflush-func=@var{func}  -mno-flush-func @gol
761 -mbranch-cost=@var{num}  -mbranch-likely  -mno-branch-likely @gol
762 -mfp-exceptions -mno-fp-exceptions @gol
763 -mvr4130-align -mno-vr4130-align -msynci -mno-synci @gol
764 -mrelax-pic-calls -mno-relax-pic-calls -mmcount-ra-address}
766 @emph{MMIX Options}
767 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
768 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
769 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
770 -mno-base-addresses  -msingle-exit  -mno-single-exit}
772 @emph{MN10300 Options}
773 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
774 -mno-am33 -mam33 -mam33-2 -mam34 @gol
775 -mtune=@var{cpu-type} @gol
776 -mreturn-pointer-on-d0 @gol
777 -mno-crt0  -mrelax -mliw -msetlb}
779 @emph{PDP-11 Options}
780 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
781 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
782 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
783 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
784 -mbranch-expensive  -mbranch-cheap @gol
785 -munix-asm  -mdec-asm}
787 @emph{picoChip Options}
788 @gccoptlist{-mae=@var{ae_type} -mvliw-lookahead=@var{N} @gol
789 -msymbol-as-address -mno-inefficient-warnings}
791 @emph{PowerPC Options}
792 See RS/6000 and PowerPC Options.
794 @emph{RL78 Options}
795 @gccoptlist{-msim -mmul=none -mmul=g13 -mmul=rl78}
797 @emph{RS/6000 and PowerPC Options}
798 @gccoptlist{-mcpu=@var{cpu-type} @gol
799 -mtune=@var{cpu-type} @gol
800 -mcmodel=@var{code-model} @gol
801 -mpowerpc64 @gol
802 -maltivec  -mno-altivec @gol
803 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
804 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
805 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb -mpopcntd -mno-popcntd @gol
806 -mfprnd  -mno-fprnd @gol
807 -mcmpb -mno-cmpb -mmfpgpr -mno-mfpgpr -mhard-dfp -mno-hard-dfp @gol
808 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
809 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
810 -malign-power  -malign-natural @gol
811 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
812 -msingle-float -mdouble-float -msimple-fpu @gol
813 -mstring  -mno-string  -mupdate  -mno-update @gol
814 -mavoid-indexed-addresses  -mno-avoid-indexed-addresses @gol
815 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
816 -mstrict-align  -mno-strict-align  -mrelocatable @gol
817 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
818 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
819 -mdynamic-no-pic  -maltivec -mswdiv  -msingle-pic-base @gol
820 -mprioritize-restricted-insns=@var{priority} @gol
821 -msched-costly-dep=@var{dependence_type} @gol
822 -minsert-sched-nops=@var{scheme} @gol
823 -mcall-sysv  -mcall-netbsd @gol
824 -maix-struct-return  -msvr4-struct-return @gol
825 -mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
826 -mblock-move-inline-limit=@var{num} @gol
827 -misel -mno-isel @gol
828 -misel=yes  -misel=no @gol
829 -mspe -mno-spe @gol
830 -mspe=yes  -mspe=no @gol
831 -mpaired @gol
832 -mgen-cell-microcode -mwarn-cell-microcode @gol
833 -mvrsave -mno-vrsave @gol
834 -mmulhw -mno-mulhw @gol
835 -mdlmzb -mno-dlmzb @gol
836 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
837 -mprototype  -mno-prototype @gol
838 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
839 -msdata=@var{opt}  -mvxworks  -G @var{num}  -pthread @gol
840 -mrecip -mrecip=@var{opt} -mno-recip -mrecip-precision @gol
841 -mno-recip-precision @gol
842 -mveclibabi=@var{type} -mfriz -mno-friz @gol
843 -mpointers-to-nested-functions -mno-pointers-to-nested-functions @gol
844 -msave-toc-indirect -mno-save-toc-indirect}
846 @emph{RX Options}
847 @gccoptlist{-m64bit-doubles  -m32bit-doubles  -fpu  -nofpu@gol
848 -mcpu=@gol
849 -mbig-endian-data -mlittle-endian-data @gol
850 -msmall-data @gol
851 -msim  -mno-sim@gol
852 -mas100-syntax -mno-as100-syntax@gol
853 -mrelax@gol
854 -mmax-constant-size=@gol
855 -mint-register=@gol
856 -mpid@gol
857 -msave-acc-in-interrupts}
859 @emph{S/390 and zSeries Options}
860 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
861 -mhard-float  -msoft-float  -mhard-dfp -mno-hard-dfp @gol
862 -mlong-double-64 -mlong-double-128 @gol
863 -mbackchain  -mno-backchain -mpacked-stack  -mno-packed-stack @gol
864 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
865 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
866 -mtpf-trace -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
867 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size -mstack-guard}
869 @emph{Score Options}
870 @gccoptlist{-meb -mel @gol
871 -mnhwloop @gol
872 -muls @gol
873 -mmac @gol
874 -mscore5 -mscore5u -mscore7 -mscore7d}
876 @emph{SH Options}
877 @gccoptlist{-m1  -m2  -m2e @gol
878 -m2a-nofpu -m2a-single-only -m2a-single -m2a @gol
879 -m3  -m3e @gol
880 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
881 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol
882 -m5-64media  -m5-64media-nofpu @gol
883 -m5-32media  -m5-32media-nofpu @gol
884 -m5-compact  -m5-compact-nofpu @gol
885 -mb  -ml  -mdalign  -mrelax @gol
886 -mbigtable -mfmovd -mhitachi -mrenesas -mno-renesas -mnomacsave @gol
887 -mieee -mno-ieee -mbitops  -misize  -minline-ic_invalidate -mpadstruct @gol
888 -mspace -mprefergot  -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
889 -mdivsi3_libfunc=@var{name} -mfixed-range=@var{register-range} @gol
890 -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol
891 -maccumulate-outgoing-args -minvalid-symbols -msoft-atomic -mhard-atomic @gol
892 -mbranch-cost=@var{num} -mzdcbranch -mno-zdcbranch -mcbranchdi -mcmpeqdi @gol
893 -mfused-madd -mno-fused-madd -mfsca -mno-fsca -mfsrra -mno-fsrra @gol
894 -mpretend-cmove -mtas}
896 @emph{Solaris 2 Options}
897 @gccoptlist{-mimpure-text  -mno-impure-text @gol
898 -pthreads -pthread}
900 @emph{SPARC Options}
901 @gccoptlist{-mcpu=@var{cpu-type} @gol
902 -mtune=@var{cpu-type} @gol
903 -mcmodel=@var{code-model} @gol
904 -mmemory-model=@var{mem-model} @gol
905 -m32  -m64  -mapp-regs  -mno-app-regs @gol
906 -mfaster-structs  -mno-faster-structs  -mflat  -mno-flat @gol
907 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
908 -mhard-quad-float  -msoft-quad-float @gol
909 -mlittle-endian @gol
910 -mstack-bias  -mno-stack-bias @gol
911 -munaligned-doubles  -mno-unaligned-doubles @gol
912 -mv8plus  -mno-v8plus  -mvis  -mno-vis @gol
913 -mvis2  -mno-vis2  -mvis3  -mno-vis3 @gol
914 -mfmaf  -mno-fmaf  -mpopc  -mno-popc @gol
915 -mfix-at697f}
917 @emph{SPU Options}
918 @gccoptlist{-mwarn-reloc -merror-reloc @gol
919 -msafe-dma -munsafe-dma @gol
920 -mbranch-hints @gol
921 -msmall-mem -mlarge-mem -mstdmain @gol
922 -mfixed-range=@var{register-range} @gol
923 -mea32 -mea64 @gol
924 -maddress-space-conversion -mno-address-space-conversion @gol
925 -mcache-size=@var{cache-size} @gol
926 -matomic-updates -mno-atomic-updates}
928 @emph{System V Options}
929 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
931 @emph{TILE-Gx Options}
932 @gccoptlist{-mcpu=CPU -m32 -m64 -mcmodel=@var{code-model}}
934 @emph{TILEPro Options}
935 @gccoptlist{-mcpu=CPU -m32}
937 @emph{V850 Options}
938 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
939 -mprolog-function  -mno-prolog-function  -mspace @gol
940 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
941 -mapp-regs  -mno-app-regs @gol
942 -mdisable-callt  -mno-disable-callt @gol
943 -mv850e2v3 @gol
944 -mv850e2 @gol
945 -mv850e1 -mv850es @gol
946 -mv850e @gol
947 -mv850  -mbig-switch}
949 @emph{VAX Options}
950 @gccoptlist{-mg  -mgnu  -munix}
952 @emph{VMS Options}
953 @gccoptlist{-mvms-return-codes -mdebug-main=@var{prefix} -mmalloc64 @gol
954 -mpointer-size=@var{size}}
956 @emph{VxWorks Options}
957 @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
958 -Xbind-lazy  -Xbind-now}
960 @emph{x86-64 Options}
961 See i386 and x86-64 Options.
963 @emph{Xstormy16 Options}
964 @gccoptlist{-msim}
966 @emph{Xtensa Options}
967 @gccoptlist{-mconst16 -mno-const16 @gol
968 -mfused-madd  -mno-fused-madd @gol
969 -mforce-no-pic @gol
970 -mserialize-volatile  -mno-serialize-volatile @gol
971 -mtext-section-literals  -mno-text-section-literals @gol
972 -mtarget-align  -mno-target-align @gol
973 -mlongcalls  -mno-longcalls}
975 @emph{zSeries Options}
976 See S/390 and zSeries Options.
978 @item Code Generation Options
979 @xref{Code Gen Options,,Options for Code Generation Conventions}.
980 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
981 -ffixed-@var{reg}  -fexceptions @gol
982 -fnon-call-exceptions  -fdelete-dead-exceptions  -funwind-tables @gol
983 -fasynchronous-unwind-tables @gol
984 -finhibit-size-directive  -finstrument-functions @gol
985 -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol
986 -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{} @gol
987 -fno-common  -fno-ident @gol
988 -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE @gol
989 -fno-jump-tables @gol
990 -frecord-gcc-switches @gol
991 -freg-struct-return  -fshort-enums @gol
992 -fshort-double  -fshort-wchar @gol
993 -fverbose-asm  -fpack-struct[=@var{n}]  -fstack-check @gol
994 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
995 -fno-stack-limit -fsplit-stack @gol
996 -fleading-underscore  -ftls-model=@var{model} @gol
997 -fstack-reuse=@var{reuse_level} @gol
998 -ftrapv  -fwrapv  -fbounds-check @gol
999 -fvisibility -fstrict-volatile-bitfields -fsync-libcalls}
1000 @end table
1002 @menu
1003 * Overall Options::     Controlling the kind of output:
1004                         an executable, object files, assembler files,
1005                         or preprocessed source.
1006 * C Dialect Options::   Controlling the variant of C language compiled.
1007 * C++ Dialect Options:: Variations on C++.
1008 * Objective-C and Objective-C++ Dialect Options:: Variations on Objective-C
1009                         and Objective-C++.
1010 * Language Independent Options:: Controlling how diagnostics should be
1011                         formatted.
1012 * Warning Options::     How picky should the compiler be?
1013 * Debugging Options::   Symbol tables, measurements, and debugging dumps.
1014 * Optimize Options::    How much optimization?
1015 * Preprocessor Options:: Controlling header files and macro definitions.
1016                          Also, getting dependency information for Make.
1017 * Assembler Options::   Passing options to the assembler.
1018 * Link Options::        Specifying libraries and so on.
1019 * Directory Options::   Where to find header files and libraries.
1020                         Where to find the compiler executable files.
1021 * Spec Files::          How to pass switches to sub-processes.
1022 * Target Options::      Running a cross-compiler, or an old version of GCC.
1023 @end menu
1025 @node Overall Options
1026 @section Options Controlling the Kind of Output
1028 Compilation can involve up to four stages: preprocessing, compilation
1029 proper, assembly and linking, always in that order.  GCC is capable of
1030 preprocessing and compiling several files either into several
1031 assembler input files, or into one assembler input file; then each
1032 assembler input file produces an object file, and linking combines all
1033 the object files (those newly compiled, and those specified as input)
1034 into an executable file.
1036 @cindex file name suffix
1037 For any given input file, the file name suffix determines what kind of
1038 compilation is done:
1040 @table @gcctabopt
1041 @item @var{file}.c
1042 C source code that must be preprocessed.
1044 @item @var{file}.i
1045 C source code that should not be preprocessed.
1047 @item @var{file}.ii
1048 C++ source code that should not be preprocessed.
1050 @item @var{file}.m
1051 Objective-C source code.  Note that you must link with the @file{libobjc}
1052 library to make an Objective-C program work.
1054 @item @var{file}.mi
1055 Objective-C source code that should not be preprocessed.
1057 @item @var{file}.mm
1058 @itemx @var{file}.M
1059 Objective-C++ source code.  Note that you must link with the @file{libobjc}
1060 library to make an Objective-C++ program work.  Note that @samp{.M} refers
1061 to a literal capital M@.
1063 @item @var{file}.mii
1064 Objective-C++ source code that should not be preprocessed.
1066 @item @var{file}.h
1067 C, C++, Objective-C or Objective-C++ header file to be turned into a
1068 precompiled header (default), or C, C++ header file to be turned into an
1069 Ada spec (via the @option{-fdump-ada-spec} switch).
1071 @item @var{file}.cc
1072 @itemx @var{file}.cp
1073 @itemx @var{file}.cxx
1074 @itemx @var{file}.cpp
1075 @itemx @var{file}.CPP
1076 @itemx @var{file}.c++
1077 @itemx @var{file}.C
1078 C++ source code that must be preprocessed.  Note that in @samp{.cxx},
1079 the last two letters must both be literally @samp{x}.  Likewise,
1080 @samp{.C} refers to a literal capital C@.
1082 @item @var{file}.mm
1083 @itemx @var{file}.M
1084 Objective-C++ source code that must be preprocessed.
1086 @item @var{file}.mii
1087 Objective-C++ source code that should not be preprocessed.
1089 @item @var{file}.hh
1090 @itemx @var{file}.H
1091 @itemx @var{file}.hp
1092 @itemx @var{file}.hxx
1093 @itemx @var{file}.hpp
1094 @itemx @var{file}.HPP
1095 @itemx @var{file}.h++
1096 @itemx @var{file}.tcc
1097 C++ header file to be turned into a precompiled header or Ada spec.
1099 @item @var{file}.f
1100 @itemx @var{file}.for
1101 @itemx @var{file}.ftn
1102 Fixed form Fortran source code that should not be preprocessed.
1104 @item @var{file}.F
1105 @itemx @var{file}.FOR
1106 @itemx @var{file}.fpp
1107 @itemx @var{file}.FPP
1108 @itemx @var{file}.FTN
1109 Fixed form Fortran source code that must be preprocessed (with the traditional
1110 preprocessor).
1112 @item @var{file}.f90
1113 @itemx @var{file}.f95
1114 @itemx @var{file}.f03
1115 @itemx @var{file}.f08
1116 Free form Fortran source code that should not be preprocessed.
1118 @item @var{file}.F90
1119 @itemx @var{file}.F95
1120 @itemx @var{file}.F03
1121 @itemx @var{file}.F08
1122 Free form Fortran source code that must be preprocessed (with the
1123 traditional preprocessor).
1125 @item @var{file}.go
1126 Go source code.
1128 @c FIXME: Descriptions of Java file types.
1129 @c @var{file}.java
1130 @c @var{file}.class
1131 @c @var{file}.zip
1132 @c @var{file}.jar
1134 @item @var{file}.ads
1135 Ada source code file that contains a library unit declaration (a
1136 declaration of a package, subprogram, or generic, or a generic
1137 instantiation), or a library unit renaming declaration (a package,
1138 generic, or subprogram renaming declaration).  Such files are also
1139 called @dfn{specs}.
1141 @item @var{file}.adb
1142 Ada source code file containing a library unit body (a subprogram or
1143 package body).  Such files are also called @dfn{bodies}.
1145 @c GCC also knows about some suffixes for languages not yet included:
1146 @c Pascal:
1147 @c @var{file}.p
1148 @c @var{file}.pas
1149 @c Ratfor:
1150 @c @var{file}.r
1152 @item @var{file}.s
1153 Assembler code.
1155 @item @var{file}.S
1156 @itemx @var{file}.sx
1157 Assembler code that must be preprocessed.
1159 @item @var{other}
1160 An object file to be fed straight into linking.
1161 Any file name with no recognized suffix is treated this way.
1162 @end table
1164 @opindex x
1165 You can specify the input language explicitly with the @option{-x} option:
1167 @table @gcctabopt
1168 @item -x @var{language}
1169 Specify explicitly the @var{language} for the following input files
1170 (rather than letting the compiler choose a default based on the file
1171 name suffix).  This option applies to all following input files until
1172 the next @option{-x} option.  Possible values for @var{language} are:
1173 @smallexample
1174 c  c-header  cpp-output
1175 c++  c++-header  c++-cpp-output
1176 objective-c  objective-c-header  objective-c-cpp-output
1177 objective-c++ objective-c++-header objective-c++-cpp-output
1178 assembler  assembler-with-cpp
1180 f77  f77-cpp-input f95  f95-cpp-input
1182 java
1183 @end smallexample
1185 @item -x none
1186 Turn off any specification of a language, so that subsequent files are
1187 handled according to their file name suffixes (as they are if @option{-x}
1188 has not been used at all).
1190 @item -pass-exit-codes
1191 @opindex pass-exit-codes
1192 Normally the @command{gcc} program exits with the code of 1 if any
1193 phase of the compiler returns a non-success return code.  If you specify
1194 @option{-pass-exit-codes}, the @command{gcc} program instead returns with
1195 the numerically highest error produced by any phase returning an error
1196 indication.  The C, C++, and Fortran front ends return 4 if an internal
1197 compiler error is encountered.
1198 @end table
1200 If you only want some of the stages of compilation, you can use
1201 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
1202 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
1203 @command{gcc} is to stop.  Note that some combinations (for example,
1204 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
1206 @table @gcctabopt
1207 @item -c
1208 @opindex c
1209 Compile or assemble the source files, but do not link.  The linking
1210 stage simply is not done.  The ultimate output is in the form of an
1211 object file for each source file.
1213 By default, the object file name for a source file is made by replacing
1214 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1216 Unrecognized input files, not requiring compilation or assembly, are
1217 ignored.
1219 @item -S
1220 @opindex S
1221 Stop after the stage of compilation proper; do not assemble.  The output
1222 is in the form of an assembler code file for each non-assembler input
1223 file specified.
1225 By default, the assembler file name for a source file is made by
1226 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1228 Input files that don't require compilation are ignored.
1230 @item -E
1231 @opindex E
1232 Stop after the preprocessing stage; do not run the compiler proper.  The
1233 output is in the form of preprocessed source code, which is sent to the
1234 standard output.
1236 Input files that don't require preprocessing are ignored.
1238 @cindex output file option
1239 @item -o @var{file}
1240 @opindex o
1241 Place output in file @var{file}.  This applies to whatever
1242 sort of output is being produced, whether it be an executable file,
1243 an object file, an assembler file or preprocessed C code.
1245 If @option{-o} is not specified, the default is to put an executable
1246 file in @file{a.out}, the object file for
1247 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1248 assembler file in @file{@var{source}.s}, a precompiled header file in
1249 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1250 standard output.
1252 @item -v
1253 @opindex v
1254 Print (on standard error output) the commands executed to run the stages
1255 of compilation.  Also print the version number of the compiler driver
1256 program and of the preprocessor and the compiler proper.
1258 @item -###
1259 @opindex ###
1260 Like @option{-v} except the commands are not executed and arguments
1261 are quoted unless they contain only alphanumeric characters or @code{./-_}.
1262 This is useful for shell scripts to capture the driver-generated command lines.
1264 @item -pipe
1265 @opindex pipe
1266 Use pipes rather than temporary files for communication between the
1267 various stages of compilation.  This fails to work on some systems where
1268 the assembler is unable to read from a pipe; but the GNU assembler has
1269 no trouble.
1271 @item --help
1272 @opindex help
1273 Print (on the standard output) a description of the command-line options
1274 understood by @command{gcc}.  If the @option{-v} option is also specified
1275 then @option{--help} is also passed on to the various processes
1276 invoked by @command{gcc}, so that they can display the command-line options
1277 they accept.  If the @option{-Wextra} option has also been specified
1278 (prior to the @option{--help} option), then command-line options that
1279 have no documentation associated with them are also displayed.
1281 @item --target-help
1282 @opindex target-help
1283 Print (on the standard output) a description of target-specific command-line
1284 options for each tool.  For some targets extra target-specific
1285 information may also be printed.
1287 @item --help=@{@var{class}@r{|[}^@r{]}@var{qualifier}@}@r{[},@dots{}@r{]}
1288 Print (on the standard output) a description of the command-line
1289 options understood by the compiler that fit into all specified classes
1290 and qualifiers.  These are the supported classes:
1292 @table @asis
1293 @item @samp{optimizers}
1294 Display all of the optimization options supported by the
1295 compiler.
1297 @item @samp{warnings}
1298 Display all of the options controlling warning messages
1299 produced by the compiler.
1301 @item @samp{target}
1302 Display target-specific options.  Unlike the
1303 @option{--target-help} option however, target-specific options of the
1304 linker and assembler are not displayed.  This is because those
1305 tools do not currently support the extended @option{--help=} syntax.
1307 @item @samp{params}
1308 Display the values recognized by the @option{--param}
1309 option.
1311 @item @var{language}
1312 Display the options supported for @var{language}, where
1313 @var{language} is the name of one of the languages supported in this
1314 version of GCC@.
1316 @item @samp{common}
1317 Display the options that are common to all languages.
1318 @end table
1320 These are the supported qualifiers:
1322 @table @asis
1323 @item @samp{undocumented}
1324 Display only those options that are undocumented.
1326 @item @samp{joined}
1327 Display options taking an argument that appears after an equal
1328 sign in the same continuous piece of text, such as:
1329 @samp{--help=target}.
1331 @item @samp{separate}
1332 Display options taking an argument that appears as a separate word
1333 following the original option, such as: @samp{-o output-file}.
1334 @end table
1336 Thus for example to display all the undocumented target-specific
1337 switches supported by the compiler, use:
1339 @smallexample
1340 --help=target,undocumented
1341 @end smallexample
1343 The sense of a qualifier can be inverted by prefixing it with the
1344 @samp{^} character, so for example to display all binary warning
1345 options (i.e., ones that are either on or off and that do not take an
1346 argument) that have a description, use:
1348 @smallexample
1349 --help=warnings,^joined,^undocumented
1350 @end smallexample
1352 The argument to @option{--help=} should not consist solely of inverted
1353 qualifiers.
1355 Combining several classes is possible, although this usually
1356 restricts the output so much that there is nothing to display.  One
1357 case where it does work, however, is when one of the classes is
1358 @var{target}.  For example, to display all the target-specific
1359 optimization options, use:
1361 @smallexample
1362 --help=target,optimizers
1363 @end smallexample
1365 The @option{--help=} option can be repeated on the command line.  Each
1366 successive use displays its requested class of options, skipping
1367 those that have already been displayed.
1369 If the @option{-Q} option appears on the command line before the
1370 @option{--help=} option, then the descriptive text displayed by
1371 @option{--help=} is changed.  Instead of describing the displayed
1372 options, an indication is given as to whether the option is enabled,
1373 disabled or set to a specific value (assuming that the compiler
1374 knows this at the point where the @option{--help=} option is used).
1376 Here is a truncated example from the ARM port of @command{gcc}:
1378 @smallexample
1379   % gcc -Q -mabi=2 --help=target -c
1380   The following options are target specific:
1381   -mabi=                                2
1382   -mabort-on-noreturn                   [disabled]
1383   -mapcs                                [disabled]
1384 @end smallexample
1386 The output is sensitive to the effects of previous command-line
1387 options, so for example it is possible to find out which optimizations
1388 are enabled at @option{-O2} by using:
1390 @smallexample
1391 -Q -O2 --help=optimizers
1392 @end smallexample
1394 Alternatively you can discover which binary optimizations are enabled
1395 by @option{-O3} by using:
1397 @smallexample
1398 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1399 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1400 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1401 @end smallexample
1403 @item -no-canonical-prefixes
1404 @opindex no-canonical-prefixes
1405 Do not expand any symbolic links, resolve references to @samp{/../}
1406 or @samp{/./}, or make the path absolute when generating a relative
1407 prefix.
1409 @item --version
1410 @opindex version
1411 Display the version number and copyrights of the invoked GCC@.
1413 @item -wrapper
1414 @opindex wrapper
1415 Invoke all subcommands under a wrapper program.  The name of the
1416 wrapper program and its parameters are passed as a comma separated
1417 list.
1419 @smallexample
1420 gcc -c t.c -wrapper gdb,--args
1421 @end smallexample
1423 @noindent
1424 This invokes all subprograms of @command{gcc} under
1425 @samp{gdb --args}, thus the invocation of @command{cc1} is
1426 @samp{gdb --args cc1 @dots{}}.
1428 @item -fplugin=@var{name}.so
1429 Load the plugin code in file @var{name}.so, assumed to be a
1430 shared object to be dlopen'd by the compiler.  The base name of
1431 the shared object file is used to identify the plugin for the
1432 purposes of argument parsing (See
1433 @option{-fplugin-arg-@var{name}-@var{key}=@var{value}} below).
1434 Each plugin should define the callback functions specified in the
1435 Plugins API.
1437 @item -fplugin-arg-@var{name}-@var{key}=@var{value}
1438 Define an argument called @var{key} with a value of @var{value}
1439 for the plugin called @var{name}.
1441 @item -fdump-ada-spec@r{[}-slim@r{]}
1442 For C and C++ source and include files, generate corresponding Ada
1443 specs. @xref{Generating Ada Bindings for C and C++ headers,,, gnat_ugn,
1444 GNAT User's Guide}, which provides detailed documentation on this feature.
1446 @item -fdump-go-spec=@var{file}
1447 For input files in any language, generate corresponding Go
1448 declarations in @var{file}.  This generates Go @code{const},
1449 @code{type}, @code{var}, and @code{func} declarations which may be a
1450 useful way to start writing a Go interface to code written in some
1451 other language.
1453 @include @value{srcdir}/../libiberty/at-file.texi
1454 @end table
1456 @node Invoking G++
1457 @section Compiling C++ Programs
1459 @cindex suffixes for C++ source
1460 @cindex C++ source file suffixes
1461 C++ source files conventionally use one of the suffixes @samp{.C},
1462 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1463 @samp{.cxx}; C++ header files often use @samp{.hh}, @samp{.hpp},
1464 @samp{.H}, or (for shared template code) @samp{.tcc}; and
1465 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1466 files with these names and compiles them as C++ programs even if you
1467 call the compiler the same way as for compiling C programs (usually
1468 with the name @command{gcc}).
1470 @findex g++
1471 @findex c++
1472 However, the use of @command{gcc} does not add the C++ library.
1473 @command{g++} is a program that calls GCC and automatically specifies linking
1474 against the C++ library.  It treats @samp{.c},
1475 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1476 files unless @option{-x} is used.  This program is also useful when
1477 precompiling a C header file with a @samp{.h} extension for use in C++
1478 compilations.  On many systems, @command{g++} is also installed with
1479 the name @command{c++}.
1481 @cindex invoking @command{g++}
1482 When you compile C++ programs, you may specify many of the same
1483 command-line options that you use for compiling programs in any
1484 language; or command-line options meaningful for C and related
1485 languages; or options that are meaningful only for C++ programs.
1486 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1487 explanations of options for languages related to C@.
1488 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1489 explanations of options that are meaningful only for C++ programs.
1491 @node C Dialect Options
1492 @section Options Controlling C Dialect
1493 @cindex dialect options
1494 @cindex language dialect options
1495 @cindex options, dialect
1497 The following options control the dialect of C (or languages derived
1498 from C, such as C++, Objective-C and Objective-C++) that the compiler
1499 accepts:
1501 @table @gcctabopt
1502 @cindex ANSI support
1503 @cindex ISO support
1504 @item -ansi
1505 @opindex ansi
1506 In C mode, this is equivalent to @option{-std=c90}. In C++ mode, it is
1507 equivalent to @option{-std=c++98}.
1509 This turns off certain features of GCC that are incompatible with ISO
1510 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1511 such as the @code{asm} and @code{typeof} keywords, and
1512 predefined macros such as @code{unix} and @code{vax} that identify the
1513 type of system you are using.  It also enables the undesirable and
1514 rarely used ISO trigraph feature.  For the C compiler,
1515 it disables recognition of C++ style @samp{//} comments as well as
1516 the @code{inline} keyword.
1518 The alternate keywords @code{__asm__}, @code{__extension__},
1519 @code{__inline__} and @code{__typeof__} continue to work despite
1520 @option{-ansi}.  You would not want to use them in an ISO C program, of
1521 course, but it is useful to put them in header files that might be included
1522 in compilations done with @option{-ansi}.  Alternate predefined macros
1523 such as @code{__unix__} and @code{__vax__} are also available, with or
1524 without @option{-ansi}.
1526 The @option{-ansi} option does not cause non-ISO programs to be
1527 rejected gratuitously.  For that, @option{-Wpedantic} is required in
1528 addition to @option{-ansi}.  @xref{Warning Options}.
1530 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1531 option is used.  Some header files may notice this macro and refrain
1532 from declaring certain functions or defining certain macros that the
1533 ISO standard doesn't call for; this is to avoid interfering with any
1534 programs that might use these names for other things.
1536 Functions that are normally built in but do not have semantics
1537 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1538 functions when @option{-ansi} is used.  @xref{Other Builtins,,Other
1539 built-in functions provided by GCC}, for details of the functions
1540 affected.
1542 @item -std=
1543 @opindex std
1544 Determine the language standard. @xref{Standards,,Language Standards
1545 Supported by GCC}, for details of these standard versions.  This option
1546 is currently only supported when compiling C or C++.
1548 The compiler can accept several base standards, such as @samp{c90} or
1549 @samp{c++98}, and GNU dialects of those standards, such as
1550 @samp{gnu90} or @samp{gnu++98}.  When a base standard is specified, the
1551 compiler accepts all programs following that standard plus those
1552 using GNU extensions that do not contradict it.  For example,
1553 @option{-std=c90} turns off certain features of GCC that are
1554 incompatible with ISO C90, such as the @code{asm} and @code{typeof}
1555 keywords, but not other GNU extensions that do not have a meaning in
1556 ISO C90, such as omitting the middle term of a @code{?:}
1557 expression. On the other hand, when a GNU dialect of a standard is
1558 specified, all features supported by the compiler are enabled, even when
1559 those features change the meaning of the base standard.  As a result, some
1560 strict-conforming programs may be rejected.  The particular standard
1561 is used by @option{-Wpedantic} to identify which features are GNU
1562 extensions given that version of the standard. For example
1563 @option{-std=gnu90 -Wpedantic} warns about C++ style @samp{//}
1564 comments, while @option{-std=gnu99 -Wpedantic} does not.
1566 A value for this option must be provided; possible values are
1568 @table @samp
1569 @item c90
1570 @itemx c89
1571 @itemx iso9899:1990
1572 Support all ISO C90 programs (certain GNU extensions that conflict
1573 with ISO C90 are disabled). Same as @option{-ansi} for C code.
1575 @item iso9899:199409
1576 ISO C90 as modified in amendment 1.
1578 @item c99
1579 @itemx c9x
1580 @itemx iso9899:1999
1581 @itemx iso9899:199x
1582 ISO C99.  Note that this standard is not yet fully supported; see
1583 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1584 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1586 @item c11
1587 @itemx c1x
1588 @itemx iso9899:2011
1589 ISO C11, the 2011 revision of the ISO C standard.
1590 Support is incomplete and experimental.  The name @samp{c1x} is
1591 deprecated.
1593 @item gnu90
1594 @itemx gnu89
1595 GNU dialect of ISO C90 (including some C99 features). This
1596 is the default for C code.
1598 @item gnu99
1599 @itemx gnu9x
1600 GNU dialect of ISO C99.  When ISO C99 is fully implemented in GCC,
1601 this will become the default.  The name @samp{gnu9x} is deprecated.
1603 @item gnu11
1604 @item gnu1x
1605 GNU dialect of ISO C11.  Support is incomplete and experimental.  The
1606 name @samp{gnu1x} is deprecated.
1608 @item c++98
1609 @itemx c++03
1610 The 1998 ISO C++ standard plus the 2003 technical corrigendum and some
1611 additional defect reports. Same as @option{-ansi} for C++ code.
1613 @item gnu++98
1614 @itemx gnu++03
1615 GNU dialect of @option{-std=c++98}.  This is the default for
1616 C++ code.
1618 @item c++11
1619 @itemx c++0x
1620 The 2011 ISO C++ standard plus amendments.  Support for C++11 is still
1621 experimental, and may change in incompatible ways in future releases.
1622 The name @samp{c++0x} is deprecated.
1624 @item gnu++11
1625 @itemx gnu++0x
1626 GNU dialect of @option{-std=c++11}. Support for C++11 is still
1627 experimental, and may change in incompatible ways in future releases.
1628 The name @samp{gnu++0x} is deprecated.
1630 @item c++1y
1631 The next revision of the ISO C++ standard, tentatively planned for
1632 2017.  Support is highly experimental, and will almost certainly
1633 change in incompatible ways in future releases.
1635 @item gnu++1y
1636 GNU dialect of @option{-std=c++1y}.  Support is highly experimental,
1637 and will almost certainly change in incompatible ways in future
1638 releases.
1639 @end table
1641 @item -fgnu89-inline
1642 @opindex fgnu89-inline
1643 The option @option{-fgnu89-inline} tells GCC to use the traditional
1644 GNU semantics for @code{inline} functions when in C99 mode.
1645 @xref{Inline,,An Inline Function is As Fast As a Macro}.  This option
1646 is accepted and ignored by GCC versions 4.1.3 up to but not including
1647 4.3.  In GCC versions 4.3 and later it changes the behavior of GCC in
1648 C99 mode.  Using this option is roughly equivalent to adding the
1649 @code{gnu_inline} function attribute to all inline functions
1650 (@pxref{Function Attributes}).
1652 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
1653 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
1654 specifies the default behavior).  This option was first supported in
1655 GCC 4.3.  This option is not supported in @option{-std=c90} or
1656 @option{-std=gnu90} mode.
1658 The preprocessor macros @code{__GNUC_GNU_INLINE__} and
1659 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
1660 in effect for @code{inline} functions.  @xref{Common Predefined
1661 Macros,,,cpp,The C Preprocessor}.
1663 @item -aux-info @var{filename}
1664 @opindex aux-info
1665 Output to the given filename prototyped declarations for all functions
1666 declared and/or defined in a translation unit, including those in header
1667 files.  This option is silently ignored in any language other than C@.
1669 Besides declarations, the file indicates, in comments, the origin of
1670 each declaration (source file and line), whether the declaration was
1671 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1672 @samp{O} for old, respectively, in the first character after the line
1673 number and the colon), and whether it came from a declaration or a
1674 definition (@samp{C} or @samp{F}, respectively, in the following
1675 character).  In the case of function definitions, a K&R-style list of
1676 arguments followed by their declarations is also provided, inside
1677 comments, after the declaration.
1679 @item -fallow-parameterless-variadic-functions
1680 Accept variadic functions without named parameters.
1682 Although it is possible to define such a function, this is not very
1683 useful as it is not possible to read the arguments.  This is only
1684 supported for C as this construct is allowed by C++.
1686 @item -fno-asm
1687 @opindex fno-asm
1688 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1689 keyword, so that code can use these words as identifiers.  You can use
1690 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1691 instead.  @option{-ansi} implies @option{-fno-asm}.
1693 In C++, this switch only affects the @code{typeof} keyword, since
1694 @code{asm} and @code{inline} are standard keywords.  You may want to
1695 use the @option{-fno-gnu-keywords} flag instead, which has the same
1696 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1697 switch only affects the @code{asm} and @code{typeof} keywords, since
1698 @code{inline} is a standard keyword in ISO C99.
1700 @item -fno-builtin
1701 @itemx -fno-builtin-@var{function}
1702 @opindex fno-builtin
1703 @cindex built-in functions
1704 Don't recognize built-in functions that do not begin with
1705 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1706 functions provided by GCC}, for details of the functions affected,
1707 including those which are not built-in functions when @option{-ansi} or
1708 @option{-std} options for strict ISO C conformance are used because they
1709 do not have an ISO standard meaning.
1711 GCC normally generates special code to handle certain built-in functions
1712 more efficiently; for instance, calls to @code{alloca} may become single
1713 instructions which adjust the stack directly, and calls to @code{memcpy}
1714 may become inline copy loops.  The resulting code is often both smaller
1715 and faster, but since the function calls no longer appear as such, you
1716 cannot set a breakpoint on those calls, nor can you change the behavior
1717 of the functions by linking with a different library.  In addition,
1718 when a function is recognized as a built-in function, GCC may use
1719 information about that function to warn about problems with calls to
1720 that function, or to generate more efficient code, even if the
1721 resulting code still contains calls to that function.  For example,
1722 warnings are given with @option{-Wformat} for bad calls to
1723 @code{printf} when @code{printf} is built in and @code{strlen} is
1724 known not to modify global memory.
1726 With the @option{-fno-builtin-@var{function}} option
1727 only the built-in function @var{function} is
1728 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1729 function is named that is not built-in in this version of GCC, this
1730 option is ignored.  There is no corresponding
1731 @option{-fbuiltin-@var{function}} option; if you wish to enable
1732 built-in functions selectively when using @option{-fno-builtin} or
1733 @option{-ffreestanding}, you may define macros such as:
1735 @smallexample
1736 #define abs(n)          __builtin_abs ((n))
1737 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1738 @end smallexample
1740 @item -fhosted
1741 @opindex fhosted
1742 @cindex hosted environment
1744 Assert that compilation targets a hosted environment.  This implies
1745 @option{-fbuiltin}.  A hosted environment is one in which the
1746 entire standard library is available, and in which @code{main} has a return
1747 type of @code{int}.  Examples are nearly everything except a kernel.
1748 This is equivalent to @option{-fno-freestanding}.
1750 @item -ffreestanding
1751 @opindex ffreestanding
1752 @cindex hosted environment
1754 Assert that compilation targets a freestanding environment.  This
1755 implies @option{-fno-builtin}.  A freestanding environment
1756 is one in which the standard library may not exist, and program startup may
1757 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1758 This is equivalent to @option{-fno-hosted}.
1760 @xref{Standards,,Language Standards Supported by GCC}, for details of
1761 freestanding and hosted environments.
1763 @item -fopenmp
1764 @opindex fopenmp
1765 @cindex OpenMP parallel
1766 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
1767 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
1768 compiler generates parallel code according to the OpenMP Application
1769 Program Interface v3.0 @w{@uref{http://www.openmp.org/}}.  This option
1770 implies @option{-pthread}, and thus is only supported on targets that
1771 have support for @option{-pthread}.
1773 @item -fgnu-tm
1774 @opindex fgnu-tm
1775 When the option @option{-fgnu-tm} is specified, the compiler
1776 generates code for the Linux variant of Intel's current Transactional
1777 Memory ABI specification document (Revision 1.1, May 6 2009).  This is
1778 an experimental feature whose interface may change in future versions
1779 of GCC, as the official specification changes.  Please note that not
1780 all architectures are supported for this feature.
1782 For more information on GCC's support for transactional memory,
1783 @xref{Enabling libitm,,The GNU Transactional Memory Library,libitm,GNU
1784 Transactional Memory Library}.
1786 Note that the transactional memory feature is not supported with
1787 non-call exceptions (@option{-fnon-call-exceptions}).
1789 @item -fms-extensions
1790 @opindex fms-extensions
1791 Accept some non-standard constructs used in Microsoft header files.
1793 In C++ code, this allows member names in structures to be similar
1794 to previous types declarations.
1796 @smallexample
1797 typedef int UOW;
1798 struct ABC @{
1799   UOW UOW;
1801 @end smallexample
1803 Some cases of unnamed fields in structures and unions are only
1804 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
1805 fields within structs/unions}, for details.
1807 @item -fplan9-extensions
1808 Accept some non-standard constructs used in Plan 9 code.
1810 This enables @option{-fms-extensions}, permits passing pointers to
1811 structures with anonymous fields to functions that expect pointers to
1812 elements of the type of the field, and permits referring to anonymous
1813 fields declared using a typedef.  @xref{Unnamed Fields,,Unnamed
1814 struct/union fields within structs/unions}, for details.  This is only
1815 supported for C, not C++.
1817 @item -trigraphs
1818 @opindex trigraphs
1819 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
1820 options for strict ISO C conformance) implies @option{-trigraphs}.
1822 @cindex traditional C language
1823 @cindex C language, traditional
1824 @item -traditional
1825 @itemx -traditional-cpp
1826 @opindex traditional-cpp
1827 @opindex traditional
1828 Formerly, these options caused GCC to attempt to emulate a pre-standard
1829 C compiler.  They are now only supported with the @option{-E} switch.
1830 The preprocessor continues to support a pre-standard mode.  See the GNU
1831 CPP manual for details.
1833 @item -fcond-mismatch
1834 @opindex fcond-mismatch
1835 Allow conditional expressions with mismatched types in the second and
1836 third arguments.  The value of such an expression is void.  This option
1837 is not supported for C++.
1839 @item -flax-vector-conversions
1840 @opindex flax-vector-conversions
1841 Allow implicit conversions between vectors with differing numbers of
1842 elements and/or incompatible element types.  This option should not be
1843 used for new code.
1845 @item -funsigned-char
1846 @opindex funsigned-char
1847 Let the type @code{char} be unsigned, like @code{unsigned char}.
1849 Each kind of machine has a default for what @code{char} should
1850 be.  It is either like @code{unsigned char} by default or like
1851 @code{signed char} by default.
1853 Ideally, a portable program should always use @code{signed char} or
1854 @code{unsigned char} when it depends on the signedness of an object.
1855 But many programs have been written to use plain @code{char} and
1856 expect it to be signed, or expect it to be unsigned, depending on the
1857 machines they were written for.  This option, and its inverse, let you
1858 make such a program work with the opposite default.
1860 The type @code{char} is always a distinct type from each of
1861 @code{signed char} or @code{unsigned char}, even though its behavior
1862 is always just like one of those two.
1864 @item -fsigned-char
1865 @opindex fsigned-char
1866 Let the type @code{char} be signed, like @code{signed char}.
1868 Note that this is equivalent to @option{-fno-unsigned-char}, which is
1869 the negative form of @option{-funsigned-char}.  Likewise, the option
1870 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
1872 @item -fsigned-bitfields
1873 @itemx -funsigned-bitfields
1874 @itemx -fno-signed-bitfields
1875 @itemx -fno-unsigned-bitfields
1876 @opindex fsigned-bitfields
1877 @opindex funsigned-bitfields
1878 @opindex fno-signed-bitfields
1879 @opindex fno-unsigned-bitfields
1880 These options control whether a bit-field is signed or unsigned, when the
1881 declaration does not use either @code{signed} or @code{unsigned}.  By
1882 default, such a bit-field is signed, because this is consistent: the
1883 basic integer types such as @code{int} are signed types.
1884 @end table
1886 @node C++ Dialect Options
1887 @section Options Controlling C++ Dialect
1889 @cindex compiler options, C++
1890 @cindex C++ options, command-line
1891 @cindex options, C++
1892 This section describes the command-line options that are only meaningful
1893 for C++ programs.  You can also use most of the GNU compiler options
1894 regardless of what language your program is in.  For example, you
1895 might compile a file @code{firstClass.C} like this:
1897 @smallexample
1898 g++ -g -frepo -O -c firstClass.C
1899 @end smallexample
1901 @noindent
1902 In this example, only @option{-frepo} is an option meant
1903 only for C++ programs; you can use the other options with any
1904 language supported by GCC@.
1906 Here is a list of options that are @emph{only} for compiling C++ programs:
1908 @table @gcctabopt
1910 @item -fabi-version=@var{n}
1911 @opindex fabi-version
1912 Use version @var{n} of the C++ ABI@.  The default is version 2.
1914 Version 0 refers to the version conforming most closely to
1915 the C++ ABI specification.  Therefore, the ABI obtained using version 0
1916 will change in different versions of G++ as ABI bugs are fixed.
1918 Version 1 is the version of the C++ ABI that first appeared in G++ 3.2.  
1920 Version 2 is the version of the C++ ABI that first appeared in G++ 3.4.  
1922 Version 3 corrects an error in mangling a constant address as a
1923 template argument.
1925 Version 4, which first appeared in G++ 4.5, implements a standard
1926 mangling for vector types.
1928 Version 5, which first appeared in G++ 4.6, corrects the mangling of
1929 attribute const/volatile on function pointer types, decltype of a
1930 plain decl, and use of a function parameter in the declaration of
1931 another parameter.
1933 Version 6, which first appeared in G++ 4.7, corrects the promotion
1934 behavior of C++11 scoped enums and the mangling of template argument
1935 packs, const/static_cast, prefix ++ and --, and a class scope function
1936 used as a template argument.
1938 See also @option{-Wabi}.
1940 @item -fno-access-control
1941 @opindex fno-access-control
1942 Turn off all access checking.  This switch is mainly useful for working
1943 around bugs in the access control code.
1945 @item -fcheck-new
1946 @opindex fcheck-new
1947 Check that the pointer returned by @code{operator new} is non-null
1948 before attempting to modify the storage allocated.  This check is
1949 normally unnecessary because the C++ standard specifies that
1950 @code{operator new} only returns @code{0} if it is declared
1951 @samp{throw()}, in which case the compiler always checks the
1952 return value even without this option.  In all other cases, when
1953 @code{operator new} has a non-empty exception specification, memory
1954 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
1955 @samp{new (nothrow)}.
1957 @item -fconstexpr-depth=@var{n}
1958 @opindex fconstexpr-depth
1959 Set the maximum nested evaluation depth for C++11 constexpr functions
1960 to @var{n}.  A limit is needed to detect endless recursion during
1961 constant expression evaluation.  The minimum specified by the standard
1962 is 512.
1964 @item -fdeduce-init-list
1965 @opindex fdeduce-init-list
1966 Enable deduction of a template type parameter as
1967 @code{std::initializer_list} from a brace-enclosed initializer list, i.e.@:
1969 @smallexample
1970 template <class T> auto forward(T t) -> decltype (realfn (t))
1972   return realfn (t);
1975 void f()
1977   forward(@{1,2@}); // call forward<std::initializer_list<int>>
1979 @end smallexample
1981 This deduction was implemented as a possible extension to the
1982 originally proposed semantics for the C++11 standard, but was not part
1983 of the final standard, so it is disabled by default.  This option is
1984 deprecated, and may be removed in a future version of G++.
1986 @item -ffriend-injection
1987 @opindex ffriend-injection
1988 Inject friend functions into the enclosing namespace, so that they are
1989 visible outside the scope of the class in which they are declared.
1990 Friend functions were documented to work this way in the old Annotated
1991 C++ Reference Manual, and versions of G++ before 4.1 always worked
1992 that way.  However, in ISO C++ a friend function that is not declared
1993 in an enclosing scope can only be found using argument dependent
1994 lookup.  This option causes friends to be injected as they were in
1995 earlier releases.
1997 This option is for compatibility, and may be removed in a future
1998 release of G++.
2000 @item -fno-elide-constructors
2001 @opindex fno-elide-constructors
2002 The C++ standard allows an implementation to omit creating a temporary
2003 that is only used to initialize another object of the same type.
2004 Specifying this option disables that optimization, and forces G++ to
2005 call the copy constructor in all cases.
2007 @item -fno-enforce-eh-specs
2008 @opindex fno-enforce-eh-specs
2009 Don't generate code to check for violation of exception specifications
2010 at run time.  This option violates the C++ standard, but may be useful
2011 for reducing code size in production builds, much like defining
2012 @samp{NDEBUG}.  This does not give user code permission to throw
2013 exceptions in violation of the exception specifications; the compiler
2014 still optimizes based on the specifications, so throwing an
2015 unexpected exception results in undefined behavior at run time.
2017 @item -ffor-scope
2018 @itemx -fno-for-scope
2019 @opindex ffor-scope
2020 @opindex fno-for-scope
2021 If @option{-ffor-scope} is specified, the scope of variables declared in
2022 a @i{for-init-statement} is limited to the @samp{for} loop itself,
2023 as specified by the C++ standard.
2024 If @option{-fno-for-scope} is specified, the scope of variables declared in
2025 a @i{for-init-statement} extends to the end of the enclosing scope,
2026 as was the case in old versions of G++, and other (traditional)
2027 implementations of C++.
2029 If neither flag is given, the default is to follow the standard,
2030 but to allow and give a warning for old-style code that would
2031 otherwise be invalid, or have different behavior.
2033 @item -fno-gnu-keywords
2034 @opindex fno-gnu-keywords
2035 Do not recognize @code{typeof} as a keyword, so that code can use this
2036 word as an identifier.  You can use the keyword @code{__typeof__} instead.
2037 @option{-ansi} implies @option{-fno-gnu-keywords}.
2039 @item -fno-implicit-templates
2040 @opindex fno-implicit-templates
2041 Never emit code for non-inline templates that are instantiated
2042 implicitly (i.e.@: by use); only emit code for explicit instantiations.
2043 @xref{Template Instantiation}, for more information.
2045 @item -fno-implicit-inline-templates
2046 @opindex fno-implicit-inline-templates
2047 Don't emit code for implicit instantiations of inline templates, either.
2048 The default is to handle inlines differently so that compiles with and
2049 without optimization need the same set of explicit instantiations.
2051 @item -fno-implement-inlines
2052 @opindex fno-implement-inlines
2053 To save space, do not emit out-of-line copies of inline functions
2054 controlled by @samp{#pragma implementation}.  This causes linker
2055 errors if these functions are not inlined everywhere they are called.
2057 @item -fms-extensions
2058 @opindex fms-extensions
2059 Disable Wpedantic warnings about constructs used in MFC, such as implicit
2060 int and getting a pointer to member function via non-standard syntax.
2062 @item -fno-nonansi-builtins
2063 @opindex fno-nonansi-builtins
2064 Disable built-in declarations of functions that are not mandated by
2065 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
2066 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
2068 @item -fnothrow-opt
2069 @opindex fnothrow-opt
2070 Treat a @code{throw()} exception specification as if it were a
2071 @code{noexcept} specification to reduce or eliminate the text size
2072 overhead relative to a function with no exception specification.  If
2073 the function has local variables of types with non-trivial
2074 destructors, the exception specification actually makes the
2075 function smaller because the EH cleanups for those variables can be
2076 optimized away.  The semantic effect is that an exception thrown out of
2077 a function with such an exception specification results in a call
2078 to @code{terminate} rather than @code{unexpected}.
2080 @item -fno-operator-names
2081 @opindex fno-operator-names
2082 Do not treat the operator name keywords @code{and}, @code{bitand},
2083 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
2084 synonyms as keywords.
2086 @item -fno-optional-diags
2087 @opindex fno-optional-diags
2088 Disable diagnostics that the standard says a compiler does not need to
2089 issue.  Currently, the only such diagnostic issued by G++ is the one for
2090 a name having multiple meanings within a class.
2092 @item -fpermissive
2093 @opindex fpermissive
2094 Downgrade some diagnostics about nonconformant code from errors to
2095 warnings.  Thus, using @option{-fpermissive} allows some
2096 nonconforming code to compile.
2098 @item -fno-pretty-templates
2099 @opindex fno-pretty-templates
2100 When an error message refers to a specialization of a function
2101 template, the compiler normally prints the signature of the
2102 template followed by the template arguments and any typedefs or
2103 typenames in the signature (e.g. @code{void f(T) [with T = int]}
2104 rather than @code{void f(int)}) so that it's clear which template is
2105 involved.  When an error message refers to a specialization of a class
2106 template, the compiler omits any template arguments that match
2107 the default template arguments for that template.  If either of these
2108 behaviors make it harder to understand the error message rather than
2109 easier, you can use @option{-fno-pretty-templates} to disable them.
2111 @item -frepo
2112 @opindex frepo
2113 Enable automatic template instantiation at link time.  This option also
2114 implies @option{-fno-implicit-templates}.  @xref{Template
2115 Instantiation}, for more information.
2117 @item -fno-rtti
2118 @opindex fno-rtti
2119 Disable generation of information about every class with virtual
2120 functions for use by the C++ run-time type identification features
2121 (@samp{dynamic_cast} and @samp{typeid}).  If you don't use those parts
2122 of the language, you can save some space by using this flag.  Note that
2123 exception handling uses the same information, but G++ generates it as
2124 needed. The @samp{dynamic_cast} operator can still be used for casts that
2125 do not require run-time type information, i.e.@: casts to @code{void *} or to
2126 unambiguous base classes.
2128 @item -fstats
2129 @opindex fstats
2130 Emit statistics about front-end processing at the end of the compilation.
2131 This information is generally only useful to the G++ development team.
2133 @item -fstrict-enums
2134 @opindex fstrict-enums
2135 Allow the compiler to optimize using the assumption that a value of
2136 enumerated type can only be one of the values of the enumeration (as
2137 defined in the C++ standard; basically, a value that can be
2138 represented in the minimum number of bits needed to represent all the
2139 enumerators).  This assumption may not be valid if the program uses a
2140 cast to convert an arbitrary integer value to the enumerated type.
2142 @item -ftemplate-backtrace-limit=@var{n}
2143 @opindex ftemplate-backtrace-limit
2144 Set the maximum number of template instantiation notes for a single
2145 warning or error to @var{n}.  The default value is 10.
2147 @item -ftemplate-depth=@var{n}
2148 @opindex ftemplate-depth
2149 Set the maximum instantiation depth for template classes to @var{n}.
2150 A limit on the template instantiation depth is needed to detect
2151 endless recursions during template class instantiation.  ANSI/ISO C++
2152 conforming programs must not rely on a maximum depth greater than 17
2153 (changed to 1024 in C++11).  The default value is 900, as the compiler
2154 can run out of stack space before hitting 1024 in some situations.
2156 @item -fno-threadsafe-statics
2157 @opindex fno-threadsafe-statics
2158 Do not emit the extra code to use the routines specified in the C++
2159 ABI for thread-safe initialization of local statics.  You can use this
2160 option to reduce code size slightly in code that doesn't need to be
2161 thread-safe.
2163 @item -fuse-cxa-atexit
2164 @opindex fuse-cxa-atexit
2165 Register destructors for objects with static storage duration with the
2166 @code{__cxa_atexit} function rather than the @code{atexit} function.
2167 This option is required for fully standards-compliant handling of static
2168 destructors, but only works if your C library supports
2169 @code{__cxa_atexit}.
2171 @item -fno-use-cxa-get-exception-ptr
2172 @opindex fno-use-cxa-get-exception-ptr
2173 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
2174 causes @code{std::uncaught_exception} to be incorrect, but is necessary
2175 if the runtime routine is not available.
2177 @item -fvisibility-inlines-hidden
2178 @opindex fvisibility-inlines-hidden
2179 This switch declares that the user does not attempt to compare
2180 pointers to inline functions or methods where the addresses of the two functions
2181 are taken in different shared objects.
2183 The effect of this is that GCC may, effectively, mark inline methods with
2184 @code{__attribute__ ((visibility ("hidden")))} so that they do not
2185 appear in the export table of a DSO and do not require a PLT indirection
2186 when used within the DSO@.  Enabling this option can have a dramatic effect
2187 on load and link times of a DSO as it massively reduces the size of the
2188 dynamic export table when the library makes heavy use of templates.
2190 The behavior of this switch is not quite the same as marking the
2191 methods as hidden directly, because it does not affect static variables
2192 local to the function or cause the compiler to deduce that
2193 the function is defined in only one shared object.
2195 You may mark a method as having a visibility explicitly to negate the
2196 effect of the switch for that method.  For example, if you do want to
2197 compare pointers to a particular inline method, you might mark it as
2198 having default visibility.  Marking the enclosing class with explicit
2199 visibility has no effect.
2201 Explicitly instantiated inline methods are unaffected by this option
2202 as their linkage might otherwise cross a shared library boundary.
2203 @xref{Template Instantiation}.
2205 @item -fvisibility-ms-compat
2206 @opindex fvisibility-ms-compat
2207 This flag attempts to use visibility settings to make GCC's C++
2208 linkage model compatible with that of Microsoft Visual Studio.
2210 The flag makes these changes to GCC's linkage model:
2212 @enumerate
2213 @item
2214 It sets the default visibility to @code{hidden}, like
2215 @option{-fvisibility=hidden}.
2217 @item
2218 Types, but not their members, are not hidden by default.
2220 @item
2221 The One Definition Rule is relaxed for types without explicit
2222 visibility specifications that are defined in more than one
2223 shared object: those declarations are permitted if they are
2224 permitted when this option is not used.
2225 @end enumerate
2227 In new code it is better to use @option{-fvisibility=hidden} and
2228 export those classes that are intended to be externally visible.
2229 Unfortunately it is possible for code to rely, perhaps accidentally,
2230 on the Visual Studio behavior.
2232 Among the consequences of these changes are that static data members
2233 of the same type with the same name but defined in different shared
2234 objects are different, so changing one does not change the other;
2235 and that pointers to function members defined in different shared
2236 objects may not compare equal.  When this flag is given, it is a
2237 violation of the ODR to define types with the same name differently.
2239 @item -fno-weak
2240 @opindex fno-weak
2241 Do not use weak symbol support, even if it is provided by the linker.
2242 By default, G++ uses weak symbols if they are available.  This
2243 option exists only for testing, and should not be used by end-users;
2244 it results in inferior code and has no benefits.  This option may
2245 be removed in a future release of G++.
2247 @item -nostdinc++
2248 @opindex nostdinc++
2249 Do not search for header files in the standard directories specific to
2250 C++, but do still search the other standard directories.  (This option
2251 is used when building the C++ library.)
2252 @end table
2254 In addition, these optimization, warning, and code generation options
2255 have meanings only for C++ programs:
2257 @table @gcctabopt
2258 @item -fno-default-inline
2259 @opindex fno-default-inline
2260 Do not assume @samp{inline} for functions defined inside a class scope.
2261 @xref{Optimize Options,,Options That Control Optimization}.  Note that these
2262 functions have linkage like inline functions; they just aren't
2263 inlined by default.
2265 @item -Wabi @r{(C, Objective-C, C++ and Objective-C++ only)}
2266 @opindex Wabi
2267 @opindex Wno-abi
2268 Warn when G++ generates code that is probably not compatible with the
2269 vendor-neutral C++ ABI@.  Although an effort has been made to warn about
2270 all such cases, there are probably some cases that are not warned about,
2271 even though G++ is generating incompatible code.  There may also be
2272 cases where warnings are emitted even though the code that is generated
2273 is compatible.
2275 You should rewrite your code to avoid these warnings if you are
2276 concerned about the fact that code generated by G++ may not be binary
2277 compatible with code generated by other compilers.
2279 The known incompatibilities in @option{-fabi-version=2} (the default) include:
2281 @itemize @bullet
2283 @item
2284 A template with a non-type template parameter of reference type is
2285 mangled incorrectly:
2286 @smallexample
2287 extern int N;
2288 template <int &> struct S @{@};
2289 void n (S<N>) @{2@}
2290 @end smallexample
2292 This is fixed in @option{-fabi-version=3}.
2294 @item
2295 SIMD vector types declared using @code{__attribute ((vector_size))} are
2296 mangled in a non-standard way that does not allow for overloading of
2297 functions taking vectors of different sizes.
2299 The mangling is changed in @option{-fabi-version=4}.
2300 @end itemize
2302 The known incompatibilities in @option{-fabi-version=1} include:
2304 @itemize @bullet
2306 @item
2307 Incorrect handling of tail-padding for bit-fields.  G++ may attempt to
2308 pack data into the same byte as a base class.  For example:
2310 @smallexample
2311 struct A @{ virtual void f(); int f1 : 1; @};
2312 struct B : public A @{ int f2 : 1; @};
2313 @end smallexample
2315 @noindent
2316 In this case, G++ places @code{B::f2} into the same byte
2317 as @code{A::f1}; other compilers do not.  You can avoid this problem
2318 by explicitly padding @code{A} so that its size is a multiple of the
2319 byte size on your platform; that causes G++ and other compilers to
2320 lay out @code{B} identically.
2322 @item
2323 Incorrect handling of tail-padding for virtual bases.  G++ does not use
2324 tail padding when laying out virtual bases.  For example:
2326 @smallexample
2327 struct A @{ virtual void f(); char c1; @};
2328 struct B @{ B(); char c2; @};
2329 struct C : public A, public virtual B @{@};
2330 @end smallexample
2332 @noindent
2333 In this case, G++ does not place @code{B} into the tail-padding for
2334 @code{A}; other compilers do.  You can avoid this problem by
2335 explicitly padding @code{A} so that its size is a multiple of its
2336 alignment (ignoring virtual base classes); that causes G++ and other
2337 compilers to lay out @code{C} identically.
2339 @item
2340 Incorrect handling of bit-fields with declared widths greater than that
2341 of their underlying types, when the bit-fields appear in a union.  For
2342 example:
2344 @smallexample
2345 union U @{ int i : 4096; @};
2346 @end smallexample
2348 @noindent
2349 Assuming that an @code{int} does not have 4096 bits, G++ makes the
2350 union too small by the number of bits in an @code{int}.
2352 @item
2353 Empty classes can be placed at incorrect offsets.  For example:
2355 @smallexample
2356 struct A @{@};
2358 struct B @{
2359   A a;
2360   virtual void f ();
2363 struct C : public B, public A @{@};
2364 @end smallexample
2366 @noindent
2367 G++ places the @code{A} base class of @code{C} at a nonzero offset;
2368 it should be placed at offset zero.  G++ mistakenly believes that the
2369 @code{A} data member of @code{B} is already at offset zero.
2371 @item
2372 Names of template functions whose types involve @code{typename} or
2373 template template parameters can be mangled incorrectly.
2375 @smallexample
2376 template <typename Q>
2377 void f(typename Q::X) @{@}
2379 template <template <typename> class Q>
2380 void f(typename Q<int>::X) @{@}
2381 @end smallexample
2383 @noindent
2384 Instantiations of these templates may be mangled incorrectly.
2386 @end itemize
2388 It also warns about psABI-related changes.  The known psABI changes at this
2389 point include:
2391 @itemize @bullet
2393 @item
2394 For SysV/x86-64, unions with @code{long double} members are 
2395 passed in memory as specified in psABI.  For example:
2397 @smallexample
2398 union U @{
2399   long double ld;
2400   int i;
2402 @end smallexample
2404 @noindent
2405 @code{union U} is always passed in memory.
2407 @end itemize
2409 @item -Wctor-dtor-privacy @r{(C++ and Objective-C++ only)}
2410 @opindex Wctor-dtor-privacy
2411 @opindex Wno-ctor-dtor-privacy
2412 Warn when a class seems unusable because all the constructors or
2413 destructors in that class are private, and it has neither friends nor
2414 public static member functions.
2416 @item -Wdelete-non-virtual-dtor @r{(C++ and Objective-C++ only)}
2417 @opindex Wdelete-non-virtual-dtor
2418 @opindex Wno-delete-non-virtual-dtor
2419 Warn when @samp{delete} is used to destroy an instance of a class that
2420 has virtual functions and non-virtual destructor. It is unsafe to delete
2421 an instance of a derived class through a pointer to a base class if the
2422 base class does not have a virtual destructor.  This warning is enabled
2423 by @option{-Wall}.
2425 @item -Wliteral-suffix @r{(C++ and Objective-C++ only)}
2426 @opindex Wliteral-suffix
2427 @opindex Wno-literal-suffix
2428 Warn when a string or character literal is followed by a ud-suffix which does
2429 not begin with an underscore.  As a conforming extension, GCC treats such
2430 suffixes as separate preprocessing tokens in order to maintain backwards
2431 compatibility with code that uses formatting macros from @code{<inttypes.h>}.
2432 For example:
2434 @smallexample
2435 #define __STDC_FORMAT_MACROS
2436 #include <inttypes.h>
2437 #include <stdio.h>
2439 int main() @{
2440   int64_t i64 = 123;
2441   printf("My int64: %"PRId64"\n", i64);
2443 @end smallexample
2445 In this case, @code{PRId64} is treated as a separate preprocessing token.
2447 This warning is enabled by default.
2449 @item -Wnarrowing @r{(C++ and Objective-C++ only)}
2450 @opindex Wnarrowing
2451 @opindex Wno-narrowing
2452 Warn when a narrowing conversion prohibited by C++11 occurs within
2453 @samp{@{ @}}, e.g.
2455 @smallexample
2456 int i = @{ 2.2 @}; // error: narrowing from double to int
2457 @end smallexample
2459 This flag is included in @option{-Wall} and @option{-Wc++11-compat}.
2461 With @option{-std=c++11}, @option{-Wno-narrowing} suppresses the diagnostic
2462 required by the standard.  Note that this does not affect the meaning
2463 of well-formed code; narrowing conversions are still considered
2464 ill-formed in SFINAE context.
2466 @item -Wnoexcept @r{(C++ and Objective-C++ only)}
2467 @opindex Wnoexcept
2468 @opindex Wno-noexcept
2469 Warn when a noexcept-expression evaluates to false because of a call
2470 to a function that does not have a non-throwing exception
2471 specification (i.e. @samp{throw()} or @samp{noexcept}) but is known by
2472 the compiler to never throw an exception.
2474 @item -Wnon-virtual-dtor @r{(C++ and Objective-C++ only)}
2475 @opindex Wnon-virtual-dtor
2476 @opindex Wno-non-virtual-dtor
2477 Warn when a class has virtual functions and an accessible non-virtual
2478 destructor, in which case it is possible but unsafe to delete
2479 an instance of a derived class through a pointer to the base class.
2480 This warning is also enabled if @option{-Weffc++} is specified.
2482 @item -Wreorder @r{(C++ and Objective-C++ only)}
2483 @opindex Wreorder
2484 @opindex Wno-reorder
2485 @cindex reordering, warning
2486 @cindex warning for reordering of member initializers
2487 Warn when the order of member initializers given in the code does not
2488 match the order in which they must be executed.  For instance:
2490 @smallexample
2491 struct A @{
2492   int i;
2493   int j;
2494   A(): j (0), i (1) @{ @}
2496 @end smallexample
2498 @noindent
2499 The compiler rearranges the member initializers for @samp{i}
2500 and @samp{j} to match the declaration order of the members, emitting
2501 a warning to that effect.  This warning is enabled by @option{-Wall}.
2502 @end table
2504 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
2506 @table @gcctabopt
2507 @item -Weffc++ @r{(C++ and Objective-C++ only)}
2508 @opindex Weffc++
2509 @opindex Wno-effc++
2510 Warn about violations of the following style guidelines from Scott Meyers'
2511 @cite{Effective C++, Second Edition} book:
2513 @itemize @bullet
2514 @item
2515 Item 11:  Define a copy constructor and an assignment operator for classes
2516 with dynamically-allocated memory.
2518 @item
2519 Item 12:  Prefer initialization to assignment in constructors.
2521 @item
2522 Item 14:  Make destructors virtual in base classes.
2524 @item
2525 Item 15:  Have @code{operator=} return a reference to @code{*this}.
2527 @item
2528 Item 23:  Don't try to return a reference when you must return an object.
2530 @end itemize
2532 Also warn about violations of the following style guidelines from
2533 Scott Meyers' @cite{More Effective C++} book:
2535 @itemize @bullet
2536 @item
2537 Item 6:  Distinguish between prefix and postfix forms of increment and
2538 decrement operators.
2540 @item
2541 Item 7:  Never overload @code{&&}, @code{||}, or @code{,}.
2543 @end itemize
2545 When selecting this option, be aware that the standard library
2546 headers do not obey all of these guidelines; use @samp{grep -v}
2547 to filter out those warnings.
2549 @item -Wstrict-null-sentinel @r{(C++ and Objective-C++ only)}
2550 @opindex Wstrict-null-sentinel
2551 @opindex Wno-strict-null-sentinel
2552 Warn about the use of an uncasted @code{NULL} as sentinel.  When
2553 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
2554 to @code{__null}.  Although it is a null pointer constant rather than a
2555 null pointer, it is guaranteed to be of the same size as a pointer.
2556 But this use is not portable across different compilers.
2558 @item -Wno-non-template-friend @r{(C++ and Objective-C++ only)}
2559 @opindex Wno-non-template-friend
2560 @opindex Wnon-template-friend
2561 Disable warnings when non-templatized friend functions are declared
2562 within a template.  Since the advent of explicit template specification
2563 support in G++, if the name of the friend is an unqualified-id (i.e.,
2564 @samp{friend foo(int)}), the C++ language specification demands that the
2565 friend declare or define an ordinary, nontemplate function.  (Section
2566 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
2567 could be interpreted as a particular specialization of a templatized
2568 function.  Because this non-conforming behavior is no longer the default
2569 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
2570 check existing code for potential trouble spots and is on by default.
2571 This new compiler behavior can be turned off with
2572 @option{-Wno-non-template-friend}, which keeps the conformant compiler code
2573 but disables the helpful warning.
2575 @item -Wold-style-cast @r{(C++ and Objective-C++ only)}
2576 @opindex Wold-style-cast
2577 @opindex Wno-old-style-cast
2578 Warn if an old-style (C-style) cast to a non-void type is used within
2579 a C++ program.  The new-style casts (@samp{dynamic_cast},
2580 @samp{static_cast}, @samp{reinterpret_cast}, and @samp{const_cast}) are
2581 less vulnerable to unintended effects and much easier to search for.
2583 @item -Woverloaded-virtual @r{(C++ and Objective-C++ only)}
2584 @opindex Woverloaded-virtual
2585 @opindex Wno-overloaded-virtual
2586 @cindex overloaded virtual function, warning
2587 @cindex warning for overloaded virtual function
2588 Warn when a function declaration hides virtual functions from a
2589 base class.  For example, in:
2591 @smallexample
2592 struct A @{
2593   virtual void f();
2596 struct B: public A @{
2597   void f(int);
2599 @end smallexample
2601 the @code{A} class version of @code{f} is hidden in @code{B}, and code
2602 like:
2604 @smallexample
2605 B* b;
2606 b->f();
2607 @end smallexample
2609 @noindent
2610 fails to compile.
2612 @item -Wno-pmf-conversions @r{(C++ and Objective-C++ only)}
2613 @opindex Wno-pmf-conversions
2614 @opindex Wpmf-conversions
2615 Disable the diagnostic for converting a bound pointer to member function
2616 to a plain pointer.
2618 @item -Wsign-promo @r{(C++ and Objective-C++ only)}
2619 @opindex Wsign-promo
2620 @opindex Wno-sign-promo
2621 Warn when overload resolution chooses a promotion from unsigned or
2622 enumerated type to a signed type, over a conversion to an unsigned type of
2623 the same size.  Previous versions of G++ tried to preserve
2624 unsignedness, but the standard mandates the current behavior.
2626 @smallexample
2627 struct A @{
2628   operator int ();
2629   A& operator = (int);
2632 main ()
2634   A a,b;
2635   a = b;
2637 @end smallexample
2639 @noindent
2640 In this example, G++ synthesizes a default @samp{A& operator =
2641 (const A&);}, while cfront uses the user-defined @samp{operator =}.
2642 @end table
2644 @node Objective-C and Objective-C++ Dialect Options
2645 @section Options Controlling Objective-C and Objective-C++ Dialects
2647 @cindex compiler options, Objective-C and Objective-C++
2648 @cindex Objective-C and Objective-C++ options, command-line
2649 @cindex options, Objective-C and Objective-C++
2650 (NOTE: This manual does not describe the Objective-C and Objective-C++
2651 languages themselves.  @xref{Standards,,Language Standards
2652 Supported by GCC}, for references.)
2654 This section describes the command-line options that are only meaningful
2655 for Objective-C and Objective-C++ programs.  You can also use most of
2656 the language-independent GNU compiler options.
2657 For example, you might compile a file @code{some_class.m} like this:
2659 @smallexample
2660 gcc -g -fgnu-runtime -O -c some_class.m
2661 @end smallexample
2663 @noindent
2664 In this example, @option{-fgnu-runtime} is an option meant only for
2665 Objective-C and Objective-C++ programs; you can use the other options with
2666 any language supported by GCC@.
2668 Note that since Objective-C is an extension of the C language, Objective-C
2669 compilations may also use options specific to the C front-end (e.g.,
2670 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
2671 C++-specific options (e.g., @option{-Wabi}).
2673 Here is a list of options that are @emph{only} for compiling Objective-C
2674 and Objective-C++ programs:
2676 @table @gcctabopt
2677 @item -fconstant-string-class=@var{class-name}
2678 @opindex fconstant-string-class
2679 Use @var{class-name} as the name of the class to instantiate for each
2680 literal string specified with the syntax @code{@@"@dots{}"}.  The default
2681 class name is @code{NXConstantString} if the GNU runtime is being used, and
2682 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
2683 @option{-fconstant-cfstrings} option, if also present, overrides the
2684 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
2685 to be laid out as constant CoreFoundation strings.
2687 @item -fgnu-runtime
2688 @opindex fgnu-runtime
2689 Generate object code compatible with the standard GNU Objective-C
2690 runtime.  This is the default for most types of systems.
2692 @item -fnext-runtime
2693 @opindex fnext-runtime
2694 Generate output compatible with the NeXT runtime.  This is the default
2695 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
2696 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
2697 used.
2699 @item -fno-nil-receivers
2700 @opindex fno-nil-receivers
2701 Assume that all Objective-C message dispatches (@code{[receiver
2702 message:arg]}) in this translation unit ensure that the receiver is
2703 not @code{nil}.  This allows for more efficient entry points in the
2704 runtime to be used.  This option is only available in conjunction with
2705 the NeXT runtime and ABI version 0 or 1.
2707 @item -fobjc-abi-version=@var{n}
2708 @opindex fobjc-abi-version
2709 Use version @var{n} of the Objective-C ABI for the selected runtime.
2710 This option is currently supported only for the NeXT runtime.  In that
2711 case, Version 0 is the traditional (32-bit) ABI without support for
2712 properties and other Objective-C 2.0 additions.  Version 1 is the
2713 traditional (32-bit) ABI with support for properties and other
2714 Objective-C 2.0 additions.  Version 2 is the modern (64-bit) ABI.  If
2715 nothing is specified, the default is Version 0 on 32-bit target
2716 machines, and Version 2 on 64-bit target machines.
2718 @item -fobjc-call-cxx-cdtors
2719 @opindex fobjc-call-cxx-cdtors
2720 For each Objective-C class, check if any of its instance variables is a
2721 C++ object with a non-trivial default constructor.  If so, synthesize a
2722 special @code{- (id) .cxx_construct} instance method which runs
2723 non-trivial default constructors on any such instance variables, in order,
2724 and then return @code{self}.  Similarly, check if any instance variable
2725 is a C++ object with a non-trivial destructor, and if so, synthesize a
2726 special @code{- (void) .cxx_destruct} method which runs
2727 all such default destructors, in reverse order.
2729 The @code{- (id) .cxx_construct} and @code{- (void) .cxx_destruct}
2730 methods thusly generated only operate on instance variables
2731 declared in the current Objective-C class, and not those inherited
2732 from superclasses.  It is the responsibility of the Objective-C
2733 runtime to invoke all such methods in an object's inheritance
2734 hierarchy.  The @code{- (id) .cxx_construct} methods are invoked
2735 by the runtime immediately after a new object instance is allocated;
2736 the @code{- (void) .cxx_destruct} methods are invoked immediately
2737 before the runtime deallocates an object instance.
2739 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
2740 support for invoking the @code{- (id) .cxx_construct} and
2741 @code{- (void) .cxx_destruct} methods.
2743 @item -fobjc-direct-dispatch
2744 @opindex fobjc-direct-dispatch
2745 Allow fast jumps to the message dispatcher.  On Darwin this is
2746 accomplished via the comm page.
2748 @item -fobjc-exceptions
2749 @opindex fobjc-exceptions
2750 Enable syntactic support for structured exception handling in
2751 Objective-C, similar to what is offered by C++ and Java.  This option
2752 is required to use the Objective-C keywords @code{@@try},
2753 @code{@@throw}, @code{@@catch}, @code{@@finally} and
2754 @code{@@synchronized}.  This option is available with both the GNU
2755 runtime and the NeXT runtime (but not available in conjunction with
2756 the NeXT runtime on Mac OS X 10.2 and earlier).
2758 @item -fobjc-gc
2759 @opindex fobjc-gc
2760 Enable garbage collection (GC) in Objective-C and Objective-C++
2761 programs.  This option is only available with the NeXT runtime; the
2762 GNU runtime has a different garbage collection implementation that
2763 does not require special compiler flags.
2765 @item -fobjc-nilcheck
2766 @opindex fobjc-nilcheck
2767 For the NeXT runtime with version 2 of the ABI, check for a nil
2768 receiver in method invocations before doing the actual method call.
2769 This is the default and can be disabled using
2770 @option{-fno-objc-nilcheck}.  Class methods and super calls are never
2771 checked for nil in this way no matter what this flag is set to.
2772 Currently this flag does nothing when the GNU runtime, or an older
2773 version of the NeXT runtime ABI, is used.
2775 @item -fobjc-std=objc1
2776 @opindex fobjc-std
2777 Conform to the language syntax of Objective-C 1.0, the language
2778 recognized by GCC 4.0.  This only affects the Objective-C additions to
2779 the C/C++ language; it does not affect conformance to C/C++ standards,
2780 which is controlled by the separate C/C++ dialect option flags.  When
2781 this option is used with the Objective-C or Objective-C++ compiler,
2782 any Objective-C syntax that is not recognized by GCC 4.0 is rejected.
2783 This is useful if you need to make sure that your Objective-C code can
2784 be compiled with older versions of GCC@.
2786 @item -freplace-objc-classes
2787 @opindex freplace-objc-classes
2788 Emit a special marker instructing @command{ld(1)} not to statically link in
2789 the resulting object file, and allow @command{dyld(1)} to load it in at
2790 run time instead.  This is used in conjunction with the Fix-and-Continue
2791 debugging mode, where the object file in question may be recompiled and
2792 dynamically reloaded in the course of program execution, without the need
2793 to restart the program itself.  Currently, Fix-and-Continue functionality
2794 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
2795 and later.
2797 @item -fzero-link
2798 @opindex fzero-link
2799 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
2800 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
2801 compile time) with static class references that get initialized at load time,
2802 which improves run-time performance.  Specifying the @option{-fzero-link} flag
2803 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
2804 to be retained.  This is useful in Zero-Link debugging mode, since it allows
2805 for individual class implementations to be modified during program execution.
2806 The GNU runtime currently always retains calls to @code{objc_get_class("@dots{}")}
2807 regardless of command-line options.
2809 @item -gen-decls
2810 @opindex gen-decls
2811 Dump interface declarations for all classes seen in the source file to a
2812 file named @file{@var{sourcename}.decl}.
2814 @item -Wassign-intercept @r{(Objective-C and Objective-C++ only)}
2815 @opindex Wassign-intercept
2816 @opindex Wno-assign-intercept
2817 Warn whenever an Objective-C assignment is being intercepted by the
2818 garbage collector.
2820 @item -Wno-protocol @r{(Objective-C and Objective-C++ only)}
2821 @opindex Wno-protocol
2822 @opindex Wprotocol
2823 If a class is declared to implement a protocol, a warning is issued for
2824 every method in the protocol that is not implemented by the class.  The
2825 default behavior is to issue a warning for every method not explicitly
2826 implemented in the class, even if a method implementation is inherited
2827 from the superclass.  If you use the @option{-Wno-protocol} option, then
2828 methods inherited from the superclass are considered to be implemented,
2829 and no warning is issued for them.
2831 @item -Wselector @r{(Objective-C and Objective-C++ only)}
2832 @opindex Wselector
2833 @opindex Wno-selector
2834 Warn if multiple methods of different types for the same selector are
2835 found during compilation.  The check is performed on the list of methods
2836 in the final stage of compilation.  Additionally, a check is performed
2837 for each selector appearing in a @code{@@selector(@dots{})}
2838 expression, and a corresponding method for that selector has been found
2839 during compilation.  Because these checks scan the method table only at
2840 the end of compilation, these warnings are not produced if the final
2841 stage of compilation is not reached, for example because an error is
2842 found during compilation, or because the @option{-fsyntax-only} option is
2843 being used.
2845 @item -Wstrict-selector-match @r{(Objective-C and Objective-C++ only)}
2846 @opindex Wstrict-selector-match
2847 @opindex Wno-strict-selector-match
2848 Warn if multiple methods with differing argument and/or return types are
2849 found for a given selector when attempting to send a message using this
2850 selector to a receiver of type @code{id} or @code{Class}.  When this flag
2851 is off (which is the default behavior), the compiler omits such warnings
2852 if any differences found are confined to types that share the same size
2853 and alignment.
2855 @item -Wundeclared-selector @r{(Objective-C and Objective-C++ only)}
2856 @opindex Wundeclared-selector
2857 @opindex Wno-undeclared-selector
2858 Warn if a @code{@@selector(@dots{})} expression referring to an
2859 undeclared selector is found.  A selector is considered undeclared if no
2860 method with that name has been declared before the
2861 @code{@@selector(@dots{})} expression, either explicitly in an
2862 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
2863 an @code{@@implementation} section.  This option always performs its
2864 checks as soon as a @code{@@selector(@dots{})} expression is found,
2865 while @option{-Wselector} only performs its checks in the final stage of
2866 compilation.  This also enforces the coding style convention
2867 that methods and selectors must be declared before being used.
2869 @item -print-objc-runtime-info
2870 @opindex print-objc-runtime-info
2871 Generate C header describing the largest structure that is passed by
2872 value, if any.
2874 @end table
2876 @node Language Independent Options
2877 @section Options to Control Diagnostic Messages Formatting
2878 @cindex options to control diagnostics formatting
2879 @cindex diagnostic messages
2880 @cindex message formatting
2882 Traditionally, diagnostic messages have been formatted irrespective of
2883 the output device's aspect (e.g.@: its width, @dots{}).  You can use the
2884 options described below
2885 to control the formatting algorithm for diagnostic messages, 
2886 e.g.@: how many characters per line, how often source location
2887 information should be reported.  Note that some language front ends may not
2888 honor these options.
2890 @table @gcctabopt
2891 @item -fmessage-length=@var{n}
2892 @opindex fmessage-length
2893 Try to format error messages so that they fit on lines of about @var{n}
2894 characters.  The default is 72 characters for @command{g++} and 0 for the rest of
2895 the front ends supported by GCC@.  If @var{n} is zero, then no
2896 line-wrapping is done; each error message appears on a single
2897 line.
2899 @item -fdiagnostics-show-location=once
2900 @opindex fdiagnostics-show-location
2901 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
2902 reporter to emit source location information @emph{once}; that is, in
2903 case the message is too long to fit on a single physical line and has to
2904 be wrapped, the source location won't be emitted (as prefix) again,
2905 over and over, in subsequent continuation lines.  This is the default
2906 behavior.
2908 @item -fdiagnostics-show-location=every-line
2909 Only meaningful in line-wrapping mode.  Instructs the diagnostic
2910 messages reporter to emit the same source location information (as
2911 prefix) for physical lines that result from the process of breaking
2912 a message which is too long to fit on a single line.
2914 @item -fno-diagnostics-show-option
2915 @opindex fno-diagnostics-show-option
2916 @opindex fdiagnostics-show-option
2917 By default, each diagnostic emitted includes text indicating the
2918 command-line option that directly controls the diagnostic (if such an
2919 option is known to the diagnostic machinery).  Specifying the
2920 @option{-fno-diagnostics-show-option} flag suppresses that behavior.
2922 @item -fno-diagnostics-show-caret
2923 @opindex fno-diagnostics-show-caret
2924 @opindex fdiagnostics-show-caret
2925 By default, each diagnostic emitted includes the original source line
2926 and a caret '^' indicating the column.  This option suppresses this
2927 information.
2929 @end table
2931 @node Warning Options
2932 @section Options to Request or Suppress Warnings
2933 @cindex options to control warnings
2934 @cindex warning messages
2935 @cindex messages, warning
2936 @cindex suppressing warnings
2938 Warnings are diagnostic messages that report constructions that
2939 are not inherently erroneous but that are risky or suggest there
2940 may have been an error.
2942 The following language-independent options do not enable specific
2943 warnings but control the kinds of diagnostics produced by GCC@.
2945 @table @gcctabopt
2946 @cindex syntax checking
2947 @item -fsyntax-only
2948 @opindex fsyntax-only
2949 Check the code for syntax errors, but don't do anything beyond that.
2951 @item -fmax-errors=@var{n}
2952 @opindex fmax-errors
2953 Limits the maximum number of error messages to @var{n}, at which point
2954 GCC bails out rather than attempting to continue processing the source
2955 code.  If @var{n} is 0 (the default), there is no limit on the number
2956 of error messages produced.  If @option{-Wfatal-errors} is also
2957 specified, then @option{-Wfatal-errors} takes precedence over this
2958 option.
2960 @item -w
2961 @opindex w
2962 Inhibit all warning messages.
2964 @item -Werror
2965 @opindex Werror
2966 @opindex Wno-error
2967 Make all warnings into errors.
2969 @item -Werror=
2970 @opindex Werror=
2971 @opindex Wno-error=
2972 Make the specified warning into an error.  The specifier for a warning
2973 is appended; for example @option{-Werror=switch} turns the warnings
2974 controlled by @option{-Wswitch} into errors.  This switch takes a
2975 negative form, to be used to negate @option{-Werror} for specific
2976 warnings; for example @option{-Wno-error=switch} makes
2977 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
2978 is in effect.
2980 The warning message for each controllable warning includes the
2981 option that controls the warning.  That option can then be used with
2982 @option{-Werror=} and @option{-Wno-error=} as described above.
2983 (Printing of the option in the warning message can be disabled using the
2984 @option{-fno-diagnostics-show-option} flag.)
2986 Note that specifying @option{-Werror=}@var{foo} automatically implies
2987 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
2988 imply anything.
2990 @item -Wfatal-errors
2991 @opindex Wfatal-errors
2992 @opindex Wno-fatal-errors
2993 This option causes the compiler to abort compilation on the first error
2994 occurred rather than trying to keep going and printing further error
2995 messages.
2997 @end table
2999 You can request many specific warnings with options beginning with
3000 @samp{-W}, for example @option{-Wimplicit} to request warnings on
3001 implicit declarations.  Each of these specific warning options also
3002 has a negative form beginning @samp{-Wno-} to turn off warnings; for
3003 example, @option{-Wno-implicit}.  This manual lists only one of the
3004 two forms, whichever is not the default.  For further
3005 language-specific options also refer to @ref{C++ Dialect Options} and
3006 @ref{Objective-C and Objective-C++ Dialect Options}.
3008 When an unrecognized warning option is requested (e.g.,
3009 @option{-Wunknown-warning}), GCC emits a diagnostic stating
3010 that the option is not recognized.  However, if the @option{-Wno-} form
3011 is used, the behavior is slightly different: no diagnostic is
3012 produced for @option{-Wno-unknown-warning} unless other diagnostics
3013 are being produced.  This allows the use of new @option{-Wno-} options
3014 with old compilers, but if something goes wrong, the compiler
3015 warns that an unrecognized option is present.
3017 @table @gcctabopt
3018 @item -Wpedantic
3019 @itemx -pedantic
3020 @opindex pedantic
3021 @opindex Wpedantic
3022 Issue all the warnings demanded by strict ISO C and ISO C++;
3023 reject all programs that use forbidden extensions, and some other
3024 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
3025 version of the ISO C standard specified by any @option{-std} option used.
3027 Valid ISO C and ISO C++ programs should compile properly with or without
3028 this option (though a rare few require @option{-ansi} or a
3029 @option{-std} option specifying the required version of ISO C)@.  However,
3030 without this option, certain GNU extensions and traditional C and C++
3031 features are supported as well.  With this option, they are rejected.
3033 @option{-Wpedantic} does not cause warning messages for use of the
3034 alternate keywords whose names begin and end with @samp{__}.  Pedantic
3035 warnings are also disabled in the expression that follows
3036 @code{__extension__}.  However, only system header files should use
3037 these escape routes; application programs should avoid them.
3038 @xref{Alternate Keywords}.
3040 Some users try to use @option{-Wpedantic} to check programs for strict ISO
3041 C conformance.  They soon find that it does not do quite what they want:
3042 it finds some non-ISO practices, but not all---only those for which
3043 ISO C @emph{requires} a diagnostic, and some others for which
3044 diagnostics have been added.
3046 A feature to report any failure to conform to ISO C might be useful in
3047 some instances, but would require considerable additional work and would
3048 be quite different from @option{-Wpedantic}.  We don't have plans to
3049 support such a feature in the near future.
3051 Where the standard specified with @option{-std} represents a GNU
3052 extended dialect of C, such as @samp{gnu90} or @samp{gnu99}, there is a
3053 corresponding @dfn{base standard}, the version of ISO C on which the GNU
3054 extended dialect is based.  Warnings from @option{-Wpedantic} are given
3055 where they are required by the base standard.  (It does not make sense
3056 for such warnings to be given only for features not in the specified GNU
3057 C dialect, since by definition the GNU dialects of C include all
3058 features the compiler supports with the given option, and there would be
3059 nothing to warn about.)
3061 @item -pedantic-errors
3062 @opindex pedantic-errors
3063 Like @option{-Wpedantic}, except that errors are produced rather than
3064 warnings.
3066 @item -Wall
3067 @opindex Wall
3068 @opindex Wno-all
3069 This enables all the warnings about constructions that some users
3070 consider questionable, and that are easy to avoid (or modify to
3071 prevent the warning), even in conjunction with macros.  This also
3072 enables some language-specific warnings described in @ref{C++ Dialect
3073 Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
3075 @option{-Wall} turns on the following warning flags:
3077 @gccoptlist{-Waddress   @gol
3078 -Warray-bounds @r{(only with} @option{-O2}@r{)}  @gol
3079 -Wc++11-compat  @gol
3080 -Wchar-subscripts  @gol
3081 -Wenum-compare @r{(in C/ObjC; this is on by default in C++)} @gol
3082 -Wimplicit-int @r{(C and Objective-C only)} @gol
3083 -Wimplicit-function-declaration @r{(C and Objective-C only)} @gol
3084 -Wcomment  @gol
3085 -Wformat   @gol
3086 -Wmain @r{(only for C/ObjC and unless} @option{-ffreestanding}@r{)}  @gol
3087 -Wmaybe-uninitialized @gol
3088 -Wmissing-braces @r{(only for C/ObjC)} @gol
3089 -Wnonnull  @gol
3090 -Wparentheses  @gol
3091 -Wpointer-sign  @gol
3092 -Wreorder   @gol
3093 -Wreturn-type  @gol
3094 -Wsequence-point  @gol
3095 -Wsign-compare @r{(only in C++)}  @gol
3096 -Wstrict-aliasing  @gol
3097 -Wstrict-overflow=1  @gol
3098 -Wswitch  @gol
3099 -Wtrigraphs  @gol
3100 -Wuninitialized  @gol
3101 -Wunknown-pragmas  @gol
3102 -Wunused-function  @gol
3103 -Wunused-label     @gol
3104 -Wunused-value     @gol
3105 -Wunused-variable  @gol
3106 -Wvolatile-register-var @gol
3109 Note that some warning flags are not implied by @option{-Wall}.  Some of
3110 them warn about constructions that users generally do not consider
3111 questionable, but which occasionally you might wish to check for;
3112 others warn about constructions that are necessary or hard to avoid in
3113 some cases, and there is no simple way to modify the code to suppress
3114 the warning. Some of them are enabled by @option{-Wextra} but many of
3115 them must be enabled individually.
3117 @item -Wextra
3118 @opindex W
3119 @opindex Wextra
3120 @opindex Wno-extra
3121 This enables some extra warning flags that are not enabled by
3122 @option{-Wall}. (This option used to be called @option{-W}.  The older
3123 name is still supported, but the newer name is more descriptive.)
3125 @gccoptlist{-Wclobbered  @gol
3126 -Wempty-body  @gol
3127 -Wignored-qualifiers @gol
3128 -Wmissing-field-initializers  @gol
3129 -Wmissing-parameter-type @r{(C only)}  @gol
3130 -Wold-style-declaration @r{(C only)}  @gol
3131 -Woverride-init  @gol
3132 -Wsign-compare  @gol
3133 -Wtype-limits  @gol
3134 -Wuninitialized  @gol
3135 -Wunused-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)} @gol
3136 -Wunused-but-set-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)}  @gol
3139 The option @option{-Wextra} also prints warning messages for the
3140 following cases:
3142 @itemize @bullet
3144 @item
3145 A pointer is compared against integer zero with @samp{<}, @samp{<=},
3146 @samp{>}, or @samp{>=}.
3148 @item
3149 (C++ only) An enumerator and a non-enumerator both appear in a
3150 conditional expression.
3152 @item
3153 (C++ only) Ambiguous virtual bases.
3155 @item
3156 (C++ only) Subscripting an array that has been declared @samp{register}.
3158 @item
3159 (C++ only) Taking the address of a variable that has been declared
3160 @samp{register}.
3162 @item
3163 (C++ only) A base class is not initialized in a derived class's copy
3164 constructor.
3166 @end itemize
3168 @item -Wchar-subscripts
3169 @opindex Wchar-subscripts
3170 @opindex Wno-char-subscripts
3171 Warn if an array subscript has type @code{char}.  This is a common cause
3172 of error, as programmers often forget that this type is signed on some
3173 machines.
3174 This warning is enabled by @option{-Wall}.
3176 @item -Wcomment
3177 @opindex Wcomment
3178 @opindex Wno-comment
3179 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
3180 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
3181 This warning is enabled by @option{-Wall}.
3183 @item -Wno-coverage-mismatch
3184 @opindex Wno-coverage-mismatch
3185 Warn if feedback profiles do not match when using the
3186 @option{-fprofile-use} option.
3187 If a source file is changed between compiling with @option{-fprofile-gen} and
3188 with @option{-fprofile-use}, the files with the profile feedback can fail
3189 to match the source file and GCC cannot use the profile feedback
3190 information.  By default, this warning is enabled and is treated as an
3191 error.  @option{-Wno-coverage-mismatch} can be used to disable the
3192 warning or @option{-Wno-error=coverage-mismatch} can be used to
3193 disable the error.  Disabling the error for this warning can result in
3194 poorly optimized code and is useful only in the
3195 case of very minor changes such as bug fixes to an existing code-base.
3196 Completely disabling the warning is not recommended.
3198 @item -Wno-cpp
3199 @r{(C, Objective-C, C++, Objective-C++ and Fortran only)}
3201 Suppress warning messages emitted by @code{#warning} directives.
3203 @item -Wdouble-promotion @r{(C, C++, Objective-C and Objective-C++ only)}
3204 @opindex Wdouble-promotion
3205 @opindex Wno-double-promotion
3206 Give a warning when a value of type @code{float} is implicitly
3207 promoted to @code{double}.  CPUs with a 32-bit ``single-precision''
3208 floating-point unit implement @code{float} in hardware, but emulate
3209 @code{double} in software.  On such a machine, doing computations
3210 using @code{double} values is much more expensive because of the
3211 overhead required for software emulation.
3213 It is easy to accidentally do computations with @code{double} because
3214 floating-point literals are implicitly of type @code{double}.  For
3215 example, in:
3216 @smallexample
3217 @group
3218 float area(float radius)
3220    return 3.14159 * radius * radius;
3222 @end group
3223 @end smallexample
3224 the compiler performs the entire computation with @code{double}
3225 because the floating-point literal is a @code{double}.
3227 @item -Wformat
3228 @opindex Wformat
3229 @opindex Wno-format
3230 @opindex ffreestanding
3231 @opindex fno-builtin
3232 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
3233 the arguments supplied have types appropriate to the format string
3234 specified, and that the conversions specified in the format string make
3235 sense.  This includes standard functions, and others specified by format
3236 attributes (@pxref{Function Attributes}), in the @code{printf},
3237 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
3238 not in the C standard) families (or other target-specific families).
3239 Which functions are checked without format attributes having been
3240 specified depends on the standard version selected, and such checks of
3241 functions without the attribute specified are disabled by
3242 @option{-ffreestanding} or @option{-fno-builtin}.
3244 The formats are checked against the format features supported by GNU
3245 libc version 2.2.  These include all ISO C90 and C99 features, as well
3246 as features from the Single Unix Specification and some BSD and GNU
3247 extensions.  Other library implementations may not support all these
3248 features; GCC does not support warning about features that go beyond a
3249 particular library's limitations.  However, if @option{-Wpedantic} is used
3250 with @option{-Wformat}, warnings are given about format features not
3251 in the selected standard version (but not for @code{strfmon} formats,
3252 since those are not in any version of the C standard).  @xref{C Dialect
3253 Options,,Options Controlling C Dialect}.
3255 Since @option{-Wformat} also checks for null format arguments for
3256 several functions, @option{-Wformat} also implies @option{-Wnonnull}.
3258 @option{-Wformat} is included in @option{-Wall}.  For more control over some
3259 aspects of format checking, the options @option{-Wformat-y2k},
3260 @option{-Wno-format-extra-args}, @option{-Wno-format-zero-length},
3261 @option{-Wformat-nonliteral}, @option{-Wformat-security}, and
3262 @option{-Wformat=2} are available, but are not included in @option{-Wall}.
3264 @item -Wformat-y2k
3265 @opindex Wformat-y2k
3266 @opindex Wno-format-y2k
3267 If @option{-Wformat} is specified, also warn about @code{strftime}
3268 formats that may yield only a two-digit year.
3270 @item -Wno-format-contains-nul
3271 @opindex Wno-format-contains-nul
3272 @opindex Wformat-contains-nul
3273 If @option{-Wformat} is specified, do not warn about format strings that
3274 contain NUL bytes.
3276 @item -Wno-format-extra-args
3277 @opindex Wno-format-extra-args
3278 @opindex Wformat-extra-args
3279 If @option{-Wformat} is specified, do not warn about excess arguments to a
3280 @code{printf} or @code{scanf} format function.  The C standard specifies
3281 that such arguments are ignored.
3283 Where the unused arguments lie between used arguments that are
3284 specified with @samp{$} operand number specifications, normally
3285 warnings are still given, since the implementation could not know what
3286 type to pass to @code{va_arg} to skip the unused arguments.  However,
3287 in the case of @code{scanf} formats, this option suppresses the
3288 warning if the unused arguments are all pointers, since the Single
3289 Unix Specification says that such unused arguments are allowed.
3291 @item -Wno-format-zero-length
3292 @opindex Wno-format-zero-length
3293 @opindex Wformat-zero-length
3294 If @option{-Wformat} is specified, do not warn about zero-length formats.
3295 The C standard specifies that zero-length formats are allowed.
3297 @item -Wformat-nonliteral
3298 @opindex Wformat-nonliteral
3299 @opindex Wno-format-nonliteral
3300 If @option{-Wformat} is specified, also warn if the format string is not a
3301 string literal and so cannot be checked, unless the format function
3302 takes its format arguments as a @code{va_list}.
3304 @item -Wformat-security
3305 @opindex Wformat-security
3306 @opindex Wno-format-security
3307 If @option{-Wformat} is specified, also warn about uses of format
3308 functions that represent possible security problems.  At present, this
3309 warns about calls to @code{printf} and @code{scanf} functions where the
3310 format string is not a string literal and there are no format arguments,
3311 as in @code{printf (foo);}.  This may be a security hole if the format
3312 string came from untrusted input and contains @samp{%n}.  (This is
3313 currently a subset of what @option{-Wformat-nonliteral} warns about, but
3314 in future warnings may be added to @option{-Wformat-security} that are not
3315 included in @option{-Wformat-nonliteral}.)
3317 @item -Wformat=2
3318 @opindex Wformat=2
3319 @opindex Wno-format=2
3320 Enable @option{-Wformat} plus format checks not included in
3321 @option{-Wformat}.  Currently equivalent to @option{-Wformat
3322 -Wformat-nonliteral -Wformat-security -Wformat-y2k}.
3324 @item -Wnonnull
3325 @opindex Wnonnull
3326 @opindex Wno-nonnull
3327 Warn about passing a null pointer for arguments marked as
3328 requiring a non-null value by the @code{nonnull} function attribute.
3330 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
3331 can be disabled with the @option{-Wno-nonnull} option.
3333 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
3334 @opindex Winit-self
3335 @opindex Wno-init-self
3336 Warn about uninitialized variables that are initialized with themselves.
3337 Note this option can only be used with the @option{-Wuninitialized} option.
3339 For example, GCC warns about @code{i} being uninitialized in the
3340 following snippet only when @option{-Winit-self} has been specified:
3341 @smallexample
3342 @group
3343 int f()
3345   int i = i;
3346   return i;
3348 @end group
3349 @end smallexample
3351 @item -Wimplicit-int @r{(C and Objective-C only)}
3352 @opindex Wimplicit-int
3353 @opindex Wno-implicit-int
3354 Warn when a declaration does not specify a type.
3355 This warning is enabled by @option{-Wall}.
3357 @item -Wimplicit-function-declaration @r{(C and Objective-C only)}
3358 @opindex Wimplicit-function-declaration
3359 @opindex Wno-implicit-function-declaration
3360 Give a warning whenever a function is used before being declared. In
3361 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
3362 enabled by default and it is made into an error by
3363 @option{-pedantic-errors}. This warning is also enabled by
3364 @option{-Wall}.
3366 @item -Wimplicit @r{(C and Objective-C only)}
3367 @opindex Wimplicit
3368 @opindex Wno-implicit
3369 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
3370 This warning is enabled by @option{-Wall}.
3372 @item -Wignored-qualifiers @r{(C and C++ only)}
3373 @opindex Wignored-qualifiers
3374 @opindex Wno-ignored-qualifiers
3375 Warn if the return type of a function has a type qualifier
3376 such as @code{const}.  For ISO C such a type qualifier has no effect,
3377 since the value returned by a function is not an lvalue.
3378 For C++, the warning is only emitted for scalar types or @code{void}.
3379 ISO C prohibits qualified @code{void} return types on function
3380 definitions, so such return types always receive a warning
3381 even without this option.
3383 This warning is also enabled by @option{-Wextra}.
3385 @item -Wmain
3386 @opindex Wmain
3387 @opindex Wno-main
3388 Warn if the type of @samp{main} is suspicious.  @samp{main} should be
3389 a function with external linkage, returning int, taking either zero
3390 arguments, two, or three arguments of appropriate types.  This warning
3391 is enabled by default in C++ and is enabled by either @option{-Wall}
3392 or @option{-Wpedantic}.
3394 @item -Wmissing-braces
3395 @opindex Wmissing-braces
3396 @opindex Wno-missing-braces
3397 Warn if an aggregate or union initializer is not fully bracketed.  In
3398 the following example, the initializer for @samp{a} is not fully
3399 bracketed, but that for @samp{b} is fully bracketed.  This warning is
3400 enabled by @option{-Wall} in C.
3402 @smallexample
3403 int a[2][2] = @{ 0, 1, 2, 3 @};
3404 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
3405 @end smallexample
3407 This warning is enabled by @option{-Wall}.
3409 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
3410 @opindex Wmissing-include-dirs
3411 @opindex Wno-missing-include-dirs
3412 Warn if a user-supplied include directory does not exist.
3414 @item -Wparentheses
3415 @opindex Wparentheses
3416 @opindex Wno-parentheses
3417 Warn if parentheses are omitted in certain contexts, such
3418 as when there is an assignment in a context where a truth value
3419 is expected, or when operators are nested whose precedence people
3420 often get confused about.
3422 Also warn if a comparison like @samp{x<=y<=z} appears; this is
3423 equivalent to @samp{(x<=y ? 1 : 0) <= z}, which is a different
3424 interpretation from that of ordinary mathematical notation.
3426 Also warn about constructions where there may be confusion to which
3427 @code{if} statement an @code{else} branch belongs.  Here is an example of
3428 such a case:
3430 @smallexample
3431 @group
3433   if (a)
3434     if (b)
3435       foo ();
3436   else
3437     bar ();
3439 @end group
3440 @end smallexample
3442 In C/C++, every @code{else} branch belongs to the innermost possible
3443 @code{if} statement, which in this example is @code{if (b)}.  This is
3444 often not what the programmer expected, as illustrated in the above
3445 example by indentation the programmer chose.  When there is the
3446 potential for this confusion, GCC issues a warning when this flag
3447 is specified.  To eliminate the warning, add explicit braces around
3448 the innermost @code{if} statement so there is no way the @code{else}
3449 can belong to the enclosing @code{if}.  The resulting code
3450 looks like this:
3452 @smallexample
3453 @group
3455   if (a)
3456     @{
3457       if (b)
3458         foo ();
3459       else
3460         bar ();
3461     @}
3463 @end group
3464 @end smallexample
3466 Also warn for dangerous uses of the GNU extension to
3467 @code{?:} with omitted middle operand. When the condition
3468 in the @code{?}: operator is a boolean expression, the omitted value is
3469 always 1.  Often programmers expect it to be a value computed
3470 inside the conditional expression instead.
3472 This warning is enabled by @option{-Wall}.
3474 @item -Wsequence-point
3475 @opindex Wsequence-point
3476 @opindex Wno-sequence-point
3477 Warn about code that may have undefined semantics because of violations
3478 of sequence point rules in the C and C++ standards.
3480 The C and C++ standards define the order in which expressions in a C/C++
3481 program are evaluated in terms of @dfn{sequence points}, which represent
3482 a partial ordering between the execution of parts of the program: those
3483 executed before the sequence point, and those executed after it.  These
3484 occur after the evaluation of a full expression (one which is not part
3485 of a larger expression), after the evaluation of the first operand of a
3486 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
3487 function is called (but after the evaluation of its arguments and the
3488 expression denoting the called function), and in certain other places.
3489 Other than as expressed by the sequence point rules, the order of
3490 evaluation of subexpressions of an expression is not specified.  All
3491 these rules describe only a partial order rather than a total order,
3492 since, for example, if two functions are called within one expression
3493 with no sequence point between them, the order in which the functions
3494 are called is not specified.  However, the standards committee have
3495 ruled that function calls do not overlap.
3497 It is not specified when between sequence points modifications to the
3498 values of objects take effect.  Programs whose behavior depends on this
3499 have undefined behavior; the C and C++ standards specify that ``Between
3500 the previous and next sequence point an object shall have its stored
3501 value modified at most once by the evaluation of an expression.
3502 Furthermore, the prior value shall be read only to determine the value
3503 to be stored.''.  If a program breaks these rules, the results on any
3504 particular implementation are entirely unpredictable.
3506 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
3507 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
3508 diagnosed by this option, and it may give an occasional false positive
3509 result, but in general it has been found fairly effective at detecting
3510 this sort of problem in programs.
3512 The standard is worded confusingly, therefore there is some debate
3513 over the precise meaning of the sequence point rules in subtle cases.
3514 Links to discussions of the problem, including proposed formal
3515 definitions, may be found on the GCC readings page, at
3516 @uref{http://gcc.gnu.org/@/readings.html}.
3518 This warning is enabled by @option{-Wall} for C and C++.
3520 @item -Wreturn-type
3521 @opindex Wreturn-type
3522 @opindex Wno-return-type
3523 Warn whenever a function is defined with a return type that defaults
3524 to @code{int}.  Also warn about any @code{return} statement with no
3525 return value in a function whose return type is not @code{void}
3526 (falling off the end of the function body is considered returning
3527 without a value), and about a @code{return} statement with an
3528 expression in a function whose return type is @code{void}.
3530 For C++, a function without return type always produces a diagnostic
3531 message, even when @option{-Wno-return-type} is specified.  The only
3532 exceptions are @samp{main} and functions defined in system headers.
3534 This warning is enabled by @option{-Wall}.
3536 @item -Wswitch
3537 @opindex Wswitch
3538 @opindex Wno-switch
3539 Warn whenever a @code{switch} statement has an index of enumerated type
3540 and lacks a @code{case} for one or more of the named codes of that
3541 enumeration.  (The presence of a @code{default} label prevents this
3542 warning.)  @code{case} labels outside the enumeration range also
3543 provoke warnings when this option is used (even if there is a
3544 @code{default} label).
3545 This warning is enabled by @option{-Wall}.
3547 @item -Wswitch-default
3548 @opindex Wswitch-default
3549 @opindex Wno-switch-default
3550 Warn whenever a @code{switch} statement does not have a @code{default}
3551 case.
3553 @item -Wswitch-enum
3554 @opindex Wswitch-enum
3555 @opindex Wno-switch-enum
3556 Warn whenever a @code{switch} statement has an index of enumerated type
3557 and lacks a @code{case} for one or more of the named codes of that
3558 enumeration.  @code{case} labels outside the enumeration range also
3559 provoke warnings when this option is used.  The only difference
3560 between @option{-Wswitch} and this option is that this option gives a
3561 warning about an omitted enumeration code even if there is a
3562 @code{default} label.
3564 @item -Wsync-nand @r{(C and C++ only)}
3565 @opindex Wsync-nand
3566 @opindex Wno-sync-nand
3567 Warn when @code{__sync_fetch_and_nand} and @code{__sync_nand_and_fetch}
3568 built-in functions are used.  These functions changed semantics in GCC 4.4.
3570 @item -Wtrigraphs
3571 @opindex Wtrigraphs
3572 @opindex Wno-trigraphs
3573 Warn if any trigraphs are encountered that might change the meaning of
3574 the program (trigraphs within comments are not warned about).
3575 This warning is enabled by @option{-Wall}.
3577 @item -Wunused-but-set-parameter
3578 @opindex Wunused-but-set-parameter
3579 @opindex Wno-unused-but-set-parameter
3580 Warn whenever a function parameter is assigned to, but otherwise unused
3581 (aside from its declaration).
3583 To suppress this warning use the @samp{unused} attribute
3584 (@pxref{Variable Attributes}).
3586 This warning is also enabled by @option{-Wunused} together with
3587 @option{-Wextra}.
3589 @item -Wunused-but-set-variable
3590 @opindex Wunused-but-set-variable
3591 @opindex Wno-unused-but-set-variable
3592 Warn whenever a local variable is assigned to, but otherwise unused
3593 (aside from its declaration).
3594 This warning is enabled by @option{-Wall}.
3596 To suppress this warning use the @samp{unused} attribute
3597 (@pxref{Variable Attributes}).
3599 This warning is also enabled by @option{-Wunused}, which is enabled
3600 by @option{-Wall}.
3602 @item -Wunused-function
3603 @opindex Wunused-function
3604 @opindex Wno-unused-function
3605 Warn whenever a static function is declared but not defined or a
3606 non-inline static function is unused.
3607 This warning is enabled by @option{-Wall}.
3609 @item -Wunused-label
3610 @opindex Wunused-label
3611 @opindex Wno-unused-label
3612 Warn whenever a label is declared but not used.
3613 This warning is enabled by @option{-Wall}.
3615 To suppress this warning use the @samp{unused} attribute
3616 (@pxref{Variable Attributes}).
3618 @item -Wunused-local-typedefs @r{(C, Objective-C, C++ and Objective-C++ only)}
3619 @opindex Wunused-local-typedefs
3620 Warn when a typedef locally defined in a function is not used.
3621 This warning is enabled by @option{-Wall}.
3623 @item -Wunused-parameter
3624 @opindex Wunused-parameter
3625 @opindex Wno-unused-parameter
3626 Warn whenever a function parameter is unused aside from its declaration.
3628 To suppress this warning use the @samp{unused} attribute
3629 (@pxref{Variable Attributes}).
3631 @item -Wno-unused-result
3632 @opindex Wunused-result
3633 @opindex Wno-unused-result
3634 Do not warn if a caller of a function marked with attribute
3635 @code{warn_unused_result} (@pxref{Function Attributes}) does not use
3636 its return value. The default is @option{-Wunused-result}.
3638 @item -Wunused-variable
3639 @opindex Wunused-variable
3640 @opindex Wno-unused-variable
3641 Warn whenever a local variable or non-constant static variable is unused
3642 aside from its declaration.
3643 This warning is enabled by @option{-Wall}.
3645 To suppress this warning use the @samp{unused} attribute
3646 (@pxref{Variable Attributes}).
3648 @item -Wunused-value
3649 @opindex Wunused-value
3650 @opindex Wno-unused-value
3651 Warn whenever a statement computes a result that is explicitly not
3652 used. To suppress this warning cast the unused expression to
3653 @samp{void}. This includes an expression-statement or the left-hand
3654 side of a comma expression that contains no side effects. For example,
3655 an expression such as @samp{x[i,j]} causes a warning, while
3656 @samp{x[(void)i,j]} does not.
3658 This warning is enabled by @option{-Wall}.
3660 @item -Wunused
3661 @opindex Wunused
3662 @opindex Wno-unused
3663 All the above @option{-Wunused} options combined.
3665 In order to get a warning about an unused function parameter, you must
3666 either specify @option{-Wextra -Wunused} (note that @option{-Wall} implies
3667 @option{-Wunused}), or separately specify @option{-Wunused-parameter}.
3669 @item -Wuninitialized
3670 @opindex Wuninitialized
3671 @opindex Wno-uninitialized
3672 Warn if an automatic variable is used without first being initialized
3673 or if a variable may be clobbered by a @code{setjmp} call. In C++,
3674 warn if a non-static reference or non-static @samp{const} member
3675 appears in a class without constructors.
3677 If you want to warn about code that uses the uninitialized value of the
3678 variable in its own initializer, use the @option{-Winit-self} option.
3680 These warnings occur for individual uninitialized or clobbered
3681 elements of structure, union or array variables as well as for
3682 variables that are uninitialized or clobbered as a whole.  They do
3683 not occur for variables or elements declared @code{volatile}.  Because
3684 these warnings depend on optimization, the exact variables or elements
3685 for which there are warnings depends on the precise optimization
3686 options and version of GCC used.
3688 Note that there may be no warning about a variable that is used only
3689 to compute a value that itself is never used, because such
3690 computations may be deleted by data flow analysis before the warnings
3691 are printed.
3693 @item -Wmaybe-uninitialized
3694 @opindex Wmaybe-uninitialized
3695 @opindex Wno-maybe-uninitialized
3696 For an automatic variable, if there exists a path from the function
3697 entry to a use of the variable that is initialized, but there exist
3698 some other paths for which the variable is not initialized, the compiler
3699 emits a warning if it cannot prove the uninitialized paths are not
3700 executed at run time. These warnings are made optional because GCC is
3701 not smart enough to see all the reasons why the code might be correct
3702 in spite of appearing to have an error.  Here is one example of how
3703 this can happen:
3705 @smallexample
3706 @group
3708   int x;
3709   switch (y)
3710     @{
3711     case 1: x = 1;
3712       break;
3713     case 2: x = 4;
3714       break;
3715     case 3: x = 5;
3716     @}
3717   foo (x);
3719 @end group
3720 @end smallexample
3722 @noindent
3723 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
3724 always initialized, but GCC doesn't know this. To suppress the
3725 warning, you need to provide a default case with assert(0) or
3726 similar code.
3728 @cindex @code{longjmp} warnings
3729 This option also warns when a non-volatile automatic variable might be
3730 changed by a call to @code{longjmp}.  These warnings as well are possible
3731 only in optimizing compilation.
3733 The compiler sees only the calls to @code{setjmp}.  It cannot know
3734 where @code{longjmp} will be called; in fact, a signal handler could
3735 call it at any point in the code.  As a result, you may get a warning
3736 even when there is in fact no problem because @code{longjmp} cannot
3737 in fact be called at the place that would cause a problem.
3739 Some spurious warnings can be avoided if you declare all the functions
3740 you use that never return as @code{noreturn}.  @xref{Function
3741 Attributes}.
3743 This warning is enabled by @option{-Wall} or @option{-Wextra}.
3745 @item -Wunknown-pragmas
3746 @opindex Wunknown-pragmas
3747 @opindex Wno-unknown-pragmas
3748 @cindex warning for unknown pragmas
3749 @cindex unknown pragmas, warning
3750 @cindex pragmas, warning of unknown
3751 Warn when a @code{#pragma} directive is encountered that is not understood by 
3752 GCC@.  If this command-line option is used, warnings are even issued
3753 for unknown pragmas in system header files.  This is not the case if
3754 the warnings are only enabled by the @option{-Wall} command-line option.
3756 @item -Wno-pragmas
3757 @opindex Wno-pragmas
3758 @opindex Wpragmas
3759 Do not warn about misuses of pragmas, such as incorrect parameters,
3760 invalid syntax, or conflicts between pragmas.  See also
3761 @option{-Wunknown-pragmas}.
3763 @item -Wstrict-aliasing
3764 @opindex Wstrict-aliasing
3765 @opindex Wno-strict-aliasing
3766 This option is only active when @option{-fstrict-aliasing} is active.
3767 It warns about code that might break the strict aliasing rules that the
3768 compiler is using for optimization.  The warning does not catch all
3769 cases, but does attempt to catch the more common pitfalls.  It is
3770 included in @option{-Wall}.
3771 It is equivalent to @option{-Wstrict-aliasing=3}
3773 @item -Wstrict-aliasing=n
3774 @opindex Wstrict-aliasing=n
3775 @opindex Wno-strict-aliasing=n
3776 This option is only active when @option{-fstrict-aliasing} is active.
3777 It warns about code that might break the strict aliasing rules that the
3778 compiler is using for optimization.
3779 Higher levels correspond to higher accuracy (fewer false positives).
3780 Higher levels also correspond to more effort, similar to the way @option{-O} 
3781 works.
3782 @option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=3}.
3784 Level 1: Most aggressive, quick, least accurate.
3785 Possibly useful when higher levels
3786 do not warn but @option{-fstrict-aliasing} still breaks the code, as it has very few
3787 false negatives.  However, it has many false positives.
3788 Warns for all pointer conversions between possibly incompatible types,
3789 even if never dereferenced.  Runs in the front end only.
3791 Level 2: Aggressive, quick, not too precise.
3792 May still have many false positives (not as many as level 1 though),
3793 and few false negatives (but possibly more than level 1).
3794 Unlike level 1, it only warns when an address is taken.  Warns about
3795 incomplete types.  Runs in the front end only.
3797 Level 3 (default for @option{-Wstrict-aliasing}):
3798 Should have very few false positives and few false
3799 negatives.  Slightly slower than levels 1 or 2 when optimization is enabled.
3800 Takes care of the common pun+dereference pattern in the front end:
3801 @code{*(int*)&some_float}.
3802 If optimization is enabled, it also runs in the back end, where it deals
3803 with multiple statement cases using flow-sensitive points-to information.
3804 Only warns when the converted pointer is dereferenced.
3805 Does not warn about incomplete types.
3807 @item -Wstrict-overflow
3808 @itemx -Wstrict-overflow=@var{n}
3809 @opindex Wstrict-overflow
3810 @opindex Wno-strict-overflow
3811 This option is only active when @option{-fstrict-overflow} is active.
3812 It warns about cases where the compiler optimizes based on the
3813 assumption that signed overflow does not occur.  Note that it does not
3814 warn about all cases where the code might overflow: it only warns
3815 about cases where the compiler implements some optimization.  Thus
3816 this warning depends on the optimization level.
3818 An optimization that assumes that signed overflow does not occur is
3819 perfectly safe if the values of the variables involved are such that
3820 overflow never does, in fact, occur.  Therefore this warning can
3821 easily give a false positive: a warning about code that is not
3822 actually a problem.  To help focus on important issues, several
3823 warning levels are defined.  No warnings are issued for the use of
3824 undefined signed overflow when estimating how many iterations a loop
3825 requires, in particular when determining whether a loop will be
3826 executed at all.
3828 @table @gcctabopt
3829 @item -Wstrict-overflow=1
3830 Warn about cases that are both questionable and easy to avoid.  For
3831 example,  with @option{-fstrict-overflow}, the compiler simplifies
3832 @code{x + 1 > x} to @code{1}.  This level of
3833 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
3834 are not, and must be explicitly requested.
3836 @item -Wstrict-overflow=2
3837 Also warn about other cases where a comparison is simplified to a
3838 constant.  For example: @code{abs (x) >= 0}.  This can only be
3839 simplified when @option{-fstrict-overflow} is in effect, because
3840 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
3841 zero.  @option{-Wstrict-overflow} (with no level) is the same as
3842 @option{-Wstrict-overflow=2}.
3844 @item -Wstrict-overflow=3
3845 Also warn about other cases where a comparison is simplified.  For
3846 example: @code{x + 1 > 1} is simplified to @code{x > 0}.
3848 @item -Wstrict-overflow=4
3849 Also warn about other simplifications not covered by the above cases.
3850 For example: @code{(x * 10) / 5} is simplified to @code{x * 2}.
3852 @item -Wstrict-overflow=5
3853 Also warn about cases where the compiler reduces the magnitude of a
3854 constant involved in a comparison.  For example: @code{x + 2 > y} is
3855 simplified to @code{x + 1 >= y}.  This is reported only at the
3856 highest warning level because this simplification applies to many
3857 comparisons, so this warning level gives a very large number of
3858 false positives.
3859 @end table
3861 @item -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{]}
3862 @opindex Wsuggest-attribute=
3863 @opindex Wno-suggest-attribute=
3864 Warn for cases where adding an attribute may be beneficial. The
3865 attributes currently supported are listed below.
3867 @table @gcctabopt
3868 @item -Wsuggest-attribute=pure
3869 @itemx -Wsuggest-attribute=const
3870 @itemx -Wsuggest-attribute=noreturn
3871 @opindex Wsuggest-attribute=pure
3872 @opindex Wno-suggest-attribute=pure
3873 @opindex Wsuggest-attribute=const
3874 @opindex Wno-suggest-attribute=const
3875 @opindex Wsuggest-attribute=noreturn
3876 @opindex Wno-suggest-attribute=noreturn
3878 Warn about functions that might be candidates for attributes
3879 @code{pure}, @code{const} or @code{noreturn}.  The compiler only warns for
3880 functions visible in other compilation units or (in the case of @code{pure} and
3881 @code{const}) if it cannot prove that the function returns normally. A function
3882 returns normally if it doesn't contain an infinite loop or return abnormally
3883 by throwing, calling @code{abort()} or trapping.  This analysis requires option
3884 @option{-fipa-pure-const}, which is enabled by default at @option{-O} and
3885 higher.  Higher optimization levels improve the accuracy of the analysis.
3887 @item -Wsuggest-attribute=format
3888 @itemx -Wmissing-format-attribute
3889 @opindex Wsuggest-attribute=format
3890 @opindex Wmissing-format-attribute
3891 @opindex Wno-suggest-attribute=format
3892 @opindex Wno-missing-format-attribute
3893 @opindex Wformat
3894 @opindex Wno-format
3896 Warn about function pointers that might be candidates for @code{format}
3897 attributes.  Note these are only possible candidates, not absolute ones.
3898 GCC guesses that function pointers with @code{format} attributes that
3899 are used in assignment, initialization, parameter passing or return
3900 statements should have a corresponding @code{format} attribute in the
3901 resulting type.  I.e.@: the left-hand side of the assignment or
3902 initialization, the type of the parameter variable, or the return type
3903 of the containing function respectively should also have a @code{format}
3904 attribute to avoid the warning.
3906 GCC also warns about function definitions that might be
3907 candidates for @code{format} attributes.  Again, these are only
3908 possible candidates.  GCC guesses that @code{format} attributes
3909 might be appropriate for any function that calls a function like
3910 @code{vprintf} or @code{vscanf}, but this might not always be the
3911 case, and some functions for which @code{format} attributes are
3912 appropriate may not be detected.
3913 @end table
3915 @item -Warray-bounds
3916 @opindex Wno-array-bounds
3917 @opindex Warray-bounds
3918 This option is only active when @option{-ftree-vrp} is active
3919 (default for @option{-O2} and above). It warns about subscripts to arrays
3920 that are always out of bounds. This warning is enabled by @option{-Wall}.
3922 @item -Wno-div-by-zero
3923 @opindex Wno-div-by-zero
3924 @opindex Wdiv-by-zero
3925 Do not warn about compile-time integer division by zero.  Floating-point
3926 division by zero is not warned about, as it can be a legitimate way of
3927 obtaining infinities and NaNs.
3929 @item -Wsystem-headers
3930 @opindex Wsystem-headers
3931 @opindex Wno-system-headers
3932 @cindex warnings from system headers
3933 @cindex system headers, warnings from
3934 Print warning messages for constructs found in system header files.
3935 Warnings from system headers are normally suppressed, on the assumption
3936 that they usually do not indicate real problems and would only make the
3937 compiler output harder to read.  Using this command-line option tells
3938 GCC to emit warnings from system headers as if they occurred in user
3939 code.  However, note that using @option{-Wall} in conjunction with this
3940 option does @emph{not} warn about unknown pragmas in system
3941 headers---for that, @option{-Wunknown-pragmas} must also be used.
3943 @item -Wtrampolines
3944 @opindex Wtrampolines
3945 @opindex Wno-trampolines
3946  Warn about trampolines generated for pointers to nested functions.
3948  A trampoline is a small piece of data or code that is created at run
3949  time on the stack when the address of a nested function is taken, and
3950  is used to call the nested function indirectly.  For some targets, it
3951  is made up of data only and thus requires no special treatment.  But,
3952  for most targets, it is made up of code and thus requires the stack
3953  to be made executable in order for the program to work properly.
3955 @item -Wfloat-equal
3956 @opindex Wfloat-equal
3957 @opindex Wno-float-equal
3958 Warn if floating-point values are used in equality comparisons.
3960 The idea behind this is that sometimes it is convenient (for the
3961 programmer) to consider floating-point values as approximations to
3962 infinitely precise real numbers.  If you are doing this, then you need
3963 to compute (by analyzing the code, or in some other way) the maximum or
3964 likely maximum error that the computation introduces, and allow for it
3965 when performing comparisons (and when producing output, but that's a
3966 different problem).  In particular, instead of testing for equality, you
3967 should check to see whether the two values have ranges that overlap; and
3968 this is done with the relational operators, so equality comparisons are
3969 probably mistaken.
3971 @item -Wtraditional @r{(C and Objective-C only)}
3972 @opindex Wtraditional
3973 @opindex Wno-traditional
3974 Warn about certain constructs that behave differently in traditional and
3975 ISO C@.  Also warn about ISO C constructs that have no traditional C
3976 equivalent, and/or problematic constructs that should be avoided.
3978 @itemize @bullet
3979 @item
3980 Macro parameters that appear within string literals in the macro body.
3981 In traditional C macro replacement takes place within string literals,
3982 but in ISO C it does not.
3984 @item
3985 In traditional C, some preprocessor directives did not exist.
3986 Traditional preprocessors only considered a line to be a directive
3987 if the @samp{#} appeared in column 1 on the line.  Therefore
3988 @option{-Wtraditional} warns about directives that traditional C
3989 understands but ignores because the @samp{#} does not appear as the
3990 first character on the line.  It also suggests you hide directives like
3991 @samp{#pragma} not understood by traditional C by indenting them.  Some
3992 traditional implementations do not recognize @samp{#elif}, so this option
3993 suggests avoiding it altogether.
3995 @item
3996 A function-like macro that appears without arguments.
3998 @item
3999 The unary plus operator.
4001 @item
4002 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating-point
4003 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
4004 constants.)  Note, these suffixes appear in macros defined in the system
4005 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
4006 Use of these macros in user code might normally lead to spurious
4007 warnings, however GCC's integrated preprocessor has enough context to
4008 avoid warning in these cases.
4010 @item
4011 A function declared external in one block and then used after the end of
4012 the block.
4014 @item
4015 A @code{switch} statement has an operand of type @code{long}.
4017 @item
4018 A non-@code{static} function declaration follows a @code{static} one.
4019 This construct is not accepted by some traditional C compilers.
4021 @item
4022 The ISO type of an integer constant has a different width or
4023 signedness from its traditional type.  This warning is only issued if
4024 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
4025 typically represent bit patterns, are not warned about.
4027 @item
4028 Usage of ISO string concatenation is detected.
4030 @item
4031 Initialization of automatic aggregates.
4033 @item
4034 Identifier conflicts with labels.  Traditional C lacks a separate
4035 namespace for labels.
4037 @item
4038 Initialization of unions.  If the initializer is zero, the warning is
4039 omitted.  This is done under the assumption that the zero initializer in
4040 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
4041 initializer warnings and relies on default initialization to zero in the
4042 traditional C case.
4044 @item
4045 Conversions by prototypes between fixed/floating-point values and vice
4046 versa.  The absence of these prototypes when compiling with traditional
4047 C causes serious problems.  This is a subset of the possible
4048 conversion warnings; for the full set use @option{-Wtraditional-conversion}.
4050 @item
4051 Use of ISO C style function definitions.  This warning intentionally is
4052 @emph{not} issued for prototype declarations or variadic functions
4053 because these ISO C features appear in your code when using
4054 libiberty's traditional C compatibility macros, @code{PARAMS} and
4055 @code{VPARAMS}.  This warning is also bypassed for nested functions
4056 because that feature is already a GCC extension and thus not relevant to
4057 traditional C compatibility.
4058 @end itemize
4060 @item -Wtraditional-conversion @r{(C and Objective-C only)}
4061 @opindex Wtraditional-conversion
4062 @opindex Wno-traditional-conversion
4063 Warn if a prototype causes a type conversion that is different from what
4064 would happen to the same argument in the absence of a prototype.  This
4065 includes conversions of fixed point to floating and vice versa, and
4066 conversions changing the width or signedness of a fixed-point argument
4067 except when the same as the default promotion.
4069 @item -Wdeclaration-after-statement @r{(C and Objective-C only)}
4070 @opindex Wdeclaration-after-statement
4071 @opindex Wno-declaration-after-statement
4072 Warn when a declaration is found after a statement in a block.  This
4073 construct, known from C++, was introduced with ISO C99 and is by default
4074 allowed in GCC@.  It is not supported by ISO C90 and was not supported by
4075 GCC versions before GCC 3.0.  @xref{Mixed Declarations}.
4077 @item -Wundef
4078 @opindex Wundef
4079 @opindex Wno-undef
4080 Warn if an undefined identifier is evaluated in an @samp{#if} directive.
4082 @item -Wno-endif-labels
4083 @opindex Wno-endif-labels
4084 @opindex Wendif-labels
4085 Do not warn whenever an @samp{#else} or an @samp{#endif} are followed by text.
4087 @item -Wshadow
4088 @opindex Wshadow
4089 @opindex Wno-shadow
4090 Warn whenever a local variable or type declaration shadows another variable,
4091 parameter, type, or class member (in C++), or whenever a built-in function
4092 is shadowed. Note that in C++, the compiler warns if a local variable
4093 shadows an explicit typedef, but not if it shadows a struct/class/enum.
4095 @item -Wlarger-than=@var{len}
4096 @opindex Wlarger-than=@var{len}
4097 @opindex Wlarger-than-@var{len}
4098 Warn whenever an object of larger than @var{len} bytes is defined.
4100 @item -Wframe-larger-than=@var{len}
4101 @opindex Wframe-larger-than
4102 Warn if the size of a function frame is larger than @var{len} bytes.
4103 The computation done to determine the stack frame size is approximate
4104 and not conservative.
4105 The actual requirements may be somewhat greater than @var{len}
4106 even if you do not get a warning.  In addition, any space allocated
4107 via @code{alloca}, variable-length arrays, or related constructs
4108 is not included by the compiler when determining
4109 whether or not to issue a warning.
4111 @item -Wno-free-nonheap-object
4112 @opindex Wno-free-nonheap-object
4113 @opindex Wfree-nonheap-object
4114 Do not warn when attempting to free an object that was not allocated
4115 on the heap.
4117 @item -Wstack-usage=@var{len}
4118 @opindex Wstack-usage
4119 Warn if the stack usage of a function might be larger than @var{len} bytes.
4120 The computation done to determine the stack usage is conservative.
4121 Any space allocated via @code{alloca}, variable-length arrays, or related
4122 constructs is included by the compiler when determining whether or not to
4123 issue a warning.
4125 The message is in keeping with the output of @option{-fstack-usage}.
4127 @itemize
4128 @item
4129 If the stack usage is fully static but exceeds the specified amount, it's:
4131 @smallexample
4132   warning: stack usage is 1120 bytes
4133 @end smallexample
4134 @item
4135 If the stack usage is (partly) dynamic but bounded, it's:
4137 @smallexample
4138   warning: stack usage might be 1648 bytes
4139 @end smallexample
4140 @item
4141 If the stack usage is (partly) dynamic and not bounded, it's:
4143 @smallexample
4144   warning: stack usage might be unbounded
4145 @end smallexample
4146 @end itemize
4148 @item -Wunsafe-loop-optimizations
4149 @opindex Wunsafe-loop-optimizations
4150 @opindex Wno-unsafe-loop-optimizations
4151 Warn if the loop cannot be optimized because the compiler cannot
4152 assume anything on the bounds of the loop indices.  With
4153 @option{-funsafe-loop-optimizations} warn if the compiler makes
4154 such assumptions.
4156 @item -Wno-pedantic-ms-format @r{(MinGW targets only)}
4157 @opindex Wno-pedantic-ms-format
4158 @opindex Wpedantic-ms-format
4159 When used in combination with @option{-Wformat}
4160 and @option{-pedantic} without GNU extensions, this option
4161 disables the warnings about non-ISO @code{printf} / @code{scanf} format
4162 width specifiers @code{I32}, @code{I64}, and @code{I} used on Windows targets,
4163 which depend on the MS runtime.
4165 @item -Wpointer-arith
4166 @opindex Wpointer-arith
4167 @opindex Wno-pointer-arith
4168 Warn about anything that depends on the ``size of'' a function type or
4169 of @code{void}.  GNU C assigns these types a size of 1, for
4170 convenience in calculations with @code{void *} pointers and pointers
4171 to functions.  In C++, warn also when an arithmetic operation involves
4172 @code{NULL}.  This warning is also enabled by @option{-Wpedantic}.
4174 @item -Wtype-limits
4175 @opindex Wtype-limits
4176 @opindex Wno-type-limits
4177 Warn if a comparison is always true or always false due to the limited
4178 range of the data type, but do not warn for constant expressions.  For
4179 example, warn if an unsigned variable is compared against zero with
4180 @samp{<} or @samp{>=}.  This warning is also enabled by
4181 @option{-Wextra}.
4183 @item -Wbad-function-cast @r{(C and Objective-C only)}
4184 @opindex Wbad-function-cast
4185 @opindex Wno-bad-function-cast
4186 Warn whenever a function call is cast to a non-matching type.
4187 For example, warn if @code{int malloc()} is cast to @code{anything *}.
4189 @item -Wc++-compat @r{(C and Objective-C only)}
4190 Warn about ISO C constructs that are outside of the common subset of
4191 ISO C and ISO C++, e.g.@: request for implicit conversion from
4192 @code{void *} to a pointer to non-@code{void} type.
4194 @item -Wc++11-compat @r{(C++ and Objective-C++ only)}
4195 Warn about C++ constructs whose meaning differs between ISO C++ 1998
4196 and ISO C++ 2011, e.g., identifiers in ISO C++ 1998 that are keywords
4197 in ISO C++ 2011.  This warning turns on @option{-Wnarrowing} and is
4198 enabled by @option{-Wall}.
4200 @item -Wcast-qual
4201 @opindex Wcast-qual
4202 @opindex Wno-cast-qual
4203 Warn whenever a pointer is cast so as to remove a type qualifier from
4204 the target type.  For example, warn if a @code{const char *} is cast
4205 to an ordinary @code{char *}.
4207 Also warn when making a cast that introduces a type qualifier in an
4208 unsafe way.  For example, casting @code{char **} to @code{const char **}
4209 is unsafe, as in this example:
4211 @smallexample
4212   /* p is char ** value.  */
4213   const char **q = (const char **) p;
4214   /* Assignment of readonly string to const char * is OK.  */
4215   *q = "string";
4216   /* Now char** pointer points to read-only memory.  */
4217   **p = 'b';
4218 @end smallexample
4220 @item -Wcast-align
4221 @opindex Wcast-align
4222 @opindex Wno-cast-align
4223 Warn whenever a pointer is cast such that the required alignment of the
4224 target is increased.  For example, warn if a @code{char *} is cast to
4225 an @code{int *} on machines where integers can only be accessed at
4226 two- or four-byte boundaries.
4228 @item -Wwrite-strings
4229 @opindex Wwrite-strings
4230 @opindex Wno-write-strings
4231 When compiling C, give string constants the type @code{const
4232 char[@var{length}]} so that copying the address of one into a
4233 non-@code{const} @code{char *} pointer produces a warning.  These
4234 warnings help you find at compile time code that can try to write
4235 into a string constant, but only if you have been very careful about
4236 using @code{const} in declarations and prototypes.  Otherwise, it is
4237 just a nuisance. This is why we did not make @option{-Wall} request
4238 these warnings.
4240 When compiling C++, warn about the deprecated conversion from string
4241 literals to @code{char *}.  This warning is enabled by default for C++
4242 programs.
4244 @item -Wclobbered
4245 @opindex Wclobbered
4246 @opindex Wno-clobbered
4247 Warn for variables that might be changed by @samp{longjmp} or
4248 @samp{vfork}.  This warning is also enabled by @option{-Wextra}.
4250 @item -Wconversion
4251 @opindex Wconversion
4252 @opindex Wno-conversion
4253 Warn for implicit conversions that may alter a value. This includes
4254 conversions between real and integer, like @code{abs (x)} when
4255 @code{x} is @code{double}; conversions between signed and unsigned,
4256 like @code{unsigned ui = -1}; and conversions to smaller types, like
4257 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
4258 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
4259 changed by the conversion like in @code{abs (2.0)}.  Warnings about
4260 conversions between signed and unsigned integers can be disabled by
4261 using @option{-Wno-sign-conversion}.
4263 For C++, also warn for confusing overload resolution for user-defined
4264 conversions; and conversions that never use a type conversion
4265 operator: conversions to @code{void}, the same type, a base class or a
4266 reference to them. Warnings about conversions between signed and
4267 unsigned integers are disabled by default in C++ unless
4268 @option{-Wsign-conversion} is explicitly enabled.
4270 @item -Wno-conversion-null @r{(C++ and Objective-C++ only)}
4271 @opindex Wconversion-null
4272 @opindex Wno-conversion-null
4273 Do not warn for conversions between @code{NULL} and non-pointer
4274 types. @option{-Wconversion-null} is enabled by default.
4276 @item -Wzero-as-null-pointer-constant @r{(C++ and Objective-C++ only)}
4277 @opindex Wzero-as-null-pointer-constant
4278 @opindex Wno-zero-as-null-pointer-constant
4279 Warn when a literal '0' is used as null pointer constant.  This can
4280 be useful to facilitate the conversion to @code{nullptr} in C++11.
4282 @item -Wuseless-cast @r{(C++ and Objective-C++ only)}
4283 @opindex Wuseless-cast
4284 @opindex Wno-useless-cast
4285 Warn when an expression is casted to its own type.
4287 @item -Wempty-body
4288 @opindex Wempty-body
4289 @opindex Wno-empty-body
4290 Warn if an empty body occurs in an @samp{if}, @samp{else} or @samp{do
4291 while} statement.  This warning is also enabled by @option{-Wextra}.
4293 @item -Wenum-compare
4294 @opindex Wenum-compare
4295 @opindex Wno-enum-compare
4296 Warn about a comparison between values of different enumerated types.
4297 In C++ enumeral mismatches in conditional expressions are also
4298 diagnosed and the warning is enabled by default.  In C this warning is 
4299 enabled by @option{-Wall}.
4301 @item -Wjump-misses-init @r{(C, Objective-C only)}
4302 @opindex Wjump-misses-init
4303 @opindex Wno-jump-misses-init
4304 Warn if a @code{goto} statement or a @code{switch} statement jumps
4305 forward across the initialization of a variable, or jumps backward to a
4306 label after the variable has been initialized.  This only warns about
4307 variables that are initialized when they are declared.  This warning is
4308 only supported for C and Objective-C; in C++ this sort of branch is an
4309 error in any case.
4311 @option{-Wjump-misses-init} is included in @option{-Wc++-compat}.  It
4312 can be disabled with the @option{-Wno-jump-misses-init} option.
4314 @item -Wsign-compare
4315 @opindex Wsign-compare
4316 @opindex Wno-sign-compare
4317 @cindex warning for comparison of signed and unsigned values
4318 @cindex comparison of signed and unsigned values, warning
4319 @cindex signed and unsigned values, comparison warning
4320 Warn when a comparison between signed and unsigned values could produce
4321 an incorrect result when the signed value is converted to unsigned.
4322 This warning is also enabled by @option{-Wextra}; to get the other warnings
4323 of @option{-Wextra} without this warning, use @option{-Wextra -Wno-sign-compare}.
4325 @item -Wsign-conversion
4326 @opindex Wsign-conversion
4327 @opindex Wno-sign-conversion
4328 Warn for implicit conversions that may change the sign of an integer
4329 value, like assigning a signed integer expression to an unsigned
4330 integer variable. An explicit cast silences the warning. In C, this
4331 option is enabled also by @option{-Wconversion}.
4333 @item -Wsizeof-pointer-memaccess
4334 @opindex Wsizeof-pointer-memaccess
4335 @opindex Wno-sizeof-pointer-memaccess
4336 Warn for suspicious length parameters to certain string and memory built-in
4337 functions if the argument uses @code{sizeof}.  This warning warns e.g.@:
4338 about @code{memset (ptr, 0, sizeof (ptr));} if @code{ptr} is not an array,
4339 but a pointer, and suggests a possible fix, or about
4340 @code{memcpy (&foo, ptr, sizeof (&foo));}.  This warning is enabled by
4341 @option{-Wall}.
4343 @item -Waddress
4344 @opindex Waddress
4345 @opindex Wno-address
4346 Warn about suspicious uses of memory addresses. These include using
4347 the address of a function in a conditional expression, such as
4348 @code{void func(void); if (func)}, and comparisons against the memory
4349 address of a string literal, such as @code{if (x == "abc")}.  Such
4350 uses typically indicate a programmer error: the address of a function
4351 always evaluates to true, so their use in a conditional usually
4352 indicate that the programmer forgot the parentheses in a function
4353 call; and comparisons against string literals result in unspecified
4354 behavior and are not portable in C, so they usually indicate that the
4355 programmer intended to use @code{strcmp}.  This warning is enabled by
4356 @option{-Wall}.
4358 @item -Wlogical-op
4359 @opindex Wlogical-op
4360 @opindex Wno-logical-op
4361 Warn about suspicious uses of logical operators in expressions.
4362 This includes using logical operators in contexts where a
4363 bit-wise operator is likely to be expected.
4365 @item -Waggregate-return
4366 @opindex Waggregate-return
4367 @opindex Wno-aggregate-return
4368 Warn if any functions that return structures or unions are defined or
4369 called.  (In languages where you can return an array, this also elicits
4370 a warning.)
4372 @item -Wno-attributes
4373 @opindex Wno-attributes
4374 @opindex Wattributes
4375 Do not warn if an unexpected @code{__attribute__} is used, such as
4376 unrecognized attributes, function attributes applied to variables,
4377 etc.  This does not stop errors for incorrect use of supported
4378 attributes.
4380 @item -Wno-builtin-macro-redefined
4381 @opindex Wno-builtin-macro-redefined
4382 @opindex Wbuiltin-macro-redefined
4383 Do not warn if certain built-in macros are redefined.  This suppresses
4384 warnings for redefinition of @code{__TIMESTAMP__}, @code{__TIME__},
4385 @code{__DATE__}, @code{__FILE__}, and @code{__BASE_FILE__}.
4387 @item -Wstrict-prototypes @r{(C and Objective-C only)}
4388 @opindex Wstrict-prototypes
4389 @opindex Wno-strict-prototypes
4390 Warn if a function is declared or defined without specifying the
4391 argument types.  (An old-style function definition is permitted without
4392 a warning if preceded by a declaration that specifies the argument
4393 types.)
4395 @item -Wold-style-declaration @r{(C and Objective-C only)}
4396 @opindex Wold-style-declaration
4397 @opindex Wno-old-style-declaration
4398 Warn for obsolescent usages, according to the C Standard, in a
4399 declaration. For example, warn if storage-class specifiers like
4400 @code{static} are not the first things in a declaration.  This warning
4401 is also enabled by @option{-Wextra}.
4403 @item -Wold-style-definition @r{(C and Objective-C only)}
4404 @opindex Wold-style-definition
4405 @opindex Wno-old-style-definition
4406 Warn if an old-style function definition is used.  A warning is given
4407 even if there is a previous prototype.
4409 @item -Wmissing-parameter-type @r{(C and Objective-C only)}
4410 @opindex Wmissing-parameter-type
4411 @opindex Wno-missing-parameter-type
4412 A function parameter is declared without a type specifier in K&R-style
4413 functions:
4415 @smallexample
4416 void foo(bar) @{ @}
4417 @end smallexample
4419 This warning is also enabled by @option{-Wextra}.
4421 @item -Wmissing-prototypes @r{(C and Objective-C only)}
4422 @opindex Wmissing-prototypes
4423 @opindex Wno-missing-prototypes
4424 Warn if a global function is defined without a previous prototype
4425 declaration.  This warning is issued even if the definition itself
4426 provides a prototype.  Use this option to detect global functions
4427 that do not have a matching prototype declaration in a header file.
4428 This option is not valid for C++ because all function declarations
4429 provide prototypes and a non-matching declaration will declare an
4430 overload rather than conflict with an earlier declaration.
4431 Use @option{-Wmissing-declarations} to detect missing declarations in C++.
4433 @item -Wmissing-declarations
4434 @opindex Wmissing-declarations
4435 @opindex Wno-missing-declarations
4436 Warn if a global function is defined without a previous declaration.
4437 Do so even if the definition itself provides a prototype.
4438 Use this option to detect global functions that are not declared in
4439 header files.  In C, no warnings are issued for functions with previous
4440 non-prototype declarations; use @option{-Wmissing-prototype} to detect
4441 missing prototypes.  In C++, no warnings are issued for function templates,
4442 or for inline functions, or for functions in anonymous namespaces.
4444 @item -Wmissing-field-initializers
4445 @opindex Wmissing-field-initializers
4446 @opindex Wno-missing-field-initializers
4447 @opindex W
4448 @opindex Wextra
4449 @opindex Wno-extra
4450 Warn if a structure's initializer has some fields missing.  For
4451 example, the following code causes such a warning, because
4452 @code{x.h} is implicitly zero:
4454 @smallexample
4455 struct s @{ int f, g, h; @};
4456 struct s x = @{ 3, 4 @};
4457 @end smallexample
4459 This option does not warn about designated initializers, so the following
4460 modification does not trigger a warning:
4462 @smallexample
4463 struct s @{ int f, g, h; @};
4464 struct s x = @{ .f = 3, .g = 4 @};
4465 @end smallexample
4467 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
4468 warnings without this one, use @option{-Wextra -Wno-missing-field-initializers}.
4470 @item -Wno-multichar
4471 @opindex Wno-multichar
4472 @opindex Wmultichar
4473 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
4474 Usually they indicate a typo in the user's code, as they have
4475 implementation-defined values, and should not be used in portable code.
4477 @item -Wnormalized=<none|id|nfc|nfkc>
4478 @opindex Wnormalized=
4479 @cindex NFC
4480 @cindex NFKC
4481 @cindex character set, input normalization
4482 In ISO C and ISO C++, two identifiers are different if they are
4483 different sequences of characters.  However, sometimes when characters
4484 outside the basic ASCII character set are used, you can have two
4485 different character sequences that look the same.  To avoid confusion,
4486 the ISO 10646 standard sets out some @dfn{normalization rules} which
4487 when applied ensure that two sequences that look the same are turned into
4488 the same sequence.  GCC can warn you if you are using identifiers that
4489 have not been normalized; this option controls that warning.
4491 There are four levels of warning supported by GCC@.  The default is
4492 @option{-Wnormalized=nfc}, which warns about any identifier that is
4493 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
4494 recommended form for most uses.
4496 Unfortunately, there are some characters allowed in identifiers by
4497 ISO C and ISO C++ that, when turned into NFC, are not allowed in 
4498 identifiers.  That is, there's no way to use these symbols in portable
4499 ISO C or C++ and have all your identifiers in NFC@.
4500 @option{-Wnormalized=id} suppresses the warning for these characters.
4501 It is hoped that future versions of the standards involved will correct
4502 this, which is why this option is not the default.
4504 You can switch the warning off for all characters by writing
4505 @option{-Wnormalized=none}.  You should only do this if you
4506 are using some other normalization scheme (like ``D''), because
4507 otherwise you can easily create bugs that are literally impossible to see.
4509 Some characters in ISO 10646 have distinct meanings but look identical
4510 in some fonts or display methodologies, especially once formatting has
4511 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
4512 LETTER N'', displays just like a regular @code{n} that has been
4513 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
4514 normalization scheme to convert all these into a standard form as
4515 well, and GCC warns if your code is not in NFKC if you use
4516 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
4517 about every identifier that contains the letter O because it might be
4518 confused with the digit 0, and so is not the default, but may be
4519 useful as a local coding convention if the programming environment 
4520 cannot be fixed to display these characters distinctly.
4522 @item -Wno-deprecated
4523 @opindex Wno-deprecated
4524 @opindex Wdeprecated
4525 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
4527 @item -Wno-deprecated-declarations
4528 @opindex Wno-deprecated-declarations
4529 @opindex Wdeprecated-declarations
4530 Do not warn about uses of functions (@pxref{Function Attributes}),
4531 variables (@pxref{Variable Attributes}), and types (@pxref{Type
4532 Attributes}) marked as deprecated by using the @code{deprecated}
4533 attribute.
4535 @item -Wno-overflow
4536 @opindex Wno-overflow
4537 @opindex Woverflow
4538 Do not warn about compile-time overflow in constant expressions.
4540 @item -Woverride-init @r{(C and Objective-C only)}
4541 @opindex Woverride-init
4542 @opindex Wno-override-init
4543 @opindex W
4544 @opindex Wextra
4545 @opindex Wno-extra
4546 Warn if an initialized field without side effects is overridden when
4547 using designated initializers (@pxref{Designated Inits, , Designated
4548 Initializers}).
4550 This warning is included in @option{-Wextra}.  To get other
4551 @option{-Wextra} warnings without this one, use @option{-Wextra
4552 -Wno-override-init}.
4554 @item -Wpacked
4555 @opindex Wpacked
4556 @opindex Wno-packed
4557 Warn if a structure is given the packed attribute, but the packed
4558 attribute has no effect on the layout or size of the structure.
4559 Such structures may be mis-aligned for little benefit.  For
4560 instance, in this code, the variable @code{f.x} in @code{struct bar}
4561 is misaligned even though @code{struct bar} does not itself
4562 have the packed attribute:
4564 @smallexample
4565 @group
4566 struct foo @{
4567   int x;
4568   char a, b, c, d;
4569 @} __attribute__((packed));
4570 struct bar @{
4571   char z;
4572   struct foo f;
4574 @end group
4575 @end smallexample
4577 @item -Wpacked-bitfield-compat
4578 @opindex Wpacked-bitfield-compat
4579 @opindex Wno-packed-bitfield-compat
4580 The 4.1, 4.2 and 4.3 series of GCC ignore the @code{packed} attribute
4581 on bit-fields of type @code{char}.  This has been fixed in GCC 4.4 but
4582 the change can lead to differences in the structure layout.  GCC
4583 informs you when the offset of such a field has changed in GCC 4.4.
4584 For example there is no longer a 4-bit padding between field @code{a}
4585 and @code{b} in this structure:
4587 @smallexample
4588 struct foo
4590   char a:4;
4591   char b:8;
4592 @} __attribute__ ((packed));
4593 @end smallexample
4595 This warning is enabled by default.  Use
4596 @option{-Wno-packed-bitfield-compat} to disable this warning.
4598 @item -Wpadded
4599 @opindex Wpadded
4600 @opindex Wno-padded
4601 Warn if padding is included in a structure, either to align an element
4602 of the structure or to align the whole structure.  Sometimes when this
4603 happens it is possible to rearrange the fields of the structure to
4604 reduce the padding and so make the structure smaller.
4606 @item -Wredundant-decls
4607 @opindex Wredundant-decls
4608 @opindex Wno-redundant-decls
4609 Warn if anything is declared more than once in the same scope, even in
4610 cases where multiple declaration is valid and changes nothing.
4612 @item -Wnested-externs @r{(C and Objective-C only)}
4613 @opindex Wnested-externs
4614 @opindex Wno-nested-externs
4615 Warn if an @code{extern} declaration is encountered within a function.
4617 @item -Winline
4618 @opindex Winline
4619 @opindex Wno-inline
4620 Warn if a function that is declared as inline cannot be inlined.
4621 Even with this option, the compiler does not warn about failures to
4622 inline functions declared in system headers.
4624 The compiler uses a variety of heuristics to determine whether or not
4625 to inline a function.  For example, the compiler takes into account
4626 the size of the function being inlined and the amount of inlining
4627 that has already been done in the current function.  Therefore,
4628 seemingly insignificant changes in the source program can cause the
4629 warnings produced by @option{-Winline} to appear or disappear.
4631 @item -Wno-invalid-offsetof @r{(C++ and Objective-C++ only)}
4632 @opindex Wno-invalid-offsetof
4633 @opindex Winvalid-offsetof
4634 Suppress warnings from applying the @samp{offsetof} macro to a non-POD
4635 type.  According to the 1998 ISO C++ standard, applying @samp{offsetof}
4636 to a non-POD type is undefined.  In existing C++ implementations,
4637 however, @samp{offsetof} typically gives meaningful results even when
4638 applied to certain kinds of non-POD types (such as a simple
4639 @samp{struct} that fails to be a POD type only by virtue of having a
4640 constructor).  This flag is for users who are aware that they are
4641 writing nonportable code and who have deliberately chosen to ignore the
4642 warning about it.
4644 The restrictions on @samp{offsetof} may be relaxed in a future version
4645 of the C++ standard.
4647 @item -Wno-int-to-pointer-cast
4648 @opindex Wno-int-to-pointer-cast
4649 @opindex Wint-to-pointer-cast
4650 Suppress warnings from casts to pointer type of an integer of a
4651 different size. In C++, casting to a pointer type of smaller size is
4652 an error. @option{Wint-to-pointer-cast} is enabled by default.
4655 @item -Wno-pointer-to-int-cast @r{(C and Objective-C only)}
4656 @opindex Wno-pointer-to-int-cast
4657 @opindex Wpointer-to-int-cast
4658 Suppress warnings from casts from a pointer to an integer type of a
4659 different size.
4661 @item -Winvalid-pch
4662 @opindex Winvalid-pch
4663 @opindex Wno-invalid-pch
4664 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
4665 the search path but can't be used.
4667 @item -Wlong-long
4668 @opindex Wlong-long
4669 @opindex Wno-long-long
4670 Warn if @samp{long long} type is used.  This is enabled by either
4671 @option{-Wpedantic} or @option{-Wtraditional} in ISO C90 and C++98
4672 modes.  To inhibit the warning messages, use @option{-Wno-long-long}.
4674 @item -Wvariadic-macros
4675 @opindex Wvariadic-macros
4676 @opindex Wno-variadic-macros
4677 Warn if variadic macros are used in pedantic ISO C90 mode, or the GNU
4678 alternate syntax when in pedantic ISO C99 mode.  This is default.
4679 To inhibit the warning messages, use @option{-Wno-variadic-macros}.
4681 @item -Wvarargs
4682 @opindex Wvarargs
4683 @opindex Wno-varargs
4684 Warn upon questionable usage of the macros used to handle variable
4685 arguments like @samp{va_start}.  This is default.  To inhibit the
4686 warning messages, use @option{-Wno-varargs}.
4688 @item -Wvector-operation-performance
4689 @opindex Wvector-operation-performance
4690 @opindex Wno-vector-operation-performance
4691 Warn if vector operation is not implemented via SIMD capabilities of the
4692 architecture.  Mainly useful for the performance tuning.
4693 Vector operation can be implemented @code{piecewise}, which means that the
4694 scalar operation is performed on every vector element; 
4695 @code{in parallel}, which means that the vector operation is implemented
4696 using scalars of wider type, which normally is more performance efficient;
4697 and @code{as a single scalar}, which means that vector fits into a
4698 scalar type.
4700 @item -Wvla
4701 @opindex Wvla
4702 @opindex Wno-vla
4703 Warn if variable length array is used in the code.
4704 @option{-Wno-vla} prevents the @option{-Wpedantic} warning of
4705 the variable length array.
4707 @item -Wvolatile-register-var
4708 @opindex Wvolatile-register-var
4709 @opindex Wno-volatile-register-var
4710 Warn if a register variable is declared volatile.  The volatile
4711 modifier does not inhibit all optimizations that may eliminate reads
4712 and/or writes to register variables.  This warning is enabled by
4713 @option{-Wall}.
4715 @item -Wdisabled-optimization
4716 @opindex Wdisabled-optimization
4717 @opindex Wno-disabled-optimization
4718 Warn if a requested optimization pass is disabled.  This warning does
4719 not generally indicate that there is anything wrong with your code; it
4720 merely indicates that GCC's optimizers are unable to handle the code
4721 effectively.  Often, the problem is that your code is too big or too
4722 complex; GCC refuses to optimize programs when the optimization
4723 itself is likely to take inordinate amounts of time.
4725 @item -Wpointer-sign @r{(C and Objective-C only)}
4726 @opindex Wpointer-sign
4727 @opindex Wno-pointer-sign
4728 Warn for pointer argument passing or assignment with different signedness.
4729 This option is only supported for C and Objective-C@.  It is implied by
4730 @option{-Wall} and by @option{-Wpedantic}, which can be disabled with
4731 @option{-Wno-pointer-sign}.
4733 @item -Wstack-protector
4734 @opindex Wstack-protector
4735 @opindex Wno-stack-protector
4736 This option is only active when @option{-fstack-protector} is active.  It
4737 warns about functions that are not protected against stack smashing.
4739 @item -Wno-mudflap
4740 @opindex Wno-mudflap
4741 Suppress warnings about constructs that cannot be instrumented by
4742 @option{-fmudflap}.
4744 @item -Woverlength-strings
4745 @opindex Woverlength-strings
4746 @opindex Wno-overlength-strings
4747 Warn about string constants that are longer than the ``minimum
4748 maximum'' length specified in the C standard.  Modern compilers
4749 generally allow string constants that are much longer than the
4750 standard's minimum limit, but very portable programs should avoid
4751 using longer strings.
4753 The limit applies @emph{after} string constant concatenation, and does
4754 not count the trailing NUL@.  In C90, the limit was 509 characters; in
4755 C99, it was raised to 4095.  C++98 does not specify a normative
4756 minimum maximum, so we do not diagnose overlength strings in C++@.
4758 This option is implied by @option{-Wpedantic}, and can be disabled with
4759 @option{-Wno-overlength-strings}.
4761 @item -Wunsuffixed-float-constants @r{(C and Objective-C only)}
4762 @opindex Wunsuffixed-float-constants
4764 Issue a warning for any floating constant that does not have
4765 a suffix.  When used together with @option{-Wsystem-headers} it
4766 warns about such constants in system header files.  This can be useful
4767 when preparing code to use with the @code{FLOAT_CONST_DECIMAL64} pragma
4768 from the decimal floating-point extension to C99.
4769 @end table
4771 @node Debugging Options
4772 @section Options for Debugging Your Program or GCC
4773 @cindex options, debugging
4774 @cindex debugging information options
4776 GCC has various special options that are used for debugging
4777 either your program or GCC:
4779 @table @gcctabopt
4780 @item -g
4781 @opindex g
4782 Produce debugging information in the operating system's native format
4783 (stabs, COFF, XCOFF, or DWARF 2)@.  GDB can work with this debugging
4784 information.
4786 On most systems that use stabs format, @option{-g} enables use of extra
4787 debugging information that only GDB can use; this extra information
4788 makes debugging work better in GDB but probably makes other debuggers
4789 crash or
4790 refuse to read the program.  If you want to control for certain whether
4791 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
4792 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
4794 GCC allows you to use @option{-g} with
4795 @option{-O}.  The shortcuts taken by optimized code may occasionally
4796 produce surprising results: some variables you declared may not exist
4797 at all; flow of control may briefly move where you did not expect it;
4798 some statements may not be executed because they compute constant
4799 results or their values are already at hand; some statements may
4800 execute in different places because they have been moved out of loops.
4802 Nevertheless it proves possible to debug optimized output.  This makes
4803 it reasonable to use the optimizer for programs that might have bugs.
4805 The following options are useful when GCC is generated with the
4806 capability for more than one debugging format.
4808 @item -ggdb
4809 @opindex ggdb
4810 Produce debugging information for use by GDB@.  This means to use the
4811 most expressive format available (DWARF 2, stabs, or the native format
4812 if neither of those are supported), including GDB extensions if at all
4813 possible.
4815 @item -gpubnames
4816 @opindex gpubnames
4817 Generate dwarf .debug_pubnames and .debug_pubtypes sections.
4819 @item -gstabs
4820 @opindex gstabs
4821 Produce debugging information in stabs format (if that is supported),
4822 without GDB extensions.  This is the format used by DBX on most BSD
4823 systems.  On MIPS, Alpha and System V Release 4 systems this option
4824 produces stabs debugging output that is not understood by DBX or SDB@.
4825 On System V Release 4 systems this option requires the GNU assembler.
4827 @item -feliminate-unused-debug-symbols
4828 @opindex feliminate-unused-debug-symbols
4829 Produce debugging information in stabs format (if that is supported),
4830 for only symbols that are actually used.
4832 @item -femit-class-debug-always
4833 Instead of emitting debugging information for a C++ class in only one
4834 object file, emit it in all object files using the class.  This option
4835 should be used only with debuggers that are unable to handle the way GCC
4836 normally emits debugging information for classes because using this
4837 option increases the size of debugging information by as much as a
4838 factor of two.
4840 @item -fdebug-types-section
4841 @opindex fdebug-types-section
4842 @opindex fno-debug-types-section
4843 When using DWARF Version 4 or higher, type DIEs can be put into
4844 their own @code{.debug_types} section instead of making them part of the
4845 @code{.debug_info} section.  It is more efficient to put them in a separate
4846 comdat sections since the linker can then remove duplicates.
4847 But not all DWARF consumers support @code{.debug_types} sections yet
4848 and on some objects @code{.debug_types} produces larger instead of smaller
4849 debugging information.
4851 @item -gstabs+
4852 @opindex gstabs+
4853 Produce debugging information in stabs format (if that is supported),
4854 using GNU extensions understood only by the GNU debugger (GDB)@.  The
4855 use of these extensions is likely to make other debuggers crash or
4856 refuse to read the program.
4858 @item -gcoff
4859 @opindex gcoff
4860 Produce debugging information in COFF format (if that is supported).
4861 This is the format used by SDB on most System V systems prior to
4862 System V Release 4.
4864 @item -gxcoff
4865 @opindex gxcoff
4866 Produce debugging information in XCOFF format (if that is supported).
4867 This is the format used by the DBX debugger on IBM RS/6000 systems.
4869 @item -gxcoff+
4870 @opindex gxcoff+
4871 Produce debugging information in XCOFF format (if that is supported),
4872 using GNU extensions understood only by the GNU debugger (GDB)@.  The
4873 use of these extensions is likely to make other debuggers crash or
4874 refuse to read the program, and may cause assemblers other than the GNU
4875 assembler (GAS) to fail with an error.
4877 @item -gdwarf-@var{version}
4878 @opindex gdwarf-@var{version}
4879 Produce debugging information in DWARF format (if that is supported).
4880 The value of @var{version} may be either 2, 3 or 4; the default version
4881 for most targets is 4.
4883 Note that with DWARF Version 2, some ports require and always
4884 use some non-conflicting DWARF 3 extensions in the unwind tables.
4886 Version 4 may require GDB 7.0 and @option{-fvar-tracking-assignments}
4887 for maximum benefit.
4889 @item -grecord-gcc-switches
4890 @opindex grecord-gcc-switches
4891 This switch causes the command-line options used to invoke the
4892 compiler that may affect code generation to be appended to the
4893 DW_AT_producer attribute in DWARF debugging information.  The options
4894 are concatenated with spaces separating them from each other and from
4895 the compiler version.  See also @option{-frecord-gcc-switches} for another
4896 way of storing compiler options into the object file.  This is the default.
4898 @item -gno-record-gcc-switches
4899 @opindex gno-record-gcc-switches
4900 Disallow appending command-line options to the DW_AT_producer attribute
4901 in DWARF debugging information.
4903 @item -gstrict-dwarf
4904 @opindex gstrict-dwarf
4905 Disallow using extensions of later DWARF standard version than selected
4906 with @option{-gdwarf-@var{version}}.  On most targets using non-conflicting
4907 DWARF extensions from later standard versions is allowed.
4909 @item -gno-strict-dwarf
4910 @opindex gno-strict-dwarf
4911 Allow using extensions of later DWARF standard version than selected with
4912 @option{-gdwarf-@var{version}}.
4914 @item -gvms
4915 @opindex gvms
4916 Produce debugging information in Alpha/VMS debug format (if that is
4917 supported).  This is the format used by DEBUG on Alpha/VMS systems.
4919 @item -g@var{level}
4920 @itemx -ggdb@var{level}
4921 @itemx -gstabs@var{level}
4922 @itemx -gcoff@var{level}
4923 @itemx -gxcoff@var{level}
4924 @itemx -gvms@var{level}
4925 Request debugging information and also use @var{level} to specify how
4926 much information.  The default level is 2.
4928 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
4929 @option{-g}.
4931 Level 1 produces minimal information, enough for making backtraces in
4932 parts of the program that you don't plan to debug.  This includes
4933 descriptions of functions and external variables, but no information
4934 about local variables and no line numbers.
4936 Level 3 includes extra information, such as all the macro definitions
4937 present in the program.  Some debuggers support macro expansion when
4938 you use @option{-g3}.
4940 @option{-gdwarf-2} does not accept a concatenated debug level, because
4941 GCC used to support an option @option{-gdwarf} that meant to generate
4942 debug information in version 1 of the DWARF format (which is very
4943 different from version 2), and it would have been too confusing.  That
4944 debug format is long obsolete, but the option cannot be changed now.
4945 Instead use an additional @option{-g@var{level}} option to change the
4946 debug level for DWARF.
4948 @item -gtoggle
4949 @opindex gtoggle
4950 Turn off generation of debug info, if leaving out this option
4951 generates it, or turn it on at level 2 otherwise.  The position of this
4952 argument in the command line does not matter; it takes effect after all
4953 other options are processed, and it does so only once, no matter how
4954 many times it is given.  This is mainly intended to be used with
4955 @option{-fcompare-debug}.
4957 @item -fdump-final-insns@r{[}=@var{file}@r{]}
4958 @opindex fdump-final-insns
4959 Dump the final internal representation (RTL) to @var{file}.  If the
4960 optional argument is omitted (or if @var{file} is @code{.}), the name
4961 of the dump file is determined by appending @code{.gkd} to the
4962 compilation output file name.
4964 @item -fcompare-debug@r{[}=@var{opts}@r{]}
4965 @opindex fcompare-debug
4966 @opindex fno-compare-debug
4967 If no error occurs during compilation, run the compiler a second time,
4968 adding @var{opts} and @option{-fcompare-debug-second} to the arguments
4969 passed to the second compilation.  Dump the final internal
4970 representation in both compilations, and print an error if they differ.
4972 If the equal sign is omitted, the default @option{-gtoggle} is used.
4974 The environment variable @env{GCC_COMPARE_DEBUG}, if defined, non-empty
4975 and nonzero, implicitly enables @option{-fcompare-debug}.  If
4976 @env{GCC_COMPARE_DEBUG} is defined to a string starting with a dash,
4977 then it is used for @var{opts}, otherwise the default @option{-gtoggle}
4978 is used.
4980 @option{-fcompare-debug=}, with the equal sign but without @var{opts},
4981 is equivalent to @option{-fno-compare-debug}, which disables the dumping
4982 of the final representation and the second compilation, preventing even
4983 @env{GCC_COMPARE_DEBUG} from taking effect.
4985 To verify full coverage during @option{-fcompare-debug} testing, set
4986 @env{GCC_COMPARE_DEBUG} to say @samp{-fcompare-debug-not-overridden},
4987 which GCC rejects as an invalid option in any actual compilation
4988 (rather than preprocessing, assembly or linking).  To get just a
4989 warning, setting @env{GCC_COMPARE_DEBUG} to @samp{-w%n-fcompare-debug
4990 not overridden} will do.
4992 @item -fcompare-debug-second
4993 @opindex fcompare-debug-second
4994 This option is implicitly passed to the compiler for the second
4995 compilation requested by @option{-fcompare-debug}, along with options to
4996 silence warnings, and omitting other options that would cause
4997 side-effect compiler outputs to files or to the standard output.  Dump
4998 files and preserved temporary files are renamed so as to contain the
4999 @code{.gk} additional extension during the second compilation, to avoid
5000 overwriting those generated by the first.
5002 When this option is passed to the compiler driver, it causes the
5003 @emph{first} compilation to be skipped, which makes it useful for little
5004 other than debugging the compiler proper.
5006 @item -feliminate-dwarf2-dups
5007 @opindex feliminate-dwarf2-dups
5008 Compress DWARF 2 debugging information by eliminating duplicated
5009 information about each symbol.  This option only makes sense when
5010 generating DWARF 2 debugging information with @option{-gdwarf-2}.
5012 @item -femit-struct-debug-baseonly
5013 Emit debug information for struct-like types
5014 only when the base name of the compilation source file
5015 matches the base name of file in which the struct is defined.
5017 This option substantially reduces the size of debugging information,
5018 but at significant potential loss in type information to the debugger.
5019 See @option{-femit-struct-debug-reduced} for a less aggressive option.
5020 See @option{-femit-struct-debug-detailed} for more detailed control.
5022 This option works only with DWARF 2.
5024 @item -femit-struct-debug-reduced
5025 Emit debug information for struct-like types
5026 only when the base name of the compilation source file
5027 matches the base name of file in which the type is defined,
5028 unless the struct is a template or defined in a system header.
5030 This option significantly reduces the size of debugging information,
5031 with some potential loss in type information to the debugger.
5032 See @option{-femit-struct-debug-baseonly} for a more aggressive option.
5033 See @option{-femit-struct-debug-detailed} for more detailed control.
5035 This option works only with DWARF 2.
5037 @item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
5038 Specify the struct-like types
5039 for which the compiler generates debug information.
5040 The intent is to reduce duplicate struct debug information
5041 between different object files within the same program.
5043 This option is a detailed version of
5044 @option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
5045 which serves for most needs.
5047 A specification has the syntax@*
5048 [@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
5050 The optional first word limits the specification to
5051 structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
5052 A struct type is used directly when it is the type of a variable, member.
5053 Indirect uses arise through pointers to structs.
5054 That is, when use of an incomplete struct is valid, the use is indirect.
5055 An example is
5056 @samp{struct one direct; struct two * indirect;}.
5058 The optional second word limits the specification to
5059 ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
5060 Generic structs are a bit complicated to explain.
5061 For C++, these are non-explicit specializations of template classes,
5062 or non-template classes within the above.
5063 Other programming languages have generics,
5064 but @option{-femit-struct-debug-detailed} does not yet implement them.
5066 The third word specifies the source files for those
5067 structs for which the compiler should emit debug information.
5068 The values @samp{none} and @samp{any} have the normal meaning.
5069 The value @samp{base} means that
5070 the base of name of the file in which the type declaration appears
5071 must match the base of the name of the main compilation file.
5072 In practice, this means that when compiling @file{foo.c}, debug information
5073 is generated for types declared in that file and @file{foo.h},
5074 but not other header files.
5075 The value @samp{sys} means those types satisfying @samp{base}
5076 or declared in system or compiler headers.
5078 You may need to experiment to determine the best settings for your application.
5080 The default is @option{-femit-struct-debug-detailed=all}.
5082 This option works only with DWARF 2.
5084 @item -fno-merge-debug-strings
5085 @opindex fmerge-debug-strings
5086 @opindex fno-merge-debug-strings
5087 Direct the linker to not merge together strings in the debugging
5088 information that are identical in different object files.  Merging is
5089 not supported by all assemblers or linkers.  Merging decreases the size
5090 of the debug information in the output file at the cost of increasing
5091 link processing time.  Merging is enabled by default.
5093 @item -fdebug-prefix-map=@var{old}=@var{new}
5094 @opindex fdebug-prefix-map
5095 When compiling files in directory @file{@var{old}}, record debugging
5096 information describing them as in @file{@var{new}} instead.
5098 @item -fno-dwarf2-cfi-asm
5099 @opindex fdwarf2-cfi-asm
5100 @opindex fno-dwarf2-cfi-asm
5101 Emit DWARF 2 unwind info as compiler generated @code{.eh_frame} section
5102 instead of using GAS @code{.cfi_*} directives.
5104 @cindex @command{prof}
5105 @item -p
5106 @opindex p
5107 Generate extra code to write profile information suitable for the
5108 analysis program @command{prof}.  You must use this option when compiling
5109 the source files you want data about, and you must also use it when
5110 linking.
5112 @cindex @command{gprof}
5113 @item -pg
5114 @opindex pg
5115 Generate extra code to write profile information suitable for the
5116 analysis program @command{gprof}.  You must use this option when compiling
5117 the source files you want data about, and you must also use it when
5118 linking.
5120 @item -Q
5121 @opindex Q
5122 Makes the compiler print out each function name as it is compiled, and
5123 print some statistics about each pass when it finishes.
5125 @item -ftime-report
5126 @opindex ftime-report
5127 Makes the compiler print some statistics about the time consumed by each
5128 pass when it finishes.
5130 @item -fmem-report
5131 @opindex fmem-report
5132 Makes the compiler print some statistics about permanent memory
5133 allocation when it finishes.
5135 @item -fmem-report-wpa
5136 @opindex fmem-report-wpa
5137 Makes the compiler print some statistics about permanent memory
5138 allocation for the WPA phase only.
5140 @item -fpre-ipa-mem-report
5141 @opindex fpre-ipa-mem-report
5142 @item -fpost-ipa-mem-report
5143 @opindex fpost-ipa-mem-report
5144 Makes the compiler print some statistics about permanent memory
5145 allocation before or after interprocedural optimization.
5147 @item -fstack-usage
5148 @opindex fstack-usage
5149 Makes the compiler output stack usage information for the program, on a
5150 per-function basis.  The filename for the dump is made by appending
5151 @file{.su} to the @var{auxname}.  @var{auxname} is generated from the name of
5152 the output file, if explicitly specified and it is not an executable,
5153 otherwise it is the basename of the source file.  An entry is made up
5154 of three fields:
5156 @itemize
5157 @item
5158 The name of the function.
5159 @item
5160 A number of bytes.
5161 @item
5162 One or more qualifiers: @code{static}, @code{dynamic}, @code{bounded}.
5163 @end itemize
5165 The qualifier @code{static} means that the function manipulates the stack
5166 statically: a fixed number of bytes are allocated for the frame on function
5167 entry and released on function exit; no stack adjustments are otherwise made
5168 in the function.  The second field is this fixed number of bytes.
5170 The qualifier @code{dynamic} means that the function manipulates the stack
5171 dynamically: in addition to the static allocation described above, stack
5172 adjustments are made in the body of the function, for example to push/pop
5173 arguments around function calls.  If the qualifier @code{bounded} is also
5174 present, the amount of these adjustments is bounded at compile time and
5175 the second field is an upper bound of the total amount of stack used by
5176 the function.  If it is not present, the amount of these adjustments is
5177 not bounded at compile time and the second field only represents the
5178 bounded part.
5180 @item -fprofile-arcs
5181 @opindex fprofile-arcs
5182 Add code so that program flow @dfn{arcs} are instrumented.  During
5183 execution the program records how many times each branch and call is
5184 executed and how many times it is taken or returns.  When the compiled
5185 program exits it saves this data to a file called
5186 @file{@var{auxname}.gcda} for each source file.  The data may be used for
5187 profile-directed optimizations (@option{-fbranch-probabilities}), or for
5188 test coverage analysis (@option{-ftest-coverage}).  Each object file's
5189 @var{auxname} is generated from the name of the output file, if
5190 explicitly specified and it is not the final executable, otherwise it is
5191 the basename of the source file.  In both cases any suffix is removed
5192 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
5193 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
5194 @xref{Cross-profiling}.
5196 @cindex @command{gcov}
5197 @item --coverage
5198 @opindex coverage
5200 This option is used to compile and link code instrumented for coverage
5201 analysis.  The option is a synonym for @option{-fprofile-arcs}
5202 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
5203 linking).  See the documentation for those options for more details.
5205 @itemize
5207 @item
5208 Compile the source files with @option{-fprofile-arcs} plus optimization
5209 and code generation options.  For test coverage analysis, use the
5210 additional @option{-ftest-coverage} option.  You do not need to profile
5211 every source file in a program.
5213 @item
5214 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
5215 (the latter implies the former).
5217 @item
5218 Run the program on a representative workload to generate the arc profile
5219 information.  This may be repeated any number of times.  You can run
5220 concurrent instances of your program, and provided that the file system
5221 supports locking, the data files will be correctly updated.  Also
5222 @code{fork} calls are detected and correctly handled (double counting
5223 will not happen).
5225 @item
5226 For profile-directed optimizations, compile the source files again with
5227 the same optimization and code generation options plus
5228 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
5229 Control Optimization}).
5231 @item
5232 For test coverage analysis, use @command{gcov} to produce human readable
5233 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
5234 @command{gcov} documentation for further information.
5236 @end itemize
5238 With @option{-fprofile-arcs}, for each function of your program GCC
5239 creates a program flow graph, then finds a spanning tree for the graph.
5240 Only arcs that are not on the spanning tree have to be instrumented: the
5241 compiler adds code to count the number of times that these arcs are
5242 executed.  When an arc is the only exit or only entrance to a block, the
5243 instrumentation code can be added to the block; otherwise, a new basic
5244 block must be created to hold the instrumentation code.
5246 @need 2000
5247 @item -ftest-coverage
5248 @opindex ftest-coverage
5249 Produce a notes file that the @command{gcov} code-coverage utility
5250 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
5251 show program coverage.  Each source file's note file is called
5252 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
5253 above for a description of @var{auxname} and instructions on how to
5254 generate test coverage data.  Coverage data matches the source files
5255 more closely if you do not optimize.
5257 @item -fdbg-cnt-list
5258 @opindex fdbg-cnt-list
5259 Print the name and the counter upper bound for all debug counters.
5262 @item -fdbg-cnt=@var{counter-value-list}
5263 @opindex fdbg-cnt
5264 Set the internal debug counter upper bound.  @var{counter-value-list}
5265 is a comma-separated list of @var{name}:@var{value} pairs
5266 which sets the upper bound of each debug counter @var{name} to @var{value}.
5267 All debug counters have the initial upper bound of @code{UINT_MAX};
5268 thus @code{dbg_cnt()} returns true always unless the upper bound
5269 is set by this option.
5270 For example, with @option{-fdbg-cnt=dce:10,tail_call:0},
5271 @code{dbg_cnt(dce)} returns true only for first 10 invocations.
5273 @itemx -fenable-@var{kind}-@var{pass}
5274 @itemx -fdisable-@var{kind}-@var{pass}=@var{range-list}
5275 @opindex fdisable-
5276 @opindex fenable-
5278 This is a set of options that are used to explicitly disable/enable
5279 optimization passes.  These options are intended for use for debugging GCC.
5280 Compiler users should use regular options for enabling/disabling
5281 passes instead.
5283 @table @gcctabopt
5285 @item -fdisable-ipa-@var{pass}
5286 Disable IPA pass @var{pass}. @var{pass} is the pass name.  If the same pass is
5287 statically invoked in the compiler multiple times, the pass name should be
5288 appended with a sequential number starting from 1.
5290 @item -fdisable-rtl-@var{pass}
5291 @itemx -fdisable-rtl-@var{pass}=@var{range-list}
5292 Disable RTL pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
5293 statically invoked in the compiler multiple times, the pass name should be
5294 appended with a sequential number starting from 1.  @var{range-list} is a 
5295 comma-separated list of function ranges or assembler names.  Each range is a number
5296 pair separated by a colon.  The range is inclusive in both ends.  If the range
5297 is trivial, the number pair can be simplified as a single number.  If the
5298 function's cgraph node's @var{uid} falls within one of the specified ranges,
5299 the @var{pass} is disabled for that function.  The @var{uid} is shown in the
5300 function header of a dump file, and the pass names can be dumped by using
5301 option @option{-fdump-passes}.
5303 @item -fdisable-tree-@var{pass}
5304 @itemx -fdisable-tree-@var{pass}=@var{range-list}
5305 Disable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description of
5306 option arguments.
5308 @item -fenable-ipa-@var{pass}
5309 Enable IPA pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
5310 statically invoked in the compiler multiple times, the pass name should be
5311 appended with a sequential number starting from 1.
5313 @item -fenable-rtl-@var{pass}
5314 @itemx -fenable-rtl-@var{pass}=@var{range-list}
5315 Enable RTL pass @var{pass}.  See @option{-fdisable-rtl} for option argument
5316 description and examples.
5318 @item -fenable-tree-@var{pass}
5319 @itemx -fenable-tree-@var{pass}=@var{range-list}
5320 Enable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description
5321 of option arguments.
5323 @end table
5325 Here are some examples showing uses of these options.
5327 @smallexample
5329 # disable ccp1 for all functions
5330    -fdisable-tree-ccp1
5331 # disable complete unroll for function whose cgraph node uid is 1
5332    -fenable-tree-cunroll=1
5333 # disable gcse2 for functions at the following ranges [1,1],
5334 # [300,400], and [400,1000]
5335 # disable gcse2 for functions foo and foo2
5336    -fdisable-rtl-gcse2=foo,foo2
5337 # disable early inlining
5338    -fdisable-tree-einline
5339 # disable ipa inlining
5340    -fdisable-ipa-inline
5341 # enable tree full unroll
5342    -fenable-tree-unroll
5344 @end smallexample
5346 @item -d@var{letters}
5347 @itemx -fdump-rtl-@var{pass}
5348 @opindex d
5349 Says to make debugging dumps during compilation at times specified by
5350 @var{letters}.  This is used for debugging the RTL-based passes of the
5351 compiler.  The file names for most of the dumps are made by appending
5352 a pass number and a word to the @var{dumpname}, and the files are
5353 created in the directory of the output file.  Note that the pass
5354 number is computed statically as passes get registered into the pass
5355 manager.  Thus the numbering is not related to the dynamic order of
5356 execution of passes.  In particular, a pass installed by a plugin
5357 could have a number over 200 even if it executed quite early.
5358 @var{dumpname} is generated from the name of the output file, if
5359 explicitly specified and it is not an executable, otherwise it is the
5360 basename of the source file. These switches may have different effects
5361 when @option{-E} is used for preprocessing.
5363 Debug dumps can be enabled with a @option{-fdump-rtl} switch or some
5364 @option{-d} option @var{letters}.  Here are the possible
5365 letters for use in @var{pass} and @var{letters}, and their meanings:
5367 @table @gcctabopt
5369 @item -fdump-rtl-alignments
5370 @opindex fdump-rtl-alignments
5371 Dump after branch alignments have been computed.
5373 @item -fdump-rtl-asmcons
5374 @opindex fdump-rtl-asmcons
5375 Dump after fixing rtl statements that have unsatisfied in/out constraints.
5377 @item -fdump-rtl-auto_inc_dec
5378 @opindex fdump-rtl-auto_inc_dec
5379 Dump after auto-inc-dec discovery.  This pass is only run on
5380 architectures that have auto inc or auto dec instructions.
5382 @item -fdump-rtl-barriers
5383 @opindex fdump-rtl-barriers
5384 Dump after cleaning up the barrier instructions.
5386 @item -fdump-rtl-bbpart
5387 @opindex fdump-rtl-bbpart
5388 Dump after partitioning hot and cold basic blocks.
5390 @item -fdump-rtl-bbro
5391 @opindex fdump-rtl-bbro
5392 Dump after block reordering.
5394 @item -fdump-rtl-btl1
5395 @itemx -fdump-rtl-btl2
5396 @opindex fdump-rtl-btl2
5397 @opindex fdump-rtl-btl2
5398 @option{-fdump-rtl-btl1} and @option{-fdump-rtl-btl2} enable dumping
5399 after the two branch
5400 target load optimization passes.
5402 @item -fdump-rtl-bypass
5403 @opindex fdump-rtl-bypass
5404 Dump after jump bypassing and control flow optimizations.
5406 @item -fdump-rtl-combine
5407 @opindex fdump-rtl-combine
5408 Dump after the RTL instruction combination pass.
5410 @item -fdump-rtl-compgotos
5411 @opindex fdump-rtl-compgotos
5412 Dump after duplicating the computed gotos.
5414 @item -fdump-rtl-ce1
5415 @itemx -fdump-rtl-ce2
5416 @itemx -fdump-rtl-ce3
5417 @opindex fdump-rtl-ce1
5418 @opindex fdump-rtl-ce2
5419 @opindex fdump-rtl-ce3
5420 @option{-fdump-rtl-ce1}, @option{-fdump-rtl-ce2}, and
5421 @option{-fdump-rtl-ce3} enable dumping after the three
5422 if conversion passes.
5424 @itemx -fdump-rtl-cprop_hardreg
5425 @opindex fdump-rtl-cprop_hardreg
5426 Dump after hard register copy propagation.
5428 @itemx -fdump-rtl-csa
5429 @opindex fdump-rtl-csa
5430 Dump after combining stack adjustments.
5432 @item -fdump-rtl-cse1
5433 @itemx -fdump-rtl-cse2
5434 @opindex fdump-rtl-cse1
5435 @opindex fdump-rtl-cse2
5436 @option{-fdump-rtl-cse1} and @option{-fdump-rtl-cse2} enable dumping after
5437 the two common subexpression elimination passes.
5439 @itemx -fdump-rtl-dce
5440 @opindex fdump-rtl-dce
5441 Dump after the standalone dead code elimination passes.
5443 @itemx -fdump-rtl-dbr
5444 @opindex fdump-rtl-dbr
5445 Dump after delayed branch scheduling.
5447 @item -fdump-rtl-dce1
5448 @itemx -fdump-rtl-dce2
5449 @opindex fdump-rtl-dce1
5450 @opindex fdump-rtl-dce2
5451 @option{-fdump-rtl-dce1} and @option{-fdump-rtl-dce2} enable dumping after
5452 the two dead store elimination passes.
5454 @item -fdump-rtl-eh
5455 @opindex fdump-rtl-eh
5456 Dump after finalization of EH handling code.
5458 @item -fdump-rtl-eh_ranges
5459 @opindex fdump-rtl-eh_ranges
5460 Dump after conversion of EH handling range regions.
5462 @item -fdump-rtl-expand
5463 @opindex fdump-rtl-expand
5464 Dump after RTL generation.
5466 @item -fdump-rtl-fwprop1
5467 @itemx -fdump-rtl-fwprop2
5468 @opindex fdump-rtl-fwprop1
5469 @opindex fdump-rtl-fwprop2
5470 @option{-fdump-rtl-fwprop1} and @option{-fdump-rtl-fwprop2} enable
5471 dumping after the two forward propagation passes.
5473 @item -fdump-rtl-gcse1
5474 @itemx -fdump-rtl-gcse2
5475 @opindex fdump-rtl-gcse1
5476 @opindex fdump-rtl-gcse2
5477 @option{-fdump-rtl-gcse1} and @option{-fdump-rtl-gcse2} enable dumping
5478 after global common subexpression elimination.
5480 @item -fdump-rtl-init-regs
5481 @opindex fdump-rtl-init-regs
5482 Dump after the initialization of the registers.
5484 @item -fdump-rtl-initvals
5485 @opindex fdump-rtl-initvals
5486 Dump after the computation of the initial value sets.
5488 @itemx -fdump-rtl-into_cfglayout
5489 @opindex fdump-rtl-into_cfglayout
5490 Dump after converting to cfglayout mode.
5492 @item -fdump-rtl-ira
5493 @opindex fdump-rtl-ira
5494 Dump after iterated register allocation.
5496 @item -fdump-rtl-jump
5497 @opindex fdump-rtl-jump
5498 Dump after the second jump optimization.
5500 @item -fdump-rtl-loop2
5501 @opindex fdump-rtl-loop2
5502 @option{-fdump-rtl-loop2} enables dumping after the rtl
5503 loop optimization passes.
5505 @item -fdump-rtl-mach
5506 @opindex fdump-rtl-mach
5507 Dump after performing the machine dependent reorganization pass, if that
5508 pass exists.
5510 @item -fdump-rtl-mode_sw
5511 @opindex fdump-rtl-mode_sw
5512 Dump after removing redundant mode switches.
5514 @item -fdump-rtl-rnreg
5515 @opindex fdump-rtl-rnreg
5516 Dump after register renumbering.
5518 @itemx -fdump-rtl-outof_cfglayout
5519 @opindex fdump-rtl-outof_cfglayout
5520 Dump after converting from cfglayout mode.
5522 @item -fdump-rtl-peephole2
5523 @opindex fdump-rtl-peephole2
5524 Dump after the peephole pass.
5526 @item -fdump-rtl-postreload
5527 @opindex fdump-rtl-postreload
5528 Dump after post-reload optimizations.
5530 @itemx -fdump-rtl-pro_and_epilogue
5531 @opindex fdump-rtl-pro_and_epilogue
5532 Dump after generating the function prologues and epilogues.
5534 @item -fdump-rtl-regmove
5535 @opindex fdump-rtl-regmove
5536 Dump after the register move pass.
5538 @item -fdump-rtl-sched1
5539 @itemx -fdump-rtl-sched2
5540 @opindex fdump-rtl-sched1
5541 @opindex fdump-rtl-sched2
5542 @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2} enable dumping
5543 after the basic block scheduling passes.
5545 @item -fdump-rtl-see
5546 @opindex fdump-rtl-see
5547 Dump after sign extension elimination.
5549 @item -fdump-rtl-seqabstr
5550 @opindex fdump-rtl-seqabstr
5551 Dump after common sequence discovery.
5553 @item -fdump-rtl-shorten
5554 @opindex fdump-rtl-shorten
5555 Dump after shortening branches.
5557 @item -fdump-rtl-sibling
5558 @opindex fdump-rtl-sibling
5559 Dump after sibling call optimizations.
5561 @item -fdump-rtl-split1
5562 @itemx -fdump-rtl-split2
5563 @itemx -fdump-rtl-split3
5564 @itemx -fdump-rtl-split4
5565 @itemx -fdump-rtl-split5
5566 @opindex fdump-rtl-split1
5567 @opindex fdump-rtl-split2
5568 @opindex fdump-rtl-split3
5569 @opindex fdump-rtl-split4
5570 @opindex fdump-rtl-split5
5571 @option{-fdump-rtl-split1}, @option{-fdump-rtl-split2},
5572 @option{-fdump-rtl-split3}, @option{-fdump-rtl-split4} and
5573 @option{-fdump-rtl-split5} enable dumping after five rounds of
5574 instruction splitting.
5576 @item -fdump-rtl-sms
5577 @opindex fdump-rtl-sms
5578 Dump after modulo scheduling.  This pass is only run on some
5579 architectures.
5581 @item -fdump-rtl-stack
5582 @opindex fdump-rtl-stack
5583 Dump after conversion from GCC's ``flat register file'' registers to the
5584 x87's stack-like registers.  This pass is only run on x86 variants.
5586 @item -fdump-rtl-subreg1
5587 @itemx -fdump-rtl-subreg2
5588 @opindex fdump-rtl-subreg1
5589 @opindex fdump-rtl-subreg2
5590 @option{-fdump-rtl-subreg1} and @option{-fdump-rtl-subreg2} enable dumping after
5591 the two subreg expansion passes.
5593 @item -fdump-rtl-unshare
5594 @opindex fdump-rtl-unshare
5595 Dump after all rtl has been unshared.
5597 @item -fdump-rtl-vartrack
5598 @opindex fdump-rtl-vartrack
5599 Dump after variable tracking.
5601 @item -fdump-rtl-vregs
5602 @opindex fdump-rtl-vregs
5603 Dump after converting virtual registers to hard registers.
5605 @item -fdump-rtl-web
5606 @opindex fdump-rtl-web
5607 Dump after live range splitting.
5609 @item -fdump-rtl-regclass
5610 @itemx -fdump-rtl-subregs_of_mode_init
5611 @itemx -fdump-rtl-subregs_of_mode_finish
5612 @itemx -fdump-rtl-dfinit
5613 @itemx -fdump-rtl-dfinish
5614 @opindex fdump-rtl-regclass
5615 @opindex fdump-rtl-subregs_of_mode_init
5616 @opindex fdump-rtl-subregs_of_mode_finish
5617 @opindex fdump-rtl-dfinit
5618 @opindex fdump-rtl-dfinish
5619 These dumps are defined but always produce empty files.
5621 @item -da
5622 @itemx -fdump-rtl-all
5623 @opindex da
5624 @opindex fdump-rtl-all
5625 Produce all the dumps listed above.
5627 @item -dA
5628 @opindex dA
5629 Annotate the assembler output with miscellaneous debugging information.
5631 @item -dD
5632 @opindex dD
5633 Dump all macro definitions, at the end of preprocessing, in addition to
5634 normal output.
5636 @item -dH
5637 @opindex dH
5638 Produce a core dump whenever an error occurs.
5640 @item -dp
5641 @opindex dp
5642 Annotate the assembler output with a comment indicating which
5643 pattern and alternative is used.  The length of each instruction is
5644 also printed.
5646 @item -dP
5647 @opindex dP
5648 Dump the RTL in the assembler output as a comment before each instruction.
5649 Also turns on @option{-dp} annotation.
5651 @item -dv
5652 @opindex dv
5653 For each of the other indicated dump files (@option{-fdump-rtl-@var{pass}}),
5654 dump a representation of the control flow graph suitable for viewing with VCG
5655 to @file{@var{file}.@var{pass}.vcg}.
5657 @item -dx
5658 @opindex dx
5659 Just generate RTL for a function instead of compiling it.  Usually used
5660 with @option{-fdump-rtl-expand}.
5661 @end table
5663 @item -fdump-noaddr
5664 @opindex fdump-noaddr
5665 When doing debugging dumps, suppress address output.  This makes it more
5666 feasible to use diff on debugging dumps for compiler invocations with
5667 different compiler binaries and/or different
5668 text / bss / data / heap / stack / dso start locations.
5670 @item -fdump-unnumbered
5671 @opindex fdump-unnumbered
5672 When doing debugging dumps, suppress instruction numbers and address output.
5673 This makes it more feasible to use diff on debugging dumps for compiler
5674 invocations with different options, in particular with and without
5675 @option{-g}.
5677 @item -fdump-unnumbered-links
5678 @opindex fdump-unnumbered-links
5679 When doing debugging dumps (see @option{-d} option above), suppress
5680 instruction numbers for the links to the previous and next instructions
5681 in a sequence.
5683 @item -fdump-translation-unit @r{(C++ only)}
5684 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
5685 @opindex fdump-translation-unit
5686 Dump a representation of the tree structure for the entire translation
5687 unit to a file.  The file name is made by appending @file{.tu} to the
5688 source file name, and the file is created in the same directory as the
5689 output file.  If the @samp{-@var{options}} form is used, @var{options}
5690 controls the details of the dump as described for the
5691 @option{-fdump-tree} options.
5693 @item -fdump-class-hierarchy @r{(C++ only)}
5694 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
5695 @opindex fdump-class-hierarchy
5696 Dump a representation of each class's hierarchy and virtual function
5697 table layout to a file.  The file name is made by appending
5698 @file{.class} to the source file name, and the file is created in the
5699 same directory as the output file.  If the @samp{-@var{options}} form
5700 is used, @var{options} controls the details of the dump as described
5701 for the @option{-fdump-tree} options.
5703 @item -fdump-ipa-@var{switch}
5704 @opindex fdump-ipa
5705 Control the dumping at various stages of inter-procedural analysis
5706 language tree to a file.  The file name is generated by appending a
5707 switch specific suffix to the source file name, and the file is created
5708 in the same directory as the output file.  The following dumps are
5709 possible:
5711 @table @samp
5712 @item all
5713 Enables all inter-procedural analysis dumps.
5715 @item cgraph
5716 Dumps information about call-graph optimization, unused function removal,
5717 and inlining decisions.
5719 @item inline
5720 Dump after function inlining.
5722 @end table
5724 @item -fdump-passes
5725 @opindex fdump-passes
5726 Dump the list of optimization passes that are turned on and off by
5727 the current command-line options.
5729 @item -fdump-statistics-@var{option}
5730 @opindex fdump-statistics
5731 Enable and control dumping of pass statistics in a separate file.  The
5732 file name is generated by appending a suffix ending in
5733 @samp{.statistics} to the source file name, and the file is created in
5734 the same directory as the output file.  If the @samp{-@var{option}}
5735 form is used, @samp{-stats} causes counters to be summed over the
5736 whole compilation unit while @samp{-details} dumps every event as
5737 the passes generate them.  The default with no option is to sum
5738 counters for each function compiled.
5740 @item -fdump-tree-@var{switch}
5741 @itemx -fdump-tree-@var{switch}-@var{options}
5742 @opindex fdump-tree
5743 Control the dumping at various stages of processing the intermediate
5744 language tree to a file.  The file name is generated by appending a
5745 switch-specific suffix to the source file name, and the file is
5746 created in the same directory as the output file.  If the
5747 @samp{-@var{options}} form is used, @var{options} is a list of
5748 @samp{-} separated options which control the details of the dump.  Not
5749 all options are applicable to all dumps; those that are not
5750 meaningful are ignored.  The following options are available
5752 @table @samp
5753 @item address
5754 Print the address of each node.  Usually this is not meaningful as it
5755 changes according to the environment and source file.  Its primary use
5756 is for tying up a dump file with a debug environment.
5757 @item asmname
5758 If @code{DECL_ASSEMBLER_NAME} has been set for a given decl, use that
5759 in the dump instead of @code{DECL_NAME}.  Its primary use is ease of
5760 use working backward from mangled names in the assembly file.
5761 @item slim
5762 Inhibit dumping of members of a scope or body of a function merely
5763 because that scope has been reached.  Only dump such items when they
5764 are directly reachable by some other path.  When dumping pretty-printed
5765 trees, this option inhibits dumping the bodies of control structures.
5766 @item raw
5767 Print a raw representation of the tree.  By default, trees are
5768 pretty-printed into a C-like representation.
5769 @item details
5770 Enable more detailed dumps (not honored by every dump option).
5771 @item stats
5772 Enable dumping various statistics about the pass (not honored by every dump
5773 option).
5774 @item blocks
5775 Enable showing basic block boundaries (disabled in raw dumps).
5776 @item vops
5777 Enable showing virtual operands for every statement.
5778 @item lineno
5779 Enable showing line numbers for statements.
5780 @item uid
5781 Enable showing the unique ID (@code{DECL_UID}) for each variable.
5782 @item verbose
5783 Enable showing the tree dump for each statement.
5784 @item eh
5785 Enable showing the EH region number holding each statement.
5786 @item scev
5787 Enable showing scalar evolution analysis details.
5788 @item all
5789 Turn on all options, except @option{raw}, @option{slim}, @option{verbose}
5790 and @option{lineno}.
5791 @end table
5793 The following tree dumps are possible:
5794 @table @samp
5796 @item original
5797 @opindex fdump-tree-original
5798 Dump before any tree based optimization, to @file{@var{file}.original}.
5800 @item optimized
5801 @opindex fdump-tree-optimized
5802 Dump after all tree based optimization, to @file{@var{file}.optimized}.
5804 @item gimple
5805 @opindex fdump-tree-gimple
5806 Dump each function before and after the gimplification pass to a file.  The
5807 file name is made by appending @file{.gimple} to the source file name.
5809 @item cfg
5810 @opindex fdump-tree-cfg
5811 Dump the control flow graph of each function to a file.  The file name is
5812 made by appending @file{.cfg} to the source file name.
5814 @item vcg
5815 @opindex fdump-tree-vcg
5816 Dump the control flow graph of each function to a file in VCG format.  The
5817 file name is made by appending @file{.vcg} to the source file name.  Note
5818 that if the file contains more than one function, the generated file cannot
5819 be used directly by VCG@.  You must cut and paste each function's
5820 graph into its own separate file first.
5822 @item ch
5823 @opindex fdump-tree-ch
5824 Dump each function after copying loop headers.  The file name is made by
5825 appending @file{.ch} to the source file name.
5827 @item ssa
5828 @opindex fdump-tree-ssa
5829 Dump SSA related information to a file.  The file name is made by appending
5830 @file{.ssa} to the source file name.
5832 @item alias
5833 @opindex fdump-tree-alias
5834 Dump aliasing information for each function.  The file name is made by
5835 appending @file{.alias} to the source file name.
5837 @item ccp
5838 @opindex fdump-tree-ccp
5839 Dump each function after CCP@.  The file name is made by appending
5840 @file{.ccp} to the source file name.
5842 @item storeccp
5843 @opindex fdump-tree-storeccp
5844 Dump each function after STORE-CCP@.  The file name is made by appending
5845 @file{.storeccp} to the source file name.
5847 @item pre
5848 @opindex fdump-tree-pre
5849 Dump trees after partial redundancy elimination.  The file name is made
5850 by appending @file{.pre} to the source file name.
5852 @item fre
5853 @opindex fdump-tree-fre
5854 Dump trees after full redundancy elimination.  The file name is made
5855 by appending @file{.fre} to the source file name.
5857 @item copyprop
5858 @opindex fdump-tree-copyprop
5859 Dump trees after copy propagation.  The file name is made
5860 by appending @file{.copyprop} to the source file name.
5862 @item store_copyprop
5863 @opindex fdump-tree-store_copyprop
5864 Dump trees after store copy-propagation.  The file name is made
5865 by appending @file{.store_copyprop} to the source file name.
5867 @item dce
5868 @opindex fdump-tree-dce
5869 Dump each function after dead code elimination.  The file name is made by
5870 appending @file{.dce} to the source file name.
5872 @item mudflap
5873 @opindex fdump-tree-mudflap
5874 Dump each function after adding mudflap instrumentation.  The file name is
5875 made by appending @file{.mudflap} to the source file name.
5877 @item sra
5878 @opindex fdump-tree-sra
5879 Dump each function after performing scalar replacement of aggregates.  The
5880 file name is made by appending @file{.sra} to the source file name.
5882 @item sink
5883 @opindex fdump-tree-sink
5884 Dump each function after performing code sinking.  The file name is made
5885 by appending @file{.sink} to the source file name.
5887 @item dom
5888 @opindex fdump-tree-dom
5889 Dump each function after applying dominator tree optimizations.  The file
5890 name is made by appending @file{.dom} to the source file name.
5892 @item dse
5893 @opindex fdump-tree-dse
5894 Dump each function after applying dead store elimination.  The file
5895 name is made by appending @file{.dse} to the source file name.
5897 @item phiopt
5898 @opindex fdump-tree-phiopt
5899 Dump each function after optimizing PHI nodes into straightline code.  The file
5900 name is made by appending @file{.phiopt} to the source file name.
5902 @item forwprop
5903 @opindex fdump-tree-forwprop
5904 Dump each function after forward propagating single use variables.  The file
5905 name is made by appending @file{.forwprop} to the source file name.
5907 @item copyrename
5908 @opindex fdump-tree-copyrename
5909 Dump each function after applying the copy rename optimization.  The file
5910 name is made by appending @file{.copyrename} to the source file name.
5912 @item nrv
5913 @opindex fdump-tree-nrv
5914 Dump each function after applying the named return value optimization on
5915 generic trees.  The file name is made by appending @file{.nrv} to the source
5916 file name.
5918 @item vect
5919 @opindex fdump-tree-vect
5920 Dump each function after applying vectorization of loops.  The file name is
5921 made by appending @file{.vect} to the source file name.
5923 @item slp
5924 @opindex fdump-tree-slp
5925 Dump each function after applying vectorization of basic blocks.  The file name
5926 is made by appending @file{.slp} to the source file name.
5928 @item vrp
5929 @opindex fdump-tree-vrp
5930 Dump each function after Value Range Propagation (VRP).  The file name
5931 is made by appending @file{.vrp} to the source file name.
5933 @item all
5934 @opindex fdump-tree-all
5935 Enable all the available tree dumps with the flags provided in this option.
5936 @end table
5938 @item -ftree-vectorizer-verbose=@var{n}
5939 @opindex ftree-vectorizer-verbose
5940 This option controls the amount of debugging output the vectorizer prints.
5941 This information is written to standard error, unless
5942 @option{-fdump-tree-all} or @option{-fdump-tree-vect} is specified,
5943 in which case it is output to the usual dump listing file, @file{.vect}.
5944 For @var{n}=0 no diagnostic information is reported.
5945 If @var{n}=1 the vectorizer reports each loop that got vectorized,
5946 and the total number of loops that got vectorized.
5947 If @var{n}=2 the vectorizer also reports non-vectorized loops that passed
5948 the first analysis phase (vect_analyze_loop_form) - i.e.@: countable,
5949 inner-most, single-bb, single-entry/exit loops.  This is the same verbosity
5950 level that @option{-fdump-tree-vect-stats} uses.
5951 Higher verbosity levels mean either more information dumped for each
5952 reported loop, or same amount of information reported for more loops:
5953 if @var{n}=3, vectorizer cost model information is reported.
5954 If @var{n}=4, alignment related information is added to the reports.
5955 If @var{n}=5, data-references related information (e.g.@: memory dependences,
5956 memory access-patterns) is added to the reports.
5957 If @var{n}=6, the vectorizer reports also non-vectorized inner-most loops
5958 that did not pass the first analysis phase (i.e., may not be countable, or
5959 may have complicated control-flow).
5960 If @var{n}=7, the vectorizer reports also non-vectorized nested loops.
5961 If @var{n}=8, SLP related information is added to the reports.
5962 For @var{n}=9, all the information the vectorizer generates during its
5963 analysis and transformation is reported.  This is the same verbosity level
5964 that @option{-fdump-tree-vect-details} uses.
5966 @item -frandom-seed=@var{string}
5967 @opindex frandom-seed
5968 This option provides a seed that GCC uses in place of
5969 random numbers in generating certain symbol names
5970 that have to be different in every compiled file.  It is also used to
5971 place unique stamps in coverage data files and the object files that
5972 produce them.  You can use the @option{-frandom-seed} option to produce
5973 reproducibly identical object files.
5975 The @var{string} should be different for every file you compile.
5977 @item -fsched-verbose=@var{n}
5978 @opindex fsched-verbose
5979 On targets that use instruction scheduling, this option controls the
5980 amount of debugging output the scheduler prints.  This information is
5981 written to standard error, unless @option{-fdump-rtl-sched1} or
5982 @option{-fdump-rtl-sched2} is specified, in which case it is output
5983 to the usual dump listing file, @file{.sched1} or @file{.sched2}
5984 respectively.  However for @var{n} greater than nine, the output is
5985 always printed to standard error.
5987 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
5988 same information as @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2}.
5989 For @var{n} greater than one, it also output basic block probabilities,
5990 detailed ready list information and unit/insn info.  For @var{n} greater
5991 than two, it includes RTL at abort point, control-flow and regions info.
5992 And for @var{n} over four, @option{-fsched-verbose} also includes
5993 dependence info.
5995 @item -save-temps
5996 @itemx -save-temps=cwd
5997 @opindex save-temps
5998 Store the usual ``temporary'' intermediate files permanently; place them
5999 in the current directory and name them based on the source file.  Thus,
6000 compiling @file{foo.c} with @option{-c -save-temps} produces files
6001 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
6002 preprocessed @file{foo.i} output file even though the compiler now
6003 normally uses an integrated preprocessor.
6005 When used in combination with the @option{-x} command-line option,
6006 @option{-save-temps} is sensible enough to avoid over writing an
6007 input source file with the same extension as an intermediate file.
6008 The corresponding intermediate file may be obtained by renaming the
6009 source file before using @option{-save-temps}.
6011 If you invoke GCC in parallel, compiling several different source
6012 files that share a common base name in different subdirectories or the
6013 same source file compiled for multiple output destinations, it is
6014 likely that the different parallel compilers will interfere with each
6015 other, and overwrite the temporary files.  For instance:
6017 @smallexample
6018 gcc -save-temps -o outdir1/foo.o indir1/foo.c&
6019 gcc -save-temps -o outdir2/foo.o indir2/foo.c&
6020 @end smallexample
6022 may result in @file{foo.i} and @file{foo.o} being written to
6023 simultaneously by both compilers.
6025 @item -save-temps=obj
6026 @opindex save-temps=obj
6027 Store the usual ``temporary'' intermediate files permanently.  If the
6028 @option{-o} option is used, the temporary files are based on the
6029 object file.  If the @option{-o} option is not used, the
6030 @option{-save-temps=obj} switch behaves like @option{-save-temps}.
6032 For example:
6034 @smallexample
6035 gcc -save-temps=obj -c foo.c
6036 gcc -save-temps=obj -c bar.c -o dir/xbar.o
6037 gcc -save-temps=obj foobar.c -o dir2/yfoobar
6038 @end smallexample
6040 @noindent
6041 creates @file{foo.i}, @file{foo.s}, @file{dir/xbar.i},
6042 @file{dir/xbar.s}, @file{dir2/yfoobar.i}, @file{dir2/yfoobar.s}, and
6043 @file{dir2/yfoobar.o}.
6045 @item -time@r{[}=@var{file}@r{]}
6046 @opindex time
6047 Report the CPU time taken by each subprocess in the compilation
6048 sequence.  For C source files, this is the compiler proper and assembler
6049 (plus the linker if linking is done).
6051 Without the specification of an output file, the output looks like this:
6053 @smallexample
6054 # cc1 0.12 0.01
6055 # as 0.00 0.01
6056 @end smallexample
6058 The first number on each line is the ``user time'', that is time spent
6059 executing the program itself.  The second number is ``system time'',
6060 time spent executing operating system routines on behalf of the program.
6061 Both numbers are in seconds.
6063 With the specification of an output file, the output is appended to the
6064 named file, and it looks like this:
6066 @smallexample
6067 0.12 0.01 cc1 @var{options}
6068 0.00 0.01 as @var{options}
6069 @end smallexample
6071 The ``user time'' and the ``system time'' are moved before the program
6072 name, and the options passed to the program are displayed, so that one
6073 can later tell what file was being compiled, and with which options.
6075 @item -fvar-tracking
6076 @opindex fvar-tracking
6077 Run variable tracking pass.  It computes where variables are stored at each
6078 position in code.  Better debugging information is then generated
6079 (if the debugging information format supports this information).
6081 It is enabled by default when compiling with optimization (@option{-Os},
6082 @option{-O}, @option{-O2}, @dots{}), debugging information (@option{-g}) and
6083 the debug info format supports it.
6085 @item -fvar-tracking-assignments
6086 @opindex fvar-tracking-assignments
6087 @opindex fno-var-tracking-assignments
6088 Annotate assignments to user variables early in the compilation and
6089 attempt to carry the annotations over throughout the compilation all the
6090 way to the end, in an attempt to improve debug information while
6091 optimizing.  Use of @option{-gdwarf-4} is recommended along with it.
6093 It can be enabled even if var-tracking is disabled, in which case
6094 annotations are created and maintained, but discarded at the end.
6096 @item -fvar-tracking-assignments-toggle
6097 @opindex fvar-tracking-assignments-toggle
6098 @opindex fno-var-tracking-assignments-toggle
6099 Toggle @option{-fvar-tracking-assignments}, in the same way that
6100 @option{-gtoggle} toggles @option{-g}.
6102 @item -print-file-name=@var{library}
6103 @opindex print-file-name
6104 Print the full absolute name of the library file @var{library} that
6105 would be used when linking---and don't do anything else.  With this
6106 option, GCC does not compile or link anything; it just prints the
6107 file name.
6109 @item -print-multi-directory
6110 @opindex print-multi-directory
6111 Print the directory name corresponding to the multilib selected by any
6112 other switches present in the command line.  This directory is supposed
6113 to exist in @env{GCC_EXEC_PREFIX}.
6115 @item -print-multi-lib
6116 @opindex print-multi-lib
6117 Print the mapping from multilib directory names to compiler switches
6118 that enable them.  The directory name is separated from the switches by
6119 @samp{;}, and each switch starts with an @samp{@@} instead of the
6120 @samp{-}, without spaces between multiple switches.  This is supposed to
6121 ease shell processing.
6123 @item -print-multi-os-directory
6124 @opindex print-multi-os-directory
6125 Print the path to OS libraries for the selected
6126 multilib, relative to some @file{lib} subdirectory.  If OS libraries are
6127 present in the @file{lib} subdirectory and no multilibs are used, this is
6128 usually just @file{.}, if OS libraries are present in @file{lib@var{suffix}}
6129 sibling directories this prints e.g.@: @file{../lib64}, @file{../lib} or
6130 @file{../lib32}, or if OS libraries are present in @file{lib/@var{subdir}}
6131 subdirectories it prints e.g.@: @file{amd64}, @file{sparcv9} or @file{ev6}.
6133 @item -print-prog-name=@var{program}
6134 @opindex print-prog-name
6135 Like @option{-print-file-name}, but searches for a program such as @samp{cpp}.
6137 @item -print-libgcc-file-name
6138 @opindex print-libgcc-file-name
6139 Same as @option{-print-file-name=libgcc.a}.
6141 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
6142 but you do want to link with @file{libgcc.a}.  You can do:
6144 @smallexample
6145 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
6146 @end smallexample
6148 @item -print-search-dirs
6149 @opindex print-search-dirs
6150 Print the name of the configured installation directory and a list of
6151 program and library directories @command{gcc} searches---and don't do anything else.
6153 This is useful when @command{gcc} prints the error message
6154 @samp{installation problem, cannot exec cpp0: No such file or directory}.
6155 To resolve this you either need to put @file{cpp0} and the other compiler
6156 components where @command{gcc} expects to find them, or you can set the environment
6157 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
6158 Don't forget the trailing @samp{/}.
6159 @xref{Environment Variables}.
6161 @item -print-sysroot
6162 @opindex print-sysroot
6163 Print the target sysroot directory that is used during
6164 compilation.  This is the target sysroot specified either at configure
6165 time or using the @option{--sysroot} option, possibly with an extra
6166 suffix that depends on compilation options.  If no target sysroot is
6167 specified, the option prints nothing.
6169 @item -print-sysroot-headers-suffix
6170 @opindex print-sysroot-headers-suffix
6171 Print the suffix added to the target sysroot when searching for
6172 headers, or give an error if the compiler is not configured with such
6173 a suffix---and don't do anything else.
6175 @item -dumpmachine
6176 @opindex dumpmachine
6177 Print the compiler's target machine (for example,
6178 @samp{i686-pc-linux-gnu})---and don't do anything else.
6180 @item -dumpversion
6181 @opindex dumpversion
6182 Print the compiler version (for example, @samp{3.0})---and don't do
6183 anything else.
6185 @item -dumpspecs
6186 @opindex dumpspecs
6187 Print the compiler's built-in specs---and don't do anything else.  (This
6188 is used when GCC itself is being built.)  @xref{Spec Files}.
6190 @item -feliminate-unused-debug-types
6191 @opindex feliminate-unused-debug-types
6192 Normally, when producing DWARF 2 output, GCC emits debugging
6193 information for all types declared in a compilation
6194 unit, regardless of whether or not they are actually used
6195 in that compilation unit.  Sometimes this is useful, such as
6196 if, in the debugger, you want to cast a value to a type that is
6197 not actually used in your program (but is declared).  More often,
6198 however, this results in a significant amount of wasted space.
6199 With this option, GCC avoids producing debug symbol output
6200 for types that are nowhere used in the source file being compiled.
6201 @end table
6203 @node Optimize Options
6204 @section Options That Control Optimization
6205 @cindex optimize options
6206 @cindex options, optimization
6208 These options control various sorts of optimizations.
6210 Without any optimization option, the compiler's goal is to reduce the
6211 cost of compilation and to make debugging produce the expected
6212 results.  Statements are independent: if you stop the program with a
6213 breakpoint between statements, you can then assign a new value to any
6214 variable or change the program counter to any other statement in the
6215 function and get exactly the results you expect from the source
6216 code.
6218 Turning on optimization flags makes the compiler attempt to improve
6219 the performance and/or code size at the expense of compilation time
6220 and possibly the ability to debug the program.
6222 The compiler performs optimization based on the knowledge it has of the
6223 program.  Compiling multiple files at once to a single output file mode allows
6224 the compiler to use information gained from all of the files when compiling
6225 each of them.
6227 Not all optimizations are controlled directly by a flag.  Only
6228 optimizations that have a flag are listed in this section.
6230 Most optimizations are only enabled if an @option{-O} level is set on
6231 the command line.  Otherwise they are disabled, even if individual
6232 optimization flags are specified.
6234 Depending on the target and how GCC was configured, a slightly different
6235 set of optimizations may be enabled at each @option{-O} level than
6236 those listed here.  You can invoke GCC with @option{-Q --help=optimizers}
6237 to find out the exact set of optimizations that are enabled at each level.
6238 @xref{Overall Options}, for examples.
6240 @table @gcctabopt
6241 @item -O
6242 @itemx -O1
6243 @opindex O
6244 @opindex O1
6245 Optimize.  Optimizing compilation takes somewhat more time, and a lot
6246 more memory for a large function.
6248 With @option{-O}, the compiler tries to reduce code size and execution
6249 time, without performing any optimizations that take a great deal of
6250 compilation time.
6252 @option{-O} turns on the following optimization flags:
6253 @gccoptlist{
6254 -fauto-inc-dec @gol
6255 -fcompare-elim @gol
6256 -fcprop-registers @gol
6257 -fdce @gol
6258 -fdefer-pop @gol
6259 -fdelayed-branch @gol
6260 -fdse @gol
6261 -fguess-branch-probability @gol
6262 -fif-conversion2 @gol
6263 -fif-conversion @gol
6264 -fipa-pure-const @gol
6265 -fipa-profile @gol
6266 -fipa-reference @gol
6267 -fmerge-constants
6268 -fsplit-wide-types @gol
6269 -ftree-bit-ccp @gol
6270 -ftree-builtin-call-dce @gol
6271 -ftree-ccp @gol
6272 -ftree-ch @gol
6273 -ftree-copyrename @gol
6274 -ftree-dce @gol
6275 -ftree-dominator-opts @gol
6276 -ftree-dse @gol
6277 -ftree-forwprop @gol
6278 -ftree-fre @gol
6279 -ftree-phiprop @gol
6280 -ftree-slsr @gol
6281 -ftree-sra @gol
6282 -ftree-pta @gol
6283 -ftree-ter @gol
6284 -funit-at-a-time}
6286 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
6287 where doing so does not interfere with debugging.
6289 @item -O2
6290 @opindex O2
6291 Optimize even more.  GCC performs nearly all supported optimizations
6292 that do not involve a space-speed tradeoff.
6293 As compared to @option{-O}, this option increases both compilation time
6294 and the performance of the generated code.
6296 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
6297 also turns on the following optimization flags:
6298 @gccoptlist{-fthread-jumps @gol
6299 -falign-functions  -falign-jumps @gol
6300 -falign-loops  -falign-labels @gol
6301 -fcaller-saves @gol
6302 -fcrossjumping @gol
6303 -fcse-follow-jumps  -fcse-skip-blocks @gol
6304 -fdelete-null-pointer-checks @gol
6305 -fdevirtualize @gol
6306 -fexpensive-optimizations @gol
6307 -fgcse  -fgcse-lm  @gol
6308 -fhoist-adjacent-loads @gol
6309 -finline-small-functions @gol
6310 -findirect-inlining @gol
6311 -fipa-sra @gol
6312 -foptimize-sibling-calls @gol
6313 -fpartial-inlining @gol
6314 -fpeephole2 @gol
6315 -fregmove @gol
6316 -freorder-blocks  -freorder-functions @gol
6317 -frerun-cse-after-loop  @gol
6318 -fsched-interblock  -fsched-spec @gol
6319 -fschedule-insns  -fschedule-insns2 @gol
6320 -fstrict-aliasing -fstrict-overflow @gol
6321 -ftree-switch-conversion -ftree-tail-merge @gol
6322 -ftree-pre @gol
6323 -ftree-vrp}
6325 Please note the warning under @option{-fgcse} about
6326 invoking @option{-O2} on programs that use computed gotos.
6328 @item -O3
6329 @opindex O3
6330 Optimize yet more.  @option{-O3} turns on all optimizations specified
6331 by @option{-O2} and also turns on the @option{-finline-functions},
6332 @option{-funswitch-loops}, @option{-fpredictive-commoning},
6333 @option{-fgcse-after-reload}, @option{-ftree-vectorize},
6334 @option{-fvect-cost-model},
6335 @option{-ftree-partial-pre} and @option{-fipa-cp-clone} options.
6337 @item -O0
6338 @opindex O0
6339 Reduce compilation time and make debugging produce the expected
6340 results.  This is the default.
6342 @item -Os
6343 @opindex Os
6344 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
6345 do not typically increase code size.  It also performs further
6346 optimizations designed to reduce code size.
6348 @option{-Os} disables the following optimization flags:
6349 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
6350 -falign-labels  -freorder-blocks  -freorder-blocks-and-partition @gol
6351 -fprefetch-loop-arrays  -ftree-vect-loop-version}
6353 @item -Ofast
6354 @opindex Ofast
6355 Disregard strict standards compliance.  @option{-Ofast} enables all
6356 @option{-O3} optimizations.  It also enables optimizations that are not
6357 valid for all standard-compliant programs.
6358 It turns on @option{-ffast-math} and the Fortran-specific
6359 @option{-fno-protect-parens} and @option{-fstack-arrays}.
6361 If you use multiple @option{-O} options, with or without level numbers,
6362 the last such option is the one that is effective.
6363 @end table
6365 Options of the form @option{-f@var{flag}} specify machine-independent
6366 flags.  Most flags have both positive and negative forms; the negative
6367 form of @option{-ffoo} is @option{-fno-foo}.  In the table
6368 below, only one of the forms is listed---the one you typically 
6369 use.  You can figure out the other form by either removing @samp{no-}
6370 or adding it.
6372 The following options control specific optimizations.  They are either
6373 activated by @option{-O} options or are related to ones that are.  You
6374 can use the following flags in the rare cases when ``fine-tuning'' of
6375 optimizations to be performed is desired.
6377 @table @gcctabopt
6378 @item -fno-default-inline
6379 @opindex fno-default-inline
6380 Do not make member functions inline by default merely because they are
6381 defined inside the class scope (C++ only).  Otherwise, when you specify
6382 @w{@option{-O}}, member functions defined inside class scope are compiled
6383 inline by default; i.e., you don't need to add @samp{inline} in front of
6384 the member function name.
6386 @item -fno-defer-pop
6387 @opindex fno-defer-pop
6388 Always pop the arguments to each function call as soon as that function
6389 returns.  For machines that must pop arguments after a function call,
6390 the compiler normally lets arguments accumulate on the stack for several
6391 function calls and pops them all at once.
6393 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6395 @item -fforward-propagate
6396 @opindex fforward-propagate
6397 Perform a forward propagation pass on RTL@.  The pass tries to combine two
6398 instructions and checks if the result can be simplified.  If loop unrolling
6399 is active, two passes are performed and the second is scheduled after
6400 loop unrolling.
6402 This option is enabled by default at optimization levels @option{-O},
6403 @option{-O2}, @option{-O3}, @option{-Os}.
6405 @item -ffp-contract=@var{style}
6406 @opindex ffp-contract
6407 @option{-ffp-contract=off} disables floating-point expression contraction.
6408 @option{-ffp-contract=fast} enables floating-point expression contraction
6409 such as forming of fused multiply-add operations if the target has
6410 native support for them.
6411 @option{-ffp-contract=on} enables floating-point expression contraction
6412 if allowed by the language standard.  This is currently not implemented
6413 and treated equal to @option{-ffp-contract=off}.
6415 The default is @option{-ffp-contract=fast}.
6417 @item -fomit-frame-pointer
6418 @opindex fomit-frame-pointer
6419 Don't keep the frame pointer in a register for functions that
6420 don't need one.  This avoids the instructions to save, set up and
6421 restore frame pointers; it also makes an extra register available
6422 in many functions.  @strong{It also makes debugging impossible on
6423 some machines.}
6425 On some machines, such as the VAX, this flag has no effect, because
6426 the standard calling sequence automatically handles the frame pointer
6427 and nothing is saved by pretending it doesn't exist.  The
6428 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
6429 whether a target machine supports this flag.  @xref{Registers,,Register
6430 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
6432 Starting with GCC version 4.6, the default setting (when not optimizing for
6433 size) for 32-bit GNU/Linux x86 and 32-bit Darwin x86 targets has been changed to
6434 @option{-fomit-frame-pointer}.  The default can be reverted to
6435 @option{-fno-omit-frame-pointer} by configuring GCC with the
6436 @option{--enable-frame-pointer} configure option.
6438 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6440 @item -foptimize-sibling-calls
6441 @opindex foptimize-sibling-calls
6442 Optimize sibling and tail recursive calls.
6444 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6446 @item -fno-inline
6447 @opindex fno-inline
6448 Do not expand any functions inline apart from those marked with
6449 the @code{always_inline} attribute.  This is the default when not
6450 optimizing.
6452 Single functions can be exempted from inlining by marking them
6453 with the @code{noinline} attribute.
6455 @item -finline-small-functions
6456 @opindex finline-small-functions
6457 Integrate functions into their callers when their body is smaller than expected
6458 function call code (so overall size of program gets smaller).  The compiler
6459 heuristically decides which functions are simple enough to be worth integrating
6460 in this way.  This inlining applies to all functions, even those not declared
6461 inline.
6463 Enabled at level @option{-O2}.
6465 @item -findirect-inlining
6466 @opindex findirect-inlining
6467 Inline also indirect calls that are discovered to be known at compile
6468 time thanks to previous inlining.  This option has any effect only
6469 when inlining itself is turned on by the @option{-finline-functions}
6470 or @option{-finline-small-functions} options.
6472 Enabled at level @option{-O2}.
6474 @item -finline-functions
6475 @opindex finline-functions
6476 Consider all functions for inlining, even if they are not declared inline.
6477 The compiler heuristically decides which functions are worth integrating
6478 in this way.
6480 If all calls to a given function are integrated, and the function is
6481 declared @code{static}, then the function is normally not output as
6482 assembler code in its own right.
6484 Enabled at level @option{-O3}.
6486 @item -finline-functions-called-once
6487 @opindex finline-functions-called-once
6488 Consider all @code{static} functions called once for inlining into their
6489 caller even if they are not marked @code{inline}.  If a call to a given
6490 function is integrated, then the function is not output as assembler code
6491 in its own right.
6493 Enabled at levels @option{-O1}, @option{-O2}, @option{-O3} and @option{-Os}.
6495 @item -fearly-inlining
6496 @opindex fearly-inlining
6497 Inline functions marked by @code{always_inline} and functions whose body seems
6498 smaller than the function call overhead early before doing
6499 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
6500 makes profiling significantly cheaper and usually inlining faster on programs
6501 having large chains of nested wrapper functions.
6503 Enabled by default.
6505 @item -fipa-sra
6506 @opindex fipa-sra
6507 Perform interprocedural scalar replacement of aggregates, removal of
6508 unused parameters and replacement of parameters passed by reference
6509 by parameters passed by value.
6511 Enabled at levels @option{-O2}, @option{-O3} and @option{-Os}.
6513 @item -finline-limit=@var{n}
6514 @opindex finline-limit
6515 By default, GCC limits the size of functions that can be inlined.  This flag
6516 allows coarse control of this limit.  @var{n} is the size of functions that
6517 can be inlined in number of pseudo instructions.
6519 Inlining is actually controlled by a number of parameters, which may be
6520 specified individually by using @option{--param @var{name}=@var{value}}.
6521 The @option{-finline-limit=@var{n}} option sets some of these parameters
6522 as follows:
6524 @table @gcctabopt
6525 @item max-inline-insns-single
6526 is set to @var{n}/2.
6527 @item max-inline-insns-auto
6528 is set to @var{n}/2.
6529 @end table
6531 See below for a documentation of the individual
6532 parameters controlling inlining and for the defaults of these parameters.
6534 @emph{Note:} there may be no value to @option{-finline-limit} that results
6535 in default behavior.
6537 @emph{Note:} pseudo instruction represents, in this particular context, an
6538 abstract measurement of function's size.  In no way does it represent a count
6539 of assembly instructions and as such its exact meaning might change from one
6540 release to an another.
6542 @item -fno-keep-inline-dllexport
6543 @opindex -fno-keep-inline-dllexport
6544 This is a more fine-grained version of @option{-fkeep-inline-functions},
6545 which applies only to functions that are declared using the @code{dllexport}
6546 attribute or declspec (@xref{Function Attributes,,Declaring Attributes of
6547 Functions}.)
6549 @item -fkeep-inline-functions
6550 @opindex fkeep-inline-functions
6551 In C, emit @code{static} functions that are declared @code{inline}
6552 into the object file, even if the function has been inlined into all
6553 of its callers.  This switch does not affect functions using the
6554 @code{extern inline} extension in GNU C90@.  In C++, emit any and all
6555 inline functions into the object file.
6557 @item -fkeep-static-consts
6558 @opindex fkeep-static-consts
6559 Emit variables declared @code{static const} when optimization isn't turned
6560 on, even if the variables aren't referenced.
6562 GCC enables this option by default.  If you want to force the compiler to
6563 check if a variable is referenced, regardless of whether or not
6564 optimization is turned on, use the @option{-fno-keep-static-consts} option.
6566 @item -fmerge-constants
6567 @opindex fmerge-constants
6568 Attempt to merge identical constants (string constants and floating-point
6569 constants) across compilation units.
6571 This option is the default for optimized compilation if the assembler and
6572 linker support it.  Use @option{-fno-merge-constants} to inhibit this
6573 behavior.
6575 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6577 @item -fmerge-all-constants
6578 @opindex fmerge-all-constants
6579 Attempt to merge identical constants and identical variables.
6581 This option implies @option{-fmerge-constants}.  In addition to
6582 @option{-fmerge-constants} this considers e.g.@: even constant initialized
6583 arrays or initialized constant variables with integral or floating-point
6584 types.  Languages like C or C++ require each variable, including multiple
6585 instances of the same variable in recursive calls, to have distinct locations,
6586 so using this option results in non-conforming
6587 behavior.
6589 @item -fmodulo-sched
6590 @opindex fmodulo-sched
6591 Perform swing modulo scheduling immediately before the first scheduling
6592 pass.  This pass looks at innermost loops and reorders their
6593 instructions by overlapping different iterations.
6595 @item -fmodulo-sched-allow-regmoves
6596 @opindex fmodulo-sched-allow-regmoves
6597 Perform more aggressive SMS-based modulo scheduling with register moves
6598 allowed.  By setting this flag certain anti-dependences edges are
6599 deleted, which triggers the generation of reg-moves based on the
6600 life-range analysis.  This option is effective only with
6601 @option{-fmodulo-sched} enabled.
6603 @item -fno-branch-count-reg
6604 @opindex fno-branch-count-reg
6605 Do not use ``decrement and branch'' instructions on a count register,
6606 but instead generate a sequence of instructions that decrement a
6607 register, compare it against zero, then branch based upon the result.
6608 This option is only meaningful on architectures that support such
6609 instructions, which include x86, PowerPC, IA-64 and S/390.
6611 The default is @option{-fbranch-count-reg}.
6613 @item -fno-function-cse
6614 @opindex fno-function-cse
6615 Do not put function addresses in registers; make each instruction that
6616 calls a constant function contain the function's address explicitly.
6618 This option results in less efficient code, but some strange hacks
6619 that alter the assembler output may be confused by the optimizations
6620 performed when this option is not used.
6622 The default is @option{-ffunction-cse}
6624 @item -fno-zero-initialized-in-bss
6625 @opindex fno-zero-initialized-in-bss
6626 If the target supports a BSS section, GCC by default puts variables that
6627 are initialized to zero into BSS@.  This can save space in the resulting
6628 code.
6630 This option turns off this behavior because some programs explicitly
6631 rely on variables going to the data section---e.g., so that the
6632 resulting executable can find the beginning of that section and/or make
6633 assumptions based on that.
6635 The default is @option{-fzero-initialized-in-bss}.
6637 @item -fmudflap -fmudflapth -fmudflapir
6638 @opindex fmudflap
6639 @opindex fmudflapth
6640 @opindex fmudflapir
6641 @cindex bounds checking
6642 @cindex mudflap
6643 For front-ends that support it (C and C++), instrument all risky
6644 pointer/array dereferencing operations, some standard library
6645 string/heap functions, and some other associated constructs with
6646 range/validity tests.  Modules so instrumented should be immune to
6647 buffer overflows, invalid heap use, and some other classes of C/C++
6648 programming errors.  The instrumentation relies on a separate runtime
6649 library (@file{libmudflap}), which is linked into a program if
6650 @option{-fmudflap} is given at link time.  Run-time behavior of the
6651 instrumented program is controlled by the @env{MUDFLAP_OPTIONS}
6652 environment variable.  See @code{env MUDFLAP_OPTIONS=-help a.out}
6653 for its options.
6655 Use @option{-fmudflapth} instead of @option{-fmudflap} to compile and to
6656 link if your program is multi-threaded.  Use @option{-fmudflapir}, in
6657 addition to @option{-fmudflap} or @option{-fmudflapth}, if
6658 instrumentation should ignore pointer reads.  This produces less
6659 instrumentation (and therefore faster execution) and still provides
6660 some protection against outright memory corrupting writes, but allows
6661 erroneously read data to propagate within a program.
6663 @item -fthread-jumps
6664 @opindex fthread-jumps
6665 Perform optimizations that check to see if a jump branches to a
6666 location where another comparison subsumed by the first is found.  If
6667 so, the first branch is redirected to either the destination of the
6668 second branch or a point immediately following it, depending on whether
6669 the condition is known to be true or false.
6671 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6673 @item -fsplit-wide-types
6674 @opindex fsplit-wide-types
6675 When using a type that occupies multiple registers, such as @code{long
6676 long} on a 32-bit system, split the registers apart and allocate them
6677 independently.  This normally generates better code for those types,
6678 but may make debugging more difficult.
6680 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
6681 @option{-Os}.
6683 @item -fcse-follow-jumps
6684 @opindex fcse-follow-jumps
6685 In common subexpression elimination (CSE), scan through jump instructions
6686 when the target of the jump is not reached by any other path.  For
6687 example, when CSE encounters an @code{if} statement with an
6688 @code{else} clause, CSE follows the jump when the condition
6689 tested is false.
6691 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6693 @item -fcse-skip-blocks
6694 @opindex fcse-skip-blocks
6695 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
6696 follow jumps that conditionally skip over blocks.  When CSE
6697 encounters a simple @code{if} statement with no else clause,
6698 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
6699 body of the @code{if}.
6701 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6703 @item -frerun-cse-after-loop
6704 @opindex frerun-cse-after-loop
6705 Re-run common subexpression elimination after loop optimizations are
6706 performed.
6708 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6710 @item -fgcse
6711 @opindex fgcse
6712 Perform a global common subexpression elimination pass.
6713 This pass also performs global constant and copy propagation.
6715 @emph{Note:} When compiling a program using computed gotos, a GCC
6716 extension, you may get better run-time performance if you disable
6717 the global common subexpression elimination pass by adding
6718 @option{-fno-gcse} to the command line.
6720 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6722 @item -fgcse-lm
6723 @opindex fgcse-lm
6724 When @option{-fgcse-lm} is enabled, global common subexpression elimination
6725 attempts to move loads that are only killed by stores into themselves.  This
6726 allows a loop containing a load/store sequence to be changed to a load outside
6727 the loop, and a copy/store within the loop.
6729 Enabled by default when @option{-fgcse} is enabled.
6731 @item -fgcse-sm
6732 @opindex fgcse-sm
6733 When @option{-fgcse-sm} is enabled, a store motion pass is run after
6734 global common subexpression elimination.  This pass attempts to move
6735 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
6736 loops containing a load/store sequence can be changed to a load before
6737 the loop and a store after the loop.
6739 Not enabled at any optimization level.
6741 @item -fgcse-las
6742 @opindex fgcse-las
6743 When @option{-fgcse-las} is enabled, the global common subexpression
6744 elimination pass eliminates redundant loads that come after stores to the
6745 same memory location (both partial and full redundancies).
6747 Not enabled at any optimization level.
6749 @item -fgcse-after-reload
6750 @opindex fgcse-after-reload
6751 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
6752 pass is performed after reload.  The purpose of this pass is to clean up
6753 redundant spilling.
6755 @item -funsafe-loop-optimizations
6756 @opindex funsafe-loop-optimizations
6757 This option tells the loop optimizer to assume that loop indices do not
6758 overflow, and that loops with nontrivial exit condition are not
6759 infinite.  This enables a wider range of loop optimizations even if
6760 the loop optimizer itself cannot prove that these assumptions are valid.
6761 If you use @option{-Wunsafe-loop-optimizations}, the compiler warns you
6762 if it finds this kind of loop.
6764 @item -fcrossjumping
6765 @opindex fcrossjumping
6766 Perform cross-jumping transformation.
6767 This transformation unifies equivalent code and saves code size.  The
6768 resulting code may or may not perform better than without cross-jumping.
6770 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6772 @item -fauto-inc-dec
6773 @opindex fauto-inc-dec
6774 Combine increments or decrements of addresses with memory accesses.
6775 This pass is always skipped on architectures that do not have
6776 instructions to support this.  Enabled by default at @option{-O} and
6777 higher on architectures that support this.
6779 @item -fdce
6780 @opindex fdce
6781 Perform dead code elimination (DCE) on RTL@.
6782 Enabled by default at @option{-O} and higher.
6784 @item -fdse
6785 @opindex fdse
6786 Perform dead store elimination (DSE) on RTL@.
6787 Enabled by default at @option{-O} and higher.
6789 @item -fif-conversion
6790 @opindex fif-conversion
6791 Attempt to transform conditional jumps into branch-less equivalents.  This
6792 includes use of conditional moves, min, max, set flags and abs instructions, and
6793 some tricks doable by standard arithmetics.  The use of conditional execution
6794 on chips where it is available is controlled by @code{if-conversion2}.
6796 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6798 @item -fif-conversion2
6799 @opindex fif-conversion2
6800 Use conditional execution (where available) to transform conditional jumps into
6801 branch-less equivalents.
6803 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6805 @item -fdelete-null-pointer-checks
6806 @opindex fdelete-null-pointer-checks
6807 Assume that programs cannot safely dereference null pointers, and that
6808 no code or data element resides there.  This enables simple constant
6809 folding optimizations at all optimization levels.  In addition, other
6810 optimization passes in GCC use this flag to control global dataflow
6811 analyses that eliminate useless checks for null pointers; these assume
6812 that if a pointer is checked after it has already been dereferenced,
6813 it cannot be null.
6815 Note however that in some environments this assumption is not true.
6816 Use @option{-fno-delete-null-pointer-checks} to disable this optimization
6817 for programs that depend on that behavior.
6819 Some targets, especially embedded ones, disable this option at all levels.
6820 Otherwise it is enabled at all levels: @option{-O0}, @option{-O1},
6821 @option{-O2}, @option{-O3}, @option{-Os}.  Passes that use the information
6822 are enabled independently at different optimization levels.
6824 @item -fdevirtualize
6825 @opindex fdevirtualize
6826 Attempt to convert calls to virtual functions to direct calls.  This
6827 is done both within a procedure and interprocedurally as part of
6828 indirect inlining (@code{-findirect-inlining}) and interprocedural constant
6829 propagation (@option{-fipa-cp}).
6830 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6832 @item -fexpensive-optimizations
6833 @opindex fexpensive-optimizations
6834 Perform a number of minor optimizations that are relatively expensive.
6836 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6838 @item -free
6839 @opindex free
6840 Attempt to remove redundant extension instructions.  This is especially
6841 helpful for the x86-64 architecture, which implicitly zero-extends in 64-bit
6842 registers after writing to their lower 32-bit half.
6844 Enabled for x86 at levels @option{-O2}, @option{-O3}.
6846 @item -foptimize-register-move
6847 @itemx -fregmove
6848 @opindex foptimize-register-move
6849 @opindex fregmove
6850 Attempt to reassign register numbers in move instructions and as
6851 operands of other simple instructions in order to maximize the amount of
6852 register tying.  This is especially helpful on machines with two-operand
6853 instructions.
6855 Note @option{-fregmove} and @option{-foptimize-register-move} are the same
6856 optimization.
6858 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6860 @item -fira-algorithm=@var{algorithm}
6861 Use the specified coloring algorithm for the integrated register
6862 allocator.  The @var{algorithm} argument can be @samp{priority}, which
6863 specifies Chow's priority coloring, or @samp{CB}, which specifies
6864 Chaitin-Briggs coloring.  Chaitin-Briggs coloring is not implemented
6865 for all architectures, but for those targets that do support it, it is
6866 the default because it generates better code.
6868 @item -fira-region=@var{region}
6869 Use specified regions for the integrated register allocator.  The
6870 @var{region} argument should be one of the following:
6872 @table @samp
6874 @item all
6875 Use all loops as register allocation regions.
6876 This can give the best results for machines with a small and/or
6877 irregular register set.
6879 @item mixed
6880 Use all loops except for loops with small register pressure 
6881 as the regions.  This value usually gives
6882 the best results in most cases and for most architectures,
6883 and is enabled by default when compiling with optimization for speed
6884 (@option{-O}, @option{-O2}, @dots{}).
6886 @item one
6887 Use all functions as a single region.  
6888 This typically results in the smallest code size, and is enabled by default for
6889 @option{-Os} or @option{-O0}.
6891 @end table
6893 @item -fira-loop-pressure
6894 @opindex fira-loop-pressure
6895 Use IRA to evaluate register pressure in loops for decisions to move
6896 loop invariants.  This option usually results in generation
6897 of faster and smaller code on machines with large register files (>= 32
6898 registers), but it can slow the compiler down.
6900 This option is enabled at level @option{-O3} for some targets.
6902 @item -fno-ira-share-save-slots
6903 @opindex fno-ira-share-save-slots
6904 Disable sharing of stack slots used for saving call-used hard
6905 registers living through a call.  Each hard register gets a
6906 separate stack slot, and as a result function stack frames are
6907 larger.
6909 @item -fno-ira-share-spill-slots
6910 @opindex fno-ira-share-spill-slots
6911 Disable sharing of stack slots allocated for pseudo-registers.  Each
6912 pseudo-register that does not get a hard register gets a separate
6913 stack slot, and as a result function stack frames are larger.
6915 @item -fira-verbose=@var{n}
6916 @opindex fira-verbose
6917 Control the verbosity of the dump file for the integrated register allocator.
6918 The default value is 5.  If the value @var{n} is greater or equal to 10,
6919 the dump output is sent to stderr using the same format as @var{n} minus 10.
6921 @item -fdelayed-branch
6922 @opindex fdelayed-branch
6923 If supported for the target machine, attempt to reorder instructions
6924 to exploit instruction slots available after delayed branch
6925 instructions.
6927 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6929 @item -fschedule-insns
6930 @opindex fschedule-insns
6931 If supported for the target machine, attempt to reorder instructions to
6932 eliminate execution stalls due to required data being unavailable.  This
6933 helps machines that have slow floating point or memory load instructions
6934 by allowing other instructions to be issued until the result of the load
6935 or floating-point instruction is required.
6937 Enabled at levels @option{-O2}, @option{-O3}.
6939 @item -fschedule-insns2
6940 @opindex fschedule-insns2
6941 Similar to @option{-fschedule-insns}, but requests an additional pass of
6942 instruction scheduling after register allocation has been done.  This is
6943 especially useful on machines with a relatively small number of
6944 registers and where memory load instructions take more than one cycle.
6946 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6948 @item -fno-sched-interblock
6949 @opindex fno-sched-interblock
6950 Don't schedule instructions across basic blocks.  This is normally
6951 enabled by default when scheduling before register allocation, i.e.@:
6952 with @option{-fschedule-insns} or at @option{-O2} or higher.
6954 @item -fno-sched-spec
6955 @opindex fno-sched-spec
6956 Don't allow speculative motion of non-load instructions.  This is normally
6957 enabled by default when scheduling before register allocation, i.e.@:
6958 with @option{-fschedule-insns} or at @option{-O2} or higher.
6960 @item -fsched-pressure
6961 @opindex fsched-pressure
6962 Enable register pressure sensitive insn scheduling before register
6963 allocation.  This only makes sense when scheduling before register
6964 allocation is enabled, i.e.@: with @option{-fschedule-insns} or at
6965 @option{-O2} or higher.  Usage of this option can improve the
6966 generated code and decrease its size by preventing register pressure
6967 increase above the number of available hard registers and subsequent
6968 spills in register allocation.
6970 @item -fsched-spec-load
6971 @opindex fsched-spec-load
6972 Allow speculative motion of some load instructions.  This only makes
6973 sense when scheduling before register allocation, i.e.@: with
6974 @option{-fschedule-insns} or at @option{-O2} or higher.
6976 @item -fsched-spec-load-dangerous
6977 @opindex fsched-spec-load-dangerous
6978 Allow speculative motion of more load instructions.  This only makes
6979 sense when scheduling before register allocation, i.e.@: with
6980 @option{-fschedule-insns} or at @option{-O2} or higher.
6982 @item -fsched-stalled-insns
6983 @itemx -fsched-stalled-insns=@var{n}
6984 @opindex fsched-stalled-insns
6985 Define how many insns (if any) can be moved prematurely from the queue
6986 of stalled insns into the ready list during the second scheduling pass.
6987 @option{-fno-sched-stalled-insns} means that no insns are moved
6988 prematurely, @option{-fsched-stalled-insns=0} means there is no limit
6989 on how many queued insns can be moved prematurely.
6990 @option{-fsched-stalled-insns} without a value is equivalent to
6991 @option{-fsched-stalled-insns=1}.
6993 @item -fsched-stalled-insns-dep
6994 @itemx -fsched-stalled-insns-dep=@var{n}
6995 @opindex fsched-stalled-insns-dep
6996 Define how many insn groups (cycles) are examined for a dependency
6997 on a stalled insn that is a candidate for premature removal from the queue
6998 of stalled insns.  This has an effect only during the second scheduling pass,
6999 and only if @option{-fsched-stalled-insns} is used.
7000 @option{-fno-sched-stalled-insns-dep} is equivalent to
7001 @option{-fsched-stalled-insns-dep=0}.
7002 @option{-fsched-stalled-insns-dep} without a value is equivalent to
7003 @option{-fsched-stalled-insns-dep=1}.
7005 @item -fsched2-use-superblocks
7006 @opindex fsched2-use-superblocks
7007 When scheduling after register allocation, use superblock scheduling.
7008 This allows motion across basic block boundaries,
7009 resulting in faster schedules.  This option is experimental, as not all machine
7010 descriptions used by GCC model the CPU closely enough to avoid unreliable
7011 results from the algorithm.
7013 This only makes sense when scheduling after register allocation, i.e.@: with
7014 @option{-fschedule-insns2} or at @option{-O2} or higher.
7016 @item -fsched-group-heuristic
7017 @opindex fsched-group-heuristic
7018 Enable the group heuristic in the scheduler.  This heuristic favors
7019 the instruction that belongs to a schedule group.  This is enabled
7020 by default when scheduling is enabled, i.e.@: with @option{-fschedule-insns}
7021 or @option{-fschedule-insns2} or at @option{-O2} or higher.
7023 @item -fsched-critical-path-heuristic
7024 @opindex fsched-critical-path-heuristic
7025 Enable the critical-path heuristic in the scheduler.  This heuristic favors
7026 instructions on the critical path.  This is enabled by default when
7027 scheduling is enabled, i.e.@: with @option{-fschedule-insns}
7028 or @option{-fschedule-insns2} or at @option{-O2} or higher.
7030 @item -fsched-spec-insn-heuristic
7031 @opindex fsched-spec-insn-heuristic
7032 Enable the speculative instruction heuristic in the scheduler.  This
7033 heuristic favors speculative instructions with greater dependency weakness.
7034 This is enabled by default when scheduling is enabled, i.e.@:
7035 with @option{-fschedule-insns} or @option{-fschedule-insns2}
7036 or at @option{-O2} or higher.
7038 @item -fsched-rank-heuristic
7039 @opindex fsched-rank-heuristic
7040 Enable the rank heuristic in the scheduler.  This heuristic favors
7041 the instruction belonging to a basic block with greater size or frequency.
7042 This is enabled by default when scheduling is enabled, i.e.@:
7043 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
7044 at @option{-O2} or higher.
7046 @item -fsched-last-insn-heuristic
7047 @opindex fsched-last-insn-heuristic
7048 Enable the last-instruction heuristic in the scheduler.  This heuristic
7049 favors the instruction that is less dependent on the last instruction
7050 scheduled.  This is enabled by default when scheduling is enabled,
7051 i.e.@: with @option{-fschedule-insns} or @option{-fschedule-insns2} or
7052 at @option{-O2} or higher.
7054 @item -fsched-dep-count-heuristic
7055 @opindex fsched-dep-count-heuristic
7056 Enable the dependent-count heuristic in the scheduler.  This heuristic
7057 favors the instruction that has more instructions depending on it.
7058 This is enabled by default when scheduling is enabled, i.e.@:
7059 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
7060 at @option{-O2} or higher.
7062 @item -freschedule-modulo-scheduled-loops
7063 @opindex freschedule-modulo-scheduled-loops
7064 Modulo scheduling is performed before traditional scheduling.  If a loop
7065 is modulo scheduled, later scheduling passes may change its schedule.  
7066 Use this option to control that behavior.
7068 @item -fselective-scheduling
7069 @opindex fselective-scheduling
7070 Schedule instructions using selective scheduling algorithm.  Selective
7071 scheduling runs instead of the first scheduler pass.
7073 @item -fselective-scheduling2
7074 @opindex fselective-scheduling2
7075 Schedule instructions using selective scheduling algorithm.  Selective
7076 scheduling runs instead of the second scheduler pass.
7078 @item -fsel-sched-pipelining
7079 @opindex fsel-sched-pipelining
7080 Enable software pipelining of innermost loops during selective scheduling.
7081 This option has no effect unless one of @option{-fselective-scheduling} or
7082 @option{-fselective-scheduling2} is turned on.
7084 @item -fsel-sched-pipelining-outer-loops
7085 @opindex fsel-sched-pipelining-outer-loops
7086 When pipelining loops during selective scheduling, also pipeline outer loops.
7087 This option has no effect unless @option{-fsel-sched-pipelining} is turned on.
7089 @item -fshrink-wrap
7090 @opindex fshrink-wrap
7091 Emit function prologues only before parts of the function that need it,
7092 rather than at the top of the function.  This flag is enabled by default at
7093 @option{-O} and higher.
7095 @item -fcaller-saves
7096 @opindex fcaller-saves
7097 Enable allocation of values to registers that are clobbered by
7098 function calls, by emitting extra instructions to save and restore the
7099 registers around such calls.  Such allocation is done only when it
7100 seems to result in better code.
7102 This option is always enabled by default on certain machines, usually
7103 those which have no call-preserved registers to use instead.
7105 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7107 @item -fcombine-stack-adjustments
7108 @opindex fcombine-stack-adjustments
7109 Tracks stack adjustments (pushes and pops) and stack memory references
7110 and then tries to find ways to combine them.
7112 Enabled by default at @option{-O1} and higher.
7114 @item -fconserve-stack
7115 @opindex fconserve-stack
7116 Attempt to minimize stack usage.  The compiler attempts to use less
7117 stack space, even if that makes the program slower.  This option
7118 implies setting the @option{large-stack-frame} parameter to 100
7119 and the @option{large-stack-frame-growth} parameter to 400.
7121 @item -ftree-reassoc
7122 @opindex ftree-reassoc
7123 Perform reassociation on trees.  This flag is enabled by default
7124 at @option{-O} and higher.
7126 @item -ftree-pre
7127 @opindex ftree-pre
7128 Perform partial redundancy elimination (PRE) on trees.  This flag is
7129 enabled by default at @option{-O2} and @option{-O3}.
7131 @item -ftree-partial-pre
7132 @opindex ftree-partial-pre
7133 Make partial redundancy elimination (PRE) more aggressive.  This flag is
7134 enabled by default at @option{-O3}.
7136 @item -ftree-forwprop
7137 @opindex ftree-forwprop
7138 Perform forward propagation on trees.  This flag is enabled by default
7139 at @option{-O} and higher.
7141 @item -ftree-fre
7142 @opindex ftree-fre
7143 Perform full redundancy elimination (FRE) on trees.  The difference
7144 between FRE and PRE is that FRE only considers expressions
7145 that are computed on all paths leading to the redundant computation.
7146 This analysis is faster than PRE, though it exposes fewer redundancies.
7147 This flag is enabled by default at @option{-O} and higher.
7149 @item -ftree-phiprop
7150 @opindex ftree-phiprop
7151 Perform hoisting of loads from conditional pointers on trees.  This
7152 pass is enabled by default at @option{-O} and higher.
7154 @item -fhoist-adjacent-loads
7155 @opindex hoist-adjacent-loads
7156 Speculatively hoist loads from both branches of an if-then-else if the
7157 loads are from adjacent locations in the same structure and the target
7158 architecture has a conditional move instruction.  This flag is enabled
7159 by default at @option{-O2} and higher.
7161 @item -ftree-copy-prop
7162 @opindex ftree-copy-prop
7163 Perform copy propagation on trees.  This pass eliminates unnecessary
7164 copy operations.  This flag is enabled by default at @option{-O} and
7165 higher.
7167 @item -fipa-pure-const
7168 @opindex fipa-pure-const
7169 Discover which functions are pure or constant.
7170 Enabled by default at @option{-O} and higher.
7172 @item -fipa-reference
7173 @opindex fipa-reference
7174 Discover which static variables do not escape the
7175 compilation unit.
7176 Enabled by default at @option{-O} and higher.
7178 @item -fipa-pta
7179 @opindex fipa-pta
7180 Perform interprocedural pointer analysis and interprocedural modification
7181 and reference analysis.  This option can cause excessive memory and
7182 compile-time usage on large compilation units.  It is not enabled by
7183 default at any optimization level.
7185 @item -fipa-profile
7186 @opindex fipa-profile
7187 Perform interprocedural profile propagation.  The functions called only from
7188 cold functions are marked as cold. Also functions executed once (such as
7189 @code{cold}, @code{noreturn}, static constructors or destructors) are identified. Cold
7190 functions and loop less parts of functions executed once are then optimized for
7191 size.
7192 Enabled by default at @option{-O} and higher.
7194 @item -fipa-cp
7195 @opindex fipa-cp
7196 Perform interprocedural constant propagation.
7197 This optimization analyzes the program to determine when values passed
7198 to functions are constants and then optimizes accordingly.
7199 This optimization can substantially increase performance
7200 if the application has constants passed to functions.
7201 This flag is enabled by default at @option{-O2}, @option{-Os} and @option{-O3}.
7203 @item -fipa-cp-clone
7204 @opindex fipa-cp-clone
7205 Perform function cloning to make interprocedural constant propagation stronger.
7206 When enabled, interprocedural constant propagation performs function cloning
7207 when externally visible function can be called with constant arguments.
7208 Because this optimization can create multiple copies of functions,
7209 it may significantly increase code size
7210 (see @option{--param ipcp-unit-growth=@var{value}}).
7211 This flag is enabled by default at @option{-O3}.
7213 @item -ftree-sink
7214 @opindex ftree-sink
7215 Perform forward store motion  on trees.  This flag is
7216 enabled by default at @option{-O} and higher.
7218 @item -ftree-bit-ccp
7219 @opindex ftree-bit-ccp
7220 Perform sparse conditional bit constant propagation on trees and propagate
7221 pointer alignment information.
7222 This pass only operates on local scalar variables and is enabled by default
7223 at @option{-O} and higher.  It requires that @option{-ftree-ccp} is enabled.
7225 @item -ftree-ccp
7226 @opindex ftree-ccp
7227 Perform sparse conditional constant propagation (CCP) on trees.  This
7228 pass only operates on local scalar variables and is enabled by default
7229 at @option{-O} and higher.
7231 @item -ftree-switch-conversion
7232 Perform conversion of simple initializations in a switch to
7233 initializations from a scalar array.  This flag is enabled by default
7234 at @option{-O2} and higher.
7236 @item -ftree-tail-merge
7237 Look for identical code sequences.  When found, replace one with a jump to the
7238 other.  This optimization is known as tail merging or cross jumping.  This flag
7239 is enabled by default at @option{-O2} and higher.  The compilation time
7240 in this pass can
7241 be limited using @option{max-tail-merge-comparisons} parameter and
7242 @option{max-tail-merge-iterations} parameter.
7244 @item -ftree-dce
7245 @opindex ftree-dce
7246 Perform dead code elimination (DCE) on trees.  This flag is enabled by
7247 default at @option{-O} and higher.
7249 @item -ftree-builtin-call-dce
7250 @opindex ftree-builtin-call-dce
7251 Perform conditional dead code elimination (DCE) for calls to built-in functions
7252 that may set @code{errno} but are otherwise side-effect free.  This flag is
7253 enabled by default at @option{-O2} and higher if @option{-Os} is not also
7254 specified.
7256 @item -ftree-dominator-opts
7257 @opindex ftree-dominator-opts
7258 Perform a variety of simple scalar cleanups (constant/copy
7259 propagation, redundancy elimination, range propagation and expression
7260 simplification) based on a dominator tree traversal.  This also
7261 performs jump threading (to reduce jumps to jumps). This flag is
7262 enabled by default at @option{-O} and higher.
7264 @item -ftree-dse
7265 @opindex ftree-dse
7266 Perform dead store elimination (DSE) on trees.  A dead store is a store into
7267 a memory location that is later overwritten by another store without
7268 any intervening loads.  In this case the earlier store can be deleted.  This
7269 flag is enabled by default at @option{-O} and higher.
7271 @item -ftree-ch
7272 @opindex ftree-ch
7273 Perform loop header copying on trees.  This is beneficial since it increases
7274 effectiveness of code motion optimizations.  It also saves one jump.  This flag
7275 is enabled by default at @option{-O} and higher.  It is not enabled
7276 for @option{-Os}, since it usually increases code size.
7278 @item -ftree-loop-optimize
7279 @opindex ftree-loop-optimize
7280 Perform loop optimizations on trees.  This flag is enabled by default
7281 at @option{-O} and higher.
7283 @item -ftree-loop-linear
7284 @opindex ftree-loop-linear
7285 Perform loop interchange transformations on tree.  Same as
7286 @option{-floop-interchange}.  To use this code transformation, GCC has
7287 to be configured with @option{--with-ppl} and @option{--with-cloog} to
7288 enable the Graphite loop transformation infrastructure.
7290 @item -floop-interchange
7291 @opindex floop-interchange
7292 Perform loop interchange transformations on loops.  Interchanging two
7293 nested loops switches the inner and outer loops.  For example, given a
7294 loop like:
7295 @smallexample
7296 DO J = 1, M
7297   DO I = 1, N
7298     A(J, I) = A(J, I) * C
7299   ENDDO
7300 ENDDO
7301 @end smallexample
7302 loop interchange transforms the loop as if it were written:
7303 @smallexample
7304 DO I = 1, N
7305   DO J = 1, M
7306     A(J, I) = A(J, I) * C
7307   ENDDO
7308 ENDDO
7309 @end smallexample
7310 which can be beneficial when @code{N} is larger than the caches,
7311 because in Fortran, the elements of an array are stored in memory
7312 contiguously by column, and the original loop iterates over rows,
7313 potentially creating at each access a cache miss.  This optimization
7314 applies to all the languages supported by GCC and is not limited to
7315 Fortran.  To use this code transformation, GCC has to be configured
7316 with @option{--with-ppl} and @option{--with-cloog} to enable the
7317 Graphite loop transformation infrastructure.
7319 @item -floop-strip-mine
7320 @opindex floop-strip-mine
7321 Perform loop strip mining transformations on loops.  Strip mining
7322 splits a loop into two nested loops.  The outer loop has strides
7323 equal to the strip size and the inner loop has strides of the
7324 original loop within a strip.  The strip length can be changed
7325 using the @option{loop-block-tile-size} parameter.  For example,
7326 given a loop like:
7327 @smallexample
7328 DO I = 1, N
7329   A(I) = A(I) + C
7330 ENDDO
7331 @end smallexample
7332 loop strip mining transforms the loop as if it were written:
7333 @smallexample
7334 DO II = 1, N, 51
7335   DO I = II, min (II + 50, N)
7336     A(I) = A(I) + C
7337   ENDDO
7338 ENDDO
7339 @end smallexample
7340 This optimization applies to all the languages supported by GCC and is
7341 not limited to Fortran.  To use this code transformation, GCC has to
7342 be configured with @option{--with-ppl} and @option{--with-cloog} to
7343 enable the Graphite loop transformation infrastructure.
7345 @item -floop-block
7346 @opindex floop-block
7347 Perform loop blocking transformations on loops.  Blocking strip mines
7348 each loop in the loop nest such that the memory accesses of the
7349 element loops fit inside caches.  The strip length can be changed
7350 using the @option{loop-block-tile-size} parameter.  For example, given
7351 a loop like:
7352 @smallexample
7353 DO I = 1, N
7354   DO J = 1, M
7355     A(J, I) = B(I) + C(J)
7356   ENDDO
7357 ENDDO
7358 @end smallexample
7359 loop blocking transforms the loop as if it were written:
7360 @smallexample
7361 DO II = 1, N, 51
7362   DO JJ = 1, M, 51
7363     DO I = II, min (II + 50, N)
7364       DO J = JJ, min (JJ + 50, M)
7365         A(J, I) = B(I) + C(J)
7366       ENDDO
7367     ENDDO
7368   ENDDO
7369 ENDDO
7370 @end smallexample
7371 which can be beneficial when @code{M} is larger than the caches,
7372 because the innermost loop iterates over a smaller amount of data
7373 which can be kept in the caches.  This optimization applies to all the
7374 languages supported by GCC and is not limited to Fortran.  To use this
7375 code transformation, GCC has to be configured with @option{--with-ppl}
7376 and @option{--with-cloog} to enable the Graphite loop transformation
7377 infrastructure.
7379 @item -fgraphite-identity
7380 @opindex fgraphite-identity
7381 Enable the identity transformation for graphite.  For every SCoP we generate
7382 the polyhedral representation and transform it back to gimple.  Using
7383 @option{-fgraphite-identity} we can check the costs or benefits of the
7384 GIMPLE -> GRAPHITE -> GIMPLE transformation.  Some minimal optimizations
7385 are also performed by the code generator CLooG, like index splitting and
7386 dead code elimination in loops.
7388 @item -floop-nest-optimize
7389 @opindex floop-nest-optimize
7390 Enable the ISL based loop nest optimizer.  This is a generic loop nest
7391 optimizer based on the Pluto optimization algorithms.  It calculates a loop
7392 structure optimized for data-locality and parallelism.  This option
7393 is experimental.
7395 @item -floop-parallelize-all
7396 @opindex floop-parallelize-all
7397 Use the Graphite data dependence analysis to identify loops that can
7398 be parallelized.  Parallelize all the loops that can be analyzed to
7399 not contain loop carried dependences without checking that it is
7400 profitable to parallelize the loops.
7402 @item -fcheck-data-deps
7403 @opindex fcheck-data-deps
7404 Compare the results of several data dependence analyzers.  This option
7405 is used for debugging the data dependence analyzers.
7407 @item -ftree-loop-if-convert
7408 Attempt to transform conditional jumps in the innermost loops to
7409 branch-less equivalents.  The intent is to remove control-flow from
7410 the innermost loops in order to improve the ability of the
7411 vectorization pass to handle these loops.  This is enabled by default
7412 if vectorization is enabled.
7414 @item -ftree-loop-if-convert-stores
7415 Attempt to also if-convert conditional jumps containing memory writes.
7416 This transformation can be unsafe for multi-threaded programs as it
7417 transforms conditional memory writes into unconditional memory writes.
7418 For example,
7419 @smallexample
7420 for (i = 0; i < N; i++)
7421   if (cond)
7422     A[i] = expr;
7423 @end smallexample
7424 is transformed to
7425 @smallexample
7426 for (i = 0; i < N; i++)
7427   A[i] = cond ? expr : A[i];
7428 @end smallexample
7429 potentially producing data races.
7431 @item -ftree-loop-distribution
7432 Perform loop distribution.  This flag can improve cache performance on
7433 big loop bodies and allow further loop optimizations, like
7434 parallelization or vectorization, to take place.  For example, the loop
7435 @smallexample
7436 DO I = 1, N
7437   A(I) = B(I) + C
7438   D(I) = E(I) * F
7439 ENDDO
7440 @end smallexample
7441 is transformed to
7442 @smallexample
7443 DO I = 1, N
7444    A(I) = B(I) + C
7445 ENDDO
7446 DO I = 1, N
7447    D(I) = E(I) * F
7448 ENDDO
7449 @end smallexample
7451 @item -ftree-loop-distribute-patterns
7452 Perform loop distribution of patterns that can be code generated with
7453 calls to a library.  This flag is enabled by default at @option{-O3}.
7455 This pass distributes the initialization loops and generates a call to
7456 memset zero.  For example, the loop
7457 @smallexample
7458 DO I = 1, N
7459   A(I) = 0
7460   B(I) = A(I) + I
7461 ENDDO
7462 @end smallexample
7463 is transformed to
7464 @smallexample
7465 DO I = 1, N
7466    A(I) = 0
7467 ENDDO
7468 DO I = 1, N
7469    B(I) = A(I) + I
7470 ENDDO
7471 @end smallexample
7472 and the initialization loop is transformed into a call to memset zero.
7474 @item -ftree-loop-im
7475 @opindex ftree-loop-im
7476 Perform loop invariant motion on trees.  This pass moves only invariants that
7477 are hard to handle at RTL level (function calls, operations that expand to
7478 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
7479 operands of conditions that are invariant out of the loop, so that we can use
7480 just trivial invariantness analysis in loop unswitching.  The pass also includes
7481 store motion.
7483 @item -ftree-loop-ivcanon
7484 @opindex ftree-loop-ivcanon
7485 Create a canonical counter for number of iterations in loops for which
7486 determining number of iterations requires complicated analysis.  Later
7487 optimizations then may determine the number easily.  Useful especially
7488 in connection with unrolling.
7490 @item -fivopts
7491 @opindex fivopts
7492 Perform induction variable optimizations (strength reduction, induction
7493 variable merging and induction variable elimination) on trees.
7495 @item -ftree-parallelize-loops=n
7496 @opindex ftree-parallelize-loops
7497 Parallelize loops, i.e., split their iteration space to run in n threads.
7498 This is only possible for loops whose iterations are independent
7499 and can be arbitrarily reordered.  The optimization is only
7500 profitable on multiprocessor machines, for loops that are CPU-intensive,
7501 rather than constrained e.g.@: by memory bandwidth.  This option
7502 implies @option{-pthread}, and thus is only supported on targets
7503 that have support for @option{-pthread}.
7505 @item -ftree-pta
7506 @opindex ftree-pta
7507 Perform function-local points-to analysis on trees.  This flag is
7508 enabled by default at @option{-O} and higher.
7510 @item -ftree-sra
7511 @opindex ftree-sra
7512 Perform scalar replacement of aggregates.  This pass replaces structure
7513 references with scalars to prevent committing structures to memory too
7514 early.  This flag is enabled by default at @option{-O} and higher.
7516 @item -ftree-copyrename
7517 @opindex ftree-copyrename
7518 Perform copy renaming on trees.  This pass attempts to rename compiler
7519 temporaries to other variables at copy locations, usually resulting in
7520 variable names which more closely resemble the original variables.  This flag
7521 is enabled by default at @option{-O} and higher.
7523 @item -ftree-coalesce-inlined-vars
7524 Tell the copyrename pass (see @option{-ftree-copyrename}) to attempt to
7525 combine small user-defined variables too, but only if they were inlined
7526 from other functions.  It is a more limited form of
7527 @option{-ftree-coalesce-vars}.  This may harm debug information of such
7528 inlined variables, but it will keep variables of the inlined-into
7529 function apart from each other, such that they are more likely to
7530 contain the expected values in a debugging session.  This was the
7531 default in GCC versions older than 4.7.
7533 @item -ftree-coalesce-vars
7534 Tell the copyrename pass (see @option{-ftree-copyrename}) to attempt to
7535 combine small user-defined variables too, instead of just compiler
7536 temporaries.  This may severely limit the ability to debug an optimized
7537 program compiled with @option{-fno-var-tracking-assignments}.  In the
7538 negated form, this flag prevents SSA coalescing of user variables,
7539 including inlined ones.  This option is enabled by default.
7541 @item -ftree-ter
7542 @opindex ftree-ter
7543 Perform temporary expression replacement during the SSA->normal phase.  Single
7544 use/single def temporaries are replaced at their use location with their
7545 defining expression.  This results in non-GIMPLE code, but gives the expanders
7546 much more complex trees to work on resulting in better RTL generation.  This is
7547 enabled by default at @option{-O} and higher.
7549 @item -ftree-slsr
7550 @opindex ftree-slsr
7551 Perform straight-line strength reduction on trees.  This recognizes related
7552 expressions involving multiplications and replaces them by less expensive
7553 calculations when possible.  This is enabled by default at @option{-O} and
7554 higher.
7556 @item -ftree-vectorize
7557 @opindex ftree-vectorize
7558 Perform loop vectorization on trees. This flag is enabled by default at
7559 @option{-O3}.
7561 @item -ftree-slp-vectorize
7562 @opindex ftree-slp-vectorize
7563 Perform basic block vectorization on trees. This flag is enabled by default at
7564 @option{-O3} and when @option{-ftree-vectorize} is enabled.
7566 @item -ftree-vect-loop-version
7567 @opindex ftree-vect-loop-version
7568 Perform loop versioning when doing loop vectorization on trees.  When a loop
7569 appears to be vectorizable except that data alignment or data dependence cannot
7570 be determined at compile time, then vectorized and non-vectorized versions of
7571 the loop are generated along with run-time checks for alignment or dependence
7572 to control which version is executed.  This option is enabled by default
7573 except at level @option{-Os} where it is disabled.
7575 @item -fvect-cost-model
7576 @opindex fvect-cost-model
7577 Enable cost model for vectorization.  This option is enabled by default at
7578 @option{-O3}.
7580 @item -ftree-vrp
7581 @opindex ftree-vrp
7582 Perform Value Range Propagation on trees.  This is similar to the
7583 constant propagation pass, but instead of values, ranges of values are
7584 propagated.  This allows the optimizers to remove unnecessary range
7585 checks like array bound checks and null pointer checks.  This is
7586 enabled by default at @option{-O2} and higher.  Null pointer check
7587 elimination is only done if @option{-fdelete-null-pointer-checks} is
7588 enabled.
7590 @item -ftracer
7591 @opindex ftracer
7592 Perform tail duplication to enlarge superblock size.  This transformation
7593 simplifies the control flow of the function allowing other optimizations to do
7594 a better job.
7596 @item -funroll-loops
7597 @opindex funroll-loops
7598 Unroll loops whose number of iterations can be determined at compile
7599 time or upon entry to the loop.  @option{-funroll-loops} implies
7600 @option{-frerun-cse-after-loop}.  This option makes code larger,
7601 and may or may not make it run faster.
7603 @item -funroll-all-loops
7604 @opindex funroll-all-loops
7605 Unroll all loops, even if their number of iterations is uncertain when
7606 the loop is entered.  This usually makes programs run more slowly.
7607 @option{-funroll-all-loops} implies the same options as
7608 @option{-funroll-loops},
7610 @item -fsplit-ivs-in-unroller
7611 @opindex fsplit-ivs-in-unroller
7612 Enables expression of values of induction variables in later iterations
7613 of the unrolled loop using the value in the first iteration.  This breaks
7614 long dependency chains, thus improving efficiency of the scheduling passes.
7616 A combination of @option{-fweb} and CSE is often sufficient to obtain the
7617 same effect.  However, that is not reliable in cases where the loop body
7618 is more complicated than a single basic block.  It also does not work at all
7619 on some architectures due to restrictions in the CSE pass.
7621 This optimization is enabled by default.
7623 @item -fvariable-expansion-in-unroller
7624 @opindex fvariable-expansion-in-unroller
7625 With this option, the compiler creates multiple copies of some
7626 local variables when unrolling a loop, which can result in superior code.
7628 @item -fpartial-inlining
7629 @opindex fpartial-inlining
7630 Inline parts of functions.  This option has any effect only
7631 when inlining itself is turned on by the @option{-finline-functions}
7632 or @option{-finline-small-functions} options.
7634 Enabled at level @option{-O2}.
7636 @item -fpredictive-commoning
7637 @opindex fpredictive-commoning
7638 Perform predictive commoning optimization, i.e., reusing computations
7639 (especially memory loads and stores) performed in previous
7640 iterations of loops.
7642 This option is enabled at level @option{-O3}.
7644 @item -fprefetch-loop-arrays
7645 @opindex fprefetch-loop-arrays
7646 If supported by the target machine, generate instructions to prefetch
7647 memory to improve the performance of loops that access large arrays.
7649 This option may generate better or worse code; results are highly
7650 dependent on the structure of loops within the source code.
7652 Disabled at level @option{-Os}.
7654 @item -fno-peephole
7655 @itemx -fno-peephole2
7656 @opindex fno-peephole
7657 @opindex fno-peephole2
7658 Disable any machine-specific peephole optimizations.  The difference
7659 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
7660 are implemented in the compiler; some targets use one, some use the
7661 other, a few use both.
7663 @option{-fpeephole} is enabled by default.
7664 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7666 @item -fno-guess-branch-probability
7667 @opindex fno-guess-branch-probability
7668 Do not guess branch probabilities using heuristics.
7670 GCC uses heuristics to guess branch probabilities if they are
7671 not provided by profiling feedback (@option{-fprofile-arcs}).  These
7672 heuristics are based on the control flow graph.  If some branch probabilities
7673 are specified by @samp{__builtin_expect}, then the heuristics are
7674 used to guess branch probabilities for the rest of the control flow graph,
7675 taking the @samp{__builtin_expect} info into account.  The interactions
7676 between the heuristics and @samp{__builtin_expect} can be complex, and in
7677 some cases, it may be useful to disable the heuristics so that the effects
7678 of @samp{__builtin_expect} are easier to understand.
7680 The default is @option{-fguess-branch-probability} at levels
7681 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7683 @item -freorder-blocks
7684 @opindex freorder-blocks
7685 Reorder basic blocks in the compiled function in order to reduce number of
7686 taken branches and improve code locality.
7688 Enabled at levels @option{-O2}, @option{-O3}.
7690 @item -freorder-blocks-and-partition
7691 @opindex freorder-blocks-and-partition
7692 In addition to reordering basic blocks in the compiled function, in order
7693 to reduce number of taken branches, partitions hot and cold basic blocks
7694 into separate sections of the assembly and .o files, to improve
7695 paging and cache locality performance.
7697 This optimization is automatically turned off in the presence of
7698 exception handling, for linkonce sections, for functions with a user-defined
7699 section attribute and on any architecture that does not support named
7700 sections.
7702 @item -freorder-functions
7703 @opindex freorder-functions
7704 Reorder functions in the object file in order to
7705 improve code locality.  This is implemented by using special
7706 subsections @code{.text.hot} for most frequently executed functions and
7707 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
7708 the linker so object file format must support named sections and linker must
7709 place them in a reasonable way.
7711 Also profile feedback must be available to make this option effective.  See
7712 @option{-fprofile-arcs} for details.
7714 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7716 @item -fstrict-aliasing
7717 @opindex fstrict-aliasing
7718 Allow the compiler to assume the strictest aliasing rules applicable to
7719 the language being compiled.  For C (and C++), this activates
7720 optimizations based on the type of expressions.  In particular, an
7721 object of one type is assumed never to reside at the same address as an
7722 object of a different type, unless the types are almost the same.  For
7723 example, an @code{unsigned int} can alias an @code{int}, but not a
7724 @code{void*} or a @code{double}.  A character type may alias any other
7725 type.
7727 @anchor{Type-punning}Pay special attention to code like this:
7728 @smallexample
7729 union a_union @{
7730   int i;
7731   double d;
7734 int f() @{
7735   union a_union t;
7736   t.d = 3.0;
7737   return t.i;
7739 @end smallexample
7740 The practice of reading from a different union member than the one most
7741 recently written to (called ``type-punning'') is common.  Even with
7742 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
7743 is accessed through the union type.  So, the code above works as
7744 expected.  @xref{Structures unions enumerations and bit-fields
7745 implementation}.  However, this code might not:
7746 @smallexample
7747 int f() @{
7748   union a_union t;
7749   int* ip;
7750   t.d = 3.0;
7751   ip = &t.i;
7752   return *ip;
7754 @end smallexample
7756 Similarly, access by taking the address, casting the resulting pointer
7757 and dereferencing the result has undefined behavior, even if the cast
7758 uses a union type, e.g.:
7759 @smallexample
7760 int f() @{
7761   double d = 3.0;
7762   return ((union a_union *) &d)->i;
7764 @end smallexample
7766 The @option{-fstrict-aliasing} option is enabled at levels
7767 @option{-O2}, @option{-O3}, @option{-Os}.
7769 @item -fstrict-overflow
7770 @opindex fstrict-overflow
7771 Allow the compiler to assume strict signed overflow rules, depending
7772 on the language being compiled.  For C (and C++) this means that
7773 overflow when doing arithmetic with signed numbers is undefined, which
7774 means that the compiler may assume that it does not happen.  This
7775 permits various optimizations.  For example, the compiler assumes
7776 that an expression like @code{i + 10 > i} is always true for
7777 signed @code{i}.  This assumption is only valid if signed overflow is
7778 undefined, as the expression is false if @code{i + 10} overflows when
7779 using twos complement arithmetic.  When this option is in effect any
7780 attempt to determine whether an operation on signed numbers 
7781 overflows must be written carefully to not actually involve overflow.
7783 This option also allows the compiler to assume strict pointer
7784 semantics: given a pointer to an object, if adding an offset to that
7785 pointer does not produce a pointer to the same object, the addition is
7786 undefined.  This permits the compiler to conclude that @code{p + u >
7787 p} is always true for a pointer @code{p} and unsigned integer
7788 @code{u}.  This assumption is only valid because pointer wraparound is
7789 undefined, as the expression is false if @code{p + u} overflows using
7790 twos complement arithmetic.
7792 See also the @option{-fwrapv} option.  Using @option{-fwrapv} means
7793 that integer signed overflow is fully defined: it wraps.  When
7794 @option{-fwrapv} is used, there is no difference between
7795 @option{-fstrict-overflow} and @option{-fno-strict-overflow} for
7796 integers.  With @option{-fwrapv} certain types of overflow are
7797 permitted.  For example, if the compiler gets an overflow when doing
7798 arithmetic on constants, the overflowed value can still be used with
7799 @option{-fwrapv}, but not otherwise.
7801 The @option{-fstrict-overflow} option is enabled at levels
7802 @option{-O2}, @option{-O3}, @option{-Os}.
7804 @item -falign-functions
7805 @itemx -falign-functions=@var{n}
7806 @opindex falign-functions
7807 Align the start of functions to the next power-of-two greater than
7808 @var{n}, skipping up to @var{n} bytes.  For instance,
7809 @option{-falign-functions=32} aligns functions to the next 32-byte
7810 boundary, but @option{-falign-functions=24} aligns to the next
7811 32-byte boundary only if this can be done by skipping 23 bytes or less.
7813 @option{-fno-align-functions} and @option{-falign-functions=1} are
7814 equivalent and mean that functions are not aligned.
7816 Some assemblers only support this flag when @var{n} is a power of two;
7817 in that case, it is rounded up.
7819 If @var{n} is not specified or is zero, use a machine-dependent default.
7821 Enabled at levels @option{-O2}, @option{-O3}.
7823 @item -falign-labels
7824 @itemx -falign-labels=@var{n}
7825 @opindex falign-labels
7826 Align all branch targets to a power-of-two boundary, skipping up to
7827 @var{n} bytes like @option{-falign-functions}.  This option can easily
7828 make code slower, because it must insert dummy operations for when the
7829 branch target is reached in the usual flow of the code.
7831 @option{-fno-align-labels} and @option{-falign-labels=1} are
7832 equivalent and mean that labels are not aligned.
7834 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
7835 are greater than this value, then their values are used instead.
7837 If @var{n} is not specified or is zero, use a machine-dependent default
7838 which is very likely to be @samp{1}, meaning no alignment.
7840 Enabled at levels @option{-O2}, @option{-O3}.
7842 @item -falign-loops
7843 @itemx -falign-loops=@var{n}
7844 @opindex falign-loops
7845 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
7846 like @option{-falign-functions}.  If the loops are
7847 executed many times, this makes up for any execution of the dummy
7848 operations.
7850 @option{-fno-align-loops} and @option{-falign-loops=1} are
7851 equivalent and mean that loops are not aligned.
7853 If @var{n} is not specified or is zero, use a machine-dependent default.
7855 Enabled at levels @option{-O2}, @option{-O3}.
7857 @item -falign-jumps
7858 @itemx -falign-jumps=@var{n}
7859 @opindex falign-jumps
7860 Align branch targets to a power-of-two boundary, for branch targets
7861 where the targets can only be reached by jumping, skipping up to @var{n}
7862 bytes like @option{-falign-functions}.  In this case, no dummy operations
7863 need be executed.
7865 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
7866 equivalent and mean that loops are not aligned.
7868 If @var{n} is not specified or is zero, use a machine-dependent default.
7870 Enabled at levels @option{-O2}, @option{-O3}.
7872 @item -funit-at-a-time
7873 @opindex funit-at-a-time
7874 This option is left for compatibility reasons. @option{-funit-at-a-time}
7875 has no effect, while @option{-fno-unit-at-a-time} implies
7876 @option{-fno-toplevel-reorder} and @option{-fno-section-anchors}.
7878 Enabled by default.
7880 @item -fno-toplevel-reorder
7881 @opindex fno-toplevel-reorder
7882 Do not reorder top-level functions, variables, and @code{asm}
7883 statements.  Output them in the same order that they appear in the
7884 input file.  When this option is used, unreferenced static variables
7885 are not removed.  This option is intended to support existing code
7886 that relies on a particular ordering.  For new code, it is better to
7887 use attributes.
7889 Enabled at level @option{-O0}.  When disabled explicitly, it also implies
7890 @option{-fno-section-anchors}, which is otherwise enabled at @option{-O0} on some
7891 targets.
7893 @item -fweb
7894 @opindex fweb
7895 Constructs webs as commonly used for register allocation purposes and assign
7896 each web individual pseudo register.  This allows the register allocation pass
7897 to operate on pseudos directly, but also strengthens several other optimization
7898 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
7899 however, make debugging impossible, since variables no longer stay in a
7900 ``home register''.
7902 Enabled by default with @option{-funroll-loops}.
7904 @item -fwhole-program
7905 @opindex fwhole-program
7906 Assume that the current compilation unit represents the whole program being
7907 compiled.  All public functions and variables with the exception of @code{main}
7908 and those merged by attribute @code{externally_visible} become static functions
7909 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.
7910 While this option is equivalent to proper use of the @code{static} keyword for
7911 programs consisting of a single file, in combination with option
7912 @option{-flto} this flag can be used to
7913 compile many smaller scale programs since the functions and variables become
7914 local for the whole combined compilation unit, not for the single source file
7915 itself.
7917 This option implies @option{-fwhole-file} for Fortran programs.
7919 @item -flto[=@var{n}]
7920 @opindex flto
7921 This option runs the standard link-time optimizer.  When invoked
7922 with source code, it generates GIMPLE (one of GCC's internal
7923 representations) and writes it to special ELF sections in the object
7924 file.  When the object files are linked together, all the function
7925 bodies are read from these ELF sections and instantiated as if they
7926 had been part of the same translation unit.
7928 To use the link-time optimizer, @option{-flto} needs to be specified at
7929 compile time and during the final link.  For example:
7931 @smallexample
7932 gcc -c -O2 -flto foo.c
7933 gcc -c -O2 -flto bar.c
7934 gcc -o myprog -flto -O2 foo.o bar.o
7935 @end smallexample
7937 The first two invocations to GCC save a bytecode representation
7938 of GIMPLE into special ELF sections inside @file{foo.o} and
7939 @file{bar.o}.  The final invocation reads the GIMPLE bytecode from
7940 @file{foo.o} and @file{bar.o}, merges the two files into a single
7941 internal image, and compiles the result as usual.  Since both
7942 @file{foo.o} and @file{bar.o} are merged into a single image, this
7943 causes all the interprocedural analyses and optimizations in GCC to
7944 work across the two files as if they were a single one.  This means,
7945 for example, that the inliner is able to inline functions in
7946 @file{bar.o} into functions in @file{foo.o} and vice-versa.
7948 Another (simpler) way to enable link-time optimization is:
7950 @smallexample
7951 gcc -o myprog -flto -O2 foo.c bar.c
7952 @end smallexample
7954 The above generates bytecode for @file{foo.c} and @file{bar.c},
7955 merges them together into a single GIMPLE representation and optimizes
7956 them as usual to produce @file{myprog}.
7958 The only important thing to keep in mind is that to enable link-time
7959 optimizations the @option{-flto} flag needs to be passed to both the
7960 compile and the link commands.
7962 To make whole program optimization effective, it is necessary to make
7963 certain whole program assumptions.  The compiler needs to know
7964 what functions and variables can be accessed by libraries and runtime
7965 outside of the link-time optimized unit.  When supported by the linker,
7966 the linker plugin (see @option{-fuse-linker-plugin}) passes information
7967 to the compiler about used and externally visible symbols.  When
7968 the linker plugin is not available, @option{-fwhole-program} should be
7969 used to allow the compiler to make these assumptions, which leads
7970 to more aggressive optimization decisions.
7972 Note that when a file is compiled with @option{-flto}, the generated
7973 object file is larger than a regular object file because it 
7974 contains GIMPLE bytecodes and the usual final code.  This means that
7975 object files with LTO information can be linked as normal object
7976 files; if @option{-flto} is not passed to the linker, no
7977 interprocedural optimizations are applied.
7979 Additionally, the optimization flags used to compile individual files
7980 are not necessarily related to those used at link time.  For instance,
7982 @smallexample
7983 gcc -c -O0 -flto foo.c
7984 gcc -c -O0 -flto bar.c
7985 gcc -o myprog -flto -O3 foo.o bar.o
7986 @end smallexample
7988 This produces individual object files with unoptimized assembler
7989 code, but the resulting binary @file{myprog} is optimized at
7990 @option{-O3}.  If, instead, the final binary is generated without
7991 @option{-flto}, then @file{myprog} is not optimized.
7993 When producing the final binary with @option{-flto}, GCC only
7994 applies link-time optimizations to those files that contain bytecode.
7995 Therefore, you can mix and match object files and libraries with
7996 GIMPLE bytecodes and final object code.  GCC automatically selects
7997 which files to optimize in LTO mode and which files to link without
7998 further processing.
8000 There are some code generation flags preserved by GCC when
8001 generating bytecodes, as they need to be used during the final link
8002 stage.  Currently, the following options are saved into the GIMPLE
8003 bytecode files: @option{-fPIC}, @option{-fcommon} and all the
8004 @option{-m} target flags.
8006 At link time, these options are read in and reapplied.  Note that the
8007 current implementation makes no attempt to recognize conflicting
8008 values for these options.  If different files have conflicting option
8009 values (e.g., one file is compiled with @option{-fPIC} and another
8010 isn't), the compiler simply uses the last value read from the
8011 bytecode files.  It is recommended, then, that you compile all the files
8012 participating in the same link with the same options.
8014 If LTO encounters objects with C linkage declared with incompatible
8015 types in separate translation units to be linked together (undefined
8016 behavior according to ISO C99 6.2.7), a non-fatal diagnostic may be
8017 issued.  The behavior is still undefined at run time.
8019 Another feature of LTO is that it is possible to apply interprocedural
8020 optimizations on files written in different languages.  This requires
8021 support in the language front end.  Currently, the C, C++ and
8022 Fortran front ends are capable of emitting GIMPLE bytecodes, so
8023 something like this should work:
8025 @smallexample
8026 gcc -c -flto foo.c
8027 g++ -c -flto bar.cc
8028 gfortran -c -flto baz.f90
8029 g++ -o myprog -flto -O3 foo.o bar.o baz.o -lgfortran
8030 @end smallexample
8032 Notice that the final link is done with @command{g++} to get the C++
8033 runtime libraries and @option{-lgfortran} is added to get the Fortran
8034 runtime libraries.  In general, when mixing languages in LTO mode, you
8035 should use the same link command options as when mixing languages in a
8036 regular (non-LTO) compilation; all you need to add is @option{-flto} to
8037 all the compile and link commands.
8039 If object files containing GIMPLE bytecode are stored in a library archive, say
8040 @file{libfoo.a}, it is possible to extract and use them in an LTO link if you
8041 are using a linker with plugin support.  To enable this feature, use
8042 the flag @option{-fuse-linker-plugin} at link time:
8044 @smallexample
8045 gcc -o myprog -O2 -flto -fuse-linker-plugin a.o b.o -lfoo
8046 @end smallexample
8048 With the linker plugin enabled, the linker extracts the needed
8049 GIMPLE files from @file{libfoo.a} and passes them on to the running GCC
8050 to make them part of the aggregated GIMPLE image to be optimized.
8052 If you are not using a linker with plugin support and/or do not
8053 enable the linker plugin, then the objects inside @file{libfoo.a}
8054 are extracted and linked as usual, but they do not participate
8055 in the LTO optimization process.
8057 Link-time optimizations do not require the presence of the whole program to
8058 operate.  If the program does not require any symbols to be exported, it is
8059 possible to combine @option{-flto} and @option{-fwhole-program} to allow
8060 the interprocedural optimizers to use more aggressive assumptions which may
8061 lead to improved optimization opportunities.
8062 Use of @option{-fwhole-program} is not needed when linker plugin is
8063 active (see @option{-fuse-linker-plugin}).
8065 The current implementation of LTO makes no
8066 attempt to generate bytecode that is portable between different
8067 types of hosts.  The bytecode files are versioned and there is a
8068 strict version check, so bytecode files generated in one version of
8069 GCC will not work with an older/newer version of GCC@.
8071 Link-time optimization does not work well with generation of debugging
8072 information.  Combining @option{-flto} with
8073 @option{-g} is currently experimental and expected to produce wrong
8074 results.
8076 If you specify the optional @var{n}, the optimization and code
8077 generation done at link time is executed in parallel using @var{n}
8078 parallel jobs by utilizing an installed @command{make} program.  The
8079 environment variable @env{MAKE} may be used to override the program
8080 used.  The default value for @var{n} is 1.
8082 You can also specify @option{-flto=jobserver} to use GNU make's
8083 job server mode to determine the number of parallel jobs. This
8084 is useful when the Makefile calling GCC is already executing in parallel.
8085 You must prepend a @samp{+} to the command recipe in the parent Makefile
8086 for this to work.  This option likely only works if @env{MAKE} is
8087 GNU make.
8089 This option is disabled by default.
8091 @item -flto-partition=@var{alg}
8092 @opindex flto-partition
8093 Specify the partitioning algorithm used by the link-time optimizer.
8094 The value is either @code{1to1} to specify a partitioning mirroring
8095 the original source files or @code{balanced} to specify partitioning
8096 into equally sized chunks (whenever possible).  Specifying @code{none}
8097 as an algorithm disables partitioning and streaming completely. The
8098 default value is @code{balanced}.
8100 @item -flto-compression-level=@var{n}
8101 This option specifies the level of compression used for intermediate
8102 language written to LTO object files, and is only meaningful in
8103 conjunction with LTO mode (@option{-flto}).  Valid
8104 values are 0 (no compression) to 9 (maximum compression).  Values
8105 outside this range are clamped to either 0 or 9.  If the option is not
8106 given, a default balanced compression setting is used.
8108 @item -flto-report
8109 Prints a report with internal details on the workings of the link-time
8110 optimizer.  The contents of this report vary from version to version.
8111 It is meant to be useful to GCC developers when processing object
8112 files in LTO mode (via @option{-flto}).
8114 Disabled by default.
8116 @item -fuse-linker-plugin
8117 Enables the use of a linker plugin during link-time optimization.  This
8118 option relies on plugin support in the linker, which is available in gold
8119 or in GNU ld 2.21 or newer.
8121 This option enables the extraction of object files with GIMPLE bytecode out
8122 of library archives. This improves the quality of optimization by exposing
8123 more code to the link-time optimizer.  This information specifies what
8124 symbols can be accessed externally (by non-LTO object or during dynamic
8125 linking).  Resulting code quality improvements on binaries (and shared
8126 libraries that use hidden visibility) are similar to @code{-fwhole-program}.
8127 See @option{-flto} for a description of the effect of this flag and how to
8128 use it.
8130 This option is enabled by default when LTO support in GCC is enabled
8131 and GCC was configured for use with
8132 a linker supporting plugins (GNU ld 2.21 or newer or gold).
8134 @item -ffat-lto-objects
8135 @opindex ffat-lto-objects
8136 Fat LTO objects are object files that contain both the intermediate language
8137 and the object code. This makes them usable for both LTO linking and normal
8138 linking. This option is effective only when compiling with @option{-flto}
8139 and is ignored at link time.
8141 @option{-fno-fat-lto-objects} improves compilation time over plain LTO, but
8142 requires the complete toolchain to be aware of LTO. It requires a linker with
8143 linker plugin support for basic functionality.  Additionally,
8144 @command{nm}, @command{ar} and @command{ranlib}
8145 need to support linker plugins to allow a full-featured build environment
8146 (capable of building static libraries etc). gcc provides the @command{gcc-ar},
8147 @command{gcc-nm}, @command{gcc-ranlib} wrappers to pass the right options
8148 to these tools. With non fat LTO makefiles need to be modified to use them.
8150 The default is @option{-ffat-lto-objects} but this default is intended to
8151 change in future releases when linker plugin enabled environments become more
8152 common.
8154 @item -fcompare-elim
8155 @opindex fcompare-elim
8156 After register allocation and post-register allocation instruction splitting,
8157 identify arithmetic instructions that compute processor flags similar to a
8158 comparison operation based on that arithmetic.  If possible, eliminate the
8159 explicit comparison operation.
8161 This pass only applies to certain targets that cannot explicitly represent
8162 the comparison operation before register allocation is complete.
8164 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8166 @item -fcprop-registers
8167 @opindex fcprop-registers
8168 After register allocation and post-register allocation instruction splitting,
8169 perform a copy-propagation pass to try to reduce scheduling dependencies
8170 and occasionally eliminate the copy.
8172 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8174 @item -fprofile-correction
8175 @opindex fprofile-correction
8176 Profiles collected using an instrumented binary for multi-threaded programs may
8177 be inconsistent due to missed counter updates. When this option is specified,
8178 GCC uses heuristics to correct or smooth out such inconsistencies. By
8179 default, GCC emits an error message when an inconsistent profile is detected.
8181 @item -fprofile-dir=@var{path}
8182 @opindex fprofile-dir
8184 Set the directory to search for the profile data files in to @var{path}.
8185 This option affects only the profile data generated by
8186 @option{-fprofile-generate}, @option{-ftest-coverage}, @option{-fprofile-arcs}
8187 and used by @option{-fprofile-use} and @option{-fbranch-probabilities}
8188 and its related options.  Both absolute and relative paths can be used.
8189 By default, GCC uses the current directory as @var{path}, thus the
8190 profile data file appears in the same directory as the object file.
8192 @item -fprofile-generate
8193 @itemx -fprofile-generate=@var{path}
8194 @opindex fprofile-generate
8196 Enable options usually used for instrumenting application to produce
8197 profile useful for later recompilation with profile feedback based
8198 optimization.  You must use @option{-fprofile-generate} both when
8199 compiling and when linking your program.
8201 The following options are enabled: @code{-fprofile-arcs}, @code{-fprofile-values}, @code{-fvpt}.
8203 If @var{path} is specified, GCC looks at the @var{path} to find
8204 the profile feedback data files. See @option{-fprofile-dir}.
8206 @item -fprofile-use
8207 @itemx -fprofile-use=@var{path}
8208 @opindex fprofile-use
8209 Enable profile feedback directed optimizations, and optimizations
8210 generally profitable only with profile feedback available.
8212 The following options are enabled: @code{-fbranch-probabilities}, @code{-fvpt},
8213 @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}
8215 By default, GCC emits an error message if the feedback profiles do not
8216 match the source code.  This error can be turned into a warning by using
8217 @option{-Wcoverage-mismatch}.  Note this may result in poorly optimized
8218 code.
8220 If @var{path} is specified, GCC looks at the @var{path} to find
8221 the profile feedback data files. See @option{-fprofile-dir}.
8222 @end table
8224 The following options control compiler behavior regarding floating-point 
8225 arithmetic.  These options trade off between speed and
8226 correctness.  All must be specifically enabled.
8228 @table @gcctabopt
8229 @item -ffloat-store
8230 @opindex ffloat-store
8231 Do not store floating-point variables in registers, and inhibit other
8232 options that might change whether a floating-point value is taken from a
8233 register or memory.
8235 @cindex floating-point precision
8236 This option prevents undesirable excess precision on machines such as
8237 the 68000 where the floating registers (of the 68881) keep more
8238 precision than a @code{double} is supposed to have.  Similarly for the
8239 x86 architecture.  For most programs, the excess precision does only
8240 good, but a few programs rely on the precise definition of IEEE floating
8241 point.  Use @option{-ffloat-store} for such programs, after modifying
8242 them to store all pertinent intermediate computations into variables.
8244 @item -fexcess-precision=@var{style}
8245 @opindex fexcess-precision
8246 This option allows further control over excess precision on machines
8247 where floating-point registers have more precision than the IEEE
8248 @code{float} and @code{double} types and the processor does not
8249 support operations rounding to those types.  By default,
8250 @option{-fexcess-precision=fast} is in effect; this means that
8251 operations are carried out in the precision of the registers and that
8252 it is unpredictable when rounding to the types specified in the source
8253 code takes place.  When compiling C, if
8254 @option{-fexcess-precision=standard} is specified then excess
8255 precision follows the rules specified in ISO C99; in particular,
8256 both casts and assignments cause values to be rounded to their
8257 semantic types (whereas @option{-ffloat-store} only affects
8258 assignments).  This option is enabled by default for C if a strict
8259 conformance option such as @option{-std=c99} is used.
8261 @opindex mfpmath
8262 @option{-fexcess-precision=standard} is not implemented for languages
8263 other than C, and has no effect if
8264 @option{-funsafe-math-optimizations} or @option{-ffast-math} is
8265 specified.  On the x86, it also has no effect if @option{-mfpmath=sse}
8266 or @option{-mfpmath=sse+387} is specified; in the former case, IEEE
8267 semantics apply without excess precision, and in the latter, rounding
8268 is unpredictable.
8270 @item -ffast-math
8271 @opindex ffast-math
8272 Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations},
8273 @option{-ffinite-math-only}, @option{-fno-rounding-math},
8274 @option{-fno-signaling-nans} and @option{-fcx-limited-range}.
8276 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
8278 This option is not turned on by any @option{-O} option besides
8279 @option{-Ofast} since it can result in incorrect output for programs
8280 that depend on an exact implementation of IEEE or ISO rules/specifications
8281 for math functions. It may, however, yield faster code for programs
8282 that do not require the guarantees of these specifications.
8284 @item -fno-math-errno
8285 @opindex fno-math-errno
8286 Do not set @code{errno} after calling math functions that are executed
8287 with a single instruction, e.g., @code{sqrt}.  A program that relies on
8288 IEEE exceptions for math error handling may want to use this flag
8289 for speed while maintaining IEEE arithmetic compatibility.
8291 This option is not turned on by any @option{-O} option since
8292 it can result in incorrect output for programs that depend on
8293 an exact implementation of IEEE or ISO rules/specifications for
8294 math functions. It may, however, yield faster code for programs
8295 that do not require the guarantees of these specifications.
8297 The default is @option{-fmath-errno}.
8299 On Darwin systems, the math library never sets @code{errno}.  There is
8300 therefore no reason for the compiler to consider the possibility that
8301 it might, and @option{-fno-math-errno} is the default.
8303 @item -funsafe-math-optimizations
8304 @opindex funsafe-math-optimizations
8306 Allow optimizations for floating-point arithmetic that (a) assume
8307 that arguments and results are valid and (b) may violate IEEE or
8308 ANSI standards.  When used at link-time, it may include libraries
8309 or startup files that change the default FPU control word or other
8310 similar optimizations.
8312 This option is not turned on by any @option{-O} option since
8313 it can result in incorrect output for programs that depend on
8314 an exact implementation of IEEE or ISO rules/specifications for
8315 math functions. It may, however, yield faster code for programs
8316 that do not require the guarantees of these specifications.
8317 Enables @option{-fno-signed-zeros}, @option{-fno-trapping-math},
8318 @option{-fassociative-math} and @option{-freciprocal-math}.
8320 The default is @option{-fno-unsafe-math-optimizations}.
8322 @item -fassociative-math
8323 @opindex fassociative-math
8325 Allow re-association of operands in series of floating-point operations.
8326 This violates the ISO C and C++ language standard by possibly changing
8327 computation result.  NOTE: re-ordering may change the sign of zero as
8328 well as ignore NaNs and inhibit or create underflow or overflow (and
8329 thus cannot be used on code that relies on rounding behavior like
8330 @code{(x + 2**52) - 2**52}.  May also reorder floating-point comparisons
8331 and thus may not be used when ordered comparisons are required.
8332 This option requires that both @option{-fno-signed-zeros} and
8333 @option{-fno-trapping-math} be in effect.  Moreover, it doesn't make
8334 much sense with @option{-frounding-math}. For Fortran the option
8335 is automatically enabled when both @option{-fno-signed-zeros} and
8336 @option{-fno-trapping-math} are in effect.
8338 The default is @option{-fno-associative-math}.
8340 @item -freciprocal-math
8341 @opindex freciprocal-math
8343 Allow the reciprocal of a value to be used instead of dividing by
8344 the value if this enables optimizations.  For example @code{x / y}
8345 can be replaced with @code{x * (1/y)}, which is useful if @code{(1/y)}
8346 is subject to common subexpression elimination.  Note that this loses
8347 precision and increases the number of flops operating on the value.
8349 The default is @option{-fno-reciprocal-math}.
8351 @item -ffinite-math-only
8352 @opindex ffinite-math-only
8353 Allow optimizations for floating-point arithmetic that assume
8354 that arguments and results are not NaNs or +-Infs.
8356 This option is not turned on by any @option{-O} option since
8357 it can result in incorrect output for programs that depend on
8358 an exact implementation of IEEE or ISO rules/specifications for
8359 math functions. It may, however, yield faster code for programs
8360 that do not require the guarantees of these specifications.
8362 The default is @option{-fno-finite-math-only}.
8364 @item -fno-signed-zeros
8365 @opindex fno-signed-zeros
8366 Allow optimizations for floating-point arithmetic that ignore the
8367 signedness of zero.  IEEE arithmetic specifies the behavior of
8368 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
8369 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
8370 This option implies that the sign of a zero result isn't significant.
8372 The default is @option{-fsigned-zeros}.
8374 @item -fno-trapping-math
8375 @opindex fno-trapping-math
8376 Compile code assuming that floating-point operations cannot generate
8377 user-visible traps.  These traps include division by zero, overflow,
8378 underflow, inexact result and invalid operation.  This option requires
8379 that @option{-fno-signaling-nans} be in effect.  Setting this option may
8380 allow faster code if one relies on ``non-stop'' IEEE arithmetic, for example.
8382 This option should never be turned on by any @option{-O} option since
8383 it can result in incorrect output for programs that depend on
8384 an exact implementation of IEEE or ISO rules/specifications for
8385 math functions.
8387 The default is @option{-ftrapping-math}.
8389 @item -frounding-math
8390 @opindex frounding-math
8391 Disable transformations and optimizations that assume default floating-point
8392 rounding behavior.  This is round-to-zero for all floating point
8393 to integer conversions, and round-to-nearest for all other arithmetic
8394 truncations.  This option should be specified for programs that change
8395 the FP rounding mode dynamically, or that may be executed with a
8396 non-default rounding mode.  This option disables constant folding of
8397 floating-point expressions at compile time (which may be affected by
8398 rounding mode) and arithmetic transformations that are unsafe in the
8399 presence of sign-dependent rounding modes.
8401 The default is @option{-fno-rounding-math}.
8403 This option is experimental and does not currently guarantee to
8404 disable all GCC optimizations that are affected by rounding mode.
8405 Future versions of GCC may provide finer control of this setting
8406 using C99's @code{FENV_ACCESS} pragma.  This command-line option
8407 will be used to specify the default state for @code{FENV_ACCESS}.
8409 @item -fsignaling-nans
8410 @opindex fsignaling-nans
8411 Compile code assuming that IEEE signaling NaNs may generate user-visible
8412 traps during floating-point operations.  Setting this option disables
8413 optimizations that may change the number of exceptions visible with
8414 signaling NaNs.  This option implies @option{-ftrapping-math}.
8416 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
8417 be defined.
8419 The default is @option{-fno-signaling-nans}.
8421 This option is experimental and does not currently guarantee to
8422 disable all GCC optimizations that affect signaling NaN behavior.
8424 @item -fsingle-precision-constant
8425 @opindex fsingle-precision-constant
8426 Treat floating-point constants as single precision instead of
8427 implicitly converting them to double-precision constants.
8429 @item -fcx-limited-range
8430 @opindex fcx-limited-range
8431 When enabled, this option states that a range reduction step is not
8432 needed when performing complex division.  Also, there is no checking
8433 whether the result of a complex multiplication or division is @code{NaN
8434 + I*NaN}, with an attempt to rescue the situation in that case.  The
8435 default is @option{-fno-cx-limited-range}, but is enabled by
8436 @option{-ffast-math}.
8438 This option controls the default setting of the ISO C99
8439 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
8440 all languages.
8442 @item -fcx-fortran-rules
8443 @opindex fcx-fortran-rules
8444 Complex multiplication and division follow Fortran rules.  Range
8445 reduction is done as part of complex division, but there is no checking
8446 whether the result of a complex multiplication or division is @code{NaN
8447 + I*NaN}, with an attempt to rescue the situation in that case.
8449 The default is @option{-fno-cx-fortran-rules}.
8451 @end table
8453 The following options control optimizations that may improve
8454 performance, but are not enabled by any @option{-O} options.  This
8455 section includes experimental options that may produce broken code.
8457 @table @gcctabopt
8458 @item -fbranch-probabilities
8459 @opindex fbranch-probabilities
8460 After running a program compiled with @option{-fprofile-arcs}
8461 (@pxref{Debugging Options,, Options for Debugging Your Program or
8462 @command{gcc}}), you can compile it a second time using
8463 @option{-fbranch-probabilities}, to improve optimizations based on
8464 the number of times each branch was taken.  When a program
8465 compiled with @option{-fprofile-arcs} exits, it saves arc execution
8466 counts to a file called @file{@var{sourcename}.gcda} for each source
8467 file.  The information in this data file is very dependent on the
8468 structure of the generated code, so you must use the same source code
8469 and the same optimization options for both compilations.
8471 With @option{-fbranch-probabilities}, GCC puts a
8472 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
8473 These can be used to improve optimization.  Currently, they are only
8474 used in one place: in @file{reorg.c}, instead of guessing which path a
8475 branch is most likely to take, the @samp{REG_BR_PROB} values are used to
8476 exactly determine which path is taken more often.
8478 @item -fprofile-values
8479 @opindex fprofile-values
8480 If combined with @option{-fprofile-arcs}, it adds code so that some
8481 data about values of expressions in the program is gathered.
8483 With @option{-fbranch-probabilities}, it reads back the data gathered
8484 from profiling values of expressions for usage in optimizations.
8486 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
8488 @item -fvpt
8489 @opindex fvpt
8490 If combined with @option{-fprofile-arcs}, this option instructs the compiler
8491 to add code to gather information about values of expressions.
8493 With @option{-fbranch-probabilities}, it reads back the data gathered
8494 and actually performs the optimizations based on them.
8495 Currently the optimizations include specialization of division operations
8496 using the knowledge about the value of the denominator.
8498 @item -frename-registers
8499 @opindex frename-registers
8500 Attempt to avoid false dependencies in scheduled code by making use
8501 of registers left over after register allocation.  This optimization
8502 most benefits processors with lots of registers.  Depending on the
8503 debug information format adopted by the target, however, it can
8504 make debugging impossible, since variables no longer stay in
8505 a ``home register''.
8507 Enabled by default with @option{-funroll-loops} and @option{-fpeel-loops}.
8509 @item -ftracer
8510 @opindex ftracer
8511 Perform tail duplication to enlarge superblock size.  This transformation
8512 simplifies the control flow of the function allowing other optimizations to do
8513 a better job.
8515 Enabled with @option{-fprofile-use}.
8517 @item -funroll-loops
8518 @opindex funroll-loops
8519 Unroll loops whose number of iterations can be determined at compile time or
8520 upon entry to the loop.  @option{-funroll-loops} implies
8521 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
8522 It also turns on complete loop peeling (i.e.@: complete removal of loops with
8523 a small constant number of iterations).  This option makes code larger, and may
8524 or may not make it run faster.
8526 Enabled with @option{-fprofile-use}.
8528 @item -funroll-all-loops
8529 @opindex funroll-all-loops
8530 Unroll all loops, even if their number of iterations is uncertain when
8531 the loop is entered.  This usually makes programs run more slowly.
8532 @option{-funroll-all-loops} implies the same options as
8533 @option{-funroll-loops}.
8535 @item -fpeel-loops
8536 @opindex fpeel-loops
8537 Peels loops for which there is enough information that they do not
8538 roll much (from profile feedback).  It also turns on complete loop peeling
8539 (i.e.@: complete removal of loops with small constant number of iterations).
8541 Enabled with @option{-fprofile-use}.
8543 @item -fmove-loop-invariants
8544 @opindex fmove-loop-invariants
8545 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
8546 at level @option{-O1}
8548 @item -funswitch-loops
8549 @opindex funswitch-loops
8550 Move branches with loop invariant conditions out of the loop, with duplicates
8551 of the loop on both branches (modified according to result of the condition).
8553 @item -ffunction-sections
8554 @itemx -fdata-sections
8555 @opindex ffunction-sections
8556 @opindex fdata-sections
8557 Place each function or data item into its own section in the output
8558 file if the target supports arbitrary sections.  The name of the
8559 function or the name of the data item determines the section's name
8560 in the output file.
8562 Use these options on systems where the linker can perform optimizations
8563 to improve locality of reference in the instruction space.  Most systems
8564 using the ELF object format and SPARC processors running Solaris 2 have
8565 linkers with such optimizations.  AIX may have these optimizations in
8566 the future.
8568 Only use these options when there are significant benefits from doing
8569 so.  When you specify these options, the assembler and linker
8570 create larger object and executable files and are also slower.
8571 You cannot use @code{gprof} on all systems if you
8572 specify this option, and you may have problems with debugging if
8573 you specify both this option and @option{-g}.
8575 @item -fbranch-target-load-optimize
8576 @opindex fbranch-target-load-optimize
8577 Perform branch target register load optimization before prologue / epilogue
8578 threading.
8579 The use of target registers can typically be exposed only during reload,
8580 thus hoisting loads out of loops and doing inter-block scheduling needs
8581 a separate optimization pass.
8583 @item -fbranch-target-load-optimize2
8584 @opindex fbranch-target-load-optimize2
8585 Perform branch target register load optimization after prologue / epilogue
8586 threading.
8588 @item -fbtr-bb-exclusive
8589 @opindex fbtr-bb-exclusive
8590 When performing branch target register load optimization, don't reuse
8591 branch target registers within any basic block.
8593 @item -fstack-protector
8594 @opindex fstack-protector
8595 Emit extra code to check for buffer overflows, such as stack smashing
8596 attacks.  This is done by adding a guard variable to functions with
8597 vulnerable objects.  This includes functions that call @code{alloca}, and
8598 functions with buffers larger than 8 bytes.  The guards are initialized
8599 when a function is entered and then checked when the function exits.
8600 If a guard check fails, an error message is printed and the program exits.
8602 @item -fstack-protector-all
8603 @opindex fstack-protector-all
8604 Like @option{-fstack-protector} except that all functions are protected.
8606 @item -fsection-anchors
8607 @opindex fsection-anchors
8608 Try to reduce the number of symbolic address calculations by using
8609 shared ``anchor'' symbols to address nearby objects.  This transformation
8610 can help to reduce the number of GOT entries and GOT accesses on some
8611 targets.
8613 For example, the implementation of the following function @code{foo}:
8615 @smallexample
8616 static int a, b, c;
8617 int foo (void) @{ return a + b + c; @}
8618 @end smallexample
8620 @noindent
8621 usually calculates the addresses of all three variables, but if you
8622 compile it with @option{-fsection-anchors}, it accesses the variables
8623 from a common anchor point instead.  The effect is similar to the
8624 following pseudocode (which isn't valid C):
8626 @smallexample
8627 int foo (void)
8629   register int *xr = &x;
8630   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
8632 @end smallexample
8634 Not all targets support this option.
8636 @item --param @var{name}=@var{value}
8637 @opindex param
8638 In some places, GCC uses various constants to control the amount of
8639 optimization that is done.  For example, GCC does not inline functions
8640 that contain more than a certain number of instructions.  You can
8641 control some of these constants on the command line using the
8642 @option{--param} option.
8644 The names of specific parameters, and the meaning of the values, are
8645 tied to the internals of the compiler, and are subject to change
8646 without notice in future releases.
8648 In each case, the @var{value} is an integer.  The allowable choices for
8649 @var{name} are:
8651 @table @gcctabopt
8652 @item predictable-branch-outcome
8653 When branch is predicted to be taken with probability lower than this threshold
8654 (in percent), then it is considered well predictable. The default is 10.
8656 @item max-crossjump-edges
8657 The maximum number of incoming edges to consider for cross-jumping.
8658 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
8659 the number of edges incoming to each block.  Increasing values mean
8660 more aggressive optimization, making the compilation time increase with
8661 probably small improvement in executable size.
8663 @item min-crossjump-insns
8664 The minimum number of instructions that must be matched at the end
8665 of two blocks before cross-jumping is performed on them.  This
8666 value is ignored in the case where all instructions in the block being
8667 cross-jumped from are matched.  The default value is 5.
8669 @item max-grow-copy-bb-insns
8670 The maximum code size expansion factor when copying basic blocks
8671 instead of jumping.  The expansion is relative to a jump instruction.
8672 The default value is 8.
8674 @item max-goto-duplication-insns
8675 The maximum number of instructions to duplicate to a block that jumps
8676 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
8677 passes, GCC factors computed gotos early in the compilation process,
8678 and unfactors them as late as possible.  Only computed jumps at the
8679 end of a basic blocks with no more than max-goto-duplication-insns are
8680 unfactored.  The default value is 8.
8682 @item max-delay-slot-insn-search
8683 The maximum number of instructions to consider when looking for an
8684 instruction to fill a delay slot.  If more than this arbitrary number of
8685 instructions are searched, the time savings from filling the delay slot
8686 are minimal, so stop searching.  Increasing values mean more
8687 aggressive optimization, making the compilation time increase with probably
8688 small improvement in execution time.
8690 @item max-delay-slot-live-search
8691 When trying to fill delay slots, the maximum number of instructions to
8692 consider when searching for a block with valid live register
8693 information.  Increasing this arbitrarily chosen value means more
8694 aggressive optimization, increasing the compilation time.  This parameter
8695 should be removed when the delay slot code is rewritten to maintain the
8696 control-flow graph.
8698 @item max-gcse-memory
8699 The approximate maximum amount of memory that can be allocated in
8700 order to perform the global common subexpression elimination
8701 optimization.  If more memory than specified is required, the
8702 optimization is not done.
8704 @item max-gcse-insertion-ratio
8705 If the ratio of expression insertions to deletions is larger than this value
8706 for any expression, then RTL PRE inserts or removes the expression and thus
8707 leaves partially redundant computations in the instruction stream.  The default value is 20.
8709 @item max-pending-list-length
8710 The maximum number of pending dependencies scheduling allows
8711 before flushing the current state and starting over.  Large functions
8712 with few branches or calls can create excessively large lists which
8713 needlessly consume memory and resources.
8715 @item max-modulo-backtrack-attempts
8716 The maximum number of backtrack attempts the scheduler should make
8717 when modulo scheduling a loop.  Larger values can exponentially increase
8718 compilation time.
8720 @item max-inline-insns-single
8721 Several parameters control the tree inliner used in GCC@.
8722 This number sets the maximum number of instructions (counted in GCC's
8723 internal representation) in a single function that the tree inliner
8724 considers for inlining.  This only affects functions declared
8725 inline and methods implemented in a class declaration (C++).
8726 The default value is 400.
8728 @item max-inline-insns-auto
8729 When you use @option{-finline-functions} (included in @option{-O3}),
8730 a lot of functions that would otherwise not be considered for inlining
8731 by the compiler are investigated.  To those functions, a different
8732 (more restrictive) limit compared to functions declared inline can
8733 be applied.
8734 The default value is 40.
8736 @item large-function-insns
8737 The limit specifying really large functions.  For functions larger than this
8738 limit after inlining, inlining is constrained by
8739 @option{--param large-function-growth}.  This parameter is useful primarily
8740 to avoid extreme compilation time caused by non-linear algorithms used by the
8741 back end.
8742 The default value is 2700.
8744 @item large-function-growth
8745 Specifies maximal growth of large function caused by inlining in percents.
8746 The default value is 100 which limits large function growth to 2.0 times
8747 the original size.
8749 @item large-unit-insns
8750 The limit specifying large translation unit.  Growth caused by inlining of
8751 units larger than this limit is limited by @option{--param inline-unit-growth}.
8752 For small units this might be too tight.
8753 For example, consider a unit consisting of function A
8754 that is inline and B that just calls A three times.  If B is small relative to
8755 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
8756 large units consisting of small inlineable functions, however, the overall unit
8757 growth limit is needed to avoid exponential explosion of code size.  Thus for
8758 smaller units, the size is increased to @option{--param large-unit-insns}
8759 before applying @option{--param inline-unit-growth}.  The default is 10000.
8761 @item inline-unit-growth
8762 Specifies maximal overall growth of the compilation unit caused by inlining.
8763 The default value is 30 which limits unit growth to 1.3 times the original
8764 size.
8766 @item ipcp-unit-growth
8767 Specifies maximal overall growth of the compilation unit caused by
8768 interprocedural constant propagation.  The default value is 10 which limits
8769 unit growth to 1.1 times the original size.
8771 @item large-stack-frame
8772 The limit specifying large stack frames.  While inlining the algorithm is trying
8773 to not grow past this limit too much.  The default value is 256 bytes.
8775 @item large-stack-frame-growth
8776 Specifies maximal growth of large stack frames caused by inlining in percents.
8777 The default value is 1000 which limits large stack frame growth to 11 times
8778 the original size.
8780 @item max-inline-insns-recursive
8781 @itemx max-inline-insns-recursive-auto
8782 Specifies the maximum number of instructions an out-of-line copy of a
8783 self-recursive inline
8784 function can grow into by performing recursive inlining.
8786 For functions declared inline, @option{--param max-inline-insns-recursive} is
8787 taken into account.  For functions not declared inline, recursive inlining
8788 happens only when @option{-finline-functions} (included in @option{-O3}) is
8789 enabled and @option{--param max-inline-insns-recursive-auto} is used.  The
8790 default value is 450.
8792 @item max-inline-recursive-depth
8793 @itemx max-inline-recursive-depth-auto
8794 Specifies the maximum recursion depth used for recursive inlining.
8796 For functions declared inline, @option{--param max-inline-recursive-depth} is
8797 taken into account.  For functions not declared inline, recursive inlining
8798 happens only when @option{-finline-functions} (included in @option{-O3}) is
8799 enabled and @option{--param max-inline-recursive-depth-auto} is used.  The
8800 default value is 8.
8802 @item min-inline-recursive-probability
8803 Recursive inlining is profitable only for function having deep recursion
8804 in average and can hurt for function having little recursion depth by
8805 increasing the prologue size or complexity of function body to other
8806 optimizers.
8808 When profile feedback is available (see @option{-fprofile-generate}) the actual
8809 recursion depth can be guessed from probability that function recurses via a
8810 given call expression.  This parameter limits inlining only to call expressions
8811 whose probability exceeds the given threshold (in percents).
8812 The default value is 10.
8814 @item early-inlining-insns
8815 Specify growth that the early inliner can make.  In effect it increases
8816 the amount of inlining for code having a large abstraction penalty.
8817 The default value is 10.
8819 @item max-early-inliner-iterations
8820 @itemx max-early-inliner-iterations
8821 Limit of iterations of the early inliner.  This basically bounds
8822 the number of nested indirect calls the early inliner can resolve.
8823 Deeper chains are still handled by late inlining.
8825 @item comdat-sharing-probability
8826 @itemx comdat-sharing-probability
8827 Probability (in percent) that C++ inline function with comdat visibility
8828 are shared across multiple compilation units.  The default value is 20.
8830 @item min-vect-loop-bound
8831 The minimum number of iterations under which loops are not vectorized
8832 when @option{-ftree-vectorize} is used.  The number of iterations after
8833 vectorization needs to be greater than the value specified by this option
8834 to allow vectorization.  The default value is 0.
8836 @item gcse-cost-distance-ratio
8837 Scaling factor in calculation of maximum distance an expression
8838 can be moved by GCSE optimizations.  This is currently supported only in the
8839 code hoisting pass.  The bigger the ratio, the more aggressive code hoisting
8840 is with simple expressions, i.e., the expressions that have cost
8841 less than @option{gcse-unrestricted-cost}.  Specifying 0 disables
8842 hoisting of simple expressions.  The default value is 10.
8844 @item gcse-unrestricted-cost
8845 Cost, roughly measured as the cost of a single typical machine
8846 instruction, at which GCSE optimizations do not constrain
8847 the distance an expression can travel.  This is currently
8848 supported only in the code hoisting pass.  The lesser the cost,
8849 the more aggressive code hoisting is.  Specifying 0 
8850 allows all expressions to travel unrestricted distances.
8851 The default value is 3.
8853 @item max-hoist-depth
8854 The depth of search in the dominator tree for expressions to hoist.
8855 This is used to avoid quadratic behavior in hoisting algorithm.
8856 The value of 0 does not limit on the search, but may slow down compilation
8857 of huge functions.  The default value is 30.
8859 @item max-tail-merge-comparisons
8860 The maximum amount of similar bbs to compare a bb with.  This is used to
8861 avoid quadratic behavior in tree tail merging.  The default value is 10.
8863 @item max-tail-merge-iterations
8864 The maximum amount of iterations of the pass over the function.  This is used to
8865 limit compilation time in tree tail merging.  The default value is 2.
8867 @item max-unrolled-insns
8868 The maximum number of instructions that a loop may have to be unrolled.
8869 If a loop is unrolled, this parameter also determines how many times
8870 the loop code is unrolled.
8872 @item max-average-unrolled-insns
8873 The maximum number of instructions biased by probabilities of their execution
8874 that a loop may have to be unrolled.  If a loop is unrolled,
8875 this parameter also determines how many times the loop code is unrolled.
8877 @item max-unroll-times
8878 The maximum number of unrollings of a single loop.
8880 @item max-peeled-insns
8881 The maximum number of instructions that a loop may have to be peeled.
8882 If a loop is peeled, this parameter also determines how many times
8883 the loop code is peeled.
8885 @item max-peel-times
8886 The maximum number of peelings of a single loop.
8888 @item max-completely-peeled-insns
8889 The maximum number of insns of a completely peeled loop.
8891 @item max-completely-peel-times
8892 The maximum number of iterations of a loop to be suitable for complete peeling.
8894 @item max-completely-peel-loop-nest-depth
8895 The maximum depth of a loop nest suitable for complete peeling.
8897 @item max-unswitch-insns
8898 The maximum number of insns of an unswitched loop.
8900 @item max-unswitch-level
8901 The maximum number of branches unswitched in a single loop.
8903 @item lim-expensive
8904 The minimum cost of an expensive expression in the loop invariant motion.
8906 @item iv-consider-all-candidates-bound
8907 Bound on number of candidates for induction variables, below which
8908 all candidates are considered for each use in induction variable
8909 optimizations.  If there are more candidates than this,
8910 only the most relevant ones are considered to avoid quadratic time complexity.
8912 @item iv-max-considered-uses
8913 The induction variable optimizations give up on loops that contain more
8914 induction variable uses.
8916 @item iv-always-prune-cand-set-bound
8917 If the number of candidates in the set is smaller than this value,
8918 always try to remove unnecessary ivs from the set
8919 when adding a new one.
8921 @item scev-max-expr-size
8922 Bound on size of expressions used in the scalar evolutions analyzer.
8923 Large expressions slow the analyzer.
8925 @item scev-max-expr-complexity
8926 Bound on the complexity of the expressions in the scalar evolutions analyzer.
8927 Complex expressions slow the analyzer.
8929 @item omega-max-vars
8930 The maximum number of variables in an Omega constraint system.
8931 The default value is 128.
8933 @item omega-max-geqs
8934 The maximum number of inequalities in an Omega constraint system.
8935 The default value is 256.
8937 @item omega-max-eqs
8938 The maximum number of equalities in an Omega constraint system.
8939 The default value is 128.
8941 @item omega-max-wild-cards
8942 The maximum number of wildcard variables that the Omega solver is
8943 able to insert.  The default value is 18.
8945 @item omega-hash-table-size
8946 The size of the hash table in the Omega solver.  The default value is
8947 550.
8949 @item omega-max-keys
8950 The maximal number of keys used by the Omega solver.  The default
8951 value is 500.
8953 @item omega-eliminate-redundant-constraints
8954 When set to 1, use expensive methods to eliminate all redundant
8955 constraints.  The default value is 0.
8957 @item vect-max-version-for-alignment-checks
8958 The maximum number of run-time checks that can be performed when
8959 doing loop versioning for alignment in the vectorizer.  See option
8960 @option{-ftree-vect-loop-version} for more information.
8962 @item vect-max-version-for-alias-checks
8963 The maximum number of run-time checks that can be performed when
8964 doing loop versioning for alias in the vectorizer.  See option
8965 @option{-ftree-vect-loop-version} for more information.
8967 @item max-iterations-to-track
8968 The maximum number of iterations of a loop the brute-force algorithm
8969 for analysis of the number of iterations of the loop tries to evaluate.
8971 @item hot-bb-count-fraction
8972 Select fraction of the maximal count of repetitions of basic block in program
8973 given basic block needs to have to be considered hot.
8975 @item hot-bb-frequency-fraction
8976 Select fraction of the entry block frequency of executions of basic block in
8977 function given basic block needs to have to be considered hot.
8979 @item max-predicted-iterations
8980 The maximum number of loop iterations we predict statically.  This is useful
8981 in cases where a function contains a single loop with known bound and
8982 another loop with unknown bound.
8983 The known number of iterations is predicted correctly, while
8984 the unknown number of iterations average to roughly 10.  This means that the
8985 loop without bounds appears artificially cold relative to the other one.
8987 @item align-threshold
8989 Select fraction of the maximal frequency of executions of a basic block in
8990 a function to align the basic block.
8992 @item align-loop-iterations
8994 A loop expected to iterate at least the selected number of iterations is
8995 aligned.
8997 @item tracer-dynamic-coverage
8998 @itemx tracer-dynamic-coverage-feedback
9000 This value is used to limit superblock formation once the given percentage of
9001 executed instructions is covered.  This limits unnecessary code size
9002 expansion.
9004 The @option{tracer-dynamic-coverage-feedback} is used only when profile
9005 feedback is available.  The real profiles (as opposed to statically estimated
9006 ones) are much less balanced allowing the threshold to be larger value.
9008 @item tracer-max-code-growth
9009 Stop tail duplication once code growth has reached given percentage.  This is
9010 a rather artificial limit, as most of the duplicates are eliminated later in
9011 cross jumping, so it may be set to much higher values than is the desired code
9012 growth.
9014 @item tracer-min-branch-ratio
9016 Stop reverse growth when the reverse probability of best edge is less than this
9017 threshold (in percent).
9019 @item tracer-min-branch-ratio
9020 @itemx tracer-min-branch-ratio-feedback
9022 Stop forward growth if the best edge has probability lower than this
9023 threshold.
9025 Similarly to @option{tracer-dynamic-coverage} two values are present, one for
9026 compilation for profile feedback and one for compilation without.  The value
9027 for compilation with profile feedback needs to be more conservative (higher) in
9028 order to make tracer effective.
9030 @item max-cse-path-length
9032 The maximum number of basic blocks on path that CSE considers.
9033 The default is 10.
9035 @item max-cse-insns
9036 The maximum number of instructions CSE processes before flushing.
9037 The default is 1000.
9039 @item ggc-min-expand
9041 GCC uses a garbage collector to manage its own memory allocation.  This
9042 parameter specifies the minimum percentage by which the garbage
9043 collector's heap should be allowed to expand between collections.
9044 Tuning this may improve compilation speed; it has no effect on code
9045 generation.
9047 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
9048 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of ``RAM'' is
9049 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
9050 GCC is not able to calculate RAM on a particular platform, the lower
9051 bound of 30% is used.  Setting this parameter and
9052 @option{ggc-min-heapsize} to zero causes a full collection to occur at
9053 every opportunity.  This is extremely slow, but can be useful for
9054 debugging.
9056 @item ggc-min-heapsize
9058 Minimum size of the garbage collector's heap before it begins bothering
9059 to collect garbage.  The first collection occurs after the heap expands
9060 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
9061 tuning this may improve compilation speed, and has no effect on code
9062 generation.
9064 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit that
9065 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
9066 with a lower bound of 4096 (four megabytes) and an upper bound of
9067 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
9068 particular platform, the lower bound is used.  Setting this parameter
9069 very large effectively disables garbage collection.  Setting this
9070 parameter and @option{ggc-min-expand} to zero causes a full collection
9071 to occur at every opportunity.
9073 @item max-reload-search-insns
9074 The maximum number of instruction reload should look backward for equivalent
9075 register.  Increasing values mean more aggressive optimization, making the
9076 compilation time increase with probably slightly better performance.
9077 The default value is 100.
9079 @item max-cselib-memory-locations
9080 The maximum number of memory locations cselib should take into account.
9081 Increasing values mean more aggressive optimization, making the compilation time
9082 increase with probably slightly better performance.  The default value is 500.
9084 @item reorder-blocks-duplicate
9085 @itemx reorder-blocks-duplicate-feedback
9087 Used by the basic block reordering pass to decide whether to use unconditional
9088 branch or duplicate the code on its destination.  Code is duplicated when its
9089 estimated size is smaller than this value multiplied by the estimated size of
9090 unconditional jump in the hot spots of the program.
9092 The @option{reorder-block-duplicate-feedback} is used only when profile
9093 feedback is available.  It may be set to higher values than
9094 @option{reorder-block-duplicate} since information about the hot spots is more
9095 accurate.
9097 @item max-sched-ready-insns
9098 The maximum number of instructions ready to be issued the scheduler should
9099 consider at any given time during the first scheduling pass.  Increasing
9100 values mean more thorough searches, making the compilation time increase
9101 with probably little benefit.  The default value is 100.
9103 @item max-sched-region-blocks
9104 The maximum number of blocks in a region to be considered for
9105 interblock scheduling.  The default value is 10.
9107 @item max-pipeline-region-blocks
9108 The maximum number of blocks in a region to be considered for
9109 pipelining in the selective scheduler.  The default value is 15.
9111 @item max-sched-region-insns
9112 The maximum number of insns in a region to be considered for
9113 interblock scheduling.  The default value is 100.
9115 @item max-pipeline-region-insns
9116 The maximum number of insns in a region to be considered for
9117 pipelining in the selective scheduler.  The default value is 200.
9119 @item min-spec-prob
9120 The minimum probability (in percents) of reaching a source block
9121 for interblock speculative scheduling.  The default value is 40.
9123 @item max-sched-extend-regions-iters
9124 The maximum number of iterations through CFG to extend regions.
9125 A value of 0 (the default) disables region extensions.
9127 @item max-sched-insn-conflict-delay
9128 The maximum conflict delay for an insn to be considered for speculative motion.
9129 The default value is 3.
9131 @item sched-spec-prob-cutoff
9132 The minimal probability of speculation success (in percents), so that
9133 speculative insns are scheduled.
9134 The default value is 40.
9136 @item sched-mem-true-dep-cost
9137 Minimal distance (in CPU cycles) between store and load targeting same
9138 memory locations.  The default value is 1.
9140 @item selsched-max-lookahead
9141 The maximum size of the lookahead window of selective scheduling.  It is a
9142 depth of search for available instructions.
9143 The default value is 50.
9145 @item selsched-max-sched-times
9146 The maximum number of times that an instruction is scheduled during
9147 selective scheduling.  This is the limit on the number of iterations
9148 through which the instruction may be pipelined.  The default value is 2.
9150 @item selsched-max-insns-to-rename
9151 The maximum number of best instructions in the ready list that are considered
9152 for renaming in the selective scheduler.  The default value is 2.
9154 @item sms-min-sc
9155 The minimum value of stage count that swing modulo scheduler
9156 generates.  The default value is 2.
9158 @item max-last-value-rtl
9159 The maximum size measured as number of RTLs that can be recorded in an expression
9160 in combiner for a pseudo register as last known value of that register.  The default
9161 is 10000.
9163 @item integer-share-limit
9164 Small integer constants can use a shared data structure, reducing the
9165 compiler's memory usage and increasing its speed.  This sets the maximum
9166 value of a shared integer constant.  The default value is 256.
9168 @item ssp-buffer-size
9169 The minimum size of buffers (i.e.@: arrays) that receive stack smashing
9170 protection when @option{-fstack-protection} is used.
9172 @item max-jump-thread-duplication-stmts
9173 Maximum number of statements allowed in a block that needs to be
9174 duplicated when threading jumps.
9176 @item max-fields-for-field-sensitive
9177 Maximum number of fields in a structure treated in
9178 a field sensitive manner during pointer analysis.  The default is zero
9179 for @option{-O0} and @option{-O1},
9180 and 100 for @option{-Os}, @option{-O2}, and @option{-O3}.
9182 @item prefetch-latency
9183 Estimate on average number of instructions that are executed before
9184 prefetch finishes.  The distance prefetched ahead is proportional
9185 to this constant.  Increasing this number may also lead to less
9186 streams being prefetched (see @option{simultaneous-prefetches}).
9188 @item simultaneous-prefetches
9189 Maximum number of prefetches that can run at the same time.
9191 @item l1-cache-line-size
9192 The size of cache line in L1 cache, in bytes.
9194 @item l1-cache-size
9195 The size of L1 cache, in kilobytes.
9197 @item l2-cache-size
9198 The size of L2 cache, in kilobytes.
9200 @item min-insn-to-prefetch-ratio
9201 The minimum ratio between the number of instructions and the
9202 number of prefetches to enable prefetching in a loop.
9204 @item prefetch-min-insn-to-mem-ratio
9205 The minimum ratio between the number of instructions and the
9206 number of memory references to enable prefetching in a loop.
9208 @item use-canonical-types
9209 Whether the compiler should use the ``canonical'' type system.  By
9210 default, this should always be 1, which uses a more efficient internal
9211 mechanism for comparing types in C++ and Objective-C++.  However, if
9212 bugs in the canonical type system are causing compilation failures,
9213 set this value to 0 to disable canonical types.
9215 @item switch-conversion-max-branch-ratio
9216 Switch initialization conversion refuses to create arrays that are
9217 bigger than @option{switch-conversion-max-branch-ratio} times the number of
9218 branches in the switch.
9220 @item max-partial-antic-length
9221 Maximum length of the partial antic set computed during the tree
9222 partial redundancy elimination optimization (@option{-ftree-pre}) when
9223 optimizing at @option{-O3} and above.  For some sorts of source code
9224 the enhanced partial redundancy elimination optimization can run away,
9225 consuming all of the memory available on the host machine.  This
9226 parameter sets a limit on the length of the sets that are computed,
9227 which prevents the runaway behavior.  Setting a value of 0 for
9228 this parameter allows an unlimited set length.
9230 @item sccvn-max-scc-size
9231 Maximum size of a strongly connected component (SCC) during SCCVN
9232 processing.  If this limit is hit, SCCVN processing for the whole
9233 function is not done and optimizations depending on it are
9234 disabled.  The default maximum SCC size is 10000.
9236 @item sccvn-max-alias-queries-per-access
9237 Maximum number of alias-oracle queries we perform when looking for
9238 redundancies for loads and stores.  If this limit is hit the search
9239 is aborted and the load or store is not considered redundant.  The
9240 number of queries is algorithmically limited to the number of
9241 stores on all paths from the load to the function entry.
9242 The default maxmimum number of queries is 1000.
9244 @item ira-max-loops-num
9245 IRA uses regional register allocation by default.  If a function
9246 contains more loops than the number given by this parameter, only at most
9247 the given number of the most frequently-executed loops form regions
9248 for regional register allocation.  The default value of the
9249 parameter is 100.
9251 @item ira-max-conflict-table-size 
9252 Although IRA uses a sophisticated algorithm to compress the conflict
9253 table, the table can still require excessive amounts of memory for
9254 huge functions.  If the conflict table for a function could be more
9255 than the size in MB given by this parameter, the register allocator
9256 instead uses a faster, simpler, and lower-quality
9257 algorithm that does not require building a pseudo-register conflict table.  
9258 The default value of the parameter is 2000.
9260 @item ira-loop-reserved-regs
9261 IRA can be used to evaluate more accurate register pressure in loops
9262 for decisions to move loop invariants (see @option{-O3}).  The number
9263 of available registers reserved for some other purposes is given
9264 by this parameter.  The default value of the parameter is 2, which is
9265 the minimal number of registers needed by typical instructions.
9266 This value is the best found from numerous experiments.
9268 @item loop-invariant-max-bbs-in-loop
9269 Loop invariant motion can be very expensive, both in compilation time and
9270 in amount of needed compile-time memory, with very large loops.  Loops
9271 with more basic blocks than this parameter won't have loop invariant
9272 motion optimization performed on them.  The default value of the
9273 parameter is 1000 for @option{-O1} and 10000 for @option{-O2} and above.
9275 @item loop-max-datarefs-for-datadeps
9276 Building data dapendencies is expensive for very large loops.  This
9277 parameter limits the number of data references in loops that are
9278 considered for data dependence analysis.  These large loops are no
9279 handled by the optimizations using loop data dependencies.
9280 The default value is 1000.
9282 @item max-vartrack-size
9283 Sets a maximum number of hash table slots to use during variable
9284 tracking dataflow analysis of any function.  If this limit is exceeded
9285 with variable tracking at assignments enabled, analysis for that
9286 function is retried without it, after removing all debug insns from
9287 the function.  If the limit is exceeded even without debug insns, var
9288 tracking analysis is completely disabled for the function.  Setting
9289 the parameter to zero makes it unlimited.
9291 @item max-vartrack-expr-depth
9292 Sets a maximum number of recursion levels when attempting to map
9293 variable names or debug temporaries to value expressions.  This trades
9294 compilation time for more complete debug information.  If this is set too
9295 low, value expressions that are available and could be represented in
9296 debug information may end up not being used; setting this higher may
9297 enable the compiler to find more complex debug expressions, but compile
9298 time and memory use may grow.  The default is 12.
9300 @item min-nondebug-insn-uid
9301 Use uids starting at this parameter for nondebug insns.  The range below
9302 the parameter is reserved exclusively for debug insns created by
9303 @option{-fvar-tracking-assignments}, but debug insns may get
9304 (non-overlapping) uids above it if the reserved range is exhausted.
9306 @item ipa-sra-ptr-growth-factor
9307 IPA-SRA replaces a pointer to an aggregate with one or more new
9308 parameters only when their cumulative size is less or equal to
9309 @option{ipa-sra-ptr-growth-factor} times the size of the original
9310 pointer parameter.
9312 @item tm-max-aggregate-size
9313 When making copies of thread-local variables in a transaction, this
9314 parameter specifies the size in bytes after which variables are
9315 saved with the logging functions as opposed to save/restore code
9316 sequence pairs.  This option only applies when using
9317 @option{-fgnu-tm}.
9319 @item graphite-max-nb-scop-params
9320 To avoid exponential effects in the Graphite loop transforms, the
9321 number of parameters in a Static Control Part (SCoP) is bounded.  The
9322 default value is 10 parameters.  A variable whose value is unknown at
9323 compilation time and defined outside a SCoP is a parameter of the SCoP.
9325 @item graphite-max-bbs-per-function
9326 To avoid exponential effects in the detection of SCoPs, the size of
9327 the functions analyzed by Graphite is bounded.  The default value is
9328 100 basic blocks.
9330 @item loop-block-tile-size
9331 Loop blocking or strip mining transforms, enabled with
9332 @option{-floop-block} or @option{-floop-strip-mine}, strip mine each
9333 loop in the loop nest by a given number of iterations.  The strip
9334 length can be changed using the @option{loop-block-tile-size}
9335 parameter.  The default value is 51 iterations.
9337 @item ipa-cp-value-list-size
9338 IPA-CP attempts to track all possible values and types passed to a function's
9339 parameter in order to propagate them and perform devirtualization.
9340 @option{ipa-cp-value-list-size} is the maximum number of values and types it
9341 stores per one formal parameter of a function.
9343 @item lto-partitions
9344 Specify desired number of partitions produced during WHOPR compilation.
9345 The number of partitions should exceed the number of CPUs used for compilation.
9346 The default value is 32.
9348 @item lto-minpartition
9349 Size of minimal partition for WHOPR (in estimated instructions).
9350 This prevents expenses of splitting very small programs into too many
9351 partitions.
9353 @item cxx-max-namespaces-for-diagnostic-help
9354 The maximum number of namespaces to consult for suggestions when C++
9355 name lookup fails for an identifier.  The default is 1000.
9357 @item sink-frequency-threshold
9358 The maximum relative execution frequency (in percents) of the target block
9359 relative to a statement's original block to allow statement sinking of a
9360 statement.  Larger numbers result in more aggressive statement sinking.
9361 The default value is 75.  A small positive adjustment is applied for
9362 statements with memory operands as those are even more profitable so sink.
9364 @item max-stores-to-sink
9365 The maximum number of conditional stores paires that can be sunk.  Set to 0
9366 if either vectorization (@option{-ftree-vectorize}) or if-conversion
9367 (@option{-ftree-loop-if-convert}) is disabled.  The default is 2.
9369 @item allow-load-data-races
9370 Allow optimizers to introduce new data races on loads.
9371 Set to 1 to allow, otherwise to 0.  This option is enabled by default
9372 unless implicitly set by the @option{-fmemory-model=} option.
9374 @item allow-store-data-races
9375 Allow optimizers to introduce new data races on stores.
9376 Set to 1 to allow, otherwise to 0.  This option is enabled by default
9377 unless implicitly set by the @option{-fmemory-model=} option.
9379 @item allow-packed-load-data-races
9380 Allow optimizers to introduce new data races on packed data loads.
9381 Set to 1 to allow, otherwise to 0.  This option is enabled by default
9382 unless implicitly set by the @option{-fmemory-model=} option.
9384 @item allow-packed-store-data-races
9385 Allow optimizers to introduce new data races on packed data stores.
9386 Set to 1 to allow, otherwise to 0.  This option is enabled by default
9387 unless implicitly set by the @option{-fmemory-model=} option.
9389 @item case-values-threshold
9390 The smallest number of different values for which it is best to use a
9391 jump-table instead of a tree of conditional branches.  If the value is
9392 0, use the default for the machine.  The default is 0.
9394 @item tree-reassoc-width
9395 Set the maximum number of instructions executed in parallel in
9396 reassociated tree. This parameter overrides target dependent
9397 heuristics used by default if has non zero value.
9399 @item sched-pressure-algorithm
9400 Choose between the two available implementations of
9401 @option{-fsched-pressure}.  Algorithm 1 is the original implementation
9402 and is the more likely to prevent instructions from being reordered.
9403 Algorithm 2 was designed to be a compromise between the relatively
9404 conservative approach taken by algorithm 1 and the rather aggressive
9405 approach taken by the default scheduler.  It relies more heavily on
9406 having a regular register file and accurate register pressure classes.
9407 See @file{haifa-sched.c} in the GCC sources for more details.
9409 The default choice depends on the target.
9410 @end table
9411 @end table
9413 @node Preprocessor Options
9414 @section Options Controlling the Preprocessor
9415 @cindex preprocessor options
9416 @cindex options, preprocessor
9418 These options control the C preprocessor, which is run on each C source
9419 file before actual compilation.
9421 If you use the @option{-E} option, nothing is done except preprocessing.
9422 Some of these options make sense only together with @option{-E} because
9423 they cause the preprocessor output to be unsuitable for actual
9424 compilation.
9426 @table @gcctabopt
9427 @item -Wp,@var{option}
9428 @opindex Wp
9429 You can use @option{-Wp,@var{option}} to bypass the compiler driver
9430 and pass @var{option} directly through to the preprocessor.  If
9431 @var{option} contains commas, it is split into multiple options at the
9432 commas.  However, many options are modified, translated or interpreted
9433 by the compiler driver before being passed to the preprocessor, and
9434 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
9435 interface is undocumented and subject to change, so whenever possible
9436 you should avoid using @option{-Wp} and let the driver handle the
9437 options instead.
9439 @item -Xpreprocessor @var{option}
9440 @opindex Xpreprocessor
9441 Pass @var{option} as an option to the preprocessor.  You can use this to
9442 supply system-specific preprocessor options that GCC does not 
9443 recognize.
9445 If you want to pass an option that takes an argument, you must use
9446 @option{-Xpreprocessor} twice, once for the option and once for the argument.
9448 @item -no-integrated-cpp
9449 @opindex no-integrated-cpp
9450 Perform preprocessing as a separate pass before compilation.
9451 By default, GCC performs preprocessing as an integrated part of
9452 input tokenization and parsing.
9453 If this option is provided, the appropriate language front end
9454 (@command{cc1}, @command{cc1plus}, or @command{cc1obj} for C, C++,
9455 and Objective-C, respectively) is instead invoked twice,
9456 once for preprocessing only and once for actual compilation
9457 of the preprocessed input.
9458 This option may be useful in conjunction with the @option{-B} or
9459 @option{-wrapper} options to specify an alternate preprocessor or
9460 perform additional processing of the program source between
9461 normal preprocessing and compilation.
9462 @end table
9464 @include cppopts.texi
9466 @node Assembler Options
9467 @section Passing Options to the Assembler
9469 @c prevent bad page break with this line
9470 You can pass options to the assembler.
9472 @table @gcctabopt
9473 @item -Wa,@var{option}
9474 @opindex Wa
9475 Pass @var{option} as an option to the assembler.  If @var{option}
9476 contains commas, it is split into multiple options at the commas.
9478 @item -Xassembler @var{option}
9479 @opindex Xassembler
9480 Pass @var{option} as an option to the assembler.  You can use this to
9481 supply system-specific assembler options that GCC does not
9482 recognize.
9484 If you want to pass an option that takes an argument, you must use
9485 @option{-Xassembler} twice, once for the option and once for the argument.
9487 @end table
9489 @node Link Options
9490 @section Options for Linking
9491 @cindex link options
9492 @cindex options, linking
9494 These options come into play when the compiler links object files into
9495 an executable output file.  They are meaningless if the compiler is
9496 not doing a link step.
9498 @table @gcctabopt
9499 @cindex file names
9500 @item @var{object-file-name}
9501 A file name that does not end in a special recognized suffix is
9502 considered to name an object file or library.  (Object files are
9503 distinguished from libraries by the linker according to the file
9504 contents.)  If linking is done, these object files are used as input
9505 to the linker.
9507 @item -c
9508 @itemx -S
9509 @itemx -E
9510 @opindex c
9511 @opindex S
9512 @opindex E
9513 If any of these options is used, then the linker is not run, and
9514 object file names should not be used as arguments.  @xref{Overall
9515 Options}.
9517 @cindex Libraries
9518 @item -l@var{library}
9519 @itemx -l @var{library}
9520 @opindex l
9521 Search the library named @var{library} when linking.  (The second
9522 alternative with the library as a separate argument is only for
9523 POSIX compliance and is not recommended.)
9525 It makes a difference where in the command you write this option; the
9526 linker searches and processes libraries and object files in the order they
9527 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
9528 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
9529 to functions in @samp{z}, those functions may not be loaded.
9531 The linker searches a standard list of directories for the library,
9532 which is actually a file named @file{lib@var{library}.a}.  The linker
9533 then uses this file as if it had been specified precisely by name.
9535 The directories searched include several standard system directories
9536 plus any that you specify with @option{-L}.
9538 Normally the files found this way are library files---archive files
9539 whose members are object files.  The linker handles an archive file by
9540 scanning through it for members which define symbols that have so far
9541 been referenced but not defined.  But if the file that is found is an
9542 ordinary object file, it is linked in the usual fashion.  The only
9543 difference between using an @option{-l} option and specifying a file name
9544 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
9545 and searches several directories.
9547 @item -lobjc
9548 @opindex lobjc
9549 You need this special case of the @option{-l} option in order to
9550 link an Objective-C or Objective-C++ program.
9552 @item -nostartfiles
9553 @opindex nostartfiles
9554 Do not use the standard system startup files when linking.
9555 The standard system libraries are used normally, unless @option{-nostdlib}
9556 or @option{-nodefaultlibs} is used.
9558 @item -nodefaultlibs
9559 @opindex nodefaultlibs
9560 Do not use the standard system libraries when linking.
9561 Only the libraries you specify are passed to the linker, and options
9562 specifying linkage of the system libraries, such as @code{-static-libgcc}
9563 or @code{-shared-libgcc}, are ignored.  
9564 The standard startup files are used normally, unless @option{-nostartfiles}
9565 is used.  
9567 The compiler may generate calls to @code{memcmp},
9568 @code{memset}, @code{memcpy} and @code{memmove}.
9569 These entries are usually resolved by entries in
9570 libc.  These entry points should be supplied through some other
9571 mechanism when this option is specified.
9573 @item -nostdlib
9574 @opindex nostdlib
9575 Do not use the standard system startup files or libraries when linking.
9576 No startup files and only the libraries you specify are passed to
9577 the linker, and options specifying linkage of the system libraries, such as
9578 @code{-static-libgcc} or @code{-shared-libgcc}, are ignored.
9580 The compiler may generate calls to @code{memcmp}, @code{memset},
9581 @code{memcpy} and @code{memmove}.
9582 These entries are usually resolved by entries in
9583 libc.  These entry points should be supplied through some other
9584 mechanism when this option is specified.
9586 @cindex @option{-lgcc}, use with @option{-nostdlib}
9587 @cindex @option{-nostdlib} and unresolved references
9588 @cindex unresolved references and @option{-nostdlib}
9589 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
9590 @cindex @option{-nodefaultlibs} and unresolved references
9591 @cindex unresolved references and @option{-nodefaultlibs}
9592 One of the standard libraries bypassed by @option{-nostdlib} and
9593 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
9594 which GCC uses to overcome shortcomings of particular machines, or special
9595 needs for some languages.
9596 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
9597 Collection (GCC) Internals},
9598 for more discussion of @file{libgcc.a}.)
9599 In most cases, you need @file{libgcc.a} even when you want to avoid
9600 other standard libraries.  In other words, when you specify @option{-nostdlib}
9601 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
9602 This ensures that you have no unresolved references to internal GCC
9603 library subroutines.
9604 (An example of such an internal subroutine is @samp{__main}, used to ensure C++
9605 constructors are called; @pxref{Collect2,,@code{collect2}, gccint,
9606 GNU Compiler Collection (GCC) Internals}.)
9608 @item -pie
9609 @opindex pie
9610 Produce a position independent executable on targets that support it.
9611 For predictable results, you must also specify the same set of options
9612 used for compilation (@option{-fpie}, @option{-fPIE},
9613 or model suboptions) when you specify this linker option.
9615 @item -rdynamic
9616 @opindex rdynamic
9617 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
9618 that support it. This instructs the linker to add all symbols, not
9619 only used ones, to the dynamic symbol table. This option is needed
9620 for some uses of @code{dlopen} or to allow obtaining backtraces
9621 from within a program.
9623 @item -s
9624 @opindex s
9625 Remove all symbol table and relocation information from the executable.
9627 @item -static
9628 @opindex static
9629 On systems that support dynamic linking, this prevents linking with the shared
9630 libraries.  On other systems, this option has no effect.
9632 @item -shared
9633 @opindex shared
9634 Produce a shared object which can then be linked with other objects to
9635 form an executable.  Not all systems support this option.  For predictable
9636 results, you must also specify the same set of options used for compilation
9637 (@option{-fpic}, @option{-fPIC}, or model suboptions) when
9638 you specify this linker option.@footnote{On some systems, @samp{gcc -shared}
9639 needs to build supplementary stub code for constructors to work.  On
9640 multi-libbed systems, @samp{gcc -shared} must select the correct support
9641 libraries to link against.  Failing to supply the correct flags may lead
9642 to subtle defects.  Supplying them in cases where they are not necessary
9643 is innocuous.}
9645 @item -shared-libgcc
9646 @itemx -static-libgcc
9647 @opindex shared-libgcc
9648 @opindex static-libgcc
9649 On systems that provide @file{libgcc} as a shared library, these options
9650 force the use of either the shared or static version, respectively.
9651 If no shared version of @file{libgcc} was built when the compiler was
9652 configured, these options have no effect.
9654 There are several situations in which an application should use the
9655 shared @file{libgcc} instead of the static version.  The most common
9656 of these is when the application wishes to throw and catch exceptions
9657 across different shared libraries.  In that case, each of the libraries
9658 as well as the application itself should use the shared @file{libgcc}.
9660 Therefore, the G++ and GCJ drivers automatically add
9661 @option{-shared-libgcc} whenever you build a shared library or a main
9662 executable, because C++ and Java programs typically use exceptions, so
9663 this is the right thing to do.
9665 If, instead, you use the GCC driver to create shared libraries, you may
9666 find that they are not always linked with the shared @file{libgcc}.
9667 If GCC finds, at its configuration time, that you have a non-GNU linker
9668 or a GNU linker that does not support option @option{--eh-frame-hdr},
9669 it links the shared version of @file{libgcc} into shared libraries
9670 by default.  Otherwise, it takes advantage of the linker and optimizes
9671 away the linking with the shared version of @file{libgcc}, linking with
9672 the static version of libgcc by default.  This allows exceptions to
9673 propagate through such shared libraries, without incurring relocation
9674 costs at library load time.
9676 However, if a library or main executable is supposed to throw or catch
9677 exceptions, you must link it using the G++ or GCJ driver, as appropriate
9678 for the languages used in the program, or using the option
9679 @option{-shared-libgcc}, such that it is linked with the shared
9680 @file{libgcc}.
9682 @item -static-libstdc++
9683 When the @command{g++} program is used to link a C++ program, it
9684 normally automatically links against @option{libstdc++}.  If
9685 @file{libstdc++} is available as a shared library, and the
9686 @option{-static} option is not used, then this links against the
9687 shared version of @file{libstdc++}.  That is normally fine.  However, it
9688 is sometimes useful to freeze the version of @file{libstdc++} used by
9689 the program without going all the way to a fully static link.  The
9690 @option{-static-libstdc++} option directs the @command{g++} driver to
9691 link @file{libstdc++} statically, without necessarily linking other
9692 libraries statically.
9694 @item -symbolic
9695 @opindex symbolic
9696 Bind references to global symbols when building a shared object.  Warn
9697 about any unresolved references (unless overridden by the link editor
9698 option @option{-Xlinker -z -Xlinker defs}).  Only a few systems support
9699 this option.
9701 @item -T @var{script}
9702 @opindex T
9703 @cindex linker script
9704 Use @var{script} as the linker script.  This option is supported by most
9705 systems using the GNU linker.  On some targets, such as bare-board
9706 targets without an operating system, the @option{-T} option may be required
9707 when linking to avoid references to undefined symbols.
9709 @item -Xlinker @var{option}
9710 @opindex Xlinker
9711 Pass @var{option} as an option to the linker.  You can use this to
9712 supply system-specific linker options that GCC does not recognize.
9714 If you want to pass an option that takes a separate argument, you must use
9715 @option{-Xlinker} twice, once for the option and once for the argument.
9716 For example, to pass @option{-assert definitions}, you must write
9717 @option{-Xlinker -assert -Xlinker definitions}.  It does not work to write
9718 @option{-Xlinker "-assert definitions"}, because this passes the entire
9719 string as a single argument, which is not what the linker expects.
9721 When using the GNU linker, it is usually more convenient to pass
9722 arguments to linker options using the @option{@var{option}=@var{value}}
9723 syntax than as separate arguments.  For example, you can specify
9724 @option{-Xlinker -Map=output.map} rather than
9725 @option{-Xlinker -Map -Xlinker output.map}.  Other linkers may not support
9726 this syntax for command-line options.
9728 @item -Wl,@var{option}
9729 @opindex Wl
9730 Pass @var{option} as an option to the linker.  If @var{option} contains
9731 commas, it is split into multiple options at the commas.  You can use this
9732 syntax to pass an argument to the option.
9733 For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the
9734 linker.  When using the GNU linker, you can also get the same effect with
9735 @option{-Wl,-Map=output.map}.
9737 @item -u @var{symbol}
9738 @opindex u
9739 Pretend the symbol @var{symbol} is undefined, to force linking of
9740 library modules to define it.  You can use @option{-u} multiple times with
9741 different symbols to force loading of additional library modules.
9742 @end table
9744 @node Directory Options
9745 @section Options for Directory Search
9746 @cindex directory options
9747 @cindex options, directory search
9748 @cindex search path
9750 These options specify directories to search for header files, for
9751 libraries and for parts of the compiler:
9753 @table @gcctabopt
9754 @item -I@var{dir}
9755 @opindex I
9756 Add the directory @var{dir} to the head of the list of directories to be
9757 searched for header files.  This can be used to override a system header
9758 file, substituting your own version, since these directories are
9759 searched before the system header file directories.  However, you should
9760 not use this option to add directories that contain vendor-supplied
9761 system header files (use @option{-isystem} for that).  If you use more than
9762 one @option{-I} option, the directories are scanned in left-to-right
9763 order; the standard system directories come after.
9765 If a standard system include directory, or a directory specified with
9766 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
9767 option is ignored.  The directory is still searched but as a
9768 system directory at its normal position in the system include chain.
9769 This is to ensure that GCC's procedure to fix buggy system headers and
9770 the ordering for the @code{include_next} directive are not inadvertently changed.
9771 If you really need to change the search order for system directories,
9772 use the @option{-nostdinc} and/or @option{-isystem} options.
9774 @item -iplugindir=@var{dir}
9775 Set the directory to search for plugins that are passed
9776 by @option{-fplugin=@var{name}} instead of
9777 @option{-fplugin=@var{path}/@var{name}.so}.  This option is not meant
9778 to be used by the user, but only passed by the driver.
9780 @item -iquote@var{dir}
9781 @opindex iquote
9782 Add the directory @var{dir} to the head of the list of directories to
9783 be searched for header files only for the case of @samp{#include
9784 "@var{file}"}; they are not searched for @samp{#include <@var{file}>},
9785 otherwise just like @option{-I}.
9787 @item -L@var{dir}
9788 @opindex L
9789 Add directory @var{dir} to the list of directories to be searched
9790 for @option{-l}.
9792 @item -B@var{prefix}
9793 @opindex B
9794 This option specifies where to find the executables, libraries,
9795 include files, and data files of the compiler itself.
9797 The compiler driver program runs one or more of the subprograms
9798 @command{cpp}, @command{cc1}, @command{as} and @command{ld}.  It tries
9799 @var{prefix} as a prefix for each program it tries to run, both with and
9800 without @samp{@var{machine}/@var{version}/} (@pxref{Target Options}).
9802 For each subprogram to be run, the compiler driver first tries the
9803 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
9804 is not specified, the driver tries two standard prefixes, 
9805 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
9806 those results in a file name that is found, the unmodified program
9807 name is searched for using the directories specified in your
9808 @env{PATH} environment variable.
9810 The compiler checks to see if the path provided by the @option{-B}
9811 refers to a directory, and if necessary it adds a directory
9812 separator character at the end of the path.
9814 @option{-B} prefixes that effectively specify directory names also apply
9815 to libraries in the linker, because the compiler translates these
9816 options into @option{-L} options for the linker.  They also apply to
9817 includes files in the preprocessor, because the compiler translates these
9818 options into @option{-isystem} options for the preprocessor.  In this case,
9819 the compiler appends @samp{include} to the prefix.
9821 The runtime support file @file{libgcc.a} can also be searched for using
9822 the @option{-B} prefix, if needed.  If it is not found there, the two
9823 standard prefixes above are tried, and that is all.  The file is left
9824 out of the link if it is not found by those means.
9826 Another way to specify a prefix much like the @option{-B} prefix is to use
9827 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
9828 Variables}.
9830 As a special kludge, if the path provided by @option{-B} is
9831 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
9832 9, then it is replaced by @file{[dir/]include}.  This is to help
9833 with boot-strapping the compiler.
9835 @item -specs=@var{file}
9836 @opindex specs
9837 Process @var{file} after the compiler reads in the standard @file{specs}
9838 file, in order to override the defaults which the @command{gcc} driver
9839 program uses when determining what switches to pass to @command{cc1},
9840 @command{cc1plus}, @command{as}, @command{ld}, etc.  More than one
9841 @option{-specs=@var{file}} can be specified on the command line, and they
9842 are processed in order, from left to right.
9844 @item --sysroot=@var{dir}
9845 @opindex sysroot
9846 Use @var{dir} as the logical root directory for headers and libraries.
9847 For example, if the compiler normally searches for headers in
9848 @file{/usr/include} and libraries in @file{/usr/lib}, it instead
9849 searches @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
9851 If you use both this option and the @option{-isysroot} option, then
9852 the @option{--sysroot} option applies to libraries, but the
9853 @option{-isysroot} option applies to header files.
9855 The GNU linker (beginning with version 2.16) has the necessary support
9856 for this option.  If your linker does not support this option, the
9857 header file aspect of @option{--sysroot} still works, but the
9858 library aspect does not.
9860 @item --no-sysroot-suffix
9861 @opindex no-sysroot-suffix
9862 For some targets, a suffix is added to the root directory specified
9863 with @option{--sysroot}, depending on the other options used, so that
9864 headers may for example be found in
9865 @file{@var{dir}/@var{suffix}/usr/include} instead of
9866 @file{@var{dir}/usr/include}.  This option disables the addition of
9867 such a suffix.
9869 @item -I-
9870 @opindex I-
9871 This option has been deprecated.  Please use @option{-iquote} instead for
9872 @option{-I} directories before the @option{-I-} and remove the @option{-I-}.
9873 Any directories you specify with @option{-I} options before the @option{-I-}
9874 option are searched only for the case of @samp{#include "@var{file}"};
9875 they are not searched for @samp{#include <@var{file}>}.
9877 If additional directories are specified with @option{-I} options after
9878 the @option{-I-}, these directories are searched for all @samp{#include}
9879 directives.  (Ordinarily @emph{all} @option{-I} directories are used
9880 this way.)
9882 In addition, the @option{-I-} option inhibits the use of the current
9883 directory (where the current input file came from) as the first search
9884 directory for @samp{#include "@var{file}"}.  There is no way to
9885 override this effect of @option{-I-}.  With @option{-I.} you can specify
9886 searching the directory that is current when the compiler is
9887 invoked.  That is not exactly the same as what the preprocessor does
9888 by default, but it is often satisfactory.
9890 @option{-I-} does not inhibit the use of the standard system directories
9891 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
9892 independent.
9893 @end table
9895 @c man end
9897 @node Spec Files
9898 @section Specifying subprocesses and the switches to pass to them
9899 @cindex Spec Files
9901 @command{gcc} is a driver program.  It performs its job by invoking a
9902 sequence of other programs to do the work of compiling, assembling and
9903 linking.  GCC interprets its command-line parameters and uses these to
9904 deduce which programs it should invoke, and which command-line options
9905 it ought to place on their command lines.  This behavior is controlled
9906 by @dfn{spec strings}.  In most cases there is one spec string for each
9907 program that GCC can invoke, but a few programs have multiple spec
9908 strings to control their behavior.  The spec strings built into GCC can
9909 be overridden by using the @option{-specs=} command-line switch to specify
9910 a spec file.
9912 @dfn{Spec files} are plaintext files that are used to construct spec
9913 strings.  They consist of a sequence of directives separated by blank
9914 lines.  The type of directive is determined by the first non-whitespace
9915 character on the line, which can be one of the following:
9917 @table @code
9918 @item %@var{command}
9919 Issues a @var{command} to the spec file processor.  The commands that can
9920 appear here are:
9922 @table @code
9923 @item %include <@var{file}>
9924 @cindex @code{%include}
9925 Search for @var{file} and insert its text at the current point in the
9926 specs file.
9928 @item %include_noerr <@var{file}>
9929 @cindex @code{%include_noerr}
9930 Just like @samp{%include}, but do not generate an error message if the include
9931 file cannot be found.
9933 @item %rename @var{old_name} @var{new_name}
9934 @cindex @code{%rename}
9935 Rename the spec string @var{old_name} to @var{new_name}.
9937 @end table
9939 @item *[@var{spec_name}]:
9940 This tells the compiler to create, override or delete the named spec
9941 string.  All lines after this directive up to the next directive or
9942 blank line are considered to be the text for the spec string.  If this
9943 results in an empty string then the spec is deleted.  (Or, if the
9944 spec did not exist, then nothing happens.)  Otherwise, if the spec
9945 does not currently exist a new spec is created.  If the spec does
9946 exist then its contents are overridden by the text of this
9947 directive, unless the first character of that text is the @samp{+}
9948 character, in which case the text is appended to the spec.
9950 @item [@var{suffix}]:
9951 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
9952 and up to the next directive or blank line are considered to make up the
9953 spec string for the indicated suffix.  When the compiler encounters an
9954 input file with the named suffix, it processes the spec string in
9955 order to work out how to compile that file.  For example:
9957 @smallexample
9958 .ZZ:
9959 z-compile -input %i
9960 @end smallexample
9962 This says that any input file whose name ends in @samp{.ZZ} should be
9963 passed to the program @samp{z-compile}, which should be invoked with the
9964 command-line switch @option{-input} and with the result of performing the
9965 @samp{%i} substitution.  (See below.)
9967 As an alternative to providing a spec string, the text following a
9968 suffix directive can be one of the following:
9970 @table @code
9971 @item @@@var{language}
9972 This says that the suffix is an alias for a known @var{language}.  This is
9973 similar to using the @option{-x} command-line switch to GCC to specify a
9974 language explicitly.  For example:
9976 @smallexample
9977 .ZZ:
9978 @@c++
9979 @end smallexample
9981 Says that .ZZ files are, in fact, C++ source files.
9983 @item #@var{name}
9984 This causes an error messages saying:
9986 @smallexample
9987 @var{name} compiler not installed on this system.
9988 @end smallexample
9989 @end table
9991 GCC already has an extensive list of suffixes built into it.
9992 This directive adds an entry to the end of the list of suffixes, but
9993 since the list is searched from the end backwards, it is effectively
9994 possible to override earlier entries using this technique.
9996 @end table
9998 GCC has the following spec strings built into it.  Spec files can
9999 override these strings or create their own.  Note that individual
10000 targets can also add their own spec strings to this list.
10002 @smallexample
10003 asm          Options to pass to the assembler
10004 asm_final    Options to pass to the assembler post-processor
10005 cpp          Options to pass to the C preprocessor
10006 cc1          Options to pass to the C compiler
10007 cc1plus      Options to pass to the C++ compiler
10008 endfile      Object files to include at the end of the link
10009 link         Options to pass to the linker
10010 lib          Libraries to include on the command line to the linker
10011 libgcc       Decides which GCC support library to pass to the linker
10012 linker       Sets the name of the linker
10013 predefines   Defines to be passed to the C preprocessor
10014 signed_char  Defines to pass to CPP to say whether @code{char} is signed
10015              by default
10016 startfile    Object files to include at the start of the link
10017 @end smallexample
10019 Here is a small example of a spec file:
10021 @smallexample
10022 %rename lib                 old_lib
10024 *lib:
10025 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
10026 @end smallexample
10028 This example renames the spec called @samp{lib} to @samp{old_lib} and
10029 then overrides the previous definition of @samp{lib} with a new one.
10030 The new definition adds in some extra command-line options before
10031 including the text of the old definition.
10033 @dfn{Spec strings} are a list of command-line options to be passed to their
10034 corresponding program.  In addition, the spec strings can contain
10035 @samp{%}-prefixed sequences to substitute variable text or to
10036 conditionally insert text into the command line.  Using these constructs
10037 it is possible to generate quite complex command lines.
10039 Here is a table of all defined @samp{%}-sequences for spec
10040 strings.  Note that spaces are not generated automatically around the
10041 results of expanding these sequences.  Therefore you can concatenate them
10042 together or combine them with constant text in a single argument.
10044 @table @code
10045 @item %%
10046 Substitute one @samp{%} into the program name or argument.
10048 @item %i
10049 Substitute the name of the input file being processed.
10051 @item %b
10052 Substitute the basename of the input file being processed.
10053 This is the substring up to (and not including) the last period
10054 and not including the directory.
10056 @item %B
10057 This is the same as @samp{%b}, but include the file suffix (text after
10058 the last period).
10060 @item %d
10061 Marks the argument containing or following the @samp{%d} as a
10062 temporary file name, so that that file is deleted if GCC exits
10063 successfully.  Unlike @samp{%g}, this contributes no text to the
10064 argument.
10066 @item %g@var{suffix}
10067 Substitute a file name that has suffix @var{suffix} and is chosen
10068 once per compilation, and mark the argument in the same way as
10069 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
10070 name is now chosen in a way that is hard to predict even when previously
10071 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
10072 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
10073 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
10074 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
10075 was simply substituted with a file name chosen once per compilation,
10076 without regard to any appended suffix (which was therefore treated
10077 just like ordinary text), making such attacks more likely to succeed.
10079 @item %u@var{suffix}
10080 Like @samp{%g}, but generates a new temporary file name
10081 each time it appears instead of once per compilation.
10083 @item %U@var{suffix}
10084 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
10085 new one if there is no such last file name.  In the absence of any
10086 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
10087 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
10088 involves the generation of two distinct file names, one
10089 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
10090 simply substituted with a file name chosen for the previous @samp{%u},
10091 without regard to any appended suffix.
10093 @item %j@var{suffix}
10094 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
10095 writable, and if @option{-save-temps} is not used; 
10096 otherwise, substitute the name
10097 of a temporary file, just like @samp{%u}.  This temporary file is not
10098 meant for communication between processes, but rather as a junk
10099 disposal mechanism.
10101 @item %|@var{suffix}
10102 @itemx %m@var{suffix}
10103 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
10104 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
10105 all.  These are the two most common ways to instruct a program that it
10106 should read from standard input or write to standard output.  If you
10107 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
10108 construct: see for example @file{f/lang-specs.h}.
10110 @item %.@var{SUFFIX}
10111 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
10112 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
10113 terminated by the next space or %.
10115 @item %w
10116 Marks the argument containing or following the @samp{%w} as the
10117 designated output file of this compilation.  This puts the argument
10118 into the sequence of arguments that @samp{%o} substitutes.
10120 @item %o
10121 Substitutes the names of all the output files, with spaces
10122 automatically placed around them.  You should write spaces
10123 around the @samp{%o} as well or the results are undefined.
10124 @samp{%o} is for use in the specs for running the linker.
10125 Input files whose names have no recognized suffix are not compiled
10126 at all, but they are included among the output files, so they are
10127 linked.
10129 @item %O
10130 Substitutes the suffix for object files.  Note that this is
10131 handled specially when it immediately follows @samp{%g, %u, or %U},
10132 because of the need for those to form complete file names.  The
10133 handling is such that @samp{%O} is treated exactly as if it had already
10134 been substituted, except that @samp{%g, %u, and %U} do not currently
10135 support additional @var{suffix} characters following @samp{%O} as they do
10136 following, for example, @samp{.o}.
10138 @item %p
10139 Substitutes the standard macro predefinitions for the
10140 current target machine.  Use this when running @code{cpp}.
10142 @item %P
10143 Like @samp{%p}, but puts @samp{__} before and after the name of each
10144 predefined macro, except for macros that start with @samp{__} or with
10145 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
10148 @item %I
10149 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
10150 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
10151 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
10152 and @option{-imultilib} as necessary.
10154 @item %s
10155 Current argument is the name of a library or startup file of some sort.
10156 Search for that file in a standard list of directories and substitute
10157 the full name found.  The current working directory is included in the
10158 list of directories scanned.
10160 @item %T
10161 Current argument is the name of a linker script.  Search for that file
10162 in the current list of directories to scan for libraries. If the file
10163 is located insert a @option{--script} option into the command line
10164 followed by the full path name found.  If the file is not found then
10165 generate an error message.  Note: the current working directory is not
10166 searched.
10168 @item %e@var{str}
10169 Print @var{str} as an error message.  @var{str} is terminated by a newline.
10170 Use this when inconsistent options are detected.
10172 @item %(@var{name})
10173 Substitute the contents of spec string @var{name} at this point.
10175 @item %x@{@var{option}@}
10176 Accumulate an option for @samp{%X}.
10178 @item %X
10179 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
10180 spec string.
10182 @item %Y
10183 Output the accumulated assembler options specified by @option{-Wa}.
10185 @item %Z
10186 Output the accumulated preprocessor options specified by @option{-Wp}.
10188 @item %a
10189 Process the @code{asm} spec.  This is used to compute the
10190 switches to be passed to the assembler.
10192 @item %A
10193 Process the @code{asm_final} spec.  This is a spec string for
10194 passing switches to an assembler post-processor, if such a program is
10195 needed.
10197 @item %l
10198 Process the @code{link} spec.  This is the spec for computing the
10199 command line passed to the linker.  Typically it makes use of the
10200 @samp{%L %G %S %D and %E} sequences.
10202 @item %D
10203 Dump out a @option{-L} option for each directory that GCC believes might
10204 contain startup files.  If the target supports multilibs then the
10205 current multilib directory is prepended to each of these paths.
10207 @item %L
10208 Process the @code{lib} spec.  This is a spec string for deciding which
10209 libraries are included on the command line to the linker.
10211 @item %G
10212 Process the @code{libgcc} spec.  This is a spec string for deciding
10213 which GCC support library is included on the command line to the linker.
10215 @item %S
10216 Process the @code{startfile} spec.  This is a spec for deciding which
10217 object files are the first ones passed to the linker.  Typically
10218 this might be a file named @file{crt0.o}.
10220 @item %E
10221 Process the @code{endfile} spec.  This is a spec string that specifies
10222 the last object files that are passed to the linker.
10224 @item %C
10225 Process the @code{cpp} spec.  This is used to construct the arguments
10226 to be passed to the C preprocessor.
10228 @item %1
10229 Process the @code{cc1} spec.  This is used to construct the options to be
10230 passed to the actual C compiler (@samp{cc1}).
10232 @item %2
10233 Process the @code{cc1plus} spec.  This is used to construct the options to be
10234 passed to the actual C++ compiler (@samp{cc1plus}).
10236 @item %*
10237 Substitute the variable part of a matched option.  See below.
10238 Note that each comma in the substituted string is replaced by
10239 a single space.
10241 @item %<@code{S}
10242 Remove all occurrences of @code{-S} from the command line.  Note---this
10243 command is position dependent.  @samp{%} commands in the spec string
10244 before this one see @code{-S}, @samp{%} commands in the spec string
10245 after this one do not.
10247 @item %:@var{function}(@var{args})
10248 Call the named function @var{function}, passing it @var{args}.
10249 @var{args} is first processed as a nested spec string, then split
10250 into an argument vector in the usual fashion.  The function returns
10251 a string which is processed as if it had appeared literally as part
10252 of the current spec.
10254 The following built-in spec functions are provided:
10256 @table @code
10257 @item @code{getenv}
10258 The @code{getenv} spec function takes two arguments: an environment
10259 variable name and a string.  If the environment variable is not
10260 defined, a fatal error is issued.  Otherwise, the return value is the
10261 value of the environment variable concatenated with the string.  For
10262 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
10264 @smallexample
10265 %:getenv(TOPDIR /include)
10266 @end smallexample
10268 expands to @file{/path/to/top/include}.
10270 @item @code{if-exists}
10271 The @code{if-exists} spec function takes one argument, an absolute
10272 pathname to a file.  If the file exists, @code{if-exists} returns the
10273 pathname.  Here is a small example of its usage:
10275 @smallexample
10276 *startfile:
10277 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
10278 @end smallexample
10280 @item @code{if-exists-else}
10281 The @code{if-exists-else} spec function is similar to the @code{if-exists}
10282 spec function, except that it takes two arguments.  The first argument is
10283 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
10284 returns the pathname.  If it does not exist, it returns the second argument.
10285 This way, @code{if-exists-else} can be used to select one file or another,
10286 based on the existence of the first.  Here is a small example of its usage:
10288 @smallexample
10289 *startfile:
10290 crt0%O%s %:if-exists(crti%O%s) \
10291 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
10292 @end smallexample
10294 @item @code{replace-outfile}
10295 The @code{replace-outfile} spec function takes two arguments.  It looks for the
10296 first argument in the outfiles array and replaces it with the second argument.  Here
10297 is a small example of its usage:
10299 @smallexample
10300 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
10301 @end smallexample
10303 @item @code{remove-outfile}
10304 The @code{remove-outfile} spec function takes one argument.  It looks for the
10305 first argument in the outfiles array and removes it.  Here is a small example
10306 its usage:
10308 @smallexample
10309 %:remove-outfile(-lm)
10310 @end smallexample
10312 @item @code{pass-through-libs}
10313 The @code{pass-through-libs} spec function takes any number of arguments.  It
10314 finds any @option{-l} options and any non-options ending in @file{.a} (which it
10315 assumes are the names of linker input library archive files) and returns a
10316 result containing all the found arguments each prepended by
10317 @option{-plugin-opt=-pass-through=} and joined by spaces.  This list is
10318 intended to be passed to the LTO linker plugin.
10320 @smallexample
10321 %:pass-through-libs(%G %L %G)
10322 @end smallexample
10324 @item @code{print-asm-header}
10325 The @code{print-asm-header} function takes no arguments and simply
10326 prints a banner like:
10328 @smallexample
10329 Assembler options
10330 =================
10332 Use "-Wa,OPTION" to pass "OPTION" to the assembler.
10333 @end smallexample
10335 It is used to separate compiler options from assembler options
10336 in the @option{--target-help} output.
10337 @end table
10339 @item %@{@code{S}@}
10340 Substitutes the @code{-S} switch, if that switch is given to GCC@.
10341 If that switch is not specified, this substitutes nothing.  Note that
10342 the leading dash is omitted when specifying this option, and it is
10343 automatically inserted if the substitution is performed.  Thus the spec
10344 string @samp{%@{foo@}} matches the command-line option @option{-foo}
10345 and outputs the command-line option @option{-foo}.
10347 @item %W@{@code{S}@}
10348 Like %@{@code{S}@} but mark last argument supplied within as a file to be
10349 deleted on failure.
10351 @item %@{@code{S}*@}
10352 Substitutes all the switches specified to GCC whose names start
10353 with @code{-S}, but which also take an argument.  This is used for
10354 switches like @option{-o}, @option{-D}, @option{-I}, etc.
10355 GCC considers @option{-o foo} as being
10356 one switch whose name starts with @samp{o}.  %@{o*@} substitutes this
10357 text, including the space.  Thus two arguments are generated.
10359 @item %@{@code{S}*&@code{T}*@}
10360 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
10361 (the order of @code{S} and @code{T} in the spec is not significant).
10362 There can be any number of ampersand-separated variables; for each the
10363 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
10365 @item %@{@code{S}:@code{X}@}
10366 Substitutes @code{X}, if the @option{-S} switch is given to GCC@.
10368 @item %@{!@code{S}:@code{X}@}
10369 Substitutes @code{X}, if the @option{-S} switch is @emph{not} given to GCC@.
10371 @item %@{@code{S}*:@code{X}@}
10372 Substitutes @code{X} if one or more switches whose names start with
10373 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
10374 once, no matter how many such switches appeared.  However, if @code{%*}
10375 appears somewhere in @code{X}, then @code{X} is substituted once
10376 for each matching switch, with the @code{%*} replaced by the part of
10377 that switch matching the @code{*}.
10379 @item %@{.@code{S}:@code{X}@}
10380 Substitutes @code{X}, if processing a file with suffix @code{S}.
10382 @item %@{!.@code{S}:@code{X}@}
10383 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
10385 @item %@{,@code{S}:@code{X}@}
10386 Substitutes @code{X}, if processing a file for language @code{S}.
10388 @item %@{!,@code{S}:@code{X}@}
10389 Substitutes @code{X}, if not processing a file for language @code{S}.
10391 @item %@{@code{S}|@code{P}:@code{X}@}
10392 Substitutes @code{X} if either @code{-S} or @code{-P} is given to
10393 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
10394 @code{*} sequences as well, although they have a stronger binding than
10395 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
10396 alternatives must be starred, and only the first matching alternative
10397 is substituted.
10399 For example, a spec string like this:
10401 @smallexample
10402 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
10403 @end smallexample
10405 @noindent
10406 outputs the following command-line options from the following input
10407 command-line options:
10409 @smallexample
10410 fred.c        -foo -baz
10411 jim.d         -bar -boggle
10412 -d fred.c     -foo -baz -boggle
10413 -d jim.d      -bar -baz -boggle
10414 @end smallexample
10416 @item %@{S:X; T:Y; :D@}
10418 If @code{S} is given to GCC, substitutes @code{X}; else if @code{T} is
10419 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
10420 be as many clauses as you need.  This may be combined with @code{.},
10421 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
10424 @end table
10426 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
10427 construct may contain other nested @samp{%} constructs or spaces, or
10428 even newlines.  They are processed as usual, as described above.
10429 Trailing white space in @code{X} is ignored.  White space may also
10430 appear anywhere on the left side of the colon in these constructs,
10431 except between @code{.} or @code{*} and the corresponding word.
10433 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
10434 handled specifically in these constructs.  If another value of
10435 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
10436 @option{-W} switch is found later in the command line, the earlier
10437 switch value is ignored, except with @{@code{S}*@} where @code{S} is
10438 just one letter, which passes all matching options.
10440 The character @samp{|} at the beginning of the predicate text is used to
10441 indicate that a command should be piped to the following command, but
10442 only if @option{-pipe} is specified.
10444 It is built into GCC which switches take arguments and which do not.
10445 (You might think it would be useful to generalize this to allow each
10446 compiler's spec to say which switches take arguments.  But this cannot
10447 be done in a consistent fashion.  GCC cannot even decide which input
10448 files have been specified without knowing which switches take arguments,
10449 and it must know which input files to compile in order to tell which
10450 compilers to run).
10452 GCC also knows implicitly that arguments starting in @option{-l} are to be
10453 treated as compiler output files, and passed to the linker in their
10454 proper position among the other output files.
10456 @c man begin OPTIONS
10458 @node Target Options
10459 @section Specifying Target Machine and Compiler Version
10460 @cindex target options
10461 @cindex cross compiling
10462 @cindex specifying machine version
10463 @cindex specifying compiler version and target machine
10464 @cindex compiler version, specifying
10465 @cindex target machine, specifying
10467 The usual way to run GCC is to run the executable called @command{gcc}, or
10468 @command{@var{machine}-gcc} when cross-compiling, or
10469 @command{@var{machine}-gcc-@var{version}} to run a version other than the
10470 one that was installed last.
10472 @node Submodel Options
10473 @section Hardware Models and Configurations
10474 @cindex submodel options
10475 @cindex specifying hardware config
10476 @cindex hardware models and configurations, specifying
10477 @cindex machine dependent options
10479 Each target machine types can have its own
10480 special options, starting with @samp{-m}, to choose among various
10481 hardware models or configurations---for example, 68010 vs 68020,
10482 floating coprocessor or none.  A single installed version of the
10483 compiler can compile for any model or configuration, according to the
10484 options specified.
10486 Some configurations of the compiler also support additional special
10487 options, usually for compatibility with other compilers on the same
10488 platform.
10490 @c This list is ordered alphanumerically by subsection name.
10491 @c It should be the same order and spelling as these options are listed
10492 @c in Machine Dependent Options
10494 @menu
10495 * Adapteva Epiphany Options::
10496 * ARM Options::
10497 * AVR Options::
10498 * Blackfin Options::
10499 * C6X Options::
10500 * CRIS Options::
10501 * CR16 Options::
10502 * Darwin Options::
10503 * DEC Alpha Options::
10504 * FR30 Options::
10505 * FRV Options::
10506 * GNU/Linux Options::
10507 * H8/300 Options::
10508 * HPPA Options::
10509 * i386 and x86-64 Options::
10510 * i386 and x86-64 Windows Options::
10511 * IA-64 Options::
10512 * LM32 Options::
10513 * M32C Options::
10514 * M32R/D Options::
10515 * M680x0 Options::
10516 * MCore Options::
10517 * MeP Options::
10518 * MicroBlaze Options::
10519 * MIPS Options::
10520 * MMIX Options::
10521 * MN10300 Options::
10522 * PDP-11 Options::
10523 * picoChip Options::
10524 * PowerPC Options::
10525 * RL78 Options::
10526 * RS/6000 and PowerPC Options::
10527 * RX Options::
10528 * S/390 and zSeries Options::
10529 * Score Options::
10530 * SH Options::
10531 * Solaris 2 Options::
10532 * SPARC Options::
10533 * SPU Options::
10534 * System V Options::
10535 * TILE-Gx Options::
10536 * TILEPro Options::
10537 * V850 Options::
10538 * VAX Options::
10539 * VMS Options::
10540 * VxWorks Options::
10541 * x86-64 Options::
10542 * Xstormy16 Options::
10543 * Xtensa Options::
10544 * zSeries Options::
10545 @end menu
10547 @node Adapteva Epiphany Options
10548 @subsection Adapteva Epiphany Options
10550 These @samp{-m} options are defined for Adapteva Epiphany:
10552 @table @gcctabopt
10553 @item -mhalf-reg-file
10554 @opindex mhalf-reg-file
10555 Don't allocate any register in the range @code{r32}@dots{}@code{r63}.
10556 That allows code to run on hardware variants that lack these registers.
10558 @item -mprefer-short-insn-regs
10559 @opindex mprefer-short-insn-regs
10560 Preferrentially allocate registers that allow short instruction generation.
10561 This can result in increased instruction count, so this may either reduce or
10562 increase overall code size.
10564 @item -mbranch-cost=@var{num}
10565 @opindex mbranch-cost
10566 Set the cost of branches to roughly @var{num} ``simple'' instructions.
10567 This cost is only a heuristic and is not guaranteed to produce
10568 consistent results across releases.
10570 @item -mcmove
10571 @opindex mcmove
10572 Enable the generation of conditional moves.
10574 @item -mnops=@var{num}
10575 @opindex mnops
10576 Emit @var{num} NOPs before every other generated instruction.
10578 @item -mno-soft-cmpsf
10579 @opindex mno-soft-cmpsf
10580 For single-precision floating-point comparisons, emit an @code{fsub} instruction
10581 and test the flags.  This is faster than a software comparison, but can
10582 get incorrect results in the presence of NaNs, or when two different small
10583 numbers are compared such that their difference is calculated as zero.
10584 The default is @option{-msoft-cmpsf}, which uses slower, but IEEE-compliant,
10585 software comparisons.
10587 @item -mstack-offset=@var{num}
10588 @opindex mstack-offset
10589 Set the offset between the top of the stack and the stack pointer.
10590 E.g., a value of 8 means that the eight bytes in the range @code{sp+0@dots{}sp+7}
10591 can be used by leaf functions without stack allocation.
10592 Values other than @samp{8} or @samp{16} are untested and unlikely to work.
10593 Note also that this option changes the ABI; compiling a program with a
10594 different stack offset than the libraries have been compiled with
10595 generally does not work.
10596 This option can be useful if you want to evaluate if a different stack
10597 offset would give you better code, but to actually use a different stack
10598 offset to build working programs, it is recommended to configure the
10599 toolchain with the appropriate @option{--with-stack-offset=@var{num}} option.
10601 @item -mno-round-nearest
10602 @opindex mno-round-nearest
10603 Make the scheduler assume that the rounding mode has been set to
10604 truncating.  The default is @option{-mround-nearest}.
10606 @item -mlong-calls
10607 @opindex mlong-calls
10608 If not otherwise specified by an attribute, assume all calls might be beyond
10609 the offset range of the @code{b} / @code{bl} instructions, and therefore load the
10610 function address into a register before performing a (otherwise direct) call.
10611 This is the default.
10613 @item -mshort-calls
10614 @opindex short-calls
10615 If not otherwise specified by an attribute, assume all direct calls are
10616 in the range of the @code{b} / @code{bl} instructions, so use these instructions
10617 for direct calls.  The default is @option{-mlong-calls}.
10619 @item -msmall16
10620 @opindex msmall16
10621 Assume addresses can be loaded as 16-bit unsigned values.  This does not
10622 apply to function addresses for which @option{-mlong-calls} semantics
10623 are in effect.
10625 @item -mfp-mode=@var{mode}
10626 @opindex mfp-mode
10627 Set the prevailing mode of the floating-point unit.
10628 This determines the floating-point mode that is provided and expected
10629 at function call and return time.  Making this mode match the mode you
10630 predominantly need at function start can make your programs smaller and
10631 faster by avoiding unnecessary mode switches.
10633 @var{mode} can be set to one the following values:
10635 @table @samp
10636 @item caller
10637 Any mode at function entry is valid, and retained or restored when
10638 the function returns, and when it calls other functions.
10639 This mode is useful for compiling libraries or other compilation units
10640 you might want to incorporate into different programs with different
10641 prevailing FPU modes, and the convenience of being able to use a single
10642 object file outweighs the size and speed overhead for any extra
10643 mode switching that might be needed, compared with what would be needed
10644 with a more specific choice of prevailing FPU mode.
10646 @item truncate
10647 This is the mode used for floating-point calculations with
10648 truncating (i.e.@: round towards zero) rounding mode.  That includes
10649 conversion from floating point to integer.
10651 @item round-nearest
10652 This is the mode used for floating-point calculations with
10653 round-to-nearest-or-even rounding mode.
10655 @item int
10656 This is the mode used to perform integer calculations in the FPU, e.g.@:
10657 integer multiply, or integer multiply-and-accumulate.
10658 @end table
10660 The default is @option{-mfp-mode=caller}
10662 @item -mnosplit-lohi
10663 @opindex mnosplit-lohi
10664 @item -mno-postinc
10665 @opindex mno-postinc
10666 @item -mno-postmodify
10667 @opindex mno-postmodify
10668 Code generation tweaks that disable, respectively, splitting of 32-bit
10669 loads, generation of post-increment addresses, and generation of
10670 post-modify addresses.  The defaults are @option{msplit-lohi},
10671 @option{-mpost-inc}, and @option{-mpost-modify}.
10673 @item -mnovect-double
10674 @opindex mno-vect-double
10675 Change the preferred SIMD mode to SImode.  The default is
10676 @option{-mvect-double}, which uses DImode as preferred SIMD mode.
10678 @item -max-vect-align=@var{num}
10679 @opindex max-vect-align
10680 The maximum alignment for SIMD vector mode types.
10681 @var{num} may be 4 or 8.  The default is 8.
10682 Note that this is an ABI change, even though many library function
10683 interfaces are unaffected if they don't use SIMD vector modes
10684 in places that affect size and/or alignment of relevant types.
10686 @item -msplit-vecmove-early
10687 @opindex msplit-vecmove-early
10688 Split vector moves into single word moves before reload.  In theory this
10689 can give better register allocation, but so far the reverse seems to be
10690 generally the case.
10692 @item -m1reg-@var{reg}
10693 @opindex m1reg-
10694 Specify a register to hold the constant @minus{}1, which makes loading small negative
10695 constants and certain bitmasks faster.
10696 Allowable values for @var{reg} are @samp{r43} and @samp{r63},
10697 which specify use of that register as a fixed register,
10698 and @samp{none}, which means that no register is used for this
10699 purpose.  The default is @option{-m1reg-none}.
10701 @end table
10703 @node ARM Options
10704 @subsection ARM Options
10705 @cindex ARM options
10707 These @samp{-m} options are defined for Advanced RISC Machines (ARM)
10708 architectures:
10710 @table @gcctabopt
10711 @item -mabi=@var{name}
10712 @opindex mabi
10713 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
10714 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
10716 @item -mapcs-frame
10717 @opindex mapcs-frame
10718 Generate a stack frame that is compliant with the ARM Procedure Call
10719 Standard for all functions, even if this is not strictly necessary for
10720 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
10721 with this option causes the stack frames not to be generated for
10722 leaf functions.  The default is @option{-mno-apcs-frame}.
10724 @item -mapcs
10725 @opindex mapcs
10726 This is a synonym for @option{-mapcs-frame}.
10728 @ignore
10729 @c not currently implemented
10730 @item -mapcs-stack-check
10731 @opindex mapcs-stack-check
10732 Generate code to check the amount of stack space available upon entry to
10733 every function (that actually uses some stack space).  If there is
10734 insufficient space available then either the function
10735 @samp{__rt_stkovf_split_small} or @samp{__rt_stkovf_split_big} is
10736 called, depending upon the amount of stack space required.  The runtime
10737 system is required to provide these functions.  The default is
10738 @option{-mno-apcs-stack-check}, since this produces smaller code.
10740 @c not currently implemented
10741 @item -mapcs-float
10742 @opindex mapcs-float
10743 Pass floating-point arguments using the floating-point registers.  This is
10744 one of the variants of the APCS@.  This option is recommended if the
10745 target hardware has a floating-point unit or if a lot of floating-point
10746 arithmetic is going to be performed by the code.  The default is
10747 @option{-mno-apcs-float}, since the size of integer-only code is 
10748 slightly increased if @option{-mapcs-float} is used.
10750 @c not currently implemented
10751 @item -mapcs-reentrant
10752 @opindex mapcs-reentrant
10753 Generate reentrant, position-independent code.  The default is
10754 @option{-mno-apcs-reentrant}.
10755 @end ignore
10757 @item -mthumb-interwork
10758 @opindex mthumb-interwork
10759 Generate code that supports calling between the ARM and Thumb
10760 instruction sets.  Without this option, on pre-v5 architectures, the
10761 two instruction sets cannot be reliably used inside one program.  The
10762 default is @option{-mno-thumb-interwork}, since slightly larger code
10763 is generated when @option{-mthumb-interwork} is specified.  In AAPCS
10764 configurations this option is meaningless.
10766 @item -mno-sched-prolog
10767 @opindex mno-sched-prolog
10768 Prevent the reordering of instructions in the function prologue, or the
10769 merging of those instruction with the instructions in the function's
10770 body.  This means that all functions start with a recognizable set
10771 of instructions (or in fact one of a choice from a small set of
10772 different function prologues), and this information can be used to
10773 locate the start of functions inside an executable piece of code.  The
10774 default is @option{-msched-prolog}.
10776 @item -mfloat-abi=@var{name}
10777 @opindex mfloat-abi
10778 Specifies which floating-point ABI to use.  Permissible values
10779 are: @samp{soft}, @samp{softfp} and @samp{hard}.
10781 Specifying @samp{soft} causes GCC to generate output containing
10782 library calls for floating-point operations.
10783 @samp{softfp} allows the generation of code using hardware floating-point
10784 instructions, but still uses the soft-float calling conventions.
10785 @samp{hard} allows generation of floating-point instructions
10786 and uses FPU-specific calling conventions.
10788 The default depends on the specific target configuration.  Note that
10789 the hard-float and soft-float ABIs are not link-compatible; you must
10790 compile your entire program with the same ABI, and link with a
10791 compatible set of libraries.
10793 @item -mlittle-endian
10794 @opindex mlittle-endian
10795 Generate code for a processor running in little-endian mode.  This is
10796 the default for all standard configurations.
10798 @item -mbig-endian
10799 @opindex mbig-endian
10800 Generate code for a processor running in big-endian mode; the default is
10801 to compile code for a little-endian processor.
10803 @item -mwords-little-endian
10804 @opindex mwords-little-endian
10805 This option only applies when generating code for big-endian processors.
10806 Generate code for a little-endian word order but a big-endian byte
10807 order.  That is, a byte order of the form @samp{32107654}.  Note: this
10808 option should only be used if you require compatibility with code for
10809 big-endian ARM processors generated by versions of the compiler prior to
10810 2.8.  This option is now deprecated.
10812 @item -mcpu=@var{name}
10813 @opindex mcpu
10814 This specifies the name of the target ARM processor.  GCC uses this name
10815 to determine what kind of instructions it can emit when generating
10816 assembly code.  Permissible names are: @samp{arm2}, @samp{arm250},
10817 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
10818 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
10819 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
10820 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
10821 @samp{arm720},
10822 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
10823 @samp{arm710t}, @samp{arm720t}, @samp{arm740t},
10824 @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
10825 @samp{strongarm1110},
10826 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
10827 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
10828 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
10829 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
10830 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
10831 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
10832 @samp{arm1156t2-s}, @samp{arm1156t2f-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
10833 @samp{cortex-a5}, @samp{cortex-a7}, @samp{cortex-a8}, @samp{cortex-a9}, 
10834 @samp{cortex-a15}, @samp{cortex-r4}, @samp{cortex-r4f}, @samp{cortex-r5},
10835 @samp{cortex-m4}, @samp{cortex-m3},
10836 @samp{cortex-m1},
10837 @samp{cortex-m0},
10838 @samp{cortex-m0plus},
10839 @samp{xscale}, @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312},
10840 @samp{fa526}, @samp{fa626},
10841 @samp{fa606te}, @samp{fa626te}, @samp{fmp626}, @samp{fa726te}.
10844 @option{-mcpu=generic-@var{arch}} is also permissible, and is
10845 equivalent to @option{-march=@var{arch} -mtune=generic-@var{arch}}.
10846 See @option{-mtune} for more information.
10848 @option{-mcpu=native} causes the compiler to auto-detect the CPU
10849 of the build computer.  At present, this feature is only supported on
10850 Linux, and not all architectures are recognized.  If the auto-detect is
10851 unsuccessful the option has no effect.
10853 @item -mtune=@var{name}
10854 @opindex mtune
10855 This option is very similar to the @option{-mcpu=} option, except that
10856 instead of specifying the actual target processor type, and hence
10857 restricting which instructions can be used, it specifies that GCC should
10858 tune the performance of the code as if the target were of the type
10859 specified in this option, but still choosing the instructions it
10860 generates based on the CPU specified by a @option{-mcpu=} option.
10861 For some ARM implementations better performance can be obtained by using
10862 this option.
10864 @option{-mtune=generic-@var{arch}} specifies that GCC should tune the
10865 performance for a blend of processors within architecture @var{arch}.
10866 The aim is to generate code that run well on the current most popular
10867 processors, balancing between optimizations that benefit some CPUs in the
10868 range, and avoiding performance pitfalls of other CPUs.  The effects of
10869 this option may change in future GCC versions as CPU models come and go.
10871 @option{-mtune=native} causes the compiler to auto-detect the CPU
10872 of the build computer.  At present, this feature is only supported on
10873 Linux, and not all architectures are recognized.  If the auto-detect is
10874 unsuccessful the option has no effect.
10876 @item -march=@var{name}
10877 @opindex march
10878 This specifies the name of the target ARM architecture.  GCC uses this
10879 name to determine what kind of instructions it can emit when generating
10880 assembly code.  This option can be used in conjunction with or instead
10881 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
10882 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
10883 @samp{armv5}, @samp{armv5t}, @samp{armv5e}, @samp{armv5te},
10884 @samp{armv6}, @samp{armv6j},
10885 @samp{armv6t2}, @samp{armv6z}, @samp{armv6zk}, @samp{armv6-m},
10886 @samp{armv7}, @samp{armv7-a}, @samp{armv7-r}, @samp{armv7-m},
10887 @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312}.
10889 @option{-march=native} causes the compiler to auto-detect the architecture
10890 of the build computer.  At present, this feature is only supported on
10891 Linux, and not all architectures are recognized.  If the auto-detect is
10892 unsuccessful the option has no effect.
10894 @item -mfpu=@var{name}
10895 @opindex mfpu
10896 This specifies what floating-point hardware (or hardware emulation) is
10897 available on the target.  Permissible names are: @samp{vfp}, @samp{vfpv3},
10898 @samp{vfpv3-fp16}, @samp{vfpv3-d16}, @samp{vfpv3-d16-fp16}, @samp{vfpv3xd},
10899 @samp{vfpv3xd-fp16}, @samp{neon}, @samp{neon-fp16}, @samp{vfpv4},
10900 @samp{vfpv4-d16}, @samp{fpv4-sp-d16} and @samp{neon-vfpv4}.
10902 If @option{-msoft-float} is specified this specifies the format of
10903 floating-point values.
10905 If the selected floating-point hardware includes the NEON extension
10906 (e.g. @option{-mfpu}=@samp{neon}), note that floating-point
10907 operations are not generated by GCC's auto-vectorization pass unless
10908 @option{-funsafe-math-optimizations} is also specified.  This is
10909 because NEON hardware does not fully implement the IEEE 754 standard for
10910 floating-point arithmetic (in particular denormal values are treated as
10911 zero), so the use of NEON instructions may lead to a loss of precision.
10913 @item -mfp16-format=@var{name}
10914 @opindex mfp16-format
10915 Specify the format of the @code{__fp16} half-precision floating-point type.
10916 Permissible names are @samp{none}, @samp{ieee}, and @samp{alternative};
10917 the default is @samp{none}, in which case the @code{__fp16} type is not
10918 defined.  @xref{Half-Precision}, for more information.
10920 @item -mstructure-size-boundary=@var{n}
10921 @opindex mstructure-size-boundary
10922 The sizes of all structures and unions are rounded up to a multiple
10923 of the number of bits set by this option.  Permissible values are 8, 32
10924 and 64.  The default value varies for different toolchains.  For the COFF
10925 targeted toolchain the default value is 8.  A value of 64 is only allowed
10926 if the underlying ABI supports it.
10928 Specifying a larger number can produce faster, more efficient code, but
10929 can also increase the size of the program.  Different values are potentially
10930 incompatible.  Code compiled with one value cannot necessarily expect to
10931 work with code or libraries compiled with another value, if they exchange
10932 information using structures or unions.
10934 @item -mabort-on-noreturn
10935 @opindex mabort-on-noreturn
10936 Generate a call to the function @code{abort} at the end of a
10937 @code{noreturn} function.  It is executed if the function tries to
10938 return.
10940 @item -mlong-calls
10941 @itemx -mno-long-calls
10942 @opindex mlong-calls
10943 @opindex mno-long-calls
10944 Tells the compiler to perform function calls by first loading the
10945 address of the function into a register and then performing a subroutine
10946 call on this register.  This switch is needed if the target function
10947 lies outside of the 64-megabyte addressing range of the offset-based
10948 version of subroutine call instruction.
10950 Even if this switch is enabled, not all function calls are turned
10951 into long calls.  The heuristic is that static functions, functions
10952 that have the @samp{short-call} attribute, functions that are inside
10953 the scope of a @samp{#pragma no_long_calls} directive, and functions whose
10954 definitions have already been compiled within the current compilation
10955 unit are not turned into long calls.  The exceptions to this rule are
10956 that weak function definitions, functions with the @samp{long-call}
10957 attribute or the @samp{section} attribute, and functions that are within
10958 the scope of a @samp{#pragma long_calls} directive are always
10959 turned into long calls.
10961 This feature is not enabled by default.  Specifying
10962 @option{-mno-long-calls} restores the default behavior, as does
10963 placing the function calls within the scope of a @samp{#pragma
10964 long_calls_off} directive.  Note these switches have no effect on how
10965 the compiler generates code to handle function calls via function
10966 pointers.
10968 @item -msingle-pic-base
10969 @opindex msingle-pic-base
10970 Treat the register used for PIC addressing as read-only, rather than
10971 loading it in the prologue for each function.  The runtime system is
10972 responsible for initializing this register with an appropriate value
10973 before execution begins.
10975 @item -mpic-register=@var{reg}
10976 @opindex mpic-register
10977 Specify the register to be used for PIC addressing.  The default is R10
10978 unless stack-checking is enabled, when R9 is used.
10980 @item -mcirrus-fix-invalid-insns
10981 @opindex mcirrus-fix-invalid-insns
10982 @opindex mno-cirrus-fix-invalid-insns
10983 Insert NOPs into the instruction stream to in order to work around
10984 problems with invalid Maverick instruction combinations.  This option
10985 is only valid if the @option{-mcpu=ep9312} option has been used to
10986 enable generation of instructions for the Cirrus Maverick floating-point
10987 co-processor.  This option is not enabled by default, since the
10988 problem is only present in older Maverick implementations.  The default
10989 can be re-enabled by use of the @option{-mno-cirrus-fix-invalid-insns}
10990 switch.
10992 @item -mpoke-function-name
10993 @opindex mpoke-function-name
10994 Write the name of each function into the text section, directly
10995 preceding the function prologue.  The generated code is similar to this:
10997 @smallexample
10998      t0
10999          .ascii "arm_poke_function_name", 0
11000          .align
11001      t1
11002          .word 0xff000000 + (t1 - t0)
11003      arm_poke_function_name
11004          mov     ip, sp
11005          stmfd   sp!, @{fp, ip, lr, pc@}
11006          sub     fp, ip, #4
11007 @end smallexample
11009 When performing a stack backtrace, code can inspect the value of
11010 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
11011 location @code{pc - 12} and the top 8 bits are set, then we know that
11012 there is a function name embedded immediately preceding this location
11013 and has length @code{((pc[-3]) & 0xff000000)}.
11015 @item -mthumb
11016 @itemx -marm
11017 @opindex marm
11018 @opindex mthumb
11020 Select between generating code that executes in ARM and Thumb
11021 states.  The default for most configurations is to generate code
11022 that executes in ARM state, but the default can be changed by
11023 configuring GCC with the @option{--with-mode=}@var{state}
11024 configure option.
11026 @item -mtpcs-frame
11027 @opindex mtpcs-frame
11028 Generate a stack frame that is compliant with the Thumb Procedure Call
11029 Standard for all non-leaf functions.  (A leaf function is one that does
11030 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
11032 @item -mtpcs-leaf-frame
11033 @opindex mtpcs-leaf-frame
11034 Generate a stack frame that is compliant with the Thumb Procedure Call
11035 Standard for all leaf functions.  (A leaf function is one that does
11036 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
11038 @item -mcallee-super-interworking
11039 @opindex mcallee-super-interworking
11040 Gives all externally visible functions in the file being compiled an ARM
11041 instruction set header which switches to Thumb mode before executing the
11042 rest of the function.  This allows these functions to be called from
11043 non-interworking code.  This option is not valid in AAPCS configurations
11044 because interworking is enabled by default.
11046 @item -mcaller-super-interworking
11047 @opindex mcaller-super-interworking
11048 Allows calls via function pointers (including virtual functions) to
11049 execute correctly regardless of whether the target code has been
11050 compiled for interworking or not.  There is a small overhead in the cost
11051 of executing a function pointer if this option is enabled.  This option
11052 is not valid in AAPCS configurations because interworking is enabled
11053 by default.
11055 @item -mtp=@var{name}
11056 @opindex mtp
11057 Specify the access model for the thread local storage pointer.  The valid
11058 models are @option{soft}, which generates calls to @code{__aeabi_read_tp},
11059 @option{cp15}, which fetches the thread pointer from @code{cp15} directly
11060 (supported in the arm6k architecture), and @option{auto}, which uses the
11061 best available method for the selected processor.  The default setting is
11062 @option{auto}.
11064 @item -mtls-dialect=@var{dialect}
11065 @opindex mtls-dialect
11066 Specify the dialect to use for accessing thread local storage.  Two
11067 @var{dialect}s are supported---@samp{gnu} and @samp{gnu2}.  The
11068 @samp{gnu} dialect selects the original GNU scheme for supporting
11069 local and global dynamic TLS models.  The @samp{gnu2} dialect
11070 selects the GNU descriptor scheme, which provides better performance
11071 for shared libraries.  The GNU descriptor scheme is compatible with
11072 the original scheme, but does require new assembler, linker and
11073 library support.  Initial and local exec TLS models are unaffected by
11074 this option and always use the original scheme.
11076 @item -mword-relocations
11077 @opindex mword-relocations
11078 Only generate absolute relocations on word-sized values (i.e. R_ARM_ABS32).
11079 This is enabled by default on targets (uClinux, SymbianOS) where the runtime
11080 loader imposes this restriction, and when @option{-fpic} or @option{-fPIC}
11081 is specified.
11083 @item -mfix-cortex-m3-ldrd
11084 @opindex mfix-cortex-m3-ldrd
11085 Some Cortex-M3 cores can cause data corruption when @code{ldrd} instructions
11086 with overlapping destination and base registers are used.  This option avoids
11087 generating these instructions.  This option is enabled by default when
11088 @option{-mcpu=cortex-m3} is specified.
11090 @item -munaligned-access
11091 @itemx -mno-unaligned-access
11092 @opindex munaligned-access
11093 @opindex mno-unaligned-access
11094 Enables (or disables) reading and writing of 16- and 32- bit values
11095 from addresses that are not 16- or 32- bit aligned.  By default
11096 unaligned access is disabled for all pre-ARMv6 and all ARMv6-M
11097 architectures, and enabled for all other architectures.  If unaligned
11098 access is not enabled then words in packed data structures will be
11099 accessed a byte at a time.
11101 The ARM attribute @code{Tag_CPU_unaligned_access} will be set in the
11102 generated object file to either true or false, depending upon the
11103 setting of this option.  If unaligned access is enabled then the
11104 preprocessor symbol @code{__ARM_FEATURE_UNALIGNED} will also be
11105 defined.
11107 @end table
11109 @node AVR Options
11110 @subsection AVR Options
11111 @cindex AVR Options
11113 These options are defined for AVR implementations:
11115 @table @gcctabopt
11116 @item -mmcu=@var{mcu}
11117 @opindex mmcu
11118 Specify Atmel AVR instruction set architectures (ISA) or MCU type.
11120 For a complete list of @var{mcu} values that are supported by @command{avr-gcc},
11121 see the compiler output when called with the @option{--help=target}
11122 command line option.
11123 The default for this option is@tie{}@code{avr2}.
11125 GCC supports the following AVR devices and ISAs:
11127 @include avr-mmcu.texi
11129 @item -maccumulate-args
11130 @opindex maccumulate-args
11131 Accumulate outgoing function arguments and acquire/release the needed
11132 stack space for outgoing function arguments once in function
11133 prologue/epilogue.  Without this option, outgoing arguments are pushed
11134 before calling a function and popped afterwards.
11136 Popping the arguments after the function call can be expensive on
11137 AVR so that accumulating the stack space might lead to smaller
11138 executables because arguments need not to be removed from the
11139 stack after such a function call.
11141 This option can lead to reduced code size for functions that perform
11142 several calls to functions that get their arguments on the stack like
11143 calls to printf-like functions.
11145 @item -mbranch-cost=@var{cost}
11146 @opindex mbranch-cost
11147 Set the branch costs for conditional branch instructions to
11148 @var{cost}.  Reasonable values for @var{cost} are small, non-negative
11149 integers. The default branch cost is 0.
11151 @item -mcall-prologues
11152 @opindex mcall-prologues
11153 Functions prologues/epilogues are expanded as calls to appropriate
11154 subroutines.  Code size is smaller.
11156 @item -mint8
11157 @opindex mint8
11158 Assume @code{int} to be 8-bit integer.  This affects the sizes of all types: a
11159 @code{char} is 1 byte, an @code{int} is 1 byte, a @code{long} is 2 bytes,
11160 and @code{long long} is 4 bytes.  Please note that this option does not
11161 conform to the C standards, but it results in smaller code
11162 size.
11164 @item -mno-interrupts
11165 @opindex mno-interrupts
11166 Generated code is not compatible with hardware interrupts.
11167 Code size is smaller.
11169 @item -mrelax
11170 @opindex mrelax
11171 Try to replace @code{CALL} resp.@: @code{JMP} instruction by the shorter
11172 @code{RCALL} resp.@: @code{RJMP} instruction if applicable.
11173 Setting @code{-mrelax} just adds the @code{--relax} option to the
11174 linker command line when the linker is called.
11176 Jump relaxing is performed by the linker because jump offsets are not
11177 known before code is located. Therefore, the assembler code generated by the
11178 compiler is the same, but the instructions in the executable may
11179 differ from instructions in the assembler code.
11181 Relaxing must be turned on if linker stubs are needed, see the
11182 section on @code{EIND} and linker stubs below.
11184 @item -mshort-calls
11185 @opindex mshort-calls
11186 Use @code{RCALL}/@code{RJMP} instructions even on devices with
11187 16@tie{}KiB or more of program memory, i.e.@: on devices that
11188 have the @code{CALL} and @code{JMP} instructions.
11189 See also the @code{-mrelax} command line option.
11191 @item -msp8
11192 @opindex msp8
11193 Treat the stack pointer register as an 8-bit register,
11194 i.e.@: assume the high byte of the stack pointer is zero.
11195 In general, you don't need to set this option by hand.
11197 This option is used internally by the compiler to select and
11198 build multilibs for architectures @code{avr2} and @code{avr25}.
11199 These architectures mix devices with and without @code{SPH}.
11200 For any setting other than @code{-mmcu=avr2} or @code{-mmcu=avr25}
11201 the compiler driver will add or remove this option from the compiler
11202 proper's command line, because the compiler then knows if the device
11203 or architecture has an 8-bit stack pointer and thus no @code{SPH}
11204 register or not.
11206 @item -mstrict-X
11207 @opindex mstrict-X
11208 Use address register @code{X} in a way proposed by the hardware.  This means
11209 that @code{X} is only used in indirect, post-increment or
11210 pre-decrement addressing.
11212 Without this option, the @code{X} register may be used in the same way
11213 as @code{Y} or @code{Z} which then is emulated by additional
11214 instructions.  
11215 For example, loading a value with @code{X+const} addressing with a
11216 small non-negative @code{const < 64} to a register @var{Rn} is
11217 performed as
11219 @example
11220 adiw r26, const   ; X += const
11221 ld   @var{Rn}, X        ; @var{Rn} = *X
11222 sbiw r26, const   ; X -= const
11223 @end example
11225 @item -mtiny-stack
11226 @opindex mtiny-stack
11227 Only change the lower 8@tie{}bits of the stack pointer.
11228 @end table
11230 @subsubsection @code{EIND} and Devices with more than 128 Ki Bytes of Flash
11231 @cindex @code{EIND}
11232 Pointers in the implementation are 16@tie{}bits wide.
11233 The address of a function or label is represented as word address so
11234 that indirect jumps and calls can target any code address in the
11235 range of 64@tie{}Ki words.
11237 In order to facilitate indirect jump on devices with more than 128@tie{}Ki
11238 bytes of program memory space, there is a special function register called
11239 @code{EIND} that serves as most significant part of the target address
11240 when @code{EICALL} or @code{EIJMP} instructions are used.
11242 Indirect jumps and calls on these devices are handled as follows by
11243 the compiler and are subject to some limitations:
11245 @itemize @bullet
11247 @item
11248 The compiler never sets @code{EIND}.
11250 @item
11251 The compiler uses @code{EIND} implicitely in @code{EICALL}/@code{EIJMP}
11252 instructions or might read @code{EIND} directly in order to emulate an
11253 indirect call/jump by means of a @code{RET} instruction.
11255 @item
11256 The compiler assumes that @code{EIND} never changes during the startup
11257 code or during the application. In particular, @code{EIND} is not
11258 saved/restored in function or interrupt service routine
11259 prologue/epilogue.
11261 @item
11262 For indirect calls to functions and computed goto, the linker
11263 generates @emph{stubs}. Stubs are jump pads sometimes also called
11264 @emph{trampolines}. Thus, the indirect call/jump jumps to such a stub.
11265 The stub contains a direct jump to the desired address.
11267 @item
11268 Linker relaxation must be turned on so that the linker will generate
11269 the stubs correctly an all situaltion. See the compiler option
11270 @code{-mrelax} and the linler option @code{--relax}.
11271 There are corner cases where the linker is supposed to generate stubs
11272 but aborts without relaxation and without a helpful error message.
11274 @item
11275 The default linker script is arranged for code with @code{EIND = 0}.
11276 If code is supposed to work for a setup with @code{EIND != 0}, a custom
11277 linker script has to be used in order to place the sections whose
11278 name start with @code{.trampolines} into the segment where @code{EIND}
11279 points to.
11281 @item
11282 The startup code from libgcc never sets @code{EIND}.
11283 Notice that startup code is a blend of code from libgcc and AVR-LibC.
11284 For the impact of AVR-LibC on @code{EIND}, see the
11285 @w{@uref{http://nongnu.org/avr-libc/user-manual,AVR-LibC user manual}}.
11287 @item
11288 It is legitimate for user-specific startup code to set up @code{EIND}
11289 early, for example by means of initialization code located in
11290 section @code{.init3}. Such code runs prior to general startup code
11291 that initializes RAM and calls constructors, but after the bit
11292 of startup code from AVR-LibC that sets @code{EIND} to the segment
11293 where the vector table is located.
11294 @example
11295 #include <avr/io.h>
11297 static void
11298 __attribute__((section(".init3"),naked,used,no_instrument_function))
11299 init3_set_eind (void)
11301   __asm volatile ("ldi r24,pm_hh8(__trampolines_start)\n\t"
11302                   "out %i0,r24" :: "n" (&EIND) : "r24","memory");
11304 @end example
11306 @noindent
11307 The @code{__trampolines_start} symbol is defined in the linker script.
11309 @item
11310 Stubs are generated automatically by the linker if
11311 the following two conditions are met:
11312 @itemize @minus
11314 @item The address of a label is taken by means of the @code{gs} modifier
11315 (short for @emph{generate stubs}) like so:
11316 @example
11317 LDI r24, lo8(gs(@var{func}))
11318 LDI r25, hi8(gs(@var{func}))
11319 @end example
11320 @item The final location of that label is in a code segment
11321 @emph{outside} the segment where the stubs are located.
11322 @end itemize
11324 @item
11325 The compiler emits such @code{gs} modifiers for code labels in the
11326 following situations:
11327 @itemize @minus
11328 @item Taking address of a function or code label.
11329 @item Computed goto.
11330 @item If prologue-save function is used, see @option{-mcall-prologues}
11331 command-line option.
11332 @item Switch/case dispatch tables. If you do not want such dispatch
11333 tables you can specify the @option{-fno-jump-tables} command-line option.
11334 @item C and C++ constructors/destructors called during startup/shutdown.
11335 @item If the tools hit a @code{gs()} modifier explained above.
11336 @end itemize
11338 @item
11339 Jumping to non-symbolic addresses like so is @emph{not} supported:
11341 @example
11342 int main (void)
11344     /* Call function at word address 0x2 */
11345     return ((int(*)(void)) 0x2)();
11347 @end example
11349 Instead, a stub has to be set up, i.e.@: the function has to be called
11350 through a symbol (@code{func_4} in the example):
11352 @example
11353 int main (void)
11355     extern int func_4 (void);
11357     /* Call function at byte address 0x4 */
11358     return func_4();
11360 @end example
11362 and the application be linked with @code{-Wl,--defsym,func_4=0x4}.
11363 Alternatively, @code{func_4} can be defined in the linker script.
11364 @end itemize
11366 @subsubsection Handling of the @code{RAMPD}, @code{RAMPX}, @code{RAMPY} and @code{RAMPZ} Special Function Registers
11367 @cindex @code{RAMPD}
11368 @cindex @code{RAMPX}
11369 @cindex @code{RAMPY}
11370 @cindex @code{RAMPZ}
11371 Some AVR devices support memories larger than the 64@tie{}KiB range
11372 that can be accessed with 16-bit pointers.  To access memory locations
11373 outside this 64@tie{}KiB range, the contentent of a @code{RAMP}
11374 register is used as high part of the address:
11375 The @code{X}, @code{Y}, @code{Z} address register is concatenated
11376 with the @code{RAMPX}, @code{RAMPY}, @code{RAMPZ} special function
11377 register, respectively, to get a wide address. Similarly,
11378 @code{RAMPD} is used together with direct addressing.
11380 @itemize
11381 @item
11382 The startup code initializes the @code{RAMP} special function
11383 registers with zero.
11385 @item
11386 If a @ref{AVR Named Address Spaces,named address space} other than
11387 generic or @code{__flash} is used, then @code{RAMPZ} is set
11388 as needed before the operation.
11390 @item
11391 If the device supports RAM larger than 64@tie{KiB} and the compiler
11392 needs to change @code{RAMPZ} to accomplish an operation, @code{RAMPZ}
11393 is reset to zero after the operation.
11395 @item
11396 If the device comes with a specific @code{RAMP} register, the ISR
11397 prologue/epilogue saves/restores that SFR and initializes it with
11398 zero in case the ISR code might (implicitly) use it.
11400 @item
11401 RAM larger than 64@tie{KiB} is not supported by GCC for AVR targets.
11402 If you use inline assembler to read from locations outside the
11403 16-bit address range and change one of the @code{RAMP} registers,
11404 you must reset it to zero after the access.
11406 @end itemize
11408 @subsubsection AVR Built-in Macros
11410 GCC defines several built-in macros so that the user code can test
11411 for the presence or absence of features.  Almost any of the following
11412 built-in macros are deduced from device capabilities and thus
11413 triggered by the @code{-mmcu=} command-line option.
11415 For even more AVR-specific built-in macros see
11416 @ref{AVR Named Address Spaces} and @ref{AVR Built-in Functions}.
11418 @table @code
11420 @item __AVR_@var{Device}__
11421 Setting @code{-mmcu=@var{device}} defines this built-in macro which reflects
11422 the device's name. For example, @code{-mmcu=atmega8} defines the
11423 built-in macro @code{__AVR_ATmega8__}, @code{-mmcu=attiny261a} defines
11424 @code{__AVR_ATtiny261A__}, etc.
11426 The built-in macros' names follow
11427 the scheme @code{__AVR_@var{Device}__} where @var{Device} is
11428 the device name as from the AVR user manual. The difference between
11429 @var{Device} in the built-in macro and @var{device} in
11430 @code{-mmcu=@var{device}} is that the latter is always lowercase.
11432 @item __AVR_HAVE_ELPM__
11433 The device has the the @code{ELPM} instruction.
11435 @item __AVR_HAVE_ELPMX__
11436 The device has the @code{ELPM R@var{n},Z} and @code{ELPM
11437 R@var{n},Z+} instructions.
11439 @item __AVR_HAVE_MOVW__
11440 The device has the @code{MOVW} instruction to perform 16-bit
11441 register-register moves.
11443 @item __AVR_HAVE_LPMX__
11444 The device has the @code{LPM R@var{n},Z} and
11445 @code{LPM R@var{n},Z+} instructions.
11447 @item __AVR_HAVE_MUL__
11448 The device has a hardware multiplier. 
11450 @item __AVR_HAVE_JMP_CALL__
11451 The device has the @code{JMP} and @code{CALL} instructions.
11452 This is the case for devices with at least 16@tie{}KiB of program
11453 memory and if @code{-mshort-calls} is not set.
11455 @item __AVR_HAVE_EIJMP_EICALL__
11456 @item __AVR_3_BYTE_PC__
11457 The device has the @code{EIJMP} and @code{EICALL} instructions.
11458 This is the case for devices with more than 128@tie{}KiB of program memory.
11459 This also means that the program counter
11460 (PC) is 3@tie{}bytes wide.
11462 @item __AVR_2_BYTE_PC__
11463 The program counter (PC) is 2@tie{}bytes wide. This is the case for devices
11464 with up to 128@tie{}KiB of program memory.
11466 @item __AVR_HAVE_8BIT_SP__
11467 @item __AVR_HAVE_16BIT_SP__
11468 The stack pointer (SP) register is treated as 8-bit respectively
11469 16-bit register by the compiler.
11470 The definition of these macros is affected by @code{-mtiny-stack}.
11472 @item __AVR_HAVE_SPH__
11473 @item __AVR_SP8__
11474 The device has the SPH (high part of stack pointer) special function
11475 register or has an 8-bit stack pointer, respectively.
11476 The definition of these macros is affected by @code{-mmcu=} and
11477 in the cases of @code{-mmcu=avr2} and @code{-mmcu=avr25} also
11478 by @code{-msp8}.
11480 @item __AVR_HAVE_RAMPD__
11481 @item __AVR_HAVE_RAMPX__
11482 @item __AVR_HAVE_RAMPY__
11483 @item __AVR_HAVE_RAMPZ__
11484 The device has the @code{RAMPD}, @code{RAMPX}, @code{RAMPY},
11485 @code{RAMPZ} special function register, respectively.
11487 @item __NO_INTERRUPTS__
11488 This macro reflects the @code{-mno-interrupts} command line option.
11490 @item __AVR_ERRATA_SKIP__
11491 @item __AVR_ERRATA_SKIP_JMP_CALL__
11492 Some AVR devices (AT90S8515, ATmega103) must not skip 32-bit
11493 instructions because of a hardware erratum.  Skip instructions are
11494 @code{SBRS}, @code{SBRC}, @code{SBIS}, @code{SBIC} and @code{CPSE}.
11495 The second macro is only defined if @code{__AVR_HAVE_JMP_CALL__} is also
11496 set.
11498 @item __AVR_SFR_OFFSET__=@var{offset}
11499 Instructions that can address I/O special function registers directly
11500 like @code{IN}, @code{OUT}, @code{SBI}, etc.@: may use a different
11501 address as if addressed by an instruction to access RAM like @code{LD}
11502 or @code{STS}. This offset depends on the device architecture and has
11503 to be subtracted from the RAM address in order to get the
11504 respective I/O@tie{}address.
11506 @item __WITH_AVRLIBC__
11507 The compiler is configured to be used together with AVR-Libc.
11508 See the @code{--with-avrlibc} configure option.
11510 @end table
11512 @node Blackfin Options
11513 @subsection Blackfin Options
11514 @cindex Blackfin Options
11516 @table @gcctabopt
11517 @item -mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]}
11518 @opindex mcpu=
11519 Specifies the name of the target Blackfin processor.  Currently, @var{cpu}
11520 can be one of @samp{bf512}, @samp{bf514}, @samp{bf516}, @samp{bf518},
11521 @samp{bf522}, @samp{bf523}, @samp{bf524}, @samp{bf525}, @samp{bf526},
11522 @samp{bf527}, @samp{bf531}, @samp{bf532}, @samp{bf533},
11523 @samp{bf534}, @samp{bf536}, @samp{bf537}, @samp{bf538}, @samp{bf539},
11524 @samp{bf542}, @samp{bf544}, @samp{bf547}, @samp{bf548}, @samp{bf549},
11525 @samp{bf542m}, @samp{bf544m}, @samp{bf547m}, @samp{bf548m}, @samp{bf549m},
11526 @samp{bf561}, @samp{bf592}.
11528 The optional @var{sirevision} specifies the silicon revision of the target
11529 Blackfin processor.  Any workarounds available for the targeted silicon revision
11530 are enabled.  If @var{sirevision} is @samp{none}, no workarounds are enabled.
11531 If @var{sirevision} is @samp{any}, all workarounds for the targeted processor
11532 are enabled.  The @code{__SILICON_REVISION__} macro is defined to two
11533 hexadecimal digits representing the major and minor numbers in the silicon
11534 revision.  If @var{sirevision} is @samp{none}, the @code{__SILICON_REVISION__}
11535 is not defined.  If @var{sirevision} is @samp{any}, the
11536 @code{__SILICON_REVISION__} is defined to be @code{0xffff}.
11537 If this optional @var{sirevision} is not used, GCC assumes the latest known
11538 silicon revision of the targeted Blackfin processor.
11540 GCC defines a preprocessor macro for the specified @var{cpu}.
11541 For the @samp{bfin-elf} toolchain, this option causes the hardware BSP
11542 provided by libgloss to be linked in if @option{-msim} is not given.
11544 Without this option, @samp{bf532} is used as the processor by default.
11546 Note that support for @samp{bf561} is incomplete.  For @samp{bf561},
11547 only the preprocessor macro is defined.
11549 @item -msim
11550 @opindex msim
11551 Specifies that the program will be run on the simulator.  This causes
11552 the simulator BSP provided by libgloss to be linked in.  This option
11553 has effect only for @samp{bfin-elf} toolchain.
11554 Certain other options, such as @option{-mid-shared-library} and
11555 @option{-mfdpic}, imply @option{-msim}.
11557 @item -momit-leaf-frame-pointer
11558 @opindex momit-leaf-frame-pointer
11559 Don't keep the frame pointer in a register for leaf functions.  This
11560 avoids the instructions to save, set up and restore frame pointers and
11561 makes an extra register available in leaf functions.  The option
11562 @option{-fomit-frame-pointer} removes the frame pointer for all functions,
11563 which might make debugging harder.
11565 @item -mspecld-anomaly
11566 @opindex mspecld-anomaly
11567 When enabled, the compiler ensures that the generated code does not
11568 contain speculative loads after jump instructions. If this option is used,
11569 @code{__WORKAROUND_SPECULATIVE_LOADS} is defined.
11571 @item -mno-specld-anomaly
11572 @opindex mno-specld-anomaly
11573 Don't generate extra code to prevent speculative loads from occurring.
11575 @item -mcsync-anomaly
11576 @opindex mcsync-anomaly
11577 When enabled, the compiler ensures that the generated code does not
11578 contain CSYNC or SSYNC instructions too soon after conditional branches.
11579 If this option is used, @code{__WORKAROUND_SPECULATIVE_SYNCS} is defined.
11581 @item -mno-csync-anomaly
11582 @opindex mno-csync-anomaly
11583 Don't generate extra code to prevent CSYNC or SSYNC instructions from
11584 occurring too soon after a conditional branch.
11586 @item -mlow-64k
11587 @opindex mlow-64k
11588 When enabled, the compiler is free to take advantage of the knowledge that
11589 the entire program fits into the low 64k of memory.
11591 @item -mno-low-64k
11592 @opindex mno-low-64k
11593 Assume that the program is arbitrarily large.  This is the default.
11595 @item -mstack-check-l1
11596 @opindex mstack-check-l1
11597 Do stack checking using information placed into L1 scratchpad memory by the
11598 uClinux kernel.
11600 @item -mid-shared-library
11601 @opindex mid-shared-library
11602 Generate code that supports shared libraries via the library ID method.
11603 This allows for execute in place and shared libraries in an environment
11604 without virtual memory management.  This option implies @option{-fPIC}.
11605 With a @samp{bfin-elf} target, this option implies @option{-msim}.
11607 @item -mno-id-shared-library
11608 @opindex mno-id-shared-library
11609 Generate code that doesn't assume ID-based shared libraries are being used.
11610 This is the default.
11612 @item -mleaf-id-shared-library
11613 @opindex mleaf-id-shared-library
11614 Generate code that supports shared libraries via the library ID method,
11615 but assumes that this library or executable won't link against any other
11616 ID shared libraries.  That allows the compiler to use faster code for jumps
11617 and calls.
11619 @item -mno-leaf-id-shared-library
11620 @opindex mno-leaf-id-shared-library
11621 Do not assume that the code being compiled won't link against any ID shared
11622 libraries.  Slower code is generated for jump and call insns.
11624 @item -mshared-library-id=n
11625 @opindex mshared-library-id
11626 Specifies the identification number of the ID-based shared library being
11627 compiled.  Specifying a value of 0 generates more compact code; specifying
11628 other values forces the allocation of that number to the current
11629 library but is no more space- or time-efficient than omitting this option.
11631 @item -msep-data
11632 @opindex msep-data
11633 Generate code that allows the data segment to be located in a different
11634 area of memory from the text segment.  This allows for execute in place in
11635 an environment without virtual memory management by eliminating relocations
11636 against the text section.
11638 @item -mno-sep-data
11639 @opindex mno-sep-data
11640 Generate code that assumes that the data segment follows the text segment.
11641 This is the default.
11643 @item -mlong-calls
11644 @itemx -mno-long-calls
11645 @opindex mlong-calls
11646 @opindex mno-long-calls
11647 Tells the compiler to perform function calls by first loading the
11648 address of the function into a register and then performing a subroutine
11649 call on this register.  This switch is needed if the target function
11650 lies outside of the 24-bit addressing range of the offset-based
11651 version of subroutine call instruction.
11653 This feature is not enabled by default.  Specifying
11654 @option{-mno-long-calls} restores the default behavior.  Note these
11655 switches have no effect on how the compiler generates code to handle
11656 function calls via function pointers.
11658 @item -mfast-fp
11659 @opindex mfast-fp
11660 Link with the fast floating-point library. This library relaxes some of
11661 the IEEE floating-point standard's rules for checking inputs against
11662 Not-a-Number (NAN), in the interest of performance.
11664 @item -minline-plt
11665 @opindex minline-plt
11666 Enable inlining of PLT entries in function calls to functions that are
11667 not known to bind locally.  It has no effect without @option{-mfdpic}.
11669 @item -mmulticore
11670 @opindex mmulticore
11671 Build a standalone application for multicore Blackfin processors. 
11672 This option causes proper start files and link scripts supporting 
11673 multicore to be used, and defines the macro @code{__BFIN_MULTICORE}. 
11674 It can only be used with @option{-mcpu=bf561@r{[}-@var{sirevision}@r{]}}. 
11676 This option can be used with @option{-mcorea} or @option{-mcoreb}, which
11677 selects the one-application-per-core programming model.  Without
11678 @option{-mcorea} or @option{-mcoreb}, the single-application/dual-core
11679 programming model is used. In this model, the main function of Core B
11680 should be named as @code{coreb_main}.
11682 If this option is not used, the single-core application programming
11683 model is used.
11685 @item -mcorea
11686 @opindex mcorea
11687 Build a standalone application for Core A of BF561 when using
11688 the one-application-per-core programming model. Proper start files
11689 and link scripts are used to support Core A, and the macro
11690 @code{__BFIN_COREA} is defined.
11691 This option can only be used in conjunction with @option{-mmulticore}.
11693 @item -mcoreb
11694 @opindex mcoreb
11695 Build a standalone application for Core B of BF561 when using
11696 the one-application-per-core programming model. Proper start files
11697 and link scripts are used to support Core B, and the macro
11698 @code{__BFIN_COREB} is defined. When this option is used, @code{coreb_main}
11699 should be used instead of @code{main}. 
11700 This option can only be used in conjunction with @option{-mmulticore}.
11702 @item -msdram
11703 @opindex msdram
11704 Build a standalone application for SDRAM. Proper start files and
11705 link scripts are used to put the application into SDRAM, and the macro
11706 @code{__BFIN_SDRAM} is defined.
11707 The loader should initialize SDRAM before loading the application.
11709 @item -micplb
11710 @opindex micplb
11711 Assume that ICPLBs are enabled at run time.  This has an effect on certain
11712 anomaly workarounds.  For Linux targets, the default is to assume ICPLBs
11713 are enabled; for standalone applications the default is off.
11714 @end table
11716 @node C6X Options
11717 @subsection C6X Options
11718 @cindex C6X Options
11720 @table @gcctabopt
11721 @item -march=@var{name}
11722 @opindex march
11723 This specifies the name of the target architecture.  GCC uses this
11724 name to determine what kind of instructions it can emit when generating
11725 assembly code.  Permissible names are: @samp{c62x},
11726 @samp{c64x}, @samp{c64x+}, @samp{c67x}, @samp{c67x+}, @samp{c674x}.
11728 @item -mbig-endian
11729 @opindex mbig-endian
11730 Generate code for a big-endian target.
11732 @item -mlittle-endian
11733 @opindex mlittle-endian
11734 Generate code for a little-endian target.  This is the default.
11736 @item -msim
11737 @opindex msim
11738 Choose startup files and linker script suitable for the simulator.
11740 @item -msdata=default
11741 @opindex msdata=default
11742 Put small global and static data in the @samp{.neardata} section,
11743 which is pointed to by register @code{B14}.  Put small uninitialized
11744 global and static data in the @samp{.bss} section, which is adjacent
11745 to the @samp{.neardata} section.  Put small read-only data into the
11746 @samp{.rodata} section.  The corresponding sections used for large
11747 pieces of data are @samp{.fardata}, @samp{.far} and @samp{.const}.
11749 @item -msdata=all
11750 @opindex msdata=all
11751 Put all data, not just small objects, into the sections reserved for
11752 small data, and use addressing relative to the @code{B14} register to
11753 access them.
11755 @item -msdata=none
11756 @opindex msdata=none
11757 Make no use of the sections reserved for small data, and use absolute
11758 addresses to access all data.  Put all initialized global and static
11759 data in the @samp{.fardata} section, and all uninitialized data in the
11760 @samp{.far} section.  Put all constant data into the @samp{.const}
11761 section.
11762 @end table
11764 @node CRIS Options
11765 @subsection CRIS Options
11766 @cindex CRIS Options
11768 These options are defined specifically for the CRIS ports.
11770 @table @gcctabopt
11771 @item -march=@var{architecture-type}
11772 @itemx -mcpu=@var{architecture-type}
11773 @opindex march
11774 @opindex mcpu
11775 Generate code for the specified architecture.  The choices for
11776 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
11777 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
11778 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
11779 @samp{v10}.
11781 @item -mtune=@var{architecture-type}
11782 @opindex mtune
11783 Tune to @var{architecture-type} everything applicable about the generated
11784 code, except for the ABI and the set of available instructions.  The
11785 choices for @var{architecture-type} are the same as for
11786 @option{-march=@var{architecture-type}}.
11788 @item -mmax-stack-frame=@var{n}
11789 @opindex mmax-stack-frame
11790 Warn when the stack frame of a function exceeds @var{n} bytes.
11792 @item -metrax4
11793 @itemx -metrax100
11794 @opindex metrax4
11795 @opindex metrax100
11796 The options @option{-metrax4} and @option{-metrax100} are synonyms for
11797 @option{-march=v3} and @option{-march=v8} respectively.
11799 @item -mmul-bug-workaround
11800 @itemx -mno-mul-bug-workaround
11801 @opindex mmul-bug-workaround
11802 @opindex mno-mul-bug-workaround
11803 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
11804 models where it applies.  This option is active by default.
11806 @item -mpdebug
11807 @opindex mpdebug
11808 Enable CRIS-specific verbose debug-related information in the assembly
11809 code.  This option also has the effect of turning off the @samp{#NO_APP}
11810 formatted-code indicator to the assembler at the beginning of the
11811 assembly file.
11813 @item -mcc-init
11814 @opindex mcc-init
11815 Do not use condition-code results from previous instruction; always emit
11816 compare and test instructions before use of condition codes.
11818 @item -mno-side-effects
11819 @opindex mno-side-effects
11820 Do not emit instructions with side effects in addressing modes other than
11821 post-increment.
11823 @item -mstack-align
11824 @itemx -mno-stack-align
11825 @itemx -mdata-align
11826 @itemx -mno-data-align
11827 @itemx -mconst-align
11828 @itemx -mno-const-align
11829 @opindex mstack-align
11830 @opindex mno-stack-align
11831 @opindex mdata-align
11832 @opindex mno-data-align
11833 @opindex mconst-align
11834 @opindex mno-const-align
11835 These options (@samp{no-} options) arrange (eliminate arrangements) for the
11836 stack frame, individual data and constants to be aligned for the maximum
11837 single data access size for the chosen CPU model.  The default is to
11838 arrange for 32-bit alignment.  ABI details such as structure layout are
11839 not affected by these options.
11841 @item -m32-bit
11842 @itemx -m16-bit
11843 @itemx -m8-bit
11844 @opindex m32-bit
11845 @opindex m16-bit
11846 @opindex m8-bit
11847 Similar to the stack- data- and const-align options above, these options
11848 arrange for stack frame, writable data and constants to all be 32-bit,
11849 16-bit or 8-bit aligned.  The default is 32-bit alignment.
11851 @item -mno-prologue-epilogue
11852 @itemx -mprologue-epilogue
11853 @opindex mno-prologue-epilogue
11854 @opindex mprologue-epilogue
11855 With @option{-mno-prologue-epilogue}, the normal function prologue and
11856 epilogue which set up the stack frame are omitted and no return
11857 instructions or return sequences are generated in the code.  Use this
11858 option only together with visual inspection of the compiled code: no
11859 warnings or errors are generated when call-saved registers must be saved,
11860 or storage for local variables needs to be allocated.
11862 @item -mno-gotplt
11863 @itemx -mgotplt
11864 @opindex mno-gotplt
11865 @opindex mgotplt
11866 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
11867 instruction sequences that load addresses for functions from the PLT part
11868 of the GOT rather than (traditional on other architectures) calls to the
11869 PLT@.  The default is @option{-mgotplt}.
11871 @item -melf
11872 @opindex melf
11873 Legacy no-op option only recognized with the cris-axis-elf and
11874 cris-axis-linux-gnu targets.
11876 @item -mlinux
11877 @opindex mlinux
11878 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
11880 @item -sim
11881 @opindex sim
11882 This option, recognized for the cris-axis-elf, arranges
11883 to link with input-output functions from a simulator library.  Code,
11884 initialized data and zero-initialized data are allocated consecutively.
11886 @item -sim2
11887 @opindex sim2
11888 Like @option{-sim}, but pass linker options to locate initialized data at
11889 0x40000000 and zero-initialized data at 0x80000000.
11890 @end table
11892 @node CR16 Options
11893 @subsection CR16 Options
11894 @cindex CR16 Options
11896 These options are defined specifically for the CR16 ports.
11898 @table @gcctabopt
11900 @item -mmac
11901 @opindex mmac
11902 Enable the use of multiply-accumulate instructions. Disabled by default.
11904 @item -mcr16cplus
11905 @itemx -mcr16c
11906 @opindex mcr16cplus
11907 @opindex mcr16c
11908 Generate code for CR16C or CR16C+ architecture. CR16C+ architecture 
11909 is default.
11911 @item -msim
11912 @opindex msim
11913 Links the library libsim.a which is in compatible with simulator. Applicable
11914 to ELF compiler only.
11916 @item -mint32
11917 @opindex mint32
11918 Choose integer type as 32-bit wide.
11920 @item -mbit-ops
11921 @opindex mbit-ops
11922 Generates @code{sbit}/@code{cbit} instructions for bit manipulations.
11924 @item -mdata-model=@var{model}
11925 @opindex mdata-model
11926 Choose a data model. The choices for @var{model} are @samp{near},
11927 @samp{far} or @samp{medium}. @samp{medium} is default.
11928 However, @samp{far} is not valid with @option{-mcr16c}, as the
11929 CR16C architecture does not support the far data model.
11930 @end table
11932 @node Darwin Options
11933 @subsection Darwin Options
11934 @cindex Darwin options
11936 These options are defined for all architectures running the Darwin operating
11937 system.
11939 FSF GCC on Darwin does not create ``fat'' object files; it creates
11940 an object file for the single architecture that GCC was built to
11941 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
11942 @option{-arch} options are used; it does so by running the compiler or
11943 linker multiple times and joining the results together with
11944 @file{lipo}.
11946 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
11947 @samp{i686}) is determined by the flags that specify the ISA
11948 that GCC is targetting, like @option{-mcpu} or @option{-march}.  The
11949 @option{-force_cpusubtype_ALL} option can be used to override this.
11951 The Darwin tools vary in their behavior when presented with an ISA
11952 mismatch.  The assembler, @file{as}, only permits instructions to
11953 be used that are valid for the subtype of the file it is generating,
11954 so you cannot put 64-bit instructions in a @samp{ppc750} object file.
11955 The linker for shared libraries, @file{/usr/bin/libtool}, fails
11956 and prints an error if asked to create a shared library with a less
11957 restrictive subtype than its input files (for instance, trying to put
11958 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
11959 for executables, @command{ld}, quietly gives the executable the most
11960 restrictive subtype of any of its input files.
11962 @table @gcctabopt
11963 @item -F@var{dir}
11964 @opindex F
11965 Add the framework directory @var{dir} to the head of the list of
11966 directories to be searched for header files.  These directories are
11967 interleaved with those specified by @option{-I} options and are
11968 scanned in a left-to-right order.
11970 A framework directory is a directory with frameworks in it.  A
11971 framework is a directory with a @file{Headers} and/or
11972 @file{PrivateHeaders} directory contained directly in it that ends
11973 in @file{.framework}.  The name of a framework is the name of this
11974 directory excluding the @file{.framework}.  Headers associated with
11975 the framework are found in one of those two directories, with
11976 @file{Headers} being searched first.  A subframework is a framework
11977 directory that is in a framework's @file{Frameworks} directory.
11978 Includes of subframework headers can only appear in a header of a
11979 framework that contains the subframework, or in a sibling subframework
11980 header.  Two subframeworks are siblings if they occur in the same
11981 framework.  A subframework should not have the same name as a
11982 framework; a warning is issued if this is violated.  Currently a
11983 subframework cannot have subframeworks; in the future, the mechanism
11984 may be extended to support this.  The standard frameworks can be found
11985 in @file{/System/Library/Frameworks} and
11986 @file{/Library/Frameworks}.  An example include looks like
11987 @code{#include <Framework/header.h>}, where @file{Framework} denotes
11988 the name of the framework and @file{header.h} is found in the
11989 @file{PrivateHeaders} or @file{Headers} directory.
11991 @item -iframework@var{dir}
11992 @opindex iframework
11993 Like @option{-F} except the directory is a treated as a system
11994 directory.  The main difference between this @option{-iframework} and
11995 @option{-F} is that with @option{-iframework} the compiler does not
11996 warn about constructs contained within header files found via
11997 @var{dir}.  This option is valid only for the C family of languages.
11999 @item -gused
12000 @opindex gused
12001 Emit debugging information for symbols that are used.  For stabs
12002 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
12003 This is by default ON@.
12005 @item -gfull
12006 @opindex gfull
12007 Emit debugging information for all symbols and types.
12009 @item -mmacosx-version-min=@var{version}
12010 The earliest version of MacOS X that this executable will run on
12011 is @var{version}.  Typical values of @var{version} include @code{10.1},
12012 @code{10.2}, and @code{10.3.9}.
12014 If the compiler was built to use the system's headers by default,
12015 then the default for this option is the system version on which the
12016 compiler is running, otherwise the default is to make choices that
12017 are compatible with as many systems and code bases as possible.
12019 @item -mkernel
12020 @opindex mkernel
12021 Enable kernel development mode.  The @option{-mkernel} option sets
12022 @option{-static}, @option{-fno-common}, @option{-fno-cxa-atexit},
12023 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
12024 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
12025 applicable.  This mode also sets @option{-mno-altivec},
12026 @option{-msoft-float}, @option{-fno-builtin} and
12027 @option{-mlong-branch} for PowerPC targets.
12029 @item -mone-byte-bool
12030 @opindex mone-byte-bool
12031 Override the defaults for @samp{bool} so that @samp{sizeof(bool)==1}.
12032 By default @samp{sizeof(bool)} is @samp{4} when compiling for
12033 Darwin/PowerPC and @samp{1} when compiling for Darwin/x86, so this
12034 option has no effect on x86.
12036 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
12037 to generate code that is not binary compatible with code generated
12038 without that switch.  Using this switch may require recompiling all
12039 other modules in a program, including system libraries.  Use this
12040 switch to conform to a non-default data model.
12042 @item -mfix-and-continue
12043 @itemx -ffix-and-continue
12044 @itemx -findirect-data
12045 @opindex mfix-and-continue
12046 @opindex ffix-and-continue
12047 @opindex findirect-data
12048 Generate code suitable for fast turnaround development, such as to
12049 allow GDB to dynamically load @code{.o} files into already-running
12050 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
12051 are provided for backwards compatibility.
12053 @item -all_load
12054 @opindex all_load
12055 Loads all members of static archive libraries.
12056 See man ld(1) for more information.
12058 @item -arch_errors_fatal
12059 @opindex arch_errors_fatal
12060 Cause the errors having to do with files that have the wrong architecture
12061 to be fatal.
12063 @item -bind_at_load
12064 @opindex bind_at_load
12065 Causes the output file to be marked such that the dynamic linker will
12066 bind all undefined references when the file is loaded or launched.
12068 @item -bundle
12069 @opindex bundle
12070 Produce a Mach-o bundle format file.
12071 See man ld(1) for more information.
12073 @item -bundle_loader @var{executable}
12074 @opindex bundle_loader
12075 This option specifies the @var{executable} that will load the build
12076 output file being linked.  See man ld(1) for more information.
12078 @item -dynamiclib
12079 @opindex dynamiclib
12080 When passed this option, GCC produces a dynamic library instead of
12081 an executable when linking, using the Darwin @file{libtool} command.
12083 @item -force_cpusubtype_ALL
12084 @opindex force_cpusubtype_ALL
12085 This causes GCC's output file to have the @var{ALL} subtype, instead of
12086 one controlled by the @option{-mcpu} or @option{-march} option.
12088 @item -allowable_client  @var{client_name}
12089 @itemx -client_name
12090 @itemx -compatibility_version
12091 @itemx -current_version
12092 @itemx -dead_strip
12093 @itemx -dependency-file
12094 @itemx -dylib_file
12095 @itemx -dylinker_install_name
12096 @itemx -dynamic
12097 @itemx -exported_symbols_list
12098 @itemx -filelist
12099 @need 800
12100 @itemx -flat_namespace
12101 @itemx -force_flat_namespace
12102 @itemx -headerpad_max_install_names
12103 @itemx -image_base
12104 @itemx -init
12105 @itemx -install_name
12106 @itemx -keep_private_externs
12107 @itemx -multi_module
12108 @itemx -multiply_defined
12109 @itemx -multiply_defined_unused
12110 @need 800
12111 @itemx -noall_load
12112 @itemx -no_dead_strip_inits_and_terms
12113 @itemx -nofixprebinding
12114 @itemx -nomultidefs
12115 @itemx -noprebind
12116 @itemx -noseglinkedit
12117 @itemx -pagezero_size
12118 @itemx -prebind
12119 @itemx -prebind_all_twolevel_modules
12120 @itemx -private_bundle
12121 @need 800
12122 @itemx -read_only_relocs
12123 @itemx -sectalign
12124 @itemx -sectobjectsymbols
12125 @itemx -whyload
12126 @itemx -seg1addr
12127 @itemx -sectcreate
12128 @itemx -sectobjectsymbols
12129 @itemx -sectorder
12130 @itemx -segaddr
12131 @itemx -segs_read_only_addr
12132 @need 800
12133 @itemx -segs_read_write_addr
12134 @itemx -seg_addr_table
12135 @itemx -seg_addr_table_filename
12136 @itemx -seglinkedit
12137 @itemx -segprot
12138 @itemx -segs_read_only_addr
12139 @itemx -segs_read_write_addr
12140 @itemx -single_module
12141 @itemx -static
12142 @itemx -sub_library
12143 @need 800
12144 @itemx -sub_umbrella
12145 @itemx -twolevel_namespace
12146 @itemx -umbrella
12147 @itemx -undefined
12148 @itemx -unexported_symbols_list
12149 @itemx -weak_reference_mismatches
12150 @itemx -whatsloaded
12151 @opindex allowable_client
12152 @opindex client_name
12153 @opindex compatibility_version
12154 @opindex current_version
12155 @opindex dead_strip
12156 @opindex dependency-file
12157 @opindex dylib_file
12158 @opindex dylinker_install_name
12159 @opindex dynamic
12160 @opindex exported_symbols_list
12161 @opindex filelist
12162 @opindex flat_namespace
12163 @opindex force_flat_namespace
12164 @opindex headerpad_max_install_names
12165 @opindex image_base
12166 @opindex init
12167 @opindex install_name
12168 @opindex keep_private_externs
12169 @opindex multi_module
12170 @opindex multiply_defined
12171 @opindex multiply_defined_unused
12172 @opindex noall_load
12173 @opindex no_dead_strip_inits_and_terms
12174 @opindex nofixprebinding
12175 @opindex nomultidefs
12176 @opindex noprebind
12177 @opindex noseglinkedit
12178 @opindex pagezero_size
12179 @opindex prebind
12180 @opindex prebind_all_twolevel_modules
12181 @opindex private_bundle
12182 @opindex read_only_relocs
12183 @opindex sectalign
12184 @opindex sectobjectsymbols
12185 @opindex whyload
12186 @opindex seg1addr
12187 @opindex sectcreate
12188 @opindex sectobjectsymbols
12189 @opindex sectorder
12190 @opindex segaddr
12191 @opindex segs_read_only_addr
12192 @opindex segs_read_write_addr
12193 @opindex seg_addr_table
12194 @opindex seg_addr_table_filename
12195 @opindex seglinkedit
12196 @opindex segprot
12197 @opindex segs_read_only_addr
12198 @opindex segs_read_write_addr
12199 @opindex single_module
12200 @opindex static
12201 @opindex sub_library
12202 @opindex sub_umbrella
12203 @opindex twolevel_namespace
12204 @opindex umbrella
12205 @opindex undefined
12206 @opindex unexported_symbols_list
12207 @opindex weak_reference_mismatches
12208 @opindex whatsloaded
12209 These options are passed to the Darwin linker.  The Darwin linker man page
12210 describes them in detail.
12211 @end table
12213 @node DEC Alpha Options
12214 @subsection DEC Alpha Options
12216 These @samp{-m} options are defined for the DEC Alpha implementations:
12218 @table @gcctabopt
12219 @item -mno-soft-float
12220 @itemx -msoft-float
12221 @opindex mno-soft-float
12222 @opindex msoft-float
12223 Use (do not use) the hardware floating-point instructions for
12224 floating-point operations.  When @option{-msoft-float} is specified,
12225 functions in @file{libgcc.a} are used to perform floating-point
12226 operations.  Unless they are replaced by routines that emulate the
12227 floating-point operations, or compiled in such a way as to call such
12228 emulations routines, these routines issue floating-point
12229 operations.   If you are compiling for an Alpha without floating-point
12230 operations, you must ensure that the library is built so as not to call
12231 them.
12233 Note that Alpha implementations without floating-point operations are
12234 required to have floating-point registers.
12236 @item -mfp-reg
12237 @itemx -mno-fp-regs
12238 @opindex mfp-reg
12239 @opindex mno-fp-regs
12240 Generate code that uses (does not use) the floating-point register set.
12241 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
12242 register set is not used, floating-point operands are passed in integer
12243 registers as if they were integers and floating-point results are passed
12244 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
12245 so any function with a floating-point argument or return value called by code
12246 compiled with @option{-mno-fp-regs} must also be compiled with that
12247 option.
12249 A typical use of this option is building a kernel that does not use,
12250 and hence need not save and restore, any floating-point registers.
12252 @item -mieee
12253 @opindex mieee
12254 The Alpha architecture implements floating-point hardware optimized for
12255 maximum performance.  It is mostly compliant with the IEEE floating-point
12256 standard.  However, for full compliance, software assistance is
12257 required.  This option generates code fully IEEE-compliant code
12258 @emph{except} that the @var{inexact-flag} is not maintained (see below).
12259 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
12260 defined during compilation.  The resulting code is less efficient but is
12261 able to correctly support denormalized numbers and exceptional IEEE
12262 values such as not-a-number and plus/minus infinity.  Other Alpha
12263 compilers call this option @option{-ieee_with_no_inexact}.
12265 @item -mieee-with-inexact
12266 @opindex mieee-with-inexact
12267 This is like @option{-mieee} except the generated code also maintains
12268 the IEEE @var{inexact-flag}.  Turning on this option causes the
12269 generated code to implement fully-compliant IEEE math.  In addition to
12270 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
12271 macro.  On some Alpha implementations the resulting code may execute
12272 significantly slower than the code generated by default.  Since there is
12273 very little code that depends on the @var{inexact-flag}, you should
12274 normally not specify this option.  Other Alpha compilers call this
12275 option @option{-ieee_with_inexact}.
12277 @item -mfp-trap-mode=@var{trap-mode}
12278 @opindex mfp-trap-mode
12279 This option controls what floating-point related traps are enabled.
12280 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
12281 The trap mode can be set to one of four values:
12283 @table @samp
12284 @item n
12285 This is the default (normal) setting.  The only traps that are enabled
12286 are the ones that cannot be disabled in software (e.g., division by zero
12287 trap).
12289 @item u
12290 In addition to the traps enabled by @samp{n}, underflow traps are enabled
12291 as well.
12293 @item su
12294 Like @samp{u}, but the instructions are marked to be safe for software
12295 completion (see Alpha architecture manual for details).
12297 @item sui
12298 Like @samp{su}, but inexact traps are enabled as well.
12299 @end table
12301 @item -mfp-rounding-mode=@var{rounding-mode}
12302 @opindex mfp-rounding-mode
12303 Selects the IEEE rounding mode.  Other Alpha compilers call this option
12304 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
12307 @table @samp
12308 @item n
12309 Normal IEEE rounding mode.  Floating-point numbers are rounded towards
12310 the nearest machine number or towards the even machine number in case
12311 of a tie.
12313 @item m
12314 Round towards minus infinity.
12316 @item c
12317 Chopped rounding mode.  Floating-point numbers are rounded towards zero.
12319 @item d
12320 Dynamic rounding mode.  A field in the floating-point control register
12321 (@var{fpcr}, see Alpha architecture reference manual) controls the
12322 rounding mode in effect.  The C library initializes this register for
12323 rounding towards plus infinity.  Thus, unless your program modifies the
12324 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
12325 @end table
12327 @item -mtrap-precision=@var{trap-precision}
12328 @opindex mtrap-precision
12329 In the Alpha architecture, floating-point traps are imprecise.  This
12330 means without software assistance it is impossible to recover from a
12331 floating trap and program execution normally needs to be terminated.
12332 GCC can generate code that can assist operating system trap handlers
12333 in determining the exact location that caused a floating-point trap.
12334 Depending on the requirements of an application, different levels of
12335 precisions can be selected:
12337 @table @samp
12338 @item p
12339 Program precision.  This option is the default and means a trap handler
12340 can only identify which program caused a floating-point exception.
12342 @item f
12343 Function precision.  The trap handler can determine the function that
12344 caused a floating-point exception.
12346 @item i
12347 Instruction precision.  The trap handler can determine the exact
12348 instruction that caused a floating-point exception.
12349 @end table
12351 Other Alpha compilers provide the equivalent options called
12352 @option{-scope_safe} and @option{-resumption_safe}.
12354 @item -mieee-conformant
12355 @opindex mieee-conformant
12356 This option marks the generated code as IEEE conformant.  You must not
12357 use this option unless you also specify @option{-mtrap-precision=i} and either
12358 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
12359 is to emit the line @samp{.eflag 48} in the function prologue of the
12360 generated assembly file.
12362 @item -mbuild-constants
12363 @opindex mbuild-constants
12364 Normally GCC examines a 32- or 64-bit integer constant to
12365 see if it can construct it from smaller constants in two or three
12366 instructions.  If it cannot, it outputs the constant as a literal and
12367 generates code to load it from the data segment at run time.
12369 Use this option to require GCC to construct @emph{all} integer constants
12370 using code, even if it takes more instructions (the maximum is six).
12372 You typically use this option to build a shared library dynamic
12373 loader.  Itself a shared library, it must relocate itself in memory
12374 before it can find the variables and constants in its own data segment.
12376 @item -mbwx
12377 @itemx -mno-bwx
12378 @itemx -mcix
12379 @itemx -mno-cix
12380 @itemx -mfix
12381 @itemx -mno-fix
12382 @itemx -mmax
12383 @itemx -mno-max
12384 @opindex mbwx
12385 @opindex mno-bwx
12386 @opindex mcix
12387 @opindex mno-cix
12388 @opindex mfix
12389 @opindex mno-fix
12390 @opindex mmax
12391 @opindex mno-max
12392 Indicate whether GCC should generate code to use the optional BWX,
12393 CIX, FIX and MAX instruction sets.  The default is to use the instruction
12394 sets supported by the CPU type specified via @option{-mcpu=} option or that
12395 of the CPU on which GCC was built if none is specified.
12397 @item -mfloat-vax
12398 @itemx -mfloat-ieee
12399 @opindex mfloat-vax
12400 @opindex mfloat-ieee
12401 Generate code that uses (does not use) VAX F and G floating-point
12402 arithmetic instead of IEEE single and double precision.
12404 @item -mexplicit-relocs
12405 @itemx -mno-explicit-relocs
12406 @opindex mexplicit-relocs
12407 @opindex mno-explicit-relocs
12408 Older Alpha assemblers provided no way to generate symbol relocations
12409 except via assembler macros.  Use of these macros does not allow
12410 optimal instruction scheduling.  GNU binutils as of version 2.12
12411 supports a new syntax that allows the compiler to explicitly mark
12412 which relocations should apply to which instructions.  This option
12413 is mostly useful for debugging, as GCC detects the capabilities of
12414 the assembler when it is built and sets the default accordingly.
12416 @item -msmall-data
12417 @itemx -mlarge-data
12418 @opindex msmall-data
12419 @opindex mlarge-data
12420 When @option{-mexplicit-relocs} is in effect, static data is
12421 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
12422 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
12423 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
12424 16-bit relocations off of the @code{$gp} register.  This limits the
12425 size of the small data area to 64KB, but allows the variables to be
12426 directly accessed via a single instruction.
12428 The default is @option{-mlarge-data}.  With this option the data area
12429 is limited to just below 2GB@.  Programs that require more than 2GB of
12430 data must use @code{malloc} or @code{mmap} to allocate the data in the
12431 heap instead of in the program's data segment.
12433 When generating code for shared libraries, @option{-fpic} implies
12434 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
12436 @item -msmall-text
12437 @itemx -mlarge-text
12438 @opindex msmall-text
12439 @opindex mlarge-text
12440 When @option{-msmall-text} is used, the compiler assumes that the
12441 code of the entire program (or shared library) fits in 4MB, and is
12442 thus reachable with a branch instruction.  When @option{-msmall-data}
12443 is used, the compiler can assume that all local symbols share the
12444 same @code{$gp} value, and thus reduce the number of instructions
12445 required for a function call from 4 to 1.
12447 The default is @option{-mlarge-text}.
12449 @item -mcpu=@var{cpu_type}
12450 @opindex mcpu
12451 Set the instruction set and instruction scheduling parameters for
12452 machine type @var{cpu_type}.  You can specify either the @samp{EV}
12453 style name or the corresponding chip number.  GCC supports scheduling
12454 parameters for the EV4, EV5 and EV6 family of processors and
12455 chooses the default values for the instruction set from the processor
12456 you specify.  If you do not specify a processor type, GCC defaults
12457 to the processor on which the compiler was built.
12459 Supported values for @var{cpu_type} are
12461 @table @samp
12462 @item ev4
12463 @itemx ev45
12464 @itemx 21064
12465 Schedules as an EV4 and has no instruction set extensions.
12467 @item ev5
12468 @itemx 21164
12469 Schedules as an EV5 and has no instruction set extensions.
12471 @item ev56
12472 @itemx 21164a
12473 Schedules as an EV5 and supports the BWX extension.
12475 @item pca56
12476 @itemx 21164pc
12477 @itemx 21164PC
12478 Schedules as an EV5 and supports the BWX and MAX extensions.
12480 @item ev6
12481 @itemx 21264
12482 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
12484 @item ev67
12485 @itemx 21264a
12486 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
12487 @end table
12489 Native toolchains also support the value @samp{native},
12490 which selects the best architecture option for the host processor.
12491 @option{-mcpu=native} has no effect if GCC does not recognize
12492 the processor.
12494 @item -mtune=@var{cpu_type}
12495 @opindex mtune
12496 Set only the instruction scheduling parameters for machine type
12497 @var{cpu_type}.  The instruction set is not changed.
12499 Native toolchains also support the value @samp{native},
12500 which selects the best architecture option for the host processor.
12501 @option{-mtune=native} has no effect if GCC does not recognize
12502 the processor.
12504 @item -mmemory-latency=@var{time}
12505 @opindex mmemory-latency
12506 Sets the latency the scheduler should assume for typical memory
12507 references as seen by the application.  This number is highly
12508 dependent on the memory access patterns used by the application
12509 and the size of the external cache on the machine.
12511 Valid options for @var{time} are
12513 @table @samp
12514 @item @var{number}
12515 A decimal number representing clock cycles.
12517 @item L1
12518 @itemx L2
12519 @itemx L3
12520 @itemx main
12521 The compiler contains estimates of the number of clock cycles for
12522 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
12523 (also called Dcache, Scache, and Bcache), as well as to main memory.
12524 Note that L3 is only valid for EV5.
12526 @end table
12527 @end table
12529 @node FR30 Options
12530 @subsection FR30 Options
12531 @cindex FR30 Options
12533 These options are defined specifically for the FR30 port.
12535 @table @gcctabopt
12537 @item -msmall-model
12538 @opindex msmall-model
12539 Use the small address space model.  This can produce smaller code, but
12540 it does assume that all symbolic values and addresses fit into a
12541 20-bit range.
12543 @item -mno-lsim
12544 @opindex mno-lsim
12545 Assume that runtime support has been provided and so there is no need
12546 to include the simulator library (@file{libsim.a}) on the linker
12547 command line.
12549 @end table
12551 @node FRV Options
12552 @subsection FRV Options
12553 @cindex FRV Options
12555 @table @gcctabopt
12556 @item -mgpr-32
12557 @opindex mgpr-32
12559 Only use the first 32 general-purpose registers.
12561 @item -mgpr-64
12562 @opindex mgpr-64
12564 Use all 64 general-purpose registers.
12566 @item -mfpr-32
12567 @opindex mfpr-32
12569 Use only the first 32 floating-point registers.
12571 @item -mfpr-64
12572 @opindex mfpr-64
12574 Use all 64 floating-point registers.
12576 @item -mhard-float
12577 @opindex mhard-float
12579 Use hardware instructions for floating-point operations.
12581 @item -msoft-float
12582 @opindex msoft-float
12584 Use library routines for floating-point operations.
12586 @item -malloc-cc
12587 @opindex malloc-cc
12589 Dynamically allocate condition code registers.
12591 @item -mfixed-cc
12592 @opindex mfixed-cc
12594 Do not try to dynamically allocate condition code registers, only
12595 use @code{icc0} and @code{fcc0}.
12597 @item -mdword
12598 @opindex mdword
12600 Change ABI to use double word insns.
12602 @item -mno-dword
12603 @opindex mno-dword
12605 Do not use double word instructions.
12607 @item -mdouble
12608 @opindex mdouble
12610 Use floating-point double instructions.
12612 @item -mno-double
12613 @opindex mno-double
12615 Do not use floating-point double instructions.
12617 @item -mmedia
12618 @opindex mmedia
12620 Use media instructions.
12622 @item -mno-media
12623 @opindex mno-media
12625 Do not use media instructions.
12627 @item -mmuladd
12628 @opindex mmuladd
12630 Use multiply and add/subtract instructions.
12632 @item -mno-muladd
12633 @opindex mno-muladd
12635 Do not use multiply and add/subtract instructions.
12637 @item -mfdpic
12638 @opindex mfdpic
12640 Select the FDPIC ABI, which uses function descriptors to represent
12641 pointers to functions.  Without any PIC/PIE-related options, it
12642 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
12643 assumes GOT entries and small data are within a 12-bit range from the
12644 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
12645 are computed with 32 bits.
12646 With a @samp{bfin-elf} target, this option implies @option{-msim}.
12648 @item -minline-plt
12649 @opindex minline-plt
12651 Enable inlining of PLT entries in function calls to functions that are
12652 not known to bind locally.  It has no effect without @option{-mfdpic}.
12653 It's enabled by default if optimizing for speed and compiling for
12654 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
12655 optimization option such as @option{-O3} or above is present in the
12656 command line.
12658 @item -mTLS
12659 @opindex mTLS
12661 Assume a large TLS segment when generating thread-local code.
12663 @item -mtls
12664 @opindex mtls
12666 Do not assume a large TLS segment when generating thread-local code.
12668 @item -mgprel-ro
12669 @opindex mgprel-ro
12671 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
12672 that is known to be in read-only sections.  It's enabled by default,
12673 except for @option{-fpic} or @option{-fpie}: even though it may help
12674 make the global offset table smaller, it trades 1 instruction for 4.
12675 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
12676 one of which may be shared by multiple symbols, and it avoids the need
12677 for a GOT entry for the referenced symbol, so it's more likely to be a
12678 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
12680 @item -multilib-library-pic
12681 @opindex multilib-library-pic
12683 Link with the (library, not FD) pic libraries.  It's implied by
12684 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
12685 @option{-fpic} without @option{-mfdpic}.  You should never have to use
12686 it explicitly.
12688 @item -mlinked-fp
12689 @opindex mlinked-fp
12691 Follow the EABI requirement of always creating a frame pointer whenever
12692 a stack frame is allocated.  This option is enabled by default and can
12693 be disabled with @option{-mno-linked-fp}.
12695 @item -mlong-calls
12696 @opindex mlong-calls
12698 Use indirect addressing to call functions outside the current
12699 compilation unit.  This allows the functions to be placed anywhere
12700 within the 32-bit address space.
12702 @item -malign-labels
12703 @opindex malign-labels
12705 Try to align labels to an 8-byte boundary by inserting NOPs into the
12706 previous packet.  This option only has an effect when VLIW packing
12707 is enabled.  It doesn't create new packets; it merely adds NOPs to
12708 existing ones.
12710 @item -mlibrary-pic
12711 @opindex mlibrary-pic
12713 Generate position-independent EABI code.
12715 @item -macc-4
12716 @opindex macc-4
12718 Use only the first four media accumulator registers.
12720 @item -macc-8
12721 @opindex macc-8
12723 Use all eight media accumulator registers.
12725 @item -mpack
12726 @opindex mpack
12728 Pack VLIW instructions.
12730 @item -mno-pack
12731 @opindex mno-pack
12733 Do not pack VLIW instructions.
12735 @item -mno-eflags
12736 @opindex mno-eflags
12738 Do not mark ABI switches in e_flags.
12740 @item -mcond-move
12741 @opindex mcond-move
12743 Enable the use of conditional-move instructions (default).
12745 This switch is mainly for debugging the compiler and will likely be removed
12746 in a future version.
12748 @item -mno-cond-move
12749 @opindex mno-cond-move
12751 Disable the use of conditional-move instructions.
12753 This switch is mainly for debugging the compiler and will likely be removed
12754 in a future version.
12756 @item -mscc
12757 @opindex mscc
12759 Enable the use of conditional set instructions (default).
12761 This switch is mainly for debugging the compiler and will likely be removed
12762 in a future version.
12764 @item -mno-scc
12765 @opindex mno-scc
12767 Disable the use of conditional set instructions.
12769 This switch is mainly for debugging the compiler and will likely be removed
12770 in a future version.
12772 @item -mcond-exec
12773 @opindex mcond-exec
12775 Enable the use of conditional execution (default).
12777 This switch is mainly for debugging the compiler and will likely be removed
12778 in a future version.
12780 @item -mno-cond-exec
12781 @opindex mno-cond-exec
12783 Disable the use of conditional execution.
12785 This switch is mainly for debugging the compiler and will likely be removed
12786 in a future version.
12788 @item -mvliw-branch
12789 @opindex mvliw-branch
12791 Run a pass to pack branches into VLIW instructions (default).
12793 This switch is mainly for debugging the compiler and will likely be removed
12794 in a future version.
12796 @item -mno-vliw-branch
12797 @opindex mno-vliw-branch
12799 Do not run a pass to pack branches into VLIW instructions.
12801 This switch is mainly for debugging the compiler and will likely be removed
12802 in a future version.
12804 @item -mmulti-cond-exec
12805 @opindex mmulti-cond-exec
12807 Enable optimization of @code{&&} and @code{||} in conditional execution
12808 (default).
12810 This switch is mainly for debugging the compiler and will likely be removed
12811 in a future version.
12813 @item -mno-multi-cond-exec
12814 @opindex mno-multi-cond-exec
12816 Disable optimization of @code{&&} and @code{||} in conditional execution.
12818 This switch is mainly for debugging the compiler and will likely be removed
12819 in a future version.
12821 @item -mnested-cond-exec
12822 @opindex mnested-cond-exec
12824 Enable nested conditional execution optimizations (default).
12826 This switch is mainly for debugging the compiler and will likely be removed
12827 in a future version.
12829 @item -mno-nested-cond-exec
12830 @opindex mno-nested-cond-exec
12832 Disable nested conditional execution optimizations.
12834 This switch is mainly for debugging the compiler and will likely be removed
12835 in a future version.
12837 @item -moptimize-membar
12838 @opindex moptimize-membar
12840 This switch removes redundant @code{membar} instructions from the
12841 compiler-generated code.  It is enabled by default.
12843 @item -mno-optimize-membar
12844 @opindex mno-optimize-membar
12846 This switch disables the automatic removal of redundant @code{membar}
12847 instructions from the generated code.
12849 @item -mtomcat-stats
12850 @opindex mtomcat-stats
12852 Cause gas to print out tomcat statistics.
12854 @item -mcpu=@var{cpu}
12855 @opindex mcpu
12857 Select the processor type for which to generate code.  Possible values are
12858 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
12859 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
12861 @end table
12863 @node GNU/Linux Options
12864 @subsection GNU/Linux Options
12866 These @samp{-m} options are defined for GNU/Linux targets:
12868 @table @gcctabopt
12869 @item -mglibc
12870 @opindex mglibc
12871 Use the GNU C library.  This is the default except
12872 on @samp{*-*-linux-*uclibc*} and @samp{*-*-linux-*android*} targets.
12874 @item -muclibc
12875 @opindex muclibc
12876 Use uClibc C library.  This is the default on
12877 @samp{*-*-linux-*uclibc*} targets.
12879 @item -mbionic
12880 @opindex mbionic
12881 Use Bionic C library.  This is the default on
12882 @samp{*-*-linux-*android*} targets.
12884 @item -mandroid
12885 @opindex mandroid
12886 Compile code compatible with Android platform.  This is the default on
12887 @samp{*-*-linux-*android*} targets.
12889 When compiling, this option enables @option{-mbionic}, @option{-fPIC},
12890 @option{-fno-exceptions} and @option{-fno-rtti} by default.  When linking,
12891 this option makes the GCC driver pass Android-specific options to the linker.
12892 Finally, this option causes the preprocessor macro @code{__ANDROID__}
12893 to be defined.
12895 @item -tno-android-cc
12896 @opindex tno-android-cc
12897 Disable compilation effects of @option{-mandroid}, i.e., do not enable
12898 @option{-mbionic}, @option{-fPIC}, @option{-fno-exceptions} and
12899 @option{-fno-rtti} by default.
12901 @item -tno-android-ld
12902 @opindex tno-android-ld
12903 Disable linking effects of @option{-mandroid}, i.e., pass standard Linux
12904 linking options to the linker.
12906 @end table
12908 @node H8/300 Options
12909 @subsection H8/300 Options
12911 These @samp{-m} options are defined for the H8/300 implementations:
12913 @table @gcctabopt
12914 @item -mrelax
12915 @opindex mrelax
12916 Shorten some address references at link time, when possible; uses the
12917 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
12918 ld, Using ld}, for a fuller description.
12920 @item -mh
12921 @opindex mh
12922 Generate code for the H8/300H@.
12924 @item -ms
12925 @opindex ms
12926 Generate code for the H8S@.
12928 @item -mn
12929 @opindex mn
12930 Generate code for the H8S and H8/300H in the normal mode.  This switch
12931 must be used either with @option{-mh} or @option{-ms}.
12933 @item -ms2600
12934 @opindex ms2600
12935 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
12937 @item -mexr
12938 @opindex mexr
12939 Extended registers are stored on stack before execution of function
12940 with monitor attribute. Default option is @option{-mexr}.
12941 This option is valid only for H8S targets.
12943 @item -mno-exr
12944 @opindex mno-exr
12945 Extended registers are not stored on stack before execution of function 
12946 with monitor attribute. Default option is @option{-mno-exr}. 
12947 This option is valid only for H8S targets.
12949 @item -mint32
12950 @opindex mint32
12951 Make @code{int} data 32 bits by default.
12953 @item -malign-300
12954 @opindex malign-300
12955 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
12956 The default for the H8/300H and H8S is to align longs and floats on
12957 4-byte boundaries.
12958 @option{-malign-300} causes them to be aligned on 2-byte boundaries.
12959 This option has no effect on the H8/300.
12960 @end table
12962 @node HPPA Options
12963 @subsection HPPA Options
12964 @cindex HPPA Options
12966 These @samp{-m} options are defined for the HPPA family of computers:
12968 @table @gcctabopt
12969 @item -march=@var{architecture-type}
12970 @opindex march
12971 Generate code for the specified architecture.  The choices for
12972 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
12973 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
12974 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
12975 architecture option for your machine.  Code compiled for lower numbered
12976 architectures runs on higher numbered architectures, but not the
12977 other way around.
12979 @item -mpa-risc-1-0
12980 @itemx -mpa-risc-1-1
12981 @itemx -mpa-risc-2-0
12982 @opindex mpa-risc-1-0
12983 @opindex mpa-risc-1-1
12984 @opindex mpa-risc-2-0
12985 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
12987 @item -mbig-switch
12988 @opindex mbig-switch
12989 Generate code suitable for big switch tables.  Use this option only if
12990 the assembler/linker complain about out-of-range branches within a switch
12991 table.
12993 @item -mjump-in-delay
12994 @opindex mjump-in-delay
12995 Fill delay slots of function calls with unconditional jump instructions
12996 by modifying the return pointer for the function call to be the target
12997 of the conditional jump.
12999 @item -mdisable-fpregs
13000 @opindex mdisable-fpregs
13001 Prevent floating-point registers from being used in any manner.  This is
13002 necessary for compiling kernels that perform lazy context switching of
13003 floating-point registers.  If you use this option and attempt to perform
13004 floating-point operations, the compiler aborts.
13006 @item -mdisable-indexing
13007 @opindex mdisable-indexing
13008 Prevent the compiler from using indexing address modes.  This avoids some
13009 rather obscure problems when compiling MIG generated code under MACH@.
13011 @item -mno-space-regs
13012 @opindex mno-space-regs
13013 Generate code that assumes the target has no space registers.  This allows
13014 GCC to generate faster indirect calls and use unscaled index address modes.
13016 Such code is suitable for level 0 PA systems and kernels.
13018 @item -mfast-indirect-calls
13019 @opindex mfast-indirect-calls
13020 Generate code that assumes calls never cross space boundaries.  This
13021 allows GCC to emit code that performs faster indirect calls.
13023 This option does not work in the presence of shared libraries or nested
13024 functions.
13026 @item -mfixed-range=@var{register-range}
13027 @opindex mfixed-range
13028 Generate code treating the given register range as fixed registers.
13029 A fixed register is one that the register allocator cannot use.  This is
13030 useful when compiling kernel code.  A register range is specified as
13031 two registers separated by a dash.  Multiple register ranges can be
13032 specified separated by a comma.
13034 @item -mlong-load-store
13035 @opindex mlong-load-store
13036 Generate 3-instruction load and store sequences as sometimes required by
13037 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
13038 the HP compilers.
13040 @item -mportable-runtime
13041 @opindex mportable-runtime
13042 Use the portable calling conventions proposed by HP for ELF systems.
13044 @item -mgas
13045 @opindex mgas
13046 Enable the use of assembler directives only GAS understands.
13048 @item -mschedule=@var{cpu-type}
13049 @opindex mschedule
13050 Schedule code according to the constraints for the machine type
13051 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
13052 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
13053 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
13054 proper scheduling option for your machine.  The default scheduling is
13055 @samp{8000}.
13057 @item -mlinker-opt
13058 @opindex mlinker-opt
13059 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
13060 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
13061 linkers in which they give bogus error messages when linking some programs.
13063 @item -msoft-float
13064 @opindex msoft-float
13065 Generate output containing library calls for floating point.
13066 @strong{Warning:} the requisite libraries are not available for all HPPA
13067 targets.  Normally the facilities of the machine's usual C compiler are
13068 used, but this cannot be done directly in cross-compilation.  You must make
13069 your own arrangements to provide suitable library functions for
13070 cross-compilation.
13072 @option{-msoft-float} changes the calling convention in the output file;
13073 therefore, it is only useful if you compile @emph{all} of a program with
13074 this option.  In particular, you need to compile @file{libgcc.a}, the
13075 library that comes with GCC, with @option{-msoft-float} in order for
13076 this to work.
13078 @item -msio
13079 @opindex msio
13080 Generate the predefine, @code{_SIO}, for server IO@.  The default is
13081 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
13082 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
13083 options are available under HP-UX and HI-UX@.
13085 @item -mgnu-ld
13086 @opindex mgnu-ld
13087 Use options specific to GNU @command{ld}.
13088 This passes @option{-shared} to @command{ld} when
13089 building a shared library.  It is the default when GCC is configured,
13090 explicitly or implicitly, with the GNU linker.  This option does not
13091 affect which @command{ld} is called; it only changes what parameters
13092 are passed to that @command{ld}.
13093 The @command{ld} that is called is determined by the
13094 @option{--with-ld} configure option, GCC's program search path, and
13095 finally by the user's @env{PATH}.  The linker used by GCC can be printed
13096 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
13097 on the 64-bit HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
13099 @item -mhp-ld
13100 @opindex mhp-ld
13101 Use options specific to HP @command{ld}.
13102 This passes @option{-b} to @command{ld} when building
13103 a shared library and passes @option{+Accept TypeMismatch} to @command{ld} on all
13104 links.  It is the default when GCC is configured, explicitly or
13105 implicitly, with the HP linker.  This option does not affect
13106 which @command{ld} is called; it only changes what parameters are passed to that
13107 @command{ld}.
13108 The @command{ld} that is called is determined by the @option{--with-ld}
13109 configure option, GCC's program search path, and finally by the user's
13110 @env{PATH}.  The linker used by GCC can be printed using @samp{which
13111 `gcc -print-prog-name=ld`}.  This option is only available on the 64-bit
13112 HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
13114 @item -mlong-calls
13115 @opindex mno-long-calls
13116 Generate code that uses long call sequences.  This ensures that a call
13117 is always able to reach linker generated stubs.  The default is to generate
13118 long calls only when the distance from the call site to the beginning
13119 of the function or translation unit, as the case may be, exceeds a
13120 predefined limit set by the branch type being used.  The limits for
13121 normal calls are 7,600,000 and 240,000 bytes, respectively for the
13122 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
13123 240,000 bytes.
13125 Distances are measured from the beginning of functions when using the
13126 @option{-ffunction-sections} option, or when using the @option{-mgas}
13127 and @option{-mno-portable-runtime} options together under HP-UX with
13128 the SOM linker.
13130 It is normally not desirable to use this option as it degrades
13131 performance.  However, it may be useful in large applications,
13132 particularly when partial linking is used to build the application.
13134 The types of long calls used depends on the capabilities of the
13135 assembler and linker, and the type of code being generated.  The
13136 impact on systems that support long absolute calls, and long pic
13137 symbol-difference or pc-relative calls should be relatively small.
13138 However, an indirect call is used on 32-bit ELF systems in pic code
13139 and it is quite long.
13141 @item -munix=@var{unix-std}
13142 @opindex march
13143 Generate compiler predefines and select a startfile for the specified
13144 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
13145 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
13146 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
13147 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
13148 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
13149 and later.
13151 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
13152 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
13153 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
13154 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
13155 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
13156 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
13158 It is @emph{important} to note that this option changes the interfaces
13159 for various library routines.  It also affects the operational behavior
13160 of the C library.  Thus, @emph{extreme} care is needed in using this
13161 option.
13163 Library code that is intended to operate with more than one UNIX
13164 standard must test, set and restore the variable @var{__xpg4_extended_mask}
13165 as appropriate.  Most GNU software doesn't provide this capability.
13167 @item -nolibdld
13168 @opindex nolibdld
13169 Suppress the generation of link options to search libdld.sl when the
13170 @option{-static} option is specified on HP-UX 10 and later.
13172 @item -static
13173 @opindex static
13174 The HP-UX implementation of setlocale in libc has a dependency on
13175 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
13176 when the @option{-static} option is specified, special link options
13177 are needed to resolve this dependency.
13179 On HP-UX 10 and later, the GCC driver adds the necessary options to
13180 link with libdld.sl when the @option{-static} option is specified.
13181 This causes the resulting binary to be dynamic.  On the 64-bit port,
13182 the linkers generate dynamic binaries by default in any case.  The
13183 @option{-nolibdld} option can be used to prevent the GCC driver from
13184 adding these link options.
13186 @item -threads
13187 @opindex threads
13188 Add support for multithreading with the @dfn{dce thread} library
13189 under HP-UX@.  This option sets flags for both the preprocessor and
13190 linker.
13191 @end table
13193 @node i386 and x86-64 Options
13194 @subsection Intel 386 and AMD x86-64 Options
13195 @cindex i386 Options
13196 @cindex x86-64 Options
13197 @cindex Intel 386 Options
13198 @cindex AMD x86-64 Options
13200 These @samp{-m} options are defined for the i386 and x86-64 family of
13201 computers:
13203 @table @gcctabopt
13205 @item -march=@var{cpu-type}
13206 @opindex march
13207 Generate instructions for the machine type @var{cpu-type}.  In contrast to
13208 @option{-mtune=@var{cpu-type}}, which merely tunes the generated code 
13209 for the specified @var{cpu-type}, @option{-march=@var{cpu-type}} allows GCC
13210 to generate code that may not run at all on processors other than the one
13211 indicated.  Specifying @option{-march=@var{cpu-type}} implies 
13212 @option{-mtune=@var{cpu-type}}.
13214 The choices for @var{cpu-type} are:
13216 @table @samp
13217 @item native
13218 This selects the CPU to generate code for at compilation time by determining
13219 the processor type of the compiling machine.  Using @option{-march=native}
13220 enables all instruction subsets supported by the local machine (hence
13221 the result might not run on different machines).  Using @option{-mtune=native}
13222 produces code optimized for the local machine under the constraints
13223 of the selected instruction set.  
13225 @item i386
13226 Original Intel i386 CPU@.
13228 @item i486
13229 Intel i486 CPU@.  (No scheduling is implemented for this chip.)
13231 @item i586
13232 @itemx pentium
13233 Intel Pentium CPU with no MMX support.
13235 @item pentium-mmx
13236 Intel Pentium MMX CPU, based on Pentium core with MMX instruction set support.
13238 @item pentiumpro
13239 Intel Pentium Pro CPU@.
13241 @item i686
13242 When used with @option{-march}, the Pentium Pro
13243 instruction set is used, so the code runs on all i686 family chips.
13244 When used with @option{-mtune}, it has the same meaning as @samp{generic}.
13246 @item pentium2
13247 Intel Pentium II CPU, based on Pentium Pro core with MMX instruction set
13248 support.
13250 @item pentium3
13251 @itemx pentium3m
13252 Intel Pentium III CPU, based on Pentium Pro core with MMX and SSE instruction
13253 set support.
13255 @item pentium-m
13256 Intel Pentium M; low-power version of Intel Pentium III CPU
13257 with MMX, SSE and SSE2 instruction set support.  Used by Centrino notebooks.
13259 @item pentium4
13260 @itemx pentium4m
13261 Intel Pentium 4 CPU with MMX, SSE and SSE2 instruction set support.
13263 @item prescott
13264 Improved version of Intel Pentium 4 CPU with MMX, SSE, SSE2 and SSE3 instruction
13265 set support.
13267 @item nocona
13268 Improved version of Intel Pentium 4 CPU with 64-bit extensions, MMX, SSE,
13269 SSE2 and SSE3 instruction set support.
13271 @item core2
13272 Intel Core 2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
13273 instruction set support.
13275 @item corei7
13276 Intel Core i7 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1
13277 and SSE4.2 instruction set support.
13279 @item corei7-avx
13280 Intel Core i7 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
13281 SSE4.1, SSE4.2, AVX, AES and PCLMUL instruction set support.
13283 @item core-avx-i
13284 Intel Core CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
13285 SSE4.1, SSE4.2, AVX, AES, PCLMUL, FSGSBASE, RDRND and F16C instruction
13286 set support.
13288 @item atom
13289 Intel Atom CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
13290 instruction set support.
13292 @item k6
13293 AMD K6 CPU with MMX instruction set support.
13295 @item k6-2
13296 @itemx k6-3
13297 Improved versions of AMD K6 CPU with MMX and 3DNow!@: instruction set support.
13299 @item athlon
13300 @itemx athlon-tbird
13301 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3DNow!@: and SSE prefetch instructions
13302 support.
13304 @item athlon-4
13305 @itemx athlon-xp
13306 @itemx athlon-mp
13307 Improved AMD Athlon CPU with MMX, 3DNow!, enhanced 3DNow!@: and full SSE
13308 instruction set support.
13310 @item k8
13311 @itemx opteron
13312 @itemx athlon64
13313 @itemx athlon-fx
13314 Processors based on the AMD K8 core with x86-64 instruction set support,
13315 including the AMD Opteron, Athlon 64, and Athlon 64 FX processors.
13316 (This supersets MMX, SSE, SSE2, 3DNow!, enhanced 3DNow!@: and 64-bit
13317 instruction set extensions.)
13319 @item k8-sse3
13320 @itemx opteron-sse3
13321 @itemx athlon64-sse3
13322 Improved versions of AMD K8 cores with SSE3 instruction set support.
13324 @item amdfam10
13325 @itemx barcelona
13326 CPUs based on AMD Family 10h cores with x86-64 instruction set support.  (This
13327 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3DNow!, enhanced 3DNow!, ABM and 64-bit
13328 instruction set extensions.)
13330 @item bdver1
13331 CPUs based on AMD Family 15h cores with x86-64 instruction set support.  (This
13332 supersets FMA4, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A,
13333 SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set extensions.)
13334 @item bdver2
13335 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
13336 supersets BMI, TBM, F16C, FMA, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE,
13337 SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set 
13338 extensions.)
13340 @item btver1
13341 CPUs based on AMD Family 14h cores with x86-64 instruction set support.  (This
13342 supersets MMX, SSE, SSE2, SSE3, SSSE3, SSE4A, CX16, ABM and 64-bit
13343 instruction set extensions.)
13345 @item btver2
13346 CPUs based on AMD Family 16h cores with x86-64 instruction set support. This
13347 includes MOVBE, F16C, BMI, AVX, PCL_MUL, AES, SSE4.2, SSE4.1, CX16, ABM,
13348 SSE4A, SSSE3, SSE3, SSE2, SSE, MMX and 64-bit instruction set extensions.
13350 @item winchip-c6
13351 IDT WinChip C6 CPU, dealt in same way as i486 with additional MMX instruction
13352 set support.
13354 @item winchip2
13355 IDT WinChip 2 CPU, dealt in same way as i486 with additional MMX and 3DNow!@:
13356 instruction set support.
13358 @item c3
13359 VIA C3 CPU with MMX and 3DNow!@: instruction set support.  (No scheduling is
13360 implemented for this chip.)
13362 @item c3-2
13363 VIA C3-2 (Nehemiah/C5XL) CPU with MMX and SSE instruction set support.
13364 (No scheduling is
13365 implemented for this chip.)
13367 @item geode
13368 AMD Geode embedded processor with MMX and 3DNow!@: instruction set support.
13369 @end table
13371 @item -mtune=@var{cpu-type}
13372 @opindex mtune
13373 Tune to @var{cpu-type} everything applicable about the generated code, except
13374 for the ABI and the set of available instructions.  
13375 While picking a specific @var{cpu-type} schedules things appropriately
13376 for that particular chip, the compiler does not generate any code that
13377 cannot run on the default machine type unless you use a
13378 @option{-march=@var{cpu-type}} option.
13379 For example, if GCC is configured for i686-pc-linux-gnu
13380 then @option{-mtune=pentium4} generates code that is tuned for Pentium 4
13381 but still runs on i686 machines.
13383 The choices for @var{cpu-type} are the same as for @option{-march}.
13384 In addition, @option{-mtune} supports an extra choice for @var{cpu-type}:
13386 @table @samp
13387 @item generic
13388 Produce code optimized for the most common IA32/@/AMD64/@/EM64T processors.
13389 If you know the CPU on which your code will run, then you should use
13390 the corresponding @option{-mtune} or @option{-march} option instead of
13391 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
13392 of your application will have, then you should use this option.
13394 As new processors are deployed in the marketplace, the behavior of this
13395 option will change.  Therefore, if you upgrade to a newer version of
13396 GCC, code generation controlled by this option will change to reflect
13397 the processors
13398 that are most common at the time that version of GCC is released.
13400 There is no @option{-march=generic} option because @option{-march}
13401 indicates the instruction set the compiler can use, and there is no
13402 generic instruction set applicable to all processors.  In contrast,
13403 @option{-mtune} indicates the processor (or, in this case, collection of
13404 processors) for which the code is optimized.
13405 @end table
13407 @item -mcpu=@var{cpu-type}
13408 @opindex mcpu
13409 A deprecated synonym for @option{-mtune}.
13411 @item -mfpmath=@var{unit}
13412 @opindex mfpmath
13413 Generate floating-point arithmetic for selected unit @var{unit}.  The choices
13414 for @var{unit} are:
13416 @table @samp
13417 @item 387
13418 Use the standard 387 floating-point coprocessor present on the majority of chips and
13419 emulated otherwise.  Code compiled with this option runs almost everywhere.
13420 The temporary results are computed in 80-bit precision instead of the precision
13421 specified by the type, resulting in slightly different results compared to most
13422 of other chips.  See @option{-ffloat-store} for more detailed description.
13424 This is the default choice for i386 compiler.
13426 @item sse
13427 Use scalar floating-point instructions present in the SSE instruction set.
13428 This instruction set is supported by Pentium III and newer chips,
13429 and in the AMD line
13430 by Athlon-4, Athlon XP and Athlon MP chips.  The earlier version of the SSE
13431 instruction set supports only single-precision arithmetic, thus the double and
13432 extended-precision arithmetic are still done using 387.  A later version, present
13433 only in Pentium 4 and AMD x86-64 chips, supports double-precision
13434 arithmetic too.
13436 For the i386 compiler, you must use @option{-march=@var{cpu-type}}, @option{-msse}
13437 or @option{-msse2} switches to enable SSE extensions and make this option
13438 effective.  For the x86-64 compiler, these extensions are enabled by default.
13440 The resulting code should be considerably faster in the majority of cases and avoid
13441 the numerical instability problems of 387 code, but may break some existing
13442 code that expects temporaries to be 80 bits.
13444 This is the default choice for the x86-64 compiler.
13446 @item sse,387
13447 @itemx sse+387
13448 @itemx both
13449 Attempt to utilize both instruction sets at once.  This effectively doubles the
13450 amount of available registers, and on chips with separate execution units for
13451 387 and SSE the execution resources too.  Use this option with care, as it is
13452 still experimental, because the GCC register allocator does not model separate
13453 functional units well, resulting in unstable performance.
13454 @end table
13456 @item -masm=@var{dialect}
13457 @opindex masm=@var{dialect}
13458 Output assembly instructions using selected @var{dialect}.  Supported
13459 choices are @samp{intel} or @samp{att} (the default).  Darwin does
13460 not support @samp{intel}.
13462 @item -mieee-fp
13463 @itemx -mno-ieee-fp
13464 @opindex mieee-fp
13465 @opindex mno-ieee-fp
13466 Control whether or not the compiler uses IEEE floating-point
13467 comparisons.  These correctly handle the case where the result of a
13468 comparison is unordered.
13470 @item -msoft-float
13471 @opindex msoft-float
13472 Generate output containing library calls for floating point.
13474 @strong{Warning:} the requisite libraries are not part of GCC@.
13475 Normally the facilities of the machine's usual C compiler are used, but
13476 this can't be done directly in cross-compilation.  You must make your
13477 own arrangements to provide suitable library functions for
13478 cross-compilation.
13480 On machines where a function returns floating-point results in the 80387
13481 register stack, some floating-point opcodes may be emitted even if
13482 @option{-msoft-float} is used.
13484 @item -mno-fp-ret-in-387
13485 @opindex mno-fp-ret-in-387
13486 Do not use the FPU registers for return values of functions.
13488 The usual calling convention has functions return values of types
13489 @code{float} and @code{double} in an FPU register, even if there
13490 is no FPU@.  The idea is that the operating system should emulate
13491 an FPU@.
13493 The option @option{-mno-fp-ret-in-387} causes such values to be returned
13494 in ordinary CPU registers instead.
13496 @item -mno-fancy-math-387
13497 @opindex mno-fancy-math-387
13498 Some 387 emulators do not support the @code{sin}, @code{cos} and
13499 @code{sqrt} instructions for the 387.  Specify this option to avoid
13500 generating those instructions.  This option is the default on FreeBSD,
13501 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
13502 indicates that the target CPU always has an FPU and so the
13503 instruction does not need emulation.  These
13504 instructions are not generated unless you also use the
13505 @option{-funsafe-math-optimizations} switch.
13507 @item -malign-double
13508 @itemx -mno-align-double
13509 @opindex malign-double
13510 @opindex mno-align-double
13511 Control whether GCC aligns @code{double}, @code{long double}, and
13512 @code{long long} variables on a two-word boundary or a one-word
13513 boundary.  Aligning @code{double} variables on a two-word boundary
13514 produces code that runs somewhat faster on a Pentium at the
13515 expense of more memory.
13517 On x86-64, @option{-malign-double} is enabled by default.
13519 @strong{Warning:} if you use the @option{-malign-double} switch,
13520 structures containing the above types are aligned differently than
13521 the published application binary interface specifications for the 386
13522 and are not binary compatible with structures in code compiled
13523 without that switch.
13525 @item -m96bit-long-double
13526 @itemx -m128bit-long-double
13527 @opindex m96bit-long-double
13528 @opindex m128bit-long-double
13529 These switches control the size of @code{long double} type.  The i386
13530 application binary interface specifies the size to be 96 bits,
13531 so @option{-m96bit-long-double} is the default in 32-bit mode.
13533 Modern architectures (Pentium and newer) prefer @code{long double}
13534 to be aligned to an 8- or 16-byte boundary.  In arrays or structures
13535 conforming to the ABI, this is not possible.  So specifying
13536 @option{-m128bit-long-double} aligns @code{long double}
13537 to a 16-byte boundary by padding the @code{long double} with an additional
13538 32-bit zero.
13540 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
13541 its ABI specifies that @code{long double} is aligned on 16-byte boundary.
13543 Notice that neither of these options enable any extra precision over the x87
13544 standard of 80 bits for a @code{long double}.
13546 @strong{Warning:} if you override the default value for your target ABI, this
13547 changes the size of 
13548 structures and arrays containing @code{long double} variables,
13549 as well as modifying the function calling convention for functions taking
13550 @code{long double}.  Hence they are not binary-compatible
13551 with code compiled without that switch.
13553 @item -mlong-double-64
13554 @itemx -mlong-double-80
13555 @opindex mlong-double-64
13556 @opindex mlong-double-80
13557 These switches control the size of @code{long double} type. A size
13558 of 64 bits makes the @code{long double} type equivalent to the @code{double}
13559 type. This is the default for Bionic C library.
13561 @strong{Warning:} if you override the default value for your target ABI, this
13562 changes the size of
13563 structures and arrays containing @code{long double} variables,
13564 as well as modifying the function calling convention for functions taking
13565 @code{long double}.  Hence they are not binary-compatible
13566 with code compiled without that switch.
13568 @item -mlarge-data-threshold=@var{threshold}
13569 @opindex mlarge-data-threshold
13570 When @option{-mcmodel=medium} is specified, data objects larger than
13571 @var{threshold} are placed in the large data section.  This value must be the
13572 same across all objects linked into the binary, and defaults to 65535.
13574 @item -mrtd
13575 @opindex mrtd
13576 Use a different function-calling convention, in which functions that
13577 take a fixed number of arguments return with the @code{ret @var{num}}
13578 instruction, which pops their arguments while returning.  This saves one
13579 instruction in the caller since there is no need to pop the arguments
13580 there.
13582 You can specify that an individual function is called with this calling
13583 sequence with the function attribute @samp{stdcall}.  You can also
13584 override the @option{-mrtd} option by using the function attribute
13585 @samp{cdecl}.  @xref{Function Attributes}.
13587 @strong{Warning:} this calling convention is incompatible with the one
13588 normally used on Unix, so you cannot use it if you need to call
13589 libraries compiled with the Unix compiler.
13591 Also, you must provide function prototypes for all functions that
13592 take variable numbers of arguments (including @code{printf});
13593 otherwise incorrect code is generated for calls to those
13594 functions.
13596 In addition, seriously incorrect code results if you call a
13597 function with too many arguments.  (Normally, extra arguments are
13598 harmlessly ignored.)
13600 @item -mregparm=@var{num}
13601 @opindex mregparm
13602 Control how many registers are used to pass integer arguments.  By
13603 default, no registers are used to pass arguments, and at most 3
13604 registers can be used.  You can control this behavior for a specific
13605 function by using the function attribute @samp{regparm}.
13606 @xref{Function Attributes}.
13608 @strong{Warning:} if you use this switch, and
13609 @var{num} is nonzero, then you must build all modules with the same
13610 value, including any libraries.  This includes the system libraries and
13611 startup modules.
13613 @item -msseregparm
13614 @opindex msseregparm
13615 Use SSE register passing conventions for float and double arguments
13616 and return values.  You can control this behavior for a specific
13617 function by using the function attribute @samp{sseregparm}.
13618 @xref{Function Attributes}.
13620 @strong{Warning:} if you use this switch then you must build all
13621 modules with the same value, including any libraries.  This includes
13622 the system libraries and startup modules.
13624 @item -mvect8-ret-in-mem
13625 @opindex mvect8-ret-in-mem
13626 Return 8-byte vectors in memory instead of MMX registers.  This is the
13627 default on Solaris@tie{}8 and 9 and VxWorks to match the ABI of the Sun
13628 Studio compilers until version 12.  Later compiler versions (starting
13629 with Studio 12 Update@tie{}1) follow the ABI used by other x86 targets, which
13630 is the default on Solaris@tie{}10 and later.  @emph{Only} use this option if
13631 you need to remain compatible with existing code produced by those
13632 previous compiler versions or older versions of GCC@.
13634 @item -mpc32
13635 @itemx -mpc64
13636 @itemx -mpc80
13637 @opindex mpc32
13638 @opindex mpc64
13639 @opindex mpc80
13641 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
13642 is specified, the significands of results of floating-point operations are
13643 rounded to 24 bits (single precision); @option{-mpc64} rounds the
13644 significands of results of floating-point operations to 53 bits (double
13645 precision) and @option{-mpc80} rounds the significands of results of
13646 floating-point operations to 64 bits (extended double precision), which is
13647 the default.  When this option is used, floating-point operations in higher
13648 precisions are not available to the programmer without setting the FPU
13649 control word explicitly.
13651 Setting the rounding of floating-point operations to less than the default
13652 80 bits can speed some programs by 2% or more.  Note that some mathematical
13653 libraries assume that extended-precision (80-bit) floating-point operations
13654 are enabled by default; routines in such libraries could suffer significant
13655 loss of accuracy, typically through so-called ``catastrophic cancellation'',
13656 when this option is used to set the precision to less than extended precision.
13658 @item -mstackrealign
13659 @opindex mstackrealign
13660 Realign the stack at entry.  On the Intel x86, the @option{-mstackrealign}
13661 option generates an alternate prologue and epilogue that realigns the
13662 run-time stack if necessary.  This supports mixing legacy codes that keep
13663 4-byte stack alignment with modern codes that keep 16-byte stack alignment for
13664 SSE compatibility.  See also the attribute @code{force_align_arg_pointer},
13665 applicable to individual functions.
13667 @item -mpreferred-stack-boundary=@var{num}
13668 @opindex mpreferred-stack-boundary
13669 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
13670 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
13671 the default is 4 (16 bytes or 128 bits).
13673 @strong{Warning:} When generating code for the x86-64 architecture with
13674 SSE extensions disabled, @option{-mpreferred-stack-boundary=3} can be
13675 used to keep the stack boundary aligned to 8 byte boundary.  Since
13676 x86-64 ABI require 16 byte stack alignment, this is ABI incompatible and
13677 intended to be used in controlled environment where stack space is
13678 important limitation.  This option will lead to wrong code when functions
13679 compiled with 16 byte stack alignment (such as functions from a standard
13680 library) are called with misaligned stack.  In this case, SSE
13681 instructions may lead to misaligned memory access traps.  In addition,
13682 variable arguments will be handled incorrectly for 16 byte aligned
13683 objects (including x87 long double and __int128), leading to wrong
13684 results.  You must build all modules with
13685 @option{-mpreferred-stack-boundary=3}, including any libraries.  This
13686 includes the system libraries and startup modules.
13688 @item -mincoming-stack-boundary=@var{num}
13689 @opindex mincoming-stack-boundary
13690 Assume the incoming stack is aligned to a 2 raised to @var{num} byte
13691 boundary.  If @option{-mincoming-stack-boundary} is not specified,
13692 the one specified by @option{-mpreferred-stack-boundary} is used.
13694 On Pentium and Pentium Pro, @code{double} and @code{long double} values
13695 should be aligned to an 8-byte boundary (see @option{-malign-double}) or
13696 suffer significant run time performance penalties.  On Pentium III, the
13697 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
13698 properly if it is not 16-byte aligned.
13700 To ensure proper alignment of this values on the stack, the stack boundary
13701 must be as aligned as that required by any value stored on the stack.
13702 Further, every function must be generated such that it keeps the stack
13703 aligned.  Thus calling a function compiled with a higher preferred
13704 stack boundary from a function compiled with a lower preferred stack
13705 boundary most likely misaligns the stack.  It is recommended that
13706 libraries that use callbacks always use the default setting.
13708 This extra alignment does consume extra stack space, and generally
13709 increases code size.  Code that is sensitive to stack space usage, such
13710 as embedded systems and operating system kernels, may want to reduce the
13711 preferred alignment to @option{-mpreferred-stack-boundary=2}.
13713 @item -mmmx
13714 @itemx -mno-mmx
13715 @itemx -msse
13716 @itemx -mno-sse
13717 @itemx -msse2
13718 @itemx -mno-sse2
13719 @itemx -msse3
13720 @itemx -mno-sse3
13721 @itemx -mssse3
13722 @itemx -mno-ssse3
13723 @itemx -msse4.1
13724 @need 800
13725 @itemx -mno-sse4.1
13726 @itemx -msse4.2
13727 @itemx -mno-sse4.2
13728 @itemx -msse4
13729 @itemx -mno-sse4
13730 @itemx -mavx
13731 @itemx -mno-avx
13732 @itemx -mavx2
13733 @itemx -mno-avx2
13734 @itemx -maes
13735 @itemx -mno-aes
13736 @itemx -mpclmul
13737 @need 800
13738 @itemx -mno-pclmul
13739 @itemx -mfsgsbase
13740 @itemx -mno-fsgsbase
13741 @itemx -mrdrnd
13742 @itemx -mno-rdrnd
13743 @itemx -mf16c
13744 @itemx -mno-f16c
13745 @itemx -mfma
13746 @itemx -mno-fma
13747 @itemx -msse4a
13748 @itemx -mno-sse4a
13749 @itemx -mfma4
13750 @need 800
13751 @itemx -mno-fma4
13752 @itemx -mxop
13753 @itemx -mno-xop
13754 @itemx -mlwp
13755 @itemx -mno-lwp
13756 @itemx -m3dnow
13757 @itemx -mno-3dnow
13758 @itemx -mpopcnt
13759 @itemx -mno-popcnt
13760 @itemx -mabm
13761 @itemx -mno-abm
13762 @itemx -mbmi
13763 @itemx -mbmi2
13764 @itemx -mno-bmi
13765 @itemx -mno-bmi2
13766 @itemx -mlzcnt
13767 @itemx -mno-lzcnt
13768 @itemx -mrtm
13769 @itemx -mtbm
13770 @itemx -mno-tbm
13771 @opindex mmmx
13772 @opindex mno-mmx
13773 @opindex msse
13774 @opindex mno-sse
13775 @opindex m3dnow
13776 @opindex mno-3dnow
13777 These switches enable or disable the use of instructions in the MMX, SSE,
13778 SSE2, SSE3, SSSE3, SSE4.1, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, F16C,
13779 FMA, SSE4A, FMA4, XOP, LWP, ABM, BMI, BMI2, LZCNT, RTM or 3DNow!@:
13780 extended instruction sets.
13781 These extensions are also available as built-in functions: see
13782 @ref{X86 Built-in Functions}, for details of the functions enabled and
13783 disabled by these switches.
13785 To generate SSE/SSE2 instructions automatically from floating-point
13786 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
13788 GCC depresses SSEx instructions when @option{-mavx} is used. Instead, it
13789 generates new AVX instructions or AVX equivalence for all SSEx instructions
13790 when needed.
13792 These options enable GCC to use these extended instructions in
13793 generated code, even without @option{-mfpmath=sse}.  Applications that
13794 perform run-time CPU detection must compile separate files for each
13795 supported architecture, using the appropriate flags.  In particular,
13796 the file containing the CPU detection code should be compiled without
13797 these options.
13799 @item -mcld
13800 @opindex mcld
13801 This option instructs GCC to emit a @code{cld} instruction in the prologue
13802 of functions that use string instructions.  String instructions depend on
13803 the DF flag to select between autoincrement or autodecrement mode.  While the
13804 ABI specifies the DF flag to be cleared on function entry, some operating
13805 systems violate this specification by not clearing the DF flag in their
13806 exception dispatchers.  The exception handler can be invoked with the DF flag
13807 set, which leads to wrong direction mode when string instructions are used.
13808 This option can be enabled by default on 32-bit x86 targets by configuring
13809 GCC with the @option{--enable-cld} configure option.  Generation of @code{cld}
13810 instructions can be suppressed with the @option{-mno-cld} compiler option
13811 in this case.
13813 @item -mvzeroupper
13814 @opindex mvzeroupper
13815 This option instructs GCC to emit a @code{vzeroupper} instruction
13816 before a transfer of control flow out of the function to minimize
13817 the AVX to SSE transition penalty as well as remove unnecessary @code{zeroupper}
13818 intrinsics.
13820 @item -mcx16
13821 @opindex mcx16
13822 This option enables GCC to generate @code{CMPXCHG16B} instructions.
13823 @code{CMPXCHG16B} allows for atomic operations on 128-bit double quadword
13824 (or oword) data types.  
13825 This is useful for high-resolution counters that can be updated
13826 by multiple processors (or cores).  This instruction is generated as part of
13827 atomic built-in functions: see @ref{__sync Builtins} or
13828 @ref{__atomic Builtins} for details.
13830 @item -msahf
13831 @opindex msahf
13832 This option enables generation of @code{SAHF} instructions in 64-bit code.
13833 Early Intel Pentium 4 CPUs with Intel 64 support,
13834 prior to the introduction of Pentium 4 G1 step in December 2005,
13835 lacked the @code{LAHF} and @code{SAHF} instructions
13836 which were supported by AMD64.
13837 These are load and store instructions, respectively, for certain status flags.
13838 In 64-bit mode, the @code{SAHF} instruction is used to optimize @code{fmod},
13839 @code{drem}, and @code{remainder} built-in functions;
13840 see @ref{Other Builtins} for details.
13842 @item -mmovbe
13843 @opindex mmovbe
13844 This option enables use of the @code{movbe} instruction to implement
13845 @code{__builtin_bswap32} and @code{__builtin_bswap64}.
13847 @item -mcrc32
13848 @opindex mcrc32
13849 This option enables built-in functions @code{__builtin_ia32_crc32qi},
13850 @code{__builtin_ia32_crc32hi}, @code{__builtin_ia32_crc32si} and
13851 @code{__builtin_ia32_crc32di} to generate the @code{crc32} machine instruction.
13853 @item -mrecip
13854 @opindex mrecip
13855 This option enables use of @code{RCPSS} and @code{RSQRTSS} instructions
13856 (and their vectorized variants @code{RCPPS} and @code{RSQRTPS})
13857 with an additional Newton-Raphson step
13858 to increase precision instead of @code{DIVSS} and @code{SQRTSS}
13859 (and their vectorized
13860 variants) for single-precision floating-point arguments.  These instructions
13861 are generated only when @option{-funsafe-math-optimizations} is enabled
13862 together with @option{-finite-math-only} and @option{-fno-trapping-math}.
13863 Note that while the throughput of the sequence is higher than the throughput
13864 of the non-reciprocal instruction, the precision of the sequence can be
13865 decreased by up to 2 ulp (i.e. the inverse of 1.0 equals 0.99999994).
13867 Note that GCC implements @code{1.0f/sqrtf(@var{x})} in terms of @code{RSQRTSS}
13868 (or @code{RSQRTPS}) already with @option{-ffast-math} (or the above option
13869 combination), and doesn't need @option{-mrecip}.
13871 Also note that GCC emits the above sequence with additional Newton-Raphson step
13872 for vectorized single-float division and vectorized @code{sqrtf(@var{x})}
13873 already with @option{-ffast-math} (or the above option combination), and
13874 doesn't need @option{-mrecip}.
13876 @item -mrecip=@var{opt}
13877 @opindex mrecip=opt
13878 This option controls which reciprocal estimate instructions
13879 may be used.  @var{opt} is a comma-separated list of options, which may
13880 be preceded by a @samp{!} to invert the option:
13882 @table @samp
13883 @item all
13884 Enable all estimate instructions.
13886 @item default
13887 Enable the default instructions, equivalent to @option{-mrecip}.
13889 @item none
13890 Disable all estimate instructions, equivalent to @option{-mno-recip}.
13892 @item div
13893 Enable the approximation for scalar division.
13895 @item vec-div
13896 Enable the approximation for vectorized division.
13898 @item sqrt
13899 Enable the approximation for scalar square root.
13901 @item vec-sqrt
13902 Enable the approximation for vectorized square root.
13903 @end table
13905 So, for example, @option{-mrecip=all,!sqrt} enables
13906 all of the reciprocal approximations, except for square root.
13908 @item -mveclibabi=@var{type}
13909 @opindex mveclibabi
13910 Specifies the ABI type to use for vectorizing intrinsics using an
13911 external library.  Supported values for @var{type} are @samp{svml} 
13912 for the Intel short
13913 vector math library and @samp{acml} for the AMD math core library.
13914 To use this option, both @option{-ftree-vectorize} and
13915 @option{-funsafe-math-optimizations} have to be enabled, and an SVML or ACML 
13916 ABI-compatible library must be specified at link time.
13918 GCC currently emits calls to @code{vmldExp2},
13919 @code{vmldLn2}, @code{vmldLog102}, @code{vmldLog102}, @code{vmldPow2},
13920 @code{vmldTanh2}, @code{vmldTan2}, @code{vmldAtan2}, @code{vmldAtanh2},
13921 @code{vmldCbrt2}, @code{vmldSinh2}, @code{vmldSin2}, @code{vmldAsinh2},
13922 @code{vmldAsin2}, @code{vmldCosh2}, @code{vmldCos2}, @code{vmldAcosh2},
13923 @code{vmldAcos2}, @code{vmlsExp4}, @code{vmlsLn4}, @code{vmlsLog104},
13924 @code{vmlsLog104}, @code{vmlsPow4}, @code{vmlsTanh4}, @code{vmlsTan4},
13925 @code{vmlsAtan4}, @code{vmlsAtanh4}, @code{vmlsCbrt4}, @code{vmlsSinh4},
13926 @code{vmlsSin4}, @code{vmlsAsinh4}, @code{vmlsAsin4}, @code{vmlsCosh4},
13927 @code{vmlsCos4}, @code{vmlsAcosh4} and @code{vmlsAcos4} for corresponding
13928 function type when @option{-mveclibabi=svml} is used, and @code{__vrd2_sin},
13929 @code{__vrd2_cos}, @code{__vrd2_exp}, @code{__vrd2_log}, @code{__vrd2_log2},
13930 @code{__vrd2_log10}, @code{__vrs4_sinf}, @code{__vrs4_cosf},
13931 @code{__vrs4_expf}, @code{__vrs4_logf}, @code{__vrs4_log2f},
13932 @code{__vrs4_log10f} and @code{__vrs4_powf} for the corresponding function type
13933 when @option{-mveclibabi=acml} is used.  
13935 @item -mabi=@var{name}
13936 @opindex mabi
13937 Generate code for the specified calling convention.  Permissible values
13938 are @samp{sysv} for the ABI used on GNU/Linux and other systems, and
13939 @samp{ms} for the Microsoft ABI.  The default is to use the Microsoft
13940 ABI when targeting Microsoft Windows and the SysV ABI on all other systems.
13941 You can control this behavior for a specific function by
13942 using the function attribute @samp{ms_abi}/@samp{sysv_abi}.
13943 @xref{Function Attributes}.
13945 @item -mtls-dialect=@var{type}
13946 @opindex mtls-dialect
13947 Generate code to access thread-local storage using the @samp{gnu} or
13948 @samp{gnu2} conventions.  @samp{gnu} is the conservative default;
13949 @samp{gnu2} is more efficient, but it may add compile- and run-time
13950 requirements that cannot be satisfied on all systems.
13952 @item -mpush-args
13953 @itemx -mno-push-args
13954 @opindex mpush-args
13955 @opindex mno-push-args
13956 Use PUSH operations to store outgoing parameters.  This method is shorter
13957 and usually equally fast as method using SUB/MOV operations and is enabled
13958 by default.  In some cases disabling it may improve performance because of
13959 improved scheduling and reduced dependencies.
13961 @item -maccumulate-outgoing-args
13962 @opindex maccumulate-outgoing-args
13963 If enabled, the maximum amount of space required for outgoing arguments is
13964 computed in the function prologue.  This is faster on most modern CPUs
13965 because of reduced dependencies, improved scheduling and reduced stack usage
13966 when the preferred stack boundary is not equal to 2.  The drawback is a notable
13967 increase in code size.  This switch implies @option{-mno-push-args}.
13969 @item -mthreads
13970 @opindex mthreads
13971 Support thread-safe exception handling on MinGW.  Programs that rely
13972 on thread-safe exception handling must compile and link all code with the
13973 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
13974 @code{-D_MT}; when linking, it links in a special thread helper library
13975 @option{-lmingwthrd} which cleans up per-thread exception-handling data.
13977 @item -mno-align-stringops
13978 @opindex mno-align-stringops
13979 Do not align the destination of inlined string operations.  This switch reduces
13980 code size and improves performance in case the destination is already aligned,
13981 but GCC doesn't know about it.
13983 @item -minline-all-stringops
13984 @opindex minline-all-stringops
13985 By default GCC inlines string operations only when the destination is 
13986 known to be aligned to least a 4-byte boundary.  
13987 This enables more inlining and increases code
13988 size, but may improve performance of code that depends on fast
13989 @code{memcpy}, @code{strlen},
13990 and @code{memset} for short lengths.
13992 @item -minline-stringops-dynamically
13993 @opindex minline-stringops-dynamically
13994 For string operations of unknown size, use run-time checks with
13995 inline code for small blocks and a library call for large blocks.
13997 @item -mstringop-strategy=@var{alg}
13998 @opindex mstringop-strategy=@var{alg}
13999 Override the internal decision heuristic for the particular algorithm to use
14000 for inlining string operations.  The allowed values for @var{alg} are:
14002 @table @samp
14003 @item rep_byte
14004 @itemx rep_4byte
14005 @itemx rep_8byte
14006 Expand using i386 @code{rep} prefix of the specified size.
14008 @item byte_loop
14009 @itemx loop
14010 @itemx unrolled_loop
14011 Expand into an inline loop.
14013 @item libcall
14014 Always use a library call.
14015 @end table
14017 @item -momit-leaf-frame-pointer
14018 @opindex momit-leaf-frame-pointer
14019 Don't keep the frame pointer in a register for leaf functions.  This
14020 avoids the instructions to save, set up, and restore frame pointers and
14021 makes an extra register available in leaf functions.  The option
14022 @option{-fomit-leaf-frame-pointer} removes the frame pointer for leaf functions,
14023 which might make debugging harder.
14025 @item -mtls-direct-seg-refs
14026 @itemx -mno-tls-direct-seg-refs
14027 @opindex mtls-direct-seg-refs
14028 Controls whether TLS variables may be accessed with offsets from the
14029 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
14030 or whether the thread base pointer must be added.  Whether or not this
14031 is valid depends on the operating system, and whether it maps the
14032 segment to cover the entire TLS area.
14034 For systems that use the GNU C Library, the default is on.
14036 @item -msse2avx
14037 @itemx -mno-sse2avx
14038 @opindex msse2avx
14039 Specify that the assembler should encode SSE instructions with VEX
14040 prefix.  The option @option{-mavx} turns this on by default.
14042 @item -mfentry
14043 @itemx -mno-fentry
14044 @opindex mfentry
14045 If profiling is active (@option{-pg}), put the profiling
14046 counter call before the prologue.
14047 Note: On x86 architectures the attribute @code{ms_hook_prologue}
14048 isn't possible at the moment for @option{-mfentry} and @option{-pg}.
14050 @item -m8bit-idiv
14051 @itemx -mno-8bit-idiv
14052 @opindex 8bit-idiv
14053 On some processors, like Intel Atom, 8-bit unsigned integer divide is
14054 much faster than 32-bit/64-bit integer divide.  This option generates a
14055 run-time check.  If both dividend and divisor are within range of 0
14056 to 255, 8-bit unsigned integer divide is used instead of
14057 32-bit/64-bit integer divide.
14059 @item -mavx256-split-unaligned-load
14060 @itemx -mavx256-split-unaligned-store
14061 @opindex avx256-split-unaligned-load
14062 @opindex avx256-split-unaligned-store
14063 Split 32-byte AVX unaligned load and store.
14065 @end table
14067 These @samp{-m} switches are supported in addition to the above
14068 on x86-64 processors in 64-bit environments.
14070 @table @gcctabopt
14071 @item -m32
14072 @itemx -m64
14073 @itemx -mx32
14074 @opindex m32
14075 @opindex m64
14076 @opindex mx32
14077 Generate code for a 32-bit or 64-bit environment.
14078 The @option{-m32} option sets @code{int}, @code{long}, and pointer types
14079 to 32 bits, and
14080 generates code that runs on any i386 system.
14082 The @option{-m64} option sets @code{int} to 32 bits and @code{long} and pointer
14083 types to 64 bits, and generates code for the x86-64 architecture.
14084 For Darwin only the @option{-m64} option also turns off the @option{-fno-pic}
14085 and @option{-mdynamic-no-pic} options.
14087 The @option{-mx32} option sets @code{int}, @code{long}, and pointer types
14088 to 32 bits, and
14089 generates code for the x86-64 architecture.
14091 @item -mno-red-zone
14092 @opindex mno-red-zone
14093 Do not use a so-called ``red zone'' for x86-64 code.  The red zone is mandated
14094 by the x86-64 ABI; it is a 128-byte area beyond the location of the
14095 stack pointer that is not modified by signal or interrupt handlers
14096 and therefore can be used for temporary data without adjusting the stack
14097 pointer.  The flag @option{-mno-red-zone} disables this red zone.
14099 @item -mcmodel=small
14100 @opindex mcmodel=small
14101 Generate code for the small code model: the program and its symbols must
14102 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
14103 Programs can be statically or dynamically linked.  This is the default
14104 code model.
14106 @item -mcmodel=kernel
14107 @opindex mcmodel=kernel
14108 Generate code for the kernel code model.  The kernel runs in the
14109 negative 2 GB of the address space.
14110 This model has to be used for Linux kernel code.
14112 @item -mcmodel=medium
14113 @opindex mcmodel=medium
14114 Generate code for the medium model: the program is linked in the lower 2
14115 GB of the address space.  Small symbols are also placed there.  Symbols
14116 with sizes larger than @option{-mlarge-data-threshold} are put into
14117 large data or BSS sections and can be located above 2GB.  Programs can
14118 be statically or dynamically linked.
14120 @item -mcmodel=large
14121 @opindex mcmodel=large
14122 Generate code for the large model.  This model makes no assumptions
14123 about addresses and sizes of sections.
14125 @item -maddress-mode=long
14126 @opindex maddress-mode=long
14127 Generate code for long address mode.  This is only supported for 64-bit
14128 and x32 environments.  It is the default address mode for 64-bit
14129 environments.
14131 @item -maddress-mode=short
14132 @opindex maddress-mode=short
14133 Generate code for short address mode.  This is only supported for 32-bit
14134 and x32 environments.  It is the default address mode for 32-bit and
14135 x32 environments.
14136 @end table
14138 @node i386 and x86-64 Windows Options
14139 @subsection i386 and x86-64 Windows Options
14140 @cindex i386 and x86-64 Windows Options
14142 These additional options are available for Microsoft Windows targets:
14144 @table @gcctabopt
14145 @item -mconsole
14146 @opindex mconsole
14147 This option
14148 specifies that a console application is to be generated, by
14149 instructing the linker to set the PE header subsystem type
14150 required for console applications.
14151 This option is available for Cygwin and MinGW targets and is
14152 enabled by default on those targets.
14154 @item -mdll
14155 @opindex mdll
14156 This option is available for Cygwin and MinGW targets.  It
14157 specifies that a DLL---a dynamic link library---is to be
14158 generated, enabling the selection of the required runtime
14159 startup object and entry point.
14161 @item -mnop-fun-dllimport
14162 @opindex mnop-fun-dllimport
14163 This option is available for Cygwin and MinGW targets.  It
14164 specifies that the @code{dllimport} attribute should be ignored.
14166 @item -mthread
14167 @opindex mthread
14168 This option is available for MinGW targets. It specifies
14169 that MinGW-specific thread support is to be used.
14171 @item -municode
14172 @opindex municode
14173 This option is available for MinGW-w64 targets.  It causes
14174 the @code{UNICODE} preprocessor macro to be predefined, and
14175 chooses Unicode-capable runtime startup code.
14177 @item -mwin32
14178 @opindex mwin32
14179 This option is available for Cygwin and MinGW targets.  It
14180 specifies that the typical Microsoft Windows predefined macros are to
14181 be set in the pre-processor, but does not influence the choice
14182 of runtime library/startup code.
14184 @item -mwindows
14185 @opindex mwindows
14186 This option is available for Cygwin and MinGW targets.  It
14187 specifies that a GUI application is to be generated by
14188 instructing the linker to set the PE header subsystem type
14189 appropriately.
14191 @item -fno-set-stack-executable
14192 @opindex fno-set-stack-executable
14193 This option is available for MinGW targets. It specifies that
14194 the executable flag for the stack used by nested functions isn't
14195 set. This is necessary for binaries running in kernel mode of
14196 Microsoft Windows, as there the User32 API, which is used to set executable
14197 privileges, isn't available.
14199 @item -fwritable-relocated-rdata
14200 @opindex fno-writable-relocated-rdata
14201 This option is available for MinGW and Cygwin targets.  It specifies
14202 that relocated-data in read-only section is put into .data
14203 section.  This is a necessary for older runtimes not supporting
14204 modification of .rdata sections for pseudo-relocation.
14206 @item -mpe-aligned-commons
14207 @opindex mpe-aligned-commons
14208 This option is available for Cygwin and MinGW targets.  It
14209 specifies that the GNU extension to the PE file format that
14210 permits the correct alignment of COMMON variables should be
14211 used when generating code.  It is enabled by default if
14212 GCC detects that the target assembler found during configuration
14213 supports the feature.
14214 @end table
14216 See also under @ref{i386 and x86-64 Options} for standard options.
14218 @node IA-64 Options
14219 @subsection IA-64 Options
14220 @cindex IA-64 Options
14222 These are the @samp{-m} options defined for the Intel IA-64 architecture.
14224 @table @gcctabopt
14225 @item -mbig-endian
14226 @opindex mbig-endian
14227 Generate code for a big-endian target.  This is the default for HP-UX@.
14229 @item -mlittle-endian
14230 @opindex mlittle-endian
14231 Generate code for a little-endian target.  This is the default for AIX5
14232 and GNU/Linux.
14234 @item -mgnu-as
14235 @itemx -mno-gnu-as
14236 @opindex mgnu-as
14237 @opindex mno-gnu-as
14238 Generate (or don't) code for the GNU assembler.  This is the default.
14239 @c Also, this is the default if the configure option @option{--with-gnu-as}
14240 @c is used.
14242 @item -mgnu-ld
14243 @itemx -mno-gnu-ld
14244 @opindex mgnu-ld
14245 @opindex mno-gnu-ld
14246 Generate (or don't) code for the GNU linker.  This is the default.
14247 @c Also, this is the default if the configure option @option{--with-gnu-ld}
14248 @c is used.
14250 @item -mno-pic
14251 @opindex mno-pic
14252 Generate code that does not use a global pointer register.  The result
14253 is not position independent code, and violates the IA-64 ABI@.
14255 @item -mvolatile-asm-stop
14256 @itemx -mno-volatile-asm-stop
14257 @opindex mvolatile-asm-stop
14258 @opindex mno-volatile-asm-stop
14259 Generate (or don't) a stop bit immediately before and after volatile asm
14260 statements.
14262 @item -mregister-names
14263 @itemx -mno-register-names
14264 @opindex mregister-names
14265 @opindex mno-register-names
14266 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
14267 the stacked registers.  This may make assembler output more readable.
14269 @item -mno-sdata
14270 @itemx -msdata
14271 @opindex mno-sdata
14272 @opindex msdata
14273 Disable (or enable) optimizations that use the small data section.  This may
14274 be useful for working around optimizer bugs.
14276 @item -mconstant-gp
14277 @opindex mconstant-gp
14278 Generate code that uses a single constant global pointer value.  This is
14279 useful when compiling kernel code.
14281 @item -mauto-pic
14282 @opindex mauto-pic
14283 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
14284 This is useful when compiling firmware code.
14286 @item -minline-float-divide-min-latency
14287 @opindex minline-float-divide-min-latency
14288 Generate code for inline divides of floating-point values
14289 using the minimum latency algorithm.
14291 @item -minline-float-divide-max-throughput
14292 @opindex minline-float-divide-max-throughput
14293 Generate code for inline divides of floating-point values
14294 using the maximum throughput algorithm.
14296 @item -mno-inline-float-divide
14297 @opindex mno-inline-float-divide
14298 Do not generate inline code for divides of floating-point values.
14300 @item -minline-int-divide-min-latency
14301 @opindex minline-int-divide-min-latency
14302 Generate code for inline divides of integer values
14303 using the minimum latency algorithm.
14305 @item -minline-int-divide-max-throughput
14306 @opindex minline-int-divide-max-throughput
14307 Generate code for inline divides of integer values
14308 using the maximum throughput algorithm.
14310 @item -mno-inline-int-divide
14311 @opindex mno-inline-int-divide
14312 Do not generate inline code for divides of integer values.
14314 @item -minline-sqrt-min-latency
14315 @opindex minline-sqrt-min-latency
14316 Generate code for inline square roots
14317 using the minimum latency algorithm.
14319 @item -minline-sqrt-max-throughput
14320 @opindex minline-sqrt-max-throughput
14321 Generate code for inline square roots
14322 using the maximum throughput algorithm.
14324 @item -mno-inline-sqrt
14325 @opindex mno-inline-sqrt
14326 Do not generate inline code for @code{sqrt}.
14328 @item -mfused-madd
14329 @itemx -mno-fused-madd
14330 @opindex mfused-madd
14331 @opindex mno-fused-madd
14332 Do (don't) generate code that uses the fused multiply/add or multiply/subtract
14333 instructions.  The default is to use these instructions.
14335 @item -mno-dwarf2-asm
14336 @itemx -mdwarf2-asm
14337 @opindex mno-dwarf2-asm
14338 @opindex mdwarf2-asm
14339 Don't (or do) generate assembler code for the DWARF 2 line number debugging
14340 info.  This may be useful when not using the GNU assembler.
14342 @item -mearly-stop-bits
14343 @itemx -mno-early-stop-bits
14344 @opindex mearly-stop-bits
14345 @opindex mno-early-stop-bits
14346 Allow stop bits to be placed earlier than immediately preceding the
14347 instruction that triggered the stop bit.  This can improve instruction
14348 scheduling, but does not always do so.
14350 @item -mfixed-range=@var{register-range}
14351 @opindex mfixed-range
14352 Generate code treating the given register range as fixed registers.
14353 A fixed register is one that the register allocator cannot use.  This is
14354 useful when compiling kernel code.  A register range is specified as
14355 two registers separated by a dash.  Multiple register ranges can be
14356 specified separated by a comma.
14358 @item -mtls-size=@var{tls-size}
14359 @opindex mtls-size
14360 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
14363 @item -mtune=@var{cpu-type}
14364 @opindex mtune
14365 Tune the instruction scheduling for a particular CPU, Valid values are
14366 @samp{itanium}, @samp{itanium1}, @samp{merced}, @samp{itanium2},
14367 and @samp{mckinley}.
14369 @item -milp32
14370 @itemx -mlp64
14371 @opindex milp32
14372 @opindex mlp64
14373 Generate code for a 32-bit or 64-bit environment.
14374 The 32-bit environment sets int, long and pointer to 32 bits.
14375 The 64-bit environment sets int to 32 bits and long and pointer
14376 to 64 bits.  These are HP-UX specific flags.
14378 @item -mno-sched-br-data-spec
14379 @itemx -msched-br-data-spec
14380 @opindex mno-sched-br-data-spec
14381 @opindex msched-br-data-spec
14382 (Dis/En)able data speculative scheduling before reload.
14383 This results in generation of @code{ld.a} instructions and
14384 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
14385 The default is 'disable'.
14387 @item -msched-ar-data-spec
14388 @itemx -mno-sched-ar-data-spec
14389 @opindex msched-ar-data-spec
14390 @opindex mno-sched-ar-data-spec
14391 (En/Dis)able data speculative scheduling after reload.
14392 This results in generation of @code{ld.a} instructions and
14393 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
14394 The default is 'enable'.
14396 @item -mno-sched-control-spec
14397 @itemx -msched-control-spec
14398 @opindex mno-sched-control-spec
14399 @opindex msched-control-spec
14400 (Dis/En)able control speculative scheduling.  This feature is
14401 available only during region scheduling (i.e.@: before reload).
14402 This results in generation of the @code{ld.s} instructions and
14403 the corresponding check instructions @code{chk.s}.
14404 The default is 'disable'.
14406 @item -msched-br-in-data-spec
14407 @itemx -mno-sched-br-in-data-spec
14408 @opindex msched-br-in-data-spec
14409 @opindex mno-sched-br-in-data-spec
14410 (En/Dis)able speculative scheduling of the instructions that
14411 are dependent on the data speculative loads before reload.
14412 This is effective only with @option{-msched-br-data-spec} enabled.
14413 The default is 'enable'.
14415 @item -msched-ar-in-data-spec
14416 @itemx -mno-sched-ar-in-data-spec
14417 @opindex msched-ar-in-data-spec
14418 @opindex mno-sched-ar-in-data-spec
14419 (En/Dis)able speculative scheduling of the instructions that
14420 are dependent on the data speculative loads after reload.
14421 This is effective only with @option{-msched-ar-data-spec} enabled.
14422 The default is 'enable'.
14424 @item -msched-in-control-spec
14425 @itemx -mno-sched-in-control-spec
14426 @opindex msched-in-control-spec
14427 @opindex mno-sched-in-control-spec
14428 (En/Dis)able speculative scheduling of the instructions that
14429 are dependent on the control speculative loads.
14430 This is effective only with @option{-msched-control-spec} enabled.
14431 The default is 'enable'.
14433 @item -mno-sched-prefer-non-data-spec-insns
14434 @itemx -msched-prefer-non-data-spec-insns
14435 @opindex mno-sched-prefer-non-data-spec-insns
14436 @opindex msched-prefer-non-data-spec-insns
14437 If enabled, data-speculative instructions are chosen for schedule
14438 only if there are no other choices at the moment.  This makes
14439 the use of the data speculation much more conservative.
14440 The default is 'disable'.
14442 @item -mno-sched-prefer-non-control-spec-insns
14443 @itemx -msched-prefer-non-control-spec-insns
14444 @opindex mno-sched-prefer-non-control-spec-insns
14445 @opindex msched-prefer-non-control-spec-insns
14446 If enabled, control-speculative instructions are chosen for schedule
14447 only if there are no other choices at the moment.  This makes
14448 the use of the control speculation much more conservative.
14449 The default is 'disable'.
14451 @item -mno-sched-count-spec-in-critical-path
14452 @itemx -msched-count-spec-in-critical-path
14453 @opindex mno-sched-count-spec-in-critical-path
14454 @opindex msched-count-spec-in-critical-path
14455 If enabled, speculative dependencies are considered during
14456 computation of the instructions priorities.  This makes the use of the
14457 speculation a bit more conservative.
14458 The default is 'disable'.
14460 @item -msched-spec-ldc
14461 @opindex msched-spec-ldc
14462 Use a simple data speculation check.  This option is on by default.
14464 @item -msched-control-spec-ldc
14465 @opindex msched-spec-ldc
14466 Use a simple check for control speculation.  This option is on by default.
14468 @item -msched-stop-bits-after-every-cycle
14469 @opindex msched-stop-bits-after-every-cycle
14470 Place a stop bit after every cycle when scheduling.  This option is on
14471 by default.
14473 @item -msched-fp-mem-deps-zero-cost
14474 @opindex msched-fp-mem-deps-zero-cost
14475 Assume that floating-point stores and loads are not likely to cause a conflict
14476 when placed into the same instruction group.  This option is disabled by
14477 default.
14479 @item -msel-sched-dont-check-control-spec
14480 @opindex msel-sched-dont-check-control-spec
14481 Generate checks for control speculation in selective scheduling.
14482 This flag is disabled by default.
14484 @item -msched-max-memory-insns=@var{max-insns}
14485 @opindex msched-max-memory-insns
14486 Limit on the number of memory insns per instruction group, giving lower
14487 priority to subsequent memory insns attempting to schedule in the same
14488 instruction group. Frequently useful to prevent cache bank conflicts.
14489 The default value is 1.
14491 @item -msched-max-memory-insns-hard-limit
14492 @opindex msched-max-memory-insns-hard-limit
14493 Makes the limit specified by @option{msched-max-memory-insns} a hard limit,
14494 disallowing more than that number in an instruction group.
14495 Otherwise, the limit is ``soft'', meaning that non-memory operations
14496 are preferred when the limit is reached, but memory operations may still
14497 be scheduled.
14499 @end table
14501 @node LM32 Options
14502 @subsection LM32 Options
14503 @cindex LM32 options
14505 These @option{-m} options are defined for the LatticeMico32 architecture:
14507 @table @gcctabopt
14508 @item -mbarrel-shift-enabled
14509 @opindex mbarrel-shift-enabled
14510 Enable barrel-shift instructions.
14512 @item -mdivide-enabled
14513 @opindex mdivide-enabled
14514 Enable divide and modulus instructions.
14516 @item -mmultiply-enabled
14517 @opindex multiply-enabled
14518 Enable multiply instructions.
14520 @item -msign-extend-enabled
14521 @opindex msign-extend-enabled
14522 Enable sign extend instructions.
14524 @item -muser-enabled
14525 @opindex muser-enabled
14526 Enable user-defined instructions.
14528 @end table
14530 @node M32C Options
14531 @subsection M32C Options
14532 @cindex M32C options
14534 @table @gcctabopt
14535 @item -mcpu=@var{name}
14536 @opindex mcpu=
14537 Select the CPU for which code is generated.  @var{name} may be one of
14538 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
14539 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
14540 the M32C/80 series.
14542 @item -msim
14543 @opindex msim
14544 Specifies that the program will be run on the simulator.  This causes
14545 an alternate runtime library to be linked in which supports, for
14546 example, file I/O@.  You must not use this option when generating
14547 programs that will run on real hardware; you must provide your own
14548 runtime library for whatever I/O functions are needed.
14550 @item -memregs=@var{number}
14551 @opindex memregs=
14552 Specifies the number of memory-based pseudo-registers GCC uses
14553 during code generation.  These pseudo-registers are used like real
14554 registers, so there is a tradeoff between GCC's ability to fit the
14555 code into available registers, and the performance penalty of using
14556 memory instead of registers.  Note that all modules in a program must
14557 be compiled with the same value for this option.  Because of that, you
14558 must not use this option with GCC's default runtime libraries.
14560 @end table
14562 @node M32R/D Options
14563 @subsection M32R/D Options
14564 @cindex M32R/D options
14566 These @option{-m} options are defined for Renesas M32R/D architectures:
14568 @table @gcctabopt
14569 @item -m32r2
14570 @opindex m32r2
14571 Generate code for the M32R/2@.
14573 @item -m32rx
14574 @opindex m32rx
14575 Generate code for the M32R/X@.
14577 @item -m32r
14578 @opindex m32r
14579 Generate code for the M32R@.  This is the default.
14581 @item -mmodel=small
14582 @opindex mmodel=small
14583 Assume all objects live in the lower 16MB of memory (so that their addresses
14584 can be loaded with the @code{ld24} instruction), and assume all subroutines
14585 are reachable with the @code{bl} instruction.
14586 This is the default.
14588 The addressability of a particular object can be set with the
14589 @code{model} attribute.
14591 @item -mmodel=medium
14592 @opindex mmodel=medium
14593 Assume objects may be anywhere in the 32-bit address space (the compiler
14594 generates @code{seth/add3} instructions to load their addresses), and
14595 assume all subroutines are reachable with the @code{bl} instruction.
14597 @item -mmodel=large
14598 @opindex mmodel=large
14599 Assume objects may be anywhere in the 32-bit address space (the compiler
14600 generates @code{seth/add3} instructions to load their addresses), and
14601 assume subroutines may not be reachable with the @code{bl} instruction
14602 (the compiler generates the much slower @code{seth/add3/jl}
14603 instruction sequence).
14605 @item -msdata=none
14606 @opindex msdata=none
14607 Disable use of the small data area.  Variables are put into
14608 one of @samp{.data}, @samp{.bss}, or @samp{.rodata} (unless the
14609 @code{section} attribute has been specified).
14610 This is the default.
14612 The small data area consists of sections @samp{.sdata} and @samp{.sbss}.
14613 Objects may be explicitly put in the small data area with the
14614 @code{section} attribute using one of these sections.
14616 @item -msdata=sdata
14617 @opindex msdata=sdata
14618 Put small global and static data in the small data area, but do not
14619 generate special code to reference them.
14621 @item -msdata=use
14622 @opindex msdata=use
14623 Put small global and static data in the small data area, and generate
14624 special instructions to reference them.
14626 @item -G @var{num}
14627 @opindex G
14628 @cindex smaller data references
14629 Put global and static objects less than or equal to @var{num} bytes
14630 into the small data or BSS sections instead of the normal data or BSS
14631 sections.  The default value of @var{num} is 8.
14632 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
14633 for this option to have any effect.
14635 All modules should be compiled with the same @option{-G @var{num}} value.
14636 Compiling with different values of @var{num} may or may not work; if it
14637 doesn't the linker gives an error message---incorrect code is not
14638 generated.
14640 @item -mdebug
14641 @opindex mdebug
14642 Makes the M32R-specific code in the compiler display some statistics
14643 that might help in debugging programs.
14645 @item -malign-loops
14646 @opindex malign-loops
14647 Align all loops to a 32-byte boundary.
14649 @item -mno-align-loops
14650 @opindex mno-align-loops
14651 Do not enforce a 32-byte alignment for loops.  This is the default.
14653 @item -missue-rate=@var{number}
14654 @opindex missue-rate=@var{number}
14655 Issue @var{number} instructions per cycle.  @var{number} can only be 1
14656 or 2.
14658 @item -mbranch-cost=@var{number}
14659 @opindex mbranch-cost=@var{number}
14660 @var{number} can only be 1 or 2.  If it is 1 then branches are
14661 preferred over conditional code, if it is 2, then the opposite applies.
14663 @item -mflush-trap=@var{number}
14664 @opindex mflush-trap=@var{number}
14665 Specifies the trap number to use to flush the cache.  The default is
14666 12.  Valid numbers are between 0 and 15 inclusive.
14668 @item -mno-flush-trap
14669 @opindex mno-flush-trap
14670 Specifies that the cache cannot be flushed by using a trap.
14672 @item -mflush-func=@var{name}
14673 @opindex mflush-func=@var{name}
14674 Specifies the name of the operating system function to call to flush
14675 the cache.  The default is @emph{_flush_cache}, but a function call
14676 is only used if a trap is not available.
14678 @item -mno-flush-func
14679 @opindex mno-flush-func
14680 Indicates that there is no OS function for flushing the cache.
14682 @end table
14684 @node M680x0 Options
14685 @subsection M680x0 Options
14686 @cindex M680x0 options
14688 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
14689 The default settings depend on which architecture was selected when
14690 the compiler was configured; the defaults for the most common choices
14691 are given below.
14693 @table @gcctabopt
14694 @item -march=@var{arch}
14695 @opindex march
14696 Generate code for a specific M680x0 or ColdFire instruction set
14697 architecture.  Permissible values of @var{arch} for M680x0
14698 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
14699 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
14700 architectures are selected according to Freescale's ISA classification
14701 and the permissible values are: @samp{isaa}, @samp{isaaplus},
14702 @samp{isab} and @samp{isac}.
14704 GCC defines a macro @samp{__mcf@var{arch}__} whenever it is generating
14705 code for a ColdFire target.  The @var{arch} in this macro is one of the
14706 @option{-march} arguments given above.
14708 When used together, @option{-march} and @option{-mtune} select code
14709 that runs on a family of similar processors but that is optimized
14710 for a particular microarchitecture.
14712 @item -mcpu=@var{cpu}
14713 @opindex mcpu
14714 Generate code for a specific M680x0 or ColdFire processor.
14715 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
14716 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
14717 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
14718 below, which also classifies the CPUs into families:
14720 @multitable @columnfractions 0.20 0.80
14721 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
14722 @item @samp{51} @tab @samp{51} @samp{51ac} @samp{51ag} @samp{51cn} @samp{51em} @samp{51je} @samp{51jf} @samp{51jg} @samp{51jm} @samp{51mm} @samp{51qe} @samp{51qm}
14723 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
14724 @item @samp{5206e} @tab @samp{5206e}
14725 @item @samp{5208} @tab @samp{5207} @samp{5208}
14726 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
14727 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
14728 @item @samp{5216} @tab @samp{5214} @samp{5216}
14729 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
14730 @item @samp{5225} @tab @samp{5224} @samp{5225}
14731 @item @samp{52259} @tab @samp{52252} @samp{52254} @samp{52255} @samp{52256} @samp{52258} @samp{52259}
14732 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
14733 @item @samp{5249} @tab @samp{5249}
14734 @item @samp{5250} @tab @samp{5250}
14735 @item @samp{5271} @tab @samp{5270} @samp{5271}
14736 @item @samp{5272} @tab @samp{5272}
14737 @item @samp{5275} @tab @samp{5274} @samp{5275}
14738 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
14739 @item @samp{53017} @tab @samp{53011} @samp{53012} @samp{53013} @samp{53014} @samp{53015} @samp{53016} @samp{53017}
14740 @item @samp{5307} @tab @samp{5307}
14741 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
14742 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
14743 @item @samp{5407} @tab @samp{5407}
14744 @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}
14745 @end multitable
14747 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
14748 @var{arch} is compatible with @var{cpu}.  Other combinations of
14749 @option{-mcpu} and @option{-march} are rejected.
14751 GCC defines the macro @samp{__mcf_cpu_@var{cpu}} when ColdFire target
14752 @var{cpu} is selected.  It also defines @samp{__mcf_family_@var{family}},
14753 where the value of @var{family} is given by the table above.
14755 @item -mtune=@var{tune}
14756 @opindex mtune
14757 Tune the code for a particular microarchitecture within the
14758 constraints set by @option{-march} and @option{-mcpu}.
14759 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
14760 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
14761 and @samp{cpu32}.  The ColdFire microarchitectures
14762 are: @samp{cfv1}, @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
14764 You can also use @option{-mtune=68020-40} for code that needs
14765 to run relatively well on 68020, 68030 and 68040 targets.
14766 @option{-mtune=68020-60} is similar but includes 68060 targets
14767 as well.  These two options select the same tuning decisions as
14768 @option{-m68020-40} and @option{-m68020-60} respectively.
14770 GCC defines the macros @samp{__mc@var{arch}} and @samp{__mc@var{arch}__}
14771 when tuning for 680x0 architecture @var{arch}.  It also defines
14772 @samp{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
14773 option is used.  If GCC is tuning for a range of architectures,
14774 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
14775 it defines the macros for every architecture in the range.
14777 GCC also defines the macro @samp{__m@var{uarch}__} when tuning for
14778 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
14779 of the arguments given above.
14781 @item -m68000
14782 @itemx -mc68000
14783 @opindex m68000
14784 @opindex mc68000
14785 Generate output for a 68000.  This is the default
14786 when the compiler is configured for 68000-based systems.
14787 It is equivalent to @option{-march=68000}.
14789 Use this option for microcontrollers with a 68000 or EC000 core,
14790 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
14792 @item -m68010
14793 @opindex m68010
14794 Generate output for a 68010.  This is the default
14795 when the compiler is configured for 68010-based systems.
14796 It is equivalent to @option{-march=68010}.
14798 @item -m68020
14799 @itemx -mc68020
14800 @opindex m68020
14801 @opindex mc68020
14802 Generate output for a 68020.  This is the default
14803 when the compiler is configured for 68020-based systems.
14804 It is equivalent to @option{-march=68020}.
14806 @item -m68030
14807 @opindex m68030
14808 Generate output for a 68030.  This is the default when the compiler is
14809 configured for 68030-based systems.  It is equivalent to
14810 @option{-march=68030}.
14812 @item -m68040
14813 @opindex m68040
14814 Generate output for a 68040.  This is the default when the compiler is
14815 configured for 68040-based systems.  It is equivalent to
14816 @option{-march=68040}.
14818 This option inhibits the use of 68881/68882 instructions that have to be
14819 emulated by software on the 68040.  Use this option if your 68040 does not
14820 have code to emulate those instructions.
14822 @item -m68060
14823 @opindex m68060
14824 Generate output for a 68060.  This is the default when the compiler is
14825 configured for 68060-based systems.  It is equivalent to
14826 @option{-march=68060}.
14828 This option inhibits the use of 68020 and 68881/68882 instructions that
14829 have to be emulated by software on the 68060.  Use this option if your 68060
14830 does not have code to emulate those instructions.
14832 @item -mcpu32
14833 @opindex mcpu32
14834 Generate output for a CPU32.  This is the default
14835 when the compiler is configured for CPU32-based systems.
14836 It is equivalent to @option{-march=cpu32}.
14838 Use this option for microcontrollers with a
14839 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
14840 68336, 68340, 68341, 68349 and 68360.
14842 @item -m5200
14843 @opindex m5200
14844 Generate output for a 520X ColdFire CPU@.  This is the default
14845 when the compiler is configured for 520X-based systems.
14846 It is equivalent to @option{-mcpu=5206}, and is now deprecated
14847 in favor of that option.
14849 Use this option for microcontroller with a 5200 core, including
14850 the MCF5202, MCF5203, MCF5204 and MCF5206.
14852 @item -m5206e
14853 @opindex m5206e
14854 Generate output for a 5206e ColdFire CPU@.  The option is now
14855 deprecated in favor of the equivalent @option{-mcpu=5206e}.
14857 @item -m528x
14858 @opindex m528x
14859 Generate output for a member of the ColdFire 528X family.
14860 The option is now deprecated in favor of the equivalent
14861 @option{-mcpu=528x}.
14863 @item -m5307
14864 @opindex m5307
14865 Generate output for a ColdFire 5307 CPU@.  The option is now deprecated
14866 in favor of the equivalent @option{-mcpu=5307}.
14868 @item -m5407
14869 @opindex m5407
14870 Generate output for a ColdFire 5407 CPU@.  The option is now deprecated
14871 in favor of the equivalent @option{-mcpu=5407}.
14873 @item -mcfv4e
14874 @opindex mcfv4e
14875 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
14876 This includes use of hardware floating-point instructions.
14877 The option is equivalent to @option{-mcpu=547x}, and is now
14878 deprecated in favor of that option.
14880 @item -m68020-40
14881 @opindex m68020-40
14882 Generate output for a 68040, without using any of the new instructions.
14883 This results in code that can run relatively efficiently on either a
14884 68020/68881 or a 68030 or a 68040.  The generated code does use the
14885 68881 instructions that are emulated on the 68040.
14887 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
14889 @item -m68020-60
14890 @opindex m68020-60
14891 Generate output for a 68060, without using any of the new instructions.
14892 This results in code that can run relatively efficiently on either a
14893 68020/68881 or a 68030 or a 68040.  The generated code does use the
14894 68881 instructions that are emulated on the 68060.
14896 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
14898 @item -mhard-float
14899 @itemx -m68881
14900 @opindex mhard-float
14901 @opindex m68881
14902 Generate floating-point instructions.  This is the default for 68020
14903 and above, and for ColdFire devices that have an FPU@.  It defines the
14904 macro @samp{__HAVE_68881__} on M680x0 targets and @samp{__mcffpu__}
14905 on ColdFire targets.
14907 @item -msoft-float
14908 @opindex msoft-float
14909 Do not generate floating-point instructions; use library calls instead.
14910 This is the default for 68000, 68010, and 68832 targets.  It is also
14911 the default for ColdFire devices that have no FPU.
14913 @item -mdiv
14914 @itemx -mno-div
14915 @opindex mdiv
14916 @opindex mno-div
14917 Generate (do not generate) ColdFire hardware divide and remainder
14918 instructions.  If @option{-march} is used without @option{-mcpu},
14919 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
14920 architectures.  Otherwise, the default is taken from the target CPU
14921 (either the default CPU, or the one specified by @option{-mcpu}).  For
14922 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
14923 @option{-mcpu=5206e}.
14925 GCC defines the macro @samp{__mcfhwdiv__} when this option is enabled.
14927 @item -mshort
14928 @opindex mshort
14929 Consider type @code{int} to be 16 bits wide, like @code{short int}.
14930 Additionally, parameters passed on the stack are also aligned to a
14931 16-bit boundary even on targets whose API mandates promotion to 32-bit.
14933 @item -mno-short
14934 @opindex mno-short
14935 Do not consider type @code{int} to be 16 bits wide.  This is the default.
14937 @item -mnobitfield
14938 @itemx -mno-bitfield
14939 @opindex mnobitfield
14940 @opindex mno-bitfield
14941 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
14942 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
14944 @item -mbitfield
14945 @opindex mbitfield
14946 Do use the bit-field instructions.  The @option{-m68020} option implies
14947 @option{-mbitfield}.  This is the default if you use a configuration
14948 designed for a 68020.
14950 @item -mrtd
14951 @opindex mrtd
14952 Use a different function-calling convention, in which functions
14953 that take a fixed number of arguments return with the @code{rtd}
14954 instruction, which pops their arguments while returning.  This
14955 saves one instruction in the caller since there is no need to pop
14956 the arguments there.
14958 This calling convention is incompatible with the one normally
14959 used on Unix, so you cannot use it if you need to call libraries
14960 compiled with the Unix compiler.
14962 Also, you must provide function prototypes for all functions that
14963 take variable numbers of arguments (including @code{printf});
14964 otherwise incorrect code is generated for calls to those
14965 functions.
14967 In addition, seriously incorrect code results if you call a
14968 function with too many arguments.  (Normally, extra arguments are
14969 harmlessly ignored.)
14971 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
14972 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
14974 @item -mno-rtd
14975 @opindex mno-rtd
14976 Do not use the calling conventions selected by @option{-mrtd}.
14977 This is the default.
14979 @item -malign-int
14980 @itemx -mno-align-int
14981 @opindex malign-int
14982 @opindex mno-align-int
14983 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
14984 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
14985 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
14986 Aligning variables on 32-bit boundaries produces code that runs somewhat
14987 faster on processors with 32-bit busses at the expense of more memory.
14989 @strong{Warning:} if you use the @option{-malign-int} switch, GCC
14990 aligns structures containing the above types differently than
14991 most published application binary interface specifications for the m68k.
14993 @item -mpcrel
14994 @opindex mpcrel
14995 Use the pc-relative addressing mode of the 68000 directly, instead of
14996 using a global offset table.  At present, this option implies @option{-fpic},
14997 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
14998 not presently supported with @option{-mpcrel}, though this could be supported for
14999 68020 and higher processors.
15001 @item -mno-strict-align
15002 @itemx -mstrict-align
15003 @opindex mno-strict-align
15004 @opindex mstrict-align
15005 Do not (do) assume that unaligned memory references are handled by
15006 the system.
15008 @item -msep-data
15009 Generate code that allows the data segment to be located in a different
15010 area of memory from the text segment.  This allows for execute-in-place in
15011 an environment without virtual memory management.  This option implies
15012 @option{-fPIC}.
15014 @item -mno-sep-data
15015 Generate code that assumes that the data segment follows the text segment.
15016 This is the default.
15018 @item -mid-shared-library
15019 Generate code that supports shared libraries via the library ID method.
15020 This allows for execute-in-place and shared libraries in an environment
15021 without virtual memory management.  This option implies @option{-fPIC}.
15023 @item -mno-id-shared-library
15024 Generate code that doesn't assume ID-based shared libraries are being used.
15025 This is the default.
15027 @item -mshared-library-id=n
15028 Specifies the identification number of the ID-based shared library being
15029 compiled.  Specifying a value of 0 generates more compact code; specifying
15030 other values forces the allocation of that number to the current
15031 library, but is no more space- or time-efficient than omitting this option.
15033 @item -mxgot
15034 @itemx -mno-xgot
15035 @opindex mxgot
15036 @opindex mno-xgot
15037 When generating position-independent code for ColdFire, generate code
15038 that works if the GOT has more than 8192 entries.  This code is
15039 larger and slower than code generated without this option.  On M680x0
15040 processors, this option is not needed; @option{-fPIC} suffices.
15042 GCC normally uses a single instruction to load values from the GOT@.
15043 While this is relatively efficient, it only works if the GOT
15044 is smaller than about 64k.  Anything larger causes the linker
15045 to report an error such as:
15047 @cindex relocation truncated to fit (ColdFire)
15048 @smallexample
15049 relocation truncated to fit: R_68K_GOT16O foobar
15050 @end smallexample
15052 If this happens, you should recompile your code with @option{-mxgot}.
15053 It should then work with very large GOTs.  However, code generated with
15054 @option{-mxgot} is less efficient, since it takes 4 instructions to fetch
15055 the value of a global symbol.
15057 Note that some linkers, including newer versions of the GNU linker,
15058 can create multiple GOTs and sort GOT entries.  If you have such a linker,
15059 you should only need to use @option{-mxgot} when compiling a single
15060 object file that accesses more than 8192 GOT entries.  Very few do.
15062 These options have no effect unless GCC is generating
15063 position-independent code.
15065 @end table
15067 @node MCore Options
15068 @subsection MCore Options
15069 @cindex MCore options
15071 These are the @samp{-m} options defined for the Motorola M*Core
15072 processors.
15074 @table @gcctabopt
15076 @item -mhardlit
15077 @itemx -mno-hardlit
15078 @opindex mhardlit
15079 @opindex mno-hardlit
15080 Inline constants into the code stream if it can be done in two
15081 instructions or less.
15083 @item -mdiv
15084 @itemx -mno-div
15085 @opindex mdiv
15086 @opindex mno-div
15087 Use the divide instruction.  (Enabled by default).
15089 @item -mrelax-immediate
15090 @itemx -mno-relax-immediate
15091 @opindex mrelax-immediate
15092 @opindex mno-relax-immediate
15093 Allow arbitrary-sized immediates in bit operations.
15095 @item -mwide-bitfields
15096 @itemx -mno-wide-bitfields
15097 @opindex mwide-bitfields
15098 @opindex mno-wide-bitfields
15099 Always treat bit-fields as @code{int}-sized.
15101 @item -m4byte-functions
15102 @itemx -mno-4byte-functions
15103 @opindex m4byte-functions
15104 @opindex mno-4byte-functions
15105 Force all functions to be aligned to a 4-byte boundary.
15107 @item -mcallgraph-data
15108 @itemx -mno-callgraph-data
15109 @opindex mcallgraph-data
15110 @opindex mno-callgraph-data
15111 Emit callgraph information.
15113 @item -mslow-bytes
15114 @itemx -mno-slow-bytes
15115 @opindex mslow-bytes
15116 @opindex mno-slow-bytes
15117 Prefer word access when reading byte quantities.
15119 @item -mlittle-endian
15120 @itemx -mbig-endian
15121 @opindex mlittle-endian
15122 @opindex mbig-endian
15123 Generate code for a little-endian target.
15125 @item -m210
15126 @itemx -m340
15127 @opindex m210
15128 @opindex m340
15129 Generate code for the 210 processor.
15131 @item -mno-lsim
15132 @opindex mno-lsim
15133 Assume that runtime support has been provided and so omit the
15134 simulator library (@file{libsim.a)} from the linker command line.
15136 @item -mstack-increment=@var{size}
15137 @opindex mstack-increment
15138 Set the maximum amount for a single stack increment operation.  Large
15139 values can increase the speed of programs that contain functions
15140 that need a large amount of stack space, but they can also trigger a
15141 segmentation fault if the stack is extended too much.  The default
15142 value is 0x1000.
15144 @end table
15146 @node MeP Options
15147 @subsection MeP Options
15148 @cindex MeP options
15150 @table @gcctabopt
15152 @item -mabsdiff
15153 @opindex mabsdiff
15154 Enables the @code{abs} instruction, which is the absolute difference
15155 between two registers.
15157 @item -mall-opts
15158 @opindex mall-opts
15159 Enables all the optional instructions---average, multiply, divide, bit
15160 operations, leading zero, absolute difference, min/max, clip, and
15161 saturation.
15164 @item -maverage
15165 @opindex maverage
15166 Enables the @code{ave} instruction, which computes the average of two
15167 registers.
15169 @item -mbased=@var{n}
15170 @opindex mbased=
15171 Variables of size @var{n} bytes or smaller are placed in the
15172 @code{.based} section by default.  Based variables use the @code{$tp}
15173 register as a base register, and there is a 128-byte limit to the
15174 @code{.based} section.
15176 @item -mbitops
15177 @opindex mbitops
15178 Enables the bit operation instructions---bit test (@code{btstm}), set
15179 (@code{bsetm}), clear (@code{bclrm}), invert (@code{bnotm}), and
15180 test-and-set (@code{tas}).
15182 @item -mc=@var{name}
15183 @opindex mc=
15184 Selects which section constant data is placed in.  @var{name} may
15185 be @code{tiny}, @code{near}, or @code{far}.
15187 @item -mclip
15188 @opindex mclip
15189 Enables the @code{clip} instruction.  Note that @code{-mclip} is not
15190 useful unless you also provide @code{-mminmax}.
15192 @item -mconfig=@var{name}
15193 @opindex mconfig=
15194 Selects one of the built-in core configurations.  Each MeP chip has
15195 one or more modules in it; each module has a core CPU and a variety of
15196 coprocessors, optional instructions, and peripherals.  The
15197 @code{MeP-Integrator} tool, not part of GCC, provides these
15198 configurations through this option; using this option is the same as
15199 using all the corresponding command-line options.  The default
15200 configuration is @code{default}.
15202 @item -mcop
15203 @opindex mcop
15204 Enables the coprocessor instructions.  By default, this is a 32-bit
15205 coprocessor.  Note that the coprocessor is normally enabled via the
15206 @code{-mconfig=} option.
15208 @item -mcop32
15209 @opindex mcop32
15210 Enables the 32-bit coprocessor's instructions.
15212 @item -mcop64
15213 @opindex mcop64
15214 Enables the 64-bit coprocessor's instructions.
15216 @item -mivc2
15217 @opindex mivc2
15218 Enables IVC2 scheduling.  IVC2 is a 64-bit VLIW coprocessor.
15220 @item -mdc
15221 @opindex mdc
15222 Causes constant variables to be placed in the @code{.near} section.
15224 @item -mdiv
15225 @opindex mdiv
15226 Enables the @code{div} and @code{divu} instructions.
15228 @item -meb
15229 @opindex meb
15230 Generate big-endian code.
15232 @item -mel
15233 @opindex mel
15234 Generate little-endian code.
15236 @item -mio-volatile
15237 @opindex mio-volatile
15238 Tells the compiler that any variable marked with the @code{io}
15239 attribute is to be considered volatile.
15241 @item -ml
15242 @opindex ml
15243 Causes variables to be assigned to the @code{.far} section by default.
15245 @item -mleadz
15246 @opindex mleadz
15247 Enables the @code{leadz} (leading zero) instruction.
15249 @item -mm
15250 @opindex mm
15251 Causes variables to be assigned to the @code{.near} section by default.
15253 @item -mminmax
15254 @opindex mminmax
15255 Enables the @code{min} and @code{max} instructions.
15257 @item -mmult
15258 @opindex mmult
15259 Enables the multiplication and multiply-accumulate instructions.
15261 @item -mno-opts
15262 @opindex mno-opts
15263 Disables all the optional instructions enabled by @code{-mall-opts}.
15265 @item -mrepeat
15266 @opindex mrepeat
15267 Enables the @code{repeat} and @code{erepeat} instructions, used for
15268 low-overhead looping.
15270 @item -ms
15271 @opindex ms
15272 Causes all variables to default to the @code{.tiny} section.  Note
15273 that there is a 65536-byte limit to this section.  Accesses to these
15274 variables use the @code{%gp} base register.
15276 @item -msatur
15277 @opindex msatur
15278 Enables the saturation instructions.  Note that the compiler does not
15279 currently generate these itself, but this option is included for
15280 compatibility with other tools, like @code{as}.
15282 @item -msdram
15283 @opindex msdram
15284 Link the SDRAM-based runtime instead of the default ROM-based runtime.
15286 @item -msim
15287 @opindex msim
15288 Link the simulator runtime libraries.
15290 @item -msimnovec
15291 @opindex msimnovec
15292 Link the simulator runtime libraries, excluding built-in support
15293 for reset and exception vectors and tables.
15295 @item -mtf
15296 @opindex mtf
15297 Causes all functions to default to the @code{.far} section.  Without
15298 this option, functions default to the @code{.near} section.
15300 @item -mtiny=@var{n}
15301 @opindex mtiny=
15302 Variables that are @var{n} bytes or smaller are allocated to the
15303 @code{.tiny} section.  These variables use the @code{$gp} base
15304 register.  The default for this option is 4, but note that there's a
15305 65536-byte limit to the @code{.tiny} section.
15307 @end table
15309 @node MicroBlaze Options
15310 @subsection MicroBlaze Options
15311 @cindex MicroBlaze Options
15313 @table @gcctabopt
15315 @item -msoft-float
15316 @opindex msoft-float
15317 Use software emulation for floating point (default).
15319 @item -mhard-float
15320 @opindex mhard-float
15321 Use hardware floating-point instructions.
15323 @item -mmemcpy
15324 @opindex mmemcpy
15325 Do not optimize block moves, use @code{memcpy}.
15327 @item -mno-clearbss
15328 @opindex mno-clearbss
15329 This option is deprecated.  Use @option{-fno-zero-initialized-in-bss} instead.
15331 @item -mcpu=@var{cpu-type}
15332 @opindex mcpu=
15333 Use features of, and schedule code for, the given CPU.
15334 Supported values are in the format @samp{v@var{X}.@var{YY}.@var{Z}},
15335 where @var{X} is a major version, @var{YY} is the minor version, and
15336 @var{Z} is compatibility code.  Example values are @samp{v3.00.a},
15337 @samp{v4.00.b}, @samp{v5.00.a}, @samp{v5.00.b}, @samp{v5.00.b}, @samp{v6.00.a}.
15339 @item -mxl-soft-mul
15340 @opindex mxl-soft-mul
15341 Use software multiply emulation (default).
15343 @item -mxl-soft-div
15344 @opindex mxl-soft-div
15345 Use software emulation for divides (default).
15347 @item -mxl-barrel-shift
15348 @opindex mxl-barrel-shift
15349 Use the hardware barrel shifter.
15351 @item -mxl-pattern-compare
15352 @opindex mxl-pattern-compare
15353 Use pattern compare instructions.
15355 @item -msmall-divides
15356 @opindex msmall-divides
15357 Use table lookup optimization for small signed integer divisions.
15359 @item -mxl-stack-check
15360 @opindex mxl-stack-check
15361 This option is deprecated.  Use @option{-fstack-check} instead.
15363 @item -mxl-gp-opt
15364 @opindex mxl-gp-opt
15365 Use GP-relative @code{.sdata}/@code{.sbss} sections.
15367 @item -mxl-multiply-high
15368 @opindex mxl-multiply-high
15369 Use multiply high instructions for high part of 32x32 multiply.
15371 @item -mxl-float-convert
15372 @opindex mxl-float-convert
15373 Use hardware floating-point conversion instructions.
15375 @item -mxl-float-sqrt
15376 @opindex mxl-float-sqrt
15377 Use hardware floating-point square root instruction.
15379 @item -mxl-mode-@var{app-model}
15380 Select application model @var{app-model}.  Valid models are
15381 @table @samp
15382 @item executable
15383 normal executable (default), uses startup code @file{crt0.o}.
15385 @item xmdstub
15386 for use with Xilinx Microprocessor Debugger (XMD) based
15387 software intrusive debug agent called xmdstub. This uses startup file
15388 @file{crt1.o} and sets the start address of the program to 0x800.
15390 @item bootstrap
15391 for applications that are loaded using a bootloader.
15392 This model uses startup file @file{crt2.o} which does not contain a processor
15393 reset vector handler. This is suitable for transferring control on a
15394 processor reset to the bootloader rather than the application.
15396 @item novectors
15397 for applications that do not require any of the
15398 MicroBlaze vectors. This option may be useful for applications running
15399 within a monitoring application. This model uses @file{crt3.o} as a startup file.
15400 @end table
15402 Option @option{-xl-mode-@var{app-model}} is a deprecated alias for
15403 @option{-mxl-mode-@var{app-model}}.
15405 @end table
15407 @node MIPS Options
15408 @subsection MIPS Options
15409 @cindex MIPS options
15411 @table @gcctabopt
15413 @item -EB
15414 @opindex EB
15415 Generate big-endian code.
15417 @item -EL
15418 @opindex EL
15419 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
15420 configurations.
15422 @item -march=@var{arch}
15423 @opindex march
15424 Generate code that runs on @var{arch}, which can be the name of a
15425 generic MIPS ISA, or the name of a particular processor.
15426 The ISA names are:
15427 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
15428 @samp{mips32}, @samp{mips32r2}, @samp{mips64} and @samp{mips64r2}.
15429 The processor names are:
15430 @samp{4kc}, @samp{4km}, @samp{4kp}, @samp{4ksc},
15431 @samp{4kec}, @samp{4kem}, @samp{4kep}, @samp{4ksd},
15432 @samp{5kc}, @samp{5kf},
15433 @samp{20kc},
15434 @samp{24kc}, @samp{24kf2_1}, @samp{24kf1_1},
15435 @samp{24kec}, @samp{24kef2_1}, @samp{24kef1_1},
15436 @samp{34kc}, @samp{34kf2_1}, @samp{34kf1_1}, @samp{34kn},
15437 @samp{74kc}, @samp{74kf2_1}, @samp{74kf1_1}, @samp{74kf3_2},
15438 @samp{1004kc}, @samp{1004kf2_1}, @samp{1004kf1_1},
15439 @samp{loongson2e}, @samp{loongson2f}, @samp{loongson3a},
15440 @samp{m4k},
15441 @samp{octeon}, @samp{octeon+}, @samp{octeon2},
15442 @samp{orion},
15443 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
15444 @samp{r4600}, @samp{r4650}, @samp{r6000}, @samp{r8000},
15445 @samp{rm7000}, @samp{rm9000},
15446 @samp{r10000}, @samp{r12000}, @samp{r14000}, @samp{r16000},
15447 @samp{sb1},
15448 @samp{sr71000},
15449 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
15450 @samp{vr5000}, @samp{vr5400}, @samp{vr5500},
15451 @samp{xlr} and @samp{xlp}.
15452 The special value @samp{from-abi} selects the
15453 most compatible architecture for the selected ABI (that is,
15454 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
15456 The native Linux/GNU toolchain also supports the value @samp{native},
15457 which selects the best architecture option for the host processor.
15458 @option{-march=native} has no effect if GCC does not recognize
15459 the processor.
15461 In processor names, a final @samp{000} can be abbreviated as @samp{k}
15462 (for example, @option{-march=r2k}).  Prefixes are optional, and
15463 @samp{vr} may be written @samp{r}.
15465 Names of the form @samp{@var{n}f2_1} refer to processors with
15466 FPUs clocked at half the rate of the core, names of the form
15467 @samp{@var{n}f1_1} refer to processors with FPUs clocked at the same
15468 rate as the core, and names of the form @samp{@var{n}f3_2} refer to
15469 processors with FPUs clocked a ratio of 3:2 with respect to the core.
15470 For compatibility reasons, @samp{@var{n}f} is accepted as a synonym
15471 for @samp{@var{n}f2_1} while @samp{@var{n}x} and @samp{@var{b}fx} are
15472 accepted as synonyms for @samp{@var{n}f1_1}.
15474 GCC defines two macros based on the value of this option.  The first
15475 is @samp{_MIPS_ARCH}, which gives the name of target architecture, as
15476 a string.  The second has the form @samp{_MIPS_ARCH_@var{foo}},
15477 where @var{foo} is the capitalized value of @samp{_MIPS_ARCH}@.
15478 For example, @option{-march=r2000} sets @samp{_MIPS_ARCH}
15479 to @samp{"r2000"} and defines the macro @samp{_MIPS_ARCH_R2000}.
15481 Note that the @samp{_MIPS_ARCH} macro uses the processor names given
15482 above.  In other words, it has the full prefix and does not
15483 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
15484 the macro names the resolved architecture (either @samp{"mips1"} or
15485 @samp{"mips3"}).  It names the default architecture when no
15486 @option{-march} option is given.
15488 @item -mtune=@var{arch}
15489 @opindex mtune
15490 Optimize for @var{arch}.  Among other things, this option controls
15491 the way instructions are scheduled, and the perceived cost of arithmetic
15492 operations.  The list of @var{arch} values is the same as for
15493 @option{-march}.
15495 When this option is not used, GCC optimizes for the processor
15496 specified by @option{-march}.  By using @option{-march} and
15497 @option{-mtune} together, it is possible to generate code that
15498 runs on a family of processors, but optimize the code for one
15499 particular member of that family.
15501 @option{-mtune} defines the macros @samp{_MIPS_TUNE} and
15502 @samp{_MIPS_TUNE_@var{foo}}, which work in the same way as the
15503 @option{-march} ones described above.
15505 @item -mips1
15506 @opindex mips1
15507 Equivalent to @option{-march=mips1}.
15509 @item -mips2
15510 @opindex mips2
15511 Equivalent to @option{-march=mips2}.
15513 @item -mips3
15514 @opindex mips3
15515 Equivalent to @option{-march=mips3}.
15517 @item -mips4
15518 @opindex mips4
15519 Equivalent to @option{-march=mips4}.
15521 @item -mips32
15522 @opindex mips32
15523 Equivalent to @option{-march=mips32}.
15525 @item -mips32r2
15526 @opindex mips32r2
15527 Equivalent to @option{-march=mips32r2}.
15529 @item -mips64
15530 @opindex mips64
15531 Equivalent to @option{-march=mips64}.
15533 @item -mips64r2
15534 @opindex mips64r2
15535 Equivalent to @option{-march=mips64r2}.
15537 @item -mips16
15538 @itemx -mno-mips16
15539 @opindex mips16
15540 @opindex mno-mips16
15541 Generate (do not generate) MIPS16 code.  If GCC is targeting a
15542 MIPS32 or MIPS64 architecture, it makes use of the MIPS16e ASE@.
15544 MIPS16 code generation can also be controlled on a per-function basis
15545 by means of @code{mips16} and @code{nomips16} attributes.
15546 @xref{Function Attributes}, for more information.
15548 @item -mflip-mips16
15549 @opindex mflip-mips16
15550 Generate MIPS16 code on alternating functions.  This option is provided
15551 for regression testing of mixed MIPS16/non-MIPS16 code generation, and is
15552 not intended for ordinary use in compiling user code.
15554 @item -minterlink-mips16
15555 @itemx -mno-interlink-mips16
15556 @opindex minterlink-mips16
15557 @opindex mno-interlink-mips16
15558 Require (do not require) that non-MIPS16 code be link-compatible with
15559 MIPS16 code.
15561 For example, non-MIPS16 code cannot jump directly to MIPS16 code;
15562 it must either use a call or an indirect jump.  @option{-minterlink-mips16}
15563 therefore disables direct jumps unless GCC knows that the target of the
15564 jump is not MIPS16.
15566 @item -mabi=32
15567 @itemx -mabi=o64
15568 @itemx -mabi=n32
15569 @itemx -mabi=64
15570 @itemx -mabi=eabi
15571 @opindex mabi=32
15572 @opindex mabi=o64
15573 @opindex mabi=n32
15574 @opindex mabi=64
15575 @opindex mabi=eabi
15576 Generate code for the given ABI@.
15578 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
15579 generates 64-bit code when you select a 64-bit architecture, but you
15580 can use @option{-mgp32} to get 32-bit code instead.
15582 For information about the O64 ABI, see
15583 @uref{http://gcc.gnu.org/@/projects/@/mipso64-abi.html}.
15585 GCC supports a variant of the o32 ABI in which floating-point registers
15586 are 64 rather than 32 bits wide.  You can select this combination with
15587 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @code{mthc1}
15588 and @code{mfhc1} instructions and is therefore only supported for
15589 MIPS32R2 processors.
15591 The register assignments for arguments and return values remain the
15592 same, but each scalar value is passed in a single 64-bit register
15593 rather than a pair of 32-bit registers.  For example, scalar
15594 floating-point values are returned in @samp{$f0} only, not a
15595 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
15596 remains the same, but all 64 bits are saved.
15598 @item -mabicalls
15599 @itemx -mno-abicalls
15600 @opindex mabicalls
15601 @opindex mno-abicalls
15602 Generate (do not generate) code that is suitable for SVR4-style
15603 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
15604 systems.
15606 @item -mshared
15607 @itemx -mno-shared
15608 Generate (do not generate) code that is fully position-independent,
15609 and that can therefore be linked into shared libraries.  This option
15610 only affects @option{-mabicalls}.
15612 All @option{-mabicalls} code has traditionally been position-independent,
15613 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
15614 as an extension, the GNU toolchain allows executables to use absolute
15615 accesses for locally-binding symbols.  It can also use shorter GP
15616 initialization sequences and generate direct calls to locally-defined
15617 functions.  This mode is selected by @option{-mno-shared}.
15619 @option{-mno-shared} depends on binutils 2.16 or higher and generates
15620 objects that can only be linked by the GNU linker.  However, the option
15621 does not affect the ABI of the final executable; it only affects the ABI
15622 of relocatable objects.  Using @option{-mno-shared} generally makes
15623 executables both smaller and quicker.
15625 @option{-mshared} is the default.
15627 @item -mplt
15628 @itemx -mno-plt
15629 @opindex mplt
15630 @opindex mno-plt
15631 Assume (do not assume) that the static and dynamic linkers
15632 support PLTs and copy relocations.  This option only affects
15633 @option{-mno-shared -mabicalls}.  For the n64 ABI, this option
15634 has no effect without @option{-msym32}.
15636 You can make @option{-mplt} the default by configuring
15637 GCC with @option{--with-mips-plt}.  The default is
15638 @option{-mno-plt} otherwise.
15640 @item -mxgot
15641 @itemx -mno-xgot
15642 @opindex mxgot
15643 @opindex mno-xgot
15644 Lift (do not lift) the usual restrictions on the size of the global
15645 offset table.
15647 GCC normally uses a single instruction to load values from the GOT@.
15648 While this is relatively efficient, it only works if the GOT
15649 is smaller than about 64k.  Anything larger causes the linker
15650 to report an error such as:
15652 @cindex relocation truncated to fit (MIPS)
15653 @smallexample
15654 relocation truncated to fit: R_MIPS_GOT16 foobar
15655 @end smallexample
15657 If this happens, you should recompile your code with @option{-mxgot}.
15658 This works with very large GOTs, although the code is also
15659 less efficient, since it takes three instructions to fetch the
15660 value of a global symbol.
15662 Note that some linkers can create multiple GOTs.  If you have such a
15663 linker, you should only need to use @option{-mxgot} when a single object
15664 file accesses more than 64k's worth of GOT entries.  Very few do.
15666 These options have no effect unless GCC is generating position
15667 independent code.
15669 @item -mgp32
15670 @opindex mgp32
15671 Assume that general-purpose registers are 32 bits wide.
15673 @item -mgp64
15674 @opindex mgp64
15675 Assume that general-purpose registers are 64 bits wide.
15677 @item -mfp32
15678 @opindex mfp32
15679 Assume that floating-point registers are 32 bits wide.
15681 @item -mfp64
15682 @opindex mfp64
15683 Assume that floating-point registers are 64 bits wide.
15685 @item -mhard-float
15686 @opindex mhard-float
15687 Use floating-point coprocessor instructions.
15689 @item -msoft-float
15690 @opindex msoft-float
15691 Do not use floating-point coprocessor instructions.  Implement
15692 floating-point calculations using library calls instead.
15694 @item -mno-float
15695 @opindex mno-float
15696 Equivalent to @option{-msoft-float}, but additionally asserts that the
15697 program being compiled does not perform any floating-point operations.
15698 This option is presently supported only by some bare-metal MIPS
15699 configurations, where it may select a special set of libraries
15700 that lack all floating-point support (including, for example, the
15701 floating-point @code{printf} formats).  
15702 If code compiled with @code{-mno-float} accidentally contains
15703 floating-point operations, it is likely to suffer a link-time
15704 or run-time failure.
15706 @item -msingle-float
15707 @opindex msingle-float
15708 Assume that the floating-point coprocessor only supports single-precision
15709 operations.
15711 @item -mdouble-float
15712 @opindex mdouble-float
15713 Assume that the floating-point coprocessor supports double-precision
15714 operations.  This is the default.
15716 @item -mllsc
15717 @itemx -mno-llsc
15718 @opindex mllsc
15719 @opindex mno-llsc
15720 Use (do not use) @samp{ll}, @samp{sc}, and @samp{sync} instructions to
15721 implement atomic memory built-in functions.  When neither option is
15722 specified, GCC uses the instructions if the target architecture
15723 supports them.
15725 @option{-mllsc} is useful if the runtime environment can emulate the
15726 instructions and @option{-mno-llsc} can be useful when compiling for
15727 nonstandard ISAs.  You can make either option the default by
15728 configuring GCC with @option{--with-llsc} and @option{--without-llsc}
15729 respectively.  @option{--with-llsc} is the default for some
15730 configurations; see the installation documentation for details.
15732 @item -mdsp
15733 @itemx -mno-dsp
15734 @opindex mdsp
15735 @opindex mno-dsp
15736 Use (do not use) revision 1 of the MIPS DSP ASE@.
15737 @xref{MIPS DSP Built-in Functions}.  This option defines the
15738 preprocessor macro @samp{__mips_dsp}.  It also defines
15739 @samp{__mips_dsp_rev} to 1.
15741 @item -mdspr2
15742 @itemx -mno-dspr2
15743 @opindex mdspr2
15744 @opindex mno-dspr2
15745 Use (do not use) revision 2 of the MIPS DSP ASE@.
15746 @xref{MIPS DSP Built-in Functions}.  This option defines the
15747 preprocessor macros @samp{__mips_dsp} and @samp{__mips_dspr2}.
15748 It also defines @samp{__mips_dsp_rev} to 2.
15750 @item -msmartmips
15751 @itemx -mno-smartmips
15752 @opindex msmartmips
15753 @opindex mno-smartmips
15754 Use (do not use) the MIPS SmartMIPS ASE.
15756 @item -mpaired-single
15757 @itemx -mno-paired-single
15758 @opindex mpaired-single
15759 @opindex mno-paired-single
15760 Use (do not use) paired-single floating-point instructions.
15761 @xref{MIPS Paired-Single Support}.  This option requires
15762 hardware floating-point support to be enabled.
15764 @item -mdmx
15765 @itemx -mno-mdmx
15766 @opindex mdmx
15767 @opindex mno-mdmx
15768 Use (do not use) MIPS Digital Media Extension instructions.
15769 This option can only be used when generating 64-bit code and requires
15770 hardware floating-point support to be enabled.
15772 @item -mips3d
15773 @itemx -mno-mips3d
15774 @opindex mips3d
15775 @opindex mno-mips3d
15776 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
15777 The option @option{-mips3d} implies @option{-mpaired-single}.
15779 @item -mmt
15780 @itemx -mno-mt
15781 @opindex mmt
15782 @opindex mno-mt
15783 Use (do not use) MT Multithreading instructions.
15785 @item -mmcu
15786 @itemx -mno-mcu
15787 @opindex mmcu
15788 @opindex mno-mcu
15789 Use (do not use) the MIPS MCU ASE instructions.
15791 @item -mlong64
15792 @opindex mlong64
15793 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
15794 an explanation of the default and the way that the pointer size is
15795 determined.
15797 @item -mlong32
15798 @opindex mlong32
15799 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
15801 The default size of @code{int}s, @code{long}s and pointers depends on
15802 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
15803 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
15804 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
15805 or the same size as integer registers, whichever is smaller.
15807 @item -msym32
15808 @itemx -mno-sym32
15809 @opindex msym32
15810 @opindex mno-sym32
15811 Assume (do not assume) that all symbols have 32-bit values, regardless
15812 of the selected ABI@.  This option is useful in combination with
15813 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
15814 to generate shorter and faster references to symbolic addresses.
15816 @item -G @var{num}
15817 @opindex G
15818 Put definitions of externally-visible data in a small data section
15819 if that data is no bigger than @var{num} bytes.  GCC can then generate
15820 more efficient accesses to the data; see @option{-mgpopt} for details.
15822 The default @option{-G} option depends on the configuration.
15824 @item -mlocal-sdata
15825 @itemx -mno-local-sdata
15826 @opindex mlocal-sdata
15827 @opindex mno-local-sdata
15828 Extend (do not extend) the @option{-G} behavior to local data too,
15829 such as to static variables in C@.  @option{-mlocal-sdata} is the
15830 default for all configurations.
15832 If the linker complains that an application is using too much small data,
15833 you might want to try rebuilding the less performance-critical parts with
15834 @option{-mno-local-sdata}.  You might also want to build large
15835 libraries with @option{-mno-local-sdata}, so that the libraries leave
15836 more room for the main program.
15838 @item -mextern-sdata
15839 @itemx -mno-extern-sdata
15840 @opindex mextern-sdata
15841 @opindex mno-extern-sdata
15842 Assume (do not assume) that externally-defined data is in
15843 a small data section if the size of that data is within the @option{-G} limit.
15844 @option{-mextern-sdata} is the default for all configurations.
15846 If you compile a module @var{Mod} with @option{-mextern-sdata} @option{-G
15847 @var{num}} @option{-mgpopt}, and @var{Mod} references a variable @var{Var}
15848 that is no bigger than @var{num} bytes, you must make sure that @var{Var}
15849 is placed in a small data section.  If @var{Var} is defined by another
15850 module, you must either compile that module with a high-enough
15851 @option{-G} setting or attach a @code{section} attribute to @var{Var}'s
15852 definition.  If @var{Var} is common, you must link the application
15853 with a high-enough @option{-G} setting.
15855 The easiest way of satisfying these restrictions is to compile
15856 and link every module with the same @option{-G} option.  However,
15857 you may wish to build a library that supports several different
15858 small data limits.  You can do this by compiling the library with
15859 the highest supported @option{-G} setting and additionally using
15860 @option{-mno-extern-sdata} to stop the library from making assumptions
15861 about externally-defined data.
15863 @item -mgpopt
15864 @itemx -mno-gpopt
15865 @opindex mgpopt
15866 @opindex mno-gpopt
15867 Use (do not use) GP-relative accesses for symbols that are known to be
15868 in a small data section; see @option{-G}, @option{-mlocal-sdata} and
15869 @option{-mextern-sdata}.  @option{-mgpopt} is the default for all
15870 configurations.
15872 @option{-mno-gpopt} is useful for cases where the @code{$gp} register
15873 might not hold the value of @code{_gp}.  For example, if the code is
15874 part of a library that might be used in a boot monitor, programs that
15875 call boot monitor routines pass an unknown value in @code{$gp}.
15876 (In such situations, the boot monitor itself is usually compiled
15877 with @option{-G0}.)
15879 @option{-mno-gpopt} implies @option{-mno-local-sdata} and
15880 @option{-mno-extern-sdata}.
15882 @item -membedded-data
15883 @itemx -mno-embedded-data
15884 @opindex membedded-data
15885 @opindex mno-embedded-data
15886 Allocate variables to the read-only data section first if possible, then
15887 next in the small data section if possible, otherwise in data.  This gives
15888 slightly slower code than the default, but reduces the amount of RAM required
15889 when executing, and thus may be preferred for some embedded systems.
15891 @item -muninit-const-in-rodata
15892 @itemx -mno-uninit-const-in-rodata
15893 @opindex muninit-const-in-rodata
15894 @opindex mno-uninit-const-in-rodata
15895 Put uninitialized @code{const} variables in the read-only data section.
15896 This option is only meaningful in conjunction with @option{-membedded-data}.
15898 @item -mcode-readable=@var{setting}
15899 @opindex mcode-readable
15900 Specify whether GCC may generate code that reads from executable sections.
15901 There are three possible settings:
15903 @table @gcctabopt
15904 @item -mcode-readable=yes
15905 Instructions may freely access executable sections.  This is the
15906 default setting.
15908 @item -mcode-readable=pcrel
15909 MIPS16 PC-relative load instructions can access executable sections,
15910 but other instructions must not do so.  This option is useful on 4KSc
15911 and 4KSd processors when the code TLBs have the Read Inhibit bit set.
15912 It is also useful on processors that can be configured to have a dual
15913 instruction/data SRAM interface and that, like the M4K, automatically
15914 redirect PC-relative loads to the instruction RAM.
15916 @item -mcode-readable=no
15917 Instructions must not access executable sections.  This option can be
15918 useful on targets that are configured to have a dual instruction/data
15919 SRAM interface but that (unlike the M4K) do not automatically redirect
15920 PC-relative loads to the instruction RAM.
15921 @end table
15923 @item -msplit-addresses
15924 @itemx -mno-split-addresses
15925 @opindex msplit-addresses
15926 @opindex mno-split-addresses
15927 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
15928 relocation operators.  This option has been superseded by
15929 @option{-mexplicit-relocs} but is retained for backwards compatibility.
15931 @item -mexplicit-relocs
15932 @itemx -mno-explicit-relocs
15933 @opindex mexplicit-relocs
15934 @opindex mno-explicit-relocs
15935 Use (do not use) assembler relocation operators when dealing with symbolic
15936 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
15937 is to use assembler macros instead.
15939 @option{-mexplicit-relocs} is the default if GCC was configured
15940 to use an assembler that supports relocation operators.
15942 @item -mcheck-zero-division
15943 @itemx -mno-check-zero-division
15944 @opindex mcheck-zero-division
15945 @opindex mno-check-zero-division
15946 Trap (do not trap) on integer division by zero.
15948 The default is @option{-mcheck-zero-division}.
15950 @item -mdivide-traps
15951 @itemx -mdivide-breaks
15952 @opindex mdivide-traps
15953 @opindex mdivide-breaks
15954 MIPS systems check for division by zero by generating either a
15955 conditional trap or a break instruction.  Using traps results in
15956 smaller code, but is only supported on MIPS II and later.  Also, some
15957 versions of the Linux kernel have a bug that prevents trap from
15958 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
15959 allow conditional traps on architectures that support them and
15960 @option{-mdivide-breaks} to force the use of breaks.
15962 The default is usually @option{-mdivide-traps}, but this can be
15963 overridden at configure time using @option{--with-divide=breaks}.
15964 Divide-by-zero checks can be completely disabled using
15965 @option{-mno-check-zero-division}.
15967 @item -mmemcpy
15968 @itemx -mno-memcpy
15969 @opindex mmemcpy
15970 @opindex mno-memcpy
15971 Force (do not force) the use of @code{memcpy()} for non-trivial block
15972 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
15973 most constant-sized copies.
15975 @item -mlong-calls
15976 @itemx -mno-long-calls
15977 @opindex mlong-calls
15978 @opindex mno-long-calls
15979 Disable (do not disable) use of the @code{jal} instruction.  Calling
15980 functions using @code{jal} is more efficient but requires the caller
15981 and callee to be in the same 256 megabyte segment.
15983 This option has no effect on abicalls code.  The default is
15984 @option{-mno-long-calls}.
15986 @item -mmad
15987 @itemx -mno-mad
15988 @opindex mmad
15989 @opindex mno-mad
15990 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
15991 instructions, as provided by the R4650 ISA@.
15993 @item -mfused-madd
15994 @itemx -mno-fused-madd
15995 @opindex mfused-madd
15996 @opindex mno-fused-madd
15997 Enable (disable) use of the floating-point multiply-accumulate
15998 instructions, when they are available.  The default is
15999 @option{-mfused-madd}.
16001 When multiply-accumulate instructions are used, the intermediate
16002 product is calculated to infinite precision and is not subject to
16003 the FCSR Flush to Zero bit.  This may be undesirable in some
16004 circumstances.
16006 @item -nocpp
16007 @opindex nocpp
16008 Tell the MIPS assembler to not run its preprocessor over user
16009 assembler files (with a @samp{.s} suffix) when assembling them.
16011 @item -mfix-24k
16012 @item -mno-fix-24k
16013 @opindex mfix-24k
16014 @opindex mno-fix-24k
16015 Work around the 24K E48 (lost data on stores during refill) errata.
16016 The workarounds are implemented by the assembler rather than by GCC@.
16018 @item -mfix-r4000
16019 @itemx -mno-fix-r4000
16020 @opindex mfix-r4000
16021 @opindex mno-fix-r4000
16022 Work around certain R4000 CPU errata:
16023 @itemize @minus
16024 @item
16025 A double-word or a variable shift may give an incorrect result if executed
16026 immediately after starting an integer division.
16027 @item
16028 A double-word or a variable shift may give an incorrect result if executed
16029 while an integer multiplication is in progress.
16030 @item
16031 An integer division may give an incorrect result if started in a delay slot
16032 of a taken branch or a jump.
16033 @end itemize
16035 @item -mfix-r4400
16036 @itemx -mno-fix-r4400
16037 @opindex mfix-r4400
16038 @opindex mno-fix-r4400
16039 Work around certain R4400 CPU errata:
16040 @itemize @minus
16041 @item
16042 A double-word or a variable shift may give an incorrect result if executed
16043 immediately after starting an integer division.
16044 @end itemize
16046 @item -mfix-r10000
16047 @itemx -mno-fix-r10000
16048 @opindex mfix-r10000
16049 @opindex mno-fix-r10000
16050 Work around certain R10000 errata:
16051 @itemize @minus
16052 @item
16053 @code{ll}/@code{sc} sequences may not behave atomically on revisions
16054 prior to 3.0.  They may deadlock on revisions 2.6 and earlier.
16055 @end itemize
16057 This option can only be used if the target architecture supports
16058 branch-likely instructions.  @option{-mfix-r10000} is the default when
16059 @option{-march=r10000} is used; @option{-mno-fix-r10000} is the default
16060 otherwise.
16062 @item -mfix-vr4120
16063 @itemx -mno-fix-vr4120
16064 @opindex mfix-vr4120
16065 Work around certain VR4120 errata:
16066 @itemize @minus
16067 @item
16068 @code{dmultu} does not always produce the correct result.
16069 @item
16070 @code{div} and @code{ddiv} do not always produce the correct result if one
16071 of the operands is negative.
16072 @end itemize
16073 The workarounds for the division errata rely on special functions in
16074 @file{libgcc.a}.  At present, these functions are only provided by
16075 the @code{mips64vr*-elf} configurations.
16077 Other VR4120 errata require a NOP to be inserted between certain pairs of
16078 instructions.  These errata are handled by the assembler, not by GCC itself.
16080 @item -mfix-vr4130
16081 @opindex mfix-vr4130
16082 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
16083 workarounds are implemented by the assembler rather than by GCC,
16084 although GCC avoids using @code{mflo} and @code{mfhi} if the
16085 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
16086 instructions are available instead.
16088 @item -mfix-sb1
16089 @itemx -mno-fix-sb1
16090 @opindex mfix-sb1
16091 Work around certain SB-1 CPU core errata.
16092 (This flag currently works around the SB-1 revision 2
16093 ``F1'' and ``F2'' floating-point errata.)
16095 @item -mr10k-cache-barrier=@var{setting}
16096 @opindex mr10k-cache-barrier
16097 Specify whether GCC should insert cache barriers to avoid the
16098 side-effects of speculation on R10K processors.
16100 In common with many processors, the R10K tries to predict the outcome
16101 of a conditional branch and speculatively executes instructions from
16102 the ``taken'' branch.  It later aborts these instructions if the
16103 predicted outcome is wrong.  However, on the R10K, even aborted
16104 instructions can have side effects.
16106 This problem only affects kernel stores and, depending on the system,
16107 kernel loads.  As an example, a speculatively-executed store may load
16108 the target memory into cache and mark the cache line as dirty, even if
16109 the store itself is later aborted.  If a DMA operation writes to the
16110 same area of memory before the ``dirty'' line is flushed, the cached
16111 data overwrites the DMA-ed data.  See the R10K processor manual
16112 for a full description, including other potential problems.
16114 One workaround is to insert cache barrier instructions before every memory
16115 access that might be speculatively executed and that might have side
16116 effects even if aborted.  @option{-mr10k-cache-barrier=@var{setting}}
16117 controls GCC's implementation of this workaround.  It assumes that
16118 aborted accesses to any byte in the following regions does not have
16119 side effects:
16121 @enumerate
16122 @item
16123 the memory occupied by the current function's stack frame;
16125 @item
16126 the memory occupied by an incoming stack argument;
16128 @item
16129 the memory occupied by an object with a link-time-constant address.
16130 @end enumerate
16132 It is the kernel's responsibility to ensure that speculative
16133 accesses to these regions are indeed safe.
16135 If the input program contains a function declaration such as:
16137 @smallexample
16138 void foo (void);
16139 @end smallexample
16141 then the implementation of @code{foo} must allow @code{j foo} and
16142 @code{jal foo} to be executed speculatively.  GCC honors this
16143 restriction for functions it compiles itself.  It expects non-GCC
16144 functions (such as hand-written assembly code) to do the same.
16146 The option has three forms:
16148 @table @gcctabopt
16149 @item -mr10k-cache-barrier=load-store
16150 Insert a cache barrier before a load or store that might be
16151 speculatively executed and that might have side effects even
16152 if aborted.
16154 @item -mr10k-cache-barrier=store
16155 Insert a cache barrier before a store that might be speculatively
16156 executed and that might have side effects even if aborted.
16158 @item -mr10k-cache-barrier=none
16159 Disable the insertion of cache barriers.  This is the default setting.
16160 @end table
16162 @item -mflush-func=@var{func}
16163 @itemx -mno-flush-func
16164 @opindex mflush-func
16165 Specifies the function to call to flush the I and D caches, or to not
16166 call any such function.  If called, the function must take the same
16167 arguments as the common @code{_flush_func()}, that is, the address of the
16168 memory range for which the cache is being flushed, the size of the
16169 memory range, and the number 3 (to flush both caches).  The default
16170 depends on the target GCC was configured for, but commonly is either
16171 @samp{_flush_func} or @samp{__cpu_flush}.
16173 @item mbranch-cost=@var{num}
16174 @opindex mbranch-cost
16175 Set the cost of branches to roughly @var{num} ``simple'' instructions.
16176 This cost is only a heuristic and is not guaranteed to produce
16177 consistent results across releases.  A zero cost redundantly selects
16178 the default, which is based on the @option{-mtune} setting.
16180 @item -mbranch-likely
16181 @itemx -mno-branch-likely
16182 @opindex mbranch-likely
16183 @opindex mno-branch-likely
16184 Enable or disable use of Branch Likely instructions, regardless of the
16185 default for the selected architecture.  By default, Branch Likely
16186 instructions may be generated if they are supported by the selected
16187 architecture.  An exception is for the MIPS32 and MIPS64 architectures
16188 and processors that implement those architectures; for those, Branch
16189 Likely instructions are not be generated by default because the MIPS32
16190 and MIPS64 architectures specifically deprecate their use.
16192 @item -mfp-exceptions
16193 @itemx -mno-fp-exceptions
16194 @opindex mfp-exceptions
16195 Specifies whether FP exceptions are enabled.  This affects how
16196 FP instructions are scheduled for some processors.
16197 The default is that FP exceptions are
16198 enabled.
16200 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
16201 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
16202 FP pipe.
16204 @item -mvr4130-align
16205 @itemx -mno-vr4130-align
16206 @opindex mvr4130-align
16207 The VR4130 pipeline is two-way superscalar, but can only issue two
16208 instructions together if the first one is 8-byte aligned.  When this
16209 option is enabled, GCC aligns pairs of instructions that it
16210 thinks should execute in parallel.
16212 This option only has an effect when optimizing for the VR4130.
16213 It normally makes code faster, but at the expense of making it bigger.
16214 It is enabled by default at optimization level @option{-O3}.
16216 @item -msynci
16217 @itemx -mno-synci
16218 @opindex msynci
16219 Enable (disable) generation of @code{synci} instructions on
16220 architectures that support it.  The @code{synci} instructions (if
16221 enabled) are generated when @code{__builtin___clear_cache()} is
16222 compiled.
16224 This option defaults to @code{-mno-synci}, but the default can be
16225 overridden by configuring with @code{--with-synci}.
16227 When compiling code for single processor systems, it is generally safe
16228 to use @code{synci}.  However, on many multi-core (SMP) systems, it
16229 does not invalidate the instruction caches on all cores and may lead
16230 to undefined behavior.
16232 @item -mrelax-pic-calls
16233 @itemx -mno-relax-pic-calls
16234 @opindex mrelax-pic-calls
16235 Try to turn PIC calls that are normally dispatched via register
16236 @code{$25} into direct calls.  This is only possible if the linker can
16237 resolve the destination at link-time and if the destination is within
16238 range for a direct call.
16240 @option{-mrelax-pic-calls} is the default if GCC was configured to use
16241 an assembler and a linker that support the @code{.reloc} assembly
16242 directive and @code{-mexplicit-relocs} is in effect.  With
16243 @code{-mno-explicit-relocs}, this optimization can be performed by the
16244 assembler and the linker alone without help from the compiler.
16246 @item -mmcount-ra-address
16247 @itemx -mno-mcount-ra-address
16248 @opindex mmcount-ra-address
16249 @opindex mno-mcount-ra-address
16250 Emit (do not emit) code that allows @code{_mcount} to modify the
16251 calling function's return address.  When enabled, this option extends
16252 the usual @code{_mcount} interface with a new @var{ra-address}
16253 parameter, which has type @code{intptr_t *} and is passed in register
16254 @code{$12}.  @code{_mcount} can then modify the return address by
16255 doing both of the following:
16256 @itemize
16257 @item
16258 Returning the new address in register @code{$31}.
16259 @item
16260 Storing the new address in @code{*@var{ra-address}},
16261 if @var{ra-address} is nonnull.
16262 @end itemize
16264 The default is @option{-mno-mcount-ra-address}.
16266 @end table
16268 @node MMIX Options
16269 @subsection MMIX Options
16270 @cindex MMIX Options
16272 These options are defined for the MMIX:
16274 @table @gcctabopt
16275 @item -mlibfuncs
16276 @itemx -mno-libfuncs
16277 @opindex mlibfuncs
16278 @opindex mno-libfuncs
16279 Specify that intrinsic library functions are being compiled, passing all
16280 values in registers, no matter the size.
16282 @item -mepsilon
16283 @itemx -mno-epsilon
16284 @opindex mepsilon
16285 @opindex mno-epsilon
16286 Generate floating-point comparison instructions that compare with respect
16287 to the @code{rE} epsilon register.
16289 @item -mabi=mmixware
16290 @itemx -mabi=gnu
16291 @opindex mabi=mmixware
16292 @opindex mabi=gnu
16293 Generate code that passes function parameters and return values that (in
16294 the called function) are seen as registers @code{$0} and up, as opposed to
16295 the GNU ABI which uses global registers @code{$231} and up.
16297 @item -mzero-extend
16298 @itemx -mno-zero-extend
16299 @opindex mzero-extend
16300 @opindex mno-zero-extend
16301 When reading data from memory in sizes shorter than 64 bits, use (do not
16302 use) zero-extending load instructions by default, rather than
16303 sign-extending ones.
16305 @item -mknuthdiv
16306 @itemx -mno-knuthdiv
16307 @opindex mknuthdiv
16308 @opindex mno-knuthdiv
16309 Make the result of a division yielding a remainder have the same sign as
16310 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
16311 remainder follows the sign of the dividend.  Both methods are
16312 arithmetically valid, the latter being almost exclusively used.
16314 @item -mtoplevel-symbols
16315 @itemx -mno-toplevel-symbols
16316 @opindex mtoplevel-symbols
16317 @opindex mno-toplevel-symbols
16318 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
16319 code can be used with the @code{PREFIX} assembly directive.
16321 @item -melf
16322 @opindex melf
16323 Generate an executable in the ELF format, rather than the default
16324 @samp{mmo} format used by the @command{mmix} simulator.
16326 @item -mbranch-predict
16327 @itemx -mno-branch-predict
16328 @opindex mbranch-predict
16329 @opindex mno-branch-predict
16330 Use (do not use) the probable-branch instructions, when static branch
16331 prediction indicates a probable branch.
16333 @item -mbase-addresses
16334 @itemx -mno-base-addresses
16335 @opindex mbase-addresses
16336 @opindex mno-base-addresses
16337 Generate (do not generate) code that uses @emph{base addresses}.  Using a
16338 base address automatically generates a request (handled by the assembler
16339 and the linker) for a constant to be set up in a global register.  The
16340 register is used for one or more base address requests within the range 0
16341 to 255 from the value held in the register.  The generally leads to short
16342 and fast code, but the number of different data items that can be
16343 addressed is limited.  This means that a program that uses lots of static
16344 data may require @option{-mno-base-addresses}.
16346 @item -msingle-exit
16347 @itemx -mno-single-exit
16348 @opindex msingle-exit
16349 @opindex mno-single-exit
16350 Force (do not force) generated code to have a single exit point in each
16351 function.
16352 @end table
16354 @node MN10300 Options
16355 @subsection MN10300 Options
16356 @cindex MN10300 options
16358 These @option{-m} options are defined for Matsushita MN10300 architectures:
16360 @table @gcctabopt
16361 @item -mmult-bug
16362 @opindex mmult-bug
16363 Generate code to avoid bugs in the multiply instructions for the MN10300
16364 processors.  This is the default.
16366 @item -mno-mult-bug
16367 @opindex mno-mult-bug
16368 Do not generate code to avoid bugs in the multiply instructions for the
16369 MN10300 processors.
16371 @item -mam33
16372 @opindex mam33
16373 Generate code using features specific to the AM33 processor.
16375 @item -mno-am33
16376 @opindex mno-am33
16377 Do not generate code using features specific to the AM33 processor.  This
16378 is the default.
16380 @item -mam33-2
16381 @opindex mam33-2
16382 Generate code using features specific to the AM33/2.0 processor.
16384 @item -mam34
16385 @opindex mam34
16386 Generate code using features specific to the AM34 processor.
16388 @item -mtune=@var{cpu-type}
16389 @opindex mtune
16390 Use the timing characteristics of the indicated CPU type when
16391 scheduling instructions.  This does not change the targeted processor
16392 type.  The CPU type must be one of @samp{mn10300}, @samp{am33},
16393 @samp{am33-2} or @samp{am34}.
16395 @item -mreturn-pointer-on-d0
16396 @opindex mreturn-pointer-on-d0
16397 When generating a function that returns a pointer, return the pointer
16398 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
16399 only in @code{a0}, and attempts to call such functions without a prototype
16400 result in errors.  Note that this option is on by default; use
16401 @option{-mno-return-pointer-on-d0} to disable it.
16403 @item -mno-crt0
16404 @opindex mno-crt0
16405 Do not link in the C run-time initialization object file.
16407 @item -mrelax
16408 @opindex mrelax
16409 Indicate to the linker that it should perform a relaxation optimization pass
16410 to shorten branches, calls and absolute memory addresses.  This option only
16411 has an effect when used on the command line for the final link step.
16413 This option makes symbolic debugging impossible.
16415 @item -mliw
16416 @opindex mliw
16417 Allow the compiler to generate @emph{Long Instruction Word}
16418 instructions if the target is the @samp{AM33} or later.  This is the
16419 default.  This option defines the preprocessor macro @samp{__LIW__}.
16421 @item -mnoliw
16422 @opindex mnoliw
16423 Do not allow the compiler to generate @emph{Long Instruction Word}
16424 instructions.  This option defines the preprocessor macro
16425 @samp{__NO_LIW__}.
16427 @item -msetlb
16428 @opindex msetlb
16429 Allow the compiler to generate the @emph{SETLB} and @emph{Lcc}
16430 instructions if the target is the @samp{AM33} or later.  This is the
16431 default.  This option defines the preprocessor macro @samp{__SETLB__}.
16433 @item -mnosetlb
16434 @opindex mnosetlb
16435 Do not allow the compiler to generate @emph{SETLB} or @emph{Lcc}
16436 instructions.  This option defines the preprocessor macro
16437 @samp{__NO_SETLB__}.
16439 @end table
16441 @node PDP-11 Options
16442 @subsection PDP-11 Options
16443 @cindex PDP-11 Options
16445 These options are defined for the PDP-11:
16447 @table @gcctabopt
16448 @item -mfpu
16449 @opindex mfpu
16450 Use hardware FPP floating point.  This is the default.  (FIS floating
16451 point on the PDP-11/40 is not supported.)
16453 @item -msoft-float
16454 @opindex msoft-float
16455 Do not use hardware floating point.
16457 @item -mac0
16458 @opindex mac0
16459 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
16461 @item -mno-ac0
16462 @opindex mno-ac0
16463 Return floating-point results in memory.  This is the default.
16465 @item -m40
16466 @opindex m40
16467 Generate code for a PDP-11/40.
16469 @item -m45
16470 @opindex m45
16471 Generate code for a PDP-11/45.  This is the default.
16473 @item -m10
16474 @opindex m10
16475 Generate code for a PDP-11/10.
16477 @item -mbcopy-builtin
16478 @opindex mbcopy-builtin
16479 Use inline @code{movmemhi} patterns for copying memory.  This is the
16480 default.
16482 @item -mbcopy
16483 @opindex mbcopy
16484 Do not use inline @code{movmemhi} patterns for copying memory.
16486 @item -mint16
16487 @itemx -mno-int32
16488 @opindex mint16
16489 @opindex mno-int32
16490 Use 16-bit @code{int}.  This is the default.
16492 @item -mint32
16493 @itemx -mno-int16
16494 @opindex mint32
16495 @opindex mno-int16
16496 Use 32-bit @code{int}.
16498 @item -mfloat64
16499 @itemx -mno-float32
16500 @opindex mfloat64
16501 @opindex mno-float32
16502 Use 64-bit @code{float}.  This is the default.
16504 @item -mfloat32
16505 @itemx -mno-float64
16506 @opindex mfloat32
16507 @opindex mno-float64
16508 Use 32-bit @code{float}.
16510 @item -mabshi
16511 @opindex mabshi
16512 Use @code{abshi2} pattern.  This is the default.
16514 @item -mno-abshi
16515 @opindex mno-abshi
16516 Do not use @code{abshi2} pattern.
16518 @item -mbranch-expensive
16519 @opindex mbranch-expensive
16520 Pretend that branches are expensive.  This is for experimenting with
16521 code generation only.
16523 @item -mbranch-cheap
16524 @opindex mbranch-cheap
16525 Do not pretend that branches are expensive.  This is the default.
16527 @item -munix-asm
16528 @opindex munix-asm
16529 Use Unix assembler syntax.  This is the default when configured for
16530 @samp{pdp11-*-bsd}.
16532 @item -mdec-asm
16533 @opindex mdec-asm
16534 Use DEC assembler syntax.  This is the default when configured for any
16535 PDP-11 target other than @samp{pdp11-*-bsd}.
16536 @end table
16538 @node picoChip Options
16539 @subsection picoChip Options
16540 @cindex picoChip options
16542 These @samp{-m} options are defined for picoChip implementations:
16544 @table @gcctabopt
16546 @item -mae=@var{ae_type}
16547 @opindex mcpu
16548 Set the instruction set, register set, and instruction scheduling
16549 parameters for array element type @var{ae_type}.  Supported values
16550 for @var{ae_type} are @samp{ANY}, @samp{MUL}, and @samp{MAC}.
16552 @option{-mae=ANY} selects a completely generic AE type.  Code
16553 generated with this option runs on any of the other AE types.  The
16554 code is not as efficient as it would be if compiled for a specific
16555 AE type, and some types of operation (e.g., multiplication) do not
16556 work properly on all types of AE.
16558 @option{-mae=MUL} selects a MUL AE type.  This is the most useful AE type
16559 for compiled code, and is the default.
16561 @option{-mae=MAC} selects a DSP-style MAC AE.  Code compiled with this
16562 option may suffer from poor performance of byte (char) manipulation,
16563 since the DSP AE does not provide hardware support for byte load/stores.
16565 @item -msymbol-as-address
16566 Enable the compiler to directly use a symbol name as an address in a
16567 load/store instruction, without first loading it into a
16568 register.  Typically, the use of this option generates larger
16569 programs, which run faster than when the option isn't used.  However, the
16570 results vary from program to program, so it is left as a user option,
16571 rather than being permanently enabled.
16573 @item -mno-inefficient-warnings
16574 Disables warnings about the generation of inefficient code.  These
16575 warnings can be generated, for example, when compiling code that
16576 performs byte-level memory operations on the MAC AE type.  The MAC AE has
16577 no hardware support for byte-level memory operations, so all byte
16578 load/stores must be synthesized from word load/store operations.  This is
16579 inefficient and a warning is generated to indicate
16580 that you should rewrite the code to avoid byte operations, or to target
16581 an AE type that has the necessary hardware support.  This option disables
16582 these warnings.
16584 @end table
16586 @node PowerPC Options
16587 @subsection PowerPC Options
16588 @cindex PowerPC options
16590 These are listed under @xref{RS/6000 and PowerPC Options}.
16592 @node RL78 Options
16593 @subsection RL78 Options
16594 @cindex RL78 Options
16596 @table @gcctabopt
16598 @item -msim
16599 @opindex msim
16600 Links in additional target libraries to support operation within a
16601 simulator.
16603 @item -mmul=none
16604 @itemx -mmul=g13
16605 @itemx -mmul=rl78
16606 @opindex mmul
16607 Specifies the type of hardware multiplication support to be used.  The
16608 default is @code{none}, which uses software multiplication functions.
16609 The @code{g13} option is for the hardware multiply/divide peripheral
16610 only on the RL78/G13 targets.  The @code{rl78} option is for the
16611 standard hardware multiplication defined in the RL78 software manual.
16613 @end table
16615 @node RS/6000 and PowerPC Options
16616 @subsection IBM RS/6000 and PowerPC Options
16617 @cindex RS/6000 and PowerPC Options
16618 @cindex IBM RS/6000 and PowerPC Options
16620 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
16621 @table @gcctabopt
16622 @item -mpowerpc-gpopt
16623 @itemx -mno-powerpc-gpopt
16624 @itemx -mpowerpc-gfxopt
16625 @itemx -mno-powerpc-gfxopt
16626 @need 800
16627 @itemx -mpowerpc64
16628 @itemx -mno-powerpc64
16629 @itemx -mmfcrf
16630 @itemx -mno-mfcrf
16631 @itemx -mpopcntb
16632 @itemx -mno-popcntb
16633 @itemx -mpopcntd
16634 @itemx -mno-popcntd
16635 @itemx -mfprnd
16636 @itemx -mno-fprnd
16637 @need 800
16638 @itemx -mcmpb
16639 @itemx -mno-cmpb
16640 @itemx -mmfpgpr
16641 @itemx -mno-mfpgpr
16642 @itemx -mhard-dfp
16643 @itemx -mno-hard-dfp
16644 @opindex mpowerpc-gpopt
16645 @opindex mno-powerpc-gpopt
16646 @opindex mpowerpc-gfxopt
16647 @opindex mno-powerpc-gfxopt
16648 @opindex mpowerpc64
16649 @opindex mno-powerpc64
16650 @opindex mmfcrf
16651 @opindex mno-mfcrf
16652 @opindex mpopcntb
16653 @opindex mno-popcntb
16654 @opindex mpopcntd
16655 @opindex mno-popcntd
16656 @opindex mfprnd
16657 @opindex mno-fprnd
16658 @opindex mcmpb
16659 @opindex mno-cmpb
16660 @opindex mmfpgpr
16661 @opindex mno-mfpgpr
16662 @opindex mhard-dfp
16663 @opindex mno-hard-dfp
16664 You use these options to specify which instructions are available on the
16665 processor you are using.  The default value of these options is
16666 determined when configuring GCC@.  Specifying the
16667 @option{-mcpu=@var{cpu_type}} overrides the specification of these
16668 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
16669 rather than the options listed above.
16671 Specifying @option{-mpowerpc-gpopt} allows
16672 GCC to use the optional PowerPC architecture instructions in the
16673 General Purpose group, including floating-point square root.  Specifying
16674 @option{-mpowerpc-gfxopt} allows GCC to
16675 use the optional PowerPC architecture instructions in the Graphics
16676 group, including floating-point select.
16678 The @option{-mmfcrf} option allows GCC to generate the move from
16679 condition register field instruction implemented on the POWER4
16680 processor and other processors that support the PowerPC V2.01
16681 architecture.
16682 The @option{-mpopcntb} option allows GCC to generate the popcount and
16683 double-precision FP reciprocal estimate instruction implemented on the
16684 POWER5 processor and other processors that support the PowerPC V2.02
16685 architecture.
16686 The @option{-mpopcntd} option allows GCC to generate the popcount
16687 instruction implemented on the POWER7 processor and other processors
16688 that support the PowerPC V2.06 architecture.
16689 The @option{-mfprnd} option allows GCC to generate the FP round to
16690 integer instructions implemented on the POWER5+ processor and other
16691 processors that support the PowerPC V2.03 architecture.
16692 The @option{-mcmpb} option allows GCC to generate the compare bytes
16693 instruction implemented on the POWER6 processor and other processors
16694 that support the PowerPC V2.05 architecture.
16695 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
16696 general-purpose register instructions implemented on the POWER6X
16697 processor and other processors that support the extended PowerPC V2.05
16698 architecture.
16699 The @option{-mhard-dfp} option allows GCC to generate the decimal
16700 floating-point instructions implemented on some POWER processors.
16702 The @option{-mpowerpc64} option allows GCC to generate the additional
16703 64-bit instructions that are found in the full PowerPC64 architecture
16704 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
16705 @option{-mno-powerpc64}.
16707 @item -mcpu=@var{cpu_type}
16708 @opindex mcpu
16709 Set architecture type, register usage, and
16710 instruction scheduling parameters for machine type @var{cpu_type}.
16711 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
16712 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{464}, @samp{464fp},
16713 @samp{476}, @samp{476fp}, @samp{505}, @samp{601}, @samp{602}, @samp{603},
16714 @samp{603e}, @samp{604}, @samp{604e}, @samp{620}, @samp{630}, @samp{740},
16715 @samp{7400}, @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
16716 @samp{860}, @samp{970}, @samp{8540}, @samp{a2}, @samp{e300c2},
16717 @samp{e300c3}, @samp{e500mc}, @samp{e500mc64}, @samp{e5500},
16718 @samp{e6500}, @samp{ec603e}, @samp{G3}, @samp{G4}, @samp{G5},
16719 @samp{titan}, @samp{power3}, @samp{power4}, @samp{power5}, @samp{power5+},
16720 @samp{power6}, @samp{power6x}, @samp{power7}, @samp{powerpc},
16721 @samp{powerpc64}, and @samp{rs64}.
16723 @option{-mcpu=powerpc}, and @option{-mcpu=powerpc64} specify pure 32-bit
16724 PowerPC and 64-bit PowerPC architecture machine
16725 types, with an appropriate, generic processor model assumed for
16726 scheduling purposes.
16728 The other options specify a specific processor.  Code generated under
16729 those options runs best on that processor, and may not run at all on
16730 others.
16732 The @option{-mcpu} options automatically enable or disable the
16733 following options:
16735 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
16736 -mpopcntb -mpopcntd  -mpowerpc64 @gol
16737 -mpowerpc-gpopt  -mpowerpc-gfxopt  -msingle-float -mdouble-float @gol
16738 -msimple-fpu -mstring  -mmulhw  -mdlmzb  -mmfpgpr -mvsx}
16740 The particular options set for any particular CPU varies between
16741 compiler versions, depending on what setting seems to produce optimal
16742 code for that CPU; it doesn't necessarily reflect the actual hardware's
16743 capabilities.  If you wish to set an individual option to a particular
16744 value, you may specify it after the @option{-mcpu} option, like
16745 @option{-mcpu=970 -mno-altivec}.
16747 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
16748 not enabled or disabled by the @option{-mcpu} option at present because
16749 AIX does not have full support for these options.  You may still
16750 enable or disable them individually if you're sure it'll work in your
16751 environment.
16753 @item -mtune=@var{cpu_type}
16754 @opindex mtune
16755 Set the instruction scheduling parameters for machine type
16756 @var{cpu_type}, but do not set the architecture type or register usage,
16757 as @option{-mcpu=@var{cpu_type}} does.  The same
16758 values for @var{cpu_type} are used for @option{-mtune} as for
16759 @option{-mcpu}.  If both are specified, the code generated uses the
16760 architecture and registers set by @option{-mcpu}, but the
16761 scheduling parameters set by @option{-mtune}.
16763 @item -mcmodel=small
16764 @opindex mcmodel=small
16765 Generate PowerPC64 code for the small model: The TOC is limited to
16766 64k.
16768 @item -mcmodel=medium
16769 @opindex mcmodel=medium
16770 Generate PowerPC64 code for the medium model: The TOC and other static
16771 data may be up to a total of 4G in size.
16773 @item -mcmodel=large
16774 @opindex mcmodel=large
16775 Generate PowerPC64 code for the large model: The TOC may be up to 4G
16776 in size.  Other data and code is only limited by the 64-bit address
16777 space.
16779 @item -maltivec
16780 @itemx -mno-altivec
16781 @opindex maltivec
16782 @opindex mno-altivec
16783 Generate code that uses (does not use) AltiVec instructions, and also
16784 enable the use of built-in functions that allow more direct access to
16785 the AltiVec instruction set.  You may also need to set
16786 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
16787 enhancements.
16789 @item -mvrsave
16790 @itemx -mno-vrsave
16791 @opindex mvrsave
16792 @opindex mno-vrsave
16793 Generate VRSAVE instructions when generating AltiVec code.
16795 @item -mgen-cell-microcode
16796 @opindex mgen-cell-microcode
16797 Generate Cell microcode instructions.
16799 @item -mwarn-cell-microcode
16800 @opindex mwarn-cell-microcode
16801 Warn when a Cell microcode instruction is emitted.  An example
16802 of a Cell microcode instruction is a variable shift.
16804 @item -msecure-plt
16805 @opindex msecure-plt
16806 Generate code that allows @command{ld} and @command{ld.so}
16807 to build executables and shared
16808 libraries with non-executable @code{.plt} and @code{.got} sections.
16809 This is a PowerPC
16810 32-bit SYSV ABI option.
16812 @item -mbss-plt
16813 @opindex mbss-plt
16814 Generate code that uses a BSS @code{.plt} section that @command{ld.so}
16815 fills in, and
16816 requires @code{.plt} and @code{.got}
16817 sections that are both writable and executable.
16818 This is a PowerPC 32-bit SYSV ABI option.
16820 @item -misel
16821 @itemx -mno-isel
16822 @opindex misel
16823 @opindex mno-isel
16824 This switch enables or disables the generation of ISEL instructions.
16826 @item -misel=@var{yes/no}
16827 This switch has been deprecated.  Use @option{-misel} and
16828 @option{-mno-isel} instead.
16830 @item -mspe
16831 @itemx -mno-spe
16832 @opindex mspe
16833 @opindex mno-spe
16834 This switch enables or disables the generation of SPE simd
16835 instructions.
16837 @item -mpaired
16838 @itemx -mno-paired
16839 @opindex mpaired
16840 @opindex mno-paired
16841 This switch enables or disables the generation of PAIRED simd
16842 instructions.
16844 @item -mspe=@var{yes/no}
16845 This option has been deprecated.  Use @option{-mspe} and
16846 @option{-mno-spe} instead.
16848 @item -mvsx
16849 @itemx -mno-vsx
16850 @opindex mvsx
16851 @opindex mno-vsx
16852 Generate code that uses (does not use) vector/scalar (VSX)
16853 instructions, and also enable the use of built-in functions that allow
16854 more direct access to the VSX instruction set.
16856 @item -mfloat-gprs=@var{yes/single/double/no}
16857 @itemx -mfloat-gprs
16858 @opindex mfloat-gprs
16859 This switch enables or disables the generation of floating-point
16860 operations on the general-purpose registers for architectures that
16861 support it.
16863 The argument @var{yes} or @var{single} enables the use of
16864 single-precision floating-point operations.
16866 The argument @var{double} enables the use of single and
16867 double-precision floating-point operations.
16869 The argument @var{no} disables floating-point operations on the
16870 general-purpose registers.
16872 This option is currently only available on the MPC854x.
16874 @item -m32
16875 @itemx -m64
16876 @opindex m32
16877 @opindex m64
16878 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
16879 targets (including GNU/Linux).  The 32-bit environment sets int, long
16880 and pointer to 32 bits and generates code that runs on any PowerPC
16881 variant.  The 64-bit environment sets int to 32 bits and long and
16882 pointer to 64 bits, and generates code for PowerPC64, as for
16883 @option{-mpowerpc64}.
16885 @item -mfull-toc
16886 @itemx -mno-fp-in-toc
16887 @itemx -mno-sum-in-toc
16888 @itemx -mminimal-toc
16889 @opindex mfull-toc
16890 @opindex mno-fp-in-toc
16891 @opindex mno-sum-in-toc
16892 @opindex mminimal-toc
16893 Modify generation of the TOC (Table Of Contents), which is created for
16894 every executable file.  The @option{-mfull-toc} option is selected by
16895 default.  In that case, GCC allocates at least one TOC entry for
16896 each unique non-automatic variable reference in your program.  GCC
16897 also places floating-point constants in the TOC@.  However, only
16898 16,384 entries are available in the TOC@.
16900 If you receive a linker error message that saying you have overflowed
16901 the available TOC space, you can reduce the amount of TOC space used
16902 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
16903 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
16904 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
16905 generate code to calculate the sum of an address and a constant at
16906 run time instead of putting that sum into the TOC@.  You may specify one
16907 or both of these options.  Each causes GCC to produce very slightly
16908 slower and larger code at the expense of conserving TOC space.
16910 If you still run out of space in the TOC even when you specify both of
16911 these options, specify @option{-mminimal-toc} instead.  This option causes
16912 GCC to make only one TOC entry for every file.  When you specify this
16913 option, GCC produces code that is slower and larger but which
16914 uses extremely little TOC space.  You may wish to use this option
16915 only on files that contain less frequently-executed code.
16917 @item -maix64
16918 @itemx -maix32
16919 @opindex maix64
16920 @opindex maix32
16921 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
16922 @code{long} type, and the infrastructure needed to support them.
16923 Specifying @option{-maix64} implies @option{-mpowerpc64},
16924 while @option{-maix32} disables the 64-bit ABI and
16925 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
16927 @item -mxl-compat
16928 @itemx -mno-xl-compat
16929 @opindex mxl-compat
16930 @opindex mno-xl-compat
16931 Produce code that conforms more closely to IBM XL compiler semantics
16932 when using AIX-compatible ABI@.  Pass floating-point arguments to
16933 prototyped functions beyond the register save area (RSA) on the stack
16934 in addition to argument FPRs.  Do not assume that most significant
16935 double in 128-bit long double value is properly rounded when comparing
16936 values and converting to double.  Use XL symbol names for long double
16937 support routines.
16939 The AIX calling convention was extended but not initially documented to
16940 handle an obscure K&R C case of calling a function that takes the
16941 address of its arguments with fewer arguments than declared.  IBM XL
16942 compilers access floating-point arguments that do not fit in the
16943 RSA from the stack when a subroutine is compiled without
16944 optimization.  Because always storing floating-point arguments on the
16945 stack is inefficient and rarely needed, this option is not enabled by
16946 default and only is necessary when calling subroutines compiled by IBM
16947 XL compilers without optimization.
16949 @item -mpe
16950 @opindex mpe
16951 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
16952 application written to use message passing with special startup code to
16953 enable the application to run.  The system must have PE installed in the
16954 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
16955 must be overridden with the @option{-specs=} option to specify the
16956 appropriate directory location.  The Parallel Environment does not
16957 support threads, so the @option{-mpe} option and the @option{-pthread}
16958 option are incompatible.
16960 @item -malign-natural
16961 @itemx -malign-power
16962 @opindex malign-natural
16963 @opindex malign-power
16964 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
16965 @option{-malign-natural} overrides the ABI-defined alignment of larger
16966 types, such as floating-point doubles, on their natural size-based boundary.
16967 The option @option{-malign-power} instructs GCC to follow the ABI-specified
16968 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
16970 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
16971 is not supported.
16973 @item -msoft-float
16974 @itemx -mhard-float
16975 @opindex msoft-float
16976 @opindex mhard-float
16977 Generate code that does not use (uses) the floating-point register set.
16978 Software floating-point emulation is provided if you use the
16979 @option{-msoft-float} option, and pass the option to GCC when linking.
16981 @item -msingle-float
16982 @itemx -mdouble-float
16983 @opindex msingle-float
16984 @opindex mdouble-float
16985 Generate code for single- or double-precision floating-point operations.
16986 @option{-mdouble-float} implies @option{-msingle-float}.
16988 @item -msimple-fpu
16989 @opindex msimple-fpu
16990 Do not generate @code{sqrt} and @code{div} instructions for hardware
16991 floating-point unit.
16993 @item -mfpu=@var{name}
16994 @opindex mfpu
16995 Specify type of floating-point unit.  Valid values for @var{name} are
16996 @samp{sp_lite} (equivalent to @option{-msingle-float -msimple-fpu}),
16997 @samp{dp_lite} (equivalent to @option{-mdouble-float -msimple-fpu}),
16998 @samp{sp_full} (equivalent to @option{-msingle-float}),
16999 and @samp{dp_full} (equivalent to @option{-mdouble-float}).
17001 @item -mxilinx-fpu
17002 @opindex mxilinx-fpu
17003 Perform optimizations for the floating-point unit on Xilinx PPC 405/440.
17005 @item -mmultiple
17006 @itemx -mno-multiple
17007 @opindex mmultiple
17008 @opindex mno-multiple
17009 Generate code that uses (does not use) the load multiple word
17010 instructions and the store multiple word instructions.  These
17011 instructions are generated by default on POWER systems, and not
17012 generated on PowerPC systems.  Do not use @option{-mmultiple} on little-endian
17013 PowerPC systems, since those instructions do not work when the
17014 processor is in little-endian mode.  The exceptions are PPC740 and
17015 PPC750 which permit these instructions in little-endian mode.
17017 @item -mstring
17018 @itemx -mno-string
17019 @opindex mstring
17020 @opindex mno-string
17021 Generate code that uses (does not use) the load string instructions
17022 and the store string word instructions to save multiple registers and
17023 do small block moves.  These instructions are generated by default on
17024 POWER systems, and not generated on PowerPC systems.  Do not use
17025 @option{-mstring} on little-endian PowerPC systems, since those
17026 instructions do not work when the processor is in little-endian mode.
17027 The exceptions are PPC740 and PPC750 which permit these instructions
17028 in little-endian mode.
17030 @item -mupdate
17031 @itemx -mno-update
17032 @opindex mupdate
17033 @opindex mno-update
17034 Generate code that uses (does not use) the load or store instructions
17035 that update the base register to the address of the calculated memory
17036 location.  These instructions are generated by default.  If you use
17037 @option{-mno-update}, there is a small window between the time that the
17038 stack pointer is updated and the address of the previous frame is
17039 stored, which means code that walks the stack frame across interrupts or
17040 signals may get corrupted data.
17042 @item -mavoid-indexed-addresses
17043 @itemx -mno-avoid-indexed-addresses
17044 @opindex mavoid-indexed-addresses
17045 @opindex mno-avoid-indexed-addresses
17046 Generate code that tries to avoid (not avoid) the use of indexed load
17047 or store instructions. These instructions can incur a performance
17048 penalty on Power6 processors in certain situations, such as when
17049 stepping through large arrays that cross a 16M boundary.  This option
17050 is enabled by default when targeting Power6 and disabled otherwise.
17052 @item -mfused-madd
17053 @itemx -mno-fused-madd
17054 @opindex mfused-madd
17055 @opindex mno-fused-madd
17056 Generate code that uses (does not use) the floating-point multiply and
17057 accumulate instructions.  These instructions are generated by default
17058 if hardware floating point is used.  The machine-dependent
17059 @option{-mfused-madd} option is now mapped to the machine-independent
17060 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
17061 mapped to @option{-ffp-contract=off}.
17063 @item -mmulhw
17064 @itemx -mno-mulhw
17065 @opindex mmulhw
17066 @opindex mno-mulhw
17067 Generate code that uses (does not use) the half-word multiply and
17068 multiply-accumulate instructions on the IBM 405, 440, 464 and 476 processors.
17069 These instructions are generated by default when targeting those
17070 processors.
17072 @item -mdlmzb
17073 @itemx -mno-dlmzb
17074 @opindex mdlmzb
17075 @opindex mno-dlmzb
17076 Generate code that uses (does not use) the string-search @samp{dlmzb}
17077 instruction on the IBM 405, 440, 464 and 476 processors.  This instruction is
17078 generated by default when targeting those processors.
17080 @item -mno-bit-align
17081 @itemx -mbit-align
17082 @opindex mno-bit-align
17083 @opindex mbit-align
17084 On System V.4 and embedded PowerPC systems do not (do) force structures
17085 and unions that contain bit-fields to be aligned to the base type of the
17086 bit-field.
17088 For example, by default a structure containing nothing but 8
17089 @code{unsigned} bit-fields of length 1 is aligned to a 4-byte
17090 boundary and has a size of 4 bytes.  By using @option{-mno-bit-align},
17091 the structure is aligned to a 1-byte boundary and is 1 byte in
17092 size.
17094 @item -mno-strict-align
17095 @itemx -mstrict-align
17096 @opindex mno-strict-align
17097 @opindex mstrict-align
17098 On System V.4 and embedded PowerPC systems do not (do) assume that
17099 unaligned memory references are handled by the system.
17101 @item -mrelocatable
17102 @itemx -mno-relocatable
17103 @opindex mrelocatable
17104 @opindex mno-relocatable
17105 Generate code that allows (does not allow) a static executable to be
17106 relocated to a different address at run time.  A simple embedded
17107 PowerPC system loader should relocate the entire contents of
17108 @code{.got2} and 4-byte locations listed in the @code{.fixup} section,
17109 a table of 32-bit addresses generated by this option.  For this to
17110 work, all objects linked together must be compiled with
17111 @option{-mrelocatable} or @option{-mrelocatable-lib}.
17112 @option{-mrelocatable} code aligns the stack to an 8-byte boundary.
17114 @item -mrelocatable-lib
17115 @itemx -mno-relocatable-lib
17116 @opindex mrelocatable-lib
17117 @opindex mno-relocatable-lib
17118 Like @option{-mrelocatable}, @option{-mrelocatable-lib} generates a
17119 @code{.fixup} section to allow static executables to be relocated at
17120 run time, but @option{-mrelocatable-lib} does not use the smaller stack
17121 alignment of @option{-mrelocatable}.  Objects compiled with
17122 @option{-mrelocatable-lib} may be linked with objects compiled with
17123 any combination of the @option{-mrelocatable} options.
17125 @item -mno-toc
17126 @itemx -mtoc
17127 @opindex mno-toc
17128 @opindex mtoc
17129 On System V.4 and embedded PowerPC systems do not (do) assume that
17130 register 2 contains a pointer to a global area pointing to the addresses
17131 used in the program.
17133 @item -mlittle
17134 @itemx -mlittle-endian
17135 @opindex mlittle
17136 @opindex mlittle-endian
17137 On System V.4 and embedded PowerPC systems compile code for the
17138 processor in little-endian mode.  The @option{-mlittle-endian} option is
17139 the same as @option{-mlittle}.
17141 @item -mbig
17142 @itemx -mbig-endian
17143 @opindex mbig
17144 @opindex mbig-endian
17145 On System V.4 and embedded PowerPC systems compile code for the
17146 processor in big-endian mode.  The @option{-mbig-endian} option is
17147 the same as @option{-mbig}.
17149 @item -mdynamic-no-pic
17150 @opindex mdynamic-no-pic
17151 On Darwin and Mac OS X systems, compile code so that it is not
17152 relocatable, but that its external references are relocatable.  The
17153 resulting code is suitable for applications, but not shared
17154 libraries.
17156 @item -msingle-pic-base
17157 @opindex msingle-pic-base
17158 Treat the register used for PIC addressing as read-only, rather than
17159 loading it in the prologue for each function.  The runtime system is
17160 responsible for initializing this register with an appropriate value
17161 before execution begins.
17163 @item -mprioritize-restricted-insns=@var{priority}
17164 @opindex mprioritize-restricted-insns
17165 This option controls the priority that is assigned to
17166 dispatch-slot restricted instructions during the second scheduling
17167 pass.  The argument @var{priority} takes the value @samp{0}, @samp{1},
17168 or @samp{2} to assign no, highest, or second-highest (respectively) 
17169 priority to dispatch-slot restricted
17170 instructions.
17172 @item -msched-costly-dep=@var{dependence_type}
17173 @opindex msched-costly-dep
17174 This option controls which dependences are considered costly
17175 by the target during instruction scheduling.  The argument
17176 @var{dependence_type} takes one of the following values:
17178 @table @asis
17179 @item @samp{no}
17180 No dependence is costly.
17182 @item @samp{all}
17183 All dependences are costly.
17185 @item @samp{true_store_to_load}
17186 A true dependence from store to load is costly.
17188 @item @samp{store_to_load}
17189 Any dependence from store to load is costly.
17191 @item @var{number}
17192 Any dependence for which the latency is greater than or equal to 
17193 @var{number} is costly.
17194 @end table
17196 @item -minsert-sched-nops=@var{scheme}
17197 @opindex minsert-sched-nops
17198 This option controls which NOP insertion scheme is used during
17199 the second scheduling pass.  The argument @var{scheme} takes one of the
17200 following values:
17202 @table @asis
17203 @item @samp{no}
17204 Don't insert NOPs.
17206 @item @samp{pad}
17207 Pad with NOPs any dispatch group that has vacant issue slots,
17208 according to the scheduler's grouping.
17210 @item @samp{regroup_exact}
17211 Insert NOPs to force costly dependent insns into
17212 separate groups.  Insert exactly as many NOPs as needed to force an insn
17213 to a new group, according to the estimated processor grouping.
17215 @item @var{number}
17216 Insert NOPs to force costly dependent insns into
17217 separate groups.  Insert @var{number} NOPs to force an insn to a new group.
17218 @end table
17220 @item -mcall-sysv
17221 @opindex mcall-sysv
17222 On System V.4 and embedded PowerPC systems compile code using calling
17223 conventions that adhere to the March 1995 draft of the System V
17224 Application Binary Interface, PowerPC processor supplement.  This is the
17225 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
17227 @item -mcall-sysv-eabi
17228 @itemx -mcall-eabi
17229 @opindex mcall-sysv-eabi
17230 @opindex mcall-eabi
17231 Specify both @option{-mcall-sysv} and @option{-meabi} options.
17233 @item -mcall-sysv-noeabi
17234 @opindex mcall-sysv-noeabi
17235 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
17237 @item -mcall-aixdesc
17238 @opindex m
17239 On System V.4 and embedded PowerPC systems compile code for the AIX
17240 operating system.
17242 @item -mcall-linux
17243 @opindex mcall-linux
17244 On System V.4 and embedded PowerPC systems compile code for the
17245 Linux-based GNU system.
17247 @item -mcall-freebsd
17248 @opindex mcall-freebsd
17249 On System V.4 and embedded PowerPC systems compile code for the
17250 FreeBSD operating system.
17252 @item -mcall-netbsd
17253 @opindex mcall-netbsd
17254 On System V.4 and embedded PowerPC systems compile code for the
17255 NetBSD operating system.
17257 @item -mcall-openbsd
17258 @opindex mcall-netbsd
17259 On System V.4 and embedded PowerPC systems compile code for the
17260 OpenBSD operating system.
17262 @item -maix-struct-return
17263 @opindex maix-struct-return
17264 Return all structures in memory (as specified by the AIX ABI)@.
17266 @item -msvr4-struct-return
17267 @opindex msvr4-struct-return
17268 Return structures smaller than 8 bytes in registers (as specified by the
17269 SVR4 ABI)@.
17271 @item -mabi=@var{abi-type}
17272 @opindex mabi
17273 Extend the current ABI with a particular extension, or remove such extension.
17274 Valid values are @var{altivec}, @var{no-altivec}, @var{spe},
17275 @var{no-spe}, @var{ibmlongdouble}, @var{ieeelongdouble}@.
17277 @item -mabi=spe
17278 @opindex mabi=spe
17279 Extend the current ABI with SPE ABI extensions.  This does not change
17280 the default ABI, instead it adds the SPE ABI extensions to the current
17281 ABI@.
17283 @item -mabi=no-spe
17284 @opindex mabi=no-spe
17285 Disable Book-E SPE ABI extensions for the current ABI@.
17287 @item -mabi=ibmlongdouble
17288 @opindex mabi=ibmlongdouble
17289 Change the current ABI to use IBM extended-precision long double.
17290 This is a PowerPC 32-bit SYSV ABI option.
17292 @item -mabi=ieeelongdouble
17293 @opindex mabi=ieeelongdouble
17294 Change the current ABI to use IEEE extended-precision long double.
17295 This is a PowerPC 32-bit Linux ABI option.
17297 @item -mprototype
17298 @itemx -mno-prototype
17299 @opindex mprototype
17300 @opindex mno-prototype
17301 On System V.4 and embedded PowerPC systems assume that all calls to
17302 variable argument functions are properly prototyped.  Otherwise, the
17303 compiler must insert an instruction before every non-prototyped call to
17304 set or clear bit 6 of the condition code register (@var{CR}) to
17305 indicate whether floating-point values are passed in the floating-point
17306 registers in case the function takes variable arguments.  With
17307 @option{-mprototype}, only calls to prototyped variable argument functions
17308 set or clear the bit.
17310 @item -msim
17311 @opindex msim
17312 On embedded PowerPC systems, assume that the startup module is called
17313 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
17314 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}
17315 configurations.
17317 @item -mmvme
17318 @opindex mmvme
17319 On embedded PowerPC systems, assume that the startup module is called
17320 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
17321 @file{libc.a}.
17323 @item -mads
17324 @opindex mads
17325 On embedded PowerPC systems, assume that the startup module is called
17326 @file{crt0.o} and the standard C libraries are @file{libads.a} and
17327 @file{libc.a}.
17329 @item -myellowknife
17330 @opindex myellowknife
17331 On embedded PowerPC systems, assume that the startup module is called
17332 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
17333 @file{libc.a}.
17335 @item -mvxworks
17336 @opindex mvxworks
17337 On System V.4 and embedded PowerPC systems, specify that you are
17338 compiling for a VxWorks system.
17340 @item -memb
17341 @opindex memb
17342 On embedded PowerPC systems, set the @var{PPC_EMB} bit in the ELF flags
17343 header to indicate that @samp{eabi} extended relocations are used.
17345 @item -meabi
17346 @itemx -mno-eabi
17347 @opindex meabi
17348 @opindex mno-eabi
17349 On System V.4 and embedded PowerPC systems do (do not) adhere to the
17350 Embedded Applications Binary Interface (EABI), which is a set of
17351 modifications to the System V.4 specifications.  Selecting @option{-meabi}
17352 means that the stack is aligned to an 8-byte boundary, a function
17353 @code{__eabi} is called from @code{main} to set up the EABI
17354 environment, and the @option{-msdata} option can use both @code{r2} and
17355 @code{r13} to point to two separate small data areas.  Selecting
17356 @option{-mno-eabi} means that the stack is aligned to a 16-byte boundary,
17357 no EABI initialization function is called from @code{main}, and the
17358 @option{-msdata} option only uses @code{r13} to point to a single
17359 small data area.  The @option{-meabi} option is on by default if you
17360 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
17362 @item -msdata=eabi
17363 @opindex msdata=eabi
17364 On System V.4 and embedded PowerPC systems, put small initialized
17365 @code{const} global and static data in the @samp{.sdata2} section, which
17366 is pointed to by register @code{r2}.  Put small initialized
17367 non-@code{const} global and static data in the @samp{.sdata} section,
17368 which is pointed to by register @code{r13}.  Put small uninitialized
17369 global and static data in the @samp{.sbss} section, which is adjacent to
17370 the @samp{.sdata} section.  The @option{-msdata=eabi} option is
17371 incompatible with the @option{-mrelocatable} option.  The
17372 @option{-msdata=eabi} option also sets the @option{-memb} option.
17374 @item -msdata=sysv
17375 @opindex msdata=sysv
17376 On System V.4 and embedded PowerPC systems, put small global and static
17377 data in the @samp{.sdata} section, which is pointed to by register
17378 @code{r13}.  Put small uninitialized global and static data in the
17379 @samp{.sbss} section, which is adjacent to the @samp{.sdata} section.
17380 The @option{-msdata=sysv} option is incompatible with the
17381 @option{-mrelocatable} option.
17383 @item -msdata=default
17384 @itemx -msdata
17385 @opindex msdata=default
17386 @opindex msdata
17387 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
17388 compile code the same as @option{-msdata=eabi}, otherwise compile code the
17389 same as @option{-msdata=sysv}.
17391 @item -msdata=data
17392 @opindex msdata=data
17393 On System V.4 and embedded PowerPC systems, put small global
17394 data in the @samp{.sdata} section.  Put small uninitialized global
17395 data in the @samp{.sbss} section.  Do not use register @code{r13}
17396 to address small data however.  This is the default behavior unless
17397 other @option{-msdata} options are used.
17399 @item -msdata=none
17400 @itemx -mno-sdata
17401 @opindex msdata=none
17402 @opindex mno-sdata
17403 On embedded PowerPC systems, put all initialized global and static data
17404 in the @samp{.data} section, and all uninitialized data in the
17405 @samp{.bss} section.
17407 @item -mblock-move-inline-limit=@var{num}
17408 @opindex mblock-move-inline-limit
17409 Inline all block moves (such as calls to @code{memcpy} or structure
17410 copies) less than or equal to @var{num} bytes.  The minimum value for
17411 @var{num} is 32 bytes on 32-bit targets and 64 bytes on 64-bit
17412 targets.  The default value is target-specific.
17414 @item -G @var{num}
17415 @opindex G
17416 @cindex smaller data references (PowerPC)
17417 @cindex .sdata/.sdata2 references (PowerPC)
17418 On embedded PowerPC systems, put global and static items less than or
17419 equal to @var{num} bytes into the small data or BSS sections instead of
17420 the normal data or BSS section.  By default, @var{num} is 8.  The
17421 @option{-G @var{num}} switch is also passed to the linker.
17422 All modules should be compiled with the same @option{-G @var{num}} value.
17424 @item -mregnames
17425 @itemx -mno-regnames
17426 @opindex mregnames
17427 @opindex mno-regnames
17428 On System V.4 and embedded PowerPC systems do (do not) emit register
17429 names in the assembly language output using symbolic forms.
17431 @item -mlongcall
17432 @itemx -mno-longcall
17433 @opindex mlongcall
17434 @opindex mno-longcall
17435 By default assume that all calls are far away so that a longer and more
17436 expensive calling sequence is required.  This is required for calls
17437 farther than 32 megabytes (33,554,432 bytes) from the current location.
17438 A short call is generated if the compiler knows
17439 the call cannot be that far away.  This setting can be overridden by
17440 the @code{shortcall} function attribute, or by @code{#pragma
17441 longcall(0)}.
17443 Some linkers are capable of detecting out-of-range calls and generating
17444 glue code on the fly.  On these systems, long calls are unnecessary and
17445 generate slower code.  As of this writing, the AIX linker can do this,
17446 as can the GNU linker for PowerPC/64.  It is planned to add this feature
17447 to the GNU linker for 32-bit PowerPC systems as well.
17449 On Darwin/PPC systems, @code{#pragma longcall} generates @code{jbsr
17450 callee, L42}, plus a @dfn{branch island} (glue code).  The two target
17451 addresses represent the callee and the branch island.  The
17452 Darwin/PPC linker prefers the first address and generates a @code{bl
17453 callee} if the PPC @code{bl} instruction reaches the callee directly;
17454 otherwise, the linker generates @code{bl L42} to call the branch
17455 island.  The branch island is appended to the body of the
17456 calling function; it computes the full 32-bit address of the callee
17457 and jumps to it.
17459 On Mach-O (Darwin) systems, this option directs the compiler emit to
17460 the glue for every direct call, and the Darwin linker decides whether
17461 to use or discard it.
17463 In the future, GCC may ignore all longcall specifications
17464 when the linker is known to generate glue.
17466 @item -mtls-markers
17467 @itemx -mno-tls-markers
17468 @opindex mtls-markers
17469 @opindex mno-tls-markers
17470 Mark (do not mark) calls to @code{__tls_get_addr} with a relocation
17471 specifying the function argument.  The relocation allows the linker to
17472 reliably associate function call with argument setup instructions for
17473 TLS optimization, which in turn allows GCC to better schedule the
17474 sequence.
17476 @item -pthread
17477 @opindex pthread
17478 Adds support for multithreading with the @dfn{pthreads} library.
17479 This option sets flags for both the preprocessor and linker.
17481 @item -mrecip
17482 @itemx -mno-recip
17483 @opindex mrecip
17484 This option enables use of the reciprocal estimate and
17485 reciprocal square root estimate instructions with additional
17486 Newton-Raphson steps to increase precision instead of doing a divide or
17487 square root and divide for floating-point arguments.  You should use
17488 the @option{-ffast-math} option when using @option{-mrecip} (or at
17489 least @option{-funsafe-math-optimizations},
17490 @option{-finite-math-only}, @option{-freciprocal-math} and
17491 @option{-fno-trapping-math}).  Note that while the throughput of the
17492 sequence is generally higher than the throughput of the non-reciprocal
17493 instruction, the precision of the sequence can be decreased by up to 2
17494 ulp (i.e.@: the inverse of 1.0 equals 0.99999994) for reciprocal square
17495 roots.
17497 @item -mrecip=@var{opt}
17498 @opindex mrecip=opt
17499 This option controls which reciprocal estimate instructions
17500 may be used.  @var{opt} is a comma-separated list of options, which may
17501 be preceded by a @code{!} to invert the option:
17502 @code{all}: enable all estimate instructions,
17503 @code{default}: enable the default instructions, equivalent to @option{-mrecip},
17504 @code{none}: disable all estimate instructions, equivalent to @option{-mno-recip};
17505 @code{div}: enable the reciprocal approximation instructions for both single and double precision;
17506 @code{divf}: enable the single-precision reciprocal approximation instructions;
17507 @code{divd}: enable the double-precision reciprocal approximation instructions;
17508 @code{rsqrt}: enable the reciprocal square root approximation instructions for both single and double precision;
17509 @code{rsqrtf}: enable the single-precision reciprocal square root approximation instructions;
17510 @code{rsqrtd}: enable the double-precision reciprocal square root approximation instructions;
17512 So, for example, @option{-mrecip=all,!rsqrtd} enables
17513 all of the reciprocal estimate instructions, except for the
17514 @code{FRSQRTE}, @code{XSRSQRTEDP}, and @code{XVRSQRTEDP} instructions
17515 which handle the double-precision reciprocal square root calculations.
17517 @item -mrecip-precision
17518 @itemx -mno-recip-precision
17519 @opindex mrecip-precision
17520 Assume (do not assume) that the reciprocal estimate instructions
17521 provide higher-precision estimates than is mandated by the PowerPC
17522 ABI.  Selecting @option{-mcpu=power6} or @option{-mcpu=power7}
17523 automatically selects @option{-mrecip-precision}.  The double-precision 
17524 square root estimate instructions are not generated by
17525 default on low-precision machines, since they do not provide an
17526 estimate that converges after three steps.
17528 @item -mveclibabi=@var{type}
17529 @opindex mveclibabi
17530 Specifies the ABI type to use for vectorizing intrinsics using an
17531 external library.  The only type supported at present is @code{mass},
17532 which specifies to use IBM's Mathematical Acceleration Subsystem
17533 (MASS) libraries for vectorizing intrinsics using external libraries.
17534 GCC currently emits calls to @code{acosd2}, @code{acosf4},
17535 @code{acoshd2}, @code{acoshf4}, @code{asind2}, @code{asinf4},
17536 @code{asinhd2}, @code{asinhf4}, @code{atan2d2}, @code{atan2f4},
17537 @code{atand2}, @code{atanf4}, @code{atanhd2}, @code{atanhf4},
17538 @code{cbrtd2}, @code{cbrtf4}, @code{cosd2}, @code{cosf4},
17539 @code{coshd2}, @code{coshf4}, @code{erfcd2}, @code{erfcf4},
17540 @code{erfd2}, @code{erff4}, @code{exp2d2}, @code{exp2f4},
17541 @code{expd2}, @code{expf4}, @code{expm1d2}, @code{expm1f4},
17542 @code{hypotd2}, @code{hypotf4}, @code{lgammad2}, @code{lgammaf4},
17543 @code{log10d2}, @code{log10f4}, @code{log1pd2}, @code{log1pf4},
17544 @code{log2d2}, @code{log2f4}, @code{logd2}, @code{logf4},
17545 @code{powd2}, @code{powf4}, @code{sind2}, @code{sinf4}, @code{sinhd2},
17546 @code{sinhf4}, @code{sqrtd2}, @code{sqrtf4}, @code{tand2},
17547 @code{tanf4}, @code{tanhd2}, and @code{tanhf4} when generating code
17548 for power7.  Both @option{-ftree-vectorize} and
17549 @option{-funsafe-math-optimizations} must also be enabled.  The MASS
17550 libraries must be specified at link time.
17552 @item -mfriz
17553 @itemx -mno-friz
17554 @opindex mfriz
17555 Generate (do not generate) the @code{friz} instruction when the
17556 @option{-funsafe-math-optimizations} option is used to optimize
17557 rounding of floating-point values to 64-bit integer and back to floating
17558 point.  The @code{friz} instruction does not return the same value if
17559 the floating-point number is too large to fit in an integer.
17561 @item -mpointers-to-nested-functions
17562 @itemx -mno-pointers-to-nested-functions
17563 @opindex mpointers-to-nested-functions
17564 Generate (do not generate) code to load up the static chain register
17565 (@var{r11}) when calling through a pointer on AIX and 64-bit Linux
17566 systems where a function pointer points to a 3-word descriptor giving
17567 the function address, TOC value to be loaded in register @var{r2}, and
17568 static chain value to be loaded in register @var{r11}.  The
17569 @option{-mpointers-to-nested-functions} is on by default.  You cannot
17570 call through pointers to nested functions or pointers
17571 to functions compiled in other languages that use the static chain if
17572 you use the @option{-mno-pointers-to-nested-functions}.
17574 @item -msave-toc-indirect
17575 @itemx -mno-save-toc-indirect
17576 @opindex msave-toc-indirect
17577 Generate (do not generate) code to save the TOC value in the reserved
17578 stack location in the function prologue if the function calls through
17579 a pointer on AIX and 64-bit Linux systems.  If the TOC value is not
17580 saved in the prologue, it is saved just before the call through the
17581 pointer.  The @option{-mno-save-toc-indirect} option is the default.
17582 @end table
17584 @node RX Options
17585 @subsection RX Options
17586 @cindex RX Options
17588 These command-line options are defined for RX targets:
17590 @table @gcctabopt
17591 @item -m64bit-doubles
17592 @itemx -m32bit-doubles
17593 @opindex m64bit-doubles
17594 @opindex m32bit-doubles
17595 Make the @code{double} data type be 64 bits (@option{-m64bit-doubles})
17596 or 32 bits (@option{-m32bit-doubles}) in size.  The default is
17597 @option{-m32bit-doubles}.  @emph{Note} RX floating-point hardware only
17598 works on 32-bit values, which is why the default is
17599 @option{-m32bit-doubles}.
17601 @item -fpu
17602 @itemx -nofpu
17603 @opindex fpu
17604 @opindex nofpu
17605 Enables (@option{-fpu}) or disables (@option{-nofpu}) the use of RX
17606 floating-point hardware.  The default is enabled for the @var{RX600}
17607 series and disabled for the @var{RX200} series.
17609 Floating-point instructions are only generated for 32-bit floating-point 
17610 values, however, so the FPU hardware is not used for doubles if the
17611 @option{-m64bit-doubles} option is used.
17613 @emph{Note} If the @option{-fpu} option is enabled then
17614 @option{-funsafe-math-optimizations} is also enabled automatically.
17615 This is because the RX FPU instructions are themselves unsafe.
17617 @item -mcpu=@var{name}
17618 @opindex -mcpu
17619 Selects the type of RX CPU to be targeted.  Currently three types are
17620 supported, the generic @var{RX600} and @var{RX200} series hardware and
17621 the specific @var{RX610} CPU.  The default is @var{RX600}.
17623 The only difference between @var{RX600} and @var{RX610} is that the
17624 @var{RX610} does not support the @code{MVTIPL} instruction.
17626 The @var{RX200} series does not have a hardware floating-point unit
17627 and so @option{-nofpu} is enabled by default when this type is
17628 selected.
17630 @item -mbig-endian-data
17631 @itemx -mlittle-endian-data
17632 @opindex mbig-endian-data
17633 @opindex mlittle-endian-data
17634 Store data (but not code) in the big-endian format.  The default is
17635 @option{-mlittle-endian-data}, i.e.@: to store data in the little-endian
17636 format.
17638 @item -msmall-data-limit=@var{N}
17639 @opindex msmall-data-limit
17640 Specifies the maximum size in bytes of global and static variables
17641 which can be placed into the small data area.  Using the small data
17642 area can lead to smaller and faster code, but the size of area is
17643 limited and it is up to the programmer to ensure that the area does
17644 not overflow.  Also when the small data area is used one of the RX's
17645 registers (usually @code{r13}) is reserved for use pointing to this
17646 area, so it is no longer available for use by the compiler.  This
17647 could result in slower and/or larger code if variables are pushed onto
17648 the stack instead of being held in this register.
17650 Note, common variables (variables that have not been initialized) and
17651 constants are not placed into the small data area as they are assigned
17652 to other sections in the output executable.
17654 The default value is zero, which disables this feature.  Note, this
17655 feature is not enabled by default with higher optimization levels
17656 (@option{-O2} etc) because of the potentially detrimental effects of
17657 reserving a register.  It is up to the programmer to experiment and
17658 discover whether this feature is of benefit to their program.  See the
17659 description of the @option{-mpid} option for a description of how the
17660 actual register to hold the small data area pointer is chosen.
17662 @item -msim
17663 @itemx -mno-sim
17664 @opindex msim
17665 @opindex mno-sim
17666 Use the simulator runtime.  The default is to use the libgloss
17667 board-specific runtime.
17669 @item -mas100-syntax
17670 @itemx -mno-as100-syntax
17671 @opindex mas100-syntax
17672 @opindex mno-as100-syntax
17673 When generating assembler output use a syntax that is compatible with
17674 Renesas's AS100 assembler.  This syntax can also be handled by the GAS
17675 assembler, but it has some restrictions so it is not generated by default.
17677 @item -mmax-constant-size=@var{N}
17678 @opindex mmax-constant-size
17679 Specifies the maximum size, in bytes, of a constant that can be used as
17680 an operand in a RX instruction.  Although the RX instruction set does
17681 allow constants of up to 4 bytes in length to be used in instructions,
17682 a longer value equates to a longer instruction.  Thus in some
17683 circumstances it can be beneficial to restrict the size of constants
17684 that are used in instructions.  Constants that are too big are instead
17685 placed into a constant pool and referenced via register indirection.
17687 The value @var{N} can be between 0 and 4.  A value of 0 (the default)
17688 or 4 means that constants of any size are allowed.
17690 @item -mrelax
17691 @opindex mrelax
17692 Enable linker relaxation.  Linker relaxation is a process whereby the
17693 linker attempts to reduce the size of a program by finding shorter
17694 versions of various instructions.  Disabled by default.
17696 @item -mint-register=@var{N}
17697 @opindex mint-register
17698 Specify the number of registers to reserve for fast interrupt handler
17699 functions.  The value @var{N} can be between 0 and 4.  A value of 1
17700 means that register @code{r13} is reserved for the exclusive use
17701 of fast interrupt handlers.  A value of 2 reserves @code{r13} and
17702 @code{r12}.  A value of 3 reserves @code{r13}, @code{r12} and
17703 @code{r11}, and a value of 4 reserves @code{r13} through @code{r10}.
17704 A value of 0, the default, does not reserve any registers.
17706 @item -msave-acc-in-interrupts
17707 @opindex msave-acc-in-interrupts
17708 Specifies that interrupt handler functions should preserve the
17709 accumulator register.  This is only necessary if normal code might use
17710 the accumulator register, for example because it performs 64-bit
17711 multiplications.  The default is to ignore the accumulator as this
17712 makes the interrupt handlers faster.
17714 @item -mpid
17715 @itemx -mno-pid
17716 @opindex mpid
17717 @opindex mno-pid
17718 Enables the generation of position independent data.  When enabled any
17719 access to constant data is done via an offset from a base address
17720 held in a register.  This allows the location of constant data to be
17721 determined at run time without requiring the executable to be
17722 relocated, which is a benefit to embedded applications with tight
17723 memory constraints.  Data that can be modified is not affected by this
17724 option.
17726 Note, using this feature reserves a register, usually @code{r13}, for
17727 the constant data base address.  This can result in slower and/or
17728 larger code, especially in complicated functions.
17730 The actual register chosen to hold the constant data base address
17731 depends upon whether the @option{-msmall-data-limit} and/or the
17732 @option{-mint-register} command-line options are enabled.  Starting
17733 with register @code{r13} and proceeding downwards, registers are
17734 allocated first to satisfy the requirements of @option{-mint-register},
17735 then @option{-mpid} and finally @option{-msmall-data-limit}.  Thus it
17736 is possible for the small data area register to be @code{r8} if both
17737 @option{-mint-register=4} and @option{-mpid} are specified on the
17738 command line.
17740 By default this feature is not enabled.  The default can be restored
17741 via the @option{-mno-pid} command-line option.
17743 @end table
17745 @emph{Note:} The generic GCC command-line option @option{-ffixed-@var{reg}}
17746 has special significance to the RX port when used with the
17747 @code{interrupt} function attribute.  This attribute indicates a
17748 function intended to process fast interrupts.  GCC ensures
17749 that it only uses the registers @code{r10}, @code{r11}, @code{r12}
17750 and/or @code{r13} and only provided that the normal use of the
17751 corresponding registers have been restricted via the
17752 @option{-ffixed-@var{reg}} or @option{-mint-register} command-line
17753 options.
17755 @node S/390 and zSeries Options
17756 @subsection S/390 and zSeries Options
17757 @cindex S/390 and zSeries Options
17759 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
17761 @table @gcctabopt
17762 @item -mhard-float
17763 @itemx -msoft-float
17764 @opindex mhard-float
17765 @opindex msoft-float
17766 Use (do not use) the hardware floating-point instructions and registers
17767 for floating-point operations.  When @option{-msoft-float} is specified,
17768 functions in @file{libgcc.a} are used to perform floating-point
17769 operations.  When @option{-mhard-float} is specified, the compiler
17770 generates IEEE floating-point instructions.  This is the default.
17772 @item -mhard-dfp
17773 @itemx -mno-hard-dfp
17774 @opindex mhard-dfp
17775 @opindex mno-hard-dfp
17776 Use (do not use) the hardware decimal-floating-point instructions for
17777 decimal-floating-point operations.  When @option{-mno-hard-dfp} is
17778 specified, functions in @file{libgcc.a} are used to perform
17779 decimal-floating-point operations.  When @option{-mhard-dfp} is
17780 specified, the compiler generates decimal-floating-point hardware
17781 instructions.  This is the default for @option{-march=z9-ec} or higher.
17783 @item -mlong-double-64
17784 @itemx -mlong-double-128
17785 @opindex mlong-double-64
17786 @opindex mlong-double-128
17787 These switches control the size of @code{long double} type. A size
17788 of 64 bits makes the @code{long double} type equivalent to the @code{double}
17789 type. This is the default.
17791 @item -mbackchain
17792 @itemx -mno-backchain
17793 @opindex mbackchain
17794 @opindex mno-backchain
17795 Store (do not store) the address of the caller's frame as backchain pointer
17796 into the callee's stack frame.
17797 A backchain may be needed to allow debugging using tools that do not understand
17798 DWARF 2 call frame information.
17799 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
17800 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
17801 the backchain is placed into the topmost word of the 96/160 byte register
17802 save area.
17804 In general, code compiled with @option{-mbackchain} is call-compatible with
17805 code compiled with @option{-mmo-backchain}; however, use of the backchain
17806 for debugging purposes usually requires that the whole binary is built with
17807 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
17808 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
17809 to build a linux kernel use @option{-msoft-float}.
17811 The default is to not maintain the backchain.
17813 @item -mpacked-stack
17814 @itemx -mno-packed-stack
17815 @opindex mpacked-stack
17816 @opindex mno-packed-stack
17817 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
17818 specified, the compiler uses the all fields of the 96/160 byte register save
17819 area only for their default purpose; unused fields still take up stack space.
17820 When @option{-mpacked-stack} is specified, register save slots are densely
17821 packed at the top of the register save area; unused space is reused for other
17822 purposes, allowing for more efficient use of the available stack space.
17823 However, when @option{-mbackchain} is also in effect, the topmost word of
17824 the save area is always used to store the backchain, and the return address
17825 register is always saved two words below the backchain.
17827 As long as the stack frame backchain is not used, code generated with
17828 @option{-mpacked-stack} is call-compatible with code generated with
17829 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
17830 S/390 or zSeries generated code that uses the stack frame backchain at run
17831 time, not just for debugging purposes.  Such code is not call-compatible
17832 with code compiled with @option{-mpacked-stack}.  Also, note that the
17833 combination of @option{-mbackchain},
17834 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
17835 to build a linux kernel use @option{-msoft-float}.
17837 The default is to not use the packed stack layout.
17839 @item -msmall-exec
17840 @itemx -mno-small-exec
17841 @opindex msmall-exec
17842 @opindex mno-small-exec
17843 Generate (or do not generate) code using the @code{bras} instruction
17844 to do subroutine calls.
17845 This only works reliably if the total executable size does not
17846 exceed 64k.  The default is to use the @code{basr} instruction instead,
17847 which does not have this limitation.
17849 @item -m64
17850 @itemx -m31
17851 @opindex m64
17852 @opindex m31
17853 When @option{-m31} is specified, generate code compliant to the
17854 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
17855 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
17856 particular to generate 64-bit instructions.  For the @samp{s390}
17857 targets, the default is @option{-m31}, while the @samp{s390x}
17858 targets default to @option{-m64}.
17860 @item -mzarch
17861 @itemx -mesa
17862 @opindex mzarch
17863 @opindex mesa
17864 When @option{-mzarch} is specified, generate code using the
17865 instructions available on z/Architecture.
17866 When @option{-mesa} is specified, generate code using the
17867 instructions available on ESA/390.  Note that @option{-mesa} is
17868 not possible with @option{-m64}.
17869 When generating code compliant to the GNU/Linux for S/390 ABI,
17870 the default is @option{-mesa}.  When generating code compliant
17871 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
17873 @item -mmvcle
17874 @itemx -mno-mvcle
17875 @opindex mmvcle
17876 @opindex mno-mvcle
17877 Generate (or do not generate) code using the @code{mvcle} instruction
17878 to perform block moves.  When @option{-mno-mvcle} is specified,
17879 use a @code{mvc} loop instead.  This is the default unless optimizing for
17880 size.
17882 @item -mdebug
17883 @itemx -mno-debug
17884 @opindex mdebug
17885 @opindex mno-debug
17886 Print (or do not print) additional debug information when compiling.
17887 The default is to not print debug information.
17889 @item -march=@var{cpu-type}
17890 @opindex march
17891 Generate code that runs on @var{cpu-type}, which is the name of a system
17892 representing a certain processor type.  Possible values for
17893 @var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, @samp{z990},
17894 @samp{z9-109}, @samp{z9-ec} and @samp{z10}.
17895 When generating code using the instructions available on z/Architecture,
17896 the default is @option{-march=z900}.  Otherwise, the default is
17897 @option{-march=g5}.
17899 @item -mtune=@var{cpu-type}
17900 @opindex mtune
17901 Tune to @var{cpu-type} everything applicable about the generated code,
17902 except for the ABI and the set of available instructions.
17903 The list of @var{cpu-type} values is the same as for @option{-march}.
17904 The default is the value used for @option{-march}.
17906 @item -mtpf-trace
17907 @itemx -mno-tpf-trace
17908 @opindex mtpf-trace
17909 @opindex mno-tpf-trace
17910 Generate code that adds (does not add) in TPF OS specific branches to trace
17911 routines in the operating system.  This option is off by default, even
17912 when compiling for the TPF OS@.
17914 @item -mfused-madd
17915 @itemx -mno-fused-madd
17916 @opindex mfused-madd
17917 @opindex mno-fused-madd
17918 Generate code that uses (does not use) the floating-point multiply and
17919 accumulate instructions.  These instructions are generated by default if
17920 hardware floating point is used.
17922 @item -mwarn-framesize=@var{framesize}
17923 @opindex mwarn-framesize
17924 Emit a warning if the current function exceeds the given frame size.  Because
17925 this is a compile-time check it doesn't need to be a real problem when the program
17926 runs.  It is intended to identify functions that most probably cause
17927 a stack overflow.  It is useful to be used in an environment with limited stack
17928 size e.g.@: the linux kernel.
17930 @item -mwarn-dynamicstack
17931 @opindex mwarn-dynamicstack
17932 Emit a warning if the function calls @code{alloca} or uses dynamically-sized
17933 arrays.  This is generally a bad idea with a limited stack size.
17935 @item -mstack-guard=@var{stack-guard}
17936 @itemx -mstack-size=@var{stack-size}
17937 @opindex mstack-guard
17938 @opindex mstack-size
17939 If these options are provided the S/390 back end emits additional instructions in
17940 the function prologue that trigger a trap if the stack size is @var{stack-guard}
17941 bytes above the @var{stack-size} (remember that the stack on S/390 grows downward).
17942 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
17943 the frame size of the compiled function is chosen.
17944 These options are intended to be used to help debugging stack overflow problems.
17945 The additionally emitted code causes only little overhead and hence can also be
17946 used in production-like systems without greater performance degradation.  The given
17947 values have to be exact powers of 2 and @var{stack-size} has to be greater than
17948 @var{stack-guard} without exceeding 64k.
17949 In order to be efficient the extra code makes the assumption that the stack starts
17950 at an address aligned to the value given by @var{stack-size}.
17951 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
17952 @end table
17954 @node Score Options
17955 @subsection Score Options
17956 @cindex Score Options
17958 These options are defined for Score implementations:
17960 @table @gcctabopt
17961 @item -meb
17962 @opindex meb
17963 Compile code for big-endian mode.  This is the default.
17965 @item -mel
17966 @opindex mel
17967 Compile code for little-endian mode.
17969 @item -mnhwloop
17970 @opindex mnhwloop
17971 Disable generation of @code{bcnz} instructions.
17973 @item -muls
17974 @opindex muls
17975 Enable generation of unaligned load and store instructions.
17977 @item -mmac
17978 @opindex mmac
17979 Enable the use of multiply-accumulate instructions. Disabled by default.
17981 @item -mscore5
17982 @opindex mscore5
17983 Specify the SCORE5 as the target architecture.
17985 @item -mscore5u
17986 @opindex mscore5u
17987 Specify the SCORE5U of the target architecture.
17989 @item -mscore7
17990 @opindex mscore7
17991 Specify the SCORE7 as the target architecture. This is the default.
17993 @item -mscore7d
17994 @opindex mscore7d
17995 Specify the SCORE7D as the target architecture.
17996 @end table
17998 @node SH Options
17999 @subsection SH Options
18001 These @samp{-m} options are defined for the SH implementations:
18003 @table @gcctabopt
18004 @item -m1
18005 @opindex m1
18006 Generate code for the SH1.
18008 @item -m2
18009 @opindex m2
18010 Generate code for the SH2.
18012 @item -m2e
18013 Generate code for the SH2e.
18015 @item -m2a-nofpu
18016 @opindex m2a-nofpu
18017 Generate code for the SH2a without FPU, or for a SH2a-FPU in such a way
18018 that the floating-point unit is not used.
18020 @item -m2a-single-only
18021 @opindex m2a-single-only
18022 Generate code for the SH2a-FPU, in such a way that no double-precision
18023 floating-point operations are used.
18025 @item -m2a-single
18026 @opindex m2a-single
18027 Generate code for the SH2a-FPU assuming the floating-point unit is in
18028 single-precision mode by default.
18030 @item -m2a
18031 @opindex m2a
18032 Generate code for the SH2a-FPU assuming the floating-point unit is in
18033 double-precision mode by default.
18035 @item -m3
18036 @opindex m3
18037 Generate code for the SH3.
18039 @item -m3e
18040 @opindex m3e
18041 Generate code for the SH3e.
18043 @item -m4-nofpu
18044 @opindex m4-nofpu
18045 Generate code for the SH4 without a floating-point unit.
18047 @item -m4-single-only
18048 @opindex m4-single-only
18049 Generate code for the SH4 with a floating-point unit that only
18050 supports single-precision arithmetic.
18052 @item -m4-single
18053 @opindex m4-single
18054 Generate code for the SH4 assuming the floating-point unit is in
18055 single-precision mode by default.
18057 @item -m4
18058 @opindex m4
18059 Generate code for the SH4.
18061 @item -m4a-nofpu
18062 @opindex m4a-nofpu
18063 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
18064 floating-point unit is not used.
18066 @item -m4a-single-only
18067 @opindex m4a-single-only
18068 Generate code for the SH4a, in such a way that no double-precision
18069 floating-point operations are used.
18071 @item -m4a-single
18072 @opindex m4a-single
18073 Generate code for the SH4a assuming the floating-point unit is in
18074 single-precision mode by default.
18076 @item -m4a
18077 @opindex m4a
18078 Generate code for the SH4a.
18080 @item -m4al
18081 @opindex m4al
18082 Same as @option{-m4a-nofpu}, except that it implicitly passes
18083 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
18084 instructions at the moment.
18086 @item -mb
18087 @opindex mb
18088 Compile code for the processor in big-endian mode.
18090 @item -ml
18091 @opindex ml
18092 Compile code for the processor in little-endian mode.
18094 @item -mdalign
18095 @opindex mdalign
18096 Align doubles at 64-bit boundaries.  Note that this changes the calling
18097 conventions, and thus some functions from the standard C library do
18098 not work unless you recompile it first with @option{-mdalign}.
18100 @item -mrelax
18101 @opindex mrelax
18102 Shorten some address references at link time, when possible; uses the
18103 linker option @option{-relax}.
18105 @item -mbigtable
18106 @opindex mbigtable
18107 Use 32-bit offsets in @code{switch} tables.  The default is to use
18108 16-bit offsets.
18110 @item -mbitops
18111 @opindex mbitops
18112 Enable the use of bit manipulation instructions on SH2A.
18114 @item -mfmovd
18115 @opindex mfmovd
18116 Enable the use of the instruction @code{fmovd}.  Check @option{-mdalign} for
18117 alignment constraints.
18119 @item -mhitachi
18120 @opindex mhitachi
18121 Comply with the calling conventions defined by Renesas.
18123 @item -mrenesas
18124 @opindex mhitachi
18125 Comply with the calling conventions defined by Renesas.
18127 @item -mno-renesas
18128 @opindex mhitachi
18129 Comply with the calling conventions defined for GCC before the Renesas
18130 conventions were available.  This option is the default for all
18131 targets of the SH toolchain.
18133 @item -mnomacsave
18134 @opindex mnomacsave
18135 Mark the @code{MAC} register as call-clobbered, even if
18136 @option{-mhitachi} is given.
18138 @item -mieee
18139 @item -mno-ieee
18140 @opindex mieee
18141 @opindex mnoieee
18142 Control the IEEE compliance of floating-point comparisons, which affects the
18143 handling of cases where the result of a comparison is unordered.  By default
18144 @option{-mieee} is implicitly enabled.  If @option{-ffinite-math-only} is
18145 enabled @option{-mno-ieee} is implicitly set, which results in faster
18146 floating-point greater-equal and less-equal comparisons.  The implcit settings
18147 can be overridden by specifying either @option{-mieee} or @option{-mno-ieee}.
18149 @item -minline-ic_invalidate
18150 @opindex minline-ic_invalidate
18151 Inline code to invalidate instruction cache entries after setting up
18152 nested function trampolines.
18153 This option has no effect if @option{-musermode} is in effect and the selected
18154 code generation option (e.g. @option{-m4}) does not allow the use of the @code{icbi}
18155 instruction.
18156 If the selected code generation option does not allow the use of the @code{icbi}
18157 instruction, and @option{-musermode} is not in effect, the inlined code
18158 manipulates the instruction cache address array directly with an associative
18159 write.  This not only requires privileged mode at run time, but it also
18160 fails if the cache line had been mapped via the TLB and has become unmapped.
18162 @item -misize
18163 @opindex misize
18164 Dump instruction size and location in the assembly code.
18166 @item -mpadstruct
18167 @opindex mpadstruct
18168 This option is deprecated.  It pads structures to multiple of 4 bytes,
18169 which is incompatible with the SH ABI@.
18171 @item -msoft-atomic
18172 @opindex msoft-atomic
18173 Generate GNU/Linux compatible gUSA software atomic sequences for the atomic
18174 built-in functions.  The generated atomic sequences require support from the 
18175 interrupt / exception handling code of the system and are only suitable for
18176 single-core systems.  They will not operate correctly on multi-core systems.
18177 This option is enabled by default when the target is @code{sh-*-linux*}.
18178 When the target is SH4A, this option will also partially utilize the hardware
18179 atomic instructions @code{movli.l} and @code{movco.l} to create more
18180 efficient code.
18181 For details on the atomic built-in functions see @ref{__atomic Builtins}.
18183 @item -mhard-atomic
18184 @opindex hard-atomic
18185 Generate hardware atomic sequences for the atomic built-in functions.  This
18186 is only available on SH4A and is suitable for multi-core systems.  Code
18187 compiled with this option will also be compatible with gUSA aware
18188 interrupt / exception handling systems.  In contrast to the
18189 @option{-msoft-atomic} option this will only use the instructions
18190 @code{movli.l} and @code{movco.l} to create atomic sequences.
18192 @item -mtas
18193 @opindex mtas
18194 Generate the @code{tas.b} opcode for @code{__atomic_test_and_set}.
18195 Notice that depending on the particular hardware and software configuration
18196 this can degrade overall performance due to the operand cache line flushes
18197 that are implied by the @code{tas.b} instruction.  On multi-core SH4A
18198 processors the @code{tas.b} instruction must be used with caution since it
18199 can result in data corruption for certain cache configurations.
18201 @item -mspace
18202 @opindex mspace
18203 Optimize for space instead of speed.  Implied by @option{-Os}.
18205 @item -mprefergot
18206 @opindex mprefergot
18207 When generating position-independent code, emit function calls using
18208 the Global Offset Table instead of the Procedure Linkage Table.
18210 @item -musermode
18211 @opindex musermode
18212 Don't generate privileged mode only code.  This option
18213 implies @option{-mno-inline-ic_invalidate}
18214 if the inlined code would not work in user mode.
18215 This is the default when the target is @code{sh-*-linux*}.
18217 @item -multcost=@var{number}
18218 @opindex multcost=@var{number}
18219 Set the cost to assume for a multiply insn.
18221 @item -mdiv=@var{strategy}
18222 @opindex mdiv=@var{strategy}
18223 Set the division strategy to use for SHmedia code.  @var{strategy} must be
18224 one of: 
18226 @table @samp
18228 @item fp 
18229 Performs the operation in floating point.  This has a very high latency,
18230 but needs only a few instructions, so it might be a good choice if
18231 your code has enough easily-exploitable ILP to allow the compiler to
18232 schedule the floating-point instructions together with other instructions.
18233 Division by zero causes a floating-point exception.
18235 @item inv
18236 Uses integer operations to calculate the inverse of the divisor,
18237 and then multiplies the dividend with the inverse.  This strategy allows
18238 CSE and hoisting of the inverse calculation.  Division by zero calculates
18239 an unspecified result, but does not trap.
18241 @item inv:minlat
18242 A variant of @samp{inv} where, if no CSE or hoisting opportunities
18243 have been found, or if the entire operation has been hoisted to the same
18244 place, the last stages of the inverse calculation are intertwined with the
18245 final multiply to reduce the overall latency, at the expense of using a few
18246 more instructions, and thus offering fewer scheduling opportunities with
18247 other code.
18249 @item call
18250 Calls a library function that usually implements the @samp{inv:minlat}
18251 strategy.
18252 This gives high code density for @code{m5-*media-nofpu} compilations.
18254 @item call2
18255 Uses a different entry point of the same library function, where it
18256 assumes that a pointer to a lookup table has already been set up, which
18257 exposes the pointer load to CSE and code hoisting optimizations.
18259 @item inv:call
18260 @itemx inv:call2
18261 @itemx inv:fp
18262 Use the @samp{inv} algorithm for initial
18263 code generation, but if the code stays unoptimized, revert to the @samp{call},
18264 @samp{call2}, or @samp{fp} strategies, respectively.  Note that the
18265 potentially-trapping side effect of division by zero is carried by a
18266 separate instruction, so it is possible that all the integer instructions
18267 are hoisted out, but the marker for the side effect stays where it is.
18268 A recombination to floating-point operations or a call is not possible
18269 in that case.
18271 @item inv20u
18272 @itemx inv20l
18273 Variants of the @samp{inv:minlat} strategy.  In the case
18274 that the inverse calculation is not separated from the multiply, they speed
18275 up division where the dividend fits into 20 bits (plus sign where applicable)
18276 by inserting a test to skip a number of operations in this case; this test
18277 slows down the case of larger dividends.  @samp{inv20u} assumes the case of a such
18278 a small dividend to be unlikely, and @samp{inv20l} assumes it to be likely.
18280 @end table
18282 @item -maccumulate-outgoing-args
18283 @opindex maccumulate-outgoing-args
18284 Reserve space once for outgoing arguments in the function prologue rather
18285 than around each call.  Generally beneficial for performance and size.  Also
18286 needed for unwinding to avoid changing the stack frame around conditional code.
18288 @item -mdivsi3_libfunc=@var{name}
18289 @opindex mdivsi3_libfunc=@var{name}
18290 Set the name of the library function used for 32-bit signed division to
18291 @var{name}.
18292 This only affects the name used in the @samp{call} and @samp{inv:call}
18293 division strategies, and the compiler still expects the same
18294 sets of input/output/clobbered registers as if this option were not present.
18296 @item -mfixed-range=@var{register-range}
18297 @opindex mfixed-range
18298 Generate code treating the given register range as fixed registers.
18299 A fixed register is one that the register allocator can not use.  This is
18300 useful when compiling kernel code.  A register range is specified as
18301 two registers separated by a dash.  Multiple register ranges can be
18302 specified separated by a comma.
18304 @item -mindexed-addressing
18305 @opindex mindexed-addressing
18306 Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
18307 This is only safe if the hardware and/or OS implement 32-bit wrap-around
18308 semantics for the indexed addressing mode.  The architecture allows the
18309 implementation of processors with 64-bit MMU, which the OS could use to
18310 get 32-bit addressing, but since no current hardware implementation supports
18311 this or any other way to make the indexed addressing mode safe to use in
18312 the 32-bit ABI, the default is @option{-mno-indexed-addressing}.
18314 @item -mgettrcost=@var{number}
18315 @opindex mgettrcost=@var{number}
18316 Set the cost assumed for the @code{gettr} instruction to @var{number}.
18317 The default is 2 if @option{-mpt-fixed} is in effect, 100 otherwise.
18319 @item -mpt-fixed
18320 @opindex mpt-fixed
18321 Assume @code{pt*} instructions won't trap.  This generally generates
18322 better-scheduled code, but is unsafe on current hardware.
18323 The current architecture
18324 definition says that @code{ptabs} and @code{ptrel} trap when the target 
18325 anded with 3 is 3.
18326 This has the unintentional effect of making it unsafe to schedule these
18327 instructions before a branch, or hoist them out of a loop.  For example,
18328 @code{__do_global_ctors}, a part of @file{libgcc}
18329 that runs constructors at program
18330 startup, calls functions in a list which is delimited by @minus{}1.  With the
18331 @option{-mpt-fixed} option, the @code{ptabs} is done before testing against @minus{}1.
18332 That means that all the constructors run a bit more quickly, but when
18333 the loop comes to the end of the list, the program crashes because @code{ptabs}
18334 loads @minus{}1 into a target register.  
18336 Since this option is unsafe for any
18337 hardware implementing the current architecture specification, the default
18338 is @option{-mno-pt-fixed}.  Unless specified explicitly with 
18339 @option{-mgettrcost}, @option{-mno-pt-fixed} also implies @option{-mgettrcost=100};
18340 this deters register allocation from using target registers for storing
18341 ordinary integers.
18343 @item -minvalid-symbols
18344 @opindex minvalid-symbols
18345 Assume symbols might be invalid.  Ordinary function symbols generated by
18346 the compiler are always valid to load with
18347 @code{movi}/@code{shori}/@code{ptabs} or
18348 @code{movi}/@code{shori}/@code{ptrel},
18349 but with assembler and/or linker tricks it is possible
18350 to generate symbols that cause @code{ptabs} or @code{ptrel} to trap.
18351 This option is only meaningful when @option{-mno-pt-fixed} is in effect.
18352 It prevents cross-basic-block CSE, hoisting and most scheduling
18353 of symbol loads.  The default is @option{-mno-invalid-symbols}.
18355 @item -mbranch-cost=@var{num}
18356 @opindex mbranch-cost=@var{num}
18357 Assume @var{num} to be the cost for a branch instruction.  Higher numbers
18358 make the compiler try to generate more branch-free code if possible.  
18359 If not specified the value is selected depending on the processor type that
18360 is being compiled for.
18362 @item -mzdcbranch
18363 @itemx -mno-zdcbranch
18364 @opindex mzdcbranch
18365 @opindex mno-zdcbranch
18366 Assume (do not assume) that zero displacement conditional branch instructions
18367 @code{bt} and @code{bf} are fast.  If @option{-mzdcbranch} is specified, the
18368 compiler will try to prefer zero displacement branch code sequences.  This is
18369 enabled by default when generating code for SH4 and SH4A.  It can be explicitly
18370 disabled by specifying @option{-mno-zdcbranch}.
18372 @item -mcbranchdi
18373 @opindex mcbranchdi
18374 Enable the @code{cbranchdi4} instruction pattern.
18376 @item -mcmpeqdi
18377 @opindex mcmpeqdi
18378 Emit the @code{cmpeqdi_t} instruction pattern even when @option{-mcbranchdi}
18379 is in effect.
18381 @item -mfused-madd
18382 @itemx -mno-fused-madd
18383 @opindex mfused-madd
18384 @opindex mno-fused-madd
18385 Generate code that uses (does not use) the floating-point multiply and
18386 accumulate instructions.  These instructions are generated by default
18387 if hardware floating point is used.  The machine-dependent
18388 @option{-mfused-madd} option is now mapped to the machine-independent
18389 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
18390 mapped to @option{-ffp-contract=off}.
18392 @item -mfsca
18393 @itemx -mno-fsca
18394 @opindex mfsca
18395 @opindex mno-fsca
18396 Allow or disallow the compiler to emit the @code{fsca} instruction for sine
18397 and cosine approximations.  The option @code{-mfsca} must be used in
18398 combination with @code{-funsafe-math-optimizations}.  It is enabled by default
18399 when generating code for SH4A.  Using @code{-mno-fsca} disables sine and cosine
18400 approximations even if @code{-funsafe-math-optimizations} is in effect.
18402 @item -mfsrra
18403 @itemx -mno-fsrra
18404 @opindex mfsrra
18405 @opindex mno-fsrra
18406 Allow or disallow the compiler to emit the @code{fsrra} instruction for
18407 reciprocal square root approximations.  The option @code{-mfsrra} must be used
18408 in combination with @code{-funsafe-math-optimizations} and
18409 @code{-ffinite-math-only}.  It is enabled by default when generating code for
18410 SH4A.  Using @code{-mno-fsrra} disables reciprocal square root approximations
18411 even if @code{-funsafe-math-optimizations} and @code{-ffinite-math-only} are
18412 in effect.
18414 @item -mpretend-cmove
18415 @opindex mpretend-cmove
18416 Prefer zero-displacement conditional branches for conditional move instruction
18417 patterns.  This can result in faster code on the SH4 processor.
18419 @end table
18421 @node Solaris 2 Options
18422 @subsection Solaris 2 Options
18423 @cindex Solaris 2 options
18425 These @samp{-m} options are supported on Solaris 2:
18427 @table @gcctabopt
18428 @item -mimpure-text
18429 @opindex mimpure-text
18430 @option{-mimpure-text}, used in addition to @option{-shared}, tells
18431 the compiler to not pass @option{-z text} to the linker when linking a
18432 shared object.  Using this option, you can link position-dependent
18433 code into a shared object.
18435 @option{-mimpure-text} suppresses the ``relocations remain against
18436 allocatable but non-writable sections'' linker error message.
18437 However, the necessary relocations trigger copy-on-write, and the
18438 shared object is not actually shared across processes.  Instead of
18439 using @option{-mimpure-text}, you should compile all source code with
18440 @option{-fpic} or @option{-fPIC}.
18442 @end table
18444 These switches are supported in addition to the above on Solaris 2:
18446 @table @gcctabopt
18447 @item -pthreads
18448 @opindex pthreads
18449 Add support for multithreading using the POSIX threads library.  This
18450 option sets flags for both the preprocessor and linker.  This option does
18451 not affect the thread safety of object code produced  by the compiler or
18452 that of libraries supplied with it.
18454 @item -pthread
18455 @opindex pthread
18456 This is a synonym for @option{-pthreads}.
18457 @end table
18459 @node SPARC Options
18460 @subsection SPARC Options
18461 @cindex SPARC options
18463 These @samp{-m} options are supported on the SPARC:
18465 @table @gcctabopt
18466 @item -mno-app-regs
18467 @itemx -mapp-regs
18468 @opindex mno-app-regs
18469 @opindex mapp-regs
18470 Specify @option{-mapp-regs} to generate output using the global registers
18471 2 through 4, which the SPARC SVR4 ABI reserves for applications.  This
18472 is the default.
18474 To be fully SVR4 ABI-compliant at the cost of some performance loss,
18475 specify @option{-mno-app-regs}.  You should compile libraries and system
18476 software with this option.
18478 @item -mflat
18479 @itemx -mno-flat
18480 @opindex mflat
18481 @opindex mno-flat
18482 With @option{-mflat}, the compiler does not generate save/restore instructions
18483 and uses a ``flat'' or single register window model.  This model is compatible
18484 with the regular register window model.  The local registers and the input
18485 registers (0--5) are still treated as ``call-saved'' registers and are
18486 saved on the stack as needed.
18488 With @option{-mno-flat} (the default), the compiler generates save/restore
18489 instructions (except for leaf functions).  This is the normal operating mode.
18491 @item -mfpu
18492 @itemx -mhard-float
18493 @opindex mfpu
18494 @opindex mhard-float
18495 Generate output containing floating-point instructions.  This is the
18496 default.
18498 @item -mno-fpu
18499 @itemx -msoft-float
18500 @opindex mno-fpu
18501 @opindex msoft-float
18502 Generate output containing library calls for floating point.
18503 @strong{Warning:} the requisite libraries are not available for all SPARC
18504 targets.  Normally the facilities of the machine's usual C compiler are
18505 used, but this cannot be done directly in cross-compilation.  You must make
18506 your own arrangements to provide suitable library functions for
18507 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
18508 @samp{sparclite-*-*} do provide software floating-point support.
18510 @option{-msoft-float} changes the calling convention in the output file;
18511 therefore, it is only useful if you compile @emph{all} of a program with
18512 this option.  In particular, you need to compile @file{libgcc.a}, the
18513 library that comes with GCC, with @option{-msoft-float} in order for
18514 this to work.
18516 @item -mhard-quad-float
18517 @opindex mhard-quad-float
18518 Generate output containing quad-word (long double) floating-point
18519 instructions.
18521 @item -msoft-quad-float
18522 @opindex msoft-quad-float
18523 Generate output containing library calls for quad-word (long double)
18524 floating-point instructions.  The functions called are those specified
18525 in the SPARC ABI@.  This is the default.
18527 As of this writing, there are no SPARC implementations that have hardware
18528 support for the quad-word floating-point instructions.  They all invoke
18529 a trap handler for one of these instructions, and then the trap handler
18530 emulates the effect of the instruction.  Because of the trap handler overhead,
18531 this is much slower than calling the ABI library routines.  Thus the
18532 @option{-msoft-quad-float} option is the default.
18534 @item -mno-unaligned-doubles
18535 @itemx -munaligned-doubles
18536 @opindex mno-unaligned-doubles
18537 @opindex munaligned-doubles
18538 Assume that doubles have 8-byte alignment.  This is the default.
18540 With @option{-munaligned-doubles}, GCC assumes that doubles have 8-byte
18541 alignment only if they are contained in another type, or if they have an
18542 absolute address.  Otherwise, it assumes they have 4-byte alignment.
18543 Specifying this option avoids some rare compatibility problems with code
18544 generated by other compilers.  It is not the default because it results
18545 in a performance loss, especially for floating-point code.
18547 @item -mno-faster-structs
18548 @itemx -mfaster-structs
18549 @opindex mno-faster-structs
18550 @opindex mfaster-structs
18551 With @option{-mfaster-structs}, the compiler assumes that structures
18552 should have 8-byte alignment.  This enables the use of pairs of
18553 @code{ldd} and @code{std} instructions for copies in structure
18554 assignment, in place of twice as many @code{ld} and @code{st} pairs.
18555 However, the use of this changed alignment directly violates the SPARC
18556 ABI@.  Thus, it's intended only for use on targets where the developer
18557 acknowledges that their resulting code is not directly in line with
18558 the rules of the ABI@.
18560 @item -mcpu=@var{cpu_type}
18561 @opindex mcpu
18562 Set the instruction set, register set, and instruction scheduling parameters
18563 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
18564 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{hypersparc},
18565 @samp{leon}, @samp{sparclite}, @samp{f930}, @samp{f934}, @samp{sparclite86x},
18566 @samp{sparclet}, @samp{tsc701}, @samp{v9}, @samp{ultrasparc},
18567 @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2}, @samp{niagara3},
18568 and @samp{niagara4}.
18570 Native Solaris and GNU/Linux toolchains also support the value @samp{native},
18571 which selects the best architecture option for the host processor.
18572 @option{-mcpu=native} has no effect if GCC does not recognize
18573 the processor.
18575 Default instruction scheduling parameters are used for values that select
18576 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
18577 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
18579 Here is a list of each supported architecture and their supported
18580 implementations.
18582 @table @asis
18583 @item v7
18584 cypress
18586 @item v8
18587 supersparc, hypersparc, leon
18589 @item sparclite
18590 f930, f934, sparclite86x
18592 @item sparclet
18593 tsc701
18595 @item v9
18596 ultrasparc, ultrasparc3, niagara, niagara2, niagara3, niagara4
18597 @end table
18599 By default (unless configured otherwise), GCC generates code for the V7
18600 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
18601 additionally optimizes it for the Cypress CY7C602 chip, as used in the
18602 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
18603 SPARCStation 1, 2, IPX etc.
18605 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
18606 architecture.  The only difference from V7 code is that the compiler emits
18607 the integer multiply and integer divide instructions which exist in SPARC-V8
18608 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
18609 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
18610 2000 series.
18612 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
18613 the SPARC architecture.  This adds the integer multiply, integer divide step
18614 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
18615 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
18616 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
18617 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
18618 MB86934 chip, which is the more recent SPARClite with FPU@.
18620 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
18621 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
18622 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
18623 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
18624 optimizes it for the TEMIC SPARClet chip.
18626 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
18627 architecture.  This adds 64-bit integer and floating-point move instructions,
18628 3 additional floating-point condition code registers and conditional move
18629 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
18630 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
18631 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
18632 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
18633 @option{-mcpu=niagara}, the compiler additionally optimizes it for
18634 Sun UltraSPARC T1 chips.  With @option{-mcpu=niagara2}, the compiler
18635 additionally optimizes it for Sun UltraSPARC T2 chips. With
18636 @option{-mcpu=niagara3}, the compiler additionally optimizes it for Sun
18637 UltraSPARC T3 chips.  With @option{-mcpu=niagara4}, the compiler
18638 additionally optimizes it for Sun UltraSPARC T4 chips.
18640 @item -mtune=@var{cpu_type}
18641 @opindex mtune
18642 Set the instruction scheduling parameters for machine type
18643 @var{cpu_type}, but do not set the instruction set or register set that the
18644 option @option{-mcpu=@var{cpu_type}} does.
18646 The same values for @option{-mcpu=@var{cpu_type}} can be used for
18647 @option{-mtune=@var{cpu_type}}, but the only useful values are those
18648 that select a particular CPU implementation.  Those are @samp{cypress},
18649 @samp{supersparc}, @samp{hypersparc}, @samp{leon}, @samp{f930}, @samp{f934},
18650 @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc}, @samp{ultrasparc3},
18651 @samp{niagara}, @samp{niagara2}, @samp{niagara3} and @samp{niagara4}.  With
18652 native Solaris and GNU/Linux toolchains, @samp{native} can also be used.
18654 @item -mv8plus
18655 @itemx -mno-v8plus
18656 @opindex mv8plus
18657 @opindex mno-v8plus
18658 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
18659 difference from the V8 ABI is that the global and out registers are
18660 considered 64 bits wide.  This is enabled by default on Solaris in 32-bit
18661 mode for all SPARC-V9 processors.
18663 @item -mvis
18664 @itemx -mno-vis
18665 @opindex mvis
18666 @opindex mno-vis
18667 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
18668 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
18670 @item -mvis2
18671 @itemx -mno-vis2
18672 @opindex mvis2
18673 @opindex mno-vis2
18674 With @option{-mvis2}, GCC generates code that takes advantage of
18675 version 2.0 of the UltraSPARC Visual Instruction Set extensions.  The
18676 default is @option{-mvis2} when targeting a cpu that supports such
18677 instructions, such as UltraSPARC-III and later.  Setting @option{-mvis2}
18678 also sets @option{-mvis}.
18680 @item -mvis3
18681 @itemx -mno-vis3
18682 @opindex mvis3
18683 @opindex mno-vis3
18684 With @option{-mvis3}, GCC generates code that takes advantage of
18685 version 3.0 of the UltraSPARC Visual Instruction Set extensions.  The
18686 default is @option{-mvis3} when targeting a cpu that supports such
18687 instructions, such as niagara-3 and later.  Setting @option{-mvis3}
18688 also sets @option{-mvis2} and @option{-mvis}.
18690 @item -mpopc
18691 @itemx -mno-popc
18692 @opindex mpopc
18693 @opindex mno-popc
18694 With @option{-mpopc}, GCC generates code that takes advantage of the UltraSPARC
18695 population count instruction.  The default is @option{-mpopc}
18696 when targeting a cpu that supports such instructions, such as Niagara-2 and
18697 later.
18699 @item -mfmaf
18700 @itemx -mno-fmaf
18701 @opindex mfmaf
18702 @opindex mno-fmaf
18703 With @option{-mfmaf}, GCC generates code that takes advantage of the UltraSPARC
18704 Fused Multiply-Add Floating-point extensions.  The default is @option{-mfmaf}
18705 when targeting a cpu that supports such instructions, such as Niagara-3 and
18706 later.
18708 @item -mfix-at697f
18709 @opindex mfix-at697f
18710 Enable the documented workaround for the single erratum of the Atmel AT697F
18711 processor (which corresponds to erratum #13 of the AT697E processor).
18712 @end table
18714 These @samp{-m} options are supported in addition to the above
18715 on SPARC-V9 processors in 64-bit environments:
18717 @table @gcctabopt
18718 @item -mlittle-endian
18719 @opindex mlittle-endian
18720 Generate code for a processor running in little-endian mode.  It is only
18721 available for a few configurations and most notably not on Solaris and Linux.
18723 @item -m32
18724 @itemx -m64
18725 @opindex m32
18726 @opindex m64
18727 Generate code for a 32-bit or 64-bit environment.
18728 The 32-bit environment sets int, long and pointer to 32 bits.
18729 The 64-bit environment sets int to 32 bits and long and pointer
18730 to 64 bits.
18732 @item -mcmodel=@var{which}
18733 @opindex mcmodel
18734 Set the code model to one of
18736 @table @samp
18737 @item medlow
18738 The Medium/Low code model: 64-bit addresses, programs
18739 must be linked in the low 32 bits of memory.  Programs can be statically
18740 or dynamically linked.
18742 @item medmid
18743 The Medium/Middle code model: 64-bit addresses, programs
18744 must be linked in the low 44 bits of memory, the text and data segments must
18745 be less than 2GB in size and the data segment must be located within 2GB of
18746 the text segment.
18748 @item medany
18749 The Medium/Anywhere code model: 64-bit addresses, programs
18750 may be linked anywhere in memory, the text and data segments must be less
18751 than 2GB in size and the data segment must be located within 2GB of the
18752 text segment.
18754 @item embmedany
18755 The Medium/Anywhere code model for embedded systems:
18756 64-bit addresses, the text and data segments must be less than 2GB in
18757 size, both starting anywhere in memory (determined at link time).  The
18758 global register %g4 points to the base of the data segment.  Programs
18759 are statically linked and PIC is not supported.
18760 @end table
18762 @item -mmemory-model=@var{mem-model}
18763 @opindex mmemory-model
18764 Set the memory model in force on the processor to one of
18766 @table @samp
18767 @item default
18768 The default memory model for the processor and operating system.
18770 @item rmo
18771 Relaxed Memory Order
18773 @item pso
18774 Partial Store Order
18776 @item tso
18777 Total Store Order
18779 @item sc
18780 Sequential Consistency
18781 @end table
18783 These memory models are formally defined in Appendix D of the Sparc V9
18784 architecture manual, as set in the processor's @code{PSTATE.MM} field.
18786 @item -mstack-bias
18787 @itemx -mno-stack-bias
18788 @opindex mstack-bias
18789 @opindex mno-stack-bias
18790 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
18791 frame pointer if present, are offset by @minus{}2047 which must be added back
18792 when making stack frame references.  This is the default in 64-bit mode.
18793 Otherwise, assume no such offset is present.
18794 @end table
18796 @node SPU Options
18797 @subsection SPU Options
18798 @cindex SPU options
18800 These @samp{-m} options are supported on the SPU:
18802 @table @gcctabopt
18803 @item -mwarn-reloc
18804 @itemx -merror-reloc
18805 @opindex mwarn-reloc
18806 @opindex merror-reloc
18808 The loader for SPU does not handle dynamic relocations.  By default, GCC
18809 gives an error when it generates code that requires a dynamic
18810 relocation.  @option{-mno-error-reloc} disables the error,
18811 @option{-mwarn-reloc} generates a warning instead.
18813 @item -msafe-dma
18814 @itemx -munsafe-dma
18815 @opindex msafe-dma
18816 @opindex munsafe-dma
18818 Instructions that initiate or test completion of DMA must not be
18819 reordered with respect to loads and stores of the memory that is being
18820 accessed.
18821 With @option{-munsafe-dma} you must use the @code{volatile} keyword to protect
18822 memory accesses, but that can lead to inefficient code in places where the
18823 memory is known to not change.  Rather than mark the memory as volatile,
18824 you can use @option{-msafe-dma} to tell the compiler to treat
18825 the DMA instructions as potentially affecting all memory.  
18827 @item -mbranch-hints
18828 @opindex mbranch-hints
18830 By default, GCC generates a branch hint instruction to avoid
18831 pipeline stalls for always-taken or probably-taken branches.  A hint
18832 is not generated closer than 8 instructions away from its branch.
18833 There is little reason to disable them, except for debugging purposes,
18834 or to make an object a little bit smaller.
18836 @item -msmall-mem
18837 @itemx -mlarge-mem
18838 @opindex msmall-mem
18839 @opindex mlarge-mem
18841 By default, GCC generates code assuming that addresses are never larger
18842 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
18843 a full 32-bit address.
18845 @item -mstdmain
18846 @opindex mstdmain
18848 By default, GCC links against startup code that assumes the SPU-style
18849 main function interface (which has an unconventional parameter list).
18850 With @option{-mstdmain}, GCC links your program against startup
18851 code that assumes a C99-style interface to @code{main}, including a
18852 local copy of @code{argv} strings.
18854 @item -mfixed-range=@var{register-range}
18855 @opindex mfixed-range
18856 Generate code treating the given register range as fixed registers.
18857 A fixed register is one that the register allocator cannot use.  This is
18858 useful when compiling kernel code.  A register range is specified as
18859 two registers separated by a dash.  Multiple register ranges can be
18860 specified separated by a comma.
18862 @item -mea32
18863 @itemx -mea64
18864 @opindex mea32
18865 @opindex mea64
18866 Compile code assuming that pointers to the PPU address space accessed
18867 via the @code{__ea} named address space qualifier are either 32 or 64
18868 bits wide.  The default is 32 bits.  As this is an ABI-changing option,
18869 all object code in an executable must be compiled with the same setting.
18871 @item -maddress-space-conversion
18872 @itemx -mno-address-space-conversion
18873 @opindex maddress-space-conversion
18874 @opindex mno-address-space-conversion
18875 Allow/disallow treating the @code{__ea} address space as superset
18876 of the generic address space.  This enables explicit type casts
18877 between @code{__ea} and generic pointer as well as implicit
18878 conversions of generic pointers to @code{__ea} pointers.  The
18879 default is to allow address space pointer conversions.
18881 @item -mcache-size=@var{cache-size}
18882 @opindex mcache-size
18883 This option controls the version of libgcc that the compiler links to an
18884 executable and selects a software-managed cache for accessing variables
18885 in the @code{__ea} address space with a particular cache size.  Possible
18886 options for @var{cache-size} are @samp{8}, @samp{16}, @samp{32}, @samp{64}
18887 and @samp{128}.  The default cache size is 64KB.
18889 @item -matomic-updates
18890 @itemx -mno-atomic-updates
18891 @opindex matomic-updates
18892 @opindex mno-atomic-updates
18893 This option controls the version of libgcc that the compiler links to an
18894 executable and selects whether atomic updates to the software-managed
18895 cache of PPU-side variables are used.  If you use atomic updates, changes
18896 to a PPU variable from SPU code using the @code{__ea} named address space
18897 qualifier do not interfere with changes to other PPU variables residing
18898 in the same cache line from PPU code.  If you do not use atomic updates,
18899 such interference may occur; however, writing back cache lines is
18900 more efficient.  The default behavior is to use atomic updates.
18902 @item -mdual-nops
18903 @itemx -mdual-nops=@var{n}
18904 @opindex mdual-nops
18905 By default, GCC inserts nops to increase dual issue when it expects
18906 it to increase performance.  @var{n} can be a value from 0 to 10.  A
18907 smaller @var{n} inserts fewer nops.  10 is the default, 0 is the
18908 same as @option{-mno-dual-nops}.  Disabled with @option{-Os}.
18910 @item -mhint-max-nops=@var{n}
18911 @opindex mhint-max-nops
18912 Maximum number of nops to insert for a branch hint.  A branch hint must
18913 be at least 8 instructions away from the branch it is affecting.  GCC
18914 inserts up to @var{n} nops to enforce this, otherwise it does not
18915 generate the branch hint.
18917 @item -mhint-max-distance=@var{n}
18918 @opindex mhint-max-distance
18919 The encoding of the branch hint instruction limits the hint to be within
18920 256 instructions of the branch it is affecting.  By default, GCC makes
18921 sure it is within 125.
18923 @item -msafe-hints
18924 @opindex msafe-hints
18925 Work around a hardware bug that causes the SPU to stall indefinitely.
18926 By default, GCC inserts the @code{hbrp} instruction to make sure
18927 this stall won't happen.
18929 @end table
18931 @node System V Options
18932 @subsection Options for System V
18934 These additional options are available on System V Release 4 for
18935 compatibility with other compilers on those systems:
18937 @table @gcctabopt
18938 @item -G
18939 @opindex G
18940 Create a shared object.
18941 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
18943 @item -Qy
18944 @opindex Qy
18945 Identify the versions of each tool used by the compiler, in a
18946 @code{.ident} assembler directive in the output.
18948 @item -Qn
18949 @opindex Qn
18950 Refrain from adding @code{.ident} directives to the output file (this is
18951 the default).
18953 @item -YP,@var{dirs}
18954 @opindex YP
18955 Search the directories @var{dirs}, and no others, for libraries
18956 specified with @option{-l}.
18958 @item -Ym,@var{dir}
18959 @opindex Ym
18960 Look in the directory @var{dir} to find the M4 preprocessor.
18961 The assembler uses this option.
18962 @c This is supposed to go with a -Yd for predefined M4 macro files, but
18963 @c the generic assembler that comes with Solaris takes just -Ym.
18964 @end table
18966 @node TILE-Gx Options
18967 @subsection TILE-Gx Options
18968 @cindex TILE-Gx options
18970 These @samp{-m} options are supported on the TILE-Gx:
18972 @table @gcctabopt
18973 @item -mcmodel=small
18974 @opindex mcmodel=small
18975 Generate code for the small model.  Distance for direct calls is
18976 limited to 500M in either direction.  PC-relative addresses are 32
18977 bits.  Absolute addresses support the full address range.
18979 @item -mcmodel=large
18980 @opindex mcmodel=large
18981 Generate code for the large model.  There is no limiation on call
18982 distance, pc-relative addresses, or absolute addresses.
18984 @item -mcpu=@var{name}
18985 @opindex mcpu
18986 Selects the type of CPU to be targeted.  Currently the only supported
18987 type is @samp{tilegx}.
18989 @item -m32
18990 @itemx -m64
18991 @opindex m32
18992 @opindex m64
18993 Generate code for a 32-bit or 64-bit environment.  The 32-bit
18994 environment sets int, long, and pointer to 32 bits.  The 64-bit
18995 environment sets int to 32 bits and long and pointer to 64 bits.
18996 @end table
18998 @node TILEPro Options
18999 @subsection TILEPro Options
19000 @cindex TILEPro options
19002 These @samp{-m} options are supported on the TILEPro:
19004 @table @gcctabopt
19005 @item -mcpu=@var{name}
19006 @opindex mcpu
19007 Selects the type of CPU to be targeted.  Currently the only supported
19008 type is @samp{tilepro}.
19010 @item -m32
19011 @opindex m32
19012 Generate code for a 32-bit environment, which sets int, long, and
19013 pointer to 32 bits.  This is the only supported behavior so the flag
19014 is essentially ignored.
19015 @end table
19017 @node V850 Options
19018 @subsection V850 Options
19019 @cindex V850 Options
19021 These @samp{-m} options are defined for V850 implementations:
19023 @table @gcctabopt
19024 @item -mlong-calls
19025 @itemx -mno-long-calls
19026 @opindex mlong-calls
19027 @opindex mno-long-calls
19028 Treat all calls as being far away (near).  If calls are assumed to be
19029 far away, the compiler always loads the function's address into a
19030 register, and calls indirect through the pointer.
19032 @item -mno-ep
19033 @itemx -mep
19034 @opindex mno-ep
19035 @opindex mep
19036 Do not optimize (do optimize) basic blocks that use the same index
19037 pointer 4 or more times to copy pointer into the @code{ep} register, and
19038 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
19039 option is on by default if you optimize.
19041 @item -mno-prolog-function
19042 @itemx -mprolog-function
19043 @opindex mno-prolog-function
19044 @opindex mprolog-function
19045 Do not use (do use) external functions to save and restore registers
19046 at the prologue and epilogue of a function.  The external functions
19047 are slower, but use less code space if more than one function saves
19048 the same number of registers.  The @option{-mprolog-function} option
19049 is on by default if you optimize.
19051 @item -mspace
19052 @opindex mspace
19053 Try to make the code as small as possible.  At present, this just turns
19054 on the @option{-mep} and @option{-mprolog-function} options.
19056 @item -mtda=@var{n}
19057 @opindex mtda
19058 Put static or global variables whose size is @var{n} bytes or less into
19059 the tiny data area that register @code{ep} points to.  The tiny data
19060 area can hold up to 256 bytes in total (128 bytes for byte references).
19062 @item -msda=@var{n}
19063 @opindex msda
19064 Put static or global variables whose size is @var{n} bytes or less into
19065 the small data area that register @code{gp} points to.  The small data
19066 area can hold up to 64 kilobytes.
19068 @item -mzda=@var{n}
19069 @opindex mzda
19070 Put static or global variables whose size is @var{n} bytes or less into
19071 the first 32 kilobytes of memory.
19073 @item -mv850
19074 @opindex mv850
19075 Specify that the target processor is the V850.
19077 @item -mbig-switch
19078 @opindex mbig-switch
19079 Generate code suitable for big switch tables.  Use this option only if
19080 the assembler/linker complain about out of range branches within a switch
19081 table.
19083 @item -mapp-regs
19084 @opindex mapp-regs
19085 This option causes r2 and r5 to be used in the code generated by
19086 the compiler.  This setting is the default.
19088 @item -mno-app-regs
19089 @opindex mno-app-regs
19090 This option causes r2 and r5 to be treated as fixed registers.
19092 @item -mv850e2v3
19093 @opindex mv850e2v3
19094 Specify that the target processor is the V850E2V3.  The preprocessor
19095 constant @samp{__v850e2v3__} is defined if
19096 this option is used.
19098 @item -mv850e2
19099 @opindex mv850e2
19100 Specify that the target processor is the V850E2.  The preprocessor
19101 constant @samp{__v850e2__} is defined if this option is used.
19103 @item -mv850e1
19104 @opindex mv850e1
19105 Specify that the target processor is the V850E1.  The preprocessor
19106 constants @samp{__v850e1__} and @samp{__v850e__} are defined if
19107 this option is used.
19109 @item -mv850es
19110 @opindex mv850es
19111 Specify that the target processor is the V850ES.  This is an alias for
19112 the @option{-mv850e1} option.
19114 @item -mv850e
19115 @opindex mv850e
19116 Specify that the target processor is the V850E@.  The preprocessor
19117 constant @samp{__v850e__} is defined if this option is used.
19119 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
19120 nor @option{-mv850e2} nor @option{-mv850e2v3}
19121 are defined then a default target processor is chosen and the
19122 relevant @samp{__v850*__} preprocessor constant is defined.
19124 The preprocessor constants @samp{__v850} and @samp{__v851__} are always
19125 defined, regardless of which processor variant is the target.
19127 @item -mdisable-callt
19128 @opindex mdisable-callt
19129 This option suppresses generation of the @code{CALLT} instruction for the
19130 v850e, v850e1, v850e2 and v850e2v3 flavors of the v850 architecture.  The default is
19131 @option{-mno-disable-callt} which allows the @code{CALLT} instruction to be used.
19133 @end table
19135 @node VAX Options
19136 @subsection VAX Options
19137 @cindex VAX options
19139 These @samp{-m} options are defined for the VAX:
19141 @table @gcctabopt
19142 @item -munix
19143 @opindex munix
19144 Do not output certain jump instructions (@code{aobleq} and so on)
19145 that the Unix assembler for the VAX cannot handle across long
19146 ranges.
19148 @item -mgnu
19149 @opindex mgnu
19150 Do output those jump instructions, on the assumption that the
19151 GNU assembler is being used.
19153 @item -mg
19154 @opindex mg
19155 Output code for G-format floating-point numbers instead of D-format.
19156 @end table
19158 @node VMS Options
19159 @subsection VMS Options
19161 These @samp{-m} options are defined for the VMS implementations:
19163 @table @gcctabopt
19164 @item -mvms-return-codes
19165 @opindex mvms-return-codes
19166 Return VMS condition codes from @code{main}. The default is to return POSIX-style
19167 condition (e.g.@ error) codes.
19169 @item -mdebug-main=@var{prefix}
19170 @opindex mdebug-main=@var{prefix}
19171 Flag the first routine whose name starts with @var{prefix} as the main
19172 routine for the debugger.
19174 @item -mmalloc64
19175 @opindex mmalloc64
19176 Default to 64-bit memory allocation routines.
19178 @item -mpointer-size=@var{size}
19179 @opindex -mpointer-size=@var{size}
19180 Set the default size of pointers. Possible options for @var{size} are
19181 @samp{32} or @samp{short} for 32 bit pointers, @samp{64} or @samp{long}
19182 for 64 bit pointers, and @samp{no} for supporting only 32 bit pointers.
19183 The later option disables @code{pragma pointer_size}.
19184 @end table
19186 @node VxWorks Options
19187 @subsection VxWorks Options
19188 @cindex VxWorks Options
19190 The options in this section are defined for all VxWorks targets.
19191 Options specific to the target hardware are listed with the other
19192 options for that target.
19194 @table @gcctabopt
19195 @item -mrtp
19196 @opindex mrtp
19197 GCC can generate code for both VxWorks kernels and real time processes
19198 (RTPs).  This option switches from the former to the latter.  It also
19199 defines the preprocessor macro @code{__RTP__}.
19201 @item -non-static
19202 @opindex non-static
19203 Link an RTP executable against shared libraries rather than static
19204 libraries.  The options @option{-static} and @option{-shared} can
19205 also be used for RTPs (@pxref{Link Options}); @option{-static}
19206 is the default.
19208 @item -Bstatic
19209 @itemx -Bdynamic
19210 @opindex Bstatic
19211 @opindex Bdynamic
19212 These options are passed down to the linker.  They are defined for
19213 compatibility with Diab.
19215 @item -Xbind-lazy
19216 @opindex Xbind-lazy
19217 Enable lazy binding of function calls.  This option is equivalent to
19218 @option{-Wl,-z,now} and is defined for compatibility with Diab.
19220 @item -Xbind-now
19221 @opindex Xbind-now
19222 Disable lazy binding of function calls.  This option is the default and
19223 is defined for compatibility with Diab.
19224 @end table
19226 @node x86-64 Options
19227 @subsection x86-64 Options
19228 @cindex x86-64 options
19230 These are listed under @xref{i386 and x86-64 Options}.
19232 @node Xstormy16 Options
19233 @subsection Xstormy16 Options
19234 @cindex Xstormy16 Options
19236 These options are defined for Xstormy16:
19238 @table @gcctabopt
19239 @item -msim
19240 @opindex msim
19241 Choose startup files and linker script suitable for the simulator.
19242 @end table
19244 @node Xtensa Options
19245 @subsection Xtensa Options
19246 @cindex Xtensa Options
19248 These options are supported for Xtensa targets:
19250 @table @gcctabopt
19251 @item -mconst16
19252 @itemx -mno-const16
19253 @opindex mconst16
19254 @opindex mno-const16
19255 Enable or disable use of @code{CONST16} instructions for loading
19256 constant values.  The @code{CONST16} instruction is currently not a
19257 standard option from Tensilica.  When enabled, @code{CONST16}
19258 instructions are always used in place of the standard @code{L32R}
19259 instructions.  The use of @code{CONST16} is enabled by default only if
19260 the @code{L32R} instruction is not available.
19262 @item -mfused-madd
19263 @itemx -mno-fused-madd
19264 @opindex mfused-madd
19265 @opindex mno-fused-madd
19266 Enable or disable use of fused multiply/add and multiply/subtract
19267 instructions in the floating-point option.  This has no effect if the
19268 floating-point option is not also enabled.  Disabling fused multiply/add
19269 and multiply/subtract instructions forces the compiler to use separate
19270 instructions for the multiply and add/subtract operations.  This may be
19271 desirable in some cases where strict IEEE 754-compliant results are
19272 required: the fused multiply add/subtract instructions do not round the
19273 intermediate result, thereby producing results with @emph{more} bits of
19274 precision than specified by the IEEE standard.  Disabling fused multiply
19275 add/subtract instructions also ensures that the program output is not
19276 sensitive to the compiler's ability to combine multiply and add/subtract
19277 operations.
19279 @item -mserialize-volatile
19280 @itemx -mno-serialize-volatile
19281 @opindex mserialize-volatile
19282 @opindex mno-serialize-volatile
19283 When this option is enabled, GCC inserts @code{MEMW} instructions before
19284 @code{volatile} memory references to guarantee sequential consistency.
19285 The default is @option{-mserialize-volatile}.  Use
19286 @option{-mno-serialize-volatile} to omit the @code{MEMW} instructions.
19288 @item -mforce-no-pic
19289 @opindex mforce-no-pic
19290 For targets, like GNU/Linux, where all user-mode Xtensa code must be
19291 position-independent code (PIC), this option disables PIC for compiling
19292 kernel code.
19294 @item -mtext-section-literals
19295 @itemx -mno-text-section-literals
19296 @opindex mtext-section-literals
19297 @opindex mno-text-section-literals
19298 Control the treatment of literal pools.  The default is
19299 @option{-mno-text-section-literals}, which places literals in a separate
19300 section in the output file.  This allows the literal pool to be placed
19301 in a data RAM/ROM, and it also allows the linker to combine literal
19302 pools from separate object files to remove redundant literals and
19303 improve code size.  With @option{-mtext-section-literals}, the literals
19304 are interspersed in the text section in order to keep them as close as
19305 possible to their references.  This may be necessary for large assembly
19306 files.
19308 @item -mtarget-align
19309 @itemx -mno-target-align
19310 @opindex mtarget-align
19311 @opindex mno-target-align
19312 When this option is enabled, GCC instructs the assembler to
19313 automatically align instructions to reduce branch penalties at the
19314 expense of some code density.  The assembler attempts to widen density
19315 instructions to align branch targets and the instructions following call
19316 instructions.  If there are not enough preceding safe density
19317 instructions to align a target, no widening is performed.  The
19318 default is @option{-mtarget-align}.  These options do not affect the
19319 treatment of auto-aligned instructions like @code{LOOP}, which the
19320 assembler always aligns, either by widening density instructions or
19321 by inserting NOP instructions.
19323 @item -mlongcalls
19324 @itemx -mno-longcalls
19325 @opindex mlongcalls
19326 @opindex mno-longcalls
19327 When this option is enabled, GCC instructs the assembler to translate
19328 direct calls to indirect calls unless it can determine that the target
19329 of a direct call is in the range allowed by the call instruction.  This
19330 translation typically occurs for calls to functions in other source
19331 files.  Specifically, the assembler translates a direct @code{CALL}
19332 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
19333 The default is @option{-mno-longcalls}.  This option should be used in
19334 programs where the call target can potentially be out of range.  This
19335 option is implemented in the assembler, not the compiler, so the
19336 assembly code generated by GCC still shows direct call
19337 instructions---look at the disassembled object code to see the actual
19338 instructions.  Note that the assembler uses an indirect call for
19339 every cross-file call, not just those that really are out of range.
19340 @end table
19342 @node zSeries Options
19343 @subsection zSeries Options
19344 @cindex zSeries options
19346 These are listed under @xref{S/390 and zSeries Options}.
19348 @node Code Gen Options
19349 @section Options for Code Generation Conventions
19350 @cindex code generation conventions
19351 @cindex options, code generation
19352 @cindex run-time options
19354 These machine-independent options control the interface conventions
19355 used in code generation.
19357 Most of them have both positive and negative forms; the negative form
19358 of @option{-ffoo} is @option{-fno-foo}.  In the table below, only
19359 one of the forms is listed---the one that is not the default.  You
19360 can figure out the other form by either removing @samp{no-} or adding
19363 @table @gcctabopt
19364 @item -fbounds-check
19365 @opindex fbounds-check
19366 For front ends that support it, generate additional code to check that
19367 indices used to access arrays are within the declared range.  This is
19368 currently only supported by the Java and Fortran front ends, where
19369 this option defaults to true and false respectively.
19371 @item -fstack-reuse=@var{reuse-level}
19372 @opindex fstack_reuse
19373 This option controls stack space reuse for user declared local/auto variables
19374 and compiler generated temporaries.  @var{reuse_level} can be @samp{all},
19375 @samp{named_vars}, or @samp{none}. @samp{all} enables stack reuse for all
19376 local variables and temporaries, @samp{named_vars} enables the reuse only for
19377 user defined local variables with names, and @samp{none} disables stack reuse
19378 completely. The default value is @samp{all}. The option is needed when the
19379 program extends the lifetime of a scoped local variable or a compiler generated
19380 temporary beyond the end point defined by the language.  When a lifetime of
19381 a variable ends, and if the variable lives in memory, the optimizing compiler
19382 has the freedom to reuse its stack space with other temporaries or scoped
19383 local variables whose live range does not overlap with it. Legacy code extending
19384 local lifetime will likely to break with the stack reuse optimization.
19386 For example,
19388 @smallexample
19389    int *p;
19390    @{
19391      int local1;
19393      p = &local1;
19394      local1 = 10;
19395      ....
19396    @}
19397    @{
19398       int local2;
19399       local2 = 20;
19400       ...
19401    @}
19403    if (*p == 10)  // out of scope use of local1
19404      @{
19406      @}
19407 @end smallexample
19409 Another example:
19410 @smallexample
19412    struct A
19413    @{
19414        A(int k) : i(k), j(k) @{ @}
19415        int i;
19416        int j;
19417    @};
19419    A *ap;
19421    void foo(const A& ar)
19422    @{
19423       ap = &ar;
19424    @}
19426    void bar()
19427    @{
19428       foo(A(10)); // temp object's lifetime ends when foo returns
19430       @{
19431         A a(20);
19432         ....
19433       @}
19434       ap->i+= 10;  // ap references out of scope temp whose space
19435                    // is reused with a. What is the value of ap->i?
19436    @}
19438 @end smallexample
19440 The lifetime of a compiler generated temporary is well defined by the C++
19441 standard. When a lifetime of a temporary ends, and if the temporary lives
19442 in memory, the optimizing compiler has the freedom to reuse its stack
19443 space with other temporaries or scoped local variables whose live range
19444 does not overlap with it. However some of the legacy code relies on
19445 the behavior of older compilers in which temporaries' stack space is
19446 not reused, the aggressive stack reuse can lead to runtime errors. This
19447 option is used to control the temporary stack reuse optimization.
19449 @item -ftrapv
19450 @opindex ftrapv
19451 This option generates traps for signed overflow on addition, subtraction,
19452 multiplication operations.
19454 @item -fwrapv
19455 @opindex fwrapv
19456 This option instructs the compiler to assume that signed arithmetic
19457 overflow of addition, subtraction and multiplication wraps around
19458 using twos-complement representation.  This flag enables some optimizations
19459 and disables others.  This option is enabled by default for the Java
19460 front end, as required by the Java language specification.
19462 @item -fexceptions
19463 @opindex fexceptions
19464 Enable exception handling.  Generates extra code needed to propagate
19465 exceptions.  For some targets, this implies GCC generates frame
19466 unwind information for all functions, which can produce significant data
19467 size overhead, although it does not affect execution.  If you do not
19468 specify this option, GCC enables it by default for languages like
19469 C++ that normally require exception handling, and disables it for
19470 languages like C that do not normally require it.  However, you may need
19471 to enable this option when compiling C code that needs to interoperate
19472 properly with exception handlers written in C++.  You may also wish to
19473 disable this option if you are compiling older C++ programs that don't
19474 use exception handling.
19476 @item -fnon-call-exceptions
19477 @opindex fnon-call-exceptions
19478 Generate code that allows trapping instructions to throw exceptions.
19479 Note that this requires platform-specific runtime support that does
19480 not exist everywhere.  Moreover, it only allows @emph{trapping}
19481 instructions to throw exceptions, i.e.@: memory references or floating-point
19482 instructions.  It does not allow exceptions to be thrown from
19483 arbitrary signal handlers such as @code{SIGALRM}.
19485 @item -fdelete-dead-exceptions
19486 @opindex fdelete-dead-exceptions
19487 Consider that instructions that may throw exceptions but don't otherwise
19488 contribute to the execution of the program can be optimized away.
19489 This option is enabled by default for the Ada front end, as permitted by
19490 the Ada language specification.
19491 Optimization passes that cause dead exceptions to be removed are enabled independently at different optimization levels.
19493 @item -funwind-tables
19494 @opindex funwind-tables
19495 Similar to @option{-fexceptions}, except that it just generates any needed
19496 static data, but does not affect the generated code in any other way.
19497 You normally do not need to enable this option; instead, a language processor
19498 that needs this handling enables it on your behalf.
19500 @item -fasynchronous-unwind-tables
19501 @opindex fasynchronous-unwind-tables
19502 Generate unwind table in DWARF 2 format, if supported by target machine.  The
19503 table is exact at each instruction boundary, so it can be used for stack
19504 unwinding from asynchronous events (such as debugger or garbage collector).
19506 @item -fpcc-struct-return
19507 @opindex fpcc-struct-return
19508 Return ``short'' @code{struct} and @code{union} values in memory like
19509 longer ones, rather than in registers.  This convention is less
19510 efficient, but it has the advantage of allowing intercallability between
19511 GCC-compiled files and files compiled with other compilers, particularly
19512 the Portable C Compiler (pcc).
19514 The precise convention for returning structures in memory depends
19515 on the target configuration macros.
19517 Short structures and unions are those whose size and alignment match
19518 that of some integer type.
19520 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
19521 switch is not binary compatible with code compiled with the
19522 @option{-freg-struct-return} switch.
19523 Use it to conform to a non-default application binary interface.
19525 @item -freg-struct-return
19526 @opindex freg-struct-return
19527 Return @code{struct} and @code{union} values in registers when possible.
19528 This is more efficient for small structures than
19529 @option{-fpcc-struct-return}.
19531 If you specify neither @option{-fpcc-struct-return} nor
19532 @option{-freg-struct-return}, GCC defaults to whichever convention is
19533 standard for the target.  If there is no standard convention, GCC
19534 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
19535 the principal compiler.  In those cases, we can choose the standard, and
19536 we chose the more efficient register return alternative.
19538 @strong{Warning:} code compiled with the @option{-freg-struct-return}
19539 switch is not binary compatible with code compiled with the
19540 @option{-fpcc-struct-return} switch.
19541 Use it to conform to a non-default application binary interface.
19543 @item -fshort-enums
19544 @opindex fshort-enums
19545 Allocate to an @code{enum} type only as many bytes as it needs for the
19546 declared range of possible values.  Specifically, the @code{enum} type
19547 is equivalent to the smallest integer type that has enough room.
19549 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
19550 code that is not binary compatible with code generated without that switch.
19551 Use it to conform to a non-default application binary interface.
19553 @item -fshort-double
19554 @opindex fshort-double
19555 Use the same size for @code{double} as for @code{float}.
19557 @strong{Warning:} the @option{-fshort-double} switch causes GCC to generate
19558 code that is not binary compatible with code generated without that switch.
19559 Use it to conform to a non-default application binary interface.
19561 @item -fshort-wchar
19562 @opindex fshort-wchar
19563 Override the underlying type for @samp{wchar_t} to be @samp{short
19564 unsigned int} instead of the default for the target.  This option is
19565 useful for building programs to run under WINE@.
19567 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
19568 code that is not binary compatible with code generated without that switch.
19569 Use it to conform to a non-default application binary interface.
19571 @item -fno-common
19572 @opindex fno-common
19573 In C code, controls the placement of uninitialized global variables.
19574 Unix C compilers have traditionally permitted multiple definitions of
19575 such variables in different compilation units by placing the variables
19576 in a common block.
19577 This is the behavior specified by @option{-fcommon}, and is the default
19578 for GCC on most targets.
19579 On the other hand, this behavior is not required by ISO C, and on some
19580 targets may carry a speed or code size penalty on variable references.
19581 The @option{-fno-common} option specifies that the compiler should place
19582 uninitialized global variables in the data section of the object file,
19583 rather than generating them as common blocks.
19584 This has the effect that if the same variable is declared
19585 (without @code{extern}) in two different compilations,
19586 you get a multiple-definition error when you link them.
19587 In this case, you must compile with @option{-fcommon} instead.
19588 Compiling with @option{-fno-common} is useful on targets for which
19589 it provides better performance, or if you wish to verify that the
19590 program will work on other systems that always treat uninitialized
19591 variable declarations this way.
19593 @item -fno-ident
19594 @opindex fno-ident
19595 Ignore the @samp{#ident} directive.
19597 @item -finhibit-size-directive
19598 @opindex finhibit-size-directive
19599 Don't output a @code{.size} assembler directive, or anything else that
19600 would cause trouble if the function is split in the middle, and the
19601 two halves are placed at locations far apart in memory.  This option is
19602 used when compiling @file{crtstuff.c}; you should not need to use it
19603 for anything else.
19605 @item -fverbose-asm
19606 @opindex fverbose-asm
19607 Put extra commentary information in the generated assembly code to
19608 make it more readable.  This option is generally only of use to those
19609 who actually need to read the generated assembly code (perhaps while
19610 debugging the compiler itself).
19612 @option{-fno-verbose-asm}, the default, causes the
19613 extra information to be omitted and is useful when comparing two assembler
19614 files.
19616 @item -frecord-gcc-switches
19617 @opindex frecord-gcc-switches
19618 This switch causes the command line used to invoke the
19619 compiler to be recorded into the object file that is being created.
19620 This switch is only implemented on some targets and the exact format
19621 of the recording is target and binary file format dependent, but it
19622 usually takes the form of a section containing ASCII text.  This
19623 switch is related to the @option{-fverbose-asm} switch, but that
19624 switch only records information in the assembler output file as
19625 comments, so it never reaches the object file.
19626 See also @option{-grecord-gcc-switches} for another
19627 way of storing compiler options into the object file.
19629 @item -fpic
19630 @opindex fpic
19631 @cindex global offset table
19632 @cindex PIC
19633 Generate position-independent code (PIC) suitable for use in a shared
19634 library, if supported for the target machine.  Such code accesses all
19635 constant addresses through a global offset table (GOT)@.  The dynamic
19636 loader resolves the GOT entries when the program starts (the dynamic
19637 loader is not part of GCC; it is part of the operating system).  If
19638 the GOT size for the linked executable exceeds a machine-specific
19639 maximum size, you get an error message from the linker indicating that
19640 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
19641 instead.  (These maximums are 8k on the SPARC and 32k
19642 on the m68k and RS/6000.  The 386 has no such limit.)
19644 Position-independent code requires special support, and therefore works
19645 only on certain machines.  For the 386, GCC supports PIC for System V
19646 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
19647 position-independent.
19649 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
19650 are defined to 1.
19652 @item -fPIC
19653 @opindex fPIC
19654 If supported for the target machine, emit position-independent code,
19655 suitable for dynamic linking and avoiding any limit on the size of the
19656 global offset table.  This option makes a difference on the m68k,
19657 PowerPC and SPARC@.
19659 Position-independent code requires special support, and therefore works
19660 only on certain machines.
19662 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
19663 are defined to 2.
19665 @item -fpie
19666 @itemx -fPIE
19667 @opindex fpie
19668 @opindex fPIE
19669 These options are similar to @option{-fpic} and @option{-fPIC}, but
19670 generated position independent code can be only linked into executables.
19671 Usually these options are used when @option{-pie} GCC option is
19672 used during linking.
19674 @option{-fpie} and @option{-fPIE} both define the macros
19675 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
19676 for @option{-fpie} and 2 for @option{-fPIE}.
19678 @item -fno-jump-tables
19679 @opindex fno-jump-tables
19680 Do not use jump tables for switch statements even where it would be
19681 more efficient than other code generation strategies.  This option is
19682 of use in conjunction with @option{-fpic} or @option{-fPIC} for
19683 building code that forms part of a dynamic linker and cannot
19684 reference the address of a jump table.  On some targets, jump tables
19685 do not require a GOT and this option is not needed.
19687 @item -ffixed-@var{reg}
19688 @opindex ffixed
19689 Treat the register named @var{reg} as a fixed register; generated code
19690 should never refer to it (except perhaps as a stack pointer, frame
19691 pointer or in some other fixed role).
19693 @var{reg} must be the name of a register.  The register names accepted
19694 are machine-specific and are defined in the @code{REGISTER_NAMES}
19695 macro in the machine description macro file.
19697 This flag does not have a negative form, because it specifies a
19698 three-way choice.
19700 @item -fcall-used-@var{reg}
19701 @opindex fcall-used
19702 Treat the register named @var{reg} as an allocable register that is
19703 clobbered by function calls.  It may be allocated for temporaries or
19704 variables that do not live across a call.  Functions compiled this way
19705 do not save and restore the register @var{reg}.
19707 It is an error to use this flag with the frame pointer or stack pointer.
19708 Use of this flag for other registers that have fixed pervasive roles in
19709 the machine's execution model produces disastrous results.
19711 This flag does not have a negative form, because it specifies a
19712 three-way choice.
19714 @item -fcall-saved-@var{reg}
19715 @opindex fcall-saved
19716 Treat the register named @var{reg} as an allocable register saved by
19717 functions.  It may be allocated even for temporaries or variables that
19718 live across a call.  Functions compiled this way save and restore
19719 the register @var{reg} if they use it.
19721 It is an error to use this flag with the frame pointer or stack pointer.
19722 Use of this flag for other registers that have fixed pervasive roles in
19723 the machine's execution model produces disastrous results.
19725 A different sort of disaster results from the use of this flag for
19726 a register in which function values may be returned.
19728 This flag does not have a negative form, because it specifies a
19729 three-way choice.
19731 @item -fpack-struct[=@var{n}]
19732 @opindex fpack-struct
19733 Without a value specified, pack all structure members together without
19734 holes.  When a value is specified (which must be a small power of two), pack
19735 structure members according to this value, representing the maximum
19736 alignment (that is, objects with default alignment requirements larger than
19737 this are output potentially unaligned at the next fitting location.
19739 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
19740 code that is not binary compatible with code generated without that switch.
19741 Additionally, it makes the code suboptimal.
19742 Use it to conform to a non-default application binary interface.
19744 @item -finstrument-functions
19745 @opindex finstrument-functions
19746 Generate instrumentation calls for entry and exit to functions.  Just
19747 after function entry and just before function exit, the following
19748 profiling functions are called with the address of the current
19749 function and its call site.  (On some platforms,
19750 @code{__builtin_return_address} does not work beyond the current
19751 function, so the call site information may not be available to the
19752 profiling functions otherwise.)
19754 @smallexample
19755 void __cyg_profile_func_enter (void *this_fn,
19756                                void *call_site);
19757 void __cyg_profile_func_exit  (void *this_fn,
19758                                void *call_site);
19759 @end smallexample
19761 The first argument is the address of the start of the current function,
19762 which may be looked up exactly in the symbol table.
19764 This instrumentation is also done for functions expanded inline in other
19765 functions.  The profiling calls indicate where, conceptually, the
19766 inline function is entered and exited.  This means that addressable
19767 versions of such functions must be available.  If all your uses of a
19768 function are expanded inline, this may mean an additional expansion of
19769 code size.  If you use @samp{extern inline} in your C code, an
19770 addressable version of such functions must be provided.  (This is
19771 normally the case anyway, but if you get lucky and the optimizer always
19772 expands the functions inline, you might have gotten away without
19773 providing static copies.)
19775 A function may be given the attribute @code{no_instrument_function}, in
19776 which case this instrumentation is not done.  This can be used, for
19777 example, for the profiling functions listed above, high-priority
19778 interrupt routines, and any functions from which the profiling functions
19779 cannot safely be called (perhaps signal handlers, if the profiling
19780 routines generate output or allocate memory).
19782 @item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
19783 @opindex finstrument-functions-exclude-file-list
19785 Set the list of functions that are excluded from instrumentation (see
19786 the description of @code{-finstrument-functions}).  If the file that
19787 contains a function definition matches with one of @var{file}, then
19788 that function is not instrumented.  The match is done on substrings:
19789 if the @var{file} parameter is a substring of the file name, it is
19790 considered to be a match.
19792 For example:
19794 @smallexample
19795 -finstrument-functions-exclude-file-list=/bits/stl,include/sys
19796 @end smallexample
19798 @noindent
19799 excludes any inline function defined in files whose pathnames
19800 contain @code{/bits/stl} or @code{include/sys}.
19802 If, for some reason, you want to include letter @code{','} in one of
19803 @var{sym}, write @code{'\,'}. For example,
19804 @code{-finstrument-functions-exclude-file-list='\,\,tmp'}
19805 (note the single quote surrounding the option).
19807 @item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{}
19808 @opindex finstrument-functions-exclude-function-list
19810 This is similar to @code{-finstrument-functions-exclude-file-list},
19811 but this option sets the list of function names to be excluded from
19812 instrumentation.  The function name to be matched is its user-visible
19813 name, such as @code{vector<int> blah(const vector<int> &)}, not the
19814 internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}).  The
19815 match is done on substrings: if the @var{sym} parameter is a substring
19816 of the function name, it is considered to be a match.  For C99 and C++
19817 extended identifiers, the function name must be given in UTF-8, not
19818 using universal character names.
19820 @item -fstack-check
19821 @opindex fstack-check
19822 Generate code to verify that you do not go beyond the boundary of the
19823 stack.  You should specify this flag if you are running in an
19824 environment with multiple threads, but you only rarely need to specify it in
19825 a single-threaded environment since stack overflow is automatically
19826 detected on nearly all systems if there is only one stack.
19828 Note that this switch does not actually cause checking to be done; the
19829 operating system or the language runtime must do that.  The switch causes
19830 generation of code to ensure that they see the stack being extended.
19832 You can additionally specify a string parameter: @code{no} means no
19833 checking, @code{generic} means force the use of old-style checking,
19834 @code{specific} means use the best checking method and is equivalent
19835 to bare @option{-fstack-check}.
19837 Old-style checking is a generic mechanism that requires no specific
19838 target support in the compiler but comes with the following drawbacks:
19840 @enumerate
19841 @item
19842 Modified allocation strategy for large objects: they are always
19843 allocated dynamically if their size exceeds a fixed threshold.
19845 @item
19846 Fixed limit on the size of the static frame of functions: when it is
19847 topped by a particular function, stack checking is not reliable and
19848 a warning is issued by the compiler.
19850 @item
19851 Inefficiency: because of both the modified allocation strategy and the
19852 generic implementation, code performance is hampered.
19853 @end enumerate
19855 Note that old-style stack checking is also the fallback method for
19856 @code{specific} if no target support has been added in the compiler.
19858 @item -fstack-limit-register=@var{reg}
19859 @itemx -fstack-limit-symbol=@var{sym}
19860 @itemx -fno-stack-limit
19861 @opindex fstack-limit-register
19862 @opindex fstack-limit-symbol
19863 @opindex fno-stack-limit
19864 Generate code to ensure that the stack does not grow beyond a certain value,
19865 either the value of a register or the address of a symbol.  If a larger
19866 stack is required, a signal is raised at run time.  For most targets,
19867 the signal is raised before the stack overruns the boundary, so
19868 it is possible to catch the signal without taking special precautions.
19870 For instance, if the stack starts at absolute address @samp{0x80000000}
19871 and grows downwards, you can use the flags
19872 @option{-fstack-limit-symbol=__stack_limit} and
19873 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
19874 of 128KB@.  Note that this may only work with the GNU linker.
19876 @item -fsplit-stack
19877 @opindex fsplit-stack
19878 Generate code to automatically split the stack before it overflows.
19879 The resulting program has a discontiguous stack which can only
19880 overflow if the program is unable to allocate any more memory.  This
19881 is most useful when running threaded programs, as it is no longer
19882 necessary to calculate a good stack size to use for each thread.  This
19883 is currently only implemented for the i386 and x86_64 back ends running
19884 GNU/Linux.
19886 When code compiled with @option{-fsplit-stack} calls code compiled
19887 without @option{-fsplit-stack}, there may not be much stack space
19888 available for the latter code to run.  If compiling all code,
19889 including library code, with @option{-fsplit-stack} is not an option,
19890 then the linker can fix up these calls so that the code compiled
19891 without @option{-fsplit-stack} always has a large stack.  Support for
19892 this is implemented in the gold linker in GNU binutils release 2.21
19893 and later.
19895 @item -fleading-underscore
19896 @opindex fleading-underscore
19897 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
19898 change the way C symbols are represented in the object file.  One use
19899 is to help link with legacy assembly code.
19901 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
19902 generate code that is not binary compatible with code generated without that
19903 switch.  Use it to conform to a non-default application binary interface.
19904 Not all targets provide complete support for this switch.
19906 @item -ftls-model=@var{model}
19907 @opindex ftls-model
19908 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
19909 The @var{model} argument should be one of @code{global-dynamic},
19910 @code{local-dynamic}, @code{initial-exec} or @code{local-exec}.
19912 The default without @option{-fpic} is @code{initial-exec}; with
19913 @option{-fpic} the default is @code{global-dynamic}.
19915 @item -fvisibility=@var{default|internal|hidden|protected}
19916 @opindex fvisibility
19917 Set the default ELF image symbol visibility to the specified option---all
19918 symbols are marked with this unless overridden within the code.
19919 Using this feature can very substantially improve linking and
19920 load times of shared object libraries, produce more optimized
19921 code, provide near-perfect API export and prevent symbol clashes.
19922 It is @strong{strongly} recommended that you use this in any shared objects
19923 you distribute.
19925 Despite the nomenclature, @code{default} always means public; i.e.,
19926 available to be linked against from outside the shared object.
19927 @code{protected} and @code{internal} are pretty useless in real-world
19928 usage so the only other commonly used option is @code{hidden}.
19929 The default if @option{-fvisibility} isn't specified is
19930 @code{default}, i.e., make every
19931 symbol public---this causes the same behavior as previous versions of
19932 GCC@.
19934 A good explanation of the benefits offered by ensuring ELF
19935 symbols have the correct visibility is given by ``How To Write
19936 Shared Libraries'' by Ulrich Drepper (which can be found at
19937 @w{@uref{http://people.redhat.com/~drepper/}})---however a superior
19938 solution made possible by this option to marking things hidden when
19939 the default is public is to make the default hidden and mark things
19940 public.  This is the norm with DLLs on Windows and with @option{-fvisibility=hidden}
19941 and @code{__attribute__ ((visibility("default")))} instead of
19942 @code{__declspec(dllexport)} you get almost identical semantics with
19943 identical syntax.  This is a great boon to those working with
19944 cross-platform projects.
19946 For those adding visibility support to existing code, you may find
19947 @samp{#pragma GCC visibility} of use.  This works by you enclosing
19948 the declarations you wish to set visibility for with (for example)
19949 @samp{#pragma GCC visibility push(hidden)} and
19950 @samp{#pragma GCC visibility pop}.
19951 Bear in mind that symbol visibility should be viewed @strong{as
19952 part of the API interface contract} and thus all new code should
19953 always specify visibility when it is not the default; i.e., declarations
19954 only for use within the local DSO should @strong{always} be marked explicitly
19955 as hidden as so to avoid PLT indirection overheads---making this
19956 abundantly clear also aids readability and self-documentation of the code.
19957 Note that due to ISO C++ specification requirements, @code{operator new} and
19958 @code{operator delete} must always be of default visibility.
19960 Be aware that headers from outside your project, in particular system
19961 headers and headers from any other library you use, may not be
19962 expecting to be compiled with visibility other than the default.  You
19963 may need to explicitly say @samp{#pragma GCC visibility push(default)}
19964 before including any such headers.
19966 @samp{extern} declarations are not affected by @option{-fvisibility}, so
19967 a lot of code can be recompiled with @option{-fvisibility=hidden} with
19968 no modifications.  However, this means that calls to @code{extern}
19969 functions with no explicit visibility use the PLT, so it is more
19970 effective to use @code{__attribute ((visibility))} and/or
19971 @code{#pragma GCC visibility} to tell the compiler which @code{extern}
19972 declarations should be treated as hidden.
19974 Note that @option{-fvisibility} does affect C++ vague linkage
19975 entities. This means that, for instance, an exception class that is
19976 be thrown between DSOs must be explicitly marked with default
19977 visibility so that the @samp{type_info} nodes are unified between
19978 the DSOs.
19980 An overview of these techniques, their benefits and how to use them
19981 is at @uref{http://gcc.gnu.org/@/wiki/@/Visibility}.
19983 @item -fstrict-volatile-bitfields
19984 @opindex fstrict-volatile-bitfields
19985 This option should be used if accesses to volatile bit-fields (or other
19986 structure fields, although the compiler usually honors those types
19987 anyway) should use a single access of the width of the
19988 field's type, aligned to a natural alignment if possible.  For
19989 example, targets with memory-mapped peripheral registers might require
19990 all such accesses to be 16 bits wide; with this flag you can
19991 declare all peripheral bit-fields as @code{unsigned short} (assuming short
19992 is 16 bits on these targets) to force GCC to use 16-bit accesses
19993 instead of, perhaps, a more efficient 32-bit access.
19995 If this option is disabled, the compiler uses the most efficient
19996 instruction.  In the previous example, that might be a 32-bit load
19997 instruction, even though that accesses bytes that do not contain
19998 any portion of the bit-field, or memory-mapped registers unrelated to
19999 the one being updated.
20001 If the target requires strict alignment, and honoring the field
20002 type would require violating this alignment, a warning is issued.
20003 If the field has @code{packed} attribute, the access is done without
20004 honoring the field type.  If the field doesn't have @code{packed}
20005 attribute, the access is done honoring the field type.  In both cases,
20006 GCC assumes that the user knows something about the target hardware
20007 that it is unaware of.
20009 The default value of this option is determined by the application binary
20010 interface for the target processor.
20012 @item -fsync-libcalls
20013 @opindex fsync-libcalls
20014 This option controls whether any out-of-line instance of the @code{__sync}
20015 family of functions may be used to implement the C++11 @code{__atomic}
20016 family of functions.
20018 The default value of this option is enabled, thus the only useful form
20019 of the option is @option{-fno-sync-libcalls}.  This option is used in
20020 the implementation of the @file{libatomic} runtime library.
20022 @end table
20024 @c man end
20026 @node Environment Variables
20027 @section Environment Variables Affecting GCC
20028 @cindex environment variables
20030 @c man begin ENVIRONMENT
20031 This section describes several environment variables that affect how GCC
20032 operates.  Some of them work by specifying directories or prefixes to use
20033 when searching for various kinds of files.  Some are used to specify other
20034 aspects of the compilation environment.
20036 Note that you can also specify places to search using options such as
20037 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
20038 take precedence over places specified using environment variables, which
20039 in turn take precedence over those specified by the configuration of GCC@.
20040 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
20041 GNU Compiler Collection (GCC) Internals}.
20043 @table @env
20044 @item LANG
20045 @itemx LC_CTYPE
20046 @c @itemx LC_COLLATE
20047 @itemx LC_MESSAGES
20048 @c @itemx LC_MONETARY
20049 @c @itemx LC_NUMERIC
20050 @c @itemx LC_TIME
20051 @itemx LC_ALL
20052 @findex LANG
20053 @findex LC_CTYPE
20054 @c @findex LC_COLLATE
20055 @findex LC_MESSAGES
20056 @c @findex LC_MONETARY
20057 @c @findex LC_NUMERIC
20058 @c @findex LC_TIME
20059 @findex LC_ALL
20060 @cindex locale
20061 These environment variables control the way that GCC uses
20062 localization information which allows GCC to work with different
20063 national conventions.  GCC inspects the locale categories
20064 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
20065 so.  These locale categories can be set to any value supported by your
20066 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
20067 Kingdom encoded in UTF-8.
20069 The @env{LC_CTYPE} environment variable specifies character
20070 classification.  GCC uses it to determine the character boundaries in
20071 a string; this is needed for some multibyte encodings that contain quote
20072 and escape characters that are otherwise interpreted as a string
20073 end or escape.
20075 The @env{LC_MESSAGES} environment variable specifies the language to
20076 use in diagnostic messages.
20078 If the @env{LC_ALL} environment variable is set, it overrides the value
20079 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
20080 and @env{LC_MESSAGES} default to the value of the @env{LANG}
20081 environment variable.  If none of these variables are set, GCC
20082 defaults to traditional C English behavior.
20084 @item TMPDIR
20085 @findex TMPDIR
20086 If @env{TMPDIR} is set, it specifies the directory to use for temporary
20087 files.  GCC uses temporary files to hold the output of one stage of
20088 compilation which is to be used as input to the next stage: for example,
20089 the output of the preprocessor, which is the input to the compiler
20090 proper.
20092 @item GCC_COMPARE_DEBUG
20093 @findex GCC_COMPARE_DEBUG
20094 Setting @env{GCC_COMPARE_DEBUG} is nearly equivalent to passing
20095 @option{-fcompare-debug} to the compiler driver.  See the documentation
20096 of this option for more details.
20098 @item GCC_EXEC_PREFIX
20099 @findex GCC_EXEC_PREFIX
20100 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
20101 names of the subprograms executed by the compiler.  No slash is added
20102 when this prefix is combined with the name of a subprogram, but you can
20103 specify a prefix that ends with a slash if you wish.
20105 If @env{GCC_EXEC_PREFIX} is not set, GCC attempts to figure out
20106 an appropriate prefix to use based on the pathname it is invoked with.
20108 If GCC cannot find the subprogram using the specified prefix, it
20109 tries looking in the usual places for the subprogram.
20111 The default value of @env{GCC_EXEC_PREFIX} is
20112 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
20113 the installed compiler. In many cases @var{prefix} is the value
20114 of @code{prefix} when you ran the @file{configure} script.
20116 Other prefixes specified with @option{-B} take precedence over this prefix.
20118 This prefix is also used for finding files such as @file{crt0.o} that are
20119 used for linking.
20121 In addition, the prefix is used in an unusual way in finding the
20122 directories to search for header files.  For each of the standard
20123 directories whose name normally begins with @samp{/usr/local/lib/gcc}
20124 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
20125 replacing that beginning with the specified prefix to produce an
20126 alternate directory name.  Thus, with @option{-Bfoo/}, GCC searches
20127 @file{foo/bar} just before it searches the standard directory 
20128 @file{/usr/local/lib/bar}.
20129 If a standard directory begins with the configured
20130 @var{prefix} then the value of @var{prefix} is replaced by
20131 @env{GCC_EXEC_PREFIX} when looking for header files.
20133 @item COMPILER_PATH
20134 @findex COMPILER_PATH
20135 The value of @env{COMPILER_PATH} is a colon-separated list of
20136 directories, much like @env{PATH}.  GCC tries the directories thus
20137 specified when searching for subprograms, if it can't find the
20138 subprograms using @env{GCC_EXEC_PREFIX}.
20140 @item LIBRARY_PATH
20141 @findex LIBRARY_PATH
20142 The value of @env{LIBRARY_PATH} is a colon-separated list of
20143 directories, much like @env{PATH}.  When configured as a native compiler,
20144 GCC tries the directories thus specified when searching for special
20145 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
20146 using GCC also uses these directories when searching for ordinary
20147 libraries for the @option{-l} option (but directories specified with
20148 @option{-L} come first).
20150 @item LANG
20151 @findex LANG
20152 @cindex locale definition
20153 This variable is used to pass locale information to the compiler.  One way in
20154 which this information is used is to determine the character set to be used
20155 when character literals, string literals and comments are parsed in C and C++.
20156 When the compiler is configured to allow multibyte characters,
20157 the following values for @env{LANG} are recognized:
20159 @table @samp
20160 @item C-JIS
20161 Recognize JIS characters.
20162 @item C-SJIS
20163 Recognize SJIS characters.
20164 @item C-EUCJP
20165 Recognize EUCJP characters.
20166 @end table
20168 If @env{LANG} is not defined, or if it has some other value, then the
20169 compiler uses @code{mblen} and @code{mbtowc} as defined by the default locale to
20170 recognize and translate multibyte characters.
20171 @end table
20173 @noindent
20174 Some additional environment variables affect the behavior of the
20175 preprocessor.
20177 @include cppenv.texi
20179 @c man end
20181 @node Precompiled Headers
20182 @section Using Precompiled Headers
20183 @cindex precompiled headers
20184 @cindex speed of compilation
20186 Often large projects have many header files that are included in every
20187 source file.  The time the compiler takes to process these header files
20188 over and over again can account for nearly all of the time required to
20189 build the project.  To make builds faster, GCC allows you to
20190 @dfn{precompile} a header file.
20192 To create a precompiled header file, simply compile it as you would any
20193 other file, if necessary using the @option{-x} option to make the driver
20194 treat it as a C or C++ header file.  You may want to use a
20195 tool like @command{make} to keep the precompiled header up-to-date when
20196 the headers it contains change.
20198 A precompiled header file is searched for when @code{#include} is
20199 seen in the compilation.  As it searches for the included file
20200 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
20201 compiler looks for a precompiled header in each directory just before it
20202 looks for the include file in that directory.  The name searched for is
20203 the name specified in the @code{#include} with @samp{.gch} appended.  If
20204 the precompiled header file can't be used, it is ignored.
20206 For instance, if you have @code{#include "all.h"}, and you have
20207 @file{all.h.gch} in the same directory as @file{all.h}, then the
20208 precompiled header file is used if possible, and the original
20209 header is used otherwise.
20211 Alternatively, you might decide to put the precompiled header file in a
20212 directory and use @option{-I} to ensure that directory is searched
20213 before (or instead of) the directory containing the original header.
20214 Then, if you want to check that the precompiled header file is always
20215 used, you can put a file of the same name as the original header in this
20216 directory containing an @code{#error} command.
20218 This also works with @option{-include}.  So yet another way to use
20219 precompiled headers, good for projects not designed with precompiled
20220 header files in mind, is to simply take most of the header files used by
20221 a project, include them from another header file, precompile that header
20222 file, and @option{-include} the precompiled header.  If the header files
20223 have guards against multiple inclusion, they are skipped because
20224 they've already been included (in the precompiled header).
20226 If you need to precompile the same header file for different
20227 languages, targets, or compiler options, you can instead make a
20228 @emph{directory} named like @file{all.h.gch}, and put each precompiled
20229 header in the directory, perhaps using @option{-o}.  It doesn't matter
20230 what you call the files in the directory; every precompiled header in
20231 the directory is considered.  The first precompiled header
20232 encountered in the directory that is valid for this compilation is
20233 used; they're searched in no particular order.
20235 There are many other possibilities, limited only by your imagination,
20236 good sense, and the constraints of your build system.
20238 A precompiled header file can be used only when these conditions apply:
20240 @itemize
20241 @item
20242 Only one precompiled header can be used in a particular compilation.
20244 @item
20245 A precompiled header can't be used once the first C token is seen.  You
20246 can have preprocessor directives before a precompiled header; you cannot
20247 include a precompiled header from inside another header.
20249 @item
20250 The precompiled header file must be produced for the same language as
20251 the current compilation.  You can't use a C precompiled header for a C++
20252 compilation.
20254 @item
20255 The precompiled header file must have been produced by the same compiler
20256 binary as the current compilation is using.
20258 @item
20259 Any macros defined before the precompiled header is included must
20260 either be defined in the same way as when the precompiled header was
20261 generated, or must not affect the precompiled header, which usually
20262 means that they don't appear in the precompiled header at all.
20264 The @option{-D} option is one way to define a macro before a
20265 precompiled header is included; using a @code{#define} can also do it.
20266 There are also some options that define macros implicitly, like
20267 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
20268 defined this way.
20270 @item If debugging information is output when using the precompiled
20271 header, using @option{-g} or similar, the same kind of debugging information
20272 must have been output when building the precompiled header.  However,
20273 a precompiled header built using @option{-g} can be used in a compilation
20274 when no debugging information is being output.
20276 @item The same @option{-m} options must generally be used when building
20277 and using the precompiled header.  @xref{Submodel Options},
20278 for any cases where this rule is relaxed.
20280 @item Each of the following options must be the same when building and using
20281 the precompiled header:
20283 @gccoptlist{-fexceptions}
20285 @item
20286 Some other command-line options starting with @option{-f},
20287 @option{-p}, or @option{-O} must be defined in the same way as when
20288 the precompiled header was generated.  At present, it's not clear
20289 which options are safe to change and which are not; the safest choice
20290 is to use exactly the same options when generating and using the
20291 precompiled header.  The following are known to be safe:
20293 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
20294 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
20295 -fsched-verbose=@var{number}  -fschedule-insns  -fvisibility= @gol
20296 -pedantic-errors}
20298 @end itemize
20300 For all of these except the last, the compiler automatically
20301 ignores the precompiled header if the conditions aren't met.  If you
20302 find an option combination that doesn't work and doesn't cause the
20303 precompiled header to be ignored, please consider filing a bug report,
20304 see @ref{Bugs}.
20306 If you do use differing options when generating and using the
20307 precompiled header, the actual behavior is a mixture of the
20308 behavior for the options.  For instance, if you use @option{-g} to
20309 generate the precompiled header but not when using it, you may or may
20310 not get debugging information for routines in the precompiled header.